Index query method and device of cloud product, equipment, storage medium and product
By obtaining the indicator query requests for cloud products and determining the indicator storage model and calculation method, it solves the problem that enterprises find it difficult to understand the usage status of cloud resources, and realizes the rational use and waste avoidance of cloud resources.
Patent Information
- Application Number
- CN202510138375.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-03-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
After enterprises go to the cloud, due to the complex and diverse cloud product indicators, traditional technicians find it difficult to understand the usage status of cloud resources, resulting in the inability to reasonably utilize cloud resources, resulting in waste of resources.
By obtaining the indicator query request for cloud products, determining the indicator storage model and indicator calculation method, the query results represent the usage status of cloud resources, and are used for cloud resource optimization. The metric storage model and metric calculation method are based on the common attributes and calculation logic of multiple cloud products.
This enables users to understand the usage status of cloud resources, so that cloud resources can be used reasonably and resources can be avoided.
Smart Images

Figure CN119577257A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a method, device, equipment, storage medium and product for querying cloud product indicators. Background Art
[0002] With the development of cloud computing technology, enterprises have migrated applications, data, systems, etc. that originally ran on local servers or personal computers to cloud service platforms. Cloud service platforms help enterprises take advantage of cloud computing's elastic scaling, on-demand resource allocation, high availability, and other advantages to improve operational efficiency and reduce costs.
[0003] However, after enterprises complete the cloud migration, due to the complexity and diversity of cloud products, different cloud products have different indicators, and different methods of collecting, analyzing and consuming different indicators. Traditional enterprise technicians are not familiar with the use of the cloud and are unable to understand the cloud resource usage status and make decisions based on the indicators of each cloud product. For example, they may take some idle applications offline and downgrade the cloud resources of some applications, etc., resulting in the inability to reasonably use cloud resources and a large amount of cloud resources being wasted. Summary of the invention
[0004] The embodiments of the present application provide a cloud product indicator query method, device, equipment, storage medium and product, so that users can understand the cloud resource usage status, thereby realizing the rational use of cloud resources and avoiding the waste of cloud resources.
[0005] In a first aspect, an embodiment of the present application provides a method for querying cloud product indicators, including: Obtain the indicator query request for the cloud product, and obtain the indicator storage model and indicator calculation method based on the indicator query request; Based on the indicator storage model and indicator calculation method, determine the query result corresponding to the indicator query request; the query result represents the cloud resource usage status of the cloud product; the cloud resource usage status is used to optimize the cloud resources; Among them, the indicator storage model is determined according to the common attributes of the indicator data corresponding to multiple cloud products respectively; the indicator calculation method is determined according to the common calculation logic of the indicator data corresponding to multiple cloud products respectively.
[0006] In a second aspect, an embodiment of the present application provides an indicator query device for a cloud product, including: The acquisition module is used to obtain the indicator query request of the cloud product, and obtain the indicator storage model and indicator calculation method according to the indicator query request; the cloud resource usage status is used to optimize the cloud resources; A determination module is used to determine the query result corresponding to the indicator query request based on the indicator storage model and the indicator calculation method; the query result represents the cloud resource usage status of the cloud product; Among them, the indicator storage model is determined according to the common attributes of the indicator data corresponding to multiple cloud products respectively; the indicator calculation method is determined according to the common calculation logic of the indicator data corresponding to multiple cloud products respectively.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the above methods when executing the computer program.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, any of the above methods is implemented.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements any of the above methods.
[0010] Compared with the prior art, this application has the following advantages: The present application provides an index query method, device, equipment, storage medium and product for cloud products. First, an index query request for cloud products is obtained, and according to the index query request, an index storage model and an index calculation method are obtained; then, based on the index storage model and the index calculation method, a query result corresponding to the index query request is determined; the query result represents the cloud resource usage status of the cloud product; the cloud resource usage status is used to optimize cloud resources; wherein, the index storage model is determined according to the common attributes of the index data corresponding to multiple cloud products; the index calculation method is determined according to the common calculation logic of the index data corresponding to multiple cloud products. In the embodiment of the present application, the index storage model is determined according to the common attributes of the index data corresponding to multiple cloud products, and the index calculation method is determined according to the common calculation logic of the index data corresponding to multiple cloud products, so as to realize the normalization of the index storage model and the index calculation method, and facilitate the maintenance and expansion of the index data; when querying the index data, the query result is determined according to the unified index storage model and the index calculation model, so as to facilitate the user to understand the cloud resource usage status, thereby facilitating the user to make decisions according to the cloud resource usage status, realize the rational use of cloud resources, and avoid the waste of cloud resources.
[0011] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments according to the present application and should not be regarded as limiting the scope of the present application.
[0013] Figure 1 A schematic diagram of an indicator storage model for a cloud product according to an embodiment of the present application.
[0014] Figure 2 A schematic diagram of the calculation process of the index query method for a cloud product according to an embodiment of the present application.
[0015] Figure 3 A schematic diagram of the calculation process of the index query method for a cloud product according to an embodiment of the present application.
[0016] Figure 4 This is a flowchart of a method for querying cloud product indicators according to an embodiment of the present application.
[0017] Figure 5 This is a structural block diagram of an indicator query device for a cloud product according to an embodiment of the present application.
[0018] Figure 6 A block diagram of an electronic device used to implement an embodiment of the present application. DETAILED DESCRIPTION
[0019] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the concept or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary in nature and not restrictive.
[0020] To facilitate understanding of the technical solutions of the embodiments of the present application, the following describes the related technologies of the embodiments of the present application. The following related technologies can be combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application.
[0021] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0022] In the related art, due to the differences between cloud products, different cloud product indicators have differences. The collection, analysis and consumption of different indicators all contain their own characteristics, and are processed in a process-oriented manner through Java code. For the indicator analysis of cloud products, they are distinguished according to cloud products, and the indicator collection of all cloud products is scheduled in a scheduled task. The collected indicator data is maintained in a separate original table according to different cloud products. Because the indicator name and quantity of each cloud product are different, from the database table to the creation, reading, updating and deletion operations of Java code, to the aggregation analysis into service results, each cloud product has its own logic, and finally encapsulated for use by the consumer end, and interface encapsulation is performed according to the demand. When adding an indicator of an existing cloud product, it involves the addition of the original table fields of the cloud product, the data access object (DAO) layer, the service layer, the aggregation processing logic layer, and the interface provided to the consumer end. The code modification of the entire link is very inefficient. Therefore, it is difficult to maintain and expand the indicator data of cloud products. Traditional enterprise technicians are not familiar with cloud use and cannot understand the cloud resource usage status and make decisions based on the indicators of each cloud product.
[0023] In the technical solution of the present application, an indicator storage model is determined according to the common attributes of the indicator data corresponding to multiple cloud products, and an indicator calculation method is determined according to the common calculation logic of the indicator data corresponding to multiple cloud products, thereby realizing normalization of the indicator storage model and the indicator calculation method, and facilitating the maintenance and expansion of the indicator data; when querying the indicator data, the query results are determined according to the unified indicator storage model and the indicator calculation model, so that users can understand the usage status of cloud resources, thereby facilitating users to make decisions based on the usage status of cloud resources and determine whether operations such as upgrading, downgrading, releasing, and configuration adjustment are required, thereby optimizing the use of cloud products, avoiding waste of cloud resources, and realizing rational use of cloud resources.
[0024] The technical solution of the present application is introduced below through a specific embodiment.
[0025] In this embodiment, an indicator storage model and an indicator calculation method are pre-constructed. The indicator data corresponding to the multiple cloud products are different, but have common attributes, and the indicator storage model can be constructed according to the common attributes. Specifically, the attribute information of the indicator data corresponding to the multiple cloud products is obtained, and the common attributes of the indicator data are obtained according to the attribute information; according to the common attributes, the indicator storage model is determined, and the storage model includes indicator attributes and indicator metadata associated with the indicator attributes. The indicator attributes include common attributes; the indicator metadata is used to describe the indicator data. In addition, the indicator data corresponding to the multiple cloud products are different, but a common calculation method can be abstracted. Specifically, based on the calculation logic of the indicator data corresponding to the multiple cloud products, the calculation logic is abstracted to obtain the common calculation logic; according to the common calculation logic, the indicator calculation method is determined; the indicator calculation method includes multiple types of query statements and indicator calculation functions of multiple analysis dimensions. Optionally, the indicator calculation method is stored in the indicator metadata of the indicator storage model.
[0026] Figure 1 This is a schematic diagram of the index storage model of the cloud product provided in this application. Figure 1As shown, the indicator storage model includes indicator attributes and indicator meta information associated with the indicator attributes. The indicator attributes may include but are not limited to: unique identifier, update time, creation time, deletion time, meta indicator (metric) name, meta indicator code (metric_code), cloud product type, version information, etc. Among them, the meta indicator is a summary description of the indicator. For example, if the indicator data is the average CPU usage, the maximum CPU usage, and the minimum CPU usage, then the meta indicator is the CPU usage. The indicator meta information is used to describe the indicator data, including but not limited to: meta indicator code unique identifier (metric_code_id), indicator code (index_code), indicator data source, indicator calculation function, indicator query statement, cloud product to which the indicator belongs, indicator status, service classification, indicator name, statistical cycle, precision, unit, indicator type, etc. Among them, the indicator query statement may include a Structured Query Language (SQL) statement or a Prometheus Query Language (PQL) statement, etc. The indicator status may include: 0, 1, -1, where 0 means newly created, 1 means online, and -1 means offline. The source of indicator data is the interface for obtaining data, such as source information such as base tables and fields. The indicator types include: 0, 1, where 0 represents statistical indicators and 1 represents time series indicators. Indicator calculation functions include but are not limited to: sum function, avg function, max function, min function and count function. When using the indicator storage model to store specific indicator data, column storage can be used, for example, the data storage structure of the Prometheus monitoring component can be used for storage. Column storage to save time series data can optimize the reading and writing efficiency of time series data. When adding new indicator data to multiple cloud products, adding the indicator attributes, indicator metadata and indicator calculation method corresponding to the new indicator data in the indicator storage model can realize the addition of indicators, which has good scalability.
[0027] After receiving the indicator query request of the cloud product, parse the request, determine the indicator data to be queried, obtain the indicator storage model and indicator calculation method, determine the target indicator attribute corresponding to the indicator query request in the indicator attribute in the indicator storage model, and determine the target calculation method in the target indicator metadata associated with the target indicator attribute. The target calculation method includes a target query statement and a target calculation function; use the target query statement to obtain the original indicator data corresponding to the target indicator attribute and the target indicator metadata. Filter and group the original indicator data to obtain the target indicator data. Use the target calculation function to analyze and calculate the target indicator data in multiple dimensions to obtain the calculation results; aggregate the calculation results according to the preset time period to obtain the query results. The specific process is as follows: Figure 2 The calculation shown is Figure 3 The secondary calculation is shown.
[0028] like Figure 2 As shown in the figure, the original indicator time series data is queried using the query statement, where dept represents the department, group represents the group, instance_id represents the ID of the service instance that provides cloud resource services, and ecs_disk_util represents the disk utilization of the elastic computing service, that is, the indicator data to be queried.
[0029] The values of the indicator data ecs_disk_util of dept1, group1, and instance_id1 at different times (2024-08-20 10:00:00…2024-08-21 10:50:00) are 10%, 1%, 3%…12%, 13% respectively; the values of the indicator data ecs_disk_util of dept1, group2, and instance_id2 at different times (2024-08-20 10:00:00…2024-08-21 10:50:00) are 5%, 19%, 43%…57%, 51% respectively; the values of the indicator data ecs_disk_util of dept2, group3, and instance_id3 at different times (2024-08-20 10:00:00…2024-08-21 10:40:00) are 16%, 23%, 34%…33%, 45% respectively. After data screening, for example, filtering by tags, the tags can be cloud account ID cloudUid, region ID regionid, zone ID zoneid, department ID deptid, group ID groupid, service instance ID instanceid, status status, etc. The filtered data is then grouped, for example, grouped by deptid, groupid, and instanceid, and the obtained indicator data is then aggregated and calculated by functions. The calculation functions may include: avg_over_time, max_over_time, min_over_time, sum, count, and custom functions can also be used. The calculation functions, query statement types, and data acquisition interfaces used in this embodiment are shown in the following table:
[0030] In practical applications, Prometheus components can be used to perform a calculation once, and then a second calculation can be performed after the calculation is completed, such as Figure 3 As shown, the data after one calculation (for example, grouped by department ID, grouped by group ID, and grouped by service instance ID) is subjected to secondary aggregation calculation. It can be aggregated according to the time length, department ID, or group ID according to specific needs. For example, the data of each day can be aggregated to obtain the data of 7 days, or the data of 7 days can be aggregated to obtain the data of one month, etc. The aggregated data can also be sorted according to specific needs, for example, sorted from large to small according to the value of the indicator data, etc. If the sorted data still needs other explanatory information, the data is completed to obtain the final query result and provide it to the user.
[0031] Among them, when using the Prometheus component for calculation, in the startup configuration of the Prometheus component, the data storage duration can be set according to specific needs to control the life cycle of the original indicator data, avoid the problem of performance deterioration due to the accumulation of data over time, and ensure that the indicator query and analysis capabilities will not decay as the amount of data accumulated increases. In the secondary aggregation calculation, set the longest aggregation time, for example, set it to two weeks, and regularly clean up expired historical data to avoid affecting the query speed.
[0032] In addition, in the related art, because the index query logic of different cloud products is implemented separately, there is a lack of universal, clear and understandable aggregation analysis logic, which leads to the need to temporarily explain the problem by querying the code. There are too many developers involved, and it is impossible to quickly and clearly give a reliable explanation. In this embodiment, each index attribute and calculation method are solidified in a unified index calculation model, each index can be explained, and the calculation method can be viewed, which is convenient for quick query and problem solving.
[0033] An embodiment of the present application provides an indicator query method for a cloud product. The method in this embodiment can be applied to servers, terminal devices, platforms, devices, etc. with computing and processing capabilities, wherein the server can be a server cluster or a single server, a server deployed in the cloud or a local server.
[0034] like Figure 4 The flowchart of the cloud product index query method according to an embodiment of the present application is shown, including: Step S401, obtaining an indicator query request for a cloud product, and obtaining an indicator storage model and an indicator calculation method according to the indicator query request.
[0035] Among them, cloud products refer to products that provide cloud resource services. The types of cloud resources include but are not limited to: computing resources, storage resources, and network resources. The indicator query request is used to query the indicator data of cloud products. The indicator data can represent the cloud resource usage status of cloud products. The indicator data includes: usage type indicators, static configuration type indicators, etc. Among them, usage type indicators include: CPU utilization, disk utilization, network bandwidth utilization, etc. Static configuration type indicators include: operating system version, hardware specifications, software version, configuration parameters, etc.
[0036] After receiving the indicator query request, the indicator query request is parsed to determine the indicator data to be queried, and the indicator storage model and indicator calculation method are obtained based on the indicator data.
[0037] Step S402, based on the indicator storage model and the indicator calculation method, determine the query result corresponding to the indicator query request; the query result represents the cloud resource usage status of the cloud product, and the cloud resource usage status is used for cloud resource optimization.
[0038] Among them, the indicator storage model is determined according to the common attributes of the indicator data corresponding to multiple cloud products respectively; the indicator calculation method is determined according to the common calculation logic of the indicator data corresponding to multiple cloud products respectively.
[0039] The indicator storage model is used to store the common attributes of different indicator data, and the indicator calculation method is used to calculate the query results of the indicators. The query results can enable users to understand the cloud resource usage status of cloud products, and then make decisions based on the cloud resource usage status, for example, determine whether operations such as upgrading, downgrading, releasing, and configuration adjustment are required, thereby optimizing the use of cloud resources.
[0040] The index query method for cloud products provided in the embodiment of the present application first obtains the index query request of the cloud product, and obtains the index storage model and the index calculation method according to the index query request; then, based on the index storage model and the index calculation method, determines the query result corresponding to the index query request; the query result represents the cloud resource usage status of the cloud product, and the cloud resource usage status is used to optimize the cloud resources; wherein, the index storage model is determined according to the common attributes of the index data corresponding to multiple cloud products respectively; the index calculation method is determined according to the common calculation logic of the index data corresponding to multiple cloud products respectively. In the embodiment of the present application, the index storage model is determined according to the common attributes of the index data corresponding to multiple cloud products respectively, and the index calculation method is determined according to the common calculation logic of the index data corresponding to multiple cloud products respectively, so as to realize the normalization processing of the index storage model and the index calculation method, and facilitate the maintenance and expansion of the index data; when querying the index data, the query result is determined according to the unified index storage model and the index calculation model, so as to facilitate the user to understand the cloud resource usage status, thereby facilitating the user to make decisions according to the cloud resource usage status, realize the rational use of cloud resources, and avoid the waste of cloud resources.
[0041] The following introduces the specific implementation process of the above steps through multiple implementation methods: In one implementation, before obtaining an indicator query request for a cloud product, the indicator query method for the cloud product also includes: obtaining attribute information of indicator data corresponding to multiple cloud products respectively, and obtaining common attributes of the indicator data based on the attribute information; determining an indicator storage model based on the common attributes, the storage model including indicator attributes and indicator metadata associated with the indicator attributes; the indicator attributes include common attributes; and the indicator metadata is used to describe the indicator data.
[0042] In actual applications, an indicator storage model is pre-constructed, and after receiving an indicator query request, the pre-constructed indicator storage model is directly called. The construction process of the indicator storage model specifically includes: obtaining the attribute information of different indicator data of multiple cloud products. The indicator data of different cloud products are different, and each indicator data has its own attribute information. The common characteristics of the attribute information are extracted to obtain common attributes, that is, the indicator attributes shared by multiple indicator data and the indicator meta information associated with the indicator attributes. The indicator attributes can include common attributes and custom attributes. New attributes can be defined according to specific needs. The indicator meta information is used to describe the indicator data. For example, the indicator attribute can be a unique identifier, update time, creation time, deletion time, meta indicator (metric) name, meta indicator code (metric_code), cloud product type, version information, etc., where the meta indicator is a summary description of the indicator data. For example, if the indicator data is the average CPU usage, the maximum CPU usage, and the minimum CPU usage, then the meta indicator is the CPU usage. The indicator meta information includes but is not limited to: the unique identifier of the meta indicator code (metric_code_id), the indicator code (index_code), the indicator data source (data_source), the cloud product to which the indicator belongs, the indicator status (status), the service category, the indicator name (index_name), the statistical period (statistic_period), the precision (scale), the unit (unit), the indicator type (index_type), etc.
[0043] Among them, the indicator attributes and indicator meta-information are associated through the two fields of meta-indicator code and meta-indicator code unique identifier, and other association methods can also be used. The association fields can be set according to specific needs. The specific content of the indicator attributes and indicator meta-information is determined based on the attribute information of the indicator data of different cloud products, and can also be other content, which is not limited in this application.
[0044] When using the indicator storage model to store specific indicator data, you can use column storage, for example, using the data storage structure of the Prometheus monitoring component for storage. Using column storage to save time series data can optimize the reading and writing efficiency of time series data.
[0045] In the embodiment of the present application, an indicator storage model is determined according to the common attributes of the indicator data corresponding to multiple cloud products, thereby achieving normalization of indicator storage and facilitating maintenance and query of indicator data.
[0046] In one implementation, before obtaining an indicator query request for a cloud product, the indicator query method for the cloud product also includes: obtaining a common calculation logic based on the calculation logic of indicator data corresponding to multiple cloud products; determining an indicator calculation method based on the common calculation logic; the indicator calculation method includes multiple types of query statements and indicator calculation functions of multiple analysis dimensions.
[0047] In actual applications, multiple indicator calculation methods are pre-constructed. Specifically, the indicator calculation logic of the indicator data of different cloud products is obtained. For example, the calculation logic of many indicator data uses PQL statements or SQL statements to obtain the original indicator data, and then uses functions to calculate the maximum value, minimum value, average value, etc. of the original indicator data to obtain the final result. Therefore, according to the calculation logic of different indicator data, the common calculation logic of the indicator data is abstracted as a universal indicator calculation method. This indicator calculation method is applicable to a variety of different indicator data. In other words, these indicator calculation methods are required for a variety of indicator data. The indicator calculation method includes multiple types of query statements and indicator calculation functions of multiple analysis dimensions. Query statements include but are not limited to: PQL statements or SQL statements. Calculation functions include but are not limited to: sum function, average function, maximum function, minimum function, and count function. You can also customize functions according to specific needs, for example, to calculate weighted average.
[0048] In the embodiment of the present application, the indicator calculation method is determined according to the calculation logic of the indicator data corresponding to multiple cloud products, thereby achieving normalization of the indicator calculation method and facilitating maintenance and query of the indicator data.
[0049] In one implementation, the indicator query method for cloud products also includes: storing the indicator calculation method in the indicator metadata; determining the query result corresponding to the indicator query request based on the indicator storage model and the indicator calculation method, including: determining the target indicator attribute corresponding to the indicator query request in the indicator attribute in the indicator storage model, and determining the target calculation method in the target indicator metadata associated with the target indicator attribute, the target calculation method including a target query statement and a target calculation function; determining the target indicator data according to the target indicator attribute, the target indicator metadata and the target query statement; and using the target calculation function to calculate the target indicator data to obtain the query result.
[0050] In actual applications, the indicator calculation method can be stored in the indicator storage model, for example, stored in the indicator meta information. When the indicator query is actually executed, the target indicator attribute corresponding to the indicator query request is determined in the indicator attribute in the indicator storage model, and the target calculation method is determined in the target indicator meta information associated with the target indicator attribute, and the query and calculation are performed. For example, to query the CPU usage, first, query the meta indicator code of the CPU usage based on the indicator storage model, query the data source, unit, precision of the CPU usage, the indicator query statement and indicator calculation function corresponding to the CPU usage in the indicator meta information associated with the meta indicator code, and query the CPU utilization of multiple times in the stored data according to the meta indicator code of the CPU usage, the data source, unit, and precision of the CPU usage using the indicator query statement, and use the indicator calculation function to calculate the average value, maximum value, minimum value, etc. of the CPU utilization as the query result.
[0051] In this embodiment, the indicator calculation method is stored in the indicator metadata of the indicator storage model. When performing an indicator query, the target indicator data and the target calculation method are determined and calculated based on the indicator attributes and indicator metadata stored in the indicator storage model, which facilitates users to query indicators.
[0052] In one implementation, target indicator data is determined based on target indicator attributes, target indicator meta-information and target query statements, including: using target query statements to obtain original indicator data corresponding to target indicator attributes and target indicator meta-information; and performing data screening and data grouping on the original indicator data to obtain target indicator data.
[0053] The target query statement may be a PQL statement or an SQL statement. After the original indicator data of a preset time period is queried using the target query statement, it is filtered and grouped to obtain the target indicator data.
[0054] The data screening condition can be determined according to the indicator query request, or can be set in advance according to specific needs. The data grouping method can be set in advance according to specific needs. For example, the indicator data can be screened out according to the cloud account ID and then grouped according to different departments, and the grouped data can be used as the target indicator data.
[0055] In one implementation, the target indicator data is calculated using a target calculation function to obtain a query result, including: using the target calculation function to perform analysis and calculation on the target indicator data in multiple dimensions to obtain a calculation result; the multiple dimensions include at least two of the following: finding the maximum value, the minimum value, the average value, the sum or quantity statistics; the calculation results are aggregated according to a preset time period to obtain a query result.
[0056] The analysis and calculation of multiple dimensions include but are not limited to summing, averaging, maximum value, minimum value and quantity statistics. You can also customize functions according to specific needs, such as weighted average. After obtaining the calculation results, you can also aggregate the calculation results. For example, you can aggregate the data of each day to get the data of 7 days, or aggregate the data of 7 days to get the data of one month.
[0057] Optionally, the aggregated data can be sorted according to specific needs, for example, sorting the indicator data from large to small according to their values.
[0058] In one implementation, the cloud product indicator query method further includes: when new indicator data is added to multiple cloud products, adding indicator attributes, indicator metadata, and indicator calculation methods corresponding to the new indicator data in the indicator storage model. In the related technology, when adding an indicator to an existing cloud product, it involves adding the original table fields of the cloud product, the data access object DAO layer, the service layer, the aggregation processing logic layer, and the interface provided to the consumer end, etc. The code modification of the entire link is very inefficient.
[0059] In this embodiment, when adding new indicator data, the indicator attributes, indicator meta information and indicator calculation method corresponding to the new indicator data can be directly added to the indicator storage model, so that the indicator can be added, which has good scalability.
[0060] Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides an indicator query device for a cloud product. Figure 5 The figure shows a structural block diagram of an indicator query device for a cloud product according to an embodiment of the present application, the device comprising: The acquisition module 501 is used to obtain an indicator query request of a cloud product, and obtain an indicator storage model and an indicator calculation method according to the indicator query request; The determination module 502 is used to determine the query result corresponding to the indicator query request based on the indicator storage model and the indicator calculation method; the query result represents the cloud resource usage status of the cloud product, and the cloud resource usage status is used to optimize the cloud resources; Among them, the indicator storage model is determined according to the common attributes of the indicator data corresponding to multiple cloud products respectively; the indicator calculation method is determined according to the common calculation logic of the indicator data corresponding to multiple cloud products respectively.
[0061] The index query device for cloud products provided in the embodiment of the present application first obtains the index query request of the cloud product, and obtains the index storage model and the index calculation method according to the index query request; then, based on the index storage model and the index calculation method, determines the query result corresponding to the index query request; the query result represents the cloud resource usage status of the cloud product, and the cloud resource usage status is used to optimize the cloud resources; wherein, the index storage model is determined according to the common attributes of the index data corresponding to multiple cloud products respectively; the index calculation method is determined according to the common calculation logic of the index data corresponding to multiple cloud products respectively. In the embodiment of the present application, the index storage model is determined according to the common attributes of the index data corresponding to multiple cloud products respectively, and the index calculation method is determined according to the common calculation logic of the index data corresponding to multiple cloud products respectively, so as to realize the normalization processing of the index storage model and the index calculation method, and facilitate the maintenance and expansion of the index data; when querying the index data, the query result is determined according to the unified index storage model and the index calculation model, so as to facilitate the user to understand the cloud resource usage status, thereby facilitating the user to make decisions according to the cloud resource usage status, realize the rational use of cloud resources, and avoid the waste of cloud resources.
[0062] In one implementation, before obtaining an indicator query request for a cloud product, the device is also used to: obtain attribute information of indicator data corresponding to multiple cloud products respectively, and obtain common attributes of the indicator data based on the attribute information; determine an indicator storage model based on the common attributes, the storage model includes indicator attributes and indicator metadata associated with the indicator attributes; the indicator attributes include common attributes; and the indicator metadata is used to describe the indicator data.
[0063] In one implementation, the device is also used to: before obtaining an indicator query request for a cloud product, obtain a common calculation logic based on the calculation logic of the indicator data corresponding to multiple cloud products; determine the indicator calculation method according to the common calculation logic; the indicator calculation method includes multiple types of query statements and indicator calculation functions of multiple analysis dimensions.
[0064] In one implementation, the device is also used to: store the indicator calculation method in the indicator metadata; determine the module 502, which is used to: determine the target indicator attribute corresponding to the indicator query request in the indicator attribute in the indicator storage model, and determine the target calculation method in the target indicator metadata associated with the target indicator attribute, the target calculation method including the target query statement and the target calculation function; determine the target indicator data according to the target indicator attribute, the target indicator metadata and the target query statement; use the target calculation function to calculate the target indicator data to obtain the query result.
[0065] In one implementation, when determining the target indicator data based on the target indicator attributes, target indicator meta-information and target query statement, the determination module 502 is used to: obtain the original indicator data corresponding to the target indicator attributes and the target indicator meta-information using the target query statement; perform data screening and data grouping on the original indicator data to obtain the target indicator data.
[0066] In one implementation, when the determination module 502 uses the target calculation function to calculate the target indicator data and obtain the query result, it is used to: use the target calculation function to perform multiple-dimensional analysis and calculation on the target indicator data to obtain the calculation result; the multiple dimensions include at least two of the following: finding the maximum value, the minimum value, the average value, the sum or quantity statistics; and aggregate the calculation results according to a preset time period to obtain the query result.
[0067] In one implementation, the device is also used to: when new indicator data is added to multiple cloud products, add indicator attributes, indicator metadata and indicator calculation methods corresponding to the new indicator data to the indicator storage model. The functions of each module in the embodiment of the present application can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.
[0068] Figure 6 is a block diagram of an electronic device used to implement an embodiment of the present application. Figure 6 As shown, the electronic device includes: a memory 610 and a processor 620. The memory 610 stores a computer program that can be run on the processor 620. When the processor 620 executes the computer program, the method in the above embodiment is implemented. The number of the memory 610 and the processor 620 can be one or more.
[0069] The electronic device also includes: The communication interface 630 is used to communicate with external devices and perform data exchange transmission.
[0070] If the memory 610, the processor 620 and the communication interface 630 are implemented independently, the memory 610, the processor 620 and the communication interface 630 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0071] Optionally, in a specific implementation, if the memory 610, the processor 620 and the communication interface 630 are integrated on a chip, the memory 610, the processor 620 and the communication interface 630 can communicate with each other through an internal interface.
[0072] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the method provided in the embodiment of the present application when the program is executed by a processor.
[0073] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method provided in the embodiment of the present application is implemented.
[0074] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.
[0075] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.
[0076] It should be understood that the above processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the Advanced RISC Machines (ARM) architecture.
[0077] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of exemplary but not limiting description, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).
[0078] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0079] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0080] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0081] Any process or method described in the flow chart or otherwise described herein can be understood as a module, fragment or portion of a code representing one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.
[0082] The logic and / or steps described in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0083] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0084] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.
[0085] The above is only an exemplary embodiment of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope recorded in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A cloud product indicator query method, characterized in that: include: Obtain an indicator query request for a cloud product, and obtain an indicator storage model and an indicator calculation method according to the indicator query request; Based on the indicator storage model and the indicator calculation method, determining a query result corresponding to the indicator query request; the query result represents the cloud resource usage status of the cloud product, and the cloud resource usage status is used to optimize the cloud resources; The indicator storage model is determined according to the common attributes of the indicator data corresponding to the multiple cloud products respectively; the indicator calculation method is determined according to the common calculation logic of the indicator data corresponding to the multiple cloud products respectively.
2. The method according to claim 1, characterized in that Before obtaining the cloud product indicator query request, the method further includes: Acquire attribute information of the indicator data respectively corresponding to the plurality of cloud products, and acquire common attributes of the indicator data according to the attribute information; According to the common attributes, the indicator storage model is determined, the storage model includes indicator attributes and indicator meta-information associated with the indicator attributes; the indicator attributes include the common attributes; the indicator meta-information is used to describe the indicator data.
3. The method according to claim 1 or 2, characterized in that: Before obtaining the cloud product indicator query request, the method further includes: Based on the calculation logic of the indicator data respectively corresponding to the multiple cloud products, the common calculation logic is obtained; The indicator calculation method is determined according to the common calculation logic; the indicator calculation method includes multiple types of query statements and indicator calculation functions of multiple analysis dimensions.
4. The method according to claim 2, characterized in that: The method further comprises: Storing the indicator calculation method in the indicator meta information; The determining, based on the indicator storage model and the indicator calculation method, a query result corresponding to the indicator query request includes: Determine the target indicator attribute corresponding to the indicator query request in the indicator attributes in the indicator storage model, and determine the target calculation method in the target indicator meta information associated with the target indicator attribute, wherein the target calculation method includes a target query statement and a target calculation function; Determine target indicator data according to the target indicator attribute, the target indicator meta information and the target query statement; The target calculation function is used to calculate the target indicator data to obtain the query result.
5. The method according to claim 4, characterized in that The determining target indicator data according to the target indicator attribute, the target indicator meta information and the target query statement includes: Using the target query statement, obtaining the original indicator data corresponding to the target indicator attribute and the target indicator meta-information; The original indicator data are screened and grouped to obtain the target indicator data.
6. The method according to claim 4, characterized in that The using the target calculation function to calculate the target indicator data to obtain the query result includes: Using the target calculation function, the target indicator data is analyzed and calculated in multiple dimensions to obtain calculation results; the multiple dimensions include at least two of the following: maximum value, minimum value, average value, sum or quantity statistics; The calculation results are aggregated according to a preset time period to obtain the query results.
7. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: In the case where new indicator data is added to the multiple cloud products, indicator attributes, indicator meta information and indicator calculation methods corresponding to the new indicator data are added to the indicator storage model.
8. A cloud product index query device, characterized in that: include: An acquisition module is used to obtain an indicator query request for a cloud product, and obtain an indicator storage model and an indicator calculation method according to the indicator query request; A determination module, configured to determine a query result corresponding to the indicator query request based on the indicator storage model and the indicator calculation method; the query result represents a cloud resource usage status of the cloud product, and the cloud resource usage status is used to optimize the cloud resources; The indicator storage model is determined according to the common attributes of the indicator data corresponding to the multiple cloud products respectively; the indicator calculation method is determined according to the common calculation logic of the indicator data corresponding to the multiple cloud products respectively.
9. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a computer program stored in the memory, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. 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 method according to any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Scoring and ranking method and system based on multi-product multi-dimensional performance indexes
CN114386879A
Custom index creating method and device
CN115098546A
Cloud platform monitoring method and cloud platform monitoring system
CN115827380A
Unified supervision index method based on data governance
CN117436768A
Index query method and system, electronic equipment and storage medium
CN117520386A