Sampling rate determination method and related equipment

By obtaining and calculating the initial sampling rate of multiple indicator parameters, the target sampling rate of the distributed system is determined, which solves the problem in the existing technology that the sampling rate determination relies on manual experience, improves the accuracy and efficiency of the sampling rate, and achieves a better Precise data sampling.

CN118659984APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410601012.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Existing distributed full-link monitoring relies on manual experience settings to determine the sampling rate, resulting in poor sampling rate accuracy and inability to effectively reflect the multi-dimensional characteristics of the application.

Method used

By obtaining multiple indicator parameters associated with the application, the initial sampling rate of each indicator parameter is determined respectively, and the target sampling rate is calculated based on these initial sampling rates, which is used to sample the link data of the business request.

Benefits of technology

It improves the accuracy and efficiency of determining the sampling rate, can more accurately reflect the multi-dimensional characteristics of the application, reduces manual intervention, and enhances the data sampling effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118659984A
    Figure CN118659984A
Patent Text Reader

Abstract

The invention provides a sampling rate determination method and related equipment, and the method comprises the steps: obtaining N index parameters related to an application, and N is an integer greater than 1; for each index parameter in the N index parameters, determining an initial sampling rate of the index parameter; and determining a target sampling rate of the application according to the initial sampling rate of the N index parameters, the target sampling rate of the application being used for sampling link data of a service request of the application, so as to improve the accuracy of the obtained sampling rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a sampling rate determination method and related equipment. Background Art

[0002] At present, the distributed system architecture can be divided into multiple service nodes according to the business. The business request of a user of the application can first reach a service node, and then reach other service nodes through link calls. After a series of business logic calculations, the response data is returned to the user. Each business request will form a call chain.

[0003] Most of the existing distributed full-link monitoring focuses on how to build high concurrency, high reliability, application-level transparency, visualization, and scalability. During the link monitoring process, it is necessary to implement sampling monitoring of the monitored data according to the sampling rate of the application. The current common way to determine the sampling rate is to manually set a fixed sampling rate based on experience, which easily leads to poor sampling rate accuracy. Summary of the invention

[0004] The embodiments of the present application provide a sampling rate determination method and related devices, which are beneficial to improving the accuracy of sampling rate determination.

[0005] In order to solve the above technical problems, this application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for determining a sampling rate, comprising:

[0007] Get N indicator parameters associated with the application, where N is an integer greater than 1;

[0008] For each indicator parameter of the N indicator parameters, determining an initial sampling rate of the indicator parameter;

[0009] The target sampling rate of the application is determined according to the initial sampling rates of the N indicator parameters, and the target sampling rate of the application is used to sample the link data of the service request of the application.

[0010] In a second aspect, an embodiment of the present application further provides a sampling rate determination device, comprising:

[0011] The acquisition module is used to obtain N indicator parameters associated with the application, where N is an integer greater than 1;

[0012] A determination module, used to determine, for each of the N indicator parameters, an initial sampling rate corresponding to the indicator parameter;

[0013] The determination module is used to determine the target sampling rate of the application according to the initial sampling rates corresponding to the N indicator parameters, and the target sampling rate of the application is used to sample the link data of the service request of the application.

[0014] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the above-mentioned sampling rate determination method when executing the computer program.

[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned sampling rate determination method are implemented.

[0016] In a fifth aspect, an embodiment of the present application further provides a computer program product, comprising a computer program, which implements the steps of the above method when executed by a processor.

[0017] In an embodiment of the present application, N index parameters associated with the application are first obtained, and for each of the N index parameters, the initial sampling rate of the index parameter is determined, so that the initial sampling rate of each of the N index parameters can be determined, and then the target sampling rate of the application is determined using the initial sampling rate of the N index parameters. The target sampling rate of the application is used to sample the link data of the service request of the application, that is, in the process of determining the target sampling rate, on the one hand, there is no need to manually set the sampling rate based on experience, but it is automatically determined by the index parameters associated with the application, thereby improving the efficiency of determining the sampling rate. The embodiment of the present application considers the index parameters associated with the application to determine the sampling rate of the application, and the index parameters can characterize the characteristics related to the application, so as to improve the accuracy of the determined target sampling rate. On the other hand, in the process of determining the sampling rate according to the index parameters, it is not only dependent on a single index parameter, but multiple (N) index parameters are used, and the N index parameters can reflect the relevant characteristics of more applications, thereby further improving the accuracy of the sampling rate determination. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 is a flow chart of a sampling rate determination method provided in an embodiment of the present application;

[0020] Figure 2 is a schematic diagram of a sampling rate determination method provided in an embodiment of the present application;

[0021] Figure 3 is a structural schematic diagram of a sampling rate determination device provided in an embodiment of the present application;

[0022] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] See also Figure 1 , Figure 1 1 is a flow chart of a sampling rate determination method provided by an embodiment of the present application. The sampling rate determination method of this embodiment can be applied to electronic devices, which can be terminal devices or server devices, etc. The terminal device can be a mobile device or a non-mobile device. The server can be an independent physical server, or a cluster composed of multiple servers, or the server can also be a cloud server capable of cloud computing. Figure 1 As shown, the sampling rate determination method may include the following steps:

[0025] Step 101: Obtain N indicator parameters associated with the application.

[0026] In this embodiment, multiple indicator parameters associated with the application dimension are collected. It should be understood that the indicator parameters of the embodiment of the present application represent application-related characteristics. For example, N indicator parameters may include, but are not limited to, application level, number of abnormal requests, number of abnormal logs, number of slow requests (which can be understood as requests that take longer than a preset time threshold), number of error queries (SQL), number of slow SQLs, preset percentile values ​​of request response time (e.g., 90 percentile values), interface information, user type information, resource information (e.g., access information, etc., such as information to be queried corresponding to a business request (e.g., credit information of a user corresponding to a payment request), etc.) and at least two of the tag information. The above indicator parameters can be used to represent the application level, core business, core business interface, error rate and other related characteristics of the application, that is, to represent the characteristics of multiple dimensions of the application.

[0027] In addition, it should be noted that the above-mentioned application can also be called application software, and can be composed of multiple application programs. The application in this embodiment can be any application, and optionally, can be any application that can process requests, etc.

[0028] Step 102: For each indicator parameter among the N indicator parameters, determine an initial sampling rate of the indicator parameter.

[0029] For each of the N indicator parameters, the corresponding initial sampling rate can be determined according to the indicator parameter. Each indicator parameter has a corresponding initial sampling rate, and N initial sampling rates can be determined.

[0030] Step 103: Determine a target sampling rate of the application according to the initial sampling rates of the N indicator parameters. The target sampling rate is used to sample link data of the service request of the application.

[0031] It should be understood that the target sampling rate is used to sample the business requests of the application, and to collect the link data of the sampled business requests, so as to achieve the sampling of the link data of the business request. It should be noted that the above-mentioned business request may be a business request initiated in one of the above-mentioned applications. Since the application may be composed of multiple application programs, optionally, the business request may be an application request sent to a certain application in the application. For example, for a chat application A, which includes multiple applications, such as a voice chat program, a video chat program, a file sharing program, etc., the business request may be a voice request, a video request, or a file sharing request, etc. Exemplarily, the link data of the business request may include the tracking data of each node in the call chain of the business request, and the tracking information may include the request response time, the response status, etc.

[0032] In an embodiment of the present application, N index parameters associated with the application are first obtained, and for each of the N index parameters, the initial sampling rate of the index parameter is determined, so that the initial sampling rate of each of the N index parameters can be determined, and then the target sampling rate of the application is determined using the initial sampling rate of the N index parameters. The target sampling rate of the application is used to sample the link data of the service request of the application, that is, in the process of determining the target sampling rate, on the one hand, there is no need to manually set the sampling rate based on experience, but it is automatically determined by the index parameters associated with the application, thereby improving the efficiency of determining the sampling rate. The embodiment of the present application considers the index parameters associated with the application to determine the sampling rate of the application, and the index parameters can characterize the characteristics related to the application, so as to improve the accuracy of the determined target sampling rate. On the other hand, in the process of determining the sampling rate according to the index parameters, it is not only dependent on a single index parameter, but multiple (N) index parameters are used, and the N index parameters can reflect the relevant characteristics of more applications, thereby further improving the accuracy of the sampling rate determination.

[0033] In one embodiment, determining the initial sampling rate of the indicator parameter includes: determining the initial sampling rate of the indicator parameter according to the indicator parameter type to which the indicator parameter belongs.

[0034] That is, for each indicator parameter, its corresponding initial sampling rate can be determined according to the indicator parameter type to which it belongs. It can be understood that for different types of indicator parameters, the corresponding initial sampling rates can be determined by different sampling rate calculation methods.

[0035] In this embodiment, for different types of indicator parameters, corresponding initial sampling rates are determined by different sampling rate calculation methods, so as to improve the rationality of the initial sampling rates of different types of indicator parameters.

[0036] In one embodiment, the N indicator parameters include at least two types of indicator parameters: static indicator parameters, statistical indicator parameters, and request attribute indicator parameters; determining the initial sampling rate of the indicator parameters according to the indicator parameter type to which the indicator parameters belong, including:

[0037] When the indicator parameter belongs to a static indicator parameter, the indicator parameter is compared with a preset threshold value, and an initial sampling rate of the indicator parameter is determined according to the comparison result;

[0038] In the case where the indicator parameter is a statistical indicator parameter, determining an initial sampling rate of the indicator parameter according to the indicator parameter in the current time window and the indicator parameter in the first historical time window;

[0039] In the case where the indicator parameter belongs to the request attribute type indicator parameter, whether the indicator parameter of the application is within the preset configuration range is detected, and the initial sampling rate corresponding to the indicator parameter is determined according to the detection result.

[0040] That is, the N indicator parameters can be divided into multiple categories, each category of indicator parameters can include at least one indicator parameter, and the indicator parameters in different categories of indicator parameters are different. In this embodiment, the same method is used to determine the corresponding initial sampling rate for the same indicator parameters of the above three categories of indicator parameters, and different methods are used to determine the corresponding initial sampling rates for the above three different indicator parameters, so as to improve the rationality of the determined initial sampling rate.

[0041] Exemplarily, the start time of the current time window differs from the start time of the first historical time window by a preset number of days, such as 1 day. If the start time of the current time window is 8 a.m. today, the start time of the first historical time window is 8 a.m. yesterday. Exemplarily, static indicator parameters may include but are not limited to application level, and correspondingly, the preset threshold may be a preset level threshold. Exemplarily, statistical indicator parameters may include but are not limited to at least one of the following: the number of abnormal requests, the number of abnormal logs, the number of slow requests (which can be understood as requests that take longer than a preset duration threshold), the number of error queries (SQL), the number of slow SQLs, and the preset percentile value (e.g., 90 percentile) of the request response time. The request attribute indicator parameters may include at least one of the following: interface information, user type information, resource information (for example, access information, etc., for example, information to be queried corresponding to the business request (for example, the credit information of the user corresponding to the payment request), etc.) and at least one of the tag information. Each indicator parameter in the request attribute indicator parameters has a corresponding preset configuration range. For interface information, the corresponding preset configuration range is the preset core interface list, for user type information, the corresponding preset configuration range is the preset core user type list, for resource information, the corresponding preset configuration range is the preset core resource information list, and the tag information corresponds to the preset configuration range as the preset core tag list. Detecting whether the request attribute indicator parameters of the application belong to the preset configuration range can be understood as at least one of the following: detecting whether the interface information belongs to the preset core interface list, that is, detecting whether it is core interface information; detecting whether the user information belongs to the preset core user list, that is, detecting whether it is a core user; detecting whether the resource information belongs to the preset core resource information list, that is, detecting whether it is core resource information; detecting whether the tag information belongs to the preset core tag list, that is, detecting whether there is a core tag.

[0042] In one embodiment, the current time window and the first historical time window are both divided into M time periods, where M is an integer greater than 1, and the length of each time period is the same; according to the indicator parameters in the current time window and the indicator parameters in the first historical time window, determining the initial sampling rate of the indicator parameters includes:

[0043] Calculate a first difference between an indicator parameter in a first time period in a current time window and an indicator parameter in a first time period in a first historical time window;

[0044] Calculate a second difference between the indicator parameter in the Mth time period in the current time window and the indicator parameter in the Mth time period in the first historical time window;

[0045] An initial sampling rate of the indicator parameter is determined according to a difference between the second difference and the first difference, and a duration of a time period.

[0046] For example, the current time window is from 8:00 to 8:05 on the current day, and the first historical time window is from 8:00 to 8:05 yesterday, both of which are 5 minutes long and can be divided into 5 time periods, each of which is 1 minute. The first time period is the first 1 minute of the time window, that is, from 8:00 to 8:01, and the fifth time period is the fifth 1 minute of the time window, that is, from 8:04 to 8:05. Exemplarily, the difference between the second difference and the first difference and the length of a time period can be used to determine the initial sampling rate of the indicator parameter.

[0047] In this embodiment, the initial sampling rate of the indicator parameters can be determined by comparing the indicator parameters in the current time window with the indicator parameters in the first historical time window and by comparing the difference between the indicator parameters in the current time window and the indicator parameters in the first historical time window to improve the accuracy of the initial sampling rate of the indicator parameters.

[0048] In one embodiment, determining a target sampling rate of an application according to initial sampling rates of N indicator parameters includes:

[0049] For each indicator parameter of the N indicator parameters, obtain a target weight of the indicator parameter;

[0050] According to the target weights of the N indicator parameters, the initial sampling rates of the N indicator parameters are weighted and summed to obtain the target sampling rate of the application.

[0051] Since the importance of each indicator parameter is different, in the process of determining the target sampling rate using N indicator parameters, the target weight of each indicator parameter in the N indicator parameters can be obtained, that is, N target weights are obtained. The target weight of the indicator parameter can characterize the importance of the indicator parameter. According to the target weights of the N indicator parameters, the initial sampling rates corresponding to the N indicator parameters are weighted and summed to obtain the target sampling rate of the application, so as to improve the rationality of the obtained target sampling rate.

[0052] In one embodiment, the N indicator parameters include at least two types of indicator parameters: static indicator parameters, statistical indicator parameters, and request attribute indicator parameters; obtaining target weights of the indicator parameters includes:

[0053] In the case where the indicator parameter belongs to the static indicator parameter or the request attribute indicator parameter, determining the preset initial weight of the indicator parameter as the target weight of the indicator parameter;

[0054] In the case that the indicator parameter belongs to the statistical indicator parameter, the minimum value between the preset maximum weight of the indicator parameter and the dynamic weight of the indicator parameter is determined as the target weight of the indicator parameter, and the dynamic weight of the indicator parameter is the product of the initial sampling rate corresponding to the indicator parameter and the preset initial weight of the indicator parameter.

[0055] It should be understood that for each indicator parameter, a corresponding preset initial weight and preset maximum weight can be preset. It should be noted that the preset initial weight and the preset maximum weight can be preset based on experience or actual needs. In this embodiment, for static indicator parameters, the preset initial weight corresponding to the static indicator parameters can be used as the target weight of the static indicator parameters. For request attribute indicator parameters, the preset initial weight corresponding to the request attribute indicator parameters can be used as the target weight of the request attribute indicator parameters. For statistical indicator parameters, their weights can be adjusted dynamically. The smallest one can be selected from the preset maximum weight and the dynamic weight as the target weight. The dynamic weight can be obtained according to the product of the initial sampling rate corresponding to the statistical indicator parameter and the preset initial weight corresponding to the statistical indicator parameter. The initial sampling rate is obtained through the statistical indicator parameter. The results of the statistical indicator parameters can be different at different times. That is, as the statistical indicator parameters change, the initial sampling rate can change, so that the corresponding dynamic weight can also change accordingly, so as to achieve dynamic adjustment of the weight.

[0056] In this embodiment, for different types of indicator parameters, different methods are used to determine the corresponding target weights to improve the rationality of the target weights. Through the target weights of N indicator parameters, the initial sampling rates corresponding to the N indicator parameters are weighted and summed to obtain the target sampling rate of the application, thereby improving the rationality of the obtained target sampling rate.

[0057] In one embodiment, obtaining N indicator parameters associated with the application includes:

[0058] Get N indicator parameters in each time window, the start time of the first time window is the preset time, the time difference between the start times of two adjacent time windows is the preset time step, and the duration of each time window is the preset duration;

[0059] The initial sampling rate of the indicator parameter includes the initial sampling rate of the indicator parameter in each time window, and the target sampling rate includes the target sampling rate in each time window.

[0060] It can be understood that the N indicator parameters associated with the application are obtained once every preset time step, and each time the N indicator parameters associated with the application are obtained, the N indicator parameters within a time window (historical time window) are obtained, and the duration between the end time and the start time of any time window is the preset duration. It should be understood that the preset time can be set according to the actual situation. For example, the preset time can be the time to start the sampling rate determination process, etc.

[0061] In this embodiment, a preset time step is used at each interval to obtain N indicator parameters within the time window. The initial sampling rate of each indicator parameter within the time window is determined by using the N indicator parameters within the time window, and the target sampling rate within the time window can be determined. The target sampling rate can be determined for each time window in this way, thereby determining the target sampling rate within each time window to improve the timeliness of the target sampling rate.

[0062] In one embodiment, after determining the target sampling rate of the application according to the initial sampling rates of the N indicator parameters, the following steps are included:

[0063] The target sampling rate is transmitted to the distributed monitoring system, and the distributed monitoring system is used to sample the link data of the business request of the application according to the target sampling rate.

[0064] That is, after the target sampling rate is calculated, it can be transmitted to the distributed monitoring system, and the distributed monitoring system performs sampling according to the target sampling rate. Since the target sampling rate of the application in this application takes into account application-related parameters, that is, N indicator parameters associated with the application, the N initial sampling rates are determined using the N indicator parameters of the application, and then the target sampling rate determined using the N initial sampling rates is used to improve the rationality of the target sampling rate, and the link data of the application's business request is sampled, which can improve the data sampling effect. Exemplarily, the link data of the sampled business request can also be stored for subsequent calls and business problem troubleshooting.

[0065] The above method is described in detail below with reference to some specific embodiments. The sampling rate determination method of this embodiment can be applied to link data sampling scenarios of applications, etc.

[0066] Table 1

[0067]

[0068] like Figure 2 As shown, the core of the embodiment of the present application lies in the sampling rate calculation. The application sampling rate calculation index, that is, the index parameter, is determined from multiple dimensions (for example, application level, core business label, core business interface, error rate (which can characterize application performance), etc.). In the embodiment of the present application, the index parameter can be as shown in Table 1 above.

[0069] The preset weight indicates the sampling rate weight of the preset current indicator in the calculation rules; whether it is a dynamic weight indicates whether the current indicator weight is adjusted according to the month-on-month fluctuation of the indicator; the preset maximum weight indicates the preset maximum weight value that can account for the sampling rate when the indicator parameters are adjusted; the description is a detailed explanation of the current indicator parameters; the sampling calculation rule is the calculation method of the indicator fluctuation.

[0070] The detailed calculation method of the three types of indicator parameters in the embodiment of the present application is shown in Table 2.

[0071] Table 2

[0072]

[0073] Taking the above 11 parameter indicators as an example, Rt=F1+F2+F3+F4+F5+F6+F7+F8+F9+F10+F11, Rt represents the final target sampling rate, Rt<=100%, that is, the maximum sampling rate does not exceed 1, that is, all sampling, and 0 represents no sampling. Fi represents the weighted initial sampling rate corresponding to the i-th indicator parameter; F represents the sampling rate of a single indicator, and the calculation formula is Fx=Wx*Rx, Rx is the initial sampling rate of the current indicator parameter, and the calculation formula is shown in the table above. Wx is the final weight value (target weight) of the indicator. If the indicator rule is dynamic weight, then Wx = min (Wmax, Rx*W), that is, the maximum weight and the indicator ratio multiplied by the minimum weight. When Rx*W is less than the maximum weight, Wx is equal to Rx*W. When Rx*W is greater than the maximum weight value Wmax, Wx is equal to Wmax. If the indicator rule is not dynamic weight, then Wx = W, that is, when it is not a dynamic weight, the preset weight is used for calculation. The target sampling rate Rt of the final application is Rt<=100%, and if Rt is greater than 100%, it is 100%.

[0074] The sampling rate data queries the existing application indicator data. The target sampling rate calculated in the previous step is stored in the redis cache. Every minute (preset time step) there is detailed sampling rate data for each application, including the sampling value calculated for each indicator parameter. According to the system design, there are 4 custom indicator values ​​that can be configured separately for each application: app.coreInterface, app.coreUsers, app.coreResources, and app.coreTags. Each application can define the core business interface, core access user, core resource directory, and core tag label. If the data requested by the application this time belongs to the core business data defined by the user, the sampling rate is increased. These four interfaces are to increase the marginal benefits of monitoring data collection. First, the value of various data in the system must be clarified, and then the core resources are defined based on this. We configure or adjust our sampling strategy according to time and place, so that the core business must be monitored. In most services within the enterprise, there will also be a distinction between core business logic and some daily conversation logic. For example, for the company's credit service, the entire process of the credit application form may have a higher priority than querying the credit list or user information interface. For this type of business logic, we support accurate filtering of core business workflows through the dimensions of services, interfaces, and TAGS (labels). By configuring a higher or 100% sampling rate for these business-related links, we can ensure that important / difficult to reproduce business failures can be quickly analyzed and resolved.

[0075] According to the design, the collected monitoring data (link data, etc.) is sent to the collector through the application agent (APP agent), and the collector stores the data in other storage components such as Hbase and ES database. The collector also sends the data to the aggregated real-time computing engine flink for index aggregation calculation, and stores the calculated index parameters in the ES (ElsticSearch) database. The collector queries the application sampling rate cached in Redis according to the application name and performs dynamic sampling on the data server. The data flow entering the Collector needs to pass through the sampling rate valve to control data sampling, so that important business data can be more accurately stored in the database (DataBase).

[0076] The core calculation sampling rate module uses the flink streaming computing engine to implement sampling rate calculation:

[0077] a) First create a query object to pull indicator data from the database;

[0078] b) Then add the query object as a data source to the flink execution environment to obtain a DataStreamSource;

[0079] c) Call the flatMap method of the indicator object (query object) to convert the library's message data into sampling rate indicator data that can be calculated. The data type is Tuple2<String,Map> ;

[0080] d) Call the assignTimestampsAndWatermarks method of the indicator object, and use the timestamp field timestamp as the time watermark. All time-related calculations are based on this field of the indicator;

[0081] e) Call the keyBy(0) method of the indicator object to split the data using the application name field of each indicator to ensure that the data calculated in each data stream is the data of the same application;

[0082] f) Call the timeWindow(Time.minutes(5),Time.minutes(1)) method of the indicator object to create a sliding time window based on the application stream data. The window length is 5 minutes and the window sliding length is 1 minute (step length). That is, the data within 5 minutes of the application will be aggregated into one window. After the calculation is completed, the window time will move forward one minute;

[0083] g) Call the apply() method of the indicator object and implement the final sampling rate method within the method;

[0084] h) Call the map() method of the indicator object, fine-tune the data within the method, and then send it to the redis cache.

[0085] Flink: It is an open source stream processing framework developed by the Apache Software Foundation. Its core is a distributed stream data flow engine written in Java and Scala. Flink executes any stream data program in a data parallel and pipeline manner. Flink's pipeline runtime system can execute batch and stream processing programs. In addition, the Flink runtime itself also supports the execution of iterative algorithms. Sampling rate calculation Flink reads database indicator data, creates a 5-minute sliding window according to application diversion, and the window step is 1 minute. The sampling rate of each application is calculated in each window, and the single indicator sampling value Fx=Wx*Rx is calculated based on the sampling rate. Then, the final sampling rate Rt=F1+F2+…+F11 is calculated based on multiple indicators to obtain the final target sampling rate of the application, and then the data is sent to the redis cache for use by the collector.

[0086] Through the scheme of the embodiment of the present application, the sampling rate of the current application can be automatically calculated according to the importance of multiple indicator parameters of the application relative to the business, without manual intervention. Compared with the need to manually configure different sampling rates for different applications based on manual experience, the problem of low sampling rate accuracy, the present application can calculate the sampling rate through the indicator parameters of the application to improve the accuracy of the sampling rate. In addition, based on the real-time streaming calculation of flink, the real-time nature of the data can be guaranteed. When the key indicators of the application fluctuate, the preset time step (for example, within 1 minute) can accurately change the sampling rate of the application. At the same time, the control interface and Tag label of multiple key indicators can be customized according to the importance of the business, and the sampling rate can be flexibly controlled. When there is a problem with the business, the abnormal and important monitoring data can be saved, which is convenient for users to troubleshoot problems and also reduces the storage overhead of data.

[0087] See also Figure 3 , Figure 3 3 is a structural diagram of a sampling rate determination device 300 provided in an embodiment of the present application, which can implement the details of the sampling rate determination method in the above embodiment and achieve the same effect. Figure 3 As shown, the sampling rate determination device 300 includes:

[0088] The acquisition module 301 is used to acquire N indicator parameters associated with the application, where N is an integer greater than 1;

[0089] A determination module 302 is used to determine, for each of the N indicator parameters, an initial sampling rate corresponding to the indicator parameter;

[0090] The determination module 302 is used to determine the target sampling rate of the application according to the initial sampling rates corresponding to the N indicator parameters. The target sampling rate of the application is used to sample the link data of the service request of the application.

[0091] In one embodiment, determining an initial sampling rate of an indicator parameter includes:

[0092] An initial sampling rate of the indicator parameter is determined according to the indicator parameter type to which the indicator parameter belongs.

[0093] In one embodiment, the N indicator parameters include at least two types of indicator parameters: static indicator parameters, statistical indicator parameters, and request attribute indicator parameters;

[0094] The determination module 302 is specifically configured to:

[0095] When the indicator parameter belongs to a static indicator parameter, the indicator parameter is compared with a preset threshold value, and an initial sampling rate of the indicator parameter is determined according to the comparison result;

[0096] In the case where the indicator parameter is a statistical indicator parameter, determining an initial sampling rate of the indicator parameter according to the indicator parameter in the current time window and the indicator parameter in the first historical time window;

[0097] In the case where the indicator parameter belongs to the request attribute type indicator parameter, whether the indicator parameter of the application is within the preset configuration range is detected, and the initial sampling rate corresponding to the indicator parameter is determined according to the detection result.

[0098] In one embodiment, the current time window and the first historical time window are both divided into M time periods, where M is an integer greater than 1, and the length of each time period is the same. According to the indicator parameters in the current time window and the indicator parameters in the first historical time window, the initial sampling rate of the indicator parameters is determined, including:

[0099] Calculate a first difference between an indicator parameter in a first time period in a current time window and an indicator parameter in a first time period in a first historical time window;

[0100] Calculate a second difference between the indicator parameter in the Mth time period in the current time window and the indicator parameter in the Mth time period in the first historical time window;

[0101] An initial sampling rate of the indicator parameter is determined according to a difference between the second difference and the first difference, and a duration of a time period.

[0102] In one embodiment, the determination module 302 includes:

[0103] A weight acquisition unit, used for acquiring a target weight of each indicator parameter among the N indicator parameters;

[0104] The sampling rate determination unit is used to perform weighted summation on the initial sampling rates of the N indicator parameters according to the target weights of the N indicator parameters to obtain the target sampling rate of the application.

[0105] In one embodiment, the N indicator parameters include at least two types of indicator parameters: static indicator parameters, statistical indicator parameters, and request attribute indicator parameters;

[0106] The weight acquisition unit is specifically used for:

[0107] In the case where the indicator parameter belongs to the static indicator parameter or the request attribute indicator parameter, determining the preset initial weight of the indicator parameter as the target weight of the indicator parameter;

[0108] In the case that the indicator parameter belongs to the statistical indicator parameter, the minimum value between the preset maximum weight of the indicator parameter and the dynamic weight of the indicator parameter is determined as the target weight of the indicator parameter, and the dynamic weight of the indicator parameter is the product of the initial sampling rate corresponding to the indicator parameter and the preset initial weight of the indicator parameter.

[0109] In one embodiment, the acquisition module 301 includes:

[0110] Get N indicator parameters in each time window, the start time of the first time window is the preset time, the time difference between the start times of two adjacent time windows is the preset time step, and the duration of each time window is the preset duration;

[0111] The initial sampling rate of the indicator parameter includes the initial sampling rate of the indicator parameter in each time window, and the target sampling rate includes the target sampling rate in each time window.

[0112] In one embodiment, the apparatus 300 further includes:

[0113] The transmission module is used to transmit the target sampling rate to the distributed monitoring system, and the distributed monitoring system is used to sample the link data of the application's business request according to the target sampling rate.

[0114] The sampling rate determination device 300 provided in the embodiment of the present application can implement each process of the sampling rate determination method in the above embodiment, and will not be described again here to avoid repetition.

[0115] Figure 4 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present application.

[0116] The electronic device 400 includes but is not limited to: a radio frequency unit 401, a network module 402, an audio output unit 403, an input unit 404, a sensor 405, a display unit 406, a user input unit 407, an interface unit 408, a memory 409, a processor 410, and a power supply 411. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present application, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.

[0117] The electronic device 400 provided in the embodiment of the present application can implement each process of the sampling rate determination method of the above-mentioned embodiments, and also has the same beneficial technical effects as the above-mentioned sampling rate determination method embodiments, and the details will not be repeated here.

[0118] It should be understood that in the embodiment of the present application, the radio frequency unit 401 can be used for receiving and sending signals during information transmission or calls. Specifically, after receiving downlink data from the base station, it is sent to the processor 410 for processing; in addition, the uplink data is sent to the base station. Generally, the radio frequency unit 401 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 401 can also communicate with the network and other devices through a wireless communication system.

[0119] The electronic device provides users with wireless broadband Internet access through the network module 402, such as helping users to send and receive emails, browse web pages, and access streaming media.

[0120] The audio output unit 403 can convert the audio data received by the RF unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output it as sound. Moreover, the audio output unit 403 can also provide audio output related to a specific function performed by the electronic device 400 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 403 includes a speaker, a buzzer, a receiver, etc.

[0121] The input unit 404 is used to receive audio or video signals. The input unit 404 may include a graphics processor (GPU) 4041 and a microphone 4042, and the graphics processor 4041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 406. The image frame processed by the graphics processor 4041 can be stored in the memory 409 (or other storage medium) or sent via the radio frequency unit 401 or the network module 402. The microphone 4042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 401 in the case of a telephone call mode.

[0122] The electronic device 400 also includes at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 4061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 4061 and / or the backlight when the electronic device 400 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 405 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.

[0123] The display unit 406 is used to display information input by the user or information provided to the user. The display unit 406 may include a display panel 4061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0124] The user input unit 407 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 407 includes a touch panel 4071 and other input devices 4072. The touch panel 4071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 4071 or near the touch panel 4071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 4071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 410, receives the command sent by the processor 410 and executes it. In addition, the touch panel 4071 can be implemented using various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 4071, the user input unit 407 may also include other input devices 4072. Specifically, other input devices 4072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.

[0125] Furthermore, the touch panel 4071 may be overlaid on the display panel 4061. When the touch panel 4071 detects a touch operation on or near it, it is transmitted to the processor 410 to determine the type of the touch event. Then, the processor 410 provides a corresponding visual output on the display panel 4061 according to the type of the touch event. Figure 4 In the figure, the touch panel 4071 and the display panel 4061 are two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 4071 and the display panel 4061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.

[0126] The interface unit 408 is an interface for connecting an external device to the electronic device 400. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 408 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 400 or may be used to transmit data between the electronic device 400 and an external device.

[0127] The memory 409 can be used to store software programs and various data. The memory 409 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 409 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0128] The processor 410 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 409, and calling data stored in the memory 409, so as to monitor the electronic device as a whole. The processor 410 may include one or more processing units; preferably, the processor 410 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 410.

[0129] The electronic device 400 may also include a power supply 411 (such as a battery) for supplying power to each component. Preferably, the power supply 411 may be logically connected to the processor 410 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.

[0130] In addition, the electronic device 400 includes some functional modules not shown, which will not be described in detail here.

[0131] Preferably, an embodiment of the present application also provides an electronic device, including a processor 410, a memory 409, and a computer program stored in the memory 409 and executable on the processor 410. When the computer program is executed by the processor 410, each process of the above-mentioned sampling rate determination method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0132] The embodiment of the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the various processes of the above-mentioned sampling rate determination method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0133] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned sampling rate determination method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0134] The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0135] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0136] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0137] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for determining a sampling rate, It is characterized in that include: Get N indicator parameters associated with the application, where N is an integer greater than 1; For each indicator parameter of the N indicator parameters, determining an initial sampling rate of the indicator parameter; The target sampling rate of the application is determined according to the initial sampling rates of the N indicator parameters, and the target sampling rate of the application is used to sample the link data of the service request of the application.

2. The method according to claim 1, It is characterized in that The determining of the initial sampling rate of the indicator parameter comprises: An initial sampling rate of the indicator parameter is determined according to the indicator parameter type to which the indicator parameter belongs.

3. The method according to claim 2, It is characterized in that The N indicator parameters include at least two types of indicator parameters: static indicator parameters, statistical indicator parameters, and request attribute indicator parameters; and determining the initial sampling rate of the indicator parameters according to the indicator parameter type to which the indicator parameters belong, including: In the case where the indicator parameter belongs to the static indicator parameter, comparing the indicator parameter with a preset threshold, and determining an initial sampling rate of the indicator parameter according to the comparison result; In the case where the indicator parameter belongs to the statistical indicator parameter, determining the initial sampling rate of the indicator parameter according to the indicator parameter in the current time window and the indicator parameter in the first historical time window; In the case where the indicator parameter belongs to the request attribute type indicator parameter, it is detected whether the indicator parameter of the application belongs to a preset configuration range, and the initial sampling rate corresponding to the indicator parameter is determined according to the detection result.

4. The method according to claim 3, It is characterized in that The current time window and the first historical time window both include M time periods, where M is an integer greater than 1, and the length of each time period is the same. The determining, according to the indicator parameter in the current time window and the indicator parameter in the first historical time window, the initial sampling rate of the indicator parameter includes: Calculate a first difference between the indicator parameter in a first time period in the current time window and the indicator parameter in a first time period in the first historical time window; Calculating a second difference between the indicator parameter in the Mth time period in the current time window and the indicator parameter in the Mth time period in the first historical time window; An initial sampling rate of the indicator parameter is determined according to a difference between the second difference and the first difference, and a duration of a time period.

5. The method according to claim 1, It is characterized in that The determining the target sampling rate of the application according to the initial sampling rates of the N indicator parameters includes: For each indicator parameter of the N indicator parameters, obtaining a target weight of the indicator parameter; According to the target weights of the N indicator parameters, the initial sampling rates of the N indicator parameters are weighted and summed to obtain the target sampling rate of the application.

6. The method according to claim 5, It is characterized in that The N indicator parameters include at least two types of indicator parameters: static indicator parameters, statistical indicator parameters, and request attribute indicator parameters; the step of obtaining the target weights of the indicator parameters includes: In the case where the indicator parameter belongs to a static indicator parameter or a request attribute indicator parameter, determining a preset initial weight of the indicator parameter as a target weight of the indicator parameter; In the case that the indicator parameter belongs to a statistical indicator parameter, the minimum value between the preset maximum weight of the indicator parameter and the dynamic weight of the indicator parameter is determined as the target weight of the indicator parameter, and the dynamic weight of the indicator parameter is the product of the initial sampling rate corresponding to the indicator parameter and the preset initial weight of the indicator parameter.

7. The method according to claim 1, It is characterized in that After determining the target sampling rate of the application according to the initial sampling rates of the N indicator parameters, the method further comprises: The target sampling rate is transmitted to the distributed monitoring system to instruct the distributed monitoring system to sample the link data of the service request of the application according to the target sampling rate.

8. A sampling rate determination device, It is characterized in that include: The acquisition module is used to obtain N indicator parameters associated with the application, where N is an integer greater than 1; A determination module, used to determine, for each of the N indicator parameters, an initial sampling rate corresponding to the indicator parameter; The determination module is used to determine the target sampling rate of the application according to the initial sampling rates corresponding to the N indicator parameters, and the target sampling rate of the application is used to sample the link data of the service request of the application.

9. An electronic device, It is characterized in that include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the sampling rate determination method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the sampling rate determination method according to any one of claims 1 to 7 are implemented.

11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the sampling rate determination method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Link tracking adaptive sampling method and device, electronic equipment and storage medium

    CN119892670A