A performance index calculation method, device and medium in a network management system
By using custom functions and syntax parsing trees in the network management system to generate database custom functions, and directly perform indicator calculations in the database, the bottleneck of performance indicator calculation efficiency under large data volume is solved, and efficient calculations are achieved without increasing application server CPU resources.
Patent Information
- Application Number
- CN202310018017.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-06
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-01-06
AI Technical Summary
In the case of large data volume and multi-performance indicator definition, the bottleneck of performance indicator computing efficiency of network management systems is usually solved by increasing the CPU hardware resources of network management application module server and enabling multi-threading, but this is not completely effective.
By using custom functions and syntax parsing trees at the database level, using Antlr to generate lexical parsers and syntax parsers, automatically generate database custom function codes, and directly perform indicator calculations in the database to reduce the CPU load of the application server.
In the scenario of large data volume, the performance indicator calculation process is simplified, the CPU resource consumption of the application server is reduced, and the computing efficiency bottleneck problem is effectively solved.
Smart Images

Figure CN116346572B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network management, and in particular to a method, device and medium for calculating performance indicators in a network management system. Background Art
[0002] A network equipment management system is a management system that can perform configuration management, alarm reporting, and performance analysis on network devices connected to it, hereinafter referred to as the network management system. The performance analysis module can provide external performance indicator analysis and calculations to reflect the performance of the equipment and provide data reference for network operation and maintenance. Operation and maintenance engineers will define corresponding performance indicators based on different business needs, hereinafter referred to as indicators, such as: device CPU utilization, device availability, device energy consumption, etc. The indicator formula is the calculation formula of some counters, where the counters in the formula are reported by the network equipment and stored in the network management database. When the operation and maintenance personnel query the indicators through the network management system, the network management application module first finds the counter value in the indicator formula from the database, and then calculates the indicator result according to the indicator formula.
[0003] When the amount of data is large and there are many performance indicators defined, computing efficiency bottlenecks will appear. To solve the efficiency problem, the general practice is to increase the central processing unit (CPU) hardware resources of the network management application module server to enable multi-threading in the application and perform indicator calculation tasks.
[0004] It can be seen from this that how to reduce resource usage when calculating indicators is a technical problem that needs to be solved urgently by people in this field. Summary of the Invention
[0005] The purpose of this application is to provide a method, device and medium for calculating performance indicators in a network management system that reduces resource usage when calculating indicators.
[0006] To solve the above technical problems, the present application provides a method for calculating performance indicators in a network management system, including:
[0007] Receive business indicator query requests;
[0008] Call the custom function corresponding to the indicator according to the business indicator query request;
[0009] Obtaining indicator calculation results based on a custom function and a grammar parse tree, wherein the custom function and the grammar parse tree are generated based on pre-stored indicator formulas and function templates;
[0010] Returns indicator calculation results to the client terminal.
[0011] Preferably, in the performance indicator calculation method in the above network management system, the steps of setting the grammar parsing tree are:
[0012] Control the syntax analyzer to generate the lexical analyzer and grammar analyzer;
[0013] Control the lexical parser and the grammatical parser to traverse the pre-stored indicator formula and generate a grammatical parse tree.
[0014] Preferably, in the above-mentioned method for calculating performance indicators in the network management system, the steps for setting the custom function are as follows:
[0015] Control the parser to generate visitor files and listener files;
[0016] Control visitor files and listener files to traverse the grammar parse tree;
[0017] Fill in the default function template to generate a custom function.
[0018] Preferably, the performance indicator calculation method in the network management system controls the syntax analyzer to generate a lexical parser and a syntax parser, including:
[0019] Receive custom grammar rules;
[0020] Generate lexical parser and syntax parser according to custom grammar rules.
[0021] Preferably, the performance indicator calculation method in the network management system controls the parser to generate the visitor file and the listener file, including:
[0022] Receive custom grammar rules;
[0023] Generate visitor files and listener files according to custom syntax rules.
[0024] Preferably, the performance indicator calculation method in the network management system, calling a custom function corresponding to an indicator according to a business indicator query request, includes:
[0025] Assemble query SQL statements based on business indicator query requests;
[0026] Call the custom function corresponding to the indicator by assembling the query SQL statement.
[0027] Preferably, the performance indicator calculation method in the network management system, after controlling the syntax analyzer to generate the visitor file and the listener file, includes:
[0028] Rewrite the visitor file.
[0029] To solve the above technical problems, the present application further provides a performance indicator calculation device in a network management system, comprising:
[0030] Receiving module, used to receive business indicator query requests;
[0031] The calling module is used to call the custom function corresponding to the indicator according to the business indicator query request;
[0032] A calculation module, configured to obtain an indicator calculation result based on a custom function and a grammar parse tree, wherein the custom function and the grammar parse tree are generated based on a pre-stored indicator formula and a function template;
[0033] The return module is used to return the indicator calculation results to the client.
[0034] To solve the above technical problems, the present application further provides a performance indicator calculation device in a network management system, comprising:
[0035] Memory for storing computer programs;
[0036] The processor is used to implement the steps of the performance indicator calculation method in the network management system when executing the computer program.
[0037] In order to solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the performance indicator calculation method in the above network management system are implemented.
[0038] The performance indicator calculation method in the network management system provided by the present application includes: receiving a business indicator query request, calling a custom function corresponding to the indicator according to the business indicator query request, and obtaining the indicator calculation result according to the custom function and the grammatical parsing tree, wherein the custom function and the grammatical parsing tree are generated according to the pre-stored indicator formula and function template, and returning the indicator calculation result to the client. After receiving the query request, the database calls the custom function and the grammatical parsing tree through the query command, and can automatically call the custom function corresponding to the indicator to obtain the calculation result of the performance indicator. The database function is implemented based on C code at the bottom layer, with high operating efficiency, and database operations are IO intensive, with relatively many IO read and write operations, and the CPU spends most of the time waiting for IO. By using database function calculation, the database CPU resources can be fully utilized and the consumption of application server CPU resources can be reduced. There is no need to perform complex indicator calculation logic at the network management application layer, which greatly simplifies the performance indicator calculation process in the network management system. In the scenario of large data volumes, there is no need to increase the application server CPU resources, which effectively solves the problem of computing efficiency bottlenecks.
[0039] In addition, the present application also provides a device and a medium, which correspond to the above method and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0041] Figure 1 A flowchart of a method for calculating performance indicators in a network management system provided in an embodiment of the present application;
[0042] Figure 2 A structural diagram of a performance indicator calculation device in a network management system provided in an embodiment of the present application;
[0043] Figure 3 This is a structural diagram of another performance indicator calculation device in a network management system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0045] The core of this application is to provide a performance indicator calculation method, device and medium in a network management system that reduces resource usage when calculating indicators.
[0046] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0047] Network management equipment is essential for network management. Its configuration should meet all network management requirements. Network management system equipment includes network management units at each node, as well as equipment and corresponding software in the network management center. These devices enable network planning, control, and monitoring in industrial environments, ensuring proper operation. Generally speaking, network management involves managing a network in some way to ensure its normal and efficient operation. Its purpose is clear: to more effectively utilize network resources. It should maintain the normal operation of the network, promptly report and address network failures, and coordinate and maintain the efficient operation of the network system.
[0048] The performance analysis module provides external performance indicator analysis and calculations to reflect the performance of the device and provide data reference for network operation and maintenance. Operation and maintenance engineers will define corresponding performance indicators (hereinafter referred to as indicators) based on different business needs, such as device CPU utilization, device availability, and device energy consumption. The indicator formula is the calculation formula of some counters, such as:
[0049] KPI1 = counter1 / (counter2 + counter3). The counters in this formula are reported by network devices and stored in the network management database. When operations personnel query metrics through the network management system, the network management application module first retrieves the counter values in the metric formula from the database and then calculates the metric result according to the metric formula. When data volumes are large and there are many performance metrics defined, computational efficiency bottlenecks can occur. To address this efficiency issue, a common approach is to increase the CPU hardware resources of the network management application module server and enable multithreading within the application to perform metric calculations.
[0050] When the amount of data is large and there are many performance indicators defined, computing efficiency bottlenecks will appear. To solve the efficiency problem, the general practice is to increase the central processing unit (CPU) hardware resources of the network management application module server to enable multi-threading in the application and perform indicator calculation tasks.
[0051] In order to solve the above technical problems, simplify the complexity of the indicator calculation module, and reduce the CPU resources required for system operation, this application provides a performance indicator calculation method in a network management system, such as Figure 1 Shown, including:
[0052] S11: receiving a business indicator query request;
[0053] S12: Call the custom function corresponding to the indicator according to the business indicator query request;
[0054] S13: Obtaining an indicator calculation result according to the user-defined function and the grammar parse tree, wherein the user-defined function and the grammar parse tree are generated according to a pre-stored indicator formula and a function template;
[0055] S14: Return the indicator calculation results to the client.
[0056] It's important to note that in computer science and linguistics, syntactic analysis (also called parsing) is the process of analyzing input text consisting of sequences of words (such as English words) according to a given formal grammar to determine its grammatical structure. A parser typically appears as a component of a compiler or interpreter. Its function is to perform syntax checking and construct a data structure composed of the input words (typically a hierarchical data structure such as a parse tree or abstract syntax tree). A syntactic analyzer typically uses a separate lexical analyzer to separate individual "words" from the input character stream, and then uses the word stream as its input. In actual development, a syntactic analyzer can be written manually or generated (semi-)automatically using a tool.
[0057] Antlr (Another Tool for Language Recognition) is an open source syntax analyzer that can automatically generate a syntax tree for input content. Developers can use it to customize their own domain language. They only need to create a syntax rule file and use Antlr to generate corresponding classes based on the rule file. Based on these classes, we can use it to implement our own functions. It is a very powerful tool for parsing, translating and processing text and binary files. In principle, Antlr should be a domain-specific language (DSL) development tool. It is not only suitable for Structured Query Language (SQL), but also for other custom languages. The Antlr tool generates lexer and grammar parser as well as java files or other language files (supporting multiple languages) of visitor files and listener files. Preferably, Antlr is used as a syntax analyzer in this application.
[0058] It should be noted that this application implements this solution based on the database level, that is, after the database receives a business indicator query request, it calls the custom function corresponding to the indicator according to the business indicator query request, and obtains the indicator calculation result based on the custom function and the grammatical parsing tree, wherein the custom function and the grammatical parsing tree are generated according to the pre-stored indicator formula and function template, and the indicator calculation result is returned to the client at the earliest. That is, after the client sends an indicator query request to the database, the database calculates the indicator result and returns it to the client. Since the database function is implemented based on C code at the bottom layer, the operation efficiency is high, and the database operation is input / output (IO) intensive, there are many IO read and write operations, and the CPU spends most of the time waiting for IO. By using database function calculation, the database CPU resources can be fully utilized and the consumption of application server CPU resources can be reduced. With the help of the Antlr lexical analyzer, the database custom function code is automatically generated, and the calculation function corresponding to the indicator is created on the database.
[0059] In this embodiment, a custom function and parse tree are generated based on pre-existing indicator formulas and function templates. Upon receiving a query request, the custom function and parse tree are invoked via the query command to automatically call the corresponding custom function to obtain the performance indicator calculation result. This embodiment does not limit the type of indicator to be calculated; the corresponding indicator formula calculation method can be set according to actual needs.
[0060] The performance indicator calculation method in the network management system provided by this embodiment includes: receiving a business indicator query request, calling a custom function corresponding to the indicator according to the business indicator query request, obtaining the indicator calculation result according to the custom function and the grammatical parsing tree, wherein the custom function and the grammatical parsing tree are generated according to the pre-stored indicator formula and function template, and returning the indicator calculation result to the client. When the query request is received, the custom function and the grammatical parsing tree are called through the query command, and the custom function corresponding to the indicator can be automatically called to obtain the calculation result of the performance indicator. The database function is implemented based on C code at the bottom layer, with high operating efficiency. Database operations are IO-intensive, with many IO read and write operations, and the CPU spends most of its time waiting for IO. By using database function calculation, the database CPU resources can be fully utilized and the consumption of application server CPU resources can be reduced. There is no need to perform complex indicator calculation logic at the network management application layer, which greatly simplifies the performance indicator calculation process in the network management system. In the scenario of large data volumes, there is no need to increase the application server CPU resources, effectively solving the problem of computing efficiency bottlenecks.
[0061] According to the above embodiment, this embodiment provides a preferred solution for generating a grammar parse tree. In the performance indicator calculation method in the above network management system, the steps of setting the grammar parse tree are as follows:
[0062] Control the syntax analyzer to generate the lexical analyzer and grammar analyzer;
[0063] Control the lexical parser and the grammatical parser to traverse the pre-stored indicator formula and generate a grammatical parse tree.
[0064] The lexer and parser mentioned in this embodiment are automatically generated based on the grammar file using the command line tool provided by Antlr. The lexer and parser classes are used to parse the indicator formula to generate a grammar analysis tree. Antlr traverses the pre-stored indicator formula according to the grammar rules and generates a grammar analysis tree. The grammar rules include the definition of addition, subtraction, multiplication and division operators in the formula, the definition of variable name rules, the definition of special symbols and the definition of numeric constants. This embodiment does not limit the setting method of the grammar rules. It can be preset according to the database or customized by the operation and maintenance personnel. It can be set according to actual needs.
[0065] Preferably, controlling the syntax analyzer to generate a lexical analyzer and a syntax analyzer includes:
[0066] Receive custom grammar rules;
[0067] Generate lexical parser and syntax parser according to custom grammar rules.
[0068] According to the actual application needs, set the corresponding custom grammar rules. Antlr traverses the pre-stored indicator formula according to the grammar rules and generates a grammar parse tree.
[0069] According to the above embodiment, this embodiment provides a preferred solution for generating a custom function. In the above performance indicator calculation method in the network management system, the steps for setting the custom function are as follows:
[0070] Control the parser to generate visitor files and listener files;
[0071] Control visitor files and listener files to traverse the grammar parse tree;
[0072] Fill in the default function template to generate a custom function.
[0073] The visitor and listener files mentioned in this embodiment are automatically generated from the grammar file using the command-line tool provided by Antlr. The visitor and listener classes are used to traverse the parse tree. Antlr traverses the pre-stored indicator formula according to the grammar rules. After generating the parse tree, it uses the visitor to traverse the grammar tree, calling the rewritten visitor-related methods to parse and generate the data required for the template file. The function name, parameters, and function body content in the custom function template are filled in to automatically generate the custom function code. Finally, the generated custom function code is used to create a custom function in the database for calculating performance indicators.
[0074] According to the above embodiment, after receiving a service indicator query request, the performance indicator calculation method in the network management system calls the custom function corresponding to the indicator according to the service indicator query request, including:
[0075] Assemble query SQL statements based on business indicator query requests;
[0076] Call the custom function corresponding to the indicator by assembling the query SQL statement.
[0077] Structured Query Language (SQL) is a database query and programming language used to access data and query, update and manage relational database systems; SQL statements are a language for operating databases.
[0078] Once a custom indicator function is created, the indicator query and calculation process no longer requires attention to the operational logic within the indicator formula. Instead, the user only needs to retrieve the associated database custom function based on the indicator information, assemble a database query SQL statement, and directly call the custom function to perform the indicator query and calculation. Performance indicator analysis within the network management system is a crucial component of network operations and maintenance monitoring. However, the performance indicator calculation logic implemented within the network management application module is complex, and the business modules are tightly coupled. In scenarios with multiple indicators and large data volumes, increasing system server CPU resources is required to overcome computational efficiency bottlenecks. With the Antlr lexical analyzer, simply define the performance indicator formula syntax file to parse all performance indicator formulas defined in the system, automatically generate database custom function code, and create the corresponding calculation function in the database. This eliminates the need for complex indicator calculation logic within the network management application layer, significantly simplifying the performance indicator calculation process within the network management system. In scenarios with large data volumes, this eliminates the need to increase application server CPU resources, effectively addressing computational efficiency bottlenecks. During indicator calculation and analysis, the business application layer can directly execute query SQL in the database, automatically calling the corresponding custom function to obtain the performance indicator calculation results. The underlying database function is implemented based on C code and has high operating efficiency. Database operations are IO-intensive, with many IO read and write operations. The CPU spends most of its time waiting for IO. By using database function calculation, the database CPU resources can be fully utilized and the CPU resource consumption of the application server can be reduced.
[0079] In addition, in order to better adapt to the scenario, the performance indicator calculation method in the above network management system, after controlling the syntax analyzer to generate the visitor file and the listener file, includes:
[0080] Rewrite the visitor file.
[0081] After controlling the syntax analyzer to generate the lexical parser and syntax parser, these generated codes are put into use in the network management system, and the logic of filling in the custom function template is implemented by rewriting the methods in the visitor class.
[0082] In the above embodiments, a method for calculating performance indicators in a network management system is described in detail. This application also provides corresponding embodiments of a device for calculating performance indicators in a network management system. It should be noted that this application describes embodiments of the device from two perspectives: one based on functional modules and the other based on hardware.
[0083] Based on the perspective of functional modules, Figure 2 This is a structural diagram of a performance indicator calculation device in a network management system provided by an embodiment of the present application, such as Figure 2 Shown, including:
[0084] Receiving module 21, used to receive a business indicator query request;
[0085] A calling module 22 is used to call a custom function corresponding to an indicator according to a business indicator query request;
[0086] A calculation module 23 is configured to obtain an indicator calculation result based on a user-defined function and a grammar parse tree, wherein the user-defined function and the grammar parse tree are generated based on a pre-stored indicator formula and a function template;
[0087] The return module 24 is used to return the indicator calculation results to the client.
[0088] Specifically, a receiving module 21 is used to receive a business indicator query request; a calling module 22 is used to call the custom function corresponding to the indicator based on the business indicator query request; a calculation module 23 is used to obtain the indicator calculation result based on the custom function and the grammatical parsing tree, wherein the custom function and the grammatical parsing tree are generated based on pre-stored indicator formulas and function templates; and a return module 24 is used to return the indicator calculation result to the client. Upon receiving the query request, the custom function and the grammatical parsing tree are called through the query command to automatically call the custom function corresponding to the indicator to obtain the performance indicator calculation result. The database function is implemented in C code at the bottom layer and has high operational efficiency. Database operations are IO-intensive, with a high number of IO read and write operations, and the CPU spends most of its time waiting for IO. By using database function calculation, database CPU resources can be fully utilized and application server CPU resource consumption can be reduced. This eliminates the need for complex indicator calculation logic at the network management application layer, greatly simplifying the performance indicator calculation process in the network management system. In scenarios with large data volumes, there is no need to increase application server CPU resources, effectively solving the computing efficiency bottleneck.
[0089] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, and they will not be repeated here.
[0090] Figure 3 This is a structural diagram of another performance indicator calculation device in a network management system provided in an embodiment of the present application, such as Figure 3 As shown, the performance indicator calculation device in the network management system includes: a memory 30 for storing computer programs;
[0091] The processor 31 is configured to implement the steps of the method for obtaining user operation habit information in the above embodiment (performance indicator calculation method in a network management system) when executing a computer program.
[0092] The performance indicator calculation device in the network management system provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0093] Among them, the processor 31 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 31 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 31 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 31 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 31 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0094] The memory 30 may include one or more computer-readable storage media, which may be non-transitory. The memory 30 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 30 is at least used to store the following computer program 301, wherein, after the computer program is loaded and executed by the processor 31, it can implement the relevant steps of the performance indicator calculation method in the network management system disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 30 may also include an operating system 302 and data 303, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 302 may include Windows, Unix, Linux, etc. The data 303 may include but is not limited to data involved in implementing the performance indicator calculation method in the network management system.
[0095] In some embodiments, the performance indicator calculation device in the network management system may further include a display screen 32 , an input and output interface 33 , a communication interface 34 , a power supply 35 , and a communication bus 36 .
[0096] Those skilled in the art will understand that Figure 3 The structure shown in the figure does not constitute a limitation on the performance indicator calculation device in the network management system, and may include more or fewer components than shown in the figure.
[0097] An embodiment of the present application provides a performance indicator calculation device in a network management system, comprising a memory and a processor. When executing a program stored in the memory, the processor can implement the following method: a performance indicator calculation method in a network management system, comprising: receiving a business indicator query request, calling a custom function corresponding to the indicator according to the business indicator query request, obtaining an indicator calculation result based on the custom function and a grammatical parsing tree, wherein the custom function and grammatical parsing tree are generated based on pre-stored indicator formulas and function templates, and returning the indicator calculation result to a client. Upon receiving a query request, the custom function and grammatical parsing tree are called through a query command, thereby automatically calling the custom function corresponding to the indicator to obtain the performance indicator calculation result. The database function is implemented in C code at the bottom layer, which has high operational efficiency. Database operations are I / O-intensive, with a high number of I / O read and write operations, and the CPU spends most of its time waiting for I / O. By using database function calculation, database CPU resources can be fully utilized, reducing application server CPU resource consumption. This eliminates the need for complex indicator calculation logic at the network management application layer, greatly simplifying the performance indicator calculation process in the network management system. In scenarios with large data volumes, there is no need to increase application server CPU resources, effectively solving the computing efficiency bottleneck problem.
[0098] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the embodiment of the performance indicator calculation method in the network management system.
[0099] It is understandable that if the method in the above embodiment is implemented in the form of 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 the present application, 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, which is stored in a storage medium and executes all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0100] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the program can implement the following method: a performance indicator calculation method in a network management system, comprising: receiving a service indicator query request; invoking a custom function corresponding to the indicator based on the service indicator query request; obtaining the indicator calculation result based on the custom function and a grammatical parsing tree; wherein the custom function and grammatical parsing tree are generated based on pre-stored indicator formulas and function templates; and returning the indicator calculation result to the client. Upon receiving a query request, the custom function and grammatical parsing tree are automatically invoked via a query command to obtain the performance indicator calculation result. The database function is implemented in C code at the underlying layer, which provides high efficiency. Database operations are I / O-intensive, with numerous I / O read and write operations, and the CPU spends most of its time waiting on I / O. Using database function calculations can fully utilize database CPU resources and reduce application server CPU resource consumption. This eliminates the need for complex indicator calculation logic at the network management application layer, greatly simplifying the performance indicator calculation process in the network management system. In scenarios with large data volumes, this eliminates the need to increase application server CPU resources, effectively resolving computational efficiency bottlenecks.
[0101] The above is a detailed introduction to the performance indicator calculation method, device and medium in the network management system provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
[0102] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
Claims
1. A method for calculating performance indicators in a network management system, characterized in that: Applied to databases, including: Receive business indicator query requests from clients; Calling a custom function corresponding to an indicator according to the business indicator query request; Obtaining an indicator calculation result according to the user-defined function and the grammar parse tree, wherein the user-defined function and the grammar parse tree are generated according to a pre-stored indicator formula and a function template; Return the indicator calculation results to the client; The steps for setting the grammar parse tree are: Controlling the syntax analyzer to generate a lexical parser and a syntax parser; controlling the lexical parser and the syntax parser to traverse the pre-stored indicator formula to generate the syntax parse tree; The steps for setting the custom function are: Controlling the syntax analyzer to generate a visitor file and a listener file; controlling the visitor file and the listener file to traverse the syntax parse tree; filling a default function template to generate the custom function; The default function template is filled in, including: Fill in the function name, parameters, and function body content in the custom function template; The calling of the custom function corresponding to the indicator according to the business indicator query request includes: Assemble a query SQL statement according to the business indicator query request; and call the custom function corresponding to the indicator through the assembled query SQL statement.
2. The method for calculating performance indicators in a network management system according to claim 1, wherein: The control syntax analyzer generates a lexical analyzer and a syntax analyzer, including: Receive custom grammar rules; The lexical parser and the grammatical parser are generated according to the custom grammar rules.
3. The method for calculating performance indicators in a network management system according to claim 1, wherein: The controlling the syntax analyzer to generate a visitor file and a listener file comprises: Receive custom grammar rules; The visitor file and the listener file are generated according to the custom grammar rules.
4. The method for calculating performance indicators in a network management system according to claim 1, wherein: After the syntax analyzer is controlled to generate the visitor file and the listener file, the method includes: The visitor file is rewritten.
5. A performance index calculation device in a network management system, characterized in that: Applied to databases, including: Receiving module, used to receive business indicator query requests from clients; A calling module is used to call a custom function corresponding to an indicator according to the business indicator query request; A calculation module, configured to obtain an indicator calculation result according to the user-defined function and the grammar parse tree, wherein the user-defined function and the grammar parse tree are generated according to a pre-stored indicator formula and a function template; A return module, used to return the indicator calculation results to the client; The performance indicator calculation device in the network management system is specifically used to: Controlling the syntax analyzer to generate a lexical parser and a syntax parser; controlling the lexical parser and the syntax parser to traverse the pre-stored indicator formula to generate the syntax parse tree; The performance indicator calculation device in the network management system is specifically used to: Controlling the syntax analyzer to generate a visitor file and a listener file; controlling the visitor file and the listener file to traverse the syntax parse tree; filling a default function template to generate the custom function; The performance indicator calculation device in the network management system is specifically used to: Fill in the function name, parameters, and function body content in the custom function template; The calling module is specifically used to: Assemble a query SQL statement according to the business indicator query request; and call the custom function corresponding to the indicator through the assembled query SQL statement.
6. A performance index calculation device in a network management system, characterized in that: include: Memory for storing computer programs; A processor is configured to implement the steps of the performance indicator calculation method in the network management system according to any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the performance indicator calculation method in the network management system according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Big data free query method and device
CN110580258A
Data processing method and device
CN114816420A