Index monitoring method and device, and storage medium

By loading monitoring metric configuration information and rule instances, the data source and monitoring logic are decoupled, and the metric monitoring is performed using a sandbox execution environment. This solves the problem of low flexibility in existing technologies and enables flexible metric monitoring and independent updates of alarm rules.

CN123178227APending Publication Date: 2026-11-27INDUSTRIAL AND COMMERCIAL BANK OF CHINA +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611608725.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-16
Publication Date
2026-11-27

Smart Images

  • Figure CN123178227A_ABST
    Figure CN123178227A_ABST
Patent Text Reader

Abstract

The application discloses an index monitoring method and device and a storage medium. It relates to the field of financial technology. The method comprises the following steps: receiving a tenant ID and a target index code to be monitored, loading corresponding monitoring index configuration information and a rule instance according to the tenant ID, wherein the monitoring index configuration information is used to represent data source information of the target index code, and the rule instance is used to represent monitoring rule information of the target index code; determining a query mode corresponding to the target index code according to the monitoring index configuration information, and generating an expression corresponding to the target index code according to the rule instance; obtaining a plurality of monitoring data rows from a database according to the query mode, and performing evaluation on the plurality of monitoring data rows according to the expression in a sandbox execution environment to obtain an evaluation result; and determining an alarm result according to the evaluation result and the rule instance. Through the application, the problem of low flexibility of index monitoring in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and more specifically, to an indicator monitoring method, device, and storage medium. Background Technology

[0002] Metric monitoring is a core technical means to ensure the stable operation and risk control of business systems. Essentially, it involves collecting, calculating, and analyzing business data to monitor abnormal changes in key business metrics in real time and triggering early warning notifications when risks are detected. In enterprise-level applications such as SaaS (Software as a Service) and multi-tenant architecture systems, the business scenarios, data scale, and compliance requirements of different tenants vary significantly. Therefore, monitoring systems need to have a high degree of customization capability to achieve metric monitoring of massive amounts of heterogeneous data.

[0003] However, existing metric monitoring methods often suffer from low flexibility when dealing with complex and ever-changing business needs. For example, existing technologies typically use hard-coding or static rule engines, resulting in a high degree of coupling between the definition of monitoring metrics and the logic of alert rules. When adding new monitoring scenarios or adjusting alert thresholds, it usually involves code-level modifications, recompiling, packaging, and release, and may even require restarting the service. Hot updates of configurations are not possible, resulting in poor flexibility in metric monitoring.

[0004] There is currently no effective solution to the problem of low flexibility in indicator monitoring in related technologies. Summary of the Invention

[0005] The main objective of this application is to provide an indicator monitoring method, device, and storage medium to address the problem of low flexibility in indicator monitoring in related technologies.

[0006] To achieve the above objectives, according to one aspect of this application, a method for monitoring metrics is provided. The method includes: receiving a tenant ID and a target metric code to be monitored; loading corresponding monitoring metric configuration information and rule instances based on the tenant ID, wherein the monitoring metric configuration information represents the data source information of the target metric code, and the rule instances represent the monitoring rule information of the target metric code; determining a query mode corresponding to the target metric code based on the monitoring metric configuration information; generating an expression corresponding to the target metric code based on the rule instances; retrieving multiple monitoring data rows from a database based on the query mode; evaluating the multiple monitoring data rows based on the expression in a sandbox execution environment to obtain the evaluation result; and determining an alarm result based on the evaluation result and the rule instances.

[0007] Furthermore, before receiving the tenant ID and the target metric code to be monitored, the method also includes: receiving monitoring metric definitions and storing them in a metric definition table to obtain multiple monitoring metric configuration information, wherein the monitoring metric definition includes metric code, metric name, data source query statement template, query mode, and tenant field; receiving rule templates and population parameters for monitoring metrics, and generating multiple rule instances based on the rule templates and population parameters, wherein the rule template includes an expression skeleton and a parameter definition list, and the rule instance includes at least an expression to be executed and an alarm rule; and establishing the association between the rule instance and the monitoring metric configuration information through the metric code.

[0008] Furthermore, determining the query mode corresponding to the target indicator code based on the monitoring indicator configuration information and generating the expression corresponding to the target indicator code based on the rule instance includes: filtering multiple configuration records with an enabled running status from the monitoring indicator configuration information, and determining the query mode corresponding to the target indicator code from the multiple configuration records; determining multiple candidate rules with an enabled running status based on the rule instance, and determining the target rule from the multiple candidate rules through a multi-level priority inheritance method based on the tenant ID, and determining the expression to be executed in the target rule as the expression of the target indicator code.

[0009] Furthermore, retrieving multiple monitoring data rows from the database based on the query mode includes: if the query mode is real-time full mode, then the target data source query statement template is read from the monitoring indicator configuration information, and the tenant identifier placeholder in the target data source query statement template is replaced with the tenant ID to obtain the data source query statement. The query is then executed in the database based on the data source query statement to obtain multiple monitoring data rows; if the query mode is snapshot acceleration mode, then the pre-aggregated snapshot table corresponding to the target indicator code is determined from the monitoring indicator configuration information, and multiple monitoring data rows are retrieved from the pre-aggregated snapshot table.

[0010] Furthermore, the expression is used to evaluate multiple monitoring data rows to obtain the evaluation result, which includes: traversing each monitoring data row to obtain the current data signature corresponding to the monitoring data row; retrieving the historical data signature corresponding to the monitoring data row from the query result cache; if the current data signature and the historical data signature are the same, then the historical result is read from the query result cache and determined as the evaluation result; if the current data signature and the historical data signature are different, then in the sandbox execution environment, the expression is executed using the field values ​​of the monitoring data row to obtain the evaluation result, and the evaluation result is written to the query result cache.

[0011] Furthermore, based on the evaluation result and the rule instance, the alarm result is determined as follows: if the evaluation result is that no alarm is triggered, the alarm result of the monitoring data row corresponding to the evaluation result is determined as no alarm needs to be output; if the evaluation result is that an alarm is triggered, the historical alarm records of the monitoring data row corresponding to the evaluation result within the preset time window are obtained, and the target alarm level is determined based on the historical alarm records; the target alarm notification and target alarm channel are determined from the rule instance based on the target alarm level, and the alarm result is determined based on the target alarm channel and target alarm notification.

[0012] To achieve the above objectives, according to another aspect of this application, an indicator monitoring device is provided. The device includes: a receiving unit, configured to receive a tenant ID and a target indicator code to be monitored, and load corresponding monitoring indicator configuration information and rule instances based on the tenant ID, wherein the monitoring indicator configuration information represents the data source information of the target indicator code, and the rule instances represent the monitoring rule information of the target indicator code; a generating unit, configured to determine the query mode corresponding to the target indicator code based on the monitoring indicator configuration information, and generate an expression corresponding to the target indicator code based on the rule instances; an evaluation unit, configured to retrieve multiple monitoring data rows from the database based on the query mode, and evaluate the multiple monitoring data rows based on the expression in a sandbox execution environment to obtain the evaluation result; and a determining unit, configured to determine an alarm result based on the evaluation result and the rule instances.

[0013] Furthermore, the device also includes: a storage unit, used to receive monitoring metric definitions before receiving the tenant ID and the target metric code to be monitored, and to store the monitoring metric definitions in a metric definition table to obtain multiple monitoring metric configuration information, wherein the monitoring metric definition includes metric code, metric name, data source query statement template, query mode, and tenant field; an instance generation unit, used to receive rule templates and fill parameters for monitoring metrics, and to generate multiple rule instances based on the rule templates and fill parameters, wherein the rule template includes an expression skeleton and a parameter definition list, and the rule instance includes at least an expression to be executed and an alarm rule; and an association unit, used to establish an association relationship between rule instances and monitoring metric configuration information through metric codes.

[0014] Furthermore, the generation unit includes: a filtering module, used to filter out multiple configuration records with an enabled running status from the monitoring indicator configuration information, and determine the query mode corresponding to the target indicator code from the multiple configuration records; and a reading module, used to determine multiple candidate rules with an enabled running status based on the rule instance, and determine the target rule from the multiple candidate rules according to the tenant ID through a multi-level priority inheritance method, and determine the expression to be executed in the target rule as the expression of the target indicator code.

[0015] Furthermore, the evaluation unit includes: a first acquisition module, used to read the target data source query statement template from the monitoring indicator configuration information if the query mode is real-time full mode, and replace the tenant identifier placeholder in the target data source query statement template with the tenant ID to obtain the data source query statement, and execute the query in the database according to the data source query statement to obtain multiple monitoring data rows; a second acquisition module, used to determine the pre-aggregated snapshot table corresponding to the target indicator code from the monitoring indicator configuration information if the query mode is snapshot acceleration mode, and obtain multiple monitoring data rows from the pre-aggregated snapshot table.

[0016] Furthermore, the evaluation unit includes: a traversal module for traversing each monitoring data row to obtain the current data signature corresponding to the monitoring data row; an extraction module for extracting the historical data signature corresponding to the monitoring data row from the query result cache; a first evaluation module for reading the historical result from the query result cache and determining the historical result as the evaluation result if the current data signature and the historical data signature are the same; and a second evaluation module for executing an expression using the field values ​​of the monitoring data row in the sandbox execution environment to obtain the evaluation result if the current data signature and the historical data signature are different, and writing the evaluation result into the query result cache.

[0017] Furthermore, the determining unit includes: a first determining module, used to determine the alarm result of the monitoring data row corresponding to the evaluation result as not needing to output an alarm if the evaluation result is that no alarm is triggered; a second determining module, used to obtain the historical alarm records of the monitoring data row corresponding to the evaluation result within a preset time window if the evaluation result is that an alarm is triggered, and determine the target alarm level based on the historical alarm records; and a third determining module, used to determine the target alarm notification and target alarm channel from the rule instance based on the target alarm level, and determine the alarm result based on the target alarm channel and target alarm notification.

[0018] According to another aspect of this application, a computer-readable storage medium is provided, which includes a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any kind of indicator monitoring method.

[0019] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing any kind of metric monitoring.

[0020] According to another aspect of this application, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of the indicator monitoring method described above.

[0021] In this embodiment, by receiving a tenant ID and the target metric code to be monitored, and loading the corresponding monitoring metric configuration information and rule instance based on the tenant ID, wherein the monitoring metric configuration information represents the data source information of the target metric code, and the rule instance represents the monitoring rule information of the target metric code; determining the query mode corresponding to the target metric code based on the monitoring metric configuration information, and generating the expression corresponding to the target metric code based on the rule instance; retrieving multiple monitoring data rows from the database based on the query mode, and evaluating the multiple monitoring data rows based on the expression in the sandbox execution environment to obtain the evaluation result; and determining the alarm result based on the evaluation result and the rule instance, this solves the technical problem of low flexibility in metric monitoring in the prior art.

[0022] By loading independent monitoring metric configuration information and rule instances, the data source definition and monitoring logic are decoupled, allowing them to evolve independently. The query mode is dynamically determined based on the configuration and expressions are generated, enabling flexible adaptation of data acquisition strategies and judgment logic. Furthermore, during the data processing stage, a sandbox execution environment is introduced to evaluate the monitoring data rows, ensuring execution security while completing logical judgments. Alarms are determined based on the evaluation results and rule instances, significantly improving the flexibility of metric monitoring. Attached Figure Description

[0023] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0024] Figure 1 A hardware structure block diagram of a computer terminal for implementing an indicator monitoring method is shown.

[0025] Figure 2 This is a flowchart of the indicator monitoring method provided according to the embodiments of this application;

[0026] Figure 3 This is a schematic diagram of an indicator monitoring device provided according to an embodiment of this application;

[0027] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant laws, regulations, and standards, do not violate public order and good morals, and provide corresponding access points for users to choose to authorize or refuse. For example, this system has interfaces with relevant users or organizations, providing users with corresponding access points to choose to agree to or refuse automated decision results; if the user chooses to refuse, the process proceeds to the expert decision-making stage.

[0031] Example 1

[0032] According to an embodiment of this application, a method embodiment for monitoring indicators is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0033] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing an indicator monitoring method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0034] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0035] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the indicator monitoring method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned indicator monitoring method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0036] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0037] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0038] Under the aforementioned operating environment, this application provides the following: Figure 2 The indicator monitoring method is shown. Figure 2 This is a flowchart of the indicator monitoring method according to Embodiment 1 of this application.

[0039] Step S201: Receive the tenant ID and the target metric code to be monitored, and load the corresponding monitoring metric configuration information and rule instance according to the tenant ID. The monitoring metric configuration information is used to represent the data source information of the target metric code, and the rule instance is used to represent the monitoring rule information of the target metric code.

[0040] Optionally, the target metric code to be monitored is also the data category to be monitored. For example, the target metric code could be a code representing the data category of a contract. Furthermore, it could also receive a business object identifier, such as a specific contract ID. Monitoring metric configuration information corresponding to the tenant ID can be loaded from the database table. Each monitoring metric configuration can include the following fields: metric code, data source query statement template (the template's conditional statement can include a tenant placeholder), query mode (which can be divided into REALTIME (real-time full) and SNAPSHOT (snapshot acceleration) modes), and the pre-aggregated snapshot table name corresponding to the snapshot acceleration mode. The monitoring metric configuration information is essentially a structured configuration used to define monitoring targets. It not only indicates the data source but also indicates the corresponding data acquisition strategy based on the query mode.

[0041] Optionally, multiple rule instances corresponding to tenant IDs can be loaded from a data table. These rule instances are associated with monitoring metric configuration information via metric codes. A rule instance may include the following fields: a unique rule ID, a string of pre-compiled executable expressions, priority, the tenant ID, the specific business object identifier bound to the instance-level rule (e.g., contract ID), alarm level, silence time, recipient configuration, etc. A rule instance is essentially a specific alarm rule generated from a rule template and assigned to a particular tenant.

[0042] It should be noted that the metric monitoring method in this application embodiment can be applied to at least SaaS scenarios. By using monitoring metric configuration information and rule instances to replace the existing hard-coded counting method, the monitoring metrics and alarm rules are completely decoupled and can be configured and updated independently without interference. This provides the prerequisite for hot updates of monitoring metrics and alarm rules. Furthermore, data isolation between different tenants in the SaaS scenario is achieved through tenant IDs, and rule isolation is achieved through the priority in the rule instances.

[0043] Step S202: Determine the query mode corresponding to the target indicator code based on the monitoring indicator configuration information, and generate the expression corresponding to the target indicator code based on the rule instance.

[0044] Optionally, the query mode corresponding to the target metric code can be read from the monitoring metric configuration information. The query mode can be real-time full mode or snapshot acceleration mode. The pre-compiled executable expression string can be read from the rule instance, and then the expression corresponding to the target metric code can be generated based on the executable expression. By directly extracting the executable expression in string form from the rule instance, there is no need to parse the rule template again, avoiding the overhead of repeated compilation.

[0045] Step S203: Retrieve multiple monitoring data rows from the database according to the query pattern, and evaluate the multiple monitoring data rows according to the expression in the sandbox execution environment to obtain the evaluation result.

[0046] Optionally, a sandbox execution environment, also known as a restricted execution environment, prevents unknown scripts from accessing resources or performing dangerous operations by restricting code to accessing only specified variables. A data retrieval strategy can be determined based on the query pattern, and the tenant placeholder in the data source query statement template can be replaced with the tenant ID to retrieve monitoring data rows. Executing expressions on the monitoring data rows will yield the corresponding evaluation results.

[0047] Step S204: Determine the alarm result based on the evaluation result and the rule instance.

[0048] Optionally, the evaluation result of the expression can be a Boolean value. If the evaluation result is true (indicating that an alarm is triggered), the condition is met and an alarm is triggered; if the evaluation result is false (indicating that an alarm is not triggered), the condition is not met and no alarm is triggered. Furthermore, intelligent noise reduction can be applied to the evaluation result based on the silence time in the rule instance, thereby reducing invalid or duplicate alarms. For example, intelligent noise reduction can include storm suppression, root cause correlation, or alarm level classification.

[0049] In summary, by loading independent monitoring metric configuration information and rule instances, the data source definition and monitoring logic are decoupled, allowing them to evolve independently. The query mode is dynamically determined based on the configuration and expressions are generated, enabling flexible adaptation of data acquisition strategies and judgment logic. Furthermore, during the data processing stage, a sandbox execution environment is introduced to evaluate the monitoring data rows, ensuring execution security while completing logical judgments. Alarms are determined based on the evaluation results and rule instances, significantly improving the flexibility of metric monitoring.

[0050] To improve the flexibility of metric monitoring, optionally, before receiving the tenant ID and the target metric code to be monitored, the method further includes: receiving a monitoring metric definition and storing the monitoring metric definition in a metric definition table to obtain multiple monitoring metric configuration information, wherein the monitoring metric definition includes a metric code, metric name, data source query statement template, query mode, and tenant field; receiving a rule template and population parameters for monitoring metrics, and generating multiple rule instances based on the rule template and population parameters, wherein the rule template includes an expression skeleton and a parameter definition list, and the rule instance includes at least an expression to be executed and an alarm rule; and establishing an association between the rule instance and the monitoring metric configuration information through the metric code.

[0051] Optionally, the system can receive intent information for metric monitoring configured by business personnel. This intent information includes metric definitions and rule templates, and is then transformed into executable rule instances and metric configuration information. The metric definitions can be stored in a database table to obtain metric configuration information, which serves as the data foundation for metric monitoring. A metric definition must at least include a data source definition and a data acquisition strategy definition. For example, a metric definition might include a metric code, metric name, data source query statement template, query mode, and tenant field. The metric code is the unique identifier of the metric, the metric name is the business meaning, the data source query statement template is the query statement containing tenant placeholders, and the tenant field refers to the field name used for data isolation in a SaaS scenario.

[0052] Optionally, the rule template may include an expression skeleton and a parameter definition list. The filler parameters, i.e., the specific parameter values ​​passed by the user, can be injected into the expression skeleton to obtain the expression to be executed. The expression to be executed includes logical judgments and outputs a Boolean value. Writing the expression to be executed and the additional information configured by business personnel into a data table yields a rule instance. Each rule instance serves as an alarm rule, including metric code, context information (tenant ID and priority), and policy information (e.g., alarm level, silence time, recipient, etc.). In the data table, the rule instance can be associated with specific monitoring configuration information through the metric code, thereby decoupling monitoring metrics and alarm rules.

[0053] In summary, by receiving monitoring metric definitions and storing them as configuration information, standardized and independent management of data source definitions is achieved. By receiving rule templates and generating rule instances with populated parameters, parameterized and templated reuse of monitoring logic is achieved, avoiding redundant configuration. By establishing the association between rule instances and monitoring metric configuration information through metric coding, dynamic binding between the data source and monitoring logic is realized. This design completely decouples the metric data source and alarm rules, allowing each to evolve independently. It supports rapid response to business changes through parameterized configuration, dynamically generating new monitoring rules without modifying the code, thus improving the flexibility of metric monitoring.

[0054] To improve the flexibility of indicator monitoring, optionally, the process of determining the query mode corresponding to the target indicator code based on the monitoring indicator configuration information and generating the expression corresponding to the target indicator code based on the rule instance includes: filtering multiple configuration records with an enabled running status from the monitoring indicator configuration information, and determining the query mode corresponding to the target indicator code from the multiple configuration records; determining multiple candidate rules with an enabled running status based on the rule instance, and determining the target rule from the multiple candidate rules based on the tenant ID through a multi-level priority inheritance method, and determining the expression to be executed in the target rule as the expression of the target indicator code.

[0055] Optionally, the query pattern and expression can be determined from the monitoring metric configuration information and rule instances based on the context composed of the tenant ID and the target metric code. The stored monitoring metric configuration information can be filtered based on the target metric code. Filtering conditions include code matching and status filtering. Code matching means that the metric code of the configuration record is the same as the target metric code. Status filtering means that only configuration records with an enabled running status are filtered; metrics with a disabled running status are not included in metric monitoring. After matching the configuration record corresponding to the target metric code, the query pattern field of that configuration record can be extracted. For example, the query pattern can be real-time full mode or snapshot acceleration mode, thereby determining the subsequent data acquisition strategy—whether to directly query the database or query the pre-aggregated snapshot table—to balance the real-time nature and performance of metric monitoring.

[0056] Optionally, each loaded rule instance can be treated as an alarm rule. Alarm rules with an "enabled" running status and the target metric code can be selected from all alarm rules through status filtering and metric association. These selected alarm rules are then used as candidate rules, resulting in multiple candidate rules. Multi-level priorities can include instance-level, tenant-level, and system-level priorities. Multi-level priority inheritance is used to balance configuration reuse and differentiated customization. Specifically, instance-level priority can be prioritized over tenant-level priority, and tenant-level priority can be prioritized over system-level priority. If the received data includes a business object identifier (e.g., a specific contract ID) in addition to the tenant ID and the target metric code to be monitored, then the target rule is selected from multiple candidate rules if it has instance-level priority and the specific business object identifier bound to the instance-level rule matches the received business object identifier. If no business object identifier is received, the current metric monitoring is tenant-level macro-monitoring. Since the loaded rule instance matches the tenant ID, a tenant-level candidate rule can be selected from multiple candidate rules as the target rule. If no tenant-level candidate rule is found, any system-level candidate rule is selected as the target rule. An expression to be executed can be read from the target rule as the expression for the target metric code.

[0057] In summary, by filtering query patterns from enabled configuration records, determining target rules from enabled candidate rules using a multi-level priority inheritance method based on tenant ID, and determining target rules from multiple candidate rules using a multi-level priority inheritance method based on tenant ID, the expression for the target metric encoding is obtained. This improves the adaptability to complex multi-tenant business scenarios and enhances the flexibility of metric monitoring.

[0058] To improve the flexibility of indicator monitoring, optionally, multiple monitoring data rows can be retrieved from the database based on the query mode, including: if the query mode is real-time full mode, the target data source query statement template is read from the monitoring indicator configuration information, and the tenant identifier placeholder in the target data source query statement template is replaced with the tenant ID to obtain the data source query statement. The query is then executed in the database based on the data source query statement to obtain multiple monitoring data rows; if the query mode is snapshot acceleration mode, the pre-aggregated snapshot table corresponding to the target indicator code is determined from the monitoring indicator configuration information, and multiple monitoring data rows are retrieved from the pre-aggregated snapshot table.

[0059] Optionally, the field value of the query mode corresponding to the current target indicator code can be obtained from the monitoring indicator configuration information. If the field value is real-time full mode, the target data source query statement template is read from the monitoring indicator configuration information. This template includes a placeholder for identifying the tenant. Substituting the current tenant ID into the placeholder generates the final data source query statement. Executing the data source query statement through the database connection pool allows data to be extracted directly from the database. The returned multiple rows of data are the multiple monitoring data rows. This query mode ensures the real-time acquisition of data, but may bring a large database load.

[0060] Optionally, if the field value is in snapshot acceleration mode, the name of the pre-aggregated snapshot table bound to the target metric code is determined from the monitoring metric configuration information. The pre-aggregated snapshot table is an intermediate table generated by performing incremental or full aggregation calculations on the original business data in the database. For example, the pre-aggregated snapshot table may include pre-calculated aggregation fields such as summation and averaging, and an index is created by the tenant ID. Queries can be executed directly on this pre-aggregated snapshot table to quickly obtain multiple rows of monitoring data. This method avoids complex join operations and real-time aggregation calculations, improving query efficiency.

[0061] In summary, by introducing real-time full mode and snapshot acceleration mode, flexible adaptation of monitoring data acquisition strategies is achieved, improving the flexibility of indicator monitoring.

[0062] To improve the efficiency of indicator monitoring, optionally, multiple monitoring data rows can be evaluated based on an expression to obtain the evaluation result, which includes: traversing each monitoring data row to obtain the current data signature corresponding to the monitoring data row; retrieving the historical data signature corresponding to the monitoring data row from the query result cache; if the current data signature and the historical data signature are the same, then reading the historical result from the query result cache and determining the historical result as the evaluation result; if the current data signature and the historical data signature are different, then executing the expression using the field values ​​of the monitoring data row in the sandbox execution environment to obtain the evaluation result, and writing the evaluation result into the query result cache.

[0063] Optionally, this application embodiment introduces a differential multiplexing mechanism in the expression evaluation process. It first traverses multiple monitoring data rows and extracts their key fields (e.g., primary key ID and business field values, which may include payment amount, budget amount, etc.), and uses a hash algorithm to calculate a unique string as the current data signature. Simultaneously, it accesses the query result cache, which stores all data signatures and corresponding evaluation results from the previous scheduling cycle or the last indicator monitoring. Using the unique identifier of the current data row (e.g., contract ID) as the key, it reads the corresponding historical data signature from the query result cache and compares the current data signature with the historical data signature. If they are identical, it indicates that the monitoring data has not undergone business data changes since the last monitoring. In this case, there is no need to re-execute the time-consuming expression calculation; the historical result (i.e., Boolean value) obtained from the last calculation of the monitoring data row can be directly read from the query result cache and used as the current evaluation result.

[0064] Optionally, if the current data signature is different from the historical data signature, it indicates that the data row has been changed. In this case, the execution environment is entered into the sandbox, and the field values ​​of the current monitored data row are used as context variables to fill in the expression. The expression is executed in the restricted security sandbox to obtain a new evaluation result. The current data signature and the new evaluation result are written into the query result cache in the form of key-value pairs for reuse in the next scheduling cycle.

[0065] In summary, by traversing each monitoring data row, the current data signature corresponding to the monitoring data row is obtained; the historical data signature corresponding to the monitoring data row is extracted from the query result cache; if the current data signature and the historical data signature are the same, the historical result is read from the query result cache and determined as the evaluation result; if the current data signature and the historical data signature are different, the expression is executed using the field values ​​of the monitoring data row in the sandbox execution environment to obtain the evaluation result, and the evaluation result is written to the query result cache. This effectively reduces redundant calculations, significantly reduces computational consumption, and improves the efficiency of indicator monitoring.

[0066] To improve the flexibility of indicator monitoring, optionally, the alarm result can be determined based on the evaluation result and rule instance, including: if the evaluation result is that no alarm is triggered, then the alarm result of the monitoring data row corresponding to the evaluation result is determined as no alarm needs to be output; if the evaluation result is that an alarm is triggered, then the historical alarm records of the monitoring data row corresponding to the evaluation result within a preset time window are obtained, and the target alarm level is determined based on the historical alarm records; the target alarm notification and target alarm channel are determined from the rule instance based on the target alarm level, and the alarm result is determined based on the target alarm channel and target alarm notification.

[0067] Optionally, if the Boolean value is false (indicating no alarm was triggered), it is determined that the current monitoring data row does not require any alarm action, and the alarm result is set as no alarm output is needed. If the Boolean value is true (indicating an alarm was triggered), the alarm processing sub-process is entered.

[0068] Optionally, in the alarm processing sub-process, the unique identifier (e.g., contract ID) of the monitoring data row and the corresponding rule ID of the target rule can be extracted. The historical alarm records generated on the monitoring data row within a preset time window can be aggregated and queried in the alarm history database. The preset time window is a configurable field, and the silence time in the rule instance can be read as the preset time window. If the query result shows that one or more valid alarm records already exist within the preset time window, it indicates that the abnormal state persists or has been notified, and this alarm can be ignored (i.e., silenced), and this alarm is considered processed without outputting a new alarm. If the query result shows that there are higher priority alarms (e.g., level 1) in the historical alarm records, the currently configured alarm level (e.g., level 2) can be read from the rule instance, and the target alarm level is upgraded to level 1. The rule instance is configured with notification policies corresponding to different alarm levels. The target notification policy corresponding to the target alarm level can be extracted from the rule instance according to the target alarm level, and the target alarm notification and target alarm channel can be read from the target notification policy to obtain the alarm result.

[0069] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0070] Example 2

[0071] This application also provides an indicator monitoring device. It should be noted that the indicator monitoring device of this application can be used to execute the indicator monitoring method provided in this application. The indicator monitoring device provided in this application is described below.

[0072] According to an embodiment of this application, an apparatus for implementing the above-described indicator monitoring method is also provided, such as... Figure 3 As shown, the device includes:

[0073] The receiving unit 301 is used to receive the tenant ID and the target metric code to be monitored, and load the corresponding monitoring metric configuration information and rule instance according to the tenant ID. The monitoring metric configuration information is used to represent the data source information of the target metric code, and the rule instance is used to represent the monitoring rule information of the target metric code.

[0074] The generation unit 302 is used to determine the query mode corresponding to the target indicator code based on the monitoring indicator configuration information, and to generate the expression corresponding to the target indicator code based on the rule instance.

[0075] Evaluation unit 303 is used to retrieve multiple monitoring data rows from the database according to the query pattern, and evaluate the multiple monitoring data rows according to the expression in the sandbox execution environment to obtain the evaluation result.

[0076] Unit 304 is used to determine the alarm result based on the evaluation result and the rule instance.

[0077] The indicator monitoring device provided in this application embodiment receives a tenant ID and the target indicator code to be monitored through a receiving unit 301. Based on the tenant ID, it loads the corresponding monitoring indicator configuration information and rule instances. The monitoring indicator configuration information represents the data source information of the target indicator code, and the rule instances represent the monitoring rule information of the target indicator code. A generation unit 302 determines the query mode corresponding to the target indicator code based on the monitoring indicator configuration information and generates an expression corresponding to the target indicator code based on the rule instances. An evaluation unit 303 retrieves multiple monitoring data rows from the database based on the query mode and evaluates the multiple monitoring data rows according to the expression in a sandbox execution environment to obtain the evaluation result. A determination unit 304 determines the alarm result based on the evaluation result and the rule instances. This solves the problem of low flexibility in indicator monitoring in related technologies, thereby improving the flexibility of indicator monitoring.

[0078] Optionally, in the indicator monitoring device provided in this application embodiment, the device further includes: a storage unit, used to receive a monitoring indicator definition before receiving the tenant ID and the target indicator code to be monitored, and store the monitoring indicator definition in an indicator definition table to obtain multiple monitoring indicator configuration information, wherein the monitoring indicator definition includes an indicator code, indicator name, data source query statement template, query mode, and tenant field; an instance generation unit, used to receive a rule template and fill parameters for monitoring indicators, and generate multiple rule instances based on the rule template and fill parameters, wherein the rule template includes an expression skeleton and a parameter definition list, and the rule instance includes at least an expression to be executed and an alarm rule; and an association unit, used to establish an association relationship between the rule instance and the monitoring indicator configuration information through the indicator code.

[0079] Optionally, in the indicator monitoring device provided in this application embodiment, the generation unit 302 includes: a filtering module, used to filter out multiple configuration records with an enabled running status from the monitoring indicator configuration information, and determine the query mode corresponding to the target indicator code from the multiple configuration records; and a reading module, used to determine multiple candidate rules with an enabled running status based on rule instances, and determine the target rule from the multiple candidate rules according to the tenant ID through a multi-level priority inheritance method, and determine the expression to be executed in the target rule as the expression of the target indicator code.

[0080] Optionally, in the indicator monitoring device provided in this application embodiment, the evaluation unit 303 includes: a first acquisition module, used to read the target data source query statement template from the monitoring indicator configuration information if the query mode is real-time full mode, and replace the tenant identifier placeholder in the target data source query statement template with the tenant ID to obtain the data source query statement, and execute the query in the database according to the data source query statement to obtain multiple monitoring data rows; a second acquisition module, used to determine the pre-aggregated snapshot table corresponding to the target indicator code from the monitoring indicator configuration information if the query mode is snapshot acceleration mode, and obtain multiple monitoring data rows from the pre-aggregated snapshot table.

[0081] Optionally, in the indicator monitoring device provided in this application embodiment, the evaluation unit 303 includes: a traversal module, used to traverse each monitoring data row to obtain the current data signature corresponding to the monitoring data row; an extraction module, used to extract the historical data signature corresponding to the monitoring data row from the query result cache; a first evaluation module, used to read the historical result from the query result cache and determine the historical result as the evaluation result if the current data signature and the historical data signature are the same; and a second evaluation module, used to execute an expression using the field value of the monitoring data row in the sandbox execution environment to obtain the evaluation result if the current data signature and the historical data signature are different, and write the evaluation result into the query result cache.

[0082] Optionally, in the indicator monitoring device provided in this application embodiment, the determining unit 304 includes: a first determining module, used to determine the alarm result of the monitoring data row corresponding to the evaluation result as not needing to output an alarm if the evaluation result is that no alarm is triggered; a second determining module, used to obtain the historical alarm records of the monitoring data row corresponding to the evaluation result within a preset time window if the evaluation result is that an alarm is triggered, and determine the target alarm level based on the historical alarm records; and a third determining module, used to determine the target alarm notification and target alarm channel from the rule instance based on the target alarm level, and determine the alarm result based on the target alarm channel and target alarm notification.

[0083] It should be noted that the receiving unit 301, generating unit 302, evaluating unit 303, and determining unit 304 mentioned above correspond to steps S201 to S204 in Embodiment 1. The instances and application scenarios implemented by the units and corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of a device and can run in the computer terminal 10 provided in Embodiment 1.

[0084] Example 3

[0085] Embodiments of this application may provide an electronic device. Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 (Only one is shown) Processor 402, memory 404, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0086] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0087] The processor can access information and applications stored in memory via a transmission device to perform the following steps: receiving a tenant ID and the target metric code to be monitored, and loading the corresponding monitoring metric configuration information and rule instance based on the tenant ID. The monitoring metric configuration information represents the data source information of the target metric code, and the rule instance represents the monitoring rule information of the target metric code. Based on the monitoring metric configuration information, the processor determines the query mode corresponding to the target metric code and generates an expression corresponding to the target metric code based on the rule instance. Based on the query mode, the processor retrieves multiple monitoring data rows from the database and evaluates the multiple monitoring data rows based on the expression in the sandbox execution environment to obtain the evaluation result. Based on the evaluation result and the rule instance, the processor determines the alarm result.

[0088] The processor can also access information and applications stored in the memory via a transmission device to perform the following steps: receiving monitoring metric definitions and storing them in a metric definition table to obtain multiple monitoring metric configuration information, wherein the monitoring metric definition includes metric code, metric name, data source query statement template, query mode, and tenant field; receiving rule templates and population parameters for monitoring metrics, and generating multiple rule instances based on the rule templates and population parameters, wherein the rule template includes an expression skeleton and a parameter definition list, and the rule instance includes at least an expression to be executed and an alarm rule; establishing the association between the rule instance and the monitoring metric configuration information through the metric code.

[0089] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: filter out multiple configuration records with the running status of "enabled" from the monitoring indicator configuration information, and determine the query mode corresponding to the target indicator code from the multiple configuration records; determine multiple candidate rules with the running status of "enabled" based on the rule instance, and determine the target rule from the multiple candidate rules according to the tenant ID through a multi-level priority inheritance method, and determine the expression to be executed in the target rule as the expression of the target indicator code.

[0090] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: If the query mode is real-time full mode, the target data source query statement template is read from the monitoring indicator configuration information, and the tenant identifier placeholder in the target data source query statement template is replaced with the tenant ID to obtain the data source query statement. The query is then executed in the database according to the data source query statement to obtain multiple monitoring data rows; If the query mode is snapshot acceleration mode, the pre-aggregated snapshot table corresponding to the target indicator code is determined from the monitoring indicator configuration information, and multiple monitoring data rows are obtained from the pre-aggregated snapshot table.

[0091] The processor can also invoke information and applications stored in the memory via the transmission device to perform the following steps: traverse each monitoring data row to obtain the current data signature corresponding to the monitoring data row; extract the historical data signature corresponding to the monitoring data row from the query result cache; if the current data signature and the historical data signature are the same, read the historical result from the query result cache and determine the historical result as the evaluation result; if the current data signature and the historical data signature are different, execute the expression using the field values ​​of the monitoring data row in the sandbox execution environment to obtain the evaluation result and write the evaluation result to the query result cache.

[0092] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: if the evaluation result is that no alarm is triggered, then the alarm result of the monitoring data row corresponding to the evaluation result is determined as no alarm output is required; if the evaluation result is that an alarm is triggered, then the historical alarm records of the monitoring data row corresponding to the evaluation result within a preset time window are obtained, and the target alarm level is determined based on the historical alarm records; the target alarm notification and target alarm channel are determined from the rule instance based on the target alarm level, and the alarm result is determined based on the target alarm channel and target alarm notification.

[0093] This application provides a scheme for metric monitoring. It receives a tenant ID and the target metric code to be monitored, and loads corresponding monitoring metric configuration information and rule instances based on the tenant ID. The monitoring metric configuration information represents the data source information of the target metric code, and the rule instances represent the monitoring rule information for the target metric code. The system determines the query mode corresponding to the target metric code based on the monitoring metric configuration information and generates an expression corresponding to the target metric code based on the rule instances. Multiple monitoring data rows are retrieved from the database based on the query mode, and the expressions are evaluated in a sandbox execution environment to obtain the evaluation results. Based on the evaluation results and the rule instances, an alarm result is determined, thus solving the technical problem of low flexibility in metric monitoring in existing technologies.

[0094] Those skilled in the art will understand that Figure 4 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 4 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 4 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 4 The different configurations shown.

[0095] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0096] Example 4

[0097] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the indicator monitoring method provided in Embodiment 1.

[0098] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0099] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: receiving a tenant ID and a target metric code to be monitored, and loading corresponding monitoring metric configuration information and rule instances based on the tenant ID, wherein the monitoring metric configuration information represents the data source information of the target metric code, and the rule instances represent the monitoring rule information of the target metric code; determining the query mode corresponding to the target metric code based on the monitoring metric configuration information, and generating an expression corresponding to the target metric code based on the rule instances; retrieving multiple monitoring data rows from the database based on the query mode, and evaluating the multiple monitoring data rows based on the expression in the sandbox execution environment to obtain the evaluation result; and determining the alarm result based on the evaluation result and the rule instances.

[0100] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: receiving monitoring indicator definitions and storing the monitoring indicator definitions in an indicator definition table to obtain multiple monitoring indicator configuration information, wherein the monitoring indicator definitions include indicator codes, indicator names, data source query statement templates, query modes, and tenant fields; receiving rule templates and fill parameters for monitoring indicators, and generating multiple rule instances based on the rule templates and fill parameters, wherein the rule templates include expression skeletons and parameter definition lists, and the rule instances include at least an expression to be executed and an alarm rule; establishing an association between rule instances and monitoring indicator configuration information through indicator codes.

[0101] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: filtering multiple configuration records with an enabled running status from the monitoring indicator configuration information, and determining a query mode corresponding to the target indicator code from the multiple configuration records; determining multiple candidate rules with an enabled running status based on rule instances, and determining the target rule from the multiple candidate rules according to the tenant ID through a multi-level priority inheritance method, and determining the expression to be executed in the target rule as the expression of the target indicator code.

[0102] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: if the query mode is real-time full mode, the target data source query statement template is read from the monitoring indicator configuration information, and the tenant identifier placeholder in the target data source query statement template is replaced with the tenant ID to obtain the data source query statement. The query is then executed in the database according to the data source query statement to obtain multiple monitoring data rows; if the query mode is snapshot acceleration mode, the pre-aggregated snapshot table corresponding to the target indicator code is determined from the monitoring indicator configuration information, and multiple monitoring data rows are obtained from the pre-aggregated snapshot table.

[0103] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: traversing each monitoring data row to obtain the current data signature corresponding to the monitoring data row; extracting the historical data signature corresponding to the monitoring data row from the query result cache; if the current data signature and the historical data signature are the same, reading the historical result from the query result cache and determining the historical result as the evaluation result; if the current data signature and the historical data signature are different, executing the expression using the field values ​​of the monitoring data row in the sandbox execution environment to obtain the evaluation result and writing the evaluation result into the query result cache.

[0104] Optionally, in this embodiment, the computer-readable storage medium is further configured to store program code for performing the following steps: if the evaluation result is that no alarm is triggered, then the alarm result of the monitoring data row corresponding to the evaluation result is determined as no alarm needs to be output; if the evaluation result is that an alarm is triggered, then the historical alarm records of the monitoring data row corresponding to the evaluation result within a preset time window are obtained, and the target alarm level is determined based on the historical alarm records; the target alarm notification and the target alarm channel are determined from the rule instance based on the target alarm level, and the alarm result is determined based on the target alarm channel and the target alarm notification.

[0105] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing indicator monitoring method steps.

[0106] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0107] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0108] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0109] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0110] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0111] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0112] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for monitoring indicators, characterized in that, include: Receive tenant ID and target metric code to be monitored, and load corresponding monitoring metric configuration information and rule instance according to the tenant ID, wherein the monitoring metric configuration information is used to represent the data source information of the target metric code, and the rule instance is used to represent the monitoring rule information of the target metric code; Based on the monitoring indicator configuration information, determine the query mode corresponding to the target indicator code, and generate the expression corresponding to the target indicator code based on the rule instance; Based on the query pattern, multiple monitoring data rows are retrieved from the database, and in the sandbox execution environment, the multiple monitoring data rows are evaluated according to the expression to obtain the evaluation result; Based on the evaluation result and the rule instance, the alarm result is determined.

2. The method according to claim 1, characterized in that, Before receiving the tenant ID and the code of the target metric to be monitored, the method further includes: Receive monitoring metric definitions and store them in a metric definition table to obtain multiple monitoring metric configuration information. The monitoring metric definitions include metric code, metric name, data source query statement template, query mode, and tenant field. Receive a rule template and populated parameters for monitoring metrics, and generate multiple rule instances based on the rule template and the populated parameters. The rule template includes an expression skeleton and a parameter definition list, and the rule instances include at least an expression to be executed and an alarm rule. The association between the rule instance and the monitoring indicator configuration information is established through the indicator encoding.

3. The method according to claim 1, characterized in that, The process of determining the query mode corresponding to the target indicator code based on the monitoring indicator configuration information, and generating the expression corresponding to the target indicator code based on the rule instance, includes: Filter out multiple configuration records with an enabled running status from the monitoring indicator configuration information, and determine the query mode corresponding to the target indicator code from the multiple configuration records; Based on the rule instance, multiple candidate rules with the running status of "enabled" are determined, and the target rule is determined from the multiple candidate rules according to the tenant ID through a multi-level priority inheritance method. The expression to be executed in the target rule is determined as the expression encoded by the target indicator.

4. The method according to claim 1, characterized in that, Retrieving multiple rows of monitoring data from the database based on the query pattern includes: If the query mode is real-time full mode, then the target data source query statement template is read from the monitoring indicator configuration information, and the tenant identifier placeholder in the target data source query statement template is replaced with the tenant ID to obtain the data source query statement. The query is executed in the database according to the data source query statement to obtain the multiple monitoring data rows. If the query mode is snapshot acceleration mode, then the pre-aggregated snapshot table corresponding to the target indicator code is determined from the monitoring indicator configuration information, and the multiple monitoring data rows are obtained from the pre-aggregated snapshot table.

5. The method according to claim 1, characterized in that, The expression is used to evaluate the multiple rows of monitoring data, and the evaluation results include: Traverse each of the monitoring data rows to obtain the current data signature corresponding to the monitoring data row; Extract the historical data signature corresponding to the monitored data row from the query result cache; If the current data signature and the historical data signature are the same, then the historical result is read from the query result cache and the historical result is determined as the evaluation result; If the current data signature is different from the historical data signature, then in the sandbox execution environment, the expression is executed using the field values ​​of the monitoring data row to obtain the evaluation result, and the evaluation result is written to the query result cache.

6. The method according to claim 1, characterized in that, Based on the evaluation result and the rule instance, the alarm result is determined to include: If the evaluation result is that no alarm is triggered, then the alarm result of the monitoring data row corresponding to the evaluation result is determined to be that no alarm needs to be output. If the evaluation result triggers an alarm, then the historical alarm records of the monitoring data row corresponding to the evaluation result within a preset time window are obtained, and the target alarm level is determined based on the historical alarm records. Based on the target alarm level, the target alarm notification and target alarm channel are determined from the rule instance, and the alarm result is determined based on the target alarm channel and the target alarm notification.

7. An indicator monitoring device, characterized in that, include: The receiving unit is used to receive a tenant ID and a target metric code to be monitored, and load the corresponding monitoring metric configuration information and rule instance according to the tenant ID. The monitoring metric configuration information is used to represent the data source information of the target metric code, and the rule instance is used to represent the monitoring rule information of the target metric code. The generation unit is used to determine the query mode corresponding to the target indicator code based on the monitoring indicator configuration information, and to generate the expression corresponding to the target indicator code based on the rule instance; The evaluation unit is used to retrieve multiple monitoring data rows from the database according to the query pattern, and evaluate the multiple monitoring data rows according to the expression in the sandbox execution environment to obtain the evaluation result; The determining unit is used to determine the alarm result based on the evaluation result and the rule instance.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the indicator monitoring method according to any one of claims 1 to 6.

9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program executes the indicator monitoring method according to any one of claims 1 to 6 when it runs.

10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the indicator monitoring method according to any one of claims 1 to 6.