CN-122027533-A - Program exception information acquisition method and device, electronic equipment and medium
Abstract
The embodiment of the application provides a program abnormal information acquisition method, a device, electronic equipment and a medium, which relate to the technical field of operation and maintenance of communication networks and software systems and are suitable for various networking scenes such as an operator network, an enterprise network, a data center network, a home network, FTTR and the like; acquiring service running state information, acquiring storage space running state information and preset type data of a service module from a storage space, acquiring network state information associated with the service module from FTTR equipment or a network management system, acquiring log information of the service module from log information of an application program collected in real time, acquiring system environment resource information, and establishing an association relation between the information to obtain panoramic view information of an abnormal event. The abnormality related information for locating the cause of the abnormality can be collected comprehensively and in real time.
Inventors
- HA DA
Assignees
- 新华三信息技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260126
Claims (10)
- 1. A program abnormality information acquisition method, characterized by comprising: receiving an abnormality notification message which is reported by a monitoring point in a service module and is aimed at the service module, wherein the abnormality notification message comprises an abnormality occurrence time and abnormality data monitored by the monitoring point, and the monitoring point is a code added in the service module and is used for monitoring whether the function of the service module is abnormal or not; Acquiring registration information of the service module, wherein the registration information comprises service key data of the service module and connection information of a storage space associated with the service module; Acquiring service running state information from the service module, connecting the storage space based on the connection information, acquiring the storage space running state information from the storage space and preset type data generated in the running process of the service module and stored in the storage space, and acquiring network state information associated with the service module from optical fiber to room FTTR equipment or a network management system; Acquiring log information of the service module from the log information of the application program collected in real time, and acquiring system environment resource information at the abnormal occurrence moment from the periodically acquired system environment resource information; and establishing association relations among the abnormal data, the business key data, the business operation state information, the storage space operation state information, the preset type data, the network operation state information, the log information and the system environment resource information to obtain abnormal event panoramic view information.
- 2. The method of claim 1, wherein said obtaining service operational status information from the service module comprises: And calling a reflection mechanism or a run-time checking mechanism of the service module to acquire service running state information of the service module through a state query interface.
- 3. The method according to claim 1 or 2, wherein the obtaining storage space operation state information from the storage space and the preset type data generated during the operation of the service module and stored in the storage space include: Under the condition that the storage space comprises a database, acquiring database running state information through a management system interface of the database, wherein the database running state information at least comprises a connection pool state, a currently executed Structured Query Language (SQL) statement and a read-write operation frequency of a library table; under the condition that the storage space comprises a message queue, acquiring message queue running state information through a message queue application programming interface API, wherein the message queue running state information at least comprises a queue length, a message processing speed, a subject message accumulation amount and a consumption group consumption progress; under the condition that the storage space comprises a cache, obtaining cache state information through a cache command, wherein the cache state information at least comprises a cache hit rate, a memory occupation condition and hot spot data access frequency; And screening preset type data matched with the preset rule configuration information of the service module from the storage space.
- 4. The method of claim 1, wherein the service module is FTTR service module, the anomaly notification message includes an anomaly room identification, and the obtaining network state information associated with the service module from an optical fiber to room FTTR device or network management system comprises: And acquiring network state information associated with the abnormal room identifier from the FTTR equipment or the network management system through a state query interface, wherein the network state information at least comprises an optical link state, an access point on-line state, a room port rate, a room port utilization rate, a wireless signal quality parameter and a room service flow statistic value of abnormal room access corresponding to the abnormal room identifier.
- 5. The method according to claim 1, wherein the obtaining the log information of the service module from the log information of the application program collected in real time includes: analyzing a time field in the log information of the application program; Based on the analyzed time field, extracting log information of the service module in a preset time range before and after the abnormal occurrence moment; And establishing an inverted index for a preset field in the extracted log information.
- 6. The method of claim 1, wherein prior to the acquiring the system environment resource information at the time of occurrence of the anomaly from the periodically acquired system environment resource information, the method further comprises: Periodically collecting system environment information by using a system call interface or a designated monitoring tool, wherein the system environment resource information comprises resource use information of an operating system where the application program is located and/or resource use information of FTTR equipment; and storing the periodically acquired system environment resource information according to the time sequence.
- 7. The method according to claim 1, wherein the method further comprises: Receiving registration information reported when each service module in the application program is started through a service registration interface, wherein the registration information comprises service basic information, associated service information, operation identification, service key data, log storage paths, connection information of the storage space and description information; The registration information reported by each service module is stored as a tree structure, a root node of the tree structure is a service type, a sub-node connected with the root node is an identifier of each service module, and registration information corresponding to the service module identifier of the sub-node is hung under each sub-node.
- 8. A program abnormality information acquisition apparatus, characterized by comprising: The system comprises an abnormality monitoring and triggering module, a service module and a service module, wherein the abnormality monitoring and triggering module is used for receiving an abnormality notification message aiming at the service module and reported by a monitoring point in the service module included in an application program, the abnormality notification message comprises an abnormality occurrence time and abnormality data monitored by the monitoring point, and the monitoring point is a code added in the service module and is used for monitoring whether the function of the service module is abnormal or not; The system comprises a multi-source information collection module, a system environment resource information acquisition module, a network management system and a service module, wherein the multi-source information collection module is used for obtaining registration information of the service module, the registration information comprises service key data of the service module and connection information of a storage space associated with the service module, obtaining service operation state information from the service module, connecting the storage space based on the connection information, obtaining storage space operation state information from the storage space, and preset type data which are generated and stored in the storage space in the operation process of the service module, obtaining network state information associated with the service module from optical fiber to room FTTR equipment or the network management system, obtaining log information of the service module from log information of an application program collected in real time, and obtaining system environment resource information at the abnormal occurrence moment from system environment resource information collected in a periodic mode; the information processing module is used for establishing association relations among the abnormal data, the business key data, the business operation state information, the storage space operation state information, the preset type data, the network operation state information, the log information and the system environment resource information to obtain abnormal event panoramic view information.
- 9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; a memory for storing a computer program; A processor for implementing the method of any of claims 1-7 when executing a program stored on a memory.
- 10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-7.
Description
Program exception information acquisition method and device, electronic equipment and medium Technical Field The present application relates to the field of communications networks and software system operation and maintenance technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for acquiring program exception information. Background In the process of software development and maintenance, program abnormality is a difficult situation to avoid. However, when an exception occurs in a program, a developer can only obtain limited exception information, such as only the exception type and simple error prompt. Taking Java programs as an example, a developer can only obtain a brief description of the exception (Exception) and its subclasses. But it is difficult to locate the root of a problem based on this information for complex distributed systems or for a variety of network environments such as carrier networks, enterprise networks, data center networks, and home fiber to room (Fiber To The Room, FTTR). For example, in a distributed e-commerce system that includes numerous micro-services, program anomalies may result from various factors such as network delays, resource contention, configuration errors, or compatibility issues between services, and it is difficult to locate a particular cause of a program anomaly by simply relying on the type of anomaly and error notification information. In order to further examine the problem, the developer needs to further acquire information related to the abnormality, but after the abnormality occurs, the running state of the program may have changed, part of the key environment information may have been lost, and the key environment information when the abnormality occurs cannot be restored. Therefore, it is currently difficult to collect abnormality related information for locating the cause of the abnormality comprehensively in real time, resulting in low abnormality troubleshooting efficiency. Disclosure of Invention The embodiment of the application aims to provide a program abnormality information acquisition method, a program abnormality information acquisition device, electronic equipment and a program abnormality information acquisition medium, so as to comprehensively collect abnormality related information for locating abnormality causes in real time. The specific technical scheme is as follows: In a first aspect, an embodiment of the present application provides a method for acquiring program exception information, including: receiving an abnormality notification message which is reported by a monitoring point in a service module and is aimed at the service module, wherein the abnormality notification message comprises an abnormality occurrence time and abnormality data monitored by the monitoring point, and the monitoring point is a code added in the service module and is used for monitoring whether the function of the service module is abnormal or not; Acquiring registration information of the service module, wherein the registration information comprises service key data of the service module and connection information of a storage space associated with the service module; Acquiring service running state information from the service module, connecting the storage space based on the connection information, acquiring the storage space running state information from the storage space and preset type data generated in the running process of the service module and stored in the storage space, and acquiring network state information associated with the service module from optical fiber to room FTTR equipment or a network management system; Acquiring log information of the service module from the log information of the application program collected in real time, and acquiring system environment resource information at the abnormal occurrence moment from the periodically acquired system environment resource information; and establishing association relations among the abnormal data, the business key data, the business operation state information, the storage space operation state information, the preset type data, the network operation state information, the log information and the system environment resource information to obtain abnormal event panoramic view information. In one possible implementation manner, the acquiring service running state information from the service module includes: And calling a reflection mechanism or a run-time checking mechanism of the service module to acquire service running state information of the service module through a state query interface. In one possible implementation manner, the obtaining the storage space operation state information and the preset type data of the service module from the storage space includes: Under the condition that the storage space comprises a database, acquiring database running state information through a management system interface of the database, wherein th