Flow monitoring data acquisition method based on Sentinel and InfluxDB

By performing communication verification and custom configuration in Sentinel console components, traffic data is directly stored in InfluxDB in cloud databases, the problems of low security and inability to achieve refined monitoring in the existing technology are solved, and efficient and secure traffic data acquisition and storage are achieved.

CN120110773AActive Publication Date: 2025-06-06NORTH CLOUD VIEW TECH (BEIJING) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510304149.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-06-06
Estimated Expiration
2045-03-14

AI Technical Summary

Technical Problem

In the prior art, the acquisition method of Sentinel traffic monitoring data has the problem of low security and inability to achieve refined monitoring. Especially in the process of data transmission and storage, it is difficult to ensure the security and real-timeness of data.

Method used

By obtaining the user terminal information of Sentinel console components, conducting communication verification, and based on custom annotation classes and configuration classes, traffic data is directly stored in InfluxDB in the cloud database, thereby achieving high security and refined monitoring of traffic data acquisition.

Benefits of technology

It realizes a high-security and strong stability of traffic data acquisition method, can support real-time data analysis and refined monitoring, improves data storage efficiency, and further improves the stability of data storage through data migration and storage health probes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120110773A_ABST
    Figure CN120110773A_ABST
Patent Text Reader

Abstract

The invention relates to a flow monitoring data acquisition method based on Sentinel and InfluxDB, belongs to the technical field of flow data monitoring, and solves the problems that a flow data acquisition method in the prior art is low in safety and cannot realize refined monitoring. User terminal information of a current Sentinel console assembly is obtained, the user terminal information is sent to a cloud database, the cloud database comprises a plurality of sequential databases InfluxDB, the cloud database receives the user terminal information, communication verification is achieved based on the user terminal information, and if verification is passed, the user terminal information is sent to the Sentinel console assembly; if yes, a service requirement is input into the Sentinel console assembly, flow data collection is achieved based on the service requirement and the user-defined annotation class, and the collected flow data is stored to the InfluxDB based on the user-defined configuration class so that flow monitoring data can be obtained. The traffic monitoring data acquisition method which is high in safety and supports fine monitoring is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of flow data monitoring, and in particular to a flow monitoring data acquisition method based on Sentinel and InfluxDB. Background Art

[0002] Sentinel is an open source lightweight traffic control component that focuses on traffic management, circuit breaking and degradation, and system protection. It is widely used in microservice architecture to help developers ensure system stability and high availability.

[0003] In order to overcome the limitations of Sentinel real-time monitoring data storage, it is usually necessary to integrate the InfluxDB time series database. In the prior art, technicians often implement this by introducing dependencies, creating SentinelMetric classes, implementing MetricsRepository interfaces, configuring data storage, modifying Sentinel consoles, testing and verification, etc. However, the links configured in this way have the following disadvantages: (1) The existing linking method does not take security into consideration. For example, monitoring data may contain sensitive or confidential information, such as system operation status, user behavior, business indicators, etc. If these data are obtained by unauthorized personnel, they may lead to data leakage, business risks, and other problems; (2) It is impossible to achieve refined monitoring. By introducing message middleware such as Kafka in data transmission, the intermediate service can cache the data and write it to InfluxDB in batches regularly. However, this method cannot achieve real-time data analysis. For more fine-grained monitoring requirements (such as milliseconds), the limitations of data granularity may make some refined monitoring scenarios unsatisfactory.

[0004] Therefore, it is necessary to provide a traffic monitoring data acquisition method based on Sentinel and InfluxDB that has high security and supports refined monitoring. Summary of the invention

[0005] In view of the above analysis, an embodiment of the present invention aims to provide a flow monitoring data acquisition method based on Sentinel and InfluxDB, so as to solve the problem that the existing flow data acquisition method has low security and cannot realize refined monitoring.

[0006] The embodiment of the present invention provides a method for acquiring flow monitoring data based on Sentinel and InfluxDB, including:

[0007] Get the user terminal information of the current Sentinel console component, which includes: user terminal ID, user role, application number, and target time series database InfluxDB. Send the user terminal information to the cloud database, which includes multiple time series databases InfluxDB, each of which is used to store traffic data of a specific application.

[0008] The cloud database receives the user terminal information and implements communication verification based on the user terminal information. If the verification is successful, the business requirements are entered in the Sentinel console component, and traffic data collection is implemented based on the business requirements and the custom annotation class. The collected traffic data is stored in the InfluxDB based on the custom configuration class to obtain traffic monitoring data.

[0009] Based on the further improvement of the above method, for each Sentinel console component, the dependency of the time series database InfluxDB is defined in the configuration file pom.xml, and the connection information of the time series database InfluxDB is specified, and the connection information includes the database address, port number, Token and timeout period, so as to use the InfluxDB as the data source of the Sentinel console component; modify the query interface of the Sentinel console component, and modify the execution logic of the query interface to obtain data from the InfluxDB.

[0010] Based on a further improvement of the above method, the communication verification based on the user terminal information includes:

[0011] The user role and user terminal ID are compared with the role-terminal table stored in the cloud database to verify whether the current user has the authority to store data. If so, verify whether the correspondence between the current application number and the target time series database InfluxDB is correct. If correct, the verification passes; wherein the role-terminal table is used to store the correspondence between the user role and the user terminal ID.

[0012] Based on the further improvement of the above method, the business requirements include flow control rules, and the flow control rules include resource name, flow control type, and flow control threshold; wherein the resource name is used to specify the business name of the flow that needs to be monitored, the flow control type is used to specify the monitoring parameters of the flow, and the flow control threshold is used to limit the maximum value of the flow control type parameters.

[0013] Based on the further improvement of the above method, the custom annotation class includes: conditional annotation, which is used to verify whether the attribute value in the configuration file is the time series database InfluxDB. If so, the custom configuration class takes effect; automatic configuration annotation, which is used to realize the automatic configuration of the target InfluxDB; configuration class annotation, which is used to limit whether to use the proxy mode; Bean annotation, which is used to create an InfluxDB entity warehouse instance to realize data storage operations.

[0014] Based on the further improvement of the above method, the business requirements also include InfluxDB attribute configuration information and target mode;

[0015] The flow data collection is realized based on the business requirements and the custom annotation class, including:

[0016] A1: Use FlowRuleManager.loadRules to load the flow control rules into the Sentinel console component;

[0017] A2: Determine whether the attribute value of the current condition annotation is InfluxDB. If so, enable the InfluxDB2AutoConfiguration.class function;

[0018] A3: Automatically configure InfluxDB attributes based on the automatic configuration annotations;

[0019] A4: Modify the configuration class annotation value to the target mode;

[0020] A5: Create and register a Bean annotated function to collect traffic data of the query interface. The traffic data includes: application name, resource name, number of requests checked by Sentinel rules per second, number of requests intercepted by Sentinel rules per second, number of exceptions, average response time, total number of requests, resource code, creation time, modification time, and timestamp.

[0021] Based on the further improvement of the above method, the custom configuration class includes a data conversion method for converting the collected traffic data into a data type acceptable to InfluxDB;

[0022] The method of storing the collected traffic data in the InfluxDB based on the custom configuration class to obtain the traffic monitoring data includes:

[0023] Calling a data conversion method to process the collected flow data to obtain data to be stored;

[0024] The synchronous writing interface WriteApiBlocking of InfluxDB is used to write the data to be stored into the database with millisecond time accuracy to obtain the flow monitoring data.

[0025] Based on the further improvement of the above method, the cloud database sets a preset storage space for each time-series database, and monitors the space utilization rate and data writing rate of each time-series database in real time. When the traffic data of the application is monitored to reach the preset storage space, data migration is triggered.

[0026] Based on the further improvement of the above method, the data migration includes:

[0027] Dynamically create a temporary storage buffer and temporarily store the excess data in the buffer;

[0028] Calculate the cold data capacity of the current time series database as the first data capacity, and calculate the capacity of the current buffer data as the second data capacity. If the first data capacity is greater than the second data capacity, migrate the cold data in the previous time series database. After the migration is completed, store the data in the buffer to the current time series database. If it is less than, reallocate a time series database with a preset quota, store the data in the buffer to the newly allocated time series database, and after the storage is completed, send a storage topology update instruction to the current Sentinel console component so that subsequent data can be directly written to the newly allocated time series database.

[0029] Based on the further improvement of the above method, a storage health probe is integrated in the Sentinel console component to obtain the remaining storage space and write latency indicators of the target time series database in real time;

[0030] When storage performance degradation is detected, the Sentinel console component automatically triggers a mitigation plan, which includes:

[0031] If the remaining storage space of the target time series database is lower than a preset emergency threshold, the frequency of collecting the application traffic monitoring data is reduced;

[0032] If the write delay index exceeds a preset index value, the local cache queue is enabled and the traffic monitoring data of the application is compressed and transmitted in batches.

[0033] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0034] 1. The present invention provides a method for acquiring flow monitoring data based on Sentinel and InfluxDB, introduces a communication verification method, and implements data matching based on user terminal information. Only by verifying the correspondence between user role and user terminal ID and the correspondence between application number and target time series database InfluxDB, can flow data monitoring between Sentinel console component and cloud database be performed, thereby realizing a flow data method with high security and strong stability. In addition, the present invention abandons the method of using middleware to store data in batches, which is often used in the prior art, and directly stores the monitoring data of Sentinel console component into the designated time series database in the cloud database, thereby improving data storage efficiency, so that system users can analyze and use existing data in real time, and realize refined monitoring of flow data.

[0035] 2. The present invention provides a method for acquiring traffic monitoring data based on Sentinel and InfluxDB, and introduces a data migration method into the time series database in the cloud database, so that the method proposed by the present invention can support the processing of traffic data that exceeds the storage capacity of the current time series database, further improving the stability of data storage.

[0036] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;

[0038] FIG1 is an example diagram of a method for acquiring flow monitoring data based on Sentinel and InfluxDB in an embodiment of the present invention;

[0039] Figure 2 This is an example diagram of the correspondence between the Sentinel console component in an embodiment of the present invention and the time series database InfluxDB in the cloud database. DETAILED DESCRIPTION

[0040] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0041] A specific embodiment of the present invention discloses a method for acquiring flow monitoring data based on Sentinel and InfluxDB, such as Figure 1 As shown, including:

[0042] S1: Get the user terminal information of the current Sentinel console component, which includes: user terminal ID, user role, application number, and target time series database InfluxDB. Send the user terminal information to the cloud database, which includes multiple time series databases InfluxDB, each of which is used to store traffic data of a specific application.

[0043] The method proposed in the present invention includes multiple Sentinel console components on the client side, and multiple time series databases InfluxDB on the cloud side. Each InfluxDB is used to store the traffic data of a specific application. The purpose of this is to facilitate the acquisition of traffic data. System users can quickly obtain the traffic data of a specific application from the cloud database based on the correspondence between the time series database and the application number. Figure 2 As shown, Sentinel console component 1 corresponds to InfluxDB 1, Sentinel console component 2 corresponds to InfluxDB 2, Sentinel console component 3 corresponds to InfluxDB 3, and Sentinel console component N corresponds to InfluxDB N. Figure 2 The correspondence shown in is only a schematic representation. In actual use, the correspondence between the Sentinel console component and InfluxDB can be set according to actual needs.

[0044] Among them, the user terminal ID is used to limit the client device used by the current system user. The user role is used to limit the permissions of the current system user. It can be understood that different user roles correspond to different permissions. This setting enhances the security of the data, prevents data abuse, and reduces the risk of human error. The application number is used to indicate the application that needs to be monitored. Exemplarily, the application number can be represented by numbers such as 1, 2, 3, or by other forms of strings, bytecodes, etc. System users can set the form of the application number according to business needs. The present invention is not limited here as long as the various applications can be distinguished. The target time series database InfluxDB is used to represent the storage location of the monitoring traffic data of the application.

[0045] The present invention stores the monitoring data of the Sentinel console component directly in the time series database InfluxDB. Therefore, it is necessary to modify the configuration file of the Sentinel console component. Specifically, for each Sentinel console component, the dependency of the Sentinel console component is defined in the configuration file pom.xml, the dependency of the time series database InfluxDB is defined, and the connection information of the time series database InfluxDB is specified. The connection information includes the database address, port number, Token, and timeout period, so as to use the InfluxDB as the data source of the Sentinel console component; modify the query interface of the Sentinel console component, and modify the execution logic of the query interface to obtain data from the InfluxDB.

[0046] Specifically, introduce Sentinel related dependencies in the project's build file (pom.xml), as shown below:

[0047]

[0048] Introduce InfluxDB related dependencies in the project's build file (pom.xml), as shown below:

[0049]

[0050] In the configuration file, add the connection information of InfluxDB, including the database address, port number, token, and timeout, as shown below:

[0051] influx.url=http: / / lcoalhost:8086 /

[0052] influx.token=UfgaW37A93PkncmJum25G7M2QkBg6xqqjGthh

[0053] influx.org=sentinel

[0054] infux.bucket=sentinel

[0055] influx.log-level=NONE

[0056] influx.read-timeout=10s

[0057] influx.write-timeout=10s

[0058] influx.connect-timeout=10s

[0059] Locate the query interface code. In the Sentinel console code, find the query interface part responsible for obtaining application traffic monitoring information. This part of the code directly reads data from each Sentinel client component. Introduce the InfluxDB client library: Introduce the corresponding InfluxDB client library (influxdb-client). Modify the query logic: Modify the logic of the query interface to obtain data from InfluxDB.

[0060] S2: The cloud database receives the user terminal information and implements communication verification based on the user terminal information. If the verification is successful, the business requirements are entered in the Sentinel console component, and traffic data collection is implemented based on the business requirements and the custom annotation class. The collected traffic data is stored in the InfluxDB based on the custom configuration class to obtain traffic monitoring data.

[0061] The communication verification based on the user terminal information includes: comparing the user role and the user terminal ID with the role-terminal table stored in the cloud database to verify whether the current user has the authority to store data, and if so, verifying whether the correspondence between the current application number and the target time series database InfluxDB is correct, and if so, the verification is passed; wherein the role-terminal table is used to store the correspondence between the user role and the user terminal ID.

[0062] Among them, the role-terminal table is pre-stored in the cloud database by the system administrator, and the information in the table is continuously updated based on business needs, which is used to complete the verification of user roles and user terminal IDs. The correspondence between the application number and the target time series database InfluxDB can also be stored through a data table, for example, a program-database table, which can also be pre-stored in the cloud database by the system administrator, and the information in the table is continuously updated based on business needs, which is used to complete the verification of the correspondence between the application number and the target time series database InfluxDB. The method proposed in the present invention first verifies the user role and the user terminal ID, and then verifies the correspondence between the application number and the target time series database InfluxDB. Only when both verifications are passed, the system user is allowed to obtain traffic data. Based on this method, the security and stability of traffic data acquisition are further improved.

[0063] The business requirements include flow control rules, which include resource name, flow control type, and flow control threshold; the resource name is used to specify the business name of the flow to be monitored, the flow control type is used to specify the monitoring parameters of the flow, and the flow control threshold is used to limit the maximum value of the flow control type parameter. The business requirements also include InfluxDB attribute configuration information and target mode.

[0064] For example, the resource name can be an application, and the system user can specify the application to be monitored according to business needs. The types of traffic control include: the number of requests checked by Sentinel rules per second, the number of requests intercepted by Sentinel rules per second, the number of exceptions, the average response time, the total number of requests, and other commonly used parameter types in traffic monitoring. The traffic control threshold can be the number of queries per second, which can be set according to business needs. For example, setting the QPS (queries per second) value to 80 means that a maximum of 80 requests are allowed to pass per second.

[0065] The custom annotation class includes: conditional annotations, which are used to verify whether the attribute value in the configuration file is the time series database InfluxDB. If so, the custom configuration class takes effect; automatic configuration annotations, which are used to realize automatic configuration of the target InfluxDB; configuration class annotations, which are used to limit whether to use proxy mode, for example, Full mode and Lite mode; Bean annotations, which are used to create InfluxDB entity warehouse instances to realize data storage operations.

[0066] Exemplarily, the implementation of each annotation is as follows:

[0067] Conditional Notes:

[0068] @EnableConfigurationProperties(InfluxDBMetricsProperties.class), this annotation indicates that this configuration class will take effect only when the sentinel.metrics.type attribute in the configuration file is equal to influxdb;

[0069] Automatic configuration annotations:

[0070] @AutoConfigureAfter(InfluxDB2AutoConfiguration.class), which specifies that this configuration class should be configured after the InfluxDB2AutoConfiguration configuration class;

[0071] Configuration class annotation:

[0072] @Configuration(proxyBeanMethods=false), this annotation identifies the class as a configuration class. The Spring container will load this configuration class at startup and process the configuration information in it. proxyBeanMethods=false indicates the use of Lite mode. In this mode, the methods of the configuration class will not be proxied to improve the processing efficiency of the configuration class.

[0073] Bean annotation:

[0074]

[0075] Define a Spring Bean named InfluxDBMetricsEntityRepository to create an InfluxDB entity repository instance, which is responsible for handling storage operations for InfluxDB-related data.

[0076] Custom annotation classes can also include:

[0077] Configuration property annotation:

[0078] @EnableConfigurationProperties(InfluxDBMetricsProperties.class), this annotation is used to enable support for the InfluxDBMetricsProperties class, allowing the property values ​​in the configuration file to be bound to an instance of the InfluxDBMetricsProperties class, making it easier to use these properties in the configuration class;

[0079] Constructor injection annotation:

[0080] @RequiredArgsConstructor,

[0081] This is an annotation provided by Lombok, which automatically generates a constructor containing all final modified fields.

[0082] The flow data collection is realized based on the business requirements and the custom annotation class, including:

[0083] A1: Use FlowRuleManager.loadRules to load the flow control rules into the Sentinel console component;

[0084] A2: Determine whether the attribute value of the current condition annotation is InfluxDB. If so, enable the InfluxDB2AutoConfiguration.class function;

[0085] A3: Automatically configure InfluxDB attributes based on the automatic configuration annotations;

[0086] A4: Modify the configuration class annotation value to the target mode;

[0087] A5: Create and register a Bean annotated function to collect traffic data of the query interface. The traffic data includes: application name, resource name, number of requests checked by Sentinel rules per second, number of requests intercepted by Sentinel rules per second, number of exceptions, average response time, total number of requests, resource code, creation time, modification time, and timestamp.

[0088] The method of storing the collected traffic data in the InfluxDB based on the custom configuration class to obtain the traffic monitoring data includes:

[0089] Calling a data conversion method to process the collected flow data to obtain data to be stored;

[0090] The synchronous writing interface WriteApiBlocking of InfluxDB is used to write the data to be stored into the database with millisecond time accuracy to obtain the flow monitoring data.

[0091] The data conversion method refers to converting the collected traffic data into a data type acceptable to InfluxDB.

[0092] The present invention stores the monitoring data of the Sentinel console component directly into a specified time series database in the cloud database through a custom configuration class, thereby improving the data storage efficiency, thereby enabling system users to analyze and use existing data in real time and realizing refined monitoring of traffic data.

[0093] The cloud database sets a preset storage space for each time series database, and monitors the space usage and data writing rate of each time series database in real time. When the traffic data of the application program reaches the preset storage space, data migration is triggered. The data migration includes:

[0094] B1: Dynamically create a temporary storage buffer and temporarily store the excess data in the buffer;

[0095] B2: Calculate the cold data capacity of the current time series database as the first data capacity, and calculate the capacity of the current buffer data as the second data capacity. If the first data capacity is greater than the second data capacity, migrate the cold data in the previous time series database. After the migration is completed, store the data in the buffer to the current time series database. If it is less than, reallocate a time series database with a preset quota, store the data in the buffer to the newly allocated time series database, and after the storage is completed, send a storage topology update instruction to the current Sentinel console component so that subsequent data can be directly written to the newly allocated time series database.

[0096] In addition, the present invention integrates a storage health probe in the Sentinel console component to obtain the remaining storage space and write delay indicators of the target time series database in real time.

[0097] In Sentinel, the function of the health probe is mainly to monitor and manage the health status of the system and ensure the stability and high availability of the service. Sentinel's health probe can usually obtain the following types of indicators: service availability, response time, resource utilization (such as CPU, memory), number of database connections, average response time of database queries. For time series databases (such as InfluxDB), the following indicators can be obtained: write rate, query rate, number of data points, data storage size. On this basis, the present invention further improves the health probe of Sentinel so that it can support the acquisition of the remaining storage space and write delay indicators (i.e., the write rate of the current target time series database) of each target time series database in the cloud database.

[0098] When the storage performance is detected to be degraded, the Sentinel console component automatically triggers a mitigation plan, which includes: if the remaining storage space of the target time series database is lower than the preset emergency threshold, reduce the frequency of collecting the traffic monitoring data of the application; if the write delay index exceeds the preset index value, enable the local cache queue and batch compress and transmit the traffic monitoring data of the application. Exemplarily, the preset emergency threshold can be 500KB, and the preset index value can be 5KB / S.

[0099] Compared with the prior art, the flow monitoring data acquisition method based on Sentinel and InfluxDB provided in this embodiment introduces a communication verification method, which is implemented based on data matching of user terminal information. Only through the verification of the correspondence between the user role and the user terminal ID and the verification of the correspondence between the application number and the target time series database InfluxDB, can the flow data monitoring between the Sentinel console component and the cloud database be performed, thereby realizing a flow data method with high security and strong stability. In addition, the present invention abandons the method of using middleware to store data in batches, which is often used in the prior art, and directly stores the monitoring data of the Sentinel console component in the designated time series database in the cloud database, thereby improving the data storage efficiency, so that system users can analyze and use existing data in real time, and realize the refined monitoring of flow data. The time series database in the cloud database introduces a data migration method, so that the method proposed by the present invention can support the processing of flow data that exceeds the storage capacity of the current time series database, further improving the stability of data storage.

[0100] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0101] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for acquiring traffic monitoring data based on Sentinel and InfluxDB, characterized in that: include: Get the user terminal information of the current Sentinel console component, which includes: user terminal ID, user role, application number, and target time series database InfluxDB. Send the user terminal information to the cloud database, which includes multiple time series databases InfluxDB, each of which is used to store traffic data of a specific application. The cloud database receives the user terminal information and implements communication verification based on the user terminal information. If the verification is successful, the business requirements are entered in the Sentinel console component, and traffic data collection is implemented based on the business requirements and the custom annotation class. The collected traffic data is stored in the InfluxDB based on the custom configuration class to obtain traffic monitoring data.

2. According to claim 1, a method for acquiring flow monitoring data based on Sentinel and InfluxDB is characterized in that: For each Sentinel console component, define the dependency of the time series database InfluxDB in the configuration file pom.xml, and specify the connection information of the time series database InfluxDB, which includes the database address, port number, Token, and timeout period, so as to use the InfluxDB as the data source of the Sentinel console component; modify the query interface of the Sentinel console component, and modify the execution logic of the query interface to obtain data from the InfluxDB.

3. According to claim 2, a method for acquiring flow monitoring data based on Sentinel and InfluxDB is characterized in that: The implementing communication verification based on the user terminal information includes: The user role and user terminal ID are compared with the role-terminal table stored in the cloud database to verify whether the current user has the authority to store data. If so, verify whether the correspondence between the current application number and the target time series database InfluxDB is correct. If correct, the verification passes; wherein the role-terminal table is used to store the correspondence between the user role and the user terminal ID.

4. According to a method for acquiring flow monitoring data based on Sentinel and InfluxDB according to claim 1, it is characterized in that: The business requirements include flow control rules, and the flow control rules include resource name, flow control type, and flow control threshold; wherein the resource name is used to specify the business name of the flow that needs to be monitored, the flow control type is used to specify the monitoring parameters of the flow, and the flow control threshold is used to limit the maximum value of the flow control type parameters.

5. According to the method for acquiring traffic monitoring data based on Sentinel and InfluxDB according to claim 4, the custom annotation class comprises: Conditional annotations are used to verify whether the attribute value in the configuration file is the time series database InfluxDB. If so, the custom configuration class takes effect; automatic configuration annotations are used to implement automatic configuration of the target InfluxDB; configuration class annotations are used to limit whether to use proxy mode; Bean annotations are used to create InfluxDB entity warehouse instances to implement data storage operations.

6. According to claim 5, a method for acquiring flow monitoring data based on Sentinel and InfluxDB is characterized in that: The business requirements also include InfluxDB attribute configuration information and target mode; The flow data collection is realized based on the business requirements and the custom annotation class, including: A1: Use FlowRuleManager.ioadRules to load the flow control rules into the Sentinel console component; A2: Determine whether the attribute value of the current condition annotation is InfluxDB. If so, enable the InfluxDB2AutoConfiguration.class function; A3: Automatically configure InfluxDB attributes based on the automatic configuration annotations; A4: Modify the configuration class annotation value to the target mode; A5: Create and register a Bean annotated function to collect traffic data of the query interface. The traffic data includes: application name, resource name, number of requests checked by Sentinel rules per second, number of requests intercepted by Sentinel rules per second, number of exceptions, average response time, total number of requests, resource code, creation time, modification time, and timestamp.

7. The method for acquiring flow monitoring data based on Sentinel and InfluxDB according to claim 6 is characterized in that: The custom configuration class includes a data conversion method for converting the collected traffic data into a data type acceptable to InfluxDB; The method of storing the collected traffic data in the InfluxDB based on the custom configuration class to obtain the traffic monitoring data includes: Calling a data conversion method to process the collected flow data to obtain data to be stored; The synchronous writing interface WriteApiBlocking of InfluxDB is used to write the data to be stored into the database with millisecond time accuracy to obtain the flow monitoring data.

8. According to claim 3, a method for acquiring flow monitoring data based on Sentinel and InfluxDB is characterized in that: The cloud database sets a preset storage space for each time-series database, and monitors the space usage and data writing rate of each time-series database in real time. When it is monitored that the traffic data of the application reaches the preset storage space, data migration is triggered.

9. The method for acquiring flow monitoring data based on Sentinel and InfluxDB according to claim 8, characterized in that: The data migration includes: Dynamically create a temporary storage buffer and temporarily store the excess data in the buffer; Calculate the cold data capacity of the current time series database as the first data capacity, and calculate the capacity of the current buffer data as the second data capacity. If the first data capacity is greater than the second data capacity, migrate the cold data in the previous time series database. After the migration is completed, store the data in the buffer to the current time series database. If it is less than, reallocate a time series database with a preset quota, store the data in the buffer to the newly allocated time series database, and after the storage is completed, send a storage topology update instruction to the current Sentinel console component so that subsequent data can be directly written to the newly allocated time series database.

10. According to the method for acquiring traffic monitoring data based on Sentinel and InfluxDB in claim 9, a storage health probe is integrated in the Sentinel console component to obtain the remaining storage space and write delay index of the target time series database in real time; When storage performance degradation is detected, the Sentinel console component automatically triggers a mitigation plan, which includes: If the remaining storage space of the target time series database is lower than a preset emergency threshold, the frequency of collecting the application traffic monitoring data is reduced; If the write delay index exceeds a preset index value, the local cache queue is enabled and the traffic monitoring data of the application is compressed and transmitted in batches.

Citation Information

Patent Citations

  • Sensinel-based service fusion, degradation, and current limiting system

    CN111475382A

  • Microservice flow limiting method and device

    CN115604344A

  • Monitoring platform and method based on TDengine, electronic equipment and storage medium

    CN116996420A

  • Satellite data for aquaculture risk and disease management

    CN118076224A

  • Fusing current limiting method and system based on Sentinel

    CN118214721A