Index data processing method and device, equipment and medium
By introducing proxy components into the data monitoring module, aggregating the indicator data of multiple target service instances, the data monitoring module solves the low efficiency and memory consumption problems caused by the large amount of indicator data in multiple instance scenarios, and realizes more efficient data monitoring and storage.
Patent Information
- Application Number
- CN202411007575.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-29
AI Technical Summary
In the data monitoring module, when obtaining a large amount of indicator data, the monitoring efficiency is low and the memory resources consumes huge amounts. Especially in multiple instance scenarios, the data order reaches the order of millions, resulting in a degradation of system performance.
By installing agent components in the server, the data acquisition request of the data monitoring module is obtained, and when the preset instance aggregation conditions are met, the metric data of multiple target service instances is aggregated to generate smaller aggregated metric data, reducing data transmission and storage load.
It improves the monitoring efficiency of indicator data, reduces memory consumption, and improves system performance and stability.
Smart Images

Figure CN119046083A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a method, device, equipment and medium for processing indicator data. Background Art
[0002] The data monitoring module is an open source service monitoring system and time series database. In the data monitoring module monitoring system, the target service instance refers to the specific service or application instance that the data monitoring module server polls regularly to collect monitoring indicators. These instances can be services running on different machines, microservices in containers, or different processes on the same machine.
[0003] In the related technology, the data monitoring module sends a data collection request to the target service instance according to business needs, and obtains the corresponding indicator data in the instance dimension. For example, the data monitoring module sends a data collection request to the target service instances A, B, and C according to business needs, and obtains the indicator data set a corresponding to A, the indicator data set b corresponding to B, and the indicator data set c corresponding to C.
[0004] In the related technology, the data set of each instance read may contain a large amount of indicator data. When the number of instances is large, the indicator data obtained is even larger in magnitude, even reaching the million level. Therefore, it may cause the data monitoring module to have low monitoring efficiency for the indicator data and consume huge memory resources. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, device, equipment and medium for processing indicator data.
[0006] An embodiment of the present disclosure provides a method for processing indicator data, which is applied in a server, in which an agent component and a data monitoring module are pre-installed, and the method comprises the following steps: obtaining, through the agent component, a data collection request sent by the data monitoring module according to the component interface address of the agent component, wherein, after pre-determining that multiple target service instances corresponding to the data collection request satisfy a preset instance aggregation condition, the agent component pre-sends the component interface address to the data monitoring module; obtaining, through the agent component, an indicator data set corresponding to the data collection request according to each of the target service instances, so as to obtain multiple indicator data sets corresponding to the multiple target service instances; aggregating the multiple indicator data sets through the agent component to obtain at least one aggregated indicator data, wherein the number of indicator data of the at least one aggregated indicator data is less than the total number of indicator data contained in the multiple indicator data sets; and sending the at least one aggregated indicator data to the data monitoring module through the agent component.
[0007] The disclosed embodiment also provides an indicator data processing device, which is applied in a server, in which an agent component and a data monitoring module are pre-installed, and the device comprises: a first acquisition module, which is used to acquire, through the agent component, a data collection request sent by the data monitoring module according to the component interface address of the agent component, wherein, after pre-determining that a plurality of target service instances corresponding to the data collection request satisfy a preset instance aggregation condition, the agent component pre-sends the component interface address to the data monitoring module; a second acquisition module, which is used to acquire, through the agent component, an indicator data set corresponding to the data collection request according to each of the target service instances, so as to acquire a plurality of indicator data sets corresponding to the plurality of target service instances; an aggregation processing module, which is used to aggregate the plurality of indicator data sets through the agent component to acquire at least one aggregated indicator data, wherein the number of indicator data of the at least one aggregated indicator data is less than the total number of indicator data contained in the plurality of indicator data sets; and a sending module, which is used to send the at least one aggregated indicator data to the data monitoring module through the agent component.
[0008] The embodiment of the present disclosure also provides a server, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the indicator data processing method provided in the embodiment of the present disclosure.
[0009] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the method for processing indicator data provided by the embodiment of the present disclosure.
[0010] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0011] The processing scheme of indicator data provided by the embodiment of the present disclosure is to obtain the data collection request sent by the data monitoring module according to the component interface address of the proxy component through the proxy component, wherein the proxy component sends the component interface address to the data monitoring module in advance after pre-determining that multiple target service instances corresponding to the data collection request meet the preset instance aggregation conditions, and then obtain the indicator data set corresponding to the data collection request according to each target service instance through the proxy component to obtain multiple indicator data sets corresponding to the multiple target service instances, and aggregate the multiple indicator data sets through the proxy component to obtain at least one aggregated indicator data, wherein the number of indicator data of at least one aggregated indicator data is less than the total number of indicator data contained in the multiple indicator data sets, and send at least one aggregated indicator data to the data monitoring module. Thus, the indicator data monitored by the data monitoring module is aggregated based on the instance dimension, which improves the monitoring efficiency of the indicator data and reduces the memory consumption of storing the indicator data. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0013] Figure 1 A flowchart of a method for processing indicator data provided by an embodiment of the present disclosure;
[0014] Figure 2 A schematic diagram of a scenario for processing indicator data provided by an embodiment of the present disclosure;
[0015] Figure 3 A flowchart of another method for processing indicator data provided by an embodiment of the present disclosure;
[0016] Figure 4 An interactive schematic diagram of an indicator data processing method provided by an embodiment of the present disclosure;
[0017] Figure 5 A schematic diagram of the structure of an indicator data processing device provided in an embodiment of the present disclosure;
[0018] Figure 6A schematic diagram of the structure of a server provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0020] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0021] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0022] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0023] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0024] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0025] In order to solve the above problems, the embodiments of the present invention provide a method for processing indicator data. In this method, the relevant indicator data monitored by the data monitoring module can be aggregated based on the target service instance dimension through the proxy component. The magnitude of the indicator data after aggregation is greatly reduced, thereby reducing the impact of high-base indicators on the stability of indicator data monitored by the data monitoring module, improving the monitoring efficiency of the indicator data, and reducing the memory consumption of storing the indicator data.
[0026] The method is introduced below in conjunction with specific embodiments.
[0027] Figure 1 A flowchart of a method for processing indicator data provided in an embodiment of the present disclosure, the method can be executed by a pre-installed proxy component controlled by a server, wherein the server includes an indicator data device, wherein the device can be implemented by software and / or hardware, and can generally be integrated in the server, and the server includes a proxy component and a data monitoring module, and the data monitoring module can be Prometheus, etc. Among them, the proxy component in this embodiment can be any pre-built component, including but not limited to the Proxy component, etc. Figure 1 As shown, the method includes:
[0028] Step 101, obtaining a data collection request sent by a data monitoring module according to a component interface address of the proxy component through a proxy component, wherein:
[0029] After the proxy component predetermines that multiple target service instances corresponding to the data collection request meet the preset instance aggregation condition, the component interface address is sent to the data monitoring module in advance.
[0030] In one embodiment of the present disclosure, the data monitoring module uses a pull method to pull the monitoring data (indicator data) of the specified target service instance, that is, to capture the metrics data on the target service instance at fixed intervals. Each captured target service instance needs to expose an interface, where the interface can be a data indicator API interface. The data monitoring module can obtain its indicator data through this exposed interface.
[0031] Among them, the data monitoring module first obtains the target service instance to be collected through service discovery, that is, the process of the data monitoring module determining the target service instance mainly depends on its service discovery mechanism. The data monitoring module itself does not actively look for the target service instance, but locates and tracks them through the configured service discovery rules. The following are several common ways for the data monitoring module to determine the target service instance: 1. Static configuration: directly list the address and port of the target service instance in the configuration file of the data monitoring module. For example, one or more URLs can be specified, and the data monitoring module will periodically poll these URLs to obtain monitoring data. 2. Service discovery mechanism: For example, DNS SRV is recorded in advance, and the data monitoring module can query the Domain Name System (DNS SRV) resource record to discover the target service instance. This is suitable for environments that use DNS as a service registration and discovery mechanism. For example, the data monitoring module can integrate Consul service discovery and obtain a list of service instances from Consul. For example, in a Kubernetes environment, the data monitoring module can use the Kubernetes API to automatically discover resources such as Pods and Services to determine the target service instance. For example, for environments using Apache Mesos and Marathon, the data monitoring module can use Marathon service discovery. For example, the data monitoring module supports obtaining virtual machine information from OpenStack's Nova service for service discovery. 3. Dynamic configuration: The data monitoring module also supports dynamically loading the configuration of the target service instance from an external system, such as obtaining a JSON-formatted configuration file from an HTTP API, which is very useful in an environment where the target instance changes frequently. 4. Label expression: The data monitoring module allows the use of label expressions to filter and select target service instances. For example, you can specify to monitor only instances with specific labels (such as app=kube-data monitoring module). After the data monitoring module determines the target service instance through the above mechanism, it will periodically send HTTP requests to the exposed monitoring endpoints (usually metrics) of these instances to pull the monitored indicator data. The target service instance usually runs a data monitoring module Exporter, which is responsible for collecting local monitoring data and providing it to the data monitoring module Server in a format compatible with the data monitoring module.
[0032] In this embodiment, the service discovery request sent by the data monitoring module can be obtained through the proxy component, and then multiple target service instances corresponding to the service discovery request can be obtained, wherein the way the proxy component determines the target service instance can refer to the way the above-mentioned data monitoring module discovers the target service instance.
[0033] After determining the target service instance, the proxy component is used to determine whether multiple target service instances meet the preset instance aggregation conditions. When the preset instance aggregation conditions are met, the data capture interface that communicates with the proxy component is determined, and the component interface address of the data capture interface is fed back to the data monitoring module.
[0034] Among them, after multiple target service instances meet the preset instance aggregation conditions, it indicates that the magnitude of the indicator data provided by the preset instance aggregation conditions may be large. Therefore, aggregation processing is required before the relevant indicator data is sent to the data monitoring module.
[0035] It should be noted that in different application scenarios, the preset instance aggregation conditions are different. The examples are as follows:
[0036] In some possible examples, the number of service instances of multiple target service instances is identified through an agent component. For example, in a monitoring scenario in a Kubernetes environment, if Kubernetes includes multiple nodes and each node corresponds to an application, then all applications included in Kubernetes are target service instances. If Kubernetes is relatively large, the number of corresponding target service instances is relatively large.
[0037] In this embodiment, it is determined whether the number of service instances is greater than a preset instance number threshold, wherein when the number of service instances is greater than the preset instance number threshold, it is determined that multiple target service instances meet the preset instance aggregation condition. The preset instance number threshold can be set according to the needs of the scenario.
[0038] In some possible examples, the number of service instances included in multiple target service instances is identified through a proxy component, and the data level of each target service instance in the multiple target service instances is determined, wherein the calculation method of the data level may include: identifying all data tag types included in each target service instance, for example, in a certain http_request business scenario, all data tag types included are: app, instance, project, src_ip, span, code, and determining the number of tag key values corresponding to each data tag type, wherein the tag key value may be a value that the corresponding data tag type can take, for example, app, instance, and project are fixed for the application instance, then the corresponding number of tag key values is 1, the application provides 20 span interfaces for external access, each request has 10 status codes, then the corresponding number of tag key values is 10, and there are 1000 different src_ips accessing the application instance, then the corresponding number of tag key values is 1000.
[0039] In this embodiment, the second product value of all tag key values corresponding to all data tag types is calculated, for example, the calculated second product value is: 1*1*1*20*10*1000=200000. The second product value is determined as the data level of each target service instance.
[0040] Then, the first product value of the data level and the number of service instances is calculated. For example, if the number of service instances is 1000, the corresponding first product value is 200000000. Then, it is determined whether the first product value is greater than a preset data level threshold. When the value is greater than the preset data level threshold, it is determined that the multiple target service instances meet the preset instance aggregation condition. The preset data level threshold can be set according to the needs of the scenario, for example, it can be 20000.
[0041] In this embodiment, after pre-determining that multiple target service instances corresponding to the data collection request meet a preset instance aggregation condition, the proxy component sends the component interface address to the data monitoring module in advance.
[0042] If the proxy component determines that the multiple target service instances corresponding to the data collection request do not meet the preset instance aggregation condition, the original address of the target service instance can be directly sent to the data monitoring module.
[0043] Step 102: Obtain, through the proxy component, an indicator data set corresponding to the data collection request according to each target service instance, so as to obtain multiple indicator data sets corresponding to multiple target service instances.
[0044] In this embodiment, the data monitoring module obtains the data collection request sent by the component interface address of the proxy component, and then the proxy component obtains the indicator data set corresponding to the data collection request according to each target service instance to obtain multiple indicator data sets corresponding to multiple target service instances. Among them, the proxy component can also pull the corresponding indicator data through the interface provided by the target service instance in a Pull mode.
[0045] Among them, multiple indicator data sets correspond one-to-one to multiple target service instances, and the label values corresponding to each target service instance may be exactly the same. Therefore, aggregating multiple indicator data sets can effectively suppress the order of magnitude of the indicator data.
[0046] Step 103: Aggregate the multiple indicator data sets through the proxy component to obtain at least one aggregated indicator data, wherein the number of indicator data in the at least one aggregated indicator data is less than the total number of indicator data included in the multiple indicator data sets.
[0047] In the embodiment of the present disclosure, multiple indicator data sets are aggregated to obtain at least one aggregated indicator data. Since the indicator data sets correspond to the target service instances one by one, the aggregation processing of the indicator data with the target service as the instance is realized. The number of indicator data of the at least one aggregated indicator data after aggregation is much smaller than the total number of indicator data contained in the multiple indicator data sets.
[0048] Step 104: Send at least one aggregated indicator data to the data monitoring module through the proxy component.
[0049] After obtaining the aggregated index data, the aggregated index data is sent to the data monitoring module through the proxy component. Since the data volume of the aggregated index data is small, it avoids the slow or even failed data query of the data monitoring module, and reduces the memory resource consumption of the data monitoring module when storing related index data.
[0050] Therefore, in the embodiments of the present disclosure, referring to Figure 2 When the proxy component is Proxy, the service discovery request sent by the data monitoring module is obtained through Proxy. If the multiple target service instances discovered include Y1, Y2..., and it is determined that the multiple target service instances meet the preset instance aggregation conditions, the component interface address of the proxy component is fed back to the data monitoring module through Proxy. The data monitoring module sends a data collection request based on the component interface address. After Proxy obtains Y1 and Y2, it aggregates them to obtain aggregated indicator data, and sends the aggregated indicator data to the data monitoring module. On the contrary, if the target service instances discovered include Z, and it is determined that the multiple target service instances do not meet the preset instance aggregation conditions, the Proxy feeds back the interface address of Z to the data monitoring module, and the data monitoring module directly pulls the corresponding indicator data from Z based on the interface address of Z.
[0051] In summary, the method for processing indicator data of the embodiment of the present disclosure obtains the data collection request sent by the data monitoring module according to the component interface address of the proxy component through the proxy component, wherein the proxy component sends the component interface address to the data monitoring module in advance after pre-determining that multiple target service instances corresponding to the data collection request meet the preset instance aggregation conditions, and then obtains the indicator data set corresponding to the data collection request according to each target service instance through the proxy component to obtain multiple indicator data sets corresponding to the multiple target service instances, aggregates the multiple indicator data sets through the proxy component to obtain at least one aggregated indicator data, and sends at least one aggregated indicator data to the data monitoring module. As a result, the indicator data monitored by the data monitoring module is aggregated based on the instance dimension, which improves the monitoring efficiency of the indicator data and reduces the memory consumption of storing the indicator data.
[0052] Based on the above embodiments, in different application scenarios, the methods of aggregating multiple indicator data sets to obtain at least one aggregated indicator data are different, and examples are described as follows:
[0053] In one embodiment of the present disclosure, Figure 3 As shown, aggregating multiple indicator data sets to obtain at least one aggregated indicator data includes:
[0054] Step 301 : Identify the tag key value of each indicator data in each indicator data set through the proxy component.
[0055] In the embodiments of the present disclosure, the indicator data provided by each target instance includes a data label, wherein the label key value value corresponding to each data label labels may be one or more. For example, for the label src_ip, its corresponding label key value value may include 1000, etc. It is not difficult to understand that the more value values corresponding to src_ip, the larger the magnitude of the corresponding indicator data. For example, if the value value corresponding to src_ip is 1, the corresponding indicator data may be 1, and the value value corresponding to src_ip is 1000, the corresponding indicator data may be 1000. Therefore, the more target service instances there are, the greater the magnitude of the corresponding indicator data.
[0056] Step 302, divide and process multiple indicator data sets according to label key values through the proxy component to obtain multiple candidate data sets, wherein the label key values of the indicator data contained in each candidate data set are exactly the same, and the label key values of the indicator data contained in different candidate data sets are not exactly the same.
[0057] In an embodiment of the present disclosure, multiple indicator data sets are divided and processed according to label key values to obtain multiple candidate data sets, wherein the label key values of the indicator data contained in each candidate data set are exactly the same, and the label key values of the indicator data contained in different candidate data sets are not exactly the same, that is, in this embodiment, the indicator data contained in the indicator data set are re-divided based on the label key value as the division granularity.
[0058] For example, if the indicator data set includes sets Z1 and Z2, then the indicator data contained in set Z1 includes:
[0059] …
[0060] http_request_total{app="web",instance="10.0.0.1",project="infra",span=" / api / v1 / config",code="200"}2408
[0061] http_request_total{app="web",instance="10.0.0.1",project="infra",span=" / api / v1 / config",code="500"}12
[0062] http_request_total{app="web",instance="10.0.0.1",project="infra",span=" / api / v1 / query",code="200"}279
[0063] http_request_total{app="web",instance="10.0.0.1",project="infra",span=" / api / v1 / load",code="404"}5
[0064] The metric data included in set Z2 are as follows:
[0065] ……
[0066] http_request_total{app="web",instance="10.0.0.1",project="infra",span=" / api / v1 / config",code="200"}2478
[0067] http_request_total{app="web",instance="10.0.0.1",project="infra",span=" / api / v1 / config",code="500"}16
[0068] http_request_total{app="web",instance="10.0.0.1",project="infra",span=" / api / v1 / query",code="200"}27
[0069] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / load",code="404"}59
[0070] Step 303: Aggregate at least one candidate data set through a proxy component to obtain at least one aggregated indicator data.
[0071] In this embodiment, at least one candidate data set is aggregated to obtain aggregated indicator data, wherein when the candidate data sets are aggregated, all attribute values corresponding to all indicator data contained in each candidate data set are obtained, and the attribute value can be understood as the number of corresponding indicator data. For example, for the indicator number data "http_request_total{app="web",instance="10.0.0.1",project="infra",span=" / api / v1 / config",code="200"}2408", "2048" is its corresponding attribute value. All attribute values corresponding to each candidate data set are summed to obtain a sum value, and then, aggregated indicator data is generated according to all tag key values contained in each candidate data set and the corresponding sum value, thereby obtaining aggregated indicator data according to all aggregated indicator data corresponding to at least one candidate data set.
[0072] For example, taking the above indicator data set including sets Z1 and Z2 as an example, it is divided into candidate data sets H1-H4, where H1 includes:
[0073] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / config",code="200"}2408
[0074] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / config",code="200"}2478
[0075] H2 includes:
[0076] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / config",code="500"}12
[0077] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / config",code="500"}16
[0078] H3 includes:
[0079] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / query",code="200"}279
[0080] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / query",code="200"}27
[0081] H4 includes:
[0082] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / load",code="404"}5
[0083] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / load",code="404"}59
[0084] Then, all the corresponding attribute values in H1 are summed to obtain a sum value of 2478+2408=4886. The corresponding aggregate index data includes:
[0085] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / config",code="200"}4886,
[0086] Sum all the corresponding attribute values in H2 to obtain a sum value of 12+16=28. The corresponding aggregate index data includes:
[0087] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / config",code="500"}28,
[0088] Sum all the corresponding attribute values in H3 to obtain a sum value of 279+27=306. The corresponding aggregate indicator data includes:
[0089] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / query",code="200"}306
[0090] Sum all the corresponding attribute values in H4 to obtain a sum value of 5+59=64. The corresponding aggregate indicator data includes:
[0091] http_request_total{app="web",instance="10.0.0.1",project="infra",spa n=" / api / v1 / load",code="404"}64
[0092] The above example is only an example. In fact, each candidate data set may contain multiple indicator data items. Therefore, each candidate data set is aggregated to obtain one aggregate indicator data item, which greatly reduces the magnitude of the indicator data.
[0093] Furthermore, in one embodiment of the present disclosure, in order to further reduce the storage pressure of the data monitoring module, before sending the aggregated data to the data monitoring module, the remaining memory of the data monitoring module can be read to determine the memory required for the aggregated data. If the required memory is greater than the remaining memory, the memory difference between the required memory and the remaining memory can be calculated, and the data monitoring module can be notified in advance to release the memory corresponding to the memory difference, and the aggregated data can be sent to the data monitoring module after the release; or, in order to improve the sending efficiency of the aggregated data, the aggregated data can be first split into two parts, and the memory required for the aggregated data of the first part is less than the remaining memory of the data monitoring module, so that a memory release request is sent to the data monitoring module, wherein the memory release request includes the aggregated data of the first part and the memory required for the aggregated data of the second part. After the data monitoring module releases the memory, the proxy component sends the aggregated data of the second part to the data monitoring module.
[0094] That is, in this embodiment, when the proxy component is Proxy, refer to Figure 4 ,The data monitoring module sends the service discovery request of the ,collection task to the Proxy according to the collection configuration. The Proxy determines whether the ,service discovery request meets the preset instance aggregation condition. If it does not meet ,the condition, for example, there is only one target service instance, the original ,interface address of the target service instance is sent to the data monitoring ,module. The data monitoring module directly requests the relevant ,indicator data from the target service instance based on the ,interface address.
[0095] If the Proxy determines whether the service discovery request satisfies the preset instance aggregation conditions and determines that the instance aggregation conditions are met, the component interface address of the data capture interface of the proxy component is fed back to the data monitoring module, and the data collection request sent by the data monitoring module according to the component interface address is obtained. The Proxy pulls the corresponding multiple indicator data from the corresponding multiple target service instances to form multiple indicator data sets corresponding to the multiple target service instances, aggregates the multiple indicator data sets to obtain at least one aggregated indicator data, and sends at least one aggregated indicator data to the data monitoring module.
[0096] In summary, the method for processing indicator data of the embodiment of the present invention can aggregate the indicator data in the indicator data set according to the target service instance dimension to obtain aggregated indicator data after aggregation processing. The data magnitude of the aggregated indicator data is much smaller than the magnitude of the indicator data set corresponding to multiple service instances, thereby reducing the memory storage pressure of the data monitoring module and improving the stability of the data monitoring module's monitoring.
[0097] In order to implement the above embodiment, the present disclosure also proposes a device for processing indicator data.
[0098] Figure 5This is a schematic diagram of the structure of an indicator data processing device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated in a server including an agent component to process indicator data. Figure 5 As shown, the device includes: a first acquisition module 510, a second acquisition module 520, an aggregation processing module 530 and a sending module 540, wherein:
[0099] The first acquisition module 510 is used to acquire, through the proxy component, a data collection request sent by the data monitoring module according to the component interface address of the proxy component, wherein:
[0100] After the proxy component predetermines that multiple target service instances corresponding to the data collection request meet the preset instance aggregation condition, the component interface address is sent to the data monitoring module in advance;
[0101] A second acquisition module 520 is used to acquire an indicator data set corresponding to a data collection request according to each target service instance through a proxy component, so as to acquire multiple indicator data sets corresponding to multiple target service instances;
[0102] An aggregation processing module 530, configured to aggregate the multiple indicator data sets through the proxy component to obtain at least one aggregated indicator data, wherein the number of indicator data of the at least one aggregated indicator data is less than the total number of indicator data included in the multiple indicator data sets;
[0103] The sending module 540 is used to send at least one aggregated indicator data to the data monitoring module through the proxy component.
[0104] The indicator data processing device provided in the embodiments of the present disclosure can execute the indicator data processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0105] In some embodiments, it further comprises:
[0106] A third acquisition module is used to acquire the service discovery request sent by the data monitoring module through the proxy component;
[0107] A fourth acquisition module, used to acquire multiple target service instances corresponding to the service discovery request through the proxy component;
[0108] A first determination module, used to determine whether multiple target service instances meet a preset instance aggregation condition through a proxy component;
[0109] The second determination module is used to determine the data capture interface that communicates with the proxy component through the proxy component when the preset instance aggregation condition is met, and feed back the component interface address of the data capture interface to the data monitoring module.
[0110] In some implementations, the first determining module is specifically configured to:
[0111] Identify, by means of a proxy component, the number of service instances included in the plurality of target service instances;
[0112] The proxy component determines whether the number of service instances is greater than a preset instance number threshold, wherein when the number of service instances is greater than the preset instance number threshold, it is determined that the plurality of target service instances meet a preset instance aggregation condition.
[0113] In some implementations, the first determining module is specifically configured to:
[0114] Identify, by means of a proxy component, the number of service instances included in the plurality of target service instances;
[0115] determining, by the proxy component, a data magnitude of each of the plurality of target service instances;
[0116] Calculate, by the proxy component, a first product value of the data magnitude and the number of service instances;
[0117] The proxy component determines whether the first product value is greater than a preset data level threshold, wherein when the first product value is greater than the preset data level threshold, it is determined that the multiple target service instances meet the preset instance aggregation condition.
[0118] In some implementations, the first determining module is specifically configured to:
[0119] Identify all data tag types contained in each target service instance through the proxy component;
[0120] Determine the number of tag key values corresponding to each data tag type through the proxy component;
[0121] Calculate the second product value of the number of all tag key values corresponding to all data tag types through the proxy component;
[0122] The second product value is determined by the proxy component as the data level of each target service instance.
[0123] In some implementations, the aggregation processing module 530 is specifically configured to:
[0124] Identify the label key value of each indicator data in each indicator data set through the agent component;
[0125] The proxy component is used to divide and process the multiple indicator data sets according to the label key values to obtain multiple candidate data sets, wherein the label key values of the indicator data contained in each candidate data set are exactly the same, and the label key values of the indicator data contained in different candidate data sets are not exactly the same;
[0126] Aggregate at least one candidate data set through a proxy component to obtain at least one aggregated indicator data.
[0127] In some implementations, the aggregation processing module 530 is specifically configured to:
[0128] Obtain all attribute values corresponding to all indicator data contained in each candidate data set through the proxy component;
[0129] All attribute values corresponding to each candidate data set are summed up through the proxy component to obtain a sum value;
[0130] Generate aggregated indicator data based on all label key values and corresponding sum values contained in each candidate data set through the proxy component;
[0131] At least one aggregate indicator data is obtained through the proxy component according to all aggregate indicator data corresponding to at least one candidate data set.
[0132] The indicator data processing device provided in the embodiments of the present disclosure can execute the indicator data processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0133] In order to implement the above embodiments, the present disclosure also proposes a computer program product, including a computer program / instruction, which implements the method for processing indicator data in the above embodiments when executed by a processor.
[0134] Figure 6 A schematic diagram of the structure of a server provided in an embodiment of the present disclosure.
[0135] The following specific reference Figure 6 , which shows a schematic diagram of a structure suitable for implementing the server 600 in the embodiment of the present disclosure. The server 600 in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0136] like Figure 6As shown, the server 600 may include an agent component 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a memory 608 to a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the server 600 are also stored. The agent component 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0137] Typically, the following devices may be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication devices 609 may allow the server 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The server 600 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.
[0138] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the memory 608, or installed from the ROM 602. When the computer program is executed by the agent component 601, the above-mentioned functions defined in the method for processing indicator data of the embodiment of the present disclosure are executed, wherein the communication device 609 can be a data monitoring module of the embodiment of the present disclosure.
[0139] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0140] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0141] The computer-readable medium may be included in the server, or may exist independently without being installed in the server.
[0142] The computer-readable medium carries one or more programs. When the one or more programs are executed by the server, the server executes the method for processing the indicator data.
[0143] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0144] For example, if the obtained indicator data includes the user's web page access records, it is necessary to send a prompt message to the user, and the corresponding indicator data is obtained only after the user's authorization. As an optional but non-limiting implementation method, in response to receiving the user's active request, the method of sending the prompt message to the user can be, for example, a pop-up window, and the prompt message can be presented in text form in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the server.
[0145] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0146] The server may be written in one or more programming languages or a combination thereof to write computer program code for performing the operations of the present disclosure, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0147] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0148] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, constitute a limitation on the unit itself.
[0149] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0150] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0151] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0152] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0153] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for processing indicator data, characterized in that: The method is applied in a server, in which an agent component and a data monitoring module are pre-installed, and the method comprises the following steps: The data acquisition request sent by the data monitoring module according to the component interface address of the proxy component is obtained through the proxy component, wherein: After the proxy component predetermines that a plurality of target service instances corresponding to the data collection request meet a preset instance aggregation condition, the component interface address is pre-sent to the data monitoring module; Obtaining, by the proxy component, an indicator data set corresponding to the data collection request according to each of the target service instances, so as to obtain multiple indicator data sets corresponding to the multiple target service instances; Aggregating the multiple indicator data sets through the proxy component to obtain at least one aggregated indicator data, wherein the number of indicator data of the at least one aggregated indicator data is less than the total number of indicator data included in the multiple indicator data sets; The at least one aggregated indicator data is sent to the data monitoring module through the proxy component.
2. The method according to claim 1, characterized in that Before obtaining the data acquisition request sent by the data monitoring module according to the component interface address of the proxy component through the proxy component, the method further includes: Acquire, through the proxy component, a service discovery request sent by the data monitoring module; Acquire, through the proxy component, multiple target service instances corresponding to the service discovery request; Determining, by the proxy component, whether the multiple target service instances satisfy the preset instance aggregation condition; When the preset instance aggregation condition is met, the data capture interface communicating with the proxy component is determined by the proxy component, and the component interface address of the data capture interface is fed back to the data monitoring module.
3. The method according to claim 2, characterized in that The determining, by the proxy component, whether the multiple target service instances satisfy the preset instance aggregation condition includes: identifying, by the proxy component, the number of service instances included in the plurality of target service instances; The proxy component determines whether the number of service instances is greater than a preset instance number threshold, wherein when the number of service instances is greater than the preset instance number threshold, it is determined that the multiple target service instances meet the preset instance aggregation condition.
4. The method according to claim 2, characterized in that The determining, by the proxy component, whether the multiple target service instances satisfy the preset instance aggregation condition includes: identifying, by the proxy component, the number of service instances included in the plurality of target service instances; Determining, by the proxy component, a data magnitude of each target service instance in the plurality of target service instances; Calculate, by the proxy component, a first product value of the data magnitude and the number of service instances; The proxy component determines whether the first product value is greater than a preset data level threshold, wherein when it is greater than the preset data level threshold, it is determined that the multiple target service instances meet the preset instance aggregation condition.
5. The method according to claim 4, characterized in that The determining, by the proxy component, the data level of each target service instance in the multiple target service instances includes: Identify all data tag types contained in each target service instance through the proxy component; Determine the number of tag key values corresponding to each of the data tag types through the proxy component; Calculate, by the proxy component, a second product value of the number of all tag key values corresponding to all data tag types; The second product value is determined by the proxy component as the data level of each target service instance.
6. The method according to any one of claims 1 to 5, characterized in that: The aggregating the plurality of indicator data sets by the proxy component to obtain at least one aggregated indicator data includes: Identify, by the proxy component, a tag key value of each indicator data in each indicator data set; The proxy component divides the multiple indicator data sets according to the tag key value to obtain multiple candidate data sets, wherein the tag key value of the indicator data contained in each candidate data set is exactly the same, and the tag key values of the indicator data contained in different candidate data sets are not exactly the same; Aggregate the at least one candidate data set through the proxy component to obtain the at least one aggregated indicator data.
7. The method according to claim 6, characterized in that The aggregating the at least one candidate data set by the proxy component to obtain the at least one aggregated indicator data includes: Acquire, through the proxy component, all attribute values corresponding to all indicator data contained in each of the candidate data sets; Sum all the attribute values corresponding to each of the candidate data sets by the proxy component to obtain a sum value; Generate aggregated indicator data according to all tag key values and corresponding sum values contained in each of the candidate data sets by the proxy component; The at least one aggregate indicator data is obtained through the proxy component according to all aggregate indicator data corresponding to the at least one candidate data set.
8. A device for processing index data, characterized in that: The device is applied in a server, in which an agent component and a data monitoring module are pre-installed, and the device comprises: The first acquisition module is used to acquire, through the proxy component, a data collection request sent by the data monitoring module according to the component interface address of the proxy component, wherein: After the proxy component predetermines that a plurality of target service instances corresponding to the data collection request meet a preset instance aggregation condition, the component interface address is pre-sent to the data monitoring module; A second acquisition module, configured to acquire, through the proxy component, an indicator data set corresponding to the data collection request according to each of the target service instances, so as to acquire multiple indicator data sets corresponding to the multiple target service instances; an aggregation processing module, configured to perform aggregation processing on the plurality of indicator data sets through the proxy component to obtain at least one aggregated indicator data, wherein the number of indicator data of the at least one aggregated indicator data is less than the total number of indicator data included in the plurality of indicator data sets; A sending module is used to send the at least one aggregated indicator data to the data monitoring module through the proxy component.
9. A server, characterized in that: The server comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the indicator data processing method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to execute the indicator data processing method described in any one of claims 1 to 7.
