Data query method, device, apparatus, and storage medium
By introducing a tag management service into the monitoring system, which provides optional tag identifiers and values, the problem of high query difficulty and low efficiency caused by users needing to learn the Prometheus language is solved, thus simplifying operations and improving query efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
- Filing Date
- 2023-03-01
- Publication Date
- 2026-04-28
AI Technical Summary
In monitoring systems, users need to learn the Prometheus language to write query statements, which makes data querying difficult and inefficient.
Add a tag management service to the monitoring system, providing optional tag identifiers and tag values, allowing users to query data through these options.
It reduces the difficulty of data retrieval, simplifies the operation process, and improves the efficiency of data retrieval.
Smart Images

Figure CN116303571B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data monitoring technology, and in particular to a data query method, apparatus, device, and storage medium. Background Technology
[0002] Currently, monitoring systems typically monitor two types of data: machine monitoring metrics (machine monitoring data) and business scenario monitoring metrics (business scenario monitoring data). Machine monitoring metrics may be tagged with items such as business, team, data center, cluster, and server; with the introduction of cloud computing, this may increase the number of nodes and devices. Business scenario monitoring metrics may be tagged with items such as A / B tests, user type, user gender, user age, user level, location, distance between users, and other indexers (item attributes). Generally, business scenario monitoring metrics have more tags, more tag combinations, and change tags more frequently than machine monitoring metrics. Machine monitoring metric queries tend to focus on single metrics, such as querying the CPU utilization of a server, which may only require retrieving data for a single metric. In contrast, business scenario monitoring metric queries often involve high-dimensional metrics; for example, querying the request volume for a user's gender requires a large aggregation of raw monitoring metric data.
[0003] Based on the monitoring characteristics of the aforementioned business scenarios, users need to understand the names of all reported monitoring metrics and tag key-value pairs, and learn the Prometheus language to write appropriate query statements when performing monitoring data queries on monitoring systems (such as Prometheus). Prometheus provides a functional query language called PromQL (Prometheus Query Language), which allows users to select and aggregate time-series data in real time. The results of the monitoring data query expressions can be displayed graphically or as tabular data in the Prometheus expression browser.
[0004] However, for users, learning to write query statements using the Prometheus language not only requires them to understand the names of all business scenarios and the composition of tags, but also requires them to spend a lot of time learning the Prometheus language. This makes data querying based on the monitoring system difficult, cumbersome, and inefficient. Summary of the Invention
[0005] This application provides a data query method, apparatus, device, and storage medium. By adding a tag management service to the monitoring system, it provides users with optional tag identifiers and tag values, enabling users to perform data query operations using the optional tag identifiers and tag values. This reduces the difficulty of data query, simplifies data query operations, and improves data query efficiency.
[0006] Firstly, this application provides a data query method, executed by the querying device, comprising:
[0007] In response to the received data query request, an available tag query list is obtained from the tag management service device. The available tag query list includes: available tag identifiers and available tag values corresponding to the available tag identifiers.
[0008] In response to the selection operation of a target available tag identifier and the target available tag value corresponding to the target available tag identifier, a list of available indicator identifiers is obtained from the tag management service device;
[0009] In response to the selection operation of any target indicator identifier, the target monitoring data is queried based on the target indicator identifier, the target available tag identifier, and the target available tag value;
[0010] Display the target monitoring data.
[0011] Secondly, this application provides a data query method, executed by a tag management service device, including:
[0012] Acquire and store monitoring data collected by the acquisition component, wherein the monitoring data includes monitoring indicator identifiers and tags;
[0013] Parse the monitoring data to obtain the monitoring indicator identifiers and tags of the monitoring data;
[0014] An index is established based on the monitoring indicator identifiers and the tags;
[0015] A data query list is generated based on the monitoring indicator identifier, the tag, and the index. The data query list includes an available tag query list and an invisible index query list, so that the querying device can perform data queries based on the available tag query list.
[0016] Thirdly, embodiments of this application provide a data query device, configured on the querying device, including:
[0017] The tag list acquisition module is used to obtain an available tag query list from the tag management service device in response to the acquired data query request. The available tag query list includes: available tag identifiers and available tag values corresponding to the available tag identifiers.
[0018] The indicator list acquisition module is used to acquire a list of available indicator identifiers from the label management service device in response to the selection operation of the target available label identifier and the target available label value corresponding to the target available label identifier;
[0019] The data query module is used to query target monitoring data in response to the selection operation of any target indicator identifier, based on the target indicator identifier, the target available tag identifier, and the target available tag value;
[0020] The data display module is used to display the target monitoring data.
[0021] Fourthly, embodiments of this application provide a data query device configured in a tag management service device, including:
[0022] The data acquisition module is used to acquire and store the monitoring data collected by the acquisition component, wherein the monitoring data includes monitoring indicator identifiers and tags;
[0023] The data parsing module is used to parse the monitoring data to obtain the monitoring indicator identifiers and tags of the monitoring data;
[0024] A module is established to create an index based on the monitoring indicator identifier and the tag;
[0025] The generation module is used to generate a data query list based on the monitoring indicator identifier, the tag, and the index, wherein the data query list includes an available tag query list and an invisible index query list, so that the querying device can perform data query based on the available tag query list.
[0026] Fifthly, embodiments of this application provide an electronic device, including:
[0027] A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to perform a data query method as described in the first aspect embodiment, or to perform a data query method as described in the second aspect embodiment.
[0028] In a sixth aspect, embodiments of this application provide a computer-readable storage medium for storing a computer program that causes a computer to perform the data query method as described in the first aspect embodiment, or to perform the data query method as described in the second aspect embodiment.
[0029] In a seventh aspect, embodiments of this application provide a computer program product containing program instructions that, when executed on an electronic device, cause the electronic device to perform the data query method as described in the first aspect embodiment, or to perform the data query method as described in the second aspect embodiment.
[0030] The technical solutions disclosed in the embodiments of this application have at least the following beneficial effects:
[0031] In response to a received data query request, the system retrieves a list of available tags from the tag management service device. In response to a selection operation on a target available tag identifier and its corresponding target available tag value, the system retrieves a list of available indicator identifiers from the tag management service device. In response to a selection operation on any target indicator identifier, the system queries the target monitoring data based on the target indicator identifier, the target available tag identifier, and the target available tag value, and then displays the target monitoring data. This application adds a tag management service to the monitoring system to provide users with optional tag identifiers and tag values, enabling users to perform data query operations using these options. This reduces the difficulty of data querying, simplifies data query operations, and improves data query efficiency. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a flowchart illustrating the first data query method provided in the embodiments of this application;
[0034] Figure 2 This is a line graph showing the percentage of CPU 1 utilization of a certain server within one hour, provided in an embodiment of this application.
[0035] Figure 3 This is a signaling interaction diagram of the entire embodiment of this application;
[0036] Figure 4 This is a flowchart illustrating the second data query method provided in the embodiments of this application;
[0037] Figure 5 This is a flowchart illustrating the third data query method provided in the embodiments of this application;
[0038] Figure 6This is a schematic diagram of the trigger calculation relationship setting control or interface of the monitoring system provided in the embodiments of this application;
[0039] Figure 7 This is a schematic diagram of the command interface for setting the calculation relationship of the monitoring system provided in this application embodiment;
[0040] Figure 8 This is yet another overall signaling interaction diagram of an embodiment of this application;
[0041] Figure 9 This is a flowchart illustrating the fourth data query method provided in the embodiments of this application;
[0042] Figure 10 This is a schematic diagram of the architecture of a data monitoring system provided in an embodiment of this application;
[0043] Figure 11 This is a flowchart illustrating the fifth data query method provided in the embodiments of this application;
[0044] Figure 12 This is a schematic diagram of a data query list provided in an embodiment of this application;
[0045] Figure 13 This is a flowchart illustrating the sixth data query method provided in the embodiments of this application;
[0046] Figure 14 This is a schematic diagram of the architecture of a monitoring system provided in an embodiment of this application;
[0047] Figure 15 This is a schematic block diagram of a data query device provided in an embodiment of this application;
[0048] Figure 16 This is a schematic block diagram of another data query device provided in the embodiments of this application;
[0049] Figure 17 This is a schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0051] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0052] In this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or solution described as "exemplary" or "for example" in this application should not be construed as being better or more advantageous than other embodiments or solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0053] This application addresses the challenges of querying monitoring data in business scenarios. Currently, users must write query statements to perform data queries on monitoring systems (such as Prometheus). This process requires users to understand the names and labels of all business scenarios' metrics and involves significant time learning the Prometheus language, making data querying on monitoring systems difficult, cumbersome, and inefficient. This application proposes a novel data query scheme to reduce the difficulty of data querying, simplify the query process, and improve data query efficiency.
[0054] The following description, using the querying device as the executing entity, illustrates a data query method provided in this application embodiment.
[0055] It should be noted that the querying device in this application can be any electronic device that supports data query operations by the user. That is, the electronic device is the device used by the querying party (any user with data query needs). For example, the electronic device can be, but is not limited to: tablet computers, mobile phones (such as foldable screen phones, large screen phones, etc.), wearable devices, in-vehicle devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc., and this application does not impose specific limitations in this regard.
[0056] Figure 1 This is a flowchart illustrating the first data query method provided in this application embodiment. The data query method provided in this application embodiment can be executed by a data query device. The data query device can consist of hardware and / or software and can be integrated into an electronic device.
[0057] like Figure 1 As shown, the method may include the following steps:
[0058] S101, in response to the obtained data query request, obtain the available tag query list from the tag management service device. The available tag query list includes: available tag identifiers and available tag values corresponding to the available tag identifiers.
[0059] Typically, users of monitoring systems may have a need to query monitoring data (monitoring metrics) at any time. Users can be any technical or managerial personnel with data query needs; no specific restrictions are placed here. Furthermore, the monitoring data in this application is preferably monitoring data specific to a business scenario. For example, if the business scenario is a life services scenario, then the monitoring data will be monitoring data specific to that life services scenario, and so on.
[0060] Optionally, when a user needs to query monitoring data, they can first log in to the monitoring system using an electronic device (the querying device) and open the system's interactive interface. Then, they can trigger the data query function or interface in the interactive interface using a mouse or stylus to send a data query request to the electronic device.
[0061] An interactive interface (UI) is an input / output display interface on an electronic device. This interface establishes an organic relationship between the electronic device and the user, allowing the user to express their goals to the electronic device. The UI is divided into input and output: input represents the user telling the electronic device their needs, and output represents the electronic device conveying the results to the user.
[0062] In addition, the data query interface can be any interactive entry point that supports data query functions.
[0063] When a user-sent data query request is detected, the electronic device sends a request to the tag management service device to retrieve the available tag query list via the Application Programming Interface Server (API Server). The tag management service device then returns a list of available tags to the electronic device based on this request. In this application, the API Server encapsulates query logic to implement the data query function.
[0064] The tag management service device sends an available tag query list to the electronic device. The specific implementation process is as follows: First, upon receiving a request from the electronic device to retrieve the available tag query list, the device obtains all available tag identifiers and the corresponding available tag values from the tags it manages. Then, it generates an available tag query list based on all available tag identifiers and their corresponding available tag values. Finally, it sends the generated available tag query list to the electronic device. In this application, an available tag identifier should be understood as a tag identifier that can be triggered and used by a user, and the corresponding available tag value should also be understood as a tag value that can be triggered and used by a user.
[0065] Furthermore, when an electronic device receives a list of available tags from a tag management service device, it can display the list on the interactive interface, allowing the user to perform data queries based on the displayed list of available tags.
[0066] In this embodiment, the tag management service device can be a hardware device that manages the monitoring data collected by the monitoring data collection component (Collector or Agent) in the monitoring system according to the structure of tag identifiers and tag values. For example, a tag management server. Of course, in this application, the tag management service device can also be a functional module or electronic device in the monitoring system that manages the monitoring data collected by the monitoring data collection component according to the structure of tag identifiers and tag values, etc., and this application does not impose specific limitations on this. For example, the tag management service device can be an open-source search engine, such as a Lucene-based search server (Elasticsearch).
[0067] Among them, the tag (or label) is data that the monitoring data collection component in the monitoring system carries when reporting monitoring data to describe other attributes of the monitoring data.
[0068] In this application, a tag includes a tag identifier and a tag value. The tag identifier can be understood as information that identifies the tag, such as the tag name. The tag value can be understood as an attribute of the tag, used to represent the specific tag content.
[0069] For example, suppose the monitoring data reported by a server is as follows:
[0070] (metric: cpu.busy; value: 67.3; tags: cpu=0, host=web0);
[0071] Therefore, the tag `host=web0` indicates that the current server name is web0, and the tag `cpu=0` indicates that CPU 0 of the current server is being monitored. This monitoring data shows that CPU 0 of the web0 server currently has a utilization rate of 67.3%.
[0072] It should be understood that the monitoring system in this application can be any system with data monitoring and management functions, such as Prometheus, Nightingale, Openfalcon, etc.
[0073] S102, in response to the selection operation of the target available tag identifier and the target available tag value corresponding to the target available tag identifier, obtain the list of available indicator identifiers from the tag management service device.
[0074] In this application, the available indicator identifier can be understood as any information that can uniquely identify the available indicator, such as the available indicator name or available indicator number, etc.
[0075] In some implementations, after the electronic device displays the available tag query list on the interactive interface, the user can select the available tag identifier to be queried and the available tag value corresponding to that available tag identifier from the available tag query list, thereby achieving the selection operation of the target available tag identifier and the target available tag value.
[0076] When a user selects a target available tag identifier and its value, the electronic device can generate a request to retrieve the available metric identifier list, using the target available tag identifier and its value as parameters. Then, the API Server sends this request to the tag management service device, which retrieves the available metric identifier list based on the target available tag identifier and its value carried in the request, and returns the list to the electronic device.
[0077] In this application, upon receiving a request to retrieve the list of available indicator identifiers, the tag management service device first parses the request to obtain the parameters carried in the request (target available tag identifier and target available tag value). Secondly, based on the target available tag identifier and target available tag value, it retrieves all original monitoring indicators, including the target available tag identifier and target available tag value, from all the original monitoring indicators it manages. Then, it retrieves all available indicator identifiers from the original monitoring indicators and obtains a list of available indicator identifiers based on all the retrieved available indicator identifiers. Simultaneously, it can also summarize other available tag identifiers and their corresponding available tag values from the original monitoring indicators, and update the available tag query list based on these other available tag identifiers and their corresponding available tag values to obtain a new available tag query list. Then, it feeds back the list of available indicator identifiers and the new available tag query list to the electronic device, enabling the electronic device to respond to the user's operation based on the received list of available indicator identifiers and the new available tag query list. Here, "other available tag identifiers" refers to new tag identifiers that are different from the available tag identifiers in the available tag query list.
[0078] It's important to note that monitoring counters typically consist of a metric identifier (e.g., metric name) and a series of tags. The monitoring data values are a sequence of time points and values collected at fixed time periods. For example, assuming the monitoring data is (metric: cpu.busy; value: 67.3; tags: cpu=0, host=web0), then the monitoring metric would be (metric: cpu.busy; tags: cpu=0, host=web0), and the monitoring data values might be (time=2023-01-05 00:00:00; value=67.3), (time=2023-01-05 00:01:00; value=66.7), and so on.
[0079] In this context, the metric identifier can be understood as the identifier used to represent the meaning of the value when reporting monitoring data. For example, if a server reports monitoring data (metric: cpu.busy; value: 67.3), the value: 67.3 indicates that the value is 67.3, while the metric: cpu.busy indicates that the value is the current CPU utilization of the server.
[0080] Furthermore, upon receiving the list of available indicator identifiers and the new list of available tag queries from the tag management service device, the electronic device can display both the list of available indicator identifiers and the new list of available tag queries on the interactive interface, allowing the user to perform data query operations based on the displayed list of available indicator identifiers or the new list of available tag queries.
[0081] S103, in response to the selection operation of any target indicator identifier, queries the target monitoring data based on the target indicator identifier, the target available label identifier, and the target available label value.
[0082] Optionally, when it is detected that a user has selected any available metric identifier in the list of available metric identifiers, this application may use the selected available metric identifier as the target metric identifier. Then, based on the target metric identifier, the target available tag identifier, and the target available tag value corresponding to the target available tag identifier, the target monitoring data is obtained in the monitoring system.
[0083] Optionally, the acquisition of target monitoring data in the monitoring system by this application may include, but is not limited to, the following:
[0084] Scenario 1
[0085] Based on the target indicator identifier, the target available label identifier, and the target available label value corresponding to the target available label identifier, the target monitoring data is retrieved from the database (monitoring database) that stores all monitoring data.
[0086] Considering that the monitoring database stores all monitoring data, this application can search for the corresponding target monitoring data in the monitoring database based on the target indicator identifier, target available label identifier, and target available label value selected by the user.
[0087] In some feasible methods, when retrieving target monitoring data from the monitoring database, one can first search the monitoring database for all monitoring data including the target indicator identifier based on the target indicator identifier; then, one can filter candidate monitoring data from all monitoring data, including the target available label identifier and the target available label value.
[0088] Given that the monitoring data is time-series data and the volume of data can be substantial, conducting business analysis based on this data is challenging, and it's difficult to uncover patterns and trends within the data results. Therefore, this application, after obtaining candidate monitoring data, can aggregate and summarize the candidate monitoring data according to time series, combining multiple candidate monitoring data points from the same time period into a single monitoring data point to obtain the target monitoring data. This reduces the amount of target monitoring data obtained, making it easier for users to view the acquired target monitoring data and thus enabling better data monitoring.
[0089] It should be understood that a time series is a series of data points arranged in chronological order. Time series data is a historical imprint and has the characteristics of immutability, uniqueness, and temporal order.
[0090] Accordingly, the monitoring database storing monitoring data in this application can be selected as a database specifically designed for storing time series data and optimized for the patterns of time series data, also known as a time series database. For example, the time series database can be, but is not limited to: Open Time Series Database (OpenTSDB), InfluxDB, M3DB, VictoriaMetrics, etc.
[0091] Scenario 2
[0092] Based on the target indicator identifier, the target available tag identifier, and the target available tag value corresponding to the target available tag identifier, the original monitoring indicators, including the target indicator identifier, the target available tag identifier, and the target available tag value, are obtained from the tag management service device. Then, target monitoring data is retrieved from the monitoring database based on the original monitoring indicators.
[0093] Considering that the tag management service device can receive monitoring data collected by the monitoring data collection component, and that the monitoring data may include monitoring indicators and monitoring indicator values, and that the tag management service device can decompose and process the monitoring data into a structure of tag identifiers and tag values, this application can first obtain the original monitoring indicators in the tag management service device based on the target indicator identifier, the target available tag identifier, and the target available tag value. Then, based on the original monitoring indicators, candidate monitoring data corresponding to the original monitoring indicators is obtained from the monitoring database.
[0094] Furthermore, after obtaining candidate monitoring data, this application can aggregate and summarize the candidate monitoring data according to the time series, so as to aggregate multiple candidate monitoring data at the same time into one monitoring data to obtain the target monitoring data. This can reduce the number of target monitoring data obtained, make it easier for users to view the obtained target monitoring data, and thus better monitor the data.
[0095] S104 displays target monitoring data.
[0096] After obtaining the target monitoring data, this application can display the target monitoring data on the interactive interface so that users can view and analyze the target monitoring data.
[0097] In this application, target monitoring data can be displayed in various formats. Examples include, but are not limited to, pie charts, line charts, scale line charts, scatter plots, bar charts, and network tables.
[0098] For example, let's take a scaled line chart as an example to illustrate the display format of target monitoring data. Specifically... Figure 2 As shown, Figure 2 This refers to the utilization rate of CPU #1 on a certain server within one hour. For example... Figure 2 As shown, the CPU utilization rate changes significantly within one hour.
[0099] Figure 3 This is an overall signaling interaction diagram of an embodiment of this application, used to... Figure 3 The overall data query process of the embodiments of this application can be clearly understood.
[0100] This application provides a data query method that, in response to a received data query request, retrieves a list of available tags from a tag management service device. In response to a selection operation of a target available tag identifier and its corresponding target available tag value, it retrieves a list of available indicator identifiers from the tag management service device. In response to a selection operation of any target indicator identifier, it queries target monitoring data based on the target indicator identifier, target available tag identifier, and target available tag value, and then displays the target monitoring data. This application adds a tag management service to the monitoring system to provide users with optional tag identifiers and tag values, enabling users to perform data query operations using these options. This reduces the difficulty of data querying, simplifies data query operations, and improves data query efficiency.
[0101] In another implementation scenario of this application, considering that the monitoring database contains a large amount of monitoring data, retrieving the target monitoring data from the database would cause the entire data query response to take a significant amount of time, resulting in slow response speed. Therefore, this application adds a caching module to the monitoring system to cache the monitoring data, allowing users to query the cached data and thus improving the query speed. The following section will combine... Figure 4 This application provides a detailed explanation of the process of adding a caching module to the monitoring system and improving the speed of monitoring data retrieval based on the caching module.
[0102] like Figure 4 As shown, the method may include the following steps:
[0103] S201, in response to the received data query request, obtain the available tag query list from the tag management service device. The available tag query list includes: available tag identifiers and tag values corresponding to the available tag identifiers.
[0104] S202, in response to the selection operation of the target available tag identifier and the target available tag value corresponding to the target available tag identifier, obtain the list of available indicator identifiers from the tag management service device.
[0105] S203, in response to the selection operation of any target indicator identifier, obtain at least one target original monitoring indicator from the tag management service device based on the target indicator identifier, the target available tag identifier, and the target available tag value.
[0106] Considering that the tag management service device can manage and update the monitoring data collected by the monitoring data collection component, when a user selects any available indicator from the list of available indicator identifiers, it indicates that the user needs to query monitoring data based on the selected available indicator identifier. Therefore, this application can use the selected available indicator identifier as the target indicator identifier. Then, a raw monitoring indicator retrieval request is generated, carrying the target indicator identifier, the target available tag identifier, and the target available tag value in the raw monitoring indicator retrieval request. This raw monitoring indicator retrieval request is sent to the tag management service device via the API Server, so that the tag management service device can retrieve at least one corresponding target raw monitoring indicator based on the raw monitoring indicator retrieval request.
[0107] When the tag management service device obtains at least one target raw monitoring indicator, it can parse the raw monitoring indicator acquisition request to obtain the target indicator identifier, the target available tag identifier, and the target available tag value. Then, based on the target indicator identifier, the target available tag identifier, and the target available tag value, it can obtain all target raw monitoring indicators including the above three parameters from all the monitoring data it manages.
[0108] S204. Obtain target monitoring data based on the target's original monitoring indicators.
[0109] Typically, there are two types of queries in a monitoring system: the first is a query with fixed tags, and the second is a query with random tags.
[0110] The first type, fixed-label query, refers to the fact that the labels corresponding to the monitoring indicators (monitoring data) do not change or change very little each time they are queried, such as abnormal alarms and monitoring dashboards set by users.
[0111] Considering that the monitoring metrics set by users for abnormal alarms are fixed and will not change with each query, the monitoring metrics of abnormal alarms can be aggregated and written into the monitoring database (such as TSDB) in real time, thereby reducing the number of original monitoring metrics queried and improving query speed.
[0112] Furthermore, the monitoring dashboard includes some indicator identifiers (indicator names) and some user-selected tags. Therefore, the number of indicator names and tags retrieved is significantly reduced compared to the original monitoring indicators. Thus, aggregating new monitoring indicators in real time based on the indicator names and tags included in the monitoring dashboard can reduce the number of original monitoring indicators retrieved, thereby improving query speed.
[0113] It should be understood that the labels of the aggregated monitoring metrics are a subset of the labels of the original monitoring metrics.
[0114] Furthermore, to distinguish between monitoring metrics and original monitoring metrics, a fixed label (e.g., attribute = aggregator) is added to the aggregated monitoring metrics. When the label management service device performs data query operations in the monitoring data it manages, if it finds this specific label, it can be processed separately from the original monitoring metrics.
[0115] The second type, random tag query, refers to the fact that the tags corresponding to the monitoring indicators in each query are not fixed, and any tag may be selected, such as when users view monitoring or search for and analyze anomalies.
[0116] Considering that queries with random tags cannot aggregate new monitoring metrics based on fixed tags, caching is needed to improve query speed. Therefore, to improve the speed of acquiring target monitoring data, this application adds a caching module for caching monitoring data in parallel on top of the monitoring database. In this application, the caching module includes a first-level caching module and a second-level caching module.
[0117] Considering that users may query monitoring data at different times, resulting in historical query data, the first-level cache module in this application is primarily used to store the original monitoring metrics from historical accesses within the first time period, as well as the aggregated monitoring data corresponding to these metrics. The second-level cache module is primarily used to store the original monitoring metrics from historical accesses within the second time period, as well as the original monitoring data corresponding to these metrics.
[0118] Furthermore, both the first-level cache module and the second-level cache module use the operating system-level page replacement algorithm (Least Recently Used algorithm, or LRU algorithm for short) to retain historically accessed data.
[0119] In addition, to further accelerate data retrieval, data can be forwarded from the monitoring forwarding component (Transfer) to the first-level cache module and / or the second-level cache module, while updating the latest data of the monitoring metrics that need to be cached.
[0120] It should be understood that the first and second time periods mentioned above can be flexibly set according to the data query needs of the monitoring system. Furthermore, the first and second time periods can be the same or different; no specific restrictions are placed here.
[0121] For example, the first time period can be one week, 15 days, or one month; the second time period can be two weeks, 45 days, or two months, and so on.
[0122] Therefore, after obtaining the target's original monitoring metrics from the tag management service device, this application can obtain target monitoring data from the cache module and / or monitoring database based on the target's original monitoring metrics.
[0123] As an optional implementation, this application obtains target monitoring data from a cache module and / or a monitoring database based on the target's original monitoring metrics, and optionally includes the following steps:
[0124] Step 1001: The electronic device sends a target monitoring data query request to the first-level cache module using the API Server in order to obtain the target monitoring data from the first-level cache module.
[0125] The target monitoring data query request can carry the target's original monitoring metrics, allowing the first-level cache module to parse the request and obtain these metrics. Then, the first-level cache module searches its stored historical monitoring data for the original target monitoring metrics.
[0126] Optionally, if the original target monitoring metric is found, it indicates that the target monitoring data exists in the first-level cache module. Then, the aggregated monitoring data corresponding to the original target monitoring metric in the first-level cache module is used as the target monitoring data, thus obtaining the target monitoring data.
[0127] If the original target monitoring metric is not found, it means that the target monitoring data does not exist in the first-level cache module. In this case, step 1002 is executed to obtain the target monitoring data from the second-level cache module or the database.
[0128] Step 1002: When no target monitoring data is obtained from the first-level cache module, query whether the tag management service device has an aggregated monitoring indicator corresponding to the original target monitoring indicator. If it exists, proceed to step 1003; otherwise, proceed to step 1004.
[0129] Step 1003: If aggregated monitoring metrics exist, retrieve the target monitoring data from the monitoring database based on the aggregated monitoring metrics.
[0130] Considering that the tag management service device receives real-time monitoring data uploaded by the data collection component and updates its own managed monitoring data in real time based on the received monitoring data, this application, when determining that there is no target monitoring data in the first-level cache module, can perform a data query operation in the tag management service device based on the target original monitoring indicators to determine whether the tag management service device has an aggregated monitoring indicator corresponding to the target original monitoring indicators.
[0131] Specifically, to determine whether the tag management service device has an aggregated monitoring indicator corresponding to the target's original monitoring indicator, the tag management server can be queried to see if a matching aggregated monitoring indicator exists, based on the target indicator identifier, the target available tag identifier, and the target available tag value.
[0132] In some feasible implementations, if an aggregated monitoring indicator corresponding to the original target monitoring indicator is found in the tag management service device, the corresponding target monitoring data is obtained from the monitoring database based on the aggregated monitoring indicator.
[0133] Furthermore, after obtaining the target monitoring data from the monitoring database, this application may optionally update the first-level cache module with the queried target monitoring data so that the first-level cache module stores the most recently accessed original monitoring metric and the aggregated monitoring data corresponding to the original monitoring metric, thereby providing conditions for the next monitoring query operation.
[0134] It's important to note that the monitoring system includes an aggregation service. This service loads user-configured monitoring information such as anomaly alerts and dashboard data. When the aggregation service receives monitoring data uploaded by the monitoring data collection component, it aggregates the received data based on the user-configured anomaly alerts and dashboard information to generate new monitoring data, which is then written to the monitoring database. Because the aggregated monitoring data has fewer tags than the original data, the number of metrics actually queried is reduced, thus decreasing the number of original monitoring metrics and improving query speed.
[0135] Step 1004: If no aggregated monitoring indicator exists, obtain the list of original monitoring indicators corresponding to the target original monitoring indicator from the tag management service device, and obtain the target monitoring data based on the list of original monitoring indicators.
[0136] In this application, if no aggregated monitoring indicator is found in the tag management service device based on the target original monitoring indicator, then the tag management service device is queried for the original monitoring indicator corresponding to each target original monitoring indicator to obtain a list of original monitoring indicators. Specifically, the tag management server can be queried for the existence of all matching original monitoring indicators based on the target indicator identifier, the target available tag identifier, and the target available tag value to obtain a list of original monitoring indicators.
[0137] Then, based on the obtained list of original monitoring indicators, the target monitoring data is obtained from the secondary cache module. For the specific implementation process, please refer to steps 1005 to 1007 below.
[0138] Step 1005: Based on the original monitoring indicator list, obtain the monitoring data corresponding to each original monitoring indicator in the second-level cache module.
[0139] Step 1006: If the monitoring data corresponding to each original monitoring indicator is obtained, then all the obtained monitoring data are summarized according to the time series to obtain the target monitoring data.
[0140] After obtaining the target monitoring data, this application also updates the first-level cache module based on the target monitoring data, so that the first-level cache module stores the most recent historical access original monitoring indicators and the aggregated monitoring data corresponding to the original monitoring indicators, thereby providing favorable conditions for subsequent monitoring data queries.
[0141] Step 1007: If no monitoring data corresponding to any original monitoring indicator is obtained, then based on any original monitoring indicator, obtain the monitoring data corresponding to any original monitoring indicator from the monitoring database, and summarize all the obtained monitoring data according to the time series to obtain the target monitoring data.
[0142] In this context, "any" refers to one or more, and this application does not impose any specific restrictions on this.
[0143] Considering that in actual use, the secondary cache module may not store all original monitoring metrics and the corresponding monitoring data for each original monitoring metric, situations may arise where monitoring data for any original monitoring metric cannot be obtained. Therefore, this application can query the monitoring database for any original monitoring metric for which monitoring data has not been obtained, to retrieve the monitoring data for any original monitoring metric not obtained from the secondary cache module. Then, the monitoring data obtained from the secondary cache module and the monitoring data obtained from the monitoring database are aggregated and summarized to obtain the target monitoring data.
[0144] Furthermore, after obtaining the monitoring data corresponding to any original monitoring indicator from the monitoring database, this application can also update the second-level cache module based on the monitoring data corresponding to any original monitoring indicator, so that the updated second-level cache module can lay the foundation for subsequent monitoring data queries.
[0145] It should be noted that in steps 1001 to 1007 of this application, after the monitoring indicators in the first-level cache module or the second-level cache module are hit, there is no further request to the monitoring database to obtain data at the new time point. This is because the monitoring forwarding component (Transfer) forwards the monitoring data to the cache modules (first-level cache module and second-level cache module) and actively updates the cache in real time, thereby reducing the query operations on the monitoring database and improving the query speed of monitoring data.
[0146] S205 displays target monitoring data.
[0147] This application provides a data query method that, in response to a received data query request, retrieves a list of available tags from a tag management service device. In response to a selection operation of a target available tag identifier and its corresponding target available tag value, it retrieves a list of available indicator identifiers from the tag management service device. In response to a selection operation of any target indicator identifier, it queries target monitoring data based on the target indicator identifier, target available tag identifier, and target available tag value, and then displays the target monitoring data. This application adds a tag management service to the monitoring system to provide users with optional tag identifiers and tag values, enabling users to perform data query operations using these options. This reduces the difficulty of data querying, simplifies data query operations, and improves data query efficiency. Furthermore, this application adds a caching module to the monitoring system to cache monitoring data, allowing users to query monitoring data by querying the cached module, thereby improving the query speed of monitoring data.
[0148] In one optional implementation of this application, considering that users often have personalized query needs when querying monitoring data, i.e., they need to obtain monitoring data with a specific purpose or individualization, this application can also provide users with a calculation relationship setting function. This allows users to define personalized monitoring indicators that meet their own needs based on this function, thereby satisfying users' personalized query needs for monitoring data and simplifying the problem of monitoring data exploration. The following section will combine... Figure 5 The following is a detailed explanation of the above-described process for setting up calculation relationships in the embodiments of this application.
[0149] like Figure 5 As shown, the method may include the following steps:
[0150] S301, in response to the received calculation relationship setting instruction, displays the calculation relationship setting interface on the interactive interface. The calculation relationship setting interface includes: at least two available indicator identifiers, available label identifiers corresponding to the available indicator identifiers, and operators.
[0151] Considering that users may have different query needs when querying monitoring data, and that general data query methods cannot meet users' personalized query needs, this application adds a calculation relationship setting function to the existing functions provided by the monitoring system. This function allows users to set personalized monitoring indicators that meet their own needs, thereby obtaining personalized monitoring data based on the set personalized monitoring indicators.
[0152] In some implementations, when a user wants to query personalized monitoring data, they can log into the monitoring system via their electronic device and open the system's interactive interface. Through this interface, they can send calculation relationship setting commands to the electronic device. The interactive interface includes calculation relationship setting controls or interfaces. Furthermore, the user can trigger these controls or interfaces to send calculation relationship setting commands to the electronic device, for example... Figure 6 As shown.
[0153] When a user sends a command to set the calculation relationship, the calculation relationship setting interface is displayed on the interactive interface, allowing the user to customize the indicator calculation relationship by operating the calculation relationship setting interface.
[0154] As an optional implementation, the calculation relationship setting interface in this application can be in table format, for example... Figure 7 As shown. Among them, Figure 7 It includes available indicator identifiers, available label identifiers, and operator items.
[0155] Operators are code used to perform calculations on program code, and they perform operations on one or more available pointers. Common operators include arithmetic operators such as "*", "-", "+", " / ", and "%"; relational operators such as ">", "<", "=", ">=", "<=", and "!="; and logical operators such as "!", "&&", and "||". For example, in the operation 2+3, the available pointers are 2 and 3, and the operator is "+".
[0156] S302, in response to the selection of at least two target available indicator identifiers and target operators, generates and stores the indicator calculation relationship.
[0157] In this embodiment of the application, after the electronic device displays the calculation relationship setting interface on the interactive interface, the user can select available indicator icons and operators through the interactive interface.
[0158] When the electronic device detects that the user has selected an available indicator and operator, it can generate an indicator calculation relationship based on the selected available indicator and operator and save it to the indicator calculation relationship library.
[0159] In this application, the indicator calculation relational database can be a MySQL database.
[0160] Based on the above Figure 7 To further explain, suppose the calculation relationship settings interface includes: available indicator identifier A, available indicator identifier B, available indicator identifier C, the operator " / ", the operator "=", and the operator "+". Then, when the user first selects the target available indicator C, then the target operator "=", then the target available indicator A, then the target operator " / ", and finally the target available indicator B, the electronic device generates a custom indicator calculation relationship based on the order of the selected target available indicators and operators: C = A / B. This custom indicator calculation relationship is then displayed in the calculation relationship settings interface and simultaneously saved to the indicator calculation relationship library.
[0161] As another optional implementation of this application, considering that when users define custom indicator calculation relationships, they can also filter indicators of some tags to define the calculation relationships, this application can also generate custom indicator calculation relationships in response to user selection operations for at least one target available indicator identifier, the target available tag identifier corresponding to the target available indicator identifier, and the target operator, and then save the custom indicator calculation relationships.
[0162] Continue with Figure 7 To illustrate, suppose the calculation relationship settings interface includes: available indicator A, available indicator B, available indicator D, operators "=", "!=", " / ", and available label identifiers. Then, when the user selects the target available indicator D in the first step, selects the target operator "=" in the second step, enters parentheses in the third step, selects the target available label "metric" in the fourth step, selects the operator "=" in the fifth step, selects the target available indicator A in the sixth step, enters a comma in the seventh step, enters "code" in the eighth step, selects the target operator "!=" in the ninth step, enters 0 in the tenth step, selects the operator " / " in the eleventh step, and selects the target available indicator B in the twelfth step, the electronic device generates a custom indicator calculation relationship based on the order of the user's selected target available indicator, target available label, and target operator: D = (metric = A, code5 = 0) / B. This custom indicator calculation relationship is then displayed in the calculation relationship settings interface and simultaneously saved to the indicator calculation relationship library.
[0163] The above-mentioned settings for custom indicator calculation relationships are merely illustrative examples. Of course, in addition to the above-mentioned settings for custom indicator calculation relationships, users can also make flexible settings according to their own needs. No specific restrictions are imposed here.
[0164] S303, in response to the selection operation of any target monitoring indicator identifier and at least one available tag identifier corresponding to the target monitoring indicator identifier in the available tag query list, retrieve the target calculation relationship of the target monitoring indicator identifier and the available tag identifier corresponding to the target monitoring indicator identifier from the indicator calculation relationship database.
[0165] In this embodiment, any available tag identifier in the available tag query list can be selected as a monitoring indicator identifier. Therefore, after generating the indicator calculation relationship based on the calculation relationship setting interface, this application can output an available tag query list to the user, including the monitoring indicator identifier and at least one available tag identifier corresponding to the monitoring indicator identifier, according to the data query request triggered by the user. Furthermore, the user can select the custom monitoring indicator identifier (target monitoring indicator identifier) to be queried from the available tag query list, as well as the available tag identifier corresponding to the custom monitoring indicator identifier.
[0166] When the electronic device detects that a user has selected a target monitoring indicator identifier and at least one available tag identifier corresponding to the target monitoring indicator identifier from the available tag query list, the electronic device can obtain the target calculation relationship from the indicator calculation relationship database based on the target monitoring indicator identifier and the available tag identifier.
[0167] S304, based on the target calculation relationship, recursively search for the original monitoring indicator identifier corresponding to the target monitoring indicator identifier.
[0168] Optionally, after obtaining the target calculation relationship, this application can recursively search for all original monitoring indicator identifiers corresponding to the target monitoring indicator identifier based on the target calculation relationship.
[0169] For example, suppose the target monitoring metric is identified as monitoring metric D, and the target calculation relationship is D = (metric = A, code != 0) / B. Here, a specific tag is used to query the monitoring data of metric D (metric = D, tagk1 = tagv1). Furthermore, based on the target calculation relationship, all original monitoring metric identifiers corresponding to monitoring metric D can be found as A and B.
[0170] S305: Obtain the original monitoring indicators from the tag management service device based on the available tag identifiers corresponding to the original monitoring indicator identifiers and the target monitoring indicator identifiers.
[0171] In some implementation methods, when obtaining the original monitoring indicators, the available tag identifiers corresponding to the original monitoring indicator identifier and the target monitoring indicator identifier can be used as parameters to request the tag management service device. This allows the tag management service device to obtain the available value of the target monitoring indicator identifier on each available tag identifier from its managed monitoring data, based on the available tag identifiers corresponding to the original and target monitoring indicator identifiers. Furthermore, this application combines the target monitoring indicator identifier and the available values of each available tag identifier to form a new monitoring indicator, and requests the new monitoring indicator as a parameter from the tag management service device to obtain the original monitoring indicators corresponding to the new monitoring indicator from the tag management service device.
[0172] For example, suppose a user wants to view the data distribution of a monitoring metric (metric=A, tagk1=tagv1) on dimension tagk2. They can obtain the available values tagv21, tagv22, and tagv23 of the monitoring metric (metric=A, tagk1=tagv1) on dimension tagk2 from the tag management service device. Then, based on (metric=A, tagk1=tagv1) and tagv21, tagv22, and tagv23, a new monitoring metric is formed: (metric=A, tagk1=tagv1, tagk2=tagv21).
[0173] (metric = A, tagk1 = tagv1, tagk2 = tagv22), and,
[0174] (metric=A, tagk1=tagv1, tagk2=tagv23).
[0175] Then, based on the three new monitoring indicators mentioned above, the corresponding original monitoring indicators are obtained from the tag management service device.
[0176] Continuing with the example in step S304, when all the original monitoring metric identifiers of monitoring metric D are A and B, and the available tag identifier corresponding to monitoring metric D is tagk1 = tagv1, then the available values of monitoring metric A on tagk1 = tagv1 (metric = A, code != 0, tagk1 = tagv1) and monitoring metric B on tagk1 = tagv1 (metric = B, tagk1 = tagv1) can be obtained from the tag management service device. Since there is only one available value for the original monitoring metric identifier A on tagk1 = tagv1, and only one available value for monitoring metric B on tagk1 = tagv1, the corresponding original monitoring metrics can be directly obtained from the tag management service device based on (metric = A, code != 0, tagk1 = tagv1) and (metric = B, tagk1 = tagv1).
[0177] S306: Query and display target monitoring data based on the original monitoring indicators.
[0178] Let's continue with the first example from step S305:
[0179] After obtaining (metric=A, tagk1=tagv1, tagk2=tagv21);
[0180] (metric = A, tagk1 = tagv1, tagk2 = tagv22), and,
[0181] After obtaining the original monitoring metrics corresponding to the three new monitoring metrics (metric=A, tagk1=tagv1, tagk2=tagv23), the corresponding monitoring data can be retrieved from the cache module and / or the monitoring database using these three new monitoring metrics. Then, all the obtained monitoring data is summarized and displayed on the page.
[0182] Continuing with the second example in step S305, after obtaining the original monitoring metrics corresponding to (metric = A, code != 0, tagk1 = tagv1) and (metric = B, tagk1 = tagv1), the corresponding monitoring data can be retrieved from the cache module and / or the monitoring database based on the original monitoring metrics. Then, by dividing the data at the same time point, the new time series data obtained is the monitoring metric D, i.e., the data for (metric = D, tagk1 = tagv1). Finally, the retrieved monitoring data is displayed on the page.
[0183] When displaying target monitoring data on the page, it can be displayed in the form of a pie chart, a line chart with multiple values at time points on the X-axis, or a line chart showing the proportion of values in each dimension, etc. There are no specific restrictions on this.
[0184] Figure 8 This is an overall signaling interaction diagram of an embodiment of this application, used to... Figure 8 The overall data query process of the embodiments of this application can be clearly understood.
[0185] This application provides a data query method that, in response to a received data query request, retrieves a list of available tags from a tag management service device. In response to a selection operation of a target available tag identifier and its corresponding target available tag value, it retrieves a list of available indicator identifiers from the tag management service device. In response to a selection operation of any target indicator identifier, it queries target monitoring data based on the target indicator identifier, target available tag identifier, and target available tag value, and then displays the target monitoring data. This application adds a tag management service to the monitoring system, providing users with optional tag identifiers and tag values. This allows users to perform data query operations using these optional tag identifiers and tag values, thereby reducing the difficulty of data querying, simplifying data query operations, and improving data query efficiency. Furthermore, this application can also provide users with a calculation relationship setting function, enabling users to define personalized monitoring indicators based on this function to meet their own needs. This supports custom indicator queries of data distribution and change trends in any dimension, satisfying users' personalized query needs for monitoring data and reducing the difficulty of users exploring monitoring data.
[0186] Building upon the aforementioned embodiments, this application, in addition to obtaining the list of available indicator identifiers from the tag management service device, can also obtain an updated list of available tag queries. Therefore, users can select new target available tag identifiers and values based on the updated list of available tag queries, and obtain a new list of available indicator identifiers based on the selected new target available tag identifiers and values. This refines the user-queried monitoring data, providing conditions for obtaining more accurate monitoring data. The following section combines... Figure 9 The data query method provided in the embodiments of this application will be further explained and described.
[0187] like Figure 9 As shown, the method may include the following steps:
[0188] S401, in response to the received data query request, obtain the available tag query list from the tag management service device. The available tag query list includes: available tag identifiers and available tag values corresponding to the available tag identifiers.
[0189] S402, in response to the selection operation of the target available tag identifier and the target available tag value corresponding to the target available tag identifier, obtain a new available tag query list and available indicator identifier list from the tag management service device.
[0190] In some implementation methods, after displaying the available tag query list to the user, the user can select a target available tag identifier and a target available tag value from the list. When it is detected that the user has selected any available tag identifier and a target available tag value, the selected available tag identifier is used as the target available tag identifier, and the selected available tag value is used as the target tag value. Then, an update request for the available tag query list is generated based on the target available tag identifier and the available tag value, and this update request is sent to the tag management service device via the API Server. The tag management service device then updates the available tag query list based on the target available tag identifier and the target available tag value carried in the update request, simultaneously obtains the available indicator identifier list, and feeds back the updated available tag query list and available indicator identifier list to the electronic device.
[0191] The implementation principle of obtaining a new list of available tags and a list of available indicator identifiers from the tag management service device is the same as step S102 in the aforementioned embodiment. For the specific implementation process, please refer to the aforementioned step S102 section, which will not be elaborated on here.
[0192] S403, in response to the selection operation of any available tag value in the new available tag query list, using the new available tag query list as the available tag query list, re-obtain the new available tag query list and the new available indicator identifier list from the tag management service device, until the selection operation of any target indicator identifier in the new available indicator identifier list is obtained, so as to query the target monitoring data based on the target indicator identifier, the target available tag identifier, and the target available tag value.
[0193] Optionally, users of this application may perform data query operations on the displayed list of available indicator identifiers or the new list of available tag queries, including but not limited to the following situations:
[0194] Scenario 1
[0195] When a user selects any available tag value from the new available tag query list, this application sends a list retrieval request to the tag management service device to obtain the new available tag query list and the new available indicator identifier list, based on the target available tag value selected by the user and using the new available tag query list as the available tag query list.
[0196] After receiving a list retrieval request, the tag management service device parses the request to obtain the target available tag value and the corresponding target available tag identifier. Then, based on the target available tag identifier and target available tag value, it retrieves all original monitoring metrics under its management, including both the target available tag identifier and target available tag value. Next, it retrieves all available metric identifiers from the original monitoring metrics and obtains a new list of available metric identifiers. Simultaneously, it can also summarize other available tag identifiers and their corresponding available tag values from the original monitoring metrics, and update the available tag query list based on these other available tag identifiers and their corresponding available tag values, resulting in a new available tag query list. Finally, it feeds back the new list of available metric identifiers and the new available tag query list to the electronic device, enabling the electronic device to respond to the user's actions based on these two lists. Note that "other available tag identifiers" refers to new tag identifiers that differ from those in the available tag query list.
[0197] The electronic device displays the new list of available tags and the new list of available indicator labels fed back by the tag management service device on the interactive interface, allowing users to continue data query operations based on the new list of available tags and the new list of available indicator labels.
[0198] When it is detected that a user performs a selection operation on any available indicator in the new list of available indicator identifiers, this application determines the available indicator selected by the user as the target available indicator identifier, and then queries the target monitoring data based on the target available indicator identifier, the target available label identifier, and the target available label value.
[0199] The process of querying target monitoring data based on target available indicator identifier, target available tag identifier, and target available tag value is described in detail in the aforementioned embodiment S103 section, and will not be elaborated further here.
[0200] Scenario 2
[0201] When a user selects any available tag value in the new available tag query list, this application sends a list retrieval request to the tag management service device to obtain the new available indicator identifier list and the new available tag query list, based on the target available tag value selected by the user and using the new available tag query list as the available tag query list.
[0202] After receiving a list retrieval request, the tag management service device parses the request to obtain the target available tag value and the corresponding target available tag identifier. Then, based on the target available tag identifier and target available tag value, it retrieves all original monitoring metrics under its management, including both the target available tag identifier and target available tag value. Next, it retrieves all available metric identifiers from the original monitoring metrics and obtains a new list of available metric identifiers. Simultaneously, it can also summarize other available tag identifiers and their corresponding available tag values from the original monitoring metrics, and update the available tag query list based on these other available tag identifiers and their corresponding available tag values, resulting in a new available tag query list. Finally, it feeds back the new list of available metric identifiers and the new available tag query list to the electronic device, enabling the electronic device to respond to the user's actions based on these two lists. Note that "other available tag identifiers" refers to new tag identifiers that differ from those in the available tag query list.
[0203] The electronic device displays the new list of available tags and the new list of available indicator labels fed back by the tag management service device on the interactive interface, allowing users to continue data query operations based on the new list of available tags and the new list of available indicator labels.
[0204] When the electronic device detects that a user has selected any target available tag value in the new available tag query list, it uses this new available tag query list as its own and continues to retrieve new available tag query lists and new available indicator lists from the tag management service device. These new available tag query lists and new available indicator lists are then displayed on the interactive interface, allowing the user to continue data query operations based on these new lists.
[0205] Repeat the above operation until it is detected that the user performs the selection operation of any available indicator in the latest list of available indicator indicators. Then, this application determines the available indicator selected by the user as the target available indicator, and then queries the target monitoring data based on the target available indicator, the target available label indicator, and the target available label value.
[0206] The process of querying target monitoring data based on target available indicator identifier, target available tag identifier, and target available tag value is described in detail in the aforementioned embodiment S103 section, and will not be elaborated further here.
[0207] For example, such as Figure 10 As shown, this displays arbitrary monitoring data collected by a monitoring system, presented through an interactive interface.
[0208] Step 10: The electronic device's interactive interface displays the first list of available tags sent by the tag management service device.
[0209] Optionally, users can query monitoring data for all devices under the monitoring system through the first available tag query list in the interactive interface. For example, users can select CPU utilization from the first available tag query list to query the CPU usage of all devices in the monitoring system, or they can select memory utilization from the first available tag query list to query the memory usage of all devices in the monitoring system.
[0210] Step 20: The electronic device's interactive interface displays the second list of available tag queries and the first list of available indicator identifiers sent by the tag management service device.
[0211] The second available tag query list is a new available tag query list obtained by updating the first available tag query list.
[0212] Optionally, users can query more specific device monitoring data through the second available tab query list in the interactive interface.
[0213] Alternatively, users can query the monitoring data of the currently selected device through the first list of available indicators.
[0214] For example, users can select web0 from the second available label query list to query the CPU usage of a specific web0 device, or they can select CPU utilization from the first available metric label list to query the CPU utilization of all devices.
[0215] Step 30: The electronic device's interactive interface displays the third available tag query list and the second available indicator identifier list sent by the tag management service device.
[0216] The third available tag query list is a new available tag query list obtained by updating the second available tag query list.
[0217] The second list of available indicator identifiers is a new list of available indicator identifiers obtained by updating the first list of available indicator identifiers.
[0218] Optionally, users can query more specific device monitoring data through the third available tab query list in the interactive interface.
[0219] Alternatively, users can query the monitoring data of the currently selected device through the second list of available metrics.
[0220] For example, a user can query the usage of CPU 0 of the web0 server by selecting CPU 0 in the third available label query list, or they can select the CPU utilization of the web0 device in the second available metric label list to query the CPU utilization of the web0 device.
[0221] Step 40: The electronic device's interactive interface displays the fourth list of available tags and the third list of available indicator identifiers sent by the tag management service device.
[0222] The fourth available tag query list is a new available tag query list obtained by updating the third available tag query list.
[0223] The third list of available indicator identifiers is a new list of available indicator identifiers obtained by updating the second list of available indicator identifiers.
[0224] Optionally, users can search for more specific devices through the fourth available tab list in the interactive interface.
[0225] Alternatively, users can query the monitoring data of the currently selected device through a list of third available metrics.
[0226] For example, users can select the current time in the fourth available label query list to query the usage of CPU 0 of the web0 server at the current time, or they can select the CPU 0 utilization rate of the web0 device in the third available metric identifier list to query the CPU 0 utilization rate of the web0 device at the current time.
[0227] In this application, the user chooses to view the CPU usage of web0 server number 0.
[0228] S404 displays target monitoring data.
[0229] This application provides a data query method that, in response to a received data query request, retrieves a list of available tags from a tag management service device. In response to a selection operation of a target available tag identifier and its corresponding target available tag value, it retrieves a list of available indicator identifiers from the tag management service device. In response to a selection operation of any target indicator identifier, it queries target monitoring data based on the target indicator identifier, target available tag identifier, and target available tag value, and then displays the target monitoring data. This application adds a tag management service to the monitoring system, providing users with optional tag identifiers and tag values. This allows users to perform data query operations using these optional tag identifiers and tag values, thereby reducing the difficulty of data querying, simplifying data query operations, and improving data query efficiency. Furthermore, users can perform further refined data query operations using the updated list of available tags, thereby retrieving monitoring data that better meets their needs.
[0230] The following is combined Figure 11 The fifth data query method provided in the embodiments of this application is described, with the tag management service device as the executing entity.
[0231] Figure 11 This is a flowchart illustrating the fifth data query method provided in this application embodiment. The data query method provided in this application embodiment can be executed by a data query device. This data query device can consist of hardware and / or software and can be integrated into an electronic device. In this application embodiment, the electronic device is preferably a tag management service device.
[0232] like Figure 11 As shown, the method may include the following steps:
[0233] S501 acquires and stores the monitoring data collected by the acquisition component. The monitoring data includes monitoring indicator identifiers and tags.
[0234] The preferred acquisition component is a data collection component in the monitoring system, such as a Collector or an Agent, but no specific restrictions are imposed here.
[0235] In this embodiment, after the data collection component in the monitoring system collects monitoring data, it reports the monitoring data to the data forwarding component (e.g., Transfer). The data forwarding component writes the monitoring data to the monitoring database and forwards it to other components that require real-time data, such as the tag management service device, the first-level cache module, and the second-level cache module. The data forwarding component is used for data transmission on the data collection side of the monitoring system; its function is to transmit the monitoring data collected by the data collection component to the components that need the data.
[0236] When the tag management service device receives monitoring data sent by the data forwarding component, it can store the monitoring data.
[0237] S502, parse the monitoring data to obtain the monitoring indicator identifiers and tags of the monitoring data.
[0238] S503, establishes an index based on monitoring indicator identifiers and tags.
[0239] Considering that monitoring data includes monitoring indicator identifiers and a series of tags, to facilitate user query operations, the tag management service device can split the monitoring data according to the structure of the monitoring indicator identifiers and tags after saving the data, thus obtaining the monitoring indicator identifier part and the tag part for each monitoring data. Furthermore, based on the monitoring indicator identifier part and the tag part, an index is built, enabling subsequent monitoring data queries to be performed faster by leveraging the index and facilitating data organization, thereby improving data query speed.
[0240] An index is a separate, physical storage structure that sorts the values of one or more columns in a database table. Creating an index is equivalent to organizing disorganized data into a targeted format, thereby reducing data retrieval time. It is a collection of values from one or more columns in a table and a corresponding list of logical pointers to the data pages in the table that physically identify these values. The role of an index is similar to a table of contents in a book, allowing you to quickly find the required content based on page numbers. For example, indexes can be, but are not limited to, inverted indexes, bitmap indexes, partial indexes, expression indexes, etc., and this application does not impose specific limitations on them.
[0241] For example, a bitmap index is a special type of database index that uses bitmaps. A bitmap is an array of bits, where each bit can have either a value of 0 or 1. Each bit corresponds to a row in the data table, and the value of the bit is determined by the values in that row.
[0242] S504 generates a data query list based on the monitoring indicator identifier, tag, and index. The data query list includes an available tag query list and an invisible index query list, so that the querying device can perform data queries based on the available tag query list.
[0243] It should be understood that the available tag query list refers to the list that is visible and usable by the user, while the invisible index query list is a list that is invisible and inoperable to the user.
[0244] Furthermore, the data query list in this application has a two-level dictionary structure.
[0245] In some feasible implementations, generating a data query list can be achieved as follows: First, the monitoring metric identifier is treated as a new label, which includes a new label identifier and a new label value. Identification information is set for the new label identifier, and the monitoring metric identifier is used as the new label value. Second, the label identifier and label value are used as a first-level dictionary to obtain an available label query list. The label identifier includes the new label identifier and the label identifiers of the labels in the monitoring data, and the label value includes the new label value and the label values of the labels in the monitoring data. Furthermore, the label value and index are used as a second-level dictionary to obtain an invisible index query list. Finally, based on the available label query list and the invisible index query list, a data query list is generated.
[0246] For example, with Figure 12 Taking this as an example, the process of generating a data query list will be explained in detail. Figure 12 As shown, the data query list has a two-level dictionary structure. The monitoring metric name serves as the monitoring metric identifier, and this identifier is treated as a label. The label name (label identifier) is defined as the metric. Correspondingly, the label value is the monitoring metric name. Then, the label name and label value are placed in a two-level dictionary. The first-level dictionary allows you to find all available label values by label name, and the second-level dictionary allows you to find the corresponding bitmap index by label value.
[0247] In some implementations, after generating the data query list and receiving a request from the querying device to retrieve the available tag query list, the available tag query list in the data query list is fed back to the querying device so that the querying device can display the available tag query list to the user, helping the user to perform query operations on monitoring data based on the available tag query list.
[0248] The process of users querying monitoring data based on the available tag query list is detailed in the aforementioned embodiment section with the querying device as the execution subject, and will not be elaborated further here.
[0249] It should be noted that the available tag query list in this application can also be cascaded updated based on the user's selection. The specific process is as follows: cascaded updates are achieved through the dependency relationships between tags defined by the tag management service device. That is, after the user selects any available tag identifier and its corresponding available tag value in the available tag query list, the tag values of other tags that depend on this tag will be updated accordingly.
[0250] It should be understood that cascading, in computer science, refers to a mapping relationship between multiple objects. Establishing cascading relationships between data improves management efficiency. Cascading updates bind primary keys and foreign keys; when the primary key is changed, the foreign keys will also change accordingly. Consider a table storing teacher information: Table A (Name, Gender, Age), with Name as the primary key. Another table stores information about the classes taught by each teacher: Table B (Name, Class). They are cascaded using Name. Enabling a cascading update option allows changing a primary key value if a matching foreign key value exists. The system will update all matching foreign key values accordingly. If a record in Table A with the name "Zhang San" is changed to "Li Si," then all records in Table B with the name "Zhang San" will also be changed to "Li Si."
[0251] In a database, a primary key is a set of attributes that can uniquely identify a record. For example, in monitoring data, the primary key is the monitoring identifier.
[0252] This application provides a data query method that involves acquiring and storing monitoring data collected by a data acquisition component. The monitoring data includes monitoring indicator identifiers and tags. The monitoring data is parsed to obtain the monitoring indicator identifiers and tags. An index is built based on the monitoring indicator identifiers and tags. A data query list is generated based on the monitoring indicator identifiers, tags, and index. The data query list includes an available tag query list and an invisible index query list, enabling the querying device to perform data queries based on the available tag query list. This application adds a tag management service to the monitoring system to provide users with optional tag identifiers and tag values, allowing users to perform data query operations using these options. This reduces the difficulty of data queries, simplifies data query operations, and improves data query efficiency.
[0253] The following is combined Figure 13 The data query method provided in the embodiments of this application will be further explained.
[0254] like Figure 13 As shown, the method may include the following steps:
[0255] S601, Obtain the original monitoring indicator query request sent by the querying device. The original monitoring indicator query request includes: target indicator identifier, target available tag identifier, and target available tag value corresponding to the target available tag identifier.
[0256] In this embodiment of the application, when the querying device detects a data query request sent by the user, it can use the APIServer to send a request to the tag management service device to obtain the list of available tags.
[0257] In this embodiment, the process of the tag management service device receiving the available tag query list retrieval request sent by the querying device and feeding back the available tag query list to the querying device based on the available tag query list retrieval request can be referred to the embodiment where the execution subject is the querying device, which will not be described in detail here.
[0258] The user selects the target available tag identifier and the corresponding target available tag value from the available tag query list displayed on the querying device. The querying device then uses the target available tag identifier and the target available tag value as the parameters for obtaining the available indicator identifier list, generates an available indicator identifier list retrieval request, and sends the available indicator identifier list retrieval request to the tag service management device.
[0259] The tag management service device obtains the target available tag identifier and target available tag value carried in the request based on the list of available indicator identifiers, obtains the list of available indicator identifiers and the new list of available tag queries, and feeds back the list of available indicator identifiers and the new list of available tag queries to the electronic device.
[0260] When a user selects any target available indicator from the list of available indicator identifiers, the querying device can send a raw monitoring indicator query request to the tag management service device. The raw monitoring indicator query request includes: the target indicator identifier, the target available tag identifier, and the target available tag value corresponding to the target available tag identifier.
[0261] S602, based on the target indicator identifier, the target available label identifier, and the target available label value, query the target index in the invisible index query list.
[0262] After the tag management service device receives the original monitoring indicator query request sent by the querying device, it can parse the original monitoring indicator query request parameters to obtain the target indicator identifier, the target available tag identifier, and the target available tag value corresponding to the target available tag identifier.
[0263] Then, based on the target indicator identifier, target available label identifier, and target available label value, query all target indexes corresponding to the target indicator identifier, target available label identifier, and target available label value in the data query list, which includes the invisible index query list.
[0264] For example, if the target metric is identified as metric, the target available label is identified as tagk1, and the target available label value is tagv11, then all target indexes that can be queried in the invisible index query list based on metric, tagk1, and tagv11 are: 101010101.
[0265] For example, if the target metric is identified as metric, the target available tags are identified as tagk1 and tagk2, and the target available tag values are tagv11 and tagv21, then based on metric, tagk1, tagk2, tagv11, and tagv21, all target indexes that can be queried in the invisible index query list are: 101010101 and 110011001.
[0266] S603, determine the storage location of the target's original monitoring metrics based on the target index.
[0267] It should be understood that, since there is a one-to-one correspondence between the index and the tag value, when the number of target indexes obtained is a single one, the storage location of the target index is the storage location of the target original monitoring indicator; when the number of target indexes obtained is multiple, the tag management service device needs to find the intersection of multiple target indexes, and determine the storage location of the target original monitoring indicator through the intersection result.
[0268] For example, if all the target indexes retrieved are 101010101 and 110011001, then the intersection of these two target indexes is calculated, resulting in 100010001. Furthermore, the storage location of the original target monitoring metrics is determined based on the intersection result 100010001.
[0269] S604 retrieves the target's original monitoring metrics from the stored monitoring data based on the storage location and returns the target's original monitoring metrics to the querying device.
[0270] The number of original monitoring indicators for the target is at least one.
[0271] After obtaining the storage location of the target's original monitoring indicators, the tag management service device can retrieve the target's original monitoring indicators corresponding to the storage location from all the stored monitoring data, and return the target's original monitoring indicators to the querying device, so that the querying device can obtain the target monitoring data based on the target's original monitoring indicators.
[0272] The querying device obtains target monitoring data based on the target's original monitoring indicators. For details on this, please refer to the aforementioned implementation section where the execution subject is the querying device. Further details will not be provided here.
[0273] This application provides a data query method that involves obtaining a raw monitoring indicator query request sent by the querying device. The raw monitoring indicator query request includes: a target indicator identifier, a target available tag, and a target available tag value corresponding to the target available tag. Based on the target indicator identifier, target available tag, and target available tag value, a target index is queried from an invisible index query list. Based on the target index, the storage location of the target raw indicator is determined. Based on the storage location, the target raw monitoring indicator is retrieved from the stored monitoring data and returned to the querying device. This application adds a tag management service to the monitoring system to provide users with optional tag identifiers and tag values, enabling users to perform data query operations using these options. This reduces the difficulty of data querying, simplifies data query operations, and improves data query efficiency.
[0274] To facilitate understanding of the data query method provided in this application, this application will be described in detail with reference to specific embodiments, such as... Figure 14 As shown.
[0275] Figure 14 This is a schematic diagram of the architecture of a monitoring system provided in an embodiment of this application. The dashed arrows represent the paths for reporting monitoring data, and the solid arrows represent the paths for querying data.
[0276] In this embodiment of the application, the function of the data acquisition component (Collector) is to collect monitoring data and report the collected monitoring data to the data forwarding component (Transfer).
[0277] The data forwarding component is responsible for writing monitoring data into the monitoring database (TSDB) and forwarding the data to other cache modules and tag service devices that require real-time data.
[0278] The aggregation service loads user-configured parameters such as anomaly alerts and monitoring dashboards, receives monitoring data forwarded by the data forwarding component in real time, aggregates the monitoring data to obtain new monitoring data, and writes the new monitoring data into the monitoring database.
[0279] The tag management service device manages the monitoring data forwarded by the data forwarding component, generates a data query list including an available tag query list and an invisible index query list, and updates the data query list in real time based on the received monitoring data or the user's selection operation in the available tag query list.
[0280] The primary and secondary cache modules are designed to receive real-time monitoring data and proactively update the cached data based on the monitoring data, thereby reducing the number of operations required to query the monitoring database and thus speeding up the query speed of monitoring data.
[0281] MySQL is a relational database management system that stores data in different tables, increasing speed and improving flexibility.
[0282] The role of the user interface (UI) is to provide an interface for interaction with the outside world, through which users operate the entire monitoring system.
[0283] The role of the data acquisition service interface (API Server) is to transmit and operate the instructions received from the interactive interface, thereby enabling the monitoring system to operate perfectly.
[0284] In this embodiment of the application, the specific operation mode of the monitoring system includes a data acquisition part and a data query part.
[0285] First, regarding the data collection part:
[0286] The data acquisition component collects monitoring data and reports the collected data to the data forwarding component.
[0287] Upon receiving data from the data acquisition component, the data forwarding component performs data organization and inspection on all monitoring data, and then forwards the data to the tag management service device, the first-level cache, the second-level cache, and the monitoring database.
[0288] The tag management service device stores and manages the received monitoring data and obtains a data query list.
[0289] The first-level cache module and the second-level cache module receive real-time data and actively update the cached data.
[0290] Optionally, the data forwarding component can also forward data to the aggregation service, where the monitoring data is aggregated to obtain aggregated monitoring data. The aggregation component then writes the aggregated monitoring data into the monitoring database.
[0291] For the data query part:
[0292] Users send data query requests to the API Server through the interactive interface. The API Server checks the relational database to see if a metric calculation relationship exists in the monitoring system. If a metric calculation relationship exists, it retrieves that relationship and obtains the raw monitoring metrics from the tag management service device. If not, it directly obtains a list of available tags from the tag management service device and performs the target monitoring data acquisition operation based on the list.
[0293] If the API Server receives the monitoring data, it returns it to the interactive interface, providing feedback to the user.
[0294] The process of obtaining target monitoring data involves retrieving data from the first-level cache module, the second-level cache module, and / or the monitoring database. For details on the implementation process, please refer to the section on the querying device as the execution subject, which will not be elaborated on here.
[0295] The technical solution provided in this application adds a tag management service to the monitoring system to provide users with optional tag identifiers and tag values, enabling users to perform data query operations using the optional tag identifiers and tag values, thereby reducing the difficulty of data query, simplifying data query operations, and improving data query efficiency.
[0296] The following is a reference to the appendix. Figure 15 This application describes a data query device proposed in its embodiments. Figure 15 This is a schematic block diagram of a data query device provided in an embodiment of this application. In this embodiment, the data query device is configured on the querying device.
[0297] like Figure 15 As shown, the data query device 700 includes: a tag list acquisition module 710, an indicator list acquisition module 720, a data query module 730, and a data display module 740.
[0298] The tag list acquisition module 710 is used to obtain an available tag query list from the tag management service device in response to the acquired data query request. The available tag query list includes: available tag identifiers and tag values corresponding to the available tag identifiers.
[0299] The indicator list acquisition module 720 is used to acquire a list of available indicator identifiers from the label management service device in response to the selection operation of the target available label identifier and the target available label value corresponding to the target available label identifier;
[0300] The data query module 730 is used to query target monitoring data in response to the selection operation of any target indicator identifier, based on the target indicator identifier, the target available label identifier, and the target available label value;
[0301] The data display module 740 is used to display target monitoring data.
[0302] In one optional implementation of this application embodiment, the data query module 730 includes:
[0303] The indicator acquisition unit is used to acquire at least one original monitoring indicator of a target from the tag management service device based on the target indicator identifier, the target available tag identifier, and the target available tag value.
[0304] The data acquisition unit is used to acquire target monitoring data based on the target's original monitoring indicators.
[0305] In one optional implementation of this application embodiment, the data acquisition unit is specifically used for:
[0306] Based on the original monitoring metrics of the target, obtain the target monitoring data from the first-level cache module;
[0307] When the target monitoring data is not obtained from the first-level cache module, query whether the tag management service device has an aggregated monitoring indicator corresponding to the original target monitoring indicator;
[0308] If aggregated monitoring metrics exist, then the target monitoring data is retrieved from the monitoring database based on the aggregated monitoring metrics.
[0309] If no aggregated monitoring metrics exist, the list of original monitoring metrics corresponding to the target original monitoring metrics is obtained from the tag management service device, and the target monitoring data is obtained based on the list of original monitoring metrics.
[0310] In one optional implementation of this application embodiment, the data acquisition unit is further configured to:
[0311] Based on the original monitoring indicator list, the monitoring data corresponding to each original monitoring indicator in the original monitoring indicator list is obtained in the second-level cache module;
[0312] If the monitoring data corresponding to each original monitoring indicator is obtained, all the obtained monitoring data are summarized according to the time series to obtain the target monitoring data;
[0313] If no monitoring data corresponding to any original monitoring indicator is obtained, then the monitoring data corresponding to any original monitoring indicator is obtained from the monitoring database according to the original monitoring indicator, and all the obtained monitoring data are summarized according to the time series to obtain the target monitoring data.
[0314] In one optional implementation of this application embodiment, the data acquisition unit is further configured to:
[0315] Update the secondary cache module based on the monitoring data corresponding to any original monitoring metric.
[0316] In one optional implementation of this application embodiment, the data acquisition unit is further configured to:
[0317] Update the first-level cache module based on the target monitoring data.
[0318] One optional implementation of the embodiments of this application is...
[0319] The first-level cache module stores the original historical access monitoring metrics within the first time period, as well as the aggregated monitoring data corresponding to the original historical access monitoring metrics.
[0320] The second-level cache module stores the original monitoring metrics of historical accesses within the second time period, as well as the original monitoring data corresponding to the original monitoring metrics of historical accesses.
[0321] The monitoring database is a time-series database.
[0322] In one optional implementation of this application embodiment, the device 700 further includes: a control module.
[0323] The tag list acquisition module 710 is specifically used to obtain a new available tag query list from the tag management service device in response to the selection operation of the target available tag identifier and the target available tag value corresponding to the target available tag identifier;
[0324] The control module is used to respond to the selection operation of any available tag value in the new available tag query list. Using the new available tag query list as the available tag query list, it re-obtains the new available tag query list and the new available indicator identifier list from the tag management service device until the selection operation of any target indicator identifier in the new available indicator identifier list is obtained. Based on the target indicator identifier, the target available tag identifier, and the target available tag value, the target monitoring data is queried.
[0325] In one optional implementation of this application embodiment, the apparatus 700 further includes:
[0326] The interface display module is used to display the calculation relationship setting interface on the interactive interface in response to the obtained calculation relationship setting command. The calculation relationship setting interface includes: at least two available indicator identifiers, available label identifiers corresponding to the available indicator identifiers, and operators.
[0327] The relationship generation module is used to generate and store indicator calculation relationships in response to the selection of at least two target available indicator identifiers and operators; or, in response to the selection of at least one target available indicator identifier, the available label identifier corresponding to the available indicator identifier, and the operator, to generate and store indicator calculation relationships.
[0328] In one optional implementation of this application, any available tag identifier in the available tag query list can be used as a monitoring indicator identifier;
[0329] Accordingly, device 700 also includes:
[0330] The relationship acquisition module is used to, in response to the selection operation of any target monitoring indicator identifier and at least one available tag identifier corresponding to the target monitoring indicator identifier in the available tag query list, obtain the target calculation relationship of the target monitoring indicator identifier and the available tag identifier corresponding to the target monitoring indicator identifier from the indicator calculation relationship library;
[0331] The search module is used to recursively search for the original monitoring indicator identifier corresponding to the target monitoring indicator identifier based on the target calculation relationship.
[0332] The indicator acquisition module is used to obtain the original monitoring indicators from the tag management service device based on the available tag identifiers corresponding to the original monitoring indicator identifier and the target monitoring indicator identifier.
[0333] The data query module is specifically used to query and display target monitoring data based on the original monitoring indicators.
[0334] In one optional implementation of this application embodiment, the indicator acquisition module is specifically used for:
[0335] Based on the available tag identifiers corresponding to the original monitoring indicator identifier and the target monitoring indicator identifier, obtain the available values of the target monitoring indicator identifier on each available tag identifier from the tag management service device;
[0336] The target monitoring indicator identifier and the available value of each available tag identifier are used as new monitoring indicators, and the original monitoring indicators are obtained from the tag management service device based on the new monitoring indicators.
[0337] In one optional implementation of this application, the data display module 740 includes: a pie chart, a numerical line chart, a proportional line chart, a scatter plot, or a bar chart.
[0338] The data query device provided in this application embodiment, in response to a received data query request, obtains a list of available tags from a tag management service device, and in response to a selection operation of a target available tag identifier and the target available tag value corresponding to the target available tag identifier, obtains a list of available indicator identifiers from the tag management service device. In response to a selection operation of any target indicator identifier, it queries target monitoring data based on the target indicator identifier, target available tag identifier, and target available tag value, and then displays the target monitoring data. This application adds a tag management service to the monitoring system to provide users with optional tag identifiers and tag values, enabling users to perform data query operations using these optional tag identifiers and tag values, thereby reducing the difficulty of data querying, simplifying data query operations, and improving data query efficiency.
[0339] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be found in the method embodiments. To avoid repetition, further details are omitted here. Specifically, Figure 15 The device 700 shown can perform Figure 1 The corresponding method embodiments, and the foregoing and other operations and / or functions of each module in device 700 are respectively implemented to achieve Figure 1 For the sake of brevity, the corresponding processes in each method are not described in detail here.
[0340] The apparatus 700 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0341] Further, refer to the appendix. Figure 16 This application describes another data query device provided in its embodiments. Figure 16 This is a schematic block diagram of another data query device provided in an embodiment of this application. The data query device is configured in a tag management service device.
[0342] like Figure 16 As shown, the data query device 800 includes: a data acquisition module 810, a data parsing module 820, a creation module 830, and a generation module 840.
[0343] Among them, the data acquisition module 810 is used to acquire and store the monitoring data collected by the acquisition component. The monitoring data includes monitoring indicator identifiers and tags.
[0344] The data parsing module 820 is used to parse monitoring data and obtain monitoring indicator identifiers and tags for the monitoring data;
[0345] Module 830 is used to create an index based on monitoring indicator identifiers and tags;
[0346] The generation module 840 is used to generate a data query list based on the monitoring indicator identifier, tag, and index. The data query list includes an available tag query list and an invisible index query list, so that the querying device can perform data queries based on the available tag query list.
[0347] In one optional implementation of this application, the data query list has a two-level dictionary structure.
[0348] In one optional implementation of this application embodiment, the generation module is specifically used for:
[0349] The monitoring indicator identifier is processed as a new label, which includes a new label identifier and a new label value. Identification information is set for the new label identifier, and the monitoring indicator identifier is used as the new label value.
[0350] The available tag query list is obtained by using the tag identifier and the tag value as the first-level dictionary, wherein the tag identifier includes the new tag identifier and the tag identifier of the tag in the monitoring data, and the tag value includes the new tag value and the tag value of the tag in the monitoring data;
[0351] Using the tag value and the index as a second-level dictionary, the invisible index query list is obtained;
[0352] The data query list is generated based on the available tag query list and the invisible index query list.
[0353] In one optional implementation of this application embodiment, the apparatus 800 further includes:
[0354] The request acquisition module is used to acquire the original monitoring indicator query request sent by the querying device. The original monitoring indicator query request includes: target indicator identifier, target available tag identifier, and target available tag value corresponding to the target available tag identifier.
[0355] The index query module is used to query the target index from the invisible index query list based on the target indicator identifier, the target available label identifier, and the target available label value.
[0356] The location determination module is used to determine the storage location of the target's original monitoring metrics based on the target index.
[0357] The feedback module is used to retrieve the target's original monitoring metrics from the stored monitoring data based on the storage location, and return the target's original monitoring metrics to the querying device.
[0358] In one optional implementation of this application embodiment, the location determination module is specifically used for:
[0359] When there are multiple target indices, determine the intersection of all target indices;
[0360] Based on the intersection, determine the storage location of the target's original monitoring indicators.
[0361] The data query device provided in this application, in response to a received data query request, obtains a list of available tags from a tag management service device. In response to a selection operation of a target available tag identifier and its corresponding target available tag value, it obtains a list of available indicator identifiers from the tag management service device. In response to a selection operation of any target indicator identifier, it queries target monitoring data based on the target indicator identifier, target available tag identifier, and target available tag value, and then displays the target monitoring data. This application adds a tag management service to the monitoring system to provide users with optional tag identifiers and tag values, enabling users to perform data query operations using these options. This reduces the difficulty of data querying, simplifies data query operations, and improves data query efficiency.
[0362] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be found in the method embodiments. To avoid repetition, further details are omitted here. Specifically, Figure 16 The device 800 shown can perform Figure 11 The corresponding method embodiments, and the foregoing and other operations and / or functions of each module in the device 800 are respectively implemented to achieve Figure 11 For the sake of brevity, the corresponding processes in each method are not described in detail here.
[0363] The apparatus 800 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0364] Figure 17 This is a schematic block diagram of an electronic device provided in an embodiment of this application.
[0365] like Figure 17As shown, the electronic device 900 may include:
[0366] The system includes a memory 910 and a processor 920. The memory 910 stores computer programs and transfers the program code to the processor 920. In other words, the processor 920 can retrieve and run the computer program from the memory 910 to implement the data query method in this embodiment.
[0367] For example, the processor 920 can be used to execute the above-described data query method embodiment according to instructions in the computer program.
[0368] In some embodiments of this application, the processor 920 may include, but is not limited to:
[0369] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0370] In some embodiments of this application, the memory 910 includes, but is not limited to:
[0371] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0372] In some embodiments of this application, the computer program may be divided into one or more modules, which are stored in the memory 910 and executed by the processor 920 to perform the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.
[0373] like Figure 17 As shown, the electronic device may further include:
[0374] Transceiver 930, which can be connected to processor 920 or memory 910.
[0375] The processor 920 can control the transceiver 930 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 930 may include a transmitter and a receiver. The transceiver 930 may further include antennas, and the number of antennas may be one or more.
[0376] It should be understood that the various components in the electronic device are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0377] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the data query method of the above-described method embodiments.
[0378] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the data query method described in the above method embodiments.
[0379] When implemented using software, it can be implemented entirely or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0380] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0381] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0382] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0383] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data query method, characterized in that, The method, executed by the querying device, includes: In response to the received data query request, an available tag query list is obtained from the tag management service device. The available tag query list includes: available tag identifiers and available tag values corresponding to the available tag identifiers. The tag management service device includes hardware devices that manage the monitoring data collected by the monitoring data collection component in the monitoring system according to the structure of tag identifiers and tag values. In response to the selection operation of a target available tag identifier and the target available tag value corresponding to the target available tag identifier, a list of available indicator identifiers is obtained from the tag management service device; In response to the selection operation of any target indicator identifier, the target monitoring data is queried based on the target indicator identifier, the target available tag identifier, and the target available tag value; Display the target monitoring data; The step of querying target monitoring data based on the target indicator identifier, the target available tag identifier, and the target available tag value includes: Based on the target indicator identifier, the target available tag identifier, and the target available tag value, at least one original target monitoring indicator is obtained from the tag management service device; Based on the original monitoring indicators of the target, obtain the target monitoring data; The step of obtaining target monitoring data based on the original target monitoring indicators includes: Based on the original monitoring metrics of the target, the monitoring data of the target is obtained from the first-level cache module; When the target monitoring data is not obtained from the first-level cache module, query whether the tag management service device has an aggregated monitoring indicator corresponding to the original monitoring indicator of the target; If the aggregated monitoring metric exists, then the target monitoring data is obtained from the monitoring database based on the aggregated monitoring metric. If the aggregated monitoring metric does not exist, a list of original monitoring metrics corresponding to the target original monitoring metric is obtained from the tag management service device, and the target monitoring data is obtained based on the list of original monitoring metrics.
2. The method according to claim 1, characterized in that, The step of obtaining the target monitoring data based on the original monitoring indicator list includes: Based on the original monitoring indicator list, the monitoring data corresponding to each original monitoring indicator in the original monitoring indicator list is obtained in the second-level cache module; If the monitoring data corresponding to each original monitoring indicator is obtained, all the obtained monitoring data are summarized according to the time series to obtain the target monitoring data; If no monitoring data corresponding to any original monitoring indicator is obtained, then the monitoring data corresponding to the original monitoring indicator is obtained from the monitoring database according to the original monitoring indicator, and all monitoring data are summarized according to the time series to obtain the target monitoring data.
3. The method according to claim 2, characterized in that, After obtaining the monitoring data corresponding to the arbitrary original monitoring indicator from the monitoring database based on the arbitrary original monitoring indicator, the process further includes: The secondary cache module is updated based on the monitoring data corresponding to any of the original monitoring metrics.
4. The method according to claim 1 or 2, characterized in that, The method further includes: Update the first-level cache module based on the target monitoring data.
5. The method according to claim 1 or 2, characterized in that, The first-level cache module stores the original historical access monitoring metrics within the first time period, as well as the aggregated monitoring data corresponding to the original historical access monitoring metrics. The second-level cache module stores the original monitoring metrics of historical access within the second time period, as well as the original monitoring data corresponding to the original monitoring metrics of historical access. The monitoring database is a time-series database.
6. The method according to claim 1, characterized in that, The method further includes: In response to the selection operation of a target available tag identifier and the target available tag value corresponding to the target available tag identifier, a new available tag query list is obtained from the tag management service device; In response to the selection operation of any available tag value in the new available tag query list, the new available tag query list is used as the available tag query list. The new available tag query list and the new available tag identifier query list are retrieved from the tag management service device again until the selection operation of any target indicator identifier in the new available indicator identifier list is retrieved, so as to query the target monitoring data according to the target indicator identifier, the target available tag, and the target available tag value.
7. The method according to claim 1, characterized in that, The method further includes: In response to the received calculation relationship setting instruction, a calculation relationship setting interface is displayed on the interactive interface. The calculation relationship setting interface includes: at least two available indicator identifiers, available label identifiers corresponding to the available indicator identifiers, and operators. In response to the selection of at least two available indicator identifiers and target operators, generate and store the indicator calculation relationship; or, In response to the selection of at least two target available indicator identifiers, target available label identifiers corresponding to the target available indicator identifiers, and target operators, an indicator calculation relationship is generated and stored.
8. The method according to claim 7, characterized in that, Any available tag in the available tag query list is identified as a monitoring indicator; Accordingly, after generating and storing the index calculation relationship, the process further includes: In response to the selection operation of any target monitoring indicator and at least one available tag identifier corresponding to the target monitoring indicator in the available tag query list, the target calculation relationship of the target monitoring indicator and the available tag identifier corresponding to the target monitoring indicator is obtained from the indicator calculation relationship library; Based on the target calculation relationship, recursively search for the original monitoring indicator identifier corresponding to the target monitoring indicator; Based on the original monitoring indicator identifier and the available label identifier corresponding to the target monitoring indicator, the original monitoring indicator is obtained from the label management service device; Based on the original monitoring indicators, query and display the target monitoring data.
9. The method according to claim 8, characterized in that, The step of obtaining the original monitoring indicator from the tag management service device based on the original monitoring indicator identifier and the available tag identifier corresponding to the target monitoring indicator includes: Based on the original monitoring indicator identifier and the available tag identifier corresponding to the target monitoring indicator, obtain the available value of the target monitoring indicator on each available tag identifier from the tag management service device; The target monitoring indicator and the available value of each available tag are used as new monitoring indicators, and the original monitoring indicators are obtained from the tag management service device based on the new monitoring indicators.
10. The method according to claim 1 or 8, characterized in that, The display of the target monitoring data includes the following formats: Pie charts, line charts, scale line charts, scatter plots, or bar charts.
11. A data query method, characterized in that, The method is executed by a tag management service device, which includes hardware equipment that manages monitoring data collected by the monitoring data collection component in the monitoring system according to the structure of tag identifiers and tag values. Acquire and store monitoring data collected by the acquisition component, wherein the monitoring data includes monitoring indicator identifiers and tags; Parse the monitoring data to obtain the monitoring indicator identifiers and tags of the monitoring data; An index is established based on the monitoring indicator identifiers and the tags; Based on the monitoring indicator identifier, the tag, and the index, a data query list is generated, wherein the data query list includes: an available tag query list and an invisible index query list, so that the querying device can perform data query based on the available tag query list; Obtain the original monitoring indicator query request sent by the querying device. The original monitoring indicator query request includes: target indicator identifier, target available tag identifier, and target available tag value corresponding to the target available tag identifier. Based on the original monitoring metrics, query the corresponding aggregated monitoring metrics; If the aggregated monitoring metric does not exist, obtain the list of original monitoring metrics corresponding to the target original monitoring metric and transmit the list of original monitoring metrics to the querying device.
12. The method according to claim 11, characterized in that, The data query list has a two-level dictionary structure.
13. The method according to claim 12, characterized in that, The step of generating a data query list based on the monitoring indicator identifier, the tag, and the index includes: The monitoring indicator identifier is processed as a new label, which includes a new label identifier and a new label value. Identification information is set for the new label identifier, and the monitoring indicator identifier is used as the new label value. The available tag query list is obtained by using the tag identifier and the tag value as the first-level dictionary, wherein the tag identifier includes the new tag identifier and the tag identifier of the tag in the monitoring data, and the tag value includes the new tag value and the tag value of the tag in the monitoring data; Using the tag value and the index as a second-level dictionary, the invisible index query list is obtained; The data query list is generated based on the available tag query list and the invisible index query list.
14. The method according to claim 11, characterized in that, The method further includes: Obtain the original monitoring indicator query request sent by the querying device. The original monitoring indicator query request includes: target indicator identifier, target available tag identifier, and target available tag value corresponding to the target available tag identifier. Based on the target indicator identifier, the target available label identifier, and the target available label value, query the target index in the invisible index query list; Based on the target index, determine the storage location of the target's original metrics; Based on the storage location, the original monitoring metrics are obtained from the stored monitoring data and returned to the querying device.
15. The method according to claim 14, characterized in that, The step of determining the storage location of the original target index based on the target index includes: When there are multiple target indices, determine the intersection of all target indices; Based on the intersection, determine the storage location of the original target index.
16. A data query device, characterized in that, Configured on the querying device, including: The tag list acquisition module is used to obtain an available tag query list from the tag management service device in response to the acquired data query request. The available tag query list includes: available tag identifiers and available tag values corresponding to the available tag identifiers. The indicator list acquisition module is used to acquire a list of available indicator identifiers from the label management service device in response to the selection operation of the target available label identifier and the target available label value corresponding to the target available label identifier; The data query module is used to respond to the selection operation of any target indicator identifier and query the target monitoring data based on the target indicator identifier, the target available tag identifier, and the target available tag value. The data display module is used to display the target monitoring data; The data query module is further configured to: obtain at least one target original monitoring indicator from the tag management service device based on the target indicator identifier, the target available tag identifier, and the target available tag value; obtain target monitoring data based on the target original monitoring indicator; and obtain the target monitoring data from the first-level cache module based on the target original monitoring indicator. When the target monitoring data is not obtained from the first-level cache module, the module queries whether the tag management service device has an aggregated monitoring indicator corresponding to the target original monitoring indicator. If the aggregated monitoring indicator exists, the module obtains the target monitoring data from the monitoring database based on the aggregated monitoring indicator. If the aggregated monitoring indicator does not exist, the module obtains a list of original monitoring indicators corresponding to the target original monitoring indicator from the tag management service device and obtains the target monitoring data based on the list of original monitoring indicators.
17. A data query device, characterized in that, Configured in the tag management service device, including: The data acquisition module is used to acquire and store the monitoring data collected by the acquisition component, wherein the monitoring data includes monitoring indicator identifiers and tags; The data parsing module is used to parse the monitoring data to obtain the monitoring indicator identifiers and tags of the monitoring data; A module is established to create an index based on the monitoring indicator identifier and the tag; The generation module is used to generate a data query list based on the monitoring indicator identifier, the tag, and the index, wherein the data query list includes an available tag query list and an invisible index query list, so that the querying device can perform data query based on the available tag query list; The request acquisition module is used to acquire the original monitoring indicator query request sent by the querying device. The original monitoring indicator query request includes: target indicator identifier, target available tag identifier, and target available tag value corresponding to the target available tag identifier; based on the original monitoring indicator, query the corresponding aggregated monitoring indicator; if the aggregated monitoring indicator does not exist, acquire the list of original monitoring indicators corresponding to the target original monitoring indicator and transmit the list of original monitoring indicators to the querying device.
18. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store a computer program, the processor being used to invoke and run the computer program stored in the memory to perform the data query method as described in any one of claims 1 to 15.
19. A computer-readable storage medium, characterized in that, Used to store computer programs that cause a computer to perform the data query method as described in any one of claims 1 to 15.
20. A computer program product containing program instructions, characterized in that, When the program instructions are executed on the electronic device, the electronic device causes the electronic device to perform the data query method as described in any one of claims 1 to 15.
Citation Information
Patent Citations
Time sequence database query optimization method and device, equipment and storage medium
CN112818013A
Data visual query method and device, electronic equipment and storage medium
CN114385721A