Monitoring and service degradation method, device, equipment and medium based on asynchronous architecture

By configuring third-party asynchronous call interfaces and proxy objects, the problem of inaccurate monitoring in asynchronous architecture is solved, enabling accurate monitoring and service degradation of third-party services and ensuring system stability.

CN118820041BActive Publication Date: 2026-03-20QIAN JIN NETWORK INFORMATION TECH SHANGHAI LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In asynchronous architectures, existing monitoring tools such as Prometheus and Skywalking cannot fully capture request and response information, resulting in inaccurate or incomplete monitoring and failing to maximize the stability of the system platform.

Method used

By configuring third-party asynchronous call interfaces, the proxy object intercepts call data and collects performance metrics, monitors target fields in the configuration file, and judges the performance degradation of third-party services based on performance data and performs service degradation processing.

Benefits of technology

It enables accurate monitoring and performance data collection of third-party services in gRPC+asynchronous scenarios, ensuring system platform stability and preventing system crashes caused by individual service anomalies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118820041B_ABST
    Figure CN118820041B_ABST
Patent Text Reader

Abstract

The application discloses a monitoring and service degradation method and device based on an asynchronous architecture, electronic equipment and a medium. The monitoring and service degradation method based on the asynchronous architecture is applied to a local device and comprises the following steps: configuring a third-party asynchronous calling interface according to a third-party asynchronous calling program of a local service, so that the local service can asynchronously call a third-party service through the third-party asynchronous calling interface; intercepting calling data of the local device to the third-party service by using a proxy object of the third-party asynchronous calling interface, collecting performance data of at least one performance index in the calling data by means of monitoring logic arranged in the proxy object, and listening to a target field in a configuration file of the proxy object through the third-party asynchronous calling interface during the collection of the performance data. According to the embodiment of the application, the accuracy of performance data collection in the asynchronous calling monitoring process can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of Internet of Things, in particular to platform security and industrial Internet stability, and especially to a monitoring and service degradation method and device based on an asynchronous architecture, an apparatus, and a computer readable storage medium. BACKGROUND

[0002] In order to monitor the working process of a computer system, two monitoring tools, prometheus and skywalking, are often used. However, the two monitoring tools often perform well only in the synchronous framework of the computer system. In a scenario where grpc (a cross-language RPC framework based on HTTP / 2 protocol, which supports asynchronous communication) is used in addition to asynchronization, the communication between services becomes more complex, and the processing of requests and responses occurs in different threads or at different time points, which causes the two monitoring tools to be unable to completely capture all the information of requests and responses, so that the monitored information is not accurate or complete. In this way, in the case where a third-party service called asynchronously has a problem, the system platform cannot be maximally stabilized according to the monitored information. SUMMARY

[0003] In view of this, the embodiments of the present application provide a monitoring and service degradation method and device based on an asynchronous architecture, an electronic device, a computer readable storage medium, and a computer program product, for solving at least one technical problem.

[0004] The embodiments of the present application provide a monitoring and service degradation method based on an asynchronous architecture, which comprises: configuring a third-party asynchronous calling interface according to a third-party asynchronous calling program of a local service, so that the local service can asynchronously call a third-party service through the third-party asynchronous calling interface; intercepting calling data of a third-party service of a local device by using a proxy object of the third-party asynchronous calling interface, and collecting performance data of at least one performance indicator in the calling data through monitoring logic set in the proxy object, and listening to a target field in a configuration file of the proxy object through the third-party asynchronous calling interface in the process of collecting the performance data; judging whether the performance of the third-party service is degraded according to the performance data, updating the configuration file of the proxy object if the performance is degraded, and updating the configuration file of the proxy object if the target field in the configuration file of the proxy object is changed, so as to degrade the level of the third-party service.

[0005] Optionally, according to the method of the embodiment of the application, if the target field in the configuration file of the proxy object is changed, the configuration file of the proxy object is updated, including: if the field in the configuration file for controlling the third-party service degradation processing is modified, the callback logic of the configuration file is automatically triggered, and the configuration file is reloaded so that the third-party service is processed by degradation.

[0006] Optionally, according to the method of the embodiment of the application, if the target field in the configuration file of the proxy object is changed, the configuration file of the proxy object is updated, including: if the field in the configuration file for controlling the third-party service degradation processing is modified, the callback logic of the configuration file is automatically triggered, and the configuration file is reloaded so that the third-party service is processed by degradation.

[0007] Optionally, according to the method of the embodiment of the application, the configuration file of the proxy object is used to control the proxy object to enable or disable the call to the preset third-party service.

[0008] Optionally, according to the method of the embodiment of the application, the performance data collected by the proxy object is collected according to a preset frequency, and the performance data is processed and calculated so that the performance data is pushed to the front end in a preset form for display.

[0009] Optionally, according to the method of the embodiment of the application, the at least one performance indicator includes at least one of the following: call duration, call success rate, call exception number, call chain data, CPU occupancy rate at the time of call, and memory usage rate at the time of call.

[0010] The embodiment of the application also provides a monitoring and service degradation device based on an asynchronous architecture, including: a configuration module configured to configure a third-party asynchronous calling interface according to a third-party asynchronous calling program of a local service, so that the local service can asynchronously call a third-party service through the third-party asynchronous calling interface; an interception module configured to intercept calling data of a local device to a third-party service by using a proxy object of the third-party asynchronous calling interface, and collect performance data of at least one performance indicator in the calling data through monitoring logic set in the proxy object, and listen to a target field in a configuration file of the proxy object through the third-party asynchronous calling interface in the process of collecting the performance data; a judgment module configured to judge whether the performance of the third-party service is degraded according to the performance data, update the configuration file of the proxy object if the performance is degraded, and update the configuration file of the proxy object if the target field in the configuration file of the proxy object is changed, so as to degrade the level of the third-party service.

[0011] The embodiment of the present application provides an electronic device, which comprises a processor and a memory storing computer program instructions; the processor implements the steps of the method as described above when executing the computer program instructions.

[0012] The embodiment of the present application provides a computer readable storage medium, which stores computer program instructions; the computer program instructions are executed by a processor to implement the steps of the method as described above.

[0013] The embodiment of the present application provides a computer program product, which comprises computer program instructions; the computer program instructions are executed by a processor to implement the steps of the method as described above.

[0014] By adopting the embodiment of the present application, the third-party asynchronous call of the interface is implemented through the proxy mode, the performance data is collected, and the configuration file is monitored, so that the system platform can be accurately and stably monitored in the scene of the grpc plus the asynchronous, the call of the third-party service is monitored, the performance data is collected, and then the system platform can be effectively monitored and optimized, when the third-party service has a problem, the configuration file of the proxy object is updated, the third-party service is degraded, the system platform can avoid the entire system from collapsing due to the individual third-party service exception when the system platform has a problem and faces a processing pressure, and the system platform can be maximally kept stable. BRIEF DESCRIPTION OF DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings in the embodiments of the present application.

[0016] Figure 1 is a schematic diagram of a system architecture of the embodiment of the present application.

[0017] Figure 2 is a flowchart of a monitoring and service degradation method based on an asynchronous architecture of the embodiment of the present application.

[0018] Figure 3 is a structural block diagram of a monitoring and service degradation device based on an asynchronous architecture of the embodiment of the present application.

[0019] Figure 4 The hardware structure of the electronic device of the embodiment of the present application is shown. DETAILED DESCRIPTION

[0020] The principles and spirits of the present application will be described below with reference to a number of exemplary embodiments. It should be understood that the purpose of providing these embodiments is to make the principles and spirits of the present application clearer and more thorough, and to enable those skilled in the art to better understand and implement the principles and spirits of the present application. The exemplary embodiments provided herein are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments herein, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application.

[0021] Embodiments of the present application relate to terminal devices and / or servers. Those skilled in the art know that embodiments of the present application can be implemented as a system, apparatus, device, method, computer readable storage medium or computer program product. Therefore, the present disclosure can be embodied as at least one of the following: complete hardware, complete software, or hardware and software in combination. According to embodiments of the present application, a monitoring and service degradation method, apparatus, electronic device, computer readable storage medium and computer program product based on an asynchronous architecture are claimed. Figure 1 is a schematic diagram of a system architecture of an embodiment of the present application. As shown in Figure 1 The system includes a terminal device 102 and a server 104. The terminal device 102 can include at least one of a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart television, various wearable devices, an augmented reality (AR) device, a virtual reality (VR) device, and the like. A client can be installed on the terminal device 102. For example, the client can be a client (such as an application (app)) that is specifically used to perform a specific function, or a client that has multiple application programs (different functions) embedded therein, or a client that is logged in through a browser. A user can operate the terminal device 102, for example, the user can open the client installed on the terminal device 102 and input an instruction through the client, or the user can open the browser installed on the terminal device 102 and input an instruction through the browser. After the terminal device 102 receives the instruction input by the user, the terminal device 102 sends request information containing the instruction to the server 104. After the server 104 receives the request information, the server 104 performs corresponding processing, and then returns processing result information to the terminal device 102. Through a series of data processing and information interaction, the user instruction is completed.

[0022] In this document, terms such as first, second, third, etc. are used to distinguish one entity (or operation) from another entity (or operation), and do not imply or suggest any order or association between the entities (or operations).

[0023] The following briefly describes concepts and technical terms that can be involved in embodiments of the present application.

[0024] Figure 2 is a flowchart of a monitoring and service degradation method based on an asynchronous architecture according to an embodiment of the present application, which comprises the following steps:

[0025] S101: configuring a third-party asynchronous calling interface according to a third-party asynchronous calling program of a local service, so that the local service can asynchronously call a third-party service through the third-party asynchronous calling interface;

[0026] S102: intercepting calling data of a local device to a third-party service by using a proxy object of the third-party asynchronous calling interface, collecting performance data of at least one performance indicator in the calling data through monitoring logic set in the proxy object, and listening to a target field in a configuration file of the proxy object through the third-party asynchronous calling interface during the collection of the performance data;

[0027] S103: judging whether the performance of the third-party service is degraded according to the performance data, updating the configuration file of the proxy object if performance degradation occurs, and updating the configuration file of the proxy object if the target field in the configuration file of the proxy object changes, so as to degrade the level of the third-party service.

[0028] In a computer system, interfacing means defining a clear contract (or API) to interact with a part of the system (such as a service, component or third-party application) through the contract. In the embodiment of the present application, configuring a third-party asynchronous calling interface needs to abstract and encapsulate the third-party asynchronous calling program of a local service, define a unified interface specification, and include necessary calling parameters and return values, and possible exception handling mechanisms in the asynchronous calling interface.

[0029] In the present application, in order to reduce the impact of monitoring on the third-party asynchronous calling interface, the present application uses a set proxy object to proxy the third-party asynchronous calling interface, intercepts calling data of the third-party asynchronous calling interface through the proxy object, and executes performance indicator collection logic before or after calling the third-party asynchronous calling interface, to collect performance data of at least one performance indicator in the calling data through the collection logic. The collection logic is the monitoring logic. For example, in the monitoring process of the third-party asynchronous calling interface, the interfaces, parameters, return values, calling duration, success rate, number of exceptions, etc. that need to be monitored are determined. Then the monitoring logic can be determined according to these needs, and the monitoring logic is a program written according to these needs. Setting these programs before or after the calling program can realize the collection of performance data of the third-party service calling process, and then the target performance indicator value can be calculated according to the performance data, such as the performance indicator value that has the greatest impact on the stability of the local system.

[0030] Some monitoring logic is added in the proxy object, which can monitor the calling process and collect performance data by using the monitoring logic in the process of calling the third-party service by the third-party asynchronous calling interface, and then the performance of the local service, the third-party service and the third-party asynchronous calling interface can be determined. The performance index data is collected by the proxy mode, which ensures the accuracy and real-time performance of the data. The proxy object can directly collect data when calling the third-party asynchronous interface, which avoids the problem of data loss or delay and provides a reliable data basis for performance analysis.

[0031] Further, in the embodiment of the present application, in the process of collecting performance data, the target field in the configuration file of the proxy object is monitored by the third-party asynchronous calling interface. Optionally, some monitoring mechanisms or listeners can be added when the third-party asynchronous calling interface is encapsulated, so that the target field in the configuration file of the proxy object can be monitored by the third-party asynchronous calling interface.

[0032] In the present application, the service degradation of the third party can be realized by hot updating of the configuration file, for example, by comparing the preset performance index value and the monitoring threshold value to determine that the third-party service has a problem, the performance of the third-party service is degraded, the configuration file is modified and updated, and then the listener listens to the change, which triggers the callback logic, so that the proxy object processing the third-party calling calls the configuration file, and the configuration file of the current proxy object is updated to the modified configuration file. Since the proxy object is controlled by the configuration file, when the configuration file is updated, the proxy object can perform service degradation processing on the calling of the third-party service, so that the service of the third party is degraded.

[0033] The hot updating of the configuration file can realize the rapid degradation of the third-party service, and timely degrade the third-party service to avoid affecting the entire service. Through the hot updating mechanism of the configuration file, the user can dynamically adjust the monitoring and hot plug configuration without interrupting the service. This greatly reduces the maintenance cost and improves the availability and flexibility of the system.

[0034] In addition, in the embodiment of the present application, the degradation of the third-party service can also be realized by modifying the target field in the configuration file, for example, in the process of collecting performance data, the target field in the configuration file of the proxy object is monitored by the third-party asynchronous calling interface, if the target field in the configuration file of the proxy object changes, the configuration file of the proxy object is updated, so that the level of the third-party service can be degraded.

[0035] By using the embodiments of the present application, the system can be accurately and stably monitored and performance data can be collected even in the scenario of grpc+asynchronization, ensuring that the system can be effectively monitored and optimized. When problems occur in the third-party service, the third-party service can be downgraded by updating the configuration file of the agent object, so that the system can avoid the entire system from collapsing due to individual third-party service exceptions when problems occur and the system is under pressure, and the stability of the system is maximized. These advantages enable the method of the embodiments of the present application to be applied in the field of industrial internet or internet of things, so that the related system platform can effectively monitor the third-party service when the third-party service is called asynchronously, and the safety of the platform can be maximized in the case of problems in the third-party service, so that the platform can run stably.

[0036] In some embodiments of the present application, optionally, if the target field in the configuration file of the agent object changes, updating the configuration file of the agent object comprises: if the field for controlling the third-party service degradation processing in the configuration file is modified, triggering the callback logic of the configuration file automatically, and reloading the configuration file to make the third-party service be degraded.

[0037] In the present application, the third-party service enabling configuration file is set in the sub-file of the configuration file, and the field for controlling the third-party service degradation processing is set in the third-party service enabling configuration file. By modifying the field, for example, by setting the field "status isOn" for controlling the third-party service enabling configuration file in the configuration file, and by changing the field "status isOn" to "status isOff", the switch in the third-party service enabling configuration file can be turned off. After the listener listens to the change of the configuration file, the configuration file is automatically reloaded, and since the third-party service enabling switch in the configuration file is turned off, the system controls the third-party service to be degraded after the configuration file is reloaded.

[0038] In the present application, the operator can modify the configuration file, and the listener updates the configuration file if the listener listens to the modification of the configuration file during the listening process. In this way, the system can degrade the third-party service according to the updated configuration. For example, there is a flow control setting in the configuration file, and the flow control setting sets a flow threshold and a flow switching strategy. When the flow exceeds the set threshold, the third-party service is degraded. The operator modifies the flow control setting to modify the set threshold to a value smaller than the current flow value. In this way, according to the updated configuration file, the system determines that the current flow is greater than the threshold flow, and controls the agent object to degrade the third-party service, so that the third-party service can be quickly degraded.

[0039] In addition, various settings can be added in the configuration file of the application, for example: timeout setting, which sets the timeout time for calling the third-party service, and if the set time is exceeded, the service is considered to be degraded; retry number: set the number of retries when calling the third-party service fails, and if the set number of retries is exceeded, the degradation processing is performed; degradation logic: set the processing logic when the third-party service fails or times out, such as returning a default value, returning error information, calling a backup service, etc.; service state monitoring: set a timing task or monitoring program to detect the health status of the third-party service, and perform degradation processing when the service is abnormal; degradation switch: provide a switch to manually enable or disable the service degradation function, which is convenient for temporarily closing the degradation processing under certain circumstances. When the conditions in the settings are met, the third-party service will be degraded.

[0040] The embodiments of the application can ensure that the system can degrade the third-party service when the configuration file is modified, thereby ensuring the stability and performance of the system.

[0041] In some embodiments of the application, the monitoring and service degradation method based on the asynchronous architecture further includes: if other fields in the configuration file except the target field are modified, triggering the callback logic of the configuration file automatically, and reloading the configuration file to update the related configuration.

[0042] In the configuration file of the embodiments of the application, in addition to the target field, other contents can also be modified. If the modification is made to other contents, the system will automatically trigger the callback logic of the configuration file, reload the configuration file to update the related configuration, and will not cause the third-party service to be degraded. In this way, hot updating of the configuration file can be achieved. In addition, to achieve hot updating of the configuration file, a Java listening mechanism or a third-party library (such as Apache Commons Configuration, alibaba nacos, etc.) can be used to listen to changes in the configuration file in real time. When the configuration file is modified and saved, the listener listens to the change of the configuration file, and then triggers the corresponding callback logic to reload the configuration file and update the related configuration. In this way, dynamic adjustment of the configuration in the configuration file can be achieved without restarting the service.

[0043] In some embodiments of the application, the monitoring and service degradation method based on the asynchronous architecture further includes: using the configuration file of the proxy object to control the proxy object to enable or disable the calling of the preset third-party service. In this way, the proxy object can be used to provide a hot plug function, and through the configuration file hot updating mechanism, the user can dynamically adjust the monitoring and hot plug configuration without interrupting the service. This greatly reduces the maintenance cost and improves the availability and flexibility of the system.

[0044] In some embodiments of the present application, optionally, the monitoring and service degradation method based on the asynchronous architecture further comprises: collecting the performance data collected by the agent object according to a preset frequency, and processing and calculating the performance data, so that the performance data is pushed to the front end in a preset form for display

[0045] In the present application, after processing and calculating the performance data (for example, calculating the number of call exceptions after aggregation processing), the performance data can be displayed in the form of a monitoring dashboard. The monitoring dashboard can be displayed through a Web interface, and the monitoring dashboard can include charts, dashboards and other display forms to display various performance indicators in real time. For example, the CPU usage when calling a third-party service can be represented by a sector in a disc, so that the working condition of the system can be judged intuitively.

[0046] The monitoring dashboard displays performance indicator data through a graphical interface, making the data more intuitive and easy to understand. At the same time, the dashboard can also support interactive operations such as zooming, filtering, exporting and other functions, making it easy for users to analyze and process data in depth. In addition, the interface and display form of the monitoring dashboard can also be customized according to user needs. For example, different theme styles, custom chart types, and adding custom indicators can be provided. At the same time, API interfaces can also be provided to allow users to integrate monitoring data into their own systems.

[0047] In some embodiments of the present application, optionally, the processed performance data can be pushed to the front end for display through API or WebSocket after processing and calculating the performance data.

[0048] In embodiments of the present application, the backend service can collect performance data collected by the agent object at regular intervals and perform necessary aggregation and calculation. Then, the data is pushed to the front end for display through API or WebSocket and the like. In addition, an alarm mechanism can also be set up, and when the performance indicator exceeds the preset threshold, an alarm notification is automatically sent

[0049] In some embodiments of the present application, optionally, the target performance indicator can be one or more of the following: call duration, call success rate, call exception number, call chain data, CPU occupancy rate during call, memory usage rate during call.

[0050] In addition to the basic performance indicators, the types of data collected can be expanded according to actual needs. For example, more granular call chain data can be collected to track and locate performance bottlenecks. In addition, data related to resource usage, such as CPU occupancy and memory usage, can also be collected. In addition to performance data for local Java services, data from other sources can also be integrated for comprehensive analysis. For example, performance data from databases and status data from network devices can be integrated to provide a more comprehensive system monitoring view.

[0051] In some embodiments of the present application, the future trend of performance data can also be predicted based on historical performance data and currently collected performance data, and early warning notifications can be issued.

[0052] In embodiments of the present application, machine learning or data mining techniques can be used to intelligently analyze collected performance data to discover potential performance problems or abnormal patterns. At the same time, an intelligent warning mechanism can be set up to predict future performance trends based on historical data and current status, and early warning notifications can be issued. For example, based on historical data, the number of call exceptions each month is within a certain range. If the number of call exceptions in the month exceeds this range, it can be determined that there is a problem with the third-party asynchronous call interface or the third-party service, and early warning can be given before the next month of use, and the event can be investigated to solve the problem as soon as possible.

[0053] In summary, the design of the present application has good scalability and integrability. By adding new performance indicator collection logic or integrating other data sources, the monitoring range and functionality of the system can be easily expanded. At the same time, the monitoring dashboard also provides API interfaces to facilitate integration and data sharing with other systems.

[0054] In addition, the present application not only has overall significant advantages in local service (e.g. Java service) asynchronous performance monitoring and third-party service hot plugging, but also exhibits unique advantages in parts or details. These advantages make the present application have wide application value in improving service performance, enhancing system stability, and improving problem handling efficiency.

[0055] The above describes several embodiments of the present application. The following takes the interface of third-party asynchronous calling as an example to explain the interface process of third-party asynchronous calling in detail, which usually involves the following steps:

[0056] 1. Requirement analysis: analyze the current system's requirements for third-party asynchronous calling.

[0057] a) Determine the functions to be implemented.

[0058] b) Understand the context of the call and the expected call frequency.

[0059] c) Evaluate the limitations and possible Service Level Agreements (SLAs) of the third-party service.

[0060] 2. Interface Design: Design the interface to interact with the third-party system.

[0061] a) Define the input and output parameters of the interface.

[0062] b) Determine the message format (e.g., JSON, XML, etc.) that can be used for asynchronous calls.

[0063] c) Plan error handling and behavior in exceptional scenarios.

[0064] d) Consider interface version management for future compatibility needs in case of upgrades or changes.

[0065] 3. Message Transmission Selection: Choose a suitable message transmission mechanism for asynchronous calls.

[0066] a) Use message queues (e.g., RabbitMQ, Apache Kafka, etc.).

[0067] b) Consider using Webhooks notification mechanisms.

[0068] c) Determine the need for transport layer security (e.g., TLS).

[0069] 4. Authentication and Authorization: Design authentication and authorization strategies to ensure security.

[0070] a) Use API keys, OAuth standards, JWT (JSON Web Tokens), etc., for authentication.

[0071] b) Determine access control for the third-party service.

[0072] 5. Coding and Implementation: Write code that represents the third-party calls based on the designed interface specifications.

[0073] a) Implement the functionality defined by the interface.

[0074] b) Implement message serialization and deserialization.

[0075] c) Implement error handling and retry logic.

[0076] 6. Unit Testing and Integration Testing: Write test cases to ensure the interface works as expected.

[0077] a) Verify that interface requests are correct in terms of format.

[0078] b) Simulate third-party service responses for integration testing.

[0079] c) Test for abnormal situations and error handling.

[0080] 7. Deployment and monitoring: Deploy the interface to production and monitor its performance.

[0081] a) Ensure the process of continuous integration and continuous deployment.

[0082] b) Monitor the usage, latency, error rate of the interface.

[0083] c) Maintain logging for troubleshooting issues.

[0084] 8. Documentation and maintenance: Provide sufficient documentation to explain how to use the interface.

[0085] a) The documentation should describe how to interact with the interface.

[0086] b) Update the documentation to reflect changes in the interface.

[0087] c) Provide developer guides and troubleshooting documentation.

[0088] 9. Feedback and optimization: Collect feedback on using the interface and optimize it based on actual usage.

[0089] a) Monitor performance bottlenecks and architectural issues.

[0090] b) Track interoperability issues with third-party services.

[0091] c) Optimize and fine-tune the interface to improve performance and reliability.

[0092] Corresponding to the method embodiment of the present application, the present application also provides a monitoring and service degradation device based on an asynchronous architecture, as shown in Figure 3 The monitoring and service degradation device 100 based on an asynchronous architecture includes:

[0093] A configuration module 110 is configured to configure a third-party asynchronous calling interface according to a third-party asynchronous calling program of a local service, so that the local service can asynchronously call a third-party service through the third-party asynchronous calling interface.

[0094] An interception module 120 is configured to intercept calling data of a third-party service of a local device by using a proxy object of the third-party asynchronous calling interface, and collect performance data in the calling data according to monitoring logic set in the proxy object and information of a preset performance index, and listen to a target field in a configuration file of the proxy object through the third-party asynchronous calling interface in the process of collecting the performance data.

[0095] A judging module 130 is configured to judge whether the performance of the third-party service is degraded according to the performance data, and if the performance is degraded, update the configuration file of the proxy object, and if a target field in the configuration file of the proxy object is changed, update the configuration file of the proxy object to perform downgrade processing on the level of the third-party service.

[0096] The electronic device in the embodiments of the present application can be a user terminal device, can be a server, can be other computing devices, and can also be a cloud server. Figure 4 A hardware structure schematic diagram of the electronic device of the embodiments of the present application is shown, which can include a processor 601 and a memory 602 storing computer program instructions, and the processor 601 executes the computer program instructions to implement the flow or function of the method of any of the above embodiments.

[0097] Specifically, the processor 601 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured to implement one or more integrated circuits of the embodiments of the present application. The memory 602 can include a mass storage device for data or instructions. For example, the memory 602 can be at least one of a hard disk drive (HDD), a read-only memory (ROM), a random access memory (RAM), a floppy disk drive, a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, a universal serial bus (USB) drive, or other physical / tangible memory storage devices. For another example, the memory 602 can include removable or non-removable (or fixed) media. For another example, the memory 602 can be internal or external to the integrated gateway disaster recovery device. The memory 602 can be a non-volatile solid-state memory. In other words, the memory 602 generally includes a tangible (non-transitory) computer-readable storage medium (such as a memory device) encoded with computer-executable instructions, and when the software is executed (such as by one or more processors), the operations described in the method of the embodiments of the present application can be performed. The processor 601 implements the flow or function of any of the above embodiments by reading and executing the computer program instructions stored in the memory 602.

[0098] In one example, Figure 4The electronic device shown can also include a communication interface 603 and a bus 610. Among them, the processor 601, the memory 602, the communication interface 603 are connected through the bus 610 and complete the communication between each other. The communication interface 603 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiments of the application. The bus 610 includes hardware, software or both, which can couple the components of the online data traffic billing device to each other. For example, the bus can include at least one of the following: an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front side bus (FSB), a hyper transport (HT) interconnect, an industry standard architecture (ISA) bus, an infiniband interconnect, a low pin count (LPC) bus, a memory bus, a micro channel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standards association local (VLB) bus or other suitable bus. The bus 610 can include one or more buses. Although the embodiments of the application describe or show a specific bus, any suitable bus or interconnection method can be considered by the embodiments of the application.

[0099] In combination with the method in the above embodiments, the embodiments of the application further provide a computer readable storage medium, which has stored thereon computer program instructions, and the computer program instructions are executed by a processor to implement the flow or function of any of the methods in the above embodiments.

[0100] In addition, the embodiments of the application also provide a computer program product, which has stored thereon computer program instructions, and the computer program instructions are executed by a processor to implement the flow or function of any of the methods in the above embodiments.

[0101] The flowcharts and / or block diagrams of the methods, devices, systems and computer program products of the embodiments of the application are described above as examples, and the related aspects are described. It should be understood that each block in the flowchart and / or block diagram can be implemented by computer program instructions, or by special hardware that performs specified functions or actions, or by a combination of special hardware and computer instructions. For example, these computer program instructions can be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing apparatus, to form a machine, so that the instructions executed by the processor enable the implementation of the functions / actions specified in each block or combination of blocks in the flowchart and / or block diagram. Such a processor can be a general purpose processor, a special purpose processor, a special application processor, or a field programmable logic circuit.

[0102] The functional blocks shown in the structural block diagram of the embodiments of the present application can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc.; when implemented in software, it is a program or code segment used to perform the required tasks. The program or code segment can be stored in a memory or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0103] It should be noted that the present application is not limited to the specific configurations and processes described above or shown in the drawings. The above description is merely a specific implementation of the present application, and those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the described systems, devices, modules or units can refer to the corresponding processes in the method embodiments, which need not be described again. It should be understood that the scope of protection of the present application is not limited thereto, and any skilled in the art can think of various equivalent modifications or replacements within the technical scope disclosed by the present application, and these modifications or replacements should be covered within the scope of protection of the present application.

Claims

1. A method for monitoring and service degradation based on an asynchronous architecture, characterized in that, The method comprises the following steps: configuring a third-party asynchronous calling interface according to a third-party asynchronous calling program of a local service, so that the local service can asynchronously call a third-party service through the third-party asynchronous calling interface; intercepting calling data of a local device to the third-party service by using a proxy object of the third-party asynchronous calling interface, collecting performance data of at least one performance index in the calling data through monitoring logic set in the proxy object, and listening to a target field in a configuration file of the proxy object through the third-party asynchronous calling interface in the process of collecting performance data; wherein the third-party asynchronous calling interface is encapsulated with a listening mechanism or a listener, and the listening mechanism or the listener is used to listen to the target field in the configuration file of the proxy object; judging whether the performance of the third-party service is degraded according to the performance data, updating the configuration file of the proxy object if performance degradation occurs, and automatically triggering callback logic of the configuration file to reload the configuration file so that the third-party service is processed by degradation if the target field in the configuration file of the proxy object for controlling the third-party service degradation processing is modified; if other fields in the configuration file except the target field are modified, the callback logic of the configuration file is automatically triggered to reload the configuration file to update the related configuration.

2. The method of claim 1, wherein, Further comprising: controlling the proxy object to enable or disable calling a preset third-party service by using the configuration file of the proxy object.

3. The method of claim 1, wherein, Further comprising: collecting performance data collected by the proxy object according to a preset frequency, and processing and calculating the performance data, so that the performance data is pushed to the front end in a preset form for display.

4. The method of claim 1, wherein, The at least one performance index comprises at least one of the following: calling duration, calling success rate, calling exception number, calling chain data, CPU occupancy rate at the time of calling, and memory usage rate at the time of calling.

5. A monitoring and service degradation apparatus based on an asynchronous architecture, characterized in that, The method comprises the following steps: configuring a third-party asynchronous calling interface according to a third-party asynchronous calling program of a local service, so that the local service can asynchronously call a third-party service through the third-party asynchronous calling interface; intercepting calling data of a local device to the third-party service by using a proxy object of the third-party asynchronous calling interface, collecting performance data of at least one performance index in the calling data through monitoring logic set in the proxy object, and listening to a target field in a configuration file of the proxy object through the third-party asynchronous calling interface in the process of collecting performance data; wherein the third-party asynchronous calling interface is encapsulated with a listening mechanism or a listener, and the listening mechanism or the listener is used to listen to the target field in the configuration file of the proxy object; A judging module is configured to judge whether the performance of the third-party service is degraded according to the performance data, update the configuration file of the proxy object if the performance is degraded, and automatically trigger the callback logic of the configuration file, reload the configuration file to make the third-party service be processed by degradation if a field for controlling the third-party service degradation processing in the configuration file of the proxy object is modified. The callback logic of the configuration file is automatically triggered, the configuration file is reloaded to update the related configuration if other fields in the configuration file except the target field are modified.

6. An electronic device, comprising: The electronic device comprises a processor and a memory storing computer program instructions; the electronic device implements the method according to any one of claims 1-4 when executing the computer program instructions.

7. A computer readable storage medium characterized in that, The computer readable storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the method according to any one of claims 1-4.

8. A computer program product, characterised in that, The computer program instructions are executed by the processor to implement the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Third-party service calling method and device, electronic equipment and storage medium

    CN110399178A

  • Business processing method and device, electronic equipment and medium

    CN114553928A