CN117785536A - Log analysis method and device, storage medium and computer equipment - Google Patents

Log analysis method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN117785536A
CN117785536A CN202311841105.5A CN202311841105A CN117785536A CN 117785536 A CN117785536 A CN 117785536A CN 202311841105 A CN202311841105 A CN 202311841105A CN 117785536 A CN117785536 A CN 117785536A
Authority
CN
China
Prior art keywords
log
record
target
interface
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311841105.5A
Other languages
Chinese (zh)
Inventor
欧阳德鸿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vipshop Guangzhou Software Co Ltd
Original Assignee
Vipshop Guangzhou Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vipshop Guangzhou Software Co Ltd filed Critical Vipshop Guangzhou Software Co Ltd
Priority to CN202311841105.5A priority Critical patent/CN117785536A/en
Publication of CN117785536A publication Critical patent/CN117785536A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application provides a log analysis method, a log analysis device, a storage medium and computer equipment, wherein the method comprises the following steps: when the generation of the abnormal log record is detected, the tracking identification in the abnormal log record is acquired. Determining the log record corresponding to the tracking identification, and determining the determined set of log records as a log record set; and determining the interface information as a target record so as to determine corresponding interface information. And acquiring request parameters corresponding to the target record, and determining a target prompt. And inputting the request parameters, the interface information and the target prompt into the language model to obtain a log analysis result. By setting the tracking identifier for the log generated by the interface related to the same interaction action to determine the log record related to the interaction action, the information of the entry interface of the interaction action is determined according to the occurrence time, the interface information corresponding to the abnormal log record can be tracked quickly, and the occurrence reason of the abnormal log record is determined. And the efficiency of the analysis of the abnormal log is improved.

Description

Log analysis method and device, storage medium and computer equipment
Technical Field
The present disclosure relates to the field of software testing technologies, and in particular, to a log analysis method, a log analysis device, a storage medium, and a computer device.
Background
A log is an important source of information that records the state of an application or system at run-time. By analyzing the log, the running condition of the system can be known, the performance index is monitored, and potential problems and abnormal behaviors are found. However, with the development of the internet, modern systems are becoming more and more complex and bulky. The large-scale system generates huge amounts of logs, and the formats and structures of the logs are also various, so that manual analysis and inspection of the logs become very difficult.
Currently, in order to process and manage logs more efficiently, an automated log management tool may be used, but it is still necessary to manually check the abnormal log and manually analyze the cause of the abnormal log, resulting in a lower analysis efficiency of the abnormal log.
Disclosure of Invention
The present application aims to solve at least one of the above technical drawbacks, and particularly, the prior art uses an automated log management tool, but still needs to manually check an exception log and manually analyze the cause of the exception log, which results in a technical defect that the analysis efficiency of the exception log is low.
In a first aspect, the present application provides a log analysis method, the method including:
when the generation of the abnormal log record is detected, acquiring a tracking identifier in the abnormal log record;
according to the tracking identification, searching a log record corresponding to the tracking identification in a preset log database, and determining the searched set of log records as a log record set;
acquiring the occurrence time of each record in the log record set, and determining the record with the earliest occurrence time in the log record set as a target record;
determining corresponding interface information according to the target record, and acquiring request parameters corresponding to the target record;
determining a target prompt;
and inputting the request parameters, the interface information and the target prompt into a preset language model to obtain a log analysis result.
In one embodiment, the inputting the request parameter, the interface information and the target prompt into a preset language model to obtain a log analysis result includes:
determining a target interface corresponding to the interface information;
according to the request parameters, performing simulation call on the target interface to determine the abnormal position of the abnormal log record;
acquiring source codes of the target interfaces and the corresponding dependent interfaces;
determining context information corresponding to the abnormal position in source codes of the target interface and the corresponding dependent interfaces;
and carrying out analysis operation matched with the target prompt language on the source codes of the target interface and the corresponding dependent interfaces and the context information to obtain a log analysis result.
In one embodiment, the training process of the language model includes:
determining an initial model;
acquiring abnormal log data and corresponding log analysis data thereof;
and taking the abnormal log data as a training data set and the log analysis data as a verification data set to perform iterative training on the initial model, and determining the latest initial model as the language model until the initial model meets the preset condition.
In one embodiment, the determining the target prompt includes:
acquiring all prompt messages from a preset database, and generating a prompt message file according to the acquired prompt messages;
the prompt message file is sent to a client so that the client can display a list of the prompt message file;
and receiving response data of the client, and determining a target prompt corresponding to the response data in the prompt file according to the response data.
In one embodiment, the determining, according to the target record, corresponding interface information includes:
acquiring a preset mapping table;
searching interface information corresponding to the target record in the mapping table to obtain the interface information corresponding to the target record; wherein the interface information includes an interface name, an interface address, and a request parameter type.
In one embodiment, the method further comprises:
and responding to the visualization instruction, and sending the log analysis result to a client so that the client can perform visualization display on the log analysis result.
In a second aspect, the present application provides a log analysis device, the device comprising:
the identification acquisition module is used for acquiring tracking identification in the abnormal log record when the abnormal log record is detected to be generated;
the record set determining module is used for searching the log record corresponding to the tracking identifier in a preset log database according to the tracking identifier, and determining the searched set of the log record as a log record set;
the target record determining module is used for acquiring the occurrence time of each record in the log record set and determining the record with the earliest occurrence time in the log record set as a target record;
the parameter acquisition module is used for determining corresponding interface information according to the target record and acquiring a request parameter corresponding to the target record;
the prompt determination module is used for determining a target prompt;
and the log analysis module is used for inputting the request parameters, the interface information and the target prompt into a preset language model to obtain a log analysis result.
In one embodiment, the log analysis module includes:
a request generation sub-module, configured to determine a target interface corresponding to the interface information;
the position determining submodule is used for carrying out simulation call on the target interface according to the request parameters so as to determine the abnormal position of the abnormal log record;
the data acquisition sub-module is used for acquiring source codes of the target interface and the corresponding dependent interfaces;
the information determination submodule is used for determining context information corresponding to the abnormal position in the source codes of the target interface and the corresponding dependent interfaces;
and the log analysis sub-module is used for carrying out analysis operation matched with the target prompt language on the source codes of the target interface and the corresponding dependent interfaces and the context information to obtain a log analysis result.
In a third aspect, the present application provides a storage medium having stored therein computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the log analysis method as set forth in any one of the embodiments above.
In a fourth aspect, the present application provides a computer device comprising: one or more processors, and memory;
the memory has stored therein computer readable instructions which, when executed by the one or more processors, perform the steps of the log analysis method as described in any of the embodiments above.
From the above technical solutions, the embodiments of the present application have the following advantages:
the application provides a log analysis method, a log analysis device, a storage medium and computer equipment, wherein the method comprises the following steps: when the generation of the abnormal log record is detected, the tracking identification in the abnormal log record is acquired. Further, according to the tracking identification, determining a log record corresponding to the tracking identification in a preset log database, and determining a set of the determined log records as a log record set; and acquiring the occurrence time of each record in the log record set, and determining the record with the earliest occurrence time in the log record set as a target record so as to determine corresponding interface information. And acquiring request parameters corresponding to the target record, and determining a target prompt. And inputting the request parameters, the interface information and the target prompt into a preset language model to obtain a log analysis result. By setting the tracking identifier for the log generated by the interface related to the same interaction action, further determining the log record related to the interaction action according to the tracking identifier, and determining the information of the entry interface of the interaction action, namely the interface information according to the occurrence time, the interface information corresponding to the abnormal log record can be tracked quickly, and further the target interface corresponding to the interface information is analyzed by using the trained language model, so that the occurrence reason of the abnormal log record is determined. Therefore, labor cost is reduced, and the analysis efficiency of the abnormal log records is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive faculty for a person skilled in the art.
Fig. 1 is a schematic flow chart of a log analysis method according to an embodiment of the present application;
FIG. 2 is a flow chart of a log analysis result obtained by inputting request parameters, interface information and target prompt into a preset language model according to the embodiment of the present application;
fig. 3 is a schematic structural diagram of a log analysis device according to an embodiment of the present application;
fig. 4 is an internal structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In one embodiment, the present application provides a log analysis method, and the following embodiment describes the method applied to a server. It is understood that the log analysis method may be a single server or a server cluster composed of a plurality of servers, which is not particularly limited in this application.
As shown in fig. 1, the present application provides a log analysis method, which includes:
step S101: when the generation of the abnormal log record is detected, the tracking identification in the abnormal log record is acquired.
In this step, when the log of a system needs to be analyzed, the server can monitor the log generated by the running system, and when the server monitors the abnormal log record, the server obtains the tracking identifier in the abnormal log record.
Each log record includes a corresponding tracking identifier. The trace identification may be used to identify log records generated in the interface to which the same interaction relates. It will be appreciated that the same interaction refers to a functional module in the system, and may be manually divided.
Still further, the server monitoring the exception log record may include: and acquiring the log level and the log type in the log record of the system in real time, sequentially matching the acquired log level and the log type of the log record with a preset rule table, and determining the log record as an abnormal log record if records matched with the log level and the log type of the log record exist in the rule table. Wherein the rule table can be set manually and can be modified and adjusted.
Step S102: according to the tracking identification, searching the log records corresponding to the tracking identification in a preset log database, and determining the searched set of the log records as a log record set.
In this step, according to the trace identifier in the abnormal log record, the log record matching with the trace identifier can be searched in the log database, and then the searched set of log records is determined as the log record set.
It will be appreciated that as the service is generating log records, the server will store the generated log records in the log database in real time. Thus, the log record generated before the current time can be found in the log database.
For example, assuming that the trace identifier of the abnormal log record a is 1, and that the trace identifiers of the abnormal log record a, the log record B, the log record C and the log record D are 1, 2 and 1 in the log database, and at this time, the trace identifiers of the log record B and the log record D are consistent with the trace identifier of the abnormal log record a, the set of the abnormal log record a, the log record B and the log record D is determined as the log record set.
Step S103: the occurrence time of each record in the log record set is acquired, and the record with the earliest occurrence time in the log record set is determined as the target record.
It will be appreciated that as each log record is saved or recorded, the time at which it was generated, i.e., the time of occurrence, will be saved or recorded. And the record with the earliest occurrence time in the log record set can be determined as a target record, the target record can be understood as a first log record generated by the system in the interaction, and the information of the entrance interface for performing the simulation call, namely the interface information, can be determined according to the first log record.
Step S104: and determining corresponding interface information according to the target record, and acquiring request parameters corresponding to the target record.
The request parameters refer to the specification and description of parameters required to be transferred to the interface when the interface is used for data interaction.
In this step, according to the target record, the information of the interface corresponding to the target record, that is, the interface information, can be found. And further acquiring the request parameters of the interface so as to be capable of performing simulated call on the target interface corresponding to the interface information to analyze the abnormal log record.
Step S105: and determining a target prompt.
Where prompt (prompt) refers to input text that is used to help the model better understand the intent of the input.
In this step, the target prompt may be determined according to factors in terms of the target of analysis or the needs of the tester, etc.
Step S106: and inputting the request parameters, the interface information and the target prompt into a preset language model to obtain a log analysis result.
In this step, after obtaining the request parameter, the interface information and the target prompt, the request parameter, the interface information and the target prompt are input into the language model to obtain the log analysis result.
It can be understood that the language model can be obtained by training based on a pre-trained language model, and is used for receiving the prompt, the interface information and the request parameters corresponding to the interface information, performing simulation call on the interface corresponding to the interface information by using the request parameters according to the interface information, and analyzing the interface according to the prompt so as to output an analysis result.
The application provides a log analysis method, a log analysis device, a storage medium and computer equipment, wherein the method comprises the following steps: when the generation of the abnormal log record is detected, the tracking identification in the abnormal log record is acquired. Further, according to the tracking identification, determining a log record corresponding to the tracking identification in a preset log database, and determining a set of the determined log records as a log record set; and acquiring the occurrence time of each record in the log record set, and determining the record with the earliest occurrence time in the log record set as a target record so as to determine corresponding interface information. And acquiring request parameters corresponding to the target record, and determining a target prompt. And inputting the request parameters, the interface information and the target prompt into a preset language model to obtain a log analysis result. By setting the tracking identifier for the log generated by the interface related to the same interaction action, further determining the log record related to the interaction action according to the tracking identifier, and determining the information of the entry interface of the interaction action, namely the interface information according to the occurrence time, the interface information corresponding to the abnormal log record can be tracked quickly, and further the target interface corresponding to the interface information is analyzed by using the trained language model, so that the occurrence reason of the abnormal log record is determined. Therefore, labor cost is reduced, and the analysis efficiency of the abnormal log records is improved.
As shown in fig. 2, in one embodiment, the method includes inputting request parameters, interface information and target prompt into a preset language model to obtain log analysis results, including:
step S201: and determining a target interface corresponding to the interface information.
Wherein the interface information includes an interface name, an interface domain name, an interface address, and the like.
In this step, according to the interface domain name, the interface address, and the interface name in the interface information, the target interface corresponding to each of the interface domain name, the interface address, and the interface name may be determined.
Step S202: and according to the request parameters, performing simulated call on the target interface to determine the abnormal position of the abnormal log record.
It will be appreciated that the language model may make simulated calls to the target interface based on the request parameters to determine the location of the anomalies of the emerging anomaly log records. The abnormal position refers to a code position where an abnormal log record is generated.
Further, the database used when the target interface is subjected to the simulation call is different from the database used when the system is operated, and the database used when the target interface is subjected to the simulation call is copied based on the database used when the system is operated. Therefore, when the target interface is subjected to analog call, the database used during the system operation is not changed, namely the real operation is not performed, and the pollution to the database used during the system operation is avoided.
Step S203: and acquiring the source codes of the target interface and the corresponding dependent interfaces thereof.
Where other interfaces or services need to be invoked when a certain interface is implemented, these other interfaces or services that need to be invoked may be referred to as dependent interfaces. For example, when the interface a is called, the interface B is found to be required to be called in the interface a, and the interface C is required to be called in the interface B, and at this time, the interface B and the interface C may be determined as dependent interfaces of the interface a.
In this step, the dependent interface corresponding to the target interface can be searched according to the target interface, so as to obtain the source codes of the target interface and the dependent interface corresponding to the target interface.
Step S204: and determining the context information corresponding to the abnormal position in the source codes of the target interface and the corresponding dependent interfaces.
Where context information refers to the environment in which the code is executing and the associated context data, the context information includes, but is not limited to, the value of a variable, a function call stack, an environment configuration, and the like.
In this step, when the source codes of the target interface and the corresponding dependent interfaces are acquired, the context information corresponding to the abnormal position of the abnormal log record is determined in the source codes of the target interface and the corresponding dependent interfaces.
Step S205: and carrying out analysis operation matched with the target prompt language on the source codes and the context information of the target interface and the corresponding dependent interfaces to obtain a log analysis result.
It can be understood that the language model can understand and analyze the logic and the context information of the source codes of the target interface and the corresponding dependent interfaces, so as to obtain the log analysis result. Therefore, the target interface corresponding to the abnormal log record can be tracked rapidly, and further the trained language model is utilized to analyze the target interface so as to determine the occurrence reason of the abnormal log record. Therefore, labor cost is reduced, and the analysis efficiency of the abnormal log records is improved.
In one embodiment, the training process of the language model comprises:
determining an initial model;
acquiring abnormal log data and corresponding log analysis data thereof;
and taking the abnormal log data as a training data set and taking the log analysis data as a verification data set to carry out iterative training on the initial model, and determining the latest initial model as a language model when the initial model meets preset conditions.
Wherein the initial model refers to a pre-trained neural network model. The abnormal log data comprises a plurality of historical abnormal log records, and the log analysis data comprises analysis data corresponding to each log record in the abnormal log data.
In this embodiment, the initial model, the training data set and the verification data set are determined to perform iterative training to obtain a language model, so that the language model can be used for understanding and analyzing the abnormal log records, thereby assisting research personnel in determining the cause of the abnormality and improving the efficiency of log analysis.
It may be understood that the preset condition may be set such that the number of iterations of the initial model reaches a first preset threshold, and may also be set such that an absolute value of a difference between each parameter of the initial model in the current iteration round and a corresponding parameter of the initial model in the previous iteration round is smaller than a second preset threshold corresponding to the parameter. This is not particularly limited in this application.
In one embodiment, determining the target cue comprises:
acquiring all prompt messages from a preset database, and generating a prompt message file according to the acquired prompt messages;
the method comprises the steps of sending a prompt file to a client so that the client performs list display on the prompt file;
and receiving response data of the client, and determining a target prompt corresponding to the response data in the prompt file according to the response data.
The database is used for storing the prompt, when a developer adds the prompt, the developer can input the added prompt through the client, and the client acquires the prompt and sends the prompt to the server. After receiving the prompt, the server stores the prompt in a database.
In this embodiment, according to the prompt in the database, a corresponding prompt file is generated, and the prompt file is sent to the client, so that the user searches and selects the prompt in the prompt file, and when the user determines the required prompt, the client returns the selection information of the user as response data to the server. When the server receives the response data of the client, the selection information in the response data is obtained, and a target prompt corresponding to the selection information in the response data is determined in the prompt file according to the selection information in the response data.
It can be understood that the user can directly select the required prompt at the client, and further the server performs analysis operation corresponding to the prompt selected by the user on the abnormal log record, so that the log analysis efficiency can be further improved.
In one embodiment, determining corresponding interface information according to the target record includes:
acquiring a preset mapping table;
searching interface information corresponding to the target record in the mapping table to determine the interface information corresponding to the target record; the interface information comprises an interface name, an interface address and a request parameter type.
The mapping table can be generated according to the corresponding source code and can be used for representing the mapping relation between the log record and the interface information.
In this embodiment, the interface information corresponding to the target record can be determined by the mapping table. In one embodiment, the code may also be directly read to determine the information of the interface corresponding to the code that generated the target record, i.e., interface information.
In one embodiment, the log analysis method further comprises:
and responding to the visualization instruction, and sending the log analysis result to the client so that the client can perform visualization display on the log analysis result.
The log analysis result includes an abnormality cause generated by the abnormality log record, a modification suggestion for the abnormality log record, and the like.
It can be understood that the log analysis result is sent to the client, and when the client receives the log analysis result, the log analysis result can be visually displayed, so that a developer can intuitively know the analysis result of the abnormal log record, and the efficiency of finding and solving the problem by the developer is improved.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
The log analysis device provided in the embodiments of the present application will be described below, and the log analysis device described below and the log analysis method described above may be referred to correspondingly to each other.
As shown in fig. 3, the present application provides a log analysis device 300, which includes:
the identifier obtaining module 301 is configured to obtain a tracking identifier in the abnormal log record when the abnormal log record is detected to be generated;
the record set determining module 302 is configured to search, according to the tracking identifier, a log record corresponding to the tracking identifier in a preset log database, and determine a set of the searched log records as a log record set;
a target record determining module 303, configured to obtain an occurrence time of each record in the log record set, and determine a record with an earliest occurrence time in the log record set as a target record;
the parameter obtaining module 304 is configured to determine corresponding interface information according to the target record, and obtain a request parameter corresponding to the target record;
a prompt determination module 305, configured to determine a target prompt;
the log analysis module 306 is configured to input the request parameter, the interface information, and the target prompt into a preset language model, so as to obtain a log analysis result.
In one embodiment, the log analysis module includes:
the request generation sub-module is used for determining a target interface corresponding to the interface information;
the position determining sub-module is used for performing simulation call on the target interface according to the request parameters so as to determine the abnormal position of the abnormal log record;
the data acquisition sub-module is used for acquiring the source codes of the target interface and the corresponding dependent interfaces;
the information determination submodule is used for determining context information corresponding to the abnormal position in source codes of the target interface and the corresponding dependent interfaces;
and the log analysis sub-module is used for carrying out analysis operation matched with the target prompt language on the source codes and the context information of the target interface and the corresponding dependent interfaces to obtain a log analysis result.
In one embodiment, the log analysis module includes:
the model determining submodule is used for determining an initial model;
the analysis data acquisition sub-module is used for acquiring abnormal log data and log analysis data corresponding to the abnormal log data;
the iterative training sub-module is used for taking the abnormal log data as a training data set and taking the log analysis data as a verification data set so as to carry out iterative training on the initial model, and determining the latest initial model as a language model when the initial model meets the preset condition.
In one embodiment, the prompt determination module includes:
the file generation sub-module is used for acquiring all prompt languages in a preset database and generating a prompt language file according to the acquired prompt languages;
the file sending sub-module is used for sending the prompt language file to the client so that the client can display the list of the prompt language file;
and the prompt determination submodule is used for receiving the response data of the client and determining a target prompt corresponding to the response data in the prompt file according to the response data.
In one embodiment, the parameter acquisition module includes:
the mapping table acquisition sub-module is used for acquiring a preset mapping table;
the interface information searching sub-module is used for searching the interface information corresponding to the target record in the mapping table to obtain the interface information corresponding to the target record; the interface information comprises an interface name, an interface address and a request parameter type.
In one embodiment, the log analysis device further includes:
and the visualization module is used for responding to the visualization instruction and sending the log analysis result to the client so that the client can perform visualization display on the log analysis result.
The division of the modules in the log analysis device is merely for illustration, and in other embodiments, the log analysis device may be divided into different modules as needed to perform all or part of the functions of the log analysis device. The respective modules in the log analysis device described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, the present application also provides a storage medium having stored therein computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the log analysis method as set forth in any one of the above embodiments.
In one embodiment, the present application also provides a computer device having stored therein computer readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the log analysis method as set forth in any of the above embodiments.
Schematically, as shown in fig. 4, fig. 4 is a schematic internal structure of a computer device provided in an embodiment of the present application, and the computer device 400 may be provided as a server. Referring to FIG. 4, computer device 400 includes a processing component 402 that further includes one or more processors, and memory resources represented by memory 401, for storing instructions, such as application programs, executable by processing component 402. The application program stored in the memory 401 may include one or more modules each corresponding to a set of instructions. Further, the processing component 402 is configured to execute instructions to perform the log analysis method of any of the embodiments described above.
The computer device 400 may also include a power component 403 configured to perform power management of the computer device 400, a wired or wireless network interface 404 configured to connect the computer device 400 to a network, and an input output (I/O) interface 405. The computer device 400 may operate based on an operating system stored in memory 401, such as Windows Server TM, mac OS XTM, unix TM, linux TM, free BSDTM, or the like.
Those skilled in the art will appreciate that the structures shown in FIG. 4 are block diagrams only and do not constitute a limitation of the computer device on which the present aspects apply, and that a particular computer device may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises/comprising," "includes," and/or "having," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, components, or groups thereof, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or groups thereof, and include any and all combinations of the listed items.
In the present specification, each embodiment is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and may be combined according to needs, and the same similar parts may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of log analysis, the method comprising:
when the generation of the abnormal log record is detected, acquiring a tracking identifier in the abnormal log record;
according to the tracking identification, searching a log record corresponding to the tracking identification in a preset log database, and determining the searched set of log records as a log record set;
acquiring the occurrence time of each record in the log record set, and determining the record with the earliest occurrence time in the log record set as a target record;
determining corresponding interface information according to the target record, and acquiring request parameters corresponding to the target record;
determining a target prompt;
and inputting the request parameters, the interface information and the target prompt into a preset language model to obtain a log analysis result.
2. The method of claim 1, wherein the inputting the request parameter, the interface information, and the target prompt into a predetermined language model to obtain a log analysis result includes:
determining a target interface corresponding to the interface information;
according to the request parameters, performing simulation call on the target interface to determine the abnormal position of the abnormal log record;
acquiring source codes of the target interfaces and the corresponding dependent interfaces;
determining context information corresponding to the abnormal position in source codes of the target interface and the corresponding dependent interfaces;
and carrying out analysis operation matched with the target prompt language on the source codes of the target interface and the corresponding dependent interfaces and the context information to obtain a log analysis result.
3. The log analysis method according to claim 1 or 2, wherein the training process of the language model comprises:
determining an initial model;
acquiring abnormal log data and corresponding log analysis data thereof;
and taking the abnormal log data as a training data set and the log analysis data as a verification data set to perform iterative training on the initial model, and determining the latest initial model as the language model until the initial model meets the preset condition.
4. The log analysis method as defined in claim 1, wherein the determining the target prompt includes:
acquiring all prompt messages from a preset database, and generating a prompt message file according to the acquired prompt messages;
the prompt message file is sent to a client so that the client can display a list of the prompt message file;
and receiving response data of the client, and determining a target prompt corresponding to the response data in the prompt file according to the response data.
5. The method of claim 1, wherein determining corresponding interface information from the target record includes:
acquiring a preset mapping table;
searching interface information corresponding to the target record in the mapping table to obtain the interface information corresponding to the target record; wherein the interface information includes an interface name, an interface address, and a request parameter type.
6. The log analysis method of claim 1, wherein the method further comprises:
and responding to the visualization instruction, and sending the log analysis result to a client so that the client can perform visualization display on the log analysis result.
7. A log analysis device, the device comprising:
the identification acquisition module is used for acquiring tracking identification in the abnormal log record when the abnormal log record is detected to be generated;
the record set determining module is used for searching the log record corresponding to the tracking identifier in a preset log database according to the tracking identifier, and determining the searched set of the log record as a log record set;
the target record determining module is used for acquiring the occurrence time of each record in the log record set and determining the record with the earliest occurrence time in the log record set as a target record;
the parameter acquisition module is used for determining corresponding interface information according to the target record and acquiring a request parameter corresponding to the target record;
the prompt determination module is used for determining a target prompt;
and the log analysis module is used for inputting the request parameters, the interface information and the target prompt into a preset language model to obtain a log analysis result.
8. The log analysis method of claim 1, wherein the log analysis module comprises:
a request generation sub-module, configured to determine a target interface corresponding to the interface information;
the position determining submodule is used for carrying out simulation call on the target interface according to the request parameters so as to determine the abnormal position of the abnormal log record;
the data acquisition sub-module is used for acquiring source codes of the target interface and the corresponding dependent interfaces;
the information determination submodule is used for determining context information corresponding to the abnormal position in the source codes of the target interface and the corresponding dependent interfaces;
and the log analysis sub-module is used for carrying out analysis operation matched with the target prompt language on the source codes of the target interface and the corresponding dependent interfaces and the context information to obtain a log analysis result.
9. A storage medium, characterized by: the storage medium having stored therein computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the log analysis method of any of claims 1 to 6.
10. A computer device, comprising: one or more processors, and memory;
stored in the memory are computer readable instructions which, when executed by the one or more processors, perform the steps of the log analysis method of any one of claims 1 to 6.
CN202311841105.5A 2023-12-28 2023-12-28 Log analysis method and device, storage medium and computer equipment Pending CN117785536A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311841105.5A CN117785536A (en) 2023-12-28 2023-12-28 Log analysis method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311841105.5A CN117785536A (en) 2023-12-28 2023-12-28 Log analysis method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN117785536A true CN117785536A (en) 2024-03-29

Family

ID=90390602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311841105.5A Pending CN117785536A (en) 2023-12-28 2023-12-28 Log analysis method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN117785536A (en)

Similar Documents

Publication Publication Date Title
CN109376166B (en) Script conversion method, script conversion device, computer equipment and storage medium
CN112965871A (en) Vehicle fault prompt information acquisition method and device and storage medium
Yuan et al. An approach to cloud execution failure diagnosis based on exception logs in openstack
US11809406B2 (en) Event records in a log file
CN109766261B (en) Coverage test method, coverage test device, computer equipment and storage medium
CN112783720B (en) Topology structure diagram generation method, device, computer equipment and display system
CN111190827A (en) Interface automation test method and device, storage medium and electronic equipment
CN108399125B (en) Automatic testing method and device, computer equipment and storage medium
CN110011845B (en) Log collection method and system
CN109542496B (en) Method, device and system for determining incremental code
CN110968518A (en) Analysis method and device for automatic test log file
CN117785536A (en) Log analysis method and device, storage medium and computer equipment
CN116069650A (en) Method and device for generating test cases
CN115765182A (en) Digital twinning method and device based on time sequence database
CN115225470A (en) Business abnormity monitoring method and device, electronic equipment and storage medium
CN114490413A (en) Test data preparation method and device, storage medium and electronic equipment
CN110928784B (en) Software testing environment monitoring method and device
CN114201757A (en) Confidence coefficient identification method based on software vulnerability recognition and information storage medium
CN113238967A (en) Test case generation method and device
CN113297078B (en) MOCK system and data testing method based on same
CN117608992A (en) Method, device, computer equipment and storage medium for tracking log information
Ravi et al. Unsupervised time series data analysis for error pattern extraction for predictive maintenance
CN116521274A (en) Service operation result determining method and device
CN117951000A (en) Information generation method, device, electronic equipment and storage medium
CN118034978A (en) Chaotic engineering fault exercise method, device, equipment, storage medium and product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination