Monitoring method and system for WEB service of transformer substation and computer device
By implementing the front-end interface and back-end interface monitoring method of WEB service in the digital substation system, the problem of lack of effective monitoring in the existing technology is solved, real-time monitoring and optimization of system performance is achieved, and system stability and maintenance efficiency are improved.
Patent Information
- Application Number
- CN202411628472.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-28
AI Technical Summary
The lack of effective monitoring of WEB services in the digital substation system in the prior art has led to low efficiency in the stable operation and maintenance of the system.
Provides a method of monitoring WEB service in the substation, including front-end interface monitoring of WEB service and back-end interface monitoring. By determining whether the module interface is loading exceptions and whether the interface request is normal, recording the response time and cause of the exception, and sending it to the back-end analysis module in a JSON format message structure for performance analysis.
It realizes monitoring of the loading situation of each module interface and the call status of interface requests in the substation system integrated with multi-module interfaces, and can quickly locate the interface that affects the system loading speed and the interface with long response time, improving system stability and maintenance efficiency.
Smart Images

Figure CN119718816A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of substations, and in particular relates to a monitoring method, system and computer device for substation WEB services. Background Art
[0002] At present, the iteration speed of digital substation system is getting faster and faster, and its own functional complexity is getting higher and higher. Monolithic applications can no longer meet business needs. In order to reduce development costs and cycles, digital substation systems have evolved into modularization and integration trends. Different manufacturers develop different module interfaces, or directly use other existing system function interfaces, and finally integrate them into a system through iFrame or QianKun (iFrame and QianKun are two common technologies for front-end application interface integration). The system integration architecture is as follows: Figure 1 The WEB services and interfaces of different modules of the digital substation system may encounter some interface call failures, interface failures or failures to load normally during use. Currently, there is a lack of effective monitoring methods for the WEB services of the digital substation system, which is not conducive to the stable operation and maintenance of the system. Summary of the invention
[0003] The purpose of the present invention is to provide a monitoring method, system and computer device for substation WEB services, so as to solve the technical problem of lack of effective monitoring of substation WEB service use process in the prior art.
[0004] In order to solve the above technical problems, the present invention provides a technical solution of a substation WEB service monitoring method: a substation WEB service monitoring method, the method comprising a WEB service front-end interface monitoring method and / or a WEB service back-end interface monitoring method; The WEB service front-end interface monitoring method comprises: determining whether the module interface is loaded abnormally, if the module interface is loaded abnormally, recording the reason for the module interface loading abnormality; otherwise, recording the response time of the module interface; The WEB service backend interface monitoring method includes: after the module interface is loaded successfully and the module interface requests interface data, determining whether the interface request is normal, if the interface request is normal, recording the response time of the interface request; otherwise, recording the reason for the failure of the interface request.
[0005] The beneficial effect of the above technical solution is that the technical solution of a monitoring method for substation WEB service of the present invention belongs to a pioneering invention. In the scenario of a substation system with integrated multi-module interfaces, the present invention can monitor the loading status of each module interface and the calling status of the interface request, so that performance analysis can be performed according to the monitoring information of each module interface. Among them, for the module interface, the response time is an important feedback indicator reflecting the loading of the front-end interface. The interface that affects the system loading speed can be quickly located through the response time, which is convenient for the optimization and improvement of the system interface rendering; for the back-end interface, the response time is an important feedback indicator reflecting the back-end interface service. The interface with a long response time can be quickly located through the response time, which is convenient for service optimization and improvement. It is of great significance to ensure the stable operation of the digital substation system and improve the efficiency of system maintenance work. The present invention solves the technical problem of the lack of effective monitoring of the substation WEB service usage process in the prior art.
[0006] Furthermore, if the module interface is a module interface integrated using iFrame, the HTTP response status code of the module interface is used to determine whether the module interface is loaded abnormally: if the HTTP response status code of the module interface is an abnormal status code, it indicates that the module interface is loaded abnormally, and the reason for the module interface loading abnormality is recorded according to the abnormal status code.
[0007] Furthermore, the HTTP response status code of the module interface is obtained through the title attribute value of the document object.
[0008] Furthermore, if the module interface is a module interface integrated by iFrame, the response time of the module interface is obtained through the Performance object.
[0009] Furthermore, if the module interface is a module interface integrated by QianKun, it is determined whether the module interface is loaded abnormally through the loadMicroApp function used to load the module interface, and the reason for the module interface loading abnormality is obtained through the catch block.
[0010] Furthermore, if the module interface is a module interface integrated using QianKun, the response time of the module interface is obtained through the loadPromise function.
[0011] Furthermore, the messages related to the module interface recorded in the WEB service front-end interface monitoring method are sent to the back-end analysis module in the form of a JSON format message structure, and the back-end analysis module is used to perform WEB service performance analysis according to the received messages; the JSON format message structure corresponding to the messages related to the module interface includes the fields Route, MsgType and Content; Among them, the field Route is used to represent the routing information of the module interface; the field MsgType is used to represent the message type; and the field Content is used to represent the message content.
[0012] Furthermore, in the WEB service backend interface monitoring method, whether the interface request is normal is determined by the HTTP response status code and the business status code of the interface request: if both the HTTP response status code and the business status code are normal, it means that the interface request is normal.
[0013] Furthermore, the message related to the interface request recorded in the WEB service backend interface monitoring method is sent to the backend analysis module in the form of a JSON format message structure, and the backend analysis module is used to perform WEB service performance analysis according to the received message; the JSON format message structure corresponding to the message related to the interface request includes the fields ApiUrl, MsgType and Content; Among them, the field ApiUrl is used to indicate the interface request address; the field MsgType is used to indicate the message type; and the field Content is used to indicate the message content.
[0014] Furthermore, if the HTTP response status code is normal and the business status code is abnormal, it indicates that the interface is abnormal, and the response time when the interface call fails is recorded.
[0015] The present invention also provides a technical solution for a computer device: a computer device comprising a processor, wherein the processor is used to execute a computer program to implement the steps of the above-mentioned substation WEB service monitoring method.
[0016] The present invention also provides a technical solution for a monitoring system of a substation WEB service: a monitoring system of a substation WEB service, comprising a WEB monitoring service and a back-end analysis module; the WEB monitoring service comprises a processor, the processor is used to execute a computer program to implement the steps of a WEB service front-end interface monitoring method and / or a WEB service back-end interface monitoring method; The WEB service front-end interface monitoring method includes: determining whether the module interface is loaded abnormally, if the module interface is loaded abnormally, recording the reason for the loading abnormality and sending it to the back-end analysis module; otherwise, recording the response time of the module interface and sending it to the back-end analysis module; The WEB service backend interface monitoring method comprises: after the module interface is loaded successfully and the module interface requests interface data, determining whether the interface request is normal, if the interface request is normal, recording the response time of the interface request and sending it to the backend analysis module; otherwise, recording the reason for the failure of the interface request and sending it to the backend analysis module; The back-end analysis module performs WEB service performance analysis based on the received messages.
[0017] The beneficial effect of the above technical solution is that the technical solution of a monitoring system for substation WEB services of the present invention belongs to a pioneering invention. In the scenario of a substation system with integrated multi-module interfaces, the present invention can monitor the loading status of each module interface and the calling status of the interface request, so that performance analysis can be performed according to the monitoring information of each module interface. Among them, for the module interface, the response time is an important feedback indicator reflecting the loading of the front-end interface. The interface that affects the system loading speed can be quickly located through the response time, which is convenient for the optimization and improvement of the system interface rendering; for the back-end interface, the response time is an important feedback indicator reflecting the back-end interface service. The interface with a long response time can be quickly located through the response time, which is convenient for service optimization and improvement. It is of great significance to ensure the stable operation of the digital substation system and improve the efficiency of system maintenance work. The present invention solves the technical problem of the lack of effective monitoring of the substation WEB service usage process in the prior art.
[0018] Furthermore, if the module interface is a module interface integrated using iFrame, the HTTP response status code of the module interface is used to determine whether the module interface is loaded abnormally: if the HTTP response status code of the module interface is an abnormal status code, it indicates that the module interface is loaded abnormally, and the reason for the module interface loading abnormality is recorded according to the abnormal status code.
[0019] Furthermore, if the module interface is a module interface integrated by QianKun, it is determined whether the module interface is loaded abnormally through the loadMicroApp function used to load the module interface, and the reason for the module interface loading abnormality is obtained through the catch block.
[0020] Furthermore, in the WEB service backend interface monitoring method, whether the interface request is normal is determined by the HTTP response status code and the business status code of the interface request: if both the HTTP response status code and the business status code are normal, it means that the interface request is normal. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a WEB service integration architecture diagram for the digital substation system in the existing technology; Figure 2 A method flow chart of an embodiment of a monitoring method for a substation WEB service of the present invention; Figure 3 A schematic diagram of a module interface loading time message format of a JSON format message structure in an embodiment of a monitoring method for a substation WEB service of the present invention; Figure 4 A schematic diagram of a module interface loading failure message format of a JSON format message structure in an embodiment of a monitoring method for a substation WEB service of the present invention; Figure 5 A schematic diagram of the interface request response time message format of a JSON format message structure in an embodiment of a monitoring method for a substation WEB service of the present invention; Figure 6 This is a schematic diagram of the interface request failure message format of a JSON format message structure in an embodiment of the substation WEB service monitoring method of the present invention. DETAILED DESCRIPTION
[0022] In the substation system scenario with multi-module interface integration, the present invention can monitor the loading status of each module interface and the calling status of interface requests, so that the monitoring information of each module interface can be used to ensure the stable operation of the digital substation system and improve the efficiency of system maintenance work. The present invention solves the technical problem of the lack of effective monitoring of the substation WEB service usage process in the prior art.
[0023] Substation WEB service monitoring method embodiment: A digital substation system WEB service monitoring method is mainly used to monitor the performance of WEB services. The WEB service performance monitoring mainly includes the front-end interface rendering status and the back-end service interface status.
[0024] The front-end interface rendering status refers to the rendering events of the front-end interface, including the response time of the module interface and the loading status of the module interface.
[0025] The backend service interface status refers to the response time and interface request status of the backend gateway interface call.
[0026] Specifically, Figure 2 As shown, the main steps of the digital substation system WEB service monitoring of this embodiment are as follows: 1) Establish the binding relationship between the interface called by the module interface and the module interface route.
[0027] 2) The client accesses the WEB interface of the digital substation system, navigates different functional module interfaces through different menus, and establishes a backend WEBSOCKET connection with the WEB service performance monitoring.
[0028] 3) If it is a module interface integrated with iFrame, listen to the onLoad event of iFrame, and obtain the HTTP response status code of the module interface by judging the title attribute value of the document object. If an abnormal status code such as 401, 403, 404, 500, or 502 appears, record the module interface loading exception. If the status code is normal, record the module interface loading normally and obtain the response time of the module interface integrated with iFrame through the Performance object and record it.
[0029] 4) If it is a module interface integrated by QianKun, load the interface through the loadMicroApp function and capture exceptions. If an exception occurs, record the reason for the module interface loading exception. If there is no exception, calculate the loading time of the module interface through the loadPromise function and record it.
[0030] Specifically, by calling the loadPromise function to capture the exception with try-catch, if the loading fails, it will enter the catch block, and the cause of the loading exception will be recorded as the error information captured in the catch block.
[0031] 5) Based on the recorded contents of step 3) and step 4), define a JSON format message structure, including the fields Route (module interface route), MsgType (message type, "time" represents the module interface loading time message, "error" represents the module interface loading exception message), and Content (message content, depending on the type of MsgType, the message content can be the module interface loading time or the reason for the module interface loading exception); Figure 3 and Figure 4 shown.
[0032] 6) Through the WEBSOCKET connection created in step 2), send the message content of step 5) to the WEB service performance monitoring backend service.
[0033] 7) After the module interface is loaded successfully, it requests interface data from the proxy gateway Nginx.
[0034] 8) The proxy gateway determines whether the HTTP response status code of the interface request is normal.
[0035] 9) If the response status code in step 8) is normal, the proxy gateway records the response time of the interface request, and obtains the response content of the interface through Lua scripting technology to parse out the business status code; if the response status code in step 8) is abnormal, the reason for the failure of the interface call is recorded.
[0036] 10) The proxy gateway determines the business status code of step 9). If the business status code is abnormal, the reason for the interface call failure is recorded; if the business status code is normal, it means that the interface request is normal.
[0037] It should be noted that although in the above step 9), the response time of the interface request is recorded after judging that the response status code is normal, it does not mean that the interface request can be directly considered normal at this time. The interface request is normal only when both the response status code and the business status code are normal. When the response status code is normal but the business status code is abnormal, the response time recorded in step 8) is the time when the interface call fails.
[0038] In other implementations, the response time of the interface request may be recorded only after determining that the service status code is normal (ie, in step 9). At this time, the recorded response time is the response time when the interface request is normal.
[0039] 11) Based on the recorded contents of steps 9) and 10), define a JSON format message structure, including the fields ApiUrl (interface request address), MsgType (message type, "time" represents the interface response time message, "error" represents the interface exception message), and Content (message content, depending on the type of MsgType, the message content can be the interface response time or the reason for the interface loading exception); Figure 5 and Figure 6 shown.
[0040] 12) The proxy gateway sends the message in step 11) to the Web service performance monitoring backend service through Kafka.
[0041] 13) After receiving the message, the backend service performs storage operations and performs performance analysis operations on related interfaces based on the relationship in step 1) to generate a WEB service monitoring report.
[0042] For module interfaces, response time is an important feedback indicator for front-end interface loading. The response time can be used to quickly locate interfaces that affect system loading speed, which is convenient for optimizing and improving system interface rendering. For back-end interfaces, response time is an important feedback indicator for back-end interface services. The response time can be used to quickly locate interfaces with long response times, which is convenient for optimizing and improving services.
[0043] In this embodiment, all monitoring information is sent to the backend of the WEB service performance monitoring (i.e., the backend analysis module for performing WEB service performance analysis based on the received messages). In other implementations, the monitoring information can be sent to other locations, such as the backend of the WEB service monitoring of the substation system.
[0044] Computer device embodiment: A computer device includes a processor, the processor is used to execute a computer program to implement the steps of the substation WEB service monitoring method as described above. The specific substation WEB service monitoring method has been described in detail in the above substation WEB service monitoring method embodiment, and will not be repeated here.
[0045] An embodiment of a monitoring system for substation WEB services: A monitoring system for substation WEB service includes a WEB monitoring service and a back-end analysis module; the WEB monitoring service includes a processor, and the processor is used to execute a computer program to implement the steps of a WEB service front-end interface monitoring method and / or a WEB service back-end interface monitoring method.
[0046] The WEB service front-end interface monitoring method includes: determining whether the module interface is loaded abnormally, if the module interface is loaded abnormally, recording the reason for the loading abnormality and sending it to the back-end analysis module; otherwise, recording the response time of the module interface and sending it to the back-end analysis module.
[0047] The WEB service back-end interface monitoring method includes: after the module interface is loaded successfully and the module interface requests interface data, judging whether the interface request is normal; if the interface request is normal, recording the response time of the interface request and sending it to the back-end analysis module; otherwise, recording the reason for the failure of the interface request and sending it to the back-end analysis module.
[0048] The back-end analysis module performs WEB service performance analysis based on the received messages.
[0049] If the module interface is a module interface integrated using iFrame, the HTTP response status code of the module interface is used to determine whether the module interface is loaded abnormally: if the HTTP response status code of the module interface is an abnormal status code, it indicates that the module interface is loaded abnormally, and the reason for the module interface loading abnormality is recorded according to the abnormal status code.
[0050] If the module interface is a module interface integrated by QianKun, the loadMicroApp function used to load the module interface is used to determine whether the module interface is loaded abnormally, and the reason for the module interface loading abnormality is obtained through the catch block.
[0051] In the WEB service backend interface monitoring method, the HTTP response status code and business status code of the interface request are used to determine whether the interface request is normal: if both the HTTP response status code and the business status code are normal, it means that the interface request is normal.
[0052] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention is described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions recorded in the aforementioned embodiments without creative work, or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for monitoring substation WEB services, characterized in that: The method includes a WEB service front-end interface monitoring method and / or a WEB service back-end interface monitoring method; The WEB service front-end interface monitoring method comprises: determining whether the module interface is loaded abnormally, if the module interface is loaded abnormally, recording the reason for the module interface loading abnormality; otherwise, recording the response time of the module interface; The WEB service backend interface monitoring method includes: after the module interface is loaded successfully and the module interface requests interface data, determining whether the interface request is normal, if the interface request is normal, recording the response time of the interface request; otherwise, recording the reason for the failure of the interface request.
2. The monitoring method of substation WEB service according to claim 1, characterized in that: If the module interface is a module interface integrated using iFrame, the HTTP response status code of the module interface is used to determine whether the module interface is loaded abnormally: if the HTTP response status code of the module interface is an abnormal status code, it indicates that the module interface is loaded abnormally, and the reason for the module interface loading abnormality is recorded according to the abnormal status code.
3. The monitoring method of substation WEB service according to claim 2, characterized in that: Get the HTTP response status code of the module interface through the title attribute value of the document object.
4. The monitoring method of substation WEB service according to claim 1, 2 or 3, characterized in that: If the module interface is a module interface integrated using iFrame, the response time of the module interface is obtained through the Performance object.
5. The monitoring method of substation WEB service according to claim 1, characterized in that: If the module interface is a module interface integrated by QianKun, it is determined whether the module interface is loaded abnormally through the loadMicroApp function used to load the module interface, and the reason for the module interface loading abnormality is obtained through the catch block.
6. The monitoring method of substation WEB service according to claim 1 or 5, characterized in that: If the module interface is a module interface integrated using QianKun, the response time of the module interface is obtained through the loadPromise function.
7. The monitoring method of substation WEB service according to claim 1, characterized in that: The messages related to the module interface recorded in the WEB service front-end interface monitoring method are sent to the back-end analysis module in the form of a JSON format message structure, and the back-end analysis module is used to perform WEB service performance analysis according to the received messages; the JSON format message structure corresponding to the messages related to the module interface includes fields Route, MsgType and Content; Among them, the field Route is used to represent the routing information of the module interface; the field MsgType is used to represent the message type; and the field Content is used to represent the message content.
8. The monitoring method of substation WEB service according to claim 1, characterized in that: In the WEB service backend interface monitoring method, the HTTP response status code and business status code of the interface request are used to determine whether the interface request is normal: if both the HTTP response status code and the business status code are normal, it means that the interface request is normal.
9. The monitoring method of substation WEB service according to claim 1 or 8, characterized in that: The message related to the interface request recorded in the WEB service backend interface monitoring method is sent to the backend analysis module in the form of a JSON format message structure, and the backend analysis module is used to perform WEB service performance analysis according to the received message; the JSON format message structure corresponding to the message related to the interface request includes the fields ApiUrl, MsgType and Content; Among them, the field ApiUrl is used to indicate the interface request address; the field MsgType is used to indicate the message type; and the field Content is used to indicate the message content.
10. The monitoring method of substation WEB service according to claim 8, characterized in that: If the HTTP response status code is normal and the business status code is abnormal, it indicates that the interface is abnormal, and the response time when the interface call fails is recorded.
11. A computer device comprising a processor, characterized in that: The processor is used to execute a computer program to implement the steps of the substation WEB service monitoring method as described in any one of claims 1 to 10.
12. A monitoring system for substation WEB services, characterized in that: It includes a WEB monitoring service and a back-end analysis module; the WEB monitoring service includes a processor, and the processor is used to execute a computer program to implement the steps of the WEB service front-end interface monitoring method and / or the WEB service back-end interface monitoring method; The WEB service front-end interface monitoring method includes: determining whether the module interface is loaded abnormally, if the module interface is loaded abnormally, recording the reason for the loading abnormality and sending it to the back-end analysis module; otherwise, recording the response time of the module interface and sending it to the back-end analysis module; The WEB service backend interface monitoring method comprises: after the module interface is loaded successfully and the module interface requests interface data, determining whether the interface request is normal, if the interface request is normal, recording the response time of the interface request and sending it to the backend analysis module; otherwise, recording the reason for the failure of the interface request and sending it to the backend analysis module; The back-end analysis module performs WEB service performance analysis based on the received messages.
13. The monitoring system for substation WEB service according to claim 12, characterized in that: If the module interface is a module interface integrated using iFrame, the HTTP response status code of the module interface is used to determine whether the module interface is loaded abnormally: if the HTTP response status code of the module interface is an abnormal status code, it indicates that the module interface is loaded abnormally, and the reason for the module interface loading abnormality is recorded according to the abnormal status code.
14. The monitoring system for substation WEB service according to claim 12, characterized in that: If the module interface is a module interface integrated by QianKun, it is determined whether the module interface is loaded abnormally through the loadMicroApp function used to load the module interface, and the reason for the module interface loading abnormality is obtained through the catch block.
15. The monitoring system for substation WEB service according to claim 12, characterized in that: In the WEB service backend interface monitoring method, the HTTP response status code and business status code of the interface request are used to determine whether the interface request is normal: if both the HTTP response status code and the business status code are normal, it means that the interface request is normal.
Citation Information
Patent Citations
Web front-end exception monitoring method, monitoring server and monitoring system
CN107896156A
Front-end monitoring method and device, equipment and medium
CN112835764A
SDK module for web front-end error and performance monitoring and calling method thereof
CN112965718A
Cloud platform web front-end performance monitoring method and system and medium
CN114116377A
Management method and device for micro-front-end sub-application
CN117348946A