Performance monitoring method and apparatus, storage medium, and electronic device

By adding performance monitoring annotations and scenario annotations to business interfaces, the problem of insufficient comprehensiveness of interface-level performance statistics in existing technologies is solved, enabling flexible monitoring of business interfaces and detailed analysis of scenario performance results.

CN116389298BActive Publication Date: 2025-12-16BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310357750.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-04
Publication Date
2025-12-16
Estimated Expiration
2043-04-04

AI Technical Summary

Technical Problem

The lack of flexible performance monitoring methods in existing technologies results in incomplete performance statistics at the interface level, failing to meet the needs of multi-granularity monitoring.

Method used

Add performance monitoring annotations and scenario annotations to the business interfaces in the scenarios to be monitored. Obtain object-level performance data through performance monitoring annotations and perform statistics based on scenario annotations to obtain scenario performance result values.

Benefits of technology

It enables flexible monitoring of business interfaces, distinguishes monitoring based on the granularity of the business initiating object, and performs overall automatic statistics on performance data across the entire scenario, providing more flexible and detailed performance analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116389298B_ABST
    Figure CN116389298B_ABST
Patent Text Reader

Abstract

The present disclosure provides a performance monitoring method and device, electronic equipment and storage medium, and relates to the technical field of information security. The method comprises: adding performance monitoring annotations and scene annotations to a business interface in a to-be-monitored scene; obtaining object granularity performance data of the business interface for each business initiation object based on the performance monitoring annotations during processing of a business request by the business interface; and performing statistics on the object granularity performance data of the business interface based on the scene annotations to obtain scene performance result values for each business initiation object in the to-be-monitored scene. The method can distinguish and monitor the performance of the business interface in processing the business request according to the granularity of the business initiation object, and can also automatically statistically integrate the performance data of all business interfaces in a to-be-monitored scene, thereby realizing a flexible scene monitoring scheme.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of information security, and particularly relates to a performance monitoring method and device, a storage medium and an electronic device. BACKGROUND

[0002] In recent years, with the development of computer technology and network technology, it is more and more common to process business through network application programs, and it is necessary to monitor the interfaces in the network application programs to better manage and monitor the network application programs to ensure the safety and reliability of services.

[0003] In the related art, the performance of the interface level method is monitored without distinction, so there is a lack of performance statistics results of more granularity, and the performance monitoring result is not flexible and comprehensive enough.

[0004] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0005] The purpose of the present disclosure is to provide a performance monitoring method, device, electronic device and storage medium, which can realize a flexible scene monitoring scheme.

[0006] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.

[0007] According to one aspect of the present disclosure, a performance monitoring method is provided, comprising: adding performance monitoring annotations and scene annotations to a business interface in a to-be-monitored scene; obtaining object granularity performance data of the business interface for each business initiation object in the process of the business interface processing a business request based on the performance monitoring annotations; and performing statistics on the object granularity performance data of the business interface based on the scene annotations to obtain a scene performance result value for each business initiation object in the to-be-monitored scene.

[0008] In one embodiment of the present disclosure, performing statistics on the object granularity performance data of the business interface based on the scene annotations to obtain a scene performance result value for each business initiation object in the to-be-monitored scene comprises: determining all business interfaces in the to-be-monitored scene; processing the object granularity performance data of all business interfaces based on the scene annotations to obtain an interface performance result value of each business interface for each business initiation object; and determining the scene performance result value for each business initiation object in the to-be-monitored scene according to the interface performance result value.

[0009] In an embodiment of the present disclosure, the first interface is included in the service interface, the first object is included in the service initiation object, and the interface threshold and the performance quantification strategy of the first interface are indicated in the scenario annotation added for the first interface; wherein, the object granularity performance data of all service interfaces is processed based on the scenario annotation, and the interface performance result value of each service interface for each service initiation object is obtained, including: determining the input performance index according to the performance quantification strategy of the first interface; determining the performance data to be quantified from the object granularity performance data of the first interface for the first object according to the input performance index; taking the performance data to be quantified and the interface threshold of the first interface as the input data of the performance quantification strategy, and outputting the interface performance result value of the first interface for the first object.

[0010] In an embodiment of the present disclosure, the object granularity performance data of each service interface for each service initiation object is obtained based on the performance monitoring annotation, including: determining the object identifier of the service initiation object of the service request and the performance monitoring data of the service interface when processing the service request based on the performance monitoring annotation; and storing the object identifier and the performance monitoring data related to the same service request in association, and obtaining the object granularity performance data of each service interface for each service initiation object.

[0011] In an embodiment of the present disclosure, the performance monitoring annotation includes an object identifier field and an assignment mode of the object identifier field; wherein, the object identifier of the service initiation object of the service request is determined based on the performance monitoring annotation, including: intercepting the service request using an annotation interceptor corresponding to the performance monitoring annotation; determining target information from the service request based on the assignment mode, and assigning a value to the object identifier field according to the target information; and taking the value of the object identifier field as the object identifier of the service initiation object of the service request.

[0012] In an embodiment of the present disclosure, the performance indicator and the monitoring mode of the performance indicator are indicated in the monitoring annotation, and the performance indicator includes at least one of the following: event response rate, processing time, method call times, request success times, and method exception times; wherein, the performance monitoring data of the service interface when processing the service request is determined based on the performance monitoring annotation, including: monitoring the service interface using the monitoring mode of the performance indicator, and obtaining the performance monitoring data of the service interface under each performance indicator when processing the service request.

[0013] In an embodiment of the present disclosure, the performance monitoring annotation and the scenario annotation are added for the service interface in the to-be-monitored scenario, including: obtaining the scenario identifier and the monitoring requirement of the to-be-monitored scenario, and determining the to-be-monitored performance indicator, the performance quantification strategy, and the interface threshold of the service interface in the to-be-monitored scenario according to the monitoring requirement; adding the performance monitoring annotation for the service interface according to the to-be-monitored performance indicator; and adding the scenario annotation for the service interface according to the scenario identifier, the performance quantification strategy, and the interface threshold.

[0014] According to another aspect of the present disclosure, a performance monitoring device is provided, comprising: an adding-annotation module, configured to add performance monitoring annotations and scenario annotations to a business interface in a to-be-monitored scenario; a monitoring module, configured to obtain object granularity performance data of the business interface for each business initiation object based on the performance monitoring annotations during processing of a business request by the business interface; and a statistics module, configured to statistically process the object granularity performance data of the business interface based on the scenario annotations to obtain scenario performance result values for each business initiation object in the to-be-monitored scenario.

[0015] According to still another aspect of the present disclosure, a computer readable storage medium is provided, having a computer program stored thereon, the computer program being executed by a processor to implement the performance monitoring method described above.

[0016] According to yet another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute the performance monitoring method described above via execution of the executable instructions.

[0017] The performance monitoring method provided by the embodiments of the present disclosure can add performance monitoring annotations and scenario annotations to a business interface in a to-be-monitored scenario, then obtain object granularity performance data of the business interface for each business initiation object based on the performance monitoring annotations, and further obtain scenario performance result values for each business initiation object in the to-be-monitored scenario based on the scenario annotations. It can be seen that, on one hand, the performance of the business interface in processing a business request can be monitored in the granularity of the business initiation object, and on the other hand, the performance data of all business interfaces in a to-be-monitored scenario can be automatically statistically processed as a whole, thereby realizing a flexible scenario monitoring solution.

[0018] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not intended to limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and serve to explain the principles of the present disclosure. It is readily apparent to one of ordinary skill in the art that the accompanying drawings are merely examples which can be derived from a variety of drawings without creative work.

[0020] Figure 1 A schematic diagram of an exemplary system architecture to which the performance monitoring method of the embodiments of the present disclosure can be applied is shown;

[0021] Figure 2 A flowchart of the performance monitoring method of one embodiment of the present disclosure is shown;

[0022] Figure 3 FIG. 1 shows a flowchart of determining a scenario performance result value in a performance monitoring method according to an embodiment of the present disclosure;

[0023] Figure 4 FIG. 2 shows a flowchart of determining object granularity performance data in a performance monitoring method according to an embodiment of the present disclosure;

[0024] Figure 5 FIG. 3 shows a schematic diagram of a performance monitoring method according to an embodiment of the present disclosure;

[0025] Figure 6 FIG. 4 shows a block diagram of a performance monitoring apparatus according to an embodiment of the present disclosure; and

[0026] Figure 7 FIG. 5 shows a structural block diagram of a performance monitoring computer device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations can be implemented in any

[0028] Moreover, the drawings represent a simplified diagram where only those components and features that are necessary to conceptually illustrate the examples are shown, and thus not all components and features of an actual implementation are necessarily shown. In addition, the same reference numerals in different drawings are used to designate the same or similar components and features. The drawings are not necessarily to scale, emphasis instead being placed on the relation between components and features. The detailed description should be read in

[0029] In addition, the terms "first", "second", and the like, do not denote any

[0030] Figure 1 FIG. 1 shows a flowchart of determining a scenario performance result value in a performance monitoring method according to an embodiment of the present disclosure;

[0031] As Figure 1As shown, the system architecture can include a server 101, a network 102 and a client 103. The network 102 is a medium for providing a communication link between the client 103 and the server 101. The network 102 can include various connection types, such as wired, wireless communication links or fiber optic cables, etc.

[0032] In an example embodiment, the server 101 can be a server that provides various services, such as a background management server that provides support for the user's operation of the device using the client 103. The background management server can analyze and process received request data, etc., and feed back the processing result to the client 103. The server 101 can be a standalone physical server, a server cluster or a distributed system formed by multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. In some practical applications, the server 101 can also be a server of a network platform, such as a transaction platform, a live broadcast platform, a social platform or a music platform, etc., and the present disclosure does not limit the same. The server can be a server or a cluster formed by multiple servers, and the present disclosure does not limit the specific architecture of the server.

[0033] In an example embodiment, the client 103 that performs data transmission with the server 101 can include, but is not limited to, a smart phone, a desktop computer, a tablet computer, a notebook computer, a smart speaker, a digital assistant, an AR (Augmented Reality) device, a VR (Virtual Reality) device, a smart wearable device, etc., but is not limited thereto.

[0034] In an example embodiment, the process of the server 101 for implementing the performance monitoring method can be: the server 101 adds performance monitoring annotations and scene annotations to a business interface in a to-be-monitored scene; in the process of the business interface processing a business request, the server 101 obtains object granularity performance data of the business interface for each business initiation object based on the performance monitoring annotations; and the server 101 performs statistics on the object granularity performance data of the business interface based on the scene annotations, and obtains a scene performance result value for each business initiation object in the to-be-monitored scene.

[0035] In addition, it should be noted that, Figure 1 The shown is only one application environment of the performance monitoring method provided by the present disclosure. Figure 1The number of the server 101, the network 102 and the client 103 in the figure is only illustrative, and any number of clients, networks and servers can be provided according to actual needs.

[0036] In order for those skilled in the art to better understand the technical solutions of the present disclosure, the steps of the performance monitoring method in the example embodiments of the present disclosure will be described in more detail below in combination with the accompanying drawings and examples.

[0037] Figure 2 A flow chart of the performance monitoring method of one embodiment of the present disclosure is shown. The method provided by the embodiment of the present disclosure can be executed by the server 101 or the client 103 as shown, but the present disclosure is not limited thereto. Figure 1

[0038] In the following illustration, the server 101 is taken as an example to illustrate the execution subject.

[0039] As shown in Figure 2 The performance monitoring method provided by the embodiment of the present disclosure can include the following steps.

[0040] Step S201, adding performance monitoring annotations and scene annotations to the business interfaces in the to-be-monitored scene.

[0041] The to-be-monitored scene can be determined based on the scene implementation of the business process in the application program, for example, for an online transaction platform, the order placement process, the home page display process and the like therein can all be taken as to-be-monitored scenes. One to-be-monitored scene can correspond to one or more business interfaces, for example, for the order placement process scene, which is one to-be-monitored scene, there can be multiple business interfaces such as a search interface, a purchase interface, an order placement interface, a payment interface and the like; for example, for the home page display process scene, which is one to-be-monitored scene, there can be multiple business interfaces such as a banner display interface, a classification display interface, a merchant information interface and the like. Each business interface can contain at least one method; in the process of running and using the application program, the business interface can receive a business request and call the method therein to process the business request.

[0042] The performance monitoring annotations added to the business interface can realize the automatic performance monitoring function with definable object granularity in the performance monitoring method provided by the present disclosure, and the scene annotations added to the business interface can realize the automatic performance data statistical function with definable quantitative strategy.

[0043] ​In some embodiments, performance monitoring annotations and scene annotations are added to a business interface in a scene to be monitored, including: obtaining a scene identifier and monitoring requirements of the scene to be monitored, and determining, according to the monitoring requirements, performance indicators to be monitored of the business interface in the scene to be monitored, performance quantification strategies, and interface thresholds; adding performance monitoring annotations to the business interface according to the performance indicators to be monitored; and adding scene annotations to the business interface according to the scene identifier, the performance quantification strategies, and the interface thresholds.

[0044] In the embodiment, a configuration file containing a scene identifier and monitoring requirements can be created in advance, and the scene identifier and the monitoring requirements of the scene to be monitored are obtained by reading and parsing the configuration file.

[0045] The monitoring requirements can be obtained based on historical business data statistics in a scene, for example, if it is concluded from historical business data that the response rate and the response success rate are low in a certain scene, the monitoring requirements of monitoring the response rate and the response success rate can be set for the scene based on the conclusion, and then the performance indicators to be monitored, the performance quantification strategies, and the interface thresholds of each business interface in the scene are determined, and are added to each business interface by annotations, so as to realize automatic monitoring and statistical processing in subsequent steps.

[0046] In addition, when there are multiple scenes to be monitored, the corresponding relationship between each scene to be monitored and the interfaces contained therein can also be obtained in advance, and based on these corresponding relationships, it is determined which scene identifier should be added to which business interface, so that when there are multiple scenes to be monitored, all business interfaces in each scene to be monitored can be automatically identified by the scene identifier.

[0047] In step S203, object granularity performance data of the business interface for each business initiator is obtained based on the performance monitoring annotations during processing of the business request by the business interface.

[0048] In this step, the performance monitoring annotation can be obtained by modifying the native annotation in the Metrics tool (a set of lightweight monitoring toolkits provided by Java), and the native performance monitoring annotation in the Metrics tool mainly includes @Metric (used to count the rate of a certain event when the system interface processes a request, such as the number of requests per second TPS, the number of queries per second QPS, etc.), @Timed (used to count the interface processing time), @Counted (used to count), @Guage (used to handle fluctuations), etc. Specifically, the method provided by the present disclosure can add a field that can identify the initiator of the request (i.e., the business initiator object) and a field that can identify the business type to which the request belongs in each native performance monitoring annotation in the Metrics tool, so that the performance data can be obtained while determining which method under the interface each performance data belongs to and which request initiator (i.e., the business initiator object) each performance data corresponds to, that is, the object granularity performance data of the business interface for each business initiator object can be obtained.

[0049] The business initiator object can be determined based on actual needs or actual application environment, for example, in an application environment for saas multi-tenant deployment, the business initiator object can be a tenant object; for example, in an application environment for a client user, the business initiator object can be a client user, which is not limited by the present disclosure.

[0050] As can be seen, the performance of the business interface in processing the business request can be distinguished and monitored according to the granularity of the business initiator object in this step.

[0051] Step S205, based on the scene annotation, the object granularity performance data of the business interface is counted, and the scene performance result value for each business initiator object in the to-be-monitored scene is obtained.

[0052] In this step, the content in the scene annotation can be created by self-definition, or can be created by parsing the configuration file obtained in the foregoing. Setting the scene annotation can be used for automatic statistics of all business interfaces in a to-be-monitored scene, and the running state related to a set of business processes in the application program can be obtained, thereby providing accurate data basis for performance optimization of the business scene granularity.

[0053] In addition, the object granularity performance data counted in the present disclosure can be adjusted at the object granularity, further enabling the scene performance result value counted to not only reflect the overall performance of the process scene, but also be distinguished and counted based on the object granularity, which is more flexible.

[0054] The performance monitoring method provided by the present disclosure can add performance monitoring annotations and scene annotations to the business interfaces in the to-be-monitored scene, then obtain object granularity performance data of the business interfaces for each business initiation object based on the performance monitoring annotations, and further obtain scene performance result values of the to-be-monitored scene for each business initiation object based on the scene annotations. As can be seen, on the one hand, the performance of the business interfaces in processing business requests can be monitored in the granularity of the business initiation objects, and on the other hand, the performance data of all business interfaces in a to-be-monitored scene can be automatically and integrally counted, thereby realizing a flexible scene monitoring solution.

[0055] Figure 3 A flowchart of determining a scene performance result value in the performance monitoring method of one embodiment of the present disclosure is shown as follows. Figure 3 As shown in FIG. 5, in some embodiments, step S205 can further include the following steps.

[0056] In step S301, all business interfaces in the to-be-monitored scene are determined.

[0057] In some actual applications, the scene annotations can indicate a scene identifier field value of the scene to which the business interfaces belong, and then the interfaces with the scene identifier field value in the scene annotations being the scene identifier of the to-be-monitored scene can be determined as all business interfaces in the to-be-monitored scene.

[0058] In step S303, the object granularity performance data of all business interfaces is processed based on the scene annotations, and interface performance result values of each business interface for each business initiation object are obtained.

[0059] In some embodiments, the business interfaces can include a first interface, the business initiation objects can include a first object, and the scene annotations added to the first interface can indicate an interface threshold value and a performance quantification strategy of the first interface. Based on this, step S303 can further include: determining an input parameter performance indicator according to the performance quantification strategy of the first interface; determining to-be-quantified performance data from the object granularity performance data of the first interface for the first object according to the input parameter performance indicator; and taking the to-be-quantified performance data and the interface threshold value of the first interface as input data of the performance quantification strategy, and outputting to obtain an interface performance result value of the first interface for the first object.

[0060] In some embodiments, the interface threshold values corresponding to the business interfaces in the same to-be-monitored scene can be set as the same value, or can be set based on the importance or frequency of use of the business interfaces; and the performance quantification strategies used by the business interfaces in the same to-be-monitored scene can be set as a common strategy, or can be set based on the calling conditions of the interfaces.

[0061] For example, for the order placement flow scenario, the same performance quantification strategy can be set for each business interface in the scenario as follows:

[0062] The interface performance result value = interface threshold * success rate * success rate weight + interface threshold * time consumption rate * time consumption rate weight. The success rate and time consumption rate can be regarded as the input performance indicators described above; the success rate can be (number of successful requests / total number of requests), and the time consumption rate can be (number of requests less than the time consumption threshold / total number of requests); the sum of the success rate weight and the time consumption rate weight can be 1, for example, the success rate weight is 0.5 and the time consumption rate weight is 0.5, or the success rate weight is 0.8 and the time consumption rate weight is 0.2.

[0063] Similarly, other performance indicators in the performance data can be defined as input performance indicators to participate in the quantification calculation, and the performance quantification strategy can be flexibly set. In some actual applications, the scoring rules of the metricIndexService interface in the Metrics tool can be inherited to realize the output of the interface performance result value.

[0064] Step S305, determining the scenario performance result value for each business initiation object under the to-be-monitored scenario according to the interface performance result value.

[0065] The sum of the interface performance result values of all business interfaces under the to-be-monitored scenario can be used as the scenario performance result value for each business initiation object under the to-be-monitored scenario. If a business interface is not called, the interface threshold of the business interface can be used as the interface performance result value to directly participate in the calculation of the scenario performance result value.

[0066] Table 1 shows a display table of the scenario performance result value distinguished by business initiation objects. The business initiation object is a tenant object, and the object identifier is tenant ID.

[0067] Table 1

[0068]

[0069]

[0070] Table 2 shows a schematic table of the performance quantification strategy applicable to Table 1.

[0071] Table 2

[0072] metricS1Service interfaceThreshold * successRate * successRateWeight (0.5) + interfaceThreshold * timeConsumptionRate * timeConsumptionRateWeight (0.5) metricS2Service interfaceThreshold * successRate * successRateWeight (0.8) + interfaceThreshold * timeConsumptionRateWeight * weight (0.2) metricS3Service interfaceThreshold * successRate * successRateWeight (0.2) + interfaceThreshold * timeConsumptionRate * timeConsumptionRateWeight (0.8)

[0073] Figure 4 The flowchart shows the process of determining the object granularity performance data in the performance monitoring method of one embodiment of the present disclosure, as shown in Figure 4As shown, in some embodiments, the "obtaining object granularity performance data of the service interface for each service initiation object based on the performance monitoring annotation" in step S203 can further include the following steps.

[0074] Step S401, determining the object identifier of the service initiation object of the service request based on the performance monitoring annotation, and the performance monitoring data of the service interface when processing the service request.

[0075] In some embodiments, the performance monitoring annotation includes an object identifier field and a value assignment mode of the object identifier field; based on this, the "determining the object identifier of the service initiation object of the service request based on the performance monitoring annotation" in step S401 can further include: intercepting the service request using an annotation interceptor corresponding to the performance monitoring annotation; determining target information from the service request based on the value assignment mode, and assigning a value to the object identifier field according to the target information; and taking the value of the object identifier field as the object identifier of the service initiation object of the service request.

[0076] In some actual applications, the performance monitoring annotation can be obtained by modifying the native performance monitoring annotation in the Metrics tool, and the object identifier field and the business type field can be added to the native performance monitoring annotation in the Metrics, and the annotation interceptor can be modified to specify which field in the service request the object identifier field and the business type field are mapped from through the interface parameter specification, so as to assign values to the object identifier field and the business type field in the performance monitoring annotation after analyzing the service request.

[0077] In some embodiments, the performance indicators and the monitoring modes of the performance indicators are indicated in the monitoring annotation, and the performance indicators include at least one of the following: event response rate, processing time, method call times, request success times, and method exception times; based on this, the "determining the performance monitoring data of the service interface when processing the service request based on the performance monitoring annotation" in step S401 can further include: monitoring the service interface using the monitoring mode of the performance indicators to obtain the performance monitoring data of the service interface when processing the service request under each performance indicator.

[0078] Step S403, storing the object identifier and the performance monitoring data related to the same service request in association to obtain the object granularity performance data of the service interface for each service initiation object.

[0079] The following describes a performance monitoring method in an actual application.

[0080] Figure 5 The schematic diagram of the performance monitoring method of one embodiment of the present disclosure is shown as Figure 5 As shown, the performance monitoring method can include the following steps.

[0081] Firstly, all native performance monitoring annotation tags of Metric can be annotated and modified, and two parameters can be added: platformId represents tenant ID (i.e., object identification field), and type represents business type (i.e., business type field). Meanwhile, the annotation interceptor can be modified accordingly. Through the interface parameter specified manner, it is clear that platformId and type are mapped from which field in the business request, so as to parse and assign values. Then, based on the assignment result, the method name in the metric monitoring index is rewritten, and the tenant ID and type name are added, which are used for subsequent differentiated statistics.

[0082] The following single interface is used as an example. Assuming that the method name of the single interface is orderBuy(OrderParam orderParam), the following performance monitoring annotation for statistical interface processing time can be added to the method: @Timed(type="#orderParam.orderType", platformId="#orderParam.platformId"), which can specify the mapping relationship of the parameters in the parameters, such as orderParam.orderType=2, which can represent the payment method of the payment interface for the public transfer, and orderParam.platformId=1, which can represent tenant 1.

[0083] Then, when the single interface receives business requests from different customers (i.e., business initiation objects, such as customer 1 to customer 4 in Figure 5 Based on the modified annotation, the business requests can be collected, and the modified interceptor can append two parameters to the method name of the single interface, so that the method name of the single interface is updated to orderBuy_1_2, thereby realizing the tenant-level fission of the method (i.e., generating object granularity performance data). In addition, the type field in the embodiment can better distinguish business logic, such as being used to indicate the payment method of the single order, thereby realizing further fission granularity of the method.

[0084] Next, a new scene annotation can be developed, and a flexible index calculation strategy (i.e., performance quantification strategy) can be configured to realize scene monitoring.

[0085] Specifically, the design of the Metric native performance monitoring annotation tag modified in the foregoing steps can be reused, and a new annotation @MetricScene is added. The annotation can add the following three fields: scene represents a scene identifier, score represents an interface score (i.e., an interface threshold), and metricIndex represents an index calculation scheme (i.e., a performance quantification strategy). The metricScene annotation can inherit the platformId and type in the native performance monitoring annotation tag modified in the foregoing steps, and thus the identification and recognition of tenants and business types can still be implemented.

[0086] For example, still taking the order interface as an example, assuming that the interface name is public OrderInfo orderBuy(OrderParam orderParam), the annotation @MetricScene(type="#orderParam.orderType", platformId="#orderParam.platformId", scene="order", score="20", metricIndex="metricS1Service") can be added. The scene=order represents the order scene, the score=20 represents that the highest score of the interface in the order scene is 20 (i.e., the interface threshold), and the metricIndex represents the index calculation rule implementation (i.e., the performance quantification strategy). Similarly, a scene annotation interceptor can be added, the method name is modified according to the platformId and type, and the monitoring effect of the tenant granularity is implemented; at the same time, an asynchronous thread can be started to collect scene monitoring index data, all interfaces (such as interfaces 1-4 shown in the table) in the scene are counted according to a time period (1 min by default), the interface performance result values of the interfaces are obtained according to the index calculation scheme (i.e., the performance quantification strategy), and the scene score (i.e., the scene performance result value) is calculated according to the interface performance result values of all interfaces. Figure 5

[0087] If the interface method is not called in the time period, the interface threshold of the interface is used as the interface performance result value by default, if the method is called, the interface score (i.e., the interface performance result value) needs to be calculated according to the index calculation scheme, and finally the scene score is obtained by accumulation. The monitoring score containing the scene score can also be output on the cloud or collected and displayed by a self-built monitoring system.

[0088] ​It should be noted that the above-described diagrams are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended for limiting purposes. It is easy to understand that the processes shown in the above-described diagrams do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be executed synchronously or asynchronously, for example, in multiple modules.

[0089] Figure 6 A block diagram of a performance monitoring apparatus 600 according to one embodiment of the present disclosure is shown; as shown, it includes: an adding-annotation module 601 configured to add performance monitoring annotations and scenario annotations to a business interface in a to-be-monitored scenario; a monitoring module 602 configured to obtain object-granularity performance data of the business interface for each business initiation object in a process in which the business interface processes a business request based on the performance monitoring annotations; and a statistical module 603 configured to statistically process the object-granularity performance data of the business interface based on the scenario annotations to obtain a scenario performance result value for each business initiation object in the to-be-monitored scenario. Figure 6

[0090] The performance monitoring apparatus provided by the present disclosure can first add performance monitoring annotations and scenario annotations to a business interface in a to-be-monitored scenario, then obtain object-granularity performance data of the business interface for each business initiation object based on the performance monitoring annotations, and finally obtain a scenario performance result value for each business initiation object in the to-be-monitored scenario based on the scenario annotations. As can be seen, on the one hand, the performance of the business interface in processing a business request can be monitored in the granularity of a business initiation object, and on the other hand, the performance data of all business interfaces in a to-be-monitored scenario can be automatically statistically processed as a whole, thereby realizing a flexible scenario monitoring scheme.

[0091] In some embodiments, the statistical module 603 statistically processes the object-granularity performance data of the business interface based on the scenario annotations to obtain a scenario performance result value for each business initiation object in the to-be-monitored scenario, including: determining all business interfaces in the to-be-monitored scenario; processing the object-granularity performance data of all business interfaces based on the scenario annotations to obtain an interface performance result value for each business initiation object for each business interface; and determining a scenario performance result value for each business initiation object in the to-be-monitored scenario according to the interface performance result value.

[0092] ​In some embodiments, the first interface is included in the business interface, the first object is included in the business initiation object, and the interface threshold and the performance quantification strategy of the first interface are indicated in the scenario annotation added for the first interface; wherein the statistical module 603 processes the object granularity performance data of all business interfaces based on the scenario annotation, and obtains the interface performance result value of each business interface for each business initiation object, including: determining the input performance indicator according to the performance quantification strategy of the first interface; determining the performance data to be quantified from the object granularity performance data of the first interface for the first object according to the input performance indicator; taking the performance data to be quantified and the interface threshold of the first interface as the input data of the performance quantification strategy, and outputting the interface performance result value of the first interface for the first object.

[0093] In some embodiments, the monitoring module 602 obtains the object granularity performance data of the business interface for each business initiation object based on the performance monitoring annotation, including: determining the object identifier of the business initiation object of the business request and the performance monitoring data when the business interface processes the business request based on the performance monitoring annotation; and storing the object identifier and the performance monitoring data related to the same business request in association, to obtain the object granularity performance data of the business interface for each business initiation object.

[0094] In some embodiments, the performance monitoring annotation includes an object identifier field and an assignment mode of the object identifier field; wherein the monitoring module 602 determines the object identifier of the business initiation object of the business request based on the performance monitoring annotation, including: intercepting the business request using an annotation interceptor corresponding to the performance monitoring annotation; determining target information from the business request based on the assignment mode, and assigning a value to the object identifier field according to the target information; and taking the value of the object identifier field as the object identifier of the business initiation object of the business request.

[0095] In some embodiments, the performance indicator and the monitoring mode of the performance indicator are indicated in the monitoring annotation, and the performance indicator includes at least one of the following: event response rate, processing time, method call times, request success times, and method exception times; wherein the monitoring module 602 determines the performance monitoring data when the business interface processes the business request based on the performance monitoring annotation, including: monitoring the business interface using the monitoring mode of the performance indicator, to obtain the performance monitoring data of the business interface under each performance indicator when processing the business request.

[0096] In some embodiments, the adding annotation module 601 adds the performance monitoring annotation and the scenario annotation to the business interface in the to-be-monitored scenario, including: obtaining the scenario identifier and the monitoring requirement of the to-be-monitored scenario, and determining the to-be-monitored performance indicator, the performance quantification strategy, and the interface threshold of the business interface in the to-be-monitored scenario according to the monitoring requirement; adding the performance monitoring annotation to the business interface according to the to-be-monitored performance indicator; and adding the scenario annotation to the business interface according to the scenario identifier, the performance quantification strategy, and the interface threshold.

[0097] Figure 6 Other aspects of the embodiments can be appreciated from the above other embodiments.

[0098] Those skilled in the art can understand that various aspects of the present application can be implemented as a system, a method or a program product. Therefore, various aspects of the present application can be embodied in a form of entirely hardware, entirely software (including firmware, microcode, etc.), or a combination of hardware and software, which can be generically referred to as "circuitry", "module" or "system".

[0099] Figure 7 A structure block diagram of a performance monitoring computer device in the embodiments of the present disclosure is shown. It is to be noted that the electronic device shown is merely an example and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0100] The electronic device 700 according to this embodiment of the present application will be described below with reference to Figure 7 Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0101] As shown in Figure 7 , the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 can include, but are not limited to, the above-mentioned at least one processing unit 710, the above-mentioned at least one storage unit 720, and a bus 730 connecting different system components, including the storage unit 720 and the processing unit 710.

[0102] The storage unit stores program codes which can be executed by the processing unit 710, so that the processing unit 710 performs the steps described in the above "Exemplary Method" section according to various exemplary embodiments of the present application. For example, the processing unit 710 can perform the method as shown in Figure 2

[0103] The storage unit 720 can include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 7201 and / or a cache memory 7202, and can further include a read-only memory (ROM) 7203.

[0104] The storage unit 720 can further include a program / utility 7204 having a set of program modules 7205, including but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which can include implementation of a network environment, or some combination thereof.​​

[0105] Bus 730 can be one of several types of bus structures including a memory bus or memory controller, a peripheral bus or external bus, a graphics bus, a processor or local bus using any of a variety of bus structures, and the like.

[0106] Electronic device 700 can also communicate with one or more external devices 800 such as a keyboard or pointing device, a Bluetooth device, etc.; and one or more devices that enable a user to interact with electronic device 700 and / or one or more devices (e.g. routers, modems, etc.) that enable electronic device 700 to communicate with one or more other computing devices. Such communication can occur via Input / Output (I / O) interface 750. Still yet, electronic device 700 can communicate with one or more networks such as a local area network (LAN), a general wide area network (WAN), and / or a public network (e.g. the Internet) via network adapter 760. As depicted, network adapter 760 communicates with the other components of electronic device 700 via bus 730. It should be appreciated that although not shown, other hardware and / or software modules could be used in conjunction with electronic device 700. Examples, include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.

[0107] In the example embodiments of the present disclosure, a computer readable storage medium having stored thereon a program product capable of implementing the above-described methods of the present specification is also provided. In some possible implementations, various aspects of the present application can also be implemented as a program product in the form of a computer readable storage medium having program code portions stored thereon, the program code portions being capable of implementing the steps described in the above-mentioned “Exemplary Method” section of the present specification when the program product is run on a terminal device.

[0108] The program product for implementing the above-described methods according to the embodiments of the present application can take the form of a portable compact disc read-only memory (CD-ROM) and include program code portions, and can be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited to this, and in the present document, the readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0109] The program product can take any combination of one or more computer-readable media. The computer-readable media can be a computer-readable storage medium or a computer-readable signal medium. The computer-readable storage medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0110] The computer-readable signal medium can include a computer-readable storage medium that is configured to store and deliver a computer-readable program code. The computer-readable program code can be propagated as a computer-readable signal medium.

[0111] The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination of the foregoing.

[0112] The program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, C++, etc., or conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider.

[0113] It should be noted that, although several modules or units of the device for action execution are mentioned in the foregoing detailed description, such a division is not mandatory. Indeed, according to an embodiment of the present disclosure, features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, features and functions of one module or unit described above can be further divided into a plurality of modules or units.

[0114] Furthermore, although individual steps of the methods in the present disclosure are described in a particular order in the drawings, this is not required or implied as to the order of execution of the steps, nor is it required that all of the steps be executed to achieve the desired result. Additionally or alternatively, certain steps can be omitted, multiple steps can be combined into one step, one step can be broken into multiple steps, etc.

[0115] From the above description of the embodiments, those skilled in the art will readily appreciate that the example embodiments described herein can be implemented by software and / or by hardware coupled with software. Accordingly, the technical solutions of the embodiments of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or network, and includes a number of instructions to enable a computing device (which can be a personal computer, server, mobile terminal, or network device, etc.) to perform the methods according to the embodiments of the present disclosure.

[0116] According to an aspect of the present disclosure, a computer program product or computer program is provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the methods provided in the various optional implementations of the above-described embodiments.

[0117] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure following the general principles thereof and including such departures from the present disclosure that come within known use or custom in the art. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A performance monitoring method, characterized by, The method comprises the following steps: adding performance monitoring annotations and scene annotations to business interfaces in a to-be-monitored scene; obtaining object granularity performance data of the business interfaces for each business initiator based on the performance monitoring annotations during processing of a business request by the business interfaces; statistically processing the object granularity performance data of the business interfaces based on the scene annotations to obtain scene performance result values for each business initiator in the to-be-monitored scene; wherein the statistical processing of the object granularity performance data of the business interfaces based on the scene annotations to obtain the scene performance result values for each business initiator in the to-be-monitored scene comprises: determining all business interfaces in the to-be-monitored scene; processing the object granularity performance data of the all business interfaces based on the scene annotations to obtain interface performance result values of each business interface for each business initiator; determining the scene performance result values for each business initiator in the to-be-monitored scene according to the interface performance result values; wherein the scene annotations indicate interface threshold values, input parameter performance indicators, and indicator weights of the input parameter performance indicators of each business interface in the to-be-monitored scene; the interface threshold values are set based on the importance or frequency of use of the corresponding business interfaces; and the input parameter performance indicators are used to determine to-be-quantized performance data from the object granularity performance data; wherein the interface performance result values are determined according to the interface threshold values, the to-be-quantized performance data, and the indicator weights.

2. The method of claim 1, wherein, The business interfaces include a first interface, and the business initiators include a first object; the scene annotations added to the first interface indicate the interface threshold value and a performance quantization strategy of the first interface; wherein the processing of the object granularity performance data of the all business interfaces based on the scene annotations to obtain the interface performance result values of each business interface for each business initiator comprises: determining input parameter performance indicators according to the performance quantization strategy of the first interface; determining to-be-quantized performance data from the object granularity performance data of the first interface for the first object according to the input parameter performance indicators; using the to-be-quantized performance data and the interface threshold value of the first interface as input data of the performance quantization strategy to output the interface performance result value of the first interface for the first object.

3. The method of claim 1, wherein, The obtaining of the object granularity performance data of the business interfaces for each business initiator based on the performance monitoring annotations comprises: determining object identifiers of the business initiators of the business request and performance monitoring data when the business interfaces process the business request based on the performance monitoring annotations; storing the object identifiers and the performance monitoring data related to the same business request in association to obtain the object granularity performance data of the business interfaces for each business initiator.

4. The method of claim 3, wherein, The performance monitoring annotations comprise an object identifier field and an assignment mode of the object identifier field; wherein the determination of the object identifiers of the business initiators of the business request based on the performance monitoring annotations comprises: intercepting the business request by using an annotation interceptor corresponding to the performance monitoring annotations; and determining the object identifiers of the business initiators of the business request according to the assignment mode of the object identifier field in the performance monitoring annotations. determine target information from the service request based on the assignment mode, and assign a value to the object identification field according to the target information; use the value of the object identification field as an object identification of a service initiation object of the service request.

5. The method of claim 3, wherein, The monitoring annotation indicates a performance indicator and a monitoring mode of the performance indicator, and the performance indicator includes at least one of the following: event response rate, processing time length, method call times, request success times, and method exception times; The performance monitoring data of the service interface when processing the service request is determined based on the performance monitoring annotation, including: The service interface is monitored using the monitoring mode of the performance indicator to obtain performance monitoring data of the service interface under each performance indicator when processing the service request.

6. The method of claim 1, wherein, The performance monitoring annotation and the scene annotation are added to the service interface in the to-be-monitored scene, including: obtaining a scene identification and a monitoring requirement of the to-be-monitored scene, and determining to-be-monitored performance indicators, performance quantification strategies, and interface thresholds of the service interface in the to-be-monitored scene according to the monitoring requirement; adding the performance monitoring annotation to the service interface according to the to-be-monitored performance indicators; adding the scene annotation to the service interface according to the scene identification, the performance quantification strategies, and the interface thresholds.

7. A performance monitoring device, characterized by including: The adding annotation module is configured to add the performance monitoring annotation and the scene annotation to the service interface in the to-be-monitored scene. The monitoring module is configured to obtain object granularity performance data of the service interface for each service initiation object based on the performance monitoring annotation in a process in which the service interface processes a service request. The statistical module is configured to statistically process the object granularity performance data of the service interface based on the scene annotation to obtain a scene performance result value for each service initiation object in the to-be-monitored scene. The monitoring module statistically processes the object granularity performance data of the service interface based on the scene annotation to obtain the scene performance result value for each service initiation object in the to-be-monitored scene, including: determining all service interfaces in the to-be-monitored scene; processing the object granularity performance data of the all service interfaces based on the scene annotation to obtain an interface performance result value of each service interface for each service initiation object; determining the scene performance result value for each service initiation object in the to-be-monitored scene according to the interface performance result value; The scene annotation indicates an interface threshold, an input parameter performance indicator, and an indicator weight of the input parameter performance indicator of each service interface in the to-be-monitored scene; the interface threshold is set based on importance or frequency of use of a corresponding service interface; and the input parameter performance indicator is used to determine to-be-quantified performance data from the object granularity performance data. The interface performance result value is determined based on the interface threshold, the to-be-quantified performance data, and the indicator weight of a corresponding service interface.

8. A computer readable storage medium having stored thereon a computer program, the program being executed by a processor to implement the performance monitoring method according to any one of claims 1 to 6.

9. An electronic device, comprising: including: one or more processors; a storage device for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the performance monitoring method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Interfaces for data monitoring and event response

    US11579764B1