[go: up one dir, main page]

CN115098378A - Method and device for classifying and aggregating log segments based on abnormal breakpoints - Google Patents

Method and device for classifying and aggregating log segments based on abnormal breakpoints Download PDF

Info

Publication number
CN115098378A
CN115098378A CN202210743227.XA CN202210743227A CN115098378A CN 115098378 A CN115098378 A CN 115098378A CN 202210743227 A CN202210743227 A CN 202210743227A CN 115098378 A CN115098378 A CN 115098378A
Authority
CN
China
Prior art keywords
log
playback
abnormal
information
segments
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
CN202210743227.XA
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202210743227.XA priority Critical patent/CN115098378A/en
Publication of CN115098378A publication Critical patent/CN115098378A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/362Debugging of software
    • G06F11/366Debugging of software using diagnostics
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a method for classifying and aggregating log segments based on abnormal breakpoints. The method comprises the following steps: responding to an access request of a worker to execute flow playback; monitoring the flow playback event; when a flow playback failure event is monitored, extracting playback thread information of current execution playback from a playback context acquired by the monitoring event; acquiring a preset log path, wherein the log path is used for storing logs; acquiring a log according to the preset log path; performing content matching and interception from the log according to the playback thread information to obtain a plurality of corresponding abnormal information sections; processing the plurality of abnormal information segments to obtain specific abnormal log segments; and storing the specific abnormal log segments in a memory. The positioning of workers is assisted, the problem solving is more efficient, and the working efficiency is improved.

Description

基于异常断点分类聚合日志片段的方法、装置Method and device for classifying and aggregating log segments based on abnormal breakpoints

技术领域technical field

本发明涉及计算机技术领域,尤其涉及一种基于异常断点分类聚合日志片段的方法、一种基于异常断点分类聚合日志片段的装置。The present invention relates to the field of computer technology, in particular to a method for classifying and aggregating log segments based on abnormal breakpoints, and a device for classifying and aggregating log segments based on abnormal breakpoints.

背景技术Background technique

日志在企业IT服务中常常发挥重大作用,在软件产品的开发、测试和运营阶段,所产生的日志信息都有很大的价值。很多互联网公司会通过页面埋点输出日志以获取用户操作信息来辅助运营。同时日志信息也还有其他更重要的作用,特别是在故障排查阶段,当系统运行过程中遇到不明原因的异常时,通过日志可以帮助开发和运维同事看到目前系统异常的报错情况,从而迅速找到异常完整堆栈信息,定位异常代码片段。Logs often play an important role in enterprise IT services, and the log information generated is of great value in the development, testing and operation phases of software products. Many Internet companies will output logs through page embedding to obtain user operation information to assist operations. At the same time, the log information also has other more important functions, especially in the troubleshooting stage, when the system encounters an unexplained abnormality during the operation process, the log can help the development and operation and maintenance colleagues to see the current system abnormal error report. In this way, the complete stack information of the exception can be quickly found, and the abnormal code fragment can be located.

通常,应用的日志文件通常都记录在部署应用的服务器的某个特定目录中,当我们查询日志时需要登录服务器找到相关日志文件进行查询,并且想要做到精确查询还要掌握相关的vi操作shell脚本。如果应用部署的是生产环境,还要申请服务器权限经过层层审批,即使应用对接了其他日志收集工具,如ELK、FLUME等,虽然可以通过访问可视化界面进行查询,但是从日志的实时性和异常定位准确性来考虑,很难及时和精确定位到发生异常的信息。所以当发生异常时,这些因素都不利于我们通过日志快速定位问题,从而影响工作效率。Usually, the log files of the application are usually recorded in a specific directory of the server where the application is deployed. When we query the log, we need to log in to the server to find the relevant log files for query, and we also need to master the relevant vi operations for accurate query. shell script. If the application is deployed in a production environment, it is necessary to apply for server permissions and go through layers of approval. Even if the application is connected to other log collection tools, such as ELK, FLUME, etc., although it can be queried by accessing the visual interface, the real-time and abnormality of the log Considering the positioning accuracy, it is difficult to locate the abnormal information in time and accurately. Therefore, when an exception occurs, these factors are not conducive to us quickly locating the problem through the log, thereby affecting work efficiency.

发明内容SUMMARY OF THE INVENTION

本申请提供了一种基于异常断点分类聚合日志片段的方法、一种基于异常断点分类聚合日志片段的装置,帮助工作人员定位问题、提高了工作效率。The present application provides a method for classifying and aggregating log fragments based on abnormal breakpoints, and a device for classifying and aggregating log fragments based on abnormal breakpoints, which help staff locate problems and improve work efficiency.

第一方面,本申请实施例提供一种基于异常断点分类聚合日志片段的方法。所述基于异常断点分类聚合日志片段的方法包括:响应工作人员的访问请求执行流量回放;监听所述流量回放事件;当监听到流量回放失败事件,从所述监听事件获取的回放上下文中提取当前执行回放的回放线程信息;获取预设的日志路径,所述日志路径用于存放日志;根据所述预设日志路径获取日志;根据所述回放线程信息从所述日志中进行内容匹配和截取得到对应的若干异常信息段;对所述若干异常信息段进行处理得到各特定的异常日志片段;以及将所述各特定异常日志片段存放于存储器中。In a first aspect, an embodiment of the present application provides a method for classifying and aggregating log segments based on abnormal breakpoints. The method for classifying and aggregating log segments based on abnormal breakpoints includes: performing traffic playback in response to an access request of a staff member; monitoring the traffic playback event; Playback thread information currently performing playback; obtain a preset log path, where the log path is used to store logs; obtain logs according to the preset log path; perform content matching and interception from the log according to the playback thread information Obtaining several corresponding abnormal information segments; processing the several abnormal information segments to obtain specific abnormal log segments; and storing the specific abnormal log segments in the memory.

第二方面,本申请实施例还提供一种基于异常断点分类聚合日志片段的装置,其特征在于,所述装置中的回放主模块包括:In a second aspect, an embodiment of the present application further provides an apparatus for classifying and aggregating log segments based on abnormal breakpoints, wherein the main playback module in the apparatus includes:

回放单元,用于响应工作人员的访问请求执行流量回放;A playback unit, used to perform traffic playback in response to a worker's access request;

监听单元,用于监听所述流量回放事件并当监听到流量回放失败事件,调用所述回放比对失败事件模块;a monitoring unit, configured to monitor the traffic playback event and call the playback comparison failure event module when monitoring the traffic playback failure event;

所述回放比对失败事件模块包括:The playback comparison failure event module includes:

路径获取单元,用于获取预设的日志路径,所述日志路径用于存放日志;a path obtaining unit, configured to obtain a preset log path, where the log path is used to store logs;

日志获取单元,用于根据所述预设日志路径获取日志;a log obtaining unit, configured to obtain a log according to the preset log path;

提取单元,根据所述回放线程信息从所述日志中进行内容匹配和截取得到对应的若干异常信息段;an extraction unit, which performs content matching and interception from the log according to the playback thread information to obtain several corresponding abnormal information segments;

处理单元,用于对所述若干异常信息段进行处理得到各特定的异常日志片段;以及a processing unit, configured to process the several exception information segments to obtain each specific exception log segment; and

存储单元,用于将所述各特定异常日志片段存放于存储器中。The storage unit is configured to store the specific exception log segments in the memory.

第三方面,本申请实施例还提供了一种服务器,其特征在于,所述服务器包括:In a third aspect, an embodiment of the present application further provides a server, wherein the server includes:

存储器,用于存储计算机程序指令;memory for storing computer program instructions;

处理器,用于执行计算机程序指令以实现所述的基于异常断点分类聚合日志片段的方法。A processor for executing computer program instructions to implement the method for classifying and aggregating log segments based on exception breakpoints.

上述基于异常断点分类聚合日志片段的方法,通过执行流量回放操作,获取操作过程中生成的日志数据、异常信息、程序的回放线程、错误堆栈等数据信息。根据源程序和所述生成的若干信息获取日志中异常的信息片段,并将所述日志片段进行截取、聚合等处理生成处理后的异常片段,将所述处理后的异常片段存储在云存储器中以显示给用户,以供用户根据所述异常片段定位问题。同时,还可以对日志截取、聚合、匹配逻辑进行优化。本方案能够在异常发生时可不通过登录服务器进行日志查看,免去由于需要登录服务器而进行相关跳板机的权限审批操作。并且通过源程序代码的信息数据对原始日志进行精确匹配、聚合后,可实时存储到云存储中,用户可立即在比对失败详情页面直接点击查看。通过整理后的日志,用户可快速从日志中找到异常堆栈,帮助分析异常失败的原因从而定位问题、解决问题,提高工作效率。The above method for classifying and aggregating log segments based on exception breakpoints obtains data information such as log data, exception information, program playback threads, and error stacks generated during the operation by performing a traffic playback operation. Obtain abnormal information fragments in the log according to the source program and the generated information, and perform processing such as interception and aggregation on the log fragments to generate processed abnormal fragments, and store the processed abnormal fragments in the cloud storage. to be displayed to the user for the user to locate the problem based on the anomaly fragment. At the same time, log interception, aggregation, and matching logic can also be optimized. This solution can check the log without logging in to the server when an exception occurs, eliminating the need to log in to the server to perform permission approval operations for related springboard machines. And after the original log is accurately matched and aggregated through the information data of the source code, it can be stored in the cloud storage in real time, and the user can immediately click to view it directly on the comparison failure details page. Through the organized log, users can quickly find the exception stack from the log, help analyze the cause of abnormal failure, locate and solve problems, and improve work efficiency.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图示出的结构获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained according to the structures shown in these drawings without any creative effort.

图1为本申请实施例提供的基于异常断点分类聚合日志片段的方法流程图。FIG. 1 is a flowchart of a method for classifying and aggregating log segments based on abnormal breakpoints provided by an embodiment of the present application.

图2为本发明实施例提供的基于异常断点分类聚合日志片段的装置的结构示意图。FIG. 2 is a schematic structural diagram of an apparatus for classifying and aggregating log segments based on abnormal breakpoints according to an embodiment of the present invention.

图3为本申请实施例提供的基于异常断点分类聚合日志片段的方法另一流程图。FIG. 3 is another flowchart of a method for classifying and aggregating log segments based on abnormal breakpoints provided by an embodiment of the present application.

图4为本申请实施例提供的基于异常断点分类聚合日志片段的方法计算机设备内部结构示意图。FIG. 4 is a schematic diagram of an internal structure of a computer device for a method for classifying and aggregating log segments based on abnormal breakpoints provided by an embodiment of the present application.

本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the purpose of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的规划对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,换句话说,描述的实施例根据除了这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,还可以包含其他内容,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于只清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the present application and the above-mentioned drawings are used to distinguish similar planning objects and do not necessarily Used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances, in other words, the described embodiments are implemented in accordance with sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof may also encompass other content, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to only those expressly listed steps or units, but may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.

需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者多个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the descriptions involving "first", "second", etc. in this application are only for the purpose of description, and should not be construed as indicating or implying their relative importance or implying the number of indicated technical features . Thus, a feature defined as "first" or "second" may expressly or implicitly include one or more of that feature. In addition, the technical solutions between the various embodiments can be combined with each other, but must be based on the realization by those of ordinary skill in the art. When the combination of technical solutions is contradictory or cannot be realized, it should be considered that the combination of such technical solutions does not exist. , is not within the scope of protection claimed in this application.

本申请提供了一种基于异常断点分类聚合日志片段的方法,所述方法应用于一种基于异常断点分类聚合日志片段的系统,所述系统包括客户端和服务器端。客户端通过网络与服务器进行通信。其中,该客户端可以但不限于各种个人计算机、笔记本电脑、平板电脑。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。工作人员通过客户端向服务器发送执行流量回放操作的请求,服务器根据预设算法处理请求并将处理结果发送至客户端以供工作人员查看。在对软件产品、网络设备等进行开发、测试和运营时,产品或设备运作时会产生日志数据。所述日志数据是记录了运行时产生的数据,每一行日志数据都包括了日期、时间、使用者及动作等相关操作的描述。在执行上述方法之前,预先为服务器在操作过程产生的日志配置存储路径,以在需要的时候调用。并且在服务器中加载日志截取插件,用来捕获异常事件,当异常发生时日志截取插件可以截取和聚合特定的日志片段。The present application provides a method for classifying and aggregating log fragments based on abnormal breakpoints. The method is applied to a system for classifying and aggregating log fragments based on abnormal breakpoints. The system includes a client and a server. The client communicates with the server over the network. Wherein, the client can be, but not limited to, various personal computers, notebook computers, and tablet computers. The server can be implemented as an independent server or a server cluster composed of multiple servers. The worker sends a request for performing a traffic playback operation to the server through the client, and the server processes the request according to a preset algorithm and sends the processing result to the client for the worker to view. During the development, testing and operation of software products, network equipment, etc., log data is generated when the products or equipment operate. The log data records data generated during running, and each line of log data includes descriptions of related operations such as date, time, user, and action. Before executing the above method, a storage path is preconfigured for the log generated by the server during the operation, so as to be called when needed. And the log interception plug-in is loaded in the server to capture abnormal events. When an exception occurs, the log interception plug-in can intercept and aggregate specific log fragments.

请结合参看图1,其为本申请第一实施例提供的基于异常断点分类聚合日志片段的方法的流程图。该基于异常断点分类聚合日志片段的方法包括步骤S101-S108。Please refer to FIG. 1 , which is a flowchart of a method for classifying and aggregating log segments based on abnormal breakpoints provided by the first embodiment of the present application. The method for classifying and aggregating log segments based on abnormal breakpoints includes steps S101-S108.

步骤S101,响应工作人员的访问请求执行流量回放。Step S101, performing traffic playback in response to a staff member's access request.

在开发完成后,需要对代码进行测试。在代码测试过程中,还会不断地增加新的需求。增加新需求的过程中会有对代码的重构和拆分,不断地改动源代码,再改动的过程中,原来的功能可能会受到影响。流量回放是将某个时间段内发送至某个应用甲的所有请求存储下来,将所述请求统一发送至另一个不同的应用乙,使甲和乙接收的请求参数保持一致,从而实现了甲接收到的请求向乙重新请求了一遍。在代码测试中每增加新的需求则将在源程序代码运作的请求重新在新的代码上运行一遍,确定新的功能代码没有影响源代码实现的功能。工作人员可以在客户端选择回放的流量片段,可以是某个案例集合的流量,例如双十一购物时用户在整点时刻发起的大量请求,也可以是单条流量,例如,一个用户从购票系统上购买车票。客户端将工作人员的请求发送至服务器端,以使服务器端执行流量回放事件。After development is complete, the code needs to be tested. In the process of code testing, new requirements will continue to be added. In the process of adding new requirements, there will be refactoring and splitting of the code, and the source code will be constantly changed. During the process of changing, the original functions may be affected. Traffic playback is to store all requests sent to a certain application A within a certain period of time, and send the requests to another different application B in a unified manner, so that the request parameters received by A and B are consistent, thus realizing A. The received request is re-requested to B. Every time a new requirement is added in the code test, the request for the operation of the source code will be re-run on the new code to make sure that the new function code does not affect the function implemented by the source code. The staff can select the traffic segment to be played back on the client side, which can be the traffic of a certain case set, such as a large number of requests initiated by users on the hour during Double Eleven shopping, or a single traffic, for example, a user purchases a ticket from Buy tickets on the system. The client sends the worker's request to the server so that the server executes the traffic playback event.

步骤S102,监听所述流量回放事件。Step S102, monitor the traffic playback event.

监听是监视网络运行状态、数据流程,并且可以获取监听过程中产生的全部信息。服务器端响应客户端的请求将所述流量运行在新的完整功能代码中,并将运行过程产生的数据、涉及的代码记录下来,所述涉及的代码包括对方代码的线程名称Main、主调用函数和子调用函数等,所述产生的数据记录在日志中,包括:发起时间、流量回放异常时生成的Exception信息,所述Exception信息为程序运行过程中经过程序本身判断认为,错误已经无法挽回,会抛出异常、程序代码中的错误堆栈,以及执行过程中以SQL计算机语言打印的异常过程信息、和异常对应的info/warn信息,所述info/warn信息为日志类别。Monitoring is to monitor the network running status and data flow, and can obtain all the information generated during the monitoring process. The server side responds to the client's request to run the traffic in a new complete function code, and records the data generated during the running process and the involved codes, including the thread name Main, the main calling function and the subordinate code of the counterparty's code. Calling functions, etc., the generated data is recorded in the log, including: the origination time, the Exception information generated when the traffic playback is abnormal, the Exception information is judged by the program itself during the running process of the program, and the error is irreversible and will be thrown. exception, the error stack in the program code, the exception process information printed in the SQL computer language during the execution process, and the info/warn information corresponding to the exception, where the info/warn information is a log category.

步骤S103,当监听到流量回放失败事件,从所述监听事件获取的回放上下文中提取当前执行回放的回放线程信息。Step S103, when a traffic playback failure event is monitored, the playback thread information currently performing playback is extracted from the playback context obtained from the monitoring event.

当服务器检测到运行程序生成Exception信息、以SQL计算机语言打印的异常过程信息等异常信息时,判断为流量回放失败事件。获取流量回放涉及的代码片段、代码的线程名称Main、主调用函数和子调用函数。获取回放过程中程序生成的异常信息。When the server detects abnormal information such as Exception information generated by the running program, abnormal process information printed in SQL computer language, etc., it is determined as a traffic playback failure event. Get the code snippets involved in traffic playback, the thread name Main of the code, the main calling function, and the sub-calling function. Get exception information generated by the program during playback.

步骤S104,获取预设的日志路径,所述日志路径用于存放日志。Step S104: Obtain a preset log path, where the log path is used for storing logs.

获取预先配置好的回放过程的日志路径,根据所述路径获取记录回放过程的日志。应用RandomAccessFile操作文件对日志内容进行倒序读取,RandomAccessFile是Java输入或输出数据过程中可以使用的功能最丰富的文件内容访问类,它既可以读取文件内容,也可以向文件输出数据,RandomAccessFile操作文件可以从任意位置访问文件。由于工作中日志文件写入是从后面按行添加进去的,而查看日志时,需要从最新信息开始查看,当文件太大时不可能将文件全部读取查看,便对日志进行倒序读取。所述日志中记录了回放过程涉及到的所有代码片段,以及调用过程,以及调用过程中产生的异常信息。Obtain a preconfigured log path of the playback process, and obtain a log of the playback process according to the path. Use RandomAccessFile operation file to read log content in reverse order. RandomAccessFile is the most feature-rich file content access class that can be used in the process of Java input or output data. It can not only read file content, but also output data to the file. RandomAccessFile operation Files can be accessed from anywhere. Since the log file is written from the back at work, and when viewing the log, you need to start with the latest information. When the file is too large, it is impossible to read and view the entire file, so the log is read in reverse order. The log records all code fragments involved in the playback process, the calling process, and exception information generated during the calling process.

步骤S105,根据所述预设日志路径获取日志。Step S105, obtaining a log according to the preset log path.

步骤S106,根据所述回放线程信息从所述日志中进行内容匹配和截取得到对应的若干异常信息段。Step S106: Perform content matching and interception from the log according to the playback thread information to obtain several corresponding abnormal information segments.

所述线程信息为代码运行过程中涉及到的异常代码,应用所述日志截取插件匹配并获取所述线程信息在日志中对应的若干异常代码片段。The thread information is the abnormal code involved in the code running process, and the log interception plug-in is used to match and obtain several abnormal code fragments corresponding to the thread information in the log.

步骤S107,对所述若干异常信息段进行处理得到特定的异常日志片段。Step S107, processing the several abnormal information segments to obtain specific abnormal log segments.

所述处理包括截取、聚合等。将获取的每个异常代码段分成若干代码信息段,将分段获取的若干代码信息段按照预设条件进行聚合形成所述若干特定的异常信息片段。所述预设条件包括代码运行的发起时间、代码的线程名称、代码包含的主调用信息和子调用信息。The processing includes interception, aggregation, and the like. Each acquired abnormal code segment is divided into several code information segments, and the several code information segments acquired by segments are aggregated according to preset conditions to form the several specific abnormal information segments. The preset conditions include the start time of the code running, the thread name of the code, the main call information and the sub-call information contained in the code.

步骤S108,将所述各特定异常日志片段存放于存储器中。Step S108: Store the specific exception log segments in a memory.

所述存储器为云存储器,具体地,所述云存储器可以为AmazonS3云存储。将处理后得到的日志片段存储于所述AmazonS3云存储器中。当流量回放失败时,服务器向客户端发送回放失败页面,所述回放失败页面有若干回放选项以供用户选择。所述若干选项包括:回放结果选项、涉及的源代码片段、生成的日志内容等。若客户在页面端选择回访结果查询选项,则显示经过处理获取的异常代码片段。The storage is cloud storage, and specifically, the cloud storage may be Amazon S3 cloud storage. The log fragments obtained after processing are stored in the Amazon S3 cloud storage. When the traffic playback fails, the server sends a playback failure page to the client, and the playback failure page has several playback options for the user to choose. The several options include: playback result options, source code snippets involved, log content generated, and the like. If the customer selects the return visit result query option on the page, the exception code snippet obtained after processing will be displayed.

可以理解地,若流量回放操作成功,则接收客户下一个回放请求并执行回放操作。Understandably, if the traffic playback operation is successful, the next playback request from the client is received and the playback operation is performed.

上述实施例还提供了一种基于异常断点分类聚合日志片段的装置1,其特征在于,所述由回放主模块2和回放比对失败事件模块3。The above embodiment also provides an apparatus 1 for classifying and aggregating log segments based on abnormal breakpoints, characterized in that the playback main module 2 and the playback comparison failure event module 3 are described.

所述回放主模块2包括:The playback main module 2 includes:

回放单元3,用于响应工作人员的访问请求执行流量回放;工作人员可以在客户端选择回放的流量片段,可以是某个案例集合的流量,例如双十一购物时用户在整点时刻发起的大量请求,也可以是单条流量,例如,一个用户从购票系统上购买车票。客户端将工作人员的请求发送至服务器端,以使服务器端执行流量回放事件。The playback unit 3 is used to perform traffic playback in response to the access request of the staff; the staff can select the playback traffic segment on the client side, which can be the traffic of a certain case set, such as that initiated by the user on the hour during Double Eleven shopping A large number of requests can also be a single piece of traffic. For example, a user buys a ticket from a ticketing system. The client sends the worker's request to the server so that the server executes the traffic playback event.

监听单元4,用于监听所述流量回放事件并当监听到流量回放失败事件,调用所述回放比对失败事件模块;服务器端响应客户端的请求将所述流量运行在新的完整功能代码中,并将运行过程产生的数据、涉及的代码记录下来The monitoring unit 4 is used to monitor the traffic playback event and when monitoring the traffic playback failure event, call the playback comparison failure event module; the server side responds to the client's request to run the traffic in a new complete function code, And record the data and code involved in the running process

所述回放比对失败事件模块2包括:The playback comparison failure event module 2 includes:

路径获取单元5,用于获取预设的日志路径,所述日志路径用于存放日志;获取预先配置好的回放过程的日志路径,根据所述路径获取记录回放过程的日志。The path obtaining unit 5 is configured to obtain a preset log path, where the log path is used to store the log; obtain a preconfigured log path of the playback process, and obtain the log of the recording playback process according to the path.

日志获取单元6,用于根据所述预设日志路径获取日志;a log obtaining unit 6, configured to obtain a log according to the preset log path;

提取单元7,根据所述回放线程信息从所述日志中进行内容匹配和截取得到对应的若干异常信息段;所述线程信息为代码运行过程中涉及到的异常代码,应用所述日志截取插件匹配并获取所述线程信息在日志中对应的若干异常代码片段。Extraction unit 7, to perform content matching and interception from the log according to the playback thread information to obtain a number of corresponding abnormal information segments; the thread information is the abnormal code involved in the code running process, and the log interception plug-in is applied to match And acquire several abnormal code fragments corresponding to the thread information in the log.

处理单元8,用于对所述若干异常信息段进行处理得到各特定的异常日志片段;以及将获取的每个异常代码段分成若干代码信息段,将分段获取的若干代码信息段按照预设条件进行聚合形成所述若干特定的异常信息片段。The processing unit 8 is used to process the several abnormal information segments to obtain each specific abnormal log segment; and divide each acquired abnormal code segment into several code information segments, and divide the acquired code information segments according to preset Conditions are aggregated to form the specific pieces of exception information.

存储单元9,用于将所述各特定异常日志片段存放于存储器中。将处理后得到的日志片段存储于所述AmazonS3云存储器中。The storage unit 9 is configured to store the specific exception log segments in the memory. The log fragments obtained after processing are stored in the Amazon S3 cloud storage.

由图3所示,本申请提供的基于异常断点分类聚合日志片段的方法包括:工作人员从客户端发起请求,服务器响应工作人员的访问请求执行流量回放。服务器监听所述流量回放事件。当监听到流量回放失败事件,服务器从所述监听事件获取的回放上下文中提取当前执行回放的回放线程信息。当所述回放操作成功,服务器响应下一个工作人员的访问请求并执行流量回放操作。服务器获取预设的日志路径,所述日志路径用于存放日志。服务器根据所述预设日志路径获取日志。服务器根据所述回放线程信息从所述日志中进行内容匹配和截取得到对应的若干异常信息段、服务器对所述若干异常信息段进行处理得到各特定的异常日志片段。以及服务器将所述各特定异常日志片段存放于存储器中。工作人员可以从所述存储器页面上获取异常信息。As shown in FIG. 3 , the method for classifying and aggregating log segments based on abnormal breakpoints provided by the present application includes: a worker initiates a request from a client, and a server performs traffic playback in response to the worker's access request. The server listens for the traffic playback event. When monitoring the traffic playback failure event, the server extracts the playback thread information currently performing playback from the playback context acquired by the monitoring event. When the playback operation is successful, the server responds to the access request of the next worker and performs the traffic playback operation. The server obtains a preset log path, where the log path is used for storing logs. The server obtains the log according to the preset log path. The server performs content matching and interception from the log according to the playback thread information to obtain several corresponding abnormal information segments, and the server processes the several abnormal information segments to obtain each specific abnormal log segment. and the server stores the specific exception log segments in the memory. Staff can obtain exception information from the memory page.

本申请还提供一种计算机设备900,请结合参看图4,其为本申请第一实施例提供的计算机设备900的内部结构示意图。进一步的,该计算机嵌入式设备为HUD。计算机设备900至少包括存储器901、处理器902。具体地,存储器901,用于存储基于异常断点分类聚合日志片段的方法的程序指令。处理器902,用于执行程序指令以使计算机设备900实现上述的基于异常断点分类聚合日志片段的方法。The present application also provides a computer device 900. Please refer to FIG. 4, which is a schematic diagram of the internal structure of the computer device 900 provided by the first embodiment of the present application. Further, the computer embedded device is a HUD. The computer device 900 includes at least a memory 901 and a processor 902 . Specifically, the memory 901 is used to store program instructions of a method for classifying and aggregating log segments based on exception breakpoints. The processor 902 is configured to execute program instructions to enable the computer device 900 to implement the above-mentioned method for classifying and aggregating log segments based on exception breakpoints.

其中,存储器901至少包括一种类型的可读存储介质,该可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器901不仅可以用于存储安装于计算机设备900的应用软件及各类数据,例如,基于异常断点分类聚合日志片段的方法的控制指令等,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 901 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (eg, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, and the like. The memory 901 can not only be used to store the application software and various data installed in the computer device 900, for example, the control instructions of the method of classifying and aggregating log fragments based on exception breakpoints, etc., but also can be used to temporarily store the outputted or to be outputted data. data.

处理器902在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器901中存储的程序指令或处理数据。具体地,处理器902执行基于异常断点分类聚合日志片段的方法的程序指令以控制计算机设备900实现基于异常断点分类聚合日志片段的方法。The processor 902 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor or other data processing chips in some embodiments, and is used to execute program instructions or process data stored in the memory 901 . Specifically, the processor 902 executes the program instructions of the method of classifying and aggregating log segments based on exception breakpoints to control the computer device 900 to implement the method of classifying and aggregating log segments based on exception breakpoints.

进一步地,总线903可以是外设部件互连标准总线(peripheral componentinterconnect,简称PCI)或扩展工业标准结构总线(extended industry standardarchitecture,简称EISA)等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图4中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Further, the bus 903 may be a peripheral component interconnect standard bus (peripheral component interconnect, referred to as PCI) or an extended industry standard architecture bus (extended industry standard architecture, referred to as EISA) or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in FIG. 4, but it does not mean that there is only one bus or one type of bus.

进一步地,计算机设备900还可以包括显示组件904。显示组件904可以是LED(Light Emitting Diode,发光二极管)显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示组件904也可以适当的称为显示装置或显示单元,用于显示在计算机设备900中处理的信息以及用于显示可视化的用户界面。Further, computer device 900 may also include display component 904 . The display component 904 may be an LED (Light Emitting Diode, light-emitting diode) display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like. The display component 904 may also be appropriately referred to as a display device or a display unit for displaying information processed in the computer device 900 and for displaying a visual user interface.

进一步地,计算机设备900还可以包括通信组件905,通信组件905可选的可以包括有线通信组件和/或无线通信组件(如WI-FI通信组件、蓝牙通信组件等),通常用于在计算机设备900与其他计算机设备之间建立通信连接。Further, the computer device 900 may also include a communication component 905, and the communication component 905 may optionally include a wired communication component and/or a wireless communication component (such as a WI-FI communication component, a Bluetooth communication component, etc.), which are generally used in computer equipment A communication connection is established between 900 and other computer devices.

图4仅示出了具有组件901-905以及实现基于异常断点分类聚合日志片段的方法的程序指令的计算机设备900,本领域技术人员可以理解的是,图4示出的结构并不构成对计算机设备900的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 4 only shows a computer device 900 having components 901-905 and program instructions for implementing the method for classifying and aggregating log segments based on exception breakpoints. Those skilled in the art can understand that the structure shown in FIG. 4 does not constitute a The definition of computer device 900 may include fewer or more components than shown, or a combination of certain components, or a different arrangement of components.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,具体地,计算机设备900的处理器902执行基于异常断点分类聚合日志片段的方法的程序指令以控制计算机设备900实现可运动物体的运动轨迹的预测方法的详细过程。可以参考上述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the above-described systems, devices and units, specifically, the processor 902 of the computer device 900 executes the classification and aggregation of log segments based on exception breakpoints. The program instructions of the method are used to control the computer device 900 to implement the detailed process of the method for predicting the motion trajectory of the movable object. Reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described herein again.

显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,且本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, and these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

以上所列举的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属于本申请所涵盖的范围。The above enumeration is only the preferred embodiment of the present application, of course, the scope of the right of the present application cannot be limited by this, so the equivalent changes made according to the claims of the present application still belong to the scope covered by the present application.

Claims (10)

1.一种基于异常断点分类聚合日志片段的方法,其特征在于,所述方法包括:1. A method for classifying and aggregating log fragments based on abnormal breakpoints, wherein the method comprises: 响应工作人员的访问请求执行流量回放;Perform traffic replay in response to worker's access request; 监听所述流量回放事件;monitor the traffic playback event; 当监听到流量回放失败事件,从所述监听事件获取的回放上下文中提取当前执行回放的回放线程信息;When the traffic playback failure event is monitored, the playback thread information currently performing playback is extracted from the playback context obtained by the monitoring event; 获取预设的日志路径,所述日志路径用于存放日志;Obtain a preset log path, where the log path is used to store logs; 根据所述预设日志路径获取日志;Obtain the log according to the preset log path; 根据所述回放线程信息从所述日志中进行内容匹配和截取得到对应的若干异常信息段;Perform content matching and interception from the log according to the playback thread information to obtain a number of corresponding abnormal information segments; 对所述若干异常信息段进行处理得到各特定的异常日志片段;以及processing the several exception information segments to obtain each specific exception log segment; and 将所述各特定异常日志片段存放于存储器中。The specific exception log segments are stored in the memory. 2.如权利要求1所述的基于异常断点分类聚合日志片段的方法,其特征在于,所述方法还包括:2. The method according to claim 1, wherein the method further comprises: 若所述回放操作成功,响应下一个工作人员的访问请求并执行流量回放操作。If the playback operation is successful, respond to the access request of the next worker and perform the traffic playback operation. 3.如权利要求1所述的基于异常断点分类聚合日志片段的方法,其特征在于,所述方法还包括:3. The method according to claim 1, wherein the method further comprises: 提供回放失败页面,所述回放失败页面提供若干回放选项以供用户选择;providing a playback failure page that provides several playback options for the user to select; 响应用户选择的回放结果选项查询出对应的异常日志片段显示给用户。In response to the playback result option selected by the user, the corresponding abnormal log segment is queried and displayed to the user. 4.如权利要求1所述的基于异常断点分类聚合日志片段的方法,其特征在于,对所述若干异常信息段进行处理得到特定的异常日志片段包括:4. The method for classifying and aggregating log fragments based on abnormal breakpoints according to claim 1, wherein processing the several abnormal information fragments to obtain specific abnormal log fragments comprises: 将各异常信息段进行分段形成若干异常信息片段;Segment each abnormal information segment to form several abnormal information segments; 将若干异常信息片段按照预设条件进行聚合形成所述各特定的异常日志片段。The specific abnormal log fragments are formed by aggregating several abnormal information fragments according to preset conditions. 5.如权利要求4所述的基于异常断点分类聚合日志片段的方法,其特征在于,所述预设条件包括发起时间、线程名称、主调用信息、子调用信息。5 . The method for classifying and aggregating log segments based on exception breakpoints according to claim 4 , wherein the preset conditions include initiation time, thread name, main call information, and sub-call information. 6 . 6.如权利要求4所述的基于异常断点分类聚合日志片段的方法,其特征在于,根据所述预设日志路径获取日志具体包括:6. The method for classifying and aggregating log fragments based on abnormal breakpoints as claimed in claim 4, wherein acquiring the log according to the preset log path specifically comprises: 利用RandomAccessFile操作文件倒序读取日志内容。Use RandomAccessFile to operate the file to read the log content in reverse order. 7.如权利要求4所述的基于异常断点分类聚合日志片段的方法,其特征在于,所述存储器为云存储器。7 . The method for classifying and aggregating log fragments based on abnormal breakpoints according to claim 4 , wherein the storage is a cloud storage. 8 . 8.一种基于异常断点分类聚合日志片段的装置,其特征在于,所述装置由回放主模块和回放比对失败事件模块组成,8. a device based on abnormal breakpoint classification aggregation log fragment, it is characterized in that, described device is made up of playback main module and playback comparison failure event module, 所述回放主模块包括:The main playback module includes: 回放单元,用于响应工作人员的访问请求执行流量回放;A playback unit, used to perform traffic playback in response to a worker's access request; 监听单元,用于监听所述流量回放事件并当监听到流量回放失败事件,调用所述回放比对失败事件模块;a monitoring unit, configured to monitor the traffic playback event and call the playback comparison failure event module when monitoring the traffic playback failure event; 所述回放比对失败事件模块包括:The playback comparison failure event module includes: 路径获取单元,用于获取预设的日志路径,所述日志路径用于存放日志;a path obtaining unit, configured to obtain a preset log path, where the log path is used to store logs; 日志获取单元,用于根据所述预设日志路径获取日志;a log obtaining unit, configured to obtain a log according to the preset log path; 提取单元,根据所述回放线程信息从所述日志中进行内容匹配和截取得到对应的若干异常信息段;an extraction unit, which performs content matching and interception from the log according to the playback thread information to obtain several corresponding abnormal information segments; 处理单元,用于对所述若干异常信息段进行处理得到各特定的异常日志片段;以及a processing unit, configured to process the several exception information segments to obtain each specific exception log segment; and 存储单元,用于将所述各特定异常日志片段存放于存储器中。The storage unit is configured to store the specific exception log segments in the memory. 9.计算机可读存储介质,其特征在于,所述计算机可读存储介质用于存储程序指令,所述程序指令可被处理器执行以实现如权利要求1至8中任意一项所述的基于异常断点分类聚合日志片段的方法。9. A computer-readable storage medium, wherein the computer-readable storage medium is used to store program instructions, the program instructions can be executed by a processor to Anomaly breakpoint classification method for aggregated log fragments. 10.一种服务器,其特征在于,所述服务器包括:10. A server, characterized in that the server comprises: 存储器,用于存储计算机程序指令;memory for storing computer program instructions; 处理器,用于执行计算机程序指令以实现如权利要求1至8中任意一项所述的基于异常断点分类聚合日志片段的方法。A processor for executing computer program instructions to implement the method for classifying and aggregating log segments based on exception breakpoints as claimed in any one of claims 1 to 8.
CN202210743227.XA 2022-06-28 2022-06-28 Method and device for classifying and aggregating log segments based on abnormal breakpoints Pending CN115098378A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210743227.XA CN115098378A (en) 2022-06-28 2022-06-28 Method and device for classifying and aggregating log segments based on abnormal breakpoints

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210743227.XA CN115098378A (en) 2022-06-28 2022-06-28 Method and device for classifying and aggregating log segments based on abnormal breakpoints

Publications (1)

Publication Number Publication Date
CN115098378A true CN115098378A (en) 2022-09-23

Family

ID=83294660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210743227.XA Pending CN115098378A (en) 2022-06-28 2022-06-28 Method and device for classifying and aggregating log segments based on abnormal breakpoints

Country Status (1)

Country Link
CN (1) CN115098378A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117194566A (en) * 2023-08-21 2023-12-08 泽拓科技(深圳)有限责任公司 Multi-storage engine data copying method, system and computer equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105988917A (en) * 2015-02-26 2016-10-05 小米科技有限责任公司 Method and device for obtaining abnormal information
US20190243743A1 (en) * 2018-02-07 2019-08-08 Apple Inc. Unsupervised anomaly detection
CN113360656A (en) * 2021-06-29 2021-09-07 未鲲(上海)科技服务有限公司 Abnormal data detection method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105988917A (en) * 2015-02-26 2016-10-05 小米科技有限责任公司 Method and device for obtaining abnormal information
US20190243743A1 (en) * 2018-02-07 2019-08-08 Apple Inc. Unsupervised anomaly detection
CN113360656A (en) * 2021-06-29 2021-09-07 未鲲(上海)科技服务有限公司 Abnormal data detection method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117194566A (en) * 2023-08-21 2023-12-08 泽拓科技(深圳)有限责任公司 Multi-storage engine data copying method, system and computer equipment
CN117194566B (en) * 2023-08-21 2024-04-19 泽拓科技(深圳)有限责任公司 Multi-storage engine data copying method, system and computer equipment

Similar Documents

Publication Publication Date Title
CN112491602B (en) Behavior data monitoring method and device, computer equipment and medium
CN109284269B (en) Abnormal log analysis method and device, storage medium and server
US11263071B2 (en) Enabling symptom verification
US9495234B1 (en) Detecting anomalous behavior by determining correlations
US9652353B2 (en) Monitoring business transaction failures involving database procedure calls
US20080195670A1 (en) System and method for log management
US11449407B2 (en) System and method for monitoring computing platform parameters and dynamically generating and deploying monitoring packages
CN107003931B (en) Decoupling test validation from test execution
CN108074033A (en) Processing method, system, electronic equipment and the storage medium of achievement data
GB2524434A (en) Management system for managing computer system and management method thereof
CN112162954A (en) User operation log generation method, user operation log generation device
CN109408361A (en) Monkey tests restored method, device, electronic equipment and computer readable storage medium
CN111897696A (en) Method, device, electronic device and storage medium for detecting the state of a hard disk in a server cluster
CN112187933A (en) Method and system for monitoring services in multi-architecture cloud platform
CN113760579A (en) Troubleshooting method and device
US9760611B2 (en) Identifying element relationships in a document
CN118897784B (en) Interface call log analysis method, device, equipment, medium and product
JP2014182646A (en) Apparatus for monitoring execution of software, method and program
CN115098378A (en) Method and device for classifying and aggregating log segments based on abnormal breakpoints
US20170249176A1 (en) Systems and methods for configuration knowledge search
CN113760696A (en) Program problem positioning method and device, electronic equipment and storage medium
WO2018070211A1 (en) Management server, management method and program therefor
JP2014109975A (en) Performance analysis device, performance analysis method and performance analysis program
CN111290870B (en) Method and device for detecting abnormality
CN113934595A (en) Data analysis method and system, storage medium and electronic terminal

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