A log real-time acquisition method and device, electronic equipment, and storage medium

By writing logs to the pre-allocated area of ​​the system management component and parsing the data types, the problem of excessive system resource consumption was solved, and transaction processing efficiency was improved.

CN115658555BActive Publication Date: 2025-12-19CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211088683.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-07
Publication Date
2025-12-19
Estimated Expiration
2042-09-07

AI Technical Summary

Technical Problem

In the operating system environment of IBM mainframes, existing technologies consume excessive system resources and affect transaction processing efficiency by writing logs directly to files or databases.

Method used

Logs are written in real time to the pre-allocated area of ​​the system management component. The data type is defined by the target allocation parameter, and the log format is obtained and parsed according to the data type, avoiding direct writing to files or databases.

Benefits of technology

It reduces system resource consumption and improves transaction processing efficiency, especially when transaction volume is high.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658555B_ABST
    Figure CN115658555B_ABST
Patent Text Reader

Abstract

The application discloses a log real-time acquisition method and device, electronic equipment and a storage medium. The method comprises the following steps: writing a current target log into a pre-allocation area of a system management component according to a target allocation parameter defined in advance in an operating system environment in real time, so as to obtain system management component data corresponding to the current target log; connecting to the system management component; reading the system management component data corresponding to the current target log in the pre-allocation area of the system management component; acquiring a data format corresponding to a data type to which the current target log belongs according to the data type to which the current target log belongs; analyzing the system management component data corresponding to the current target log according to the data format corresponding to the data type to which the current target log belongs, so as to obtain the current target log; and disconnecting the connection with the system management component.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data acquisition, in particular to a log real-time acquisition method and device, electronic equipment and storage medium. BACKGROUND

[0002] In the environment of operating system running in IBM mainframe, transactions are generally run in user information control system CICS as host middleware. During the running of the transactions, some log information is recorded for diagnosing abnormal problems or monitoring the transaction state. Therefore, it is necessary to acquire the log in the running process of the transactions in real time.

[0003] The current acquisition method of transaction log is mainly to write the log into a file or a database, so that the transaction log can be acquired directly from the file or the database.

[0004] However, when the number of transactions in a unit of time is large, the write operation of this method will consume a large amount of system resources, which will cause the transaction response time to be too long and affect the processing efficiency of the transactions. SUMMARY

[0005] Based on the deficiencies of the prior art, the present application provides a log real-time acquisition method and device, electronic equipment and storage medium to solve the problem of excessive consumption of system resources and affect the processing efficiency of transactions in the prior art.

[0006] In order to achieve the above purpose, the present application provides the following technical solutions:

[0007] The first aspect of the present application provides a log real-time acquisition method, comprising:

[0008] writing a current target log into a pre-allocated area of a system management component according to a target allocation parameter defined in advance in an operating system environment to obtain system management component data corresponding to the current target log;

[0009] connecting to the system management component;

[0010] reading the system management component data corresponding to the current target log in the pre-allocated area of the system management component;

[0011] acquiring a data format corresponding to a data type to which the current target log belongs according to the data type to which the current target log belongs;

[0012] parsing the system management component data corresponding to the current target log according to the data format corresponding to the data type to which the current target log belongs to obtain the current target log;

[0013] disconnecting from the system management component.

[0014] Optionally, in the log real-time acquisition method, before the current target log is written into the pre-allocated area of the system management component according to the target allocation parameter defined in advance in the operating system environment to obtain the system management component data corresponding to the current target log, the method further comprises:

[0015] in response to a parameter configuration operation of a user, allocating a block of the pre-allocated area in the memory according to the target allocation parameter defined in the operating system environment; wherein the pre-allocated area is used to store system management component data of a specified type;

[0016] in response to a control table configuration operation of the user, generating a monitoring control table instance of the system management component in the user information control system.

[0017] Optionally, in the log real-time acquisition method, the writing of the current target log into the pre-allocated area of the system management component according to the target allocation parameter defined in advance in the operating system environment to obtain the system management component data corresponding to the current target log comprises:

[0018] when the current target log is monitored, if the data type of the current target log belongs to any one of the data types defined in the target allocation parameter, calling a monitoring program calling interface of the user information control system to write the current target log into the monitoring control table in the pre-allocated area.

[0019] Optionally, in the log real-time acquisition method, the obtaining of the data format corresponding to the data type of the current target log comprises:

[0020] judging whether it is the first time to parse the log of the data type of the current target log;

[0021] if it is judged that it is the first time to parse the log of the data type of the current target log, generating a system management component data header file corresponding to the data type of the current target log;

[0022] based on the result information of the system management component data header file corresponding to the data type of the current target log, parsing the system management component data header file corresponding to the data type of the current target log to obtain the data format corresponding to the data type of the current target log;

[0023] if it is judged that it is not the first time to parse the log of the data type of the current target log, querying the data format corresponding to the data type of the current target log.

[0024] Optionally, in the log real-time acquisition method, after the system management component data corresponding to the current target log is parsed according to the data format corresponding to the data type to which the current target log belongs, the method further includes:

[0025] storing the current target log locally, and / or sending the current target log to an information management system for storage.

[0026] The second aspect of the present application provides a log real-time acquisition device, comprising:

[0027] a writing unit configured to write a current target log into a pre-allocated area of a system management component according to a target allocation parameter defined in advance in an operating system environment, to obtain system management component data corresponding to the current target log;

[0028] a connecting unit configured to connect to the system management component;

[0029] a reading unit configured to read the system management component data corresponding to the current target log in the pre-allocated area of the system management component;

[0030] a format obtaining unit configured to obtain a data format corresponding to a data type to which the current target log belongs according to the data type to which the current target log belongs;

[0031] a first parsing unit configured to parse the system management component data corresponding to the current target log according to the data format corresponding to the data type to which the current target log belongs, to obtain the current target log;

[0032] a disconnecting unit configured to disconnect the connection with the system management component.

[0033] Optionally, in the log real-time acquisition device, the device further comprises:

[0034] a first defining unit configured to allocate a block of the pre-allocated area in the memory in response to a parameter configuration operation of a user, the target allocation parameter being defined in the operating system environment; wherein the pre-allocated area is used to store system management component data of a specified type;

[0035] a second defining unit configured to generate a monitoring control table instance of the system management component in a user information control system in response to a control table configuration operation of the user.

[0036] Optionally, in the log real-time acquisition device, the writing unit comprises:

[0037] The writing sub-unit is configured to, when the current target log is monitored, if the data type of the current target log belongs to any one of the data types defined in the target allocation parameter, call a monitoring program calling interface of the user information control system, and write the current target log into a monitoring control table in the pre-allocation area.

[0038] Optionally, in the log real-time acquisition device, the format acquisition unit comprises:

[0039] The judging unit is configured to judge whether it is the first time to analyze the data type of the current target log.

[0040] The file generating unit is configured to, when it is judged that it is the first time to analyze the data type of the current target log, generate a system management component data header file corresponding to the data type of the current target log.

[0041] The second analyzing unit is configured to analyze the system management component data header file corresponding to the data type of the current target log based on the result information of the system management component data header file corresponding to the data type of the current target log, and obtain the data format corresponding to the data type of the current target log.

[0042] The querying unit is configured to, when it is judged that it is not the first time to analyze the data type of the current target log, query the data format corresponding to the data type of the current target log.

[0043] Optionally, in the log real-time acquisition device, the format acquisition unit comprises:

[0044] The storage unit is configured to save the current target log locally and / or send the current target log to an information management system for storage.

[0045] The third aspect of the present application provides an electronic device, comprising:

[0046] a memory and a processor;

[0047] The memory is configured to store a program.

[0048] The processor is configured to execute the program, and the program is configured to, when executed, specifically implement the log real-time acquisition method according to any one of the preceding aspects.

[0049] The fourth aspect of the present application provides a computer storage medium for storing a computer program, and the computer program is configured to, when executed, implement the log real-time acquisition method according to any one of the preceding aspects.

[0050] The log real-time acquisition method provided by the embodiment of the present application writes the current target log into the pre-allocated area of the system management component according to the target allocation parameter defined in advance in the operating system environment, and obtains the system management component data corresponding to the current target log. Then, the system management component is connected, and the system management component data corresponding to the current target log in the pre-allocated area of the system management component is read. Then, the data format corresponding to the data type to which the current target log belongs is obtained according to the data type to which the current target log belongs, the system management component data corresponding to the current target log is parsed according to the data format corresponding to the data type to which the current target log belongs, the current target log is obtained, and finally, the connection with the system management component is disconnected. Therefore, the log is no longer directly written into the file or the database, but is written into the specified area of the system management component through configuration, and is parsed subsequently, so that the occupation of too many resources and the influence on the processing efficiency of the transaction can be avoided when the transaction volume increases. BRIEF DESCRIPTION OF DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of the provided drawings.

[0052] Figure 1 The flowchart of the log real-time acquisition method provided by the embodiment of the present application is shown in FIG. 1.

[0053] Figure 2 The flowchart of the information pre-configuration method provided by the embodiment of the present application is shown in FIG. 2.

[0054] Figure 3 The flowchart of the method for obtaining the data format corresponding to the data type to which the current target log belongs provided by the embodiment of the present application is shown in FIG. 3.

[0055] Figure 4 The architecture schematic diagram of the log real-time acquisition device provided by the embodiment of the present application is shown in FIG. 4.

[0056] Figure 5 The architecture schematic diagram of the electronic device provided by the embodiment of the present application is shown in FIG. 5. DETAILED DESCRIPTION

[0057] With reference to the drawings and the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments of the present application, all the other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0058] In the present application, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitation, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or equipment including the element.

[0059] The embodiments of the present application provide a log real-time acquisition method, as shown in the method, comprising the following steps: Figure 1

[0060] S101, writing a current target log into a pre-allocated area of a system management component according to a target allocation parameter defined in advance in an operating system environment, to obtain system management component data corresponding to the current target log.

[0061] The current target log refers to a log generated at present and meeting a requirement.

[0062] It should be noted that in the embodiments of the present application, the log is written into the system management component SMF, so a region for storing the system management component data is allocated in advance in the operating system (z / OS) environment through the target allocation parameter (INMEM parameter), that is, information pre-configuration needs to be performed in advance before step S101 is performed.

[0063] The target allocation parameter also has a definition of how the log is written, so when the log is generated, the current target log is written into the pre-allocated area of the system management component according to the target allocation parameter, to obtain the system management component data corresponding to the current target log.

[0064] Optionally, another embodiment of the present application provides an information pre-configuration method, as shown in the method, comprising: Figure 2

[0065] ​​S201, in response to the parameter configuration operation of the user, defining a target allocation parameter in the operating system environment, allocating a pre-allocation region in the memory.

[0066] The pre-allocation region is used to store system management component data of a specified type.

[0067] In the embodiments of the present application, the target allocation parameter not only defines the size of the allocated region, but also defines the data type. For example, the target allocation parameter can be defined as:

[0068] “INMEM(IFASMF.DEF,RESSIZMAX(1024M),TYPE(30,70:79,110)”

[0069] Wherein, “IFASMF.DEF” is the name of the target allocation parameter, which can be customized by the user. “RESSIZMAX” is the size of the allocated region. “TYPE” is the supported data type, and the log of type 30, 70-79, and 110 can be written to this region.

[0070] S202, in response to the control table configuration operation of the user, generating a monitoring control table instance of the system management component in the user information control system.

[0071] Specifically, in the embodiments of the present application, in order to enable the log to be written as required, a monitoring control table instance MCTEntry of the log is defined in the user information control system in the embodiments of the present application. For example, the following statement can define an MCTEntry named ENTRY3, which can store application log data with a length of up to 156 bytes.

[0072] “DFHMCT TYPE=EMP,

[0073] CLASS=PERFORM,

[0074] ID=(ENTRY3.13),

[0075] PERFORM=MOVE(0,156)”

[0076] Correspondingly, when the information is pre-set in the manner as shown in Figure 2 , one specific implementation of step S101 includes:

[0077] When the current target log is currently monitored, if the data type to which the current target log belongs is any one of the data types defined in the target allocation parameter, the monitoring program calling interface of the user information control system is called to write the current target log into the monitoring control table in the pre-allocation region.

[0078] Specifically, in the embodiment of the present application, the log is written into the monitoring control table by calling the monitoring program calling interface MONITOR API of the user information control system CICS.

[0079] S102, connect to the system management component.

[0080] Since the SMF data is written into the INMEM-SMF, the SMF data can be read. The SMF provides three interfaces for reading the INMEM-SMF data, through which the SMF data is read. The first step is to connect to the system management component through the IFAMCON interface. And the resource location where the system management component data is stored can be connected. Specifically, the connection can be made through the defined resource name.

[0081] S103, read the system management component data corresponding to the current target log in the pre-allocated area of the system management component.

[0082] Optionally, the system management component data corresponding to the previous target log can be read through the IFAMGET interface. And the read system management component data can be cached for subsequent parsing.

[0083] S104, according to the data type to which the current target log belongs, obtain the data format corresponding to the data type to which the current target log belongs.

[0084] It should be noted that the format of the system management component data generated by the log of different data types is different, so it is necessary to obtain the data format corresponding to the data type to which the current target log belongs according to the data type to which the current target log belongs, so as to parse according to the corresponding data format.

[0085] Optionally, in another embodiment of the present application, a specific implementation of step S104 includes the following steps as shown in Figure 3

[0086] S301, determine whether it is the first time to parse the log of the data type to which the current target log belongs.

[0087] It should be noted that if it is determined that it is not the first time to parse the log of the data type to which the current target log belongs, it means that the log of the data type has been parsed previously, so the data format corresponding to the data type has been stored, and therefore step S304 can be directly executed at this time.

[0088] If it is determined that it is the first time to parse the log of the data type to which the current target log belongs, the first generation is needed, and therefore step S302 needs to be executed at this time. ​

[0089] S302, generating a system management component data header file corresponding to the data type to which the current target log belongs.

[0090] Optionally, the program of the user information control system CICS can be used to generate the system management component data header file (SMFHeader file) corresponding to the data type to which the current target log belongs, and the file records the data structure of the data type to which the current target log belongs.

[0091] S303, based on the result information of the system management component data header file corresponding to the data type to which the current target log belongs, parsing the system management component data header file corresponding to the data type to which the current target log belongs to obtain the data format corresponding to the data type to which the current target log belongs.

[0092] S304, querying the data format corresponding to the data type to which the current target log belongs.

[0093] S105, parsing the system management component data corresponding to the current target log according to the data format corresponding to the data type to which the current target log belongs, to obtain the current target log.

[0094] Since the data format corresponding to the data type to which the current target log belongs specifies the specific composition format of the system management component data, the data format can be parsed to obtain the current target log.

[0095] Optionally, in another embodiment of the present application, in order to facilitate subsequent use of the parsed log, after step S105 is performed, the following steps can be further included:

[0096] Saving the current target log locally, and / or sending it to the information management system for storage.

[0097] Optionally, the information management system can be kafka, logstash, etc.

[0098] S106, disconnecting the connection with the system management component.

[0099] After the data access is completed, the connection between the IFAMDSC and the INMEM-SMF needs to be disconnected.

[0100] The log real-time acquisition method provided in the embodiment of the present application writes the current target log into the pre-allocated area of the system management component according to the target allocation parameter defined in advance in the operating system environment, and obtains the system management component data corresponding to the current target log. Then, the system management component is connected, and the system management component data corresponding to the current target log in the pre-allocated area of the system management component is read. Then, the data format corresponding to the data type to which the current target log belongs is obtained according to the data type to which the current target log belongs, and the system management component data corresponding to the current target log is parsed according to the data format corresponding to the data type to which the current target log belongs, to obtain the current target log. Finally, the connection with the system management component is disconnected. Therefore, the log is no longer directly written into the file or the database, but is written into the specified area of the system management component through configuration, and is parsed subsequently, so that the occupation of too many resources and the influence on the processing efficiency of the transaction can be avoided when the transaction volume increases.

[0101] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible architectural, functional, and operational scenarios of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment, or a part of code that includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than those noted in the accompanying drawings. For example, two blocks that are shown in succession can actually be executed in parallel, and they can also be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and the combination of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0102] Although the operations are depicted in a particular order, this should not be understood as requiring the operations to be performed in the particular order shown or in a sequential order. In certain circumstances, multitasking and parallel processing can be advantageous.

[0103] Another embodiment of the present application provides a log real-time acquisition device, as shown in the figure, comprising the following units: Figure 4

[0104] The writing unit 401 is configured to write the current target log into the pre-allocated area of the system management component in real time according to the target allocation parameter defined in advance in the operating system environment, to obtain the system management component data corresponding to the current target log.

[0105] ​The connection unit 402 is configured to connect to the system management component.

[0106] The reading unit 403 is configured to read system management component data corresponding to a current target log in a pre-allocated area of the system management component.

[0107] The format obtaining unit 404 is configured to obtain a data format corresponding to a data type to which the current target log belongs, according to the data type to which the current target log belongs.

[0108] The first parsing unit 405 is configured to parse the system management component data corresponding to the current target log according to the data format corresponding to the data type to which the current target log belongs, to obtain the current target log.

[0109] The disconnection unit 406 is configured to disconnect the connection with the system management component.

[0110] Optionally, the log real-time obtaining apparatus provided in another embodiment of the present application can further include:

[0111] The first defining unit is configured to, in response to a parameter configuration operation of a user, define a target allocation parameter in an operating system environment, and allocate a pre-allocated area in a memory.

[0112] The pre-allocated area is configured to store system management component data of a specified type.

[0113] The second defining unit is configured to, in response to a control table configuration operation of a user, generate a monitoring control table instance of the system management component in a user information control system.

[0114] Optionally, in the log real-time obtaining apparatus, the writing unit includes:

[0115] The writing sub-unit is configured to, when the current target log is monitored, if a data type to which the current target log belongs is any one of data types defined in the target allocation parameter, invoke a monitoring program calling interface of the user information control system, and write the current target log into the monitoring control table in the pre-allocated area.

[0116] Optionally, in the log real-time obtaining apparatus provided in another embodiment of the present application, the format obtaining unit includes:

[0117] The judging unit is configured to judge whether it is the first time to parse a log of the data type to which the current target log belongs.

[0118] The file generating unit is configured to, when it is judged that it is the first time to parse the log of the data type to which the current target log belongs, generate a system management component data header file corresponding to the data type to which the current target log belongs.

[0119] The second analysis unit is configured to analyze the system management component data header file corresponding to the data type to which the current target log belongs based on the result information of the system management component data header file corresponding to the data type to which the current target log belongs, and obtain the data format corresponding to the data type to which the current target log belongs.

[0120] The query unit is configured to query the data format corresponding to the data type to which the current target log belongs when it is determined that the log of the data type to which the current target log belongs is not parsed for the first time.

[0121] Optionally, the log real-time acquisition device provided in another embodiment of the present application further includes:

[0122] The storage unit is configured to save the current target log locally and / or send the current target log to the information management system for storage.

[0123] The log real-time acquisition device provided in the embodiment of the present application is configured to write the current target log into the pre-allocated area of the system management component according to the target allocation parameter defined in the operating system environment in real time, and obtain the system management component data corresponding to the current target log. Then, the connection unit is connected to the system management component, and the reading unit reads the system management component data corresponding to the current target log in the pre-allocated area of the system management component. Then, the format acquisition unit acquires the data format corresponding to the data type to which the current target log belongs according to the data type to which the current target log belongs, and the first analysis unit analyzes the system management component data corresponding to the current target log according to the data format corresponding to the data type to which the current target log belongs, and obtains the current target log. Finally, the disconnection unit disconnects the connection with the system management component. Thus, the log is not directly written into the file or the database, but is written into the specified area of the system management component through configuration, and is parsed subsequently, so that the occupation of excessive resources and the influence on the processing efficiency of transactions can be avoided when the transaction volume is increased.

[0124] It should be noted that the specific working processes of the various units provided in the above embodiments of the present application can be correspondingly referred to the implementation processes of the corresponding steps in the above method embodiments, which will not be described herein again.

[0125] Another embodiment of the present application provides an electronic device, as shown in the figure, including: Figure 5 as shown in the figure, including:

[0126] The memory 501 and the processor 502.

[0127] The memory 501 is configured to store a program.

[0128] The processor 502 is configured to execute the program stored in the memory 501, and specifically configured to implement the log real-time acquisition method provided by any one of the above embodiments.

[0129] Another embodiment of the present application provides a computer storage medium for storing a computer program, which, when executed, implements the log real-time acquisition method provided by any one of the above embodiments.

[0130] The computer storage medium includes permanent and non-permanent, removable and non-removable media, which can be realized by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer readable media does not include transitory computer readable media, such as modulated data signals and carriers.

[0131] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in a general manner. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0132] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A log real-time acquisition method, characterized by, The method comprises the following steps: real-time according to the target allocation parameters defined in advance in the operating system environment, calling the monitoring program calling interface of the user information control system, writing the current target log into the monitoring control table in the pre-allocated area of the system management component, obtaining the system management component data corresponding to the current target log; wherein the current target log is a transaction log; the pre-allocated area is a memory area allocated in the system management component according to the target allocation parameters; the target allocation parameters are INMEM parameters; connecting to the location in the system management component that stores the system management component data corresponding to the current target log; reading the system management component data corresponding to the current target log in the pre-allocated area of the system management component; according to the data type to which the current target log belongs, obtaining the data format corresponding to the data type to which the current target log belongs; according to the data format corresponding to the data type to which the current target log belongs, parsing the system management component data corresponding to the current target log, and obtaining the current target log; disconnecting the connection with the system management component.

2. The method of claim 1, wherein, The method further comprises the following steps before the real-time according to the target allocation parameters defined in advance in the operating system environment, calling the monitoring program calling interface of the user information control system, writing the current target log into the pre-allocated area of the system management component, and obtaining the system management component data corresponding to the current target log: in response to the parameter configuration operation of the user, defining the target allocation parameters in the operating system environment, and allocating a block of the pre-allocated area in the memory; wherein the pre-allocated area is used to store system management component data of a specified type; in response to the control table configuration operation of the user, generating the monitoring control table instance of the system management component in the user information control system.

3. The method of claim 2, wherein, The method further comprises the following steps before the real-time according to the target allocation parameters defined in advance in the operating system environment, calling the monitoring program calling interface of the user information control system, writing the current target log into the pre-allocated area of the system management component, and obtaining the system management component data corresponding to the current target log: when the current target log is currently monitored, if the data type to which the current target log belongs is any one of the data types defined in the target allocation parameters, the monitoring program calling interface of the user information control system is called, and the current target log is written into the monitoring control table in the pre-allocated area.

4. The method of claim 1, wherein, The method further comprises the following steps before the real-time according to the target allocation parameters defined in advance in the operating system environment, calling the monitoring program calling interface of the user information control system, writing the current target log into the pre-allocated area of the system management component, and obtaining the system management component data corresponding to the current target log: determining whether it is the first time to parse the log of the data type to which the current target log belongs; if it is determined that it is the first time to parse the log of the data type to which the current target log belongs, generating the system management component data header file corresponding to the data type to which the current target log belongs. According to result information of the system management component data header file corresponding to the data type to which the current target log belongs, the system management component data header file corresponding to the data type to which the current target log belongs is parsed to obtain a data format corresponding to the data type to which the current target log belongs. If it is judged that the log of the data type to which the current target log belongs is not parsed for the first time, the data format corresponding to the data type to which the current target log belongs is queried.

5. The method of claim 1, wherein, After the system management component data corresponding to the current target log is parsed according to the data format corresponding to the data type to which the current target log belongs, the current target log, the method further comprises: The current target log is saved locally and / or sent to an information management system for storage.

6. A log real-time acquisition apparatus characterized by comprising: Comprise: The writing unit is configured to write the current target log into a monitoring control table in a pre-allocated area of a system management component in real time according to a target allocation parameter defined in advance in an operating system environment, by calling a monitoring program calling interface of a user information control system, to obtain system management component data corresponding to the current target log; wherein the current target log is a transaction log; the pre-allocated area is a memory area allocated in the system management component according to the target allocation parameter; and the target allocation parameter is an INMEM parameter. The connecting unit is configured to connect to a location in the system management component where the system management component data corresponding to the current target log is stored. The reading unit is configured to read the system management component data corresponding to the current target log in the pre-allocated area of the system management component. The format obtaining unit is configured to obtain a data format corresponding to the data type to which the current target log belongs, according to the data type to which the current target log belongs. The first parsing unit is configured to parse the system management component data corresponding to the current target log according to the data format corresponding to the data type to which the current target log belongs, to obtain the current target log. The disconnecting unit is configured to disconnect the connection with the system management component.

7. The apparatus of claim 6, wherein, Further comprise: The first defining unit is configured to define the target allocation parameter in the operating system environment in response to a parameter configuration operation of a user, and allocate a block of the pre-allocated area in the memory; wherein the pre-allocated area is used to store system management component data of a specified type. The second defining unit is configured to generate a monitoring control table instance of the system management component in the user information control system in response to a control table configuration operation of the user.

8. The apparatus of claim 6, wherein, The format obtaining unit comprises: The judging unit is configured to judge whether it is the first time to parse the log of the data type to which the current target log belongs. The file generating unit is configured to generate a system management component data header file corresponding to the data type to which the current target log belongs, when it is judged that it is the first time to parse the log of the data type to which the current target log belongs. A second analysis unit is configured to analyze the system management component data header file corresponding to the data type to which the current target log belongs based on the result information of the system management component data header file corresponding to the data type to which the current target log belongs, and obtain a data format corresponding to the data type to which the current target log belongs. A query unit is configured to query the data format corresponding to the data type to which the current target log belongs when it is determined that the log of the data type to which the current target log belongs is not parsed for the first time.

9. An electronic device, comprising: Comprise: A memory and a processor; The memory is configured to store a program; The processor is configured to execute the program, and the program is configured to implement the log real-time acquisition method in any one of claims 1 to 5 when executed.

10. A computer storage medium, characterized in that, A computer program is stored, and the computer program is configured to implement the log real-time acquisition method in any one of claims 1 to 5 when executed.

Citation Information

Patent Citations

  • Method and device for parsing system log

    CN101286891A

  • Resource monitoring method and device for large machine, storage medium and equipment

    CN110908870A