Movatterモバイル変換


[0]ホーム

URL:


CN110362548B - Log extraction method and related equipment - Google Patents

Log extraction method and related equipment
Download PDF

Info

Publication number
CN110362548B
CN110362548BCN201910505732.9ACN201910505732ACN110362548BCN 110362548 BCN110362548 BCN 110362548BCN 201910505732 ACN201910505732 ACN 201910505732ACN 110362548 BCN110362548 BCN 110362548B
Authority
CN
China
Prior art keywords
file
log
slice
time
server
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.)
Active
Application number
CN201910505732.9A
Other languages
Chinese (zh)
Other versions
CN110362548A (en
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.)
Shenzhen Shenghui Technology Co ltd
Original Assignee
Shenzhen Shenghui Technology 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 Shenzhen Shenghui Technology Co ltdfiledCriticalShenzhen Shenghui Technology Co ltd
Priority to CN201910505732.9ApriorityCriticalpatent/CN110362548B/en
Publication of CN110362548ApublicationCriticalpatent/CN110362548A/en
Application grantedgrantedCritical
Publication of CN110362548BpublicationCriticalpatent/CN110362548B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The application discloses a log extraction method and related equipment, wherein the log extraction method comprises the following steps: slicing and storing the terminal log, wherein the attribute of each slice file comprises: file generation time; after receiving a log request sent by a server for extracting a certain time period, extracting at least one slice file corresponding to the time period; generating a log file based on the at least one slice file; and uploading the log file to the server. The log extraction method is automatically operated without manual grabbing; in addition, as the log data of the terminal is stored in a plurality of slice files, the screening range is reduced, the log screening time is shortened, the log grabbing efficiency is improved, and the time for checking the terminal problem is shortened. The method and the device are widely applied to remote extraction of the terminal logs.

Description

Translated fromChinese
日志提取方法及相关设备Log extraction methods and related equipment

技术领域Technical field

本发明涉及计算机技术领域,尤其是涉及一种日志提取方法及相关设备。The present invention relates to the field of computer technology, and in particular, to a log extraction method and related equipment.

背景技术Background technique

在终端发生故障时,通常通过抓取终端的日志记录,来定位终端发生故障的原因。传统的做法是:获取终端的全部日志文件后,再找专业人员进行日志的抓取与筛选。When a terminal fails, the cause of the terminal failure is usually located by grabbing the terminal's log records. The traditional approach is to obtain all the log files of the terminal and then find professionals to capture and filter the logs.

传统方法的缺点是:由于日志的抓取与筛选需要与对应的开发人员进行沟通,导致增加沟通成本,从而影响排查问题的速度。The disadvantage of the traditional method is that since the capture and filtering of logs require communication with the corresponding developers, communication costs are increased and the speed of troubleshooting is affected.

发明内容Contents of the invention

本发明旨在至少在一定程度上解决相关技术中的技术问题之一。为此,本发明的一个目的是提供一种日志提取方法及相关设备,能够方便抓取与筛选日志,有利于提高排查问题的效率。The present invention aims to solve one of the technical problems in the related art, at least to a certain extent. To this end, one purpose of the present invention is to provide a log extraction method and related equipment, which can facilitate the capture and screening of logs and help improve the efficiency of troubleshooting problems.

本发明所采用的技术方案是:The technical solution adopted by the present invention is:

第一方面,本发明提供一种日志提取方法,该日志提取方法包括:将终端日志进行切片存储,其中,每个切片文件的属性包括:文件生成时间;在接收到服务器发送的提取某个时间段的日志请求之后,提取与该时间段对应的至少一个切片文件;基于该至少一个切片文件生成日志文件;将该日志文件上传给该服务器。In a first aspect, the present invention provides a log extraction method. The log extraction method includes: storing terminal logs in slices, wherein the attributes of each slice file include: file generation time; a certain time after receiving the extraction time sent by the server. After the log request for the segment, extract at least one slice file corresponding to the time segment; generate a log file based on the at least one slice file; and upload the log file to the server.

其中,每个该切片文件包括文件建立时间和文件最终修订时间;提取与该时间段对应的至少一个切片文件,包括:基于该文件建立时间和该文件最终修订时间,获取与该时间段对应的至少一个切片文件。Wherein, each slice file includes a file creation time and a file final revision time; extracting at least one slice file corresponding to the time period includes: based on the file creation time and the file final revision time, obtaining the file corresponding to the time period. At least one slice file.

其中,基于该至少一个切片文件生成日志文件,包括:将该至少一个切片文件进行打包压缩,生成该日志文件。Wherein, generating a log file based on the at least one slice file includes: packaging and compressing the at least one slice file to generate the log file.

其中,该切片文件进一步包括多条记录生成时间;基于该至少一个切片文件生成日志文件,包括:根据该记录生成时间,从该至少一个切片文件的每个文件中分别截取符合该时间段的日志数据,并将该每个文件中截取的日志数据均单独保存为一个文件;将截取到的所有文件集中压缩,生成该日志文件。Wherein, the slice file further includes multiple record generation times; generating a log file based on the at least one slice file includes: according to the record generation time, intercepting logs that conform to the time period from each file of the at least one slice file. data, and save the intercepted log data in each file as a separate file; compress all intercepted files collectively to generate the log file.

其中,每个该切片文件的大小相同;将终端日志进行切片存储之前,包括通过该服务器向该终端设置该切片文件的文件大小。The size of each slice file is the same; before storing the terminal log in slices, the file size of the slice file is set to the terminal through the server.

第二方面,本发明提供一种日志提取装置,该日志提取装置包括:日志存储模块,用于将终端日志进行切片存储,其中,每个切片文件的属性包括:文件生成时间;切片抓取模块,用于在接收到服务器发送的提取某个时间段的日志请求之后,提取与该时间段对应的至少一个切片文件;日志生成模块,用于基于该至少一个切片文件生成日志文件;以及日志发送模块,用于将该日志文件上传给该服务器。In a second aspect, the present invention provides a log extraction device. The log extraction device includes: a log storage module for storing terminal logs in slices, where the attributes of each slice file include: file generation time; a slice capture module , used to extract at least one slice file corresponding to the time period after receiving a log request sent by the server to extract a certain time period; a log generation module, used to generate a log file based on the at least one slice file; and log sending Module used to upload the log file to the server.

第三方面,本发明提供一种终端,该终端包括:至少一个处理器;以及与该至少一个处理器通信连接的存储器;其中,该存储器存储有可被该至少一个处理器执行的指令,该指令能够执行如上述的方法。In a third aspect, the present invention provides a terminal, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the Instructions can perform the methods described above.

第四方面,本发明提供一种服务器,其中,该服务器用于从如上述的终端进行日志提取。In a fourth aspect, the present invention provides a server, wherein the server is used to extract logs from the above-mentioned terminal.

其中,该服务器还用于获取该日志文件后,将该日志文件保存在该服务器对应的存储位置,如果该存储位置保存的日志文件个数超出预定的数量,将该日志文件替换最先保存的文件。Among them, the server is also used to obtain the log file and save the log file in a storage location corresponding to the server. If the number of log files saved in the storage location exceeds a predetermined number, replace the log file with the first saved one. document.

第五方面,本发明提供一种日志提取系统,该日志提取系统包括如上述的终端和上述的服务器。In a fifth aspect, the present invention provides a log extraction system, which includes the above terminal and the above server.

本发明的有益效果是:The beneficial effects of the present invention are:

本发明通过采用将日志数据进行切片存储,然后根据服务器下发的时间段,筛选出与所述时间段对应的至少一个切片文件,并基于该至少一个切片文件生成日志文件,最后将该日志文件上传至服务器。该日志提取方法自动化操作,无须手动抓取;并且,由于终端的日志数据以多个切片文件形式保存,减少筛选范围,有利于缩减筛选日志时间;因此,本发明实施例的日期提取方法有利于提高日志抓取效率,缩短排查终端问题的时间。The present invention stores log data in slices, then filters out at least one slice file corresponding to the time period according to the time period issued by the server, generates a log file based on the at least one slice file, and finally converts the log file into Upload to server. This log extraction method operates automatically and does not require manual capture; moreover, because the log data of the terminal is saved in the form of multiple slice files, the screening scope is reduced, which is beneficial to reducing the log screening time; therefore, the date extraction method of the embodiment of the present invention is beneficial to Improve log capture efficiency and shorten the time to troubleshoot terminal problems.

进一步地,本发明终端的每个切片文件包括文件建立时间和文件最终修订时间,相当于每个切片文件具有一个时间区间,这样方便确定与查询时间段对应的切片文件。Furthermore, each slice file of the terminal of the present invention includes the file creation time and the file final revision time, which is equivalent to each slice file having a time interval, which facilitates the determination of the slice file corresponding to the query time period.

进一步地,本发明终端的每个切片文件具有多条记录生成时间,这样可剔除切片文件中不必要的日志数据,减小日志文件的体量。Furthermore, each slice file of the terminal of the present invention has multiple record generation times, so that unnecessary log data in the slice file can be eliminated and the size of the log file can be reduced.

此外,还可以在服务器端远程调节终端切片文件的大小。In addition, the size of the terminal slice file can be adjusted remotely on the server side.

本发明广泛应用于终端日志的远程自动化提取。The invention is widely used in remote automated extraction of terminal logs.

附图说明Description of the drawings

图1是本发明日志提取方法的一实施例的流程示意图;Figure 1 is a schematic flow chart of an embodiment of the log extraction method of the present invention;

图2是图1的步骤S13的一实施例的流程示意图;Figure 2 is a schematic flowchart of an embodiment of step S13 in Figure 1;

图3是本发明日志提取装置的一实施例的结构示意图;Figure 3 is a schematic structural diagram of an embodiment of the log extraction device of the present invention;

图4是本发明日志提取系统的一实施例的结构示意图。Figure 4 is a schematic structural diagram of an embodiment of the log extraction system of the present invention.

具体实施方式Detailed ways

需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。It should be noted that, as long as there is no conflict, the embodiments and features in the embodiments of this application can be combined with each other.

实施例一:Example 1:

请参阅图1,图1是本发明日志提取方法的一实施例的流程示意图。如图1所示,该方法包括如下步骤:Please refer to Figure 1, which is a schematic flow chart of an embodiment of the log extraction method of the present invention. As shown in Figure 1, the method includes the following steps:

S11:将终端日志按照切片文件方式进行存储,其中,每个切片文件的属性包括:文件生成时间;S11: Store the terminal log in the form of slice files, where the attributes of each slice file include: file generation time;

在步骤S11中,在终端或与终端通信的云卡服务器进行启动之后,生成终端日志。该终端日志的数据包括:终端WIFI信息、终端SIM卡信息、终端网络连接信息、终端电池信息以及云卡运行状态信息。In step S11, after the terminal or the cloud card server communicating with the terminal is started, a terminal log is generated. The data in the terminal log includes: terminal WIFI information, terminal SIM card information, terminal network connection information, terminal battery information and cloud card operating status information.

优选地,每个切片文件的大小相同。例如,每个切片文件的大小为20M,当一个切片文件保存的日志记录大小超过20M之后,重新生成一个新的切片文件。当然,也可以按照预定的时间单位进行保存切片文件,即设定每5分钟或10分钟生成一个切片文件。在步骤S11之前,通过该服务器向该终端设置该切片文件的文件大小。Preferably, each slice file is the same size. For example, the size of each slice file is 20M. When the log record size saved in a slice file exceeds 20M, a new slice file is regenerated. Of course, you can also save slice files according to a predetermined time unit, that is, set a slice file to be generated every 5 minutes or 10 minutes. Before step S11, the file size of the slice file is set to the terminal through the server.

优选地,每个切片文件包括文件建立时间和最终修订时间,例如,每个切片文件按照文件的初始创建时间进行命名,在每个切片文件的文件结束位置保存其最终修订时间。Preferably, each slice file includes a file creation time and a final revision time. For example, each slice file is named according to the initial creation time of the file, and its final revision time is saved at the end of the file of each slice file.

其中,每个切片文件包括多条记录生成时间。可选地,每个切片文件包括多条日志记录,每条日志记录均包括一个记录生成时间。也可以设置一段日志记录(包括若干条日志记录)包括:起始记录时间和终止记录时间。Each slice file includes multiple record generation times. Optionally, each slice file includes multiple log records, each log record including a record generation time. You can also set a log record (including several log records) including: starting recording time and ending recording time.

S12:在接收到服务器发送的提取某个时间段的日志请求之后,提取与该时间段对应的至少一个切片文件;S12: After receiving a log request sent by the server to extract a certain time period, extract at least one slice file corresponding to the time period;

在步骤S12中,包括如下步骤:In step S12, the following steps are included:

(1)获取该时间段字段。终端接收到服务器发送的获取日志请求之后,从请求信息中获取查询时间段,该查询时间段包括起始时间和终止时间。如果该查询时间段的起始时间大于终端的当前时间,则退出执行本步骤S12。(1) Get the time period field. After receiving the log acquisition request sent by the server, the terminal obtains the query time period from the request information. The query time period includes the start time and end time. If the starting time of the query time period is greater than the current time of the terminal, this step S12 is exited.

(2)定位切片文件。由于每个切片文件包括文件初始建立时间和文件最终修订时间,即每个切片文件对应一个时间区间。查找该查询时间段的起始时间和终止时间分别对应哪个或哪两个切片文件的时间区间,则提取的切片文件为该对应的切片文件或该对应的两个切片文件之间的所有文件。比如,终端当前保存100个切片文件,这100个切片文件的名称按照文件建立时间顺序排列,分别为“时间1”、“时间2”、“时间3”……“时间100”。经查找,如果该查询时间段的起始时间和终止时间均位于切片文件“时间3”的时间区间中,则提取切片文件“时间3”;如果该查询时间段的起始时间位于切片文件“时间3”的时间区间中,该查询时间段的终止时间位于切片文件“时间7”的时间区间中,则提取5个切片文件“时间3”、“时间4”、“时间5”、“时间6”及“时间7”。(2) Locate the slice file. Since each slice file includes the initial creation time of the file and the final revision time of the file, that is, each slice file corresponds to a time interval. Find the time interval of which one or two slice files correspond to the start time and end time of the query time period, and then the extracted slice files are the corresponding slice files or all files between the two corresponding slice files. For example, the terminal currently saves 100 slice files. The names of these 100 slice files are arranged in the order of file creation time, namely "time 1", "time 2", "time 3"... "time 100". After searching, if the start time and end time of the query time period are both located in the time interval of the slice file "time 3", extract the slice file "time 3"; if the start time of the query time period is located in the slice file "time 3" In the time interval of "Time 3", the end time of the query time period is in the time interval of the slice file "Time 7", then 5 slice files "Time 3", "Time 4", "Time 5", "Time" are extracted 6" and "Time 7".

S13:基于该至少一个切片文件生成日志文件;S13: Generate a log file based on the at least one slice file;

在步骤S13中,为提高日志文件的传输速率,将该至少一个切片文件进行打包压缩,生成该日志文件。In step S13, in order to increase the transmission rate of the log file, the at least one slice file is packaged and compressed to generate the log file.

优选地,由于步骤S12抓取的至少一个切片文件中仍然存在可能保存有不必要的日志记录,可进一步将非查询时间段的日志记录剔除。Preferably, since unnecessary log records may still be stored in at least one slice file captured in step S12, log records in non-query time periods may be further eliminated.

具体地,如图2所示,步骤S13包括如下子步骤:Specifically, as shown in Figure 2, step S13 includes the following sub-steps:

S131:根据记录生成时间,从该至少一个切片文件的每个文件中分别截取符合该时间段的日志数据,并将该每个文件中截取的日志数据均单独保存为一个文件。S131: According to the record generation time, intercept the log data corresponding to the time period from each file of the at least one slice file, and save the intercepted log data in each file as a separate file.

在步骤S131中,如果该时间段横跨多个切片文件,第一个切片文件和最后一个切片文件可能存在保存有不必要的日志记录,则根据该记录生成时间,从该第一个切片文件和该最后一个切片文件中分别截取符合该时间段的日志数据,并将每个文件中截取的日志数据均单独保存为一个文件。In step S131, if the time period spans multiple slice files, the first slice file and the last slice file may have unnecessary log records saved, and then based on the record generation time, the first slice file is The log data that matches the time period are intercepted from the last slice file, and the intercepted log data from each file is saved as a separate file.

也就是说,步骤S12抓取的文件数量,在经过步骤S131处理后,仍然保持不变。In other words, the number of files captured in step S12 remains unchanged after being processed in step S131.

S132:将截取到的所有文件集中压缩,生成该日志文件。S132: Centrally compress all intercepted files to generate the log file.

在步骤S132中,日志文件为压缩文件包,有利于提高文件的传输效率。In step S132, the log file is a compressed file package, which is beneficial to improving file transmission efficiency.

S14:将该日志文件上传给该服务器。S14: Upload the log file to the server.

在步骤S14中,通过特定文件传输协议,比如通过FTP文件传输协议将该日志文件上传给该服务器,可进一步提高文件的传输效率。In step S14, the log file is uploaded to the server through a specific file transfer protocol, such as FTP file transfer protocol, which can further improve file transfer efficiency.

实施例二:Example 2:

请参阅图3,图3是本发明日志提取装置的一实施例的结构示意图。如图3所示,该装置包括日志存储模块31、切片抓取模块32、日志生成模块33及日志发送模块34。Please refer to FIG. 3 , which is a schematic structural diagram of an embodiment of the log extraction device of the present invention. As shown in Figure 3, the device includes a log storage module 31, a slice capture module 32, a log generation module 33 and a log sending module 34.

日志存储模块31,用于将终端日志进行切片存储,其中,每个切片文件的属性包括:文件生成时间。The log storage module 31 is used to store terminal logs in slices, where the attributes of each slice file include: file generation time.

切片抓取模块32,用于在接收到服务器发送的提取某个时间段的日志请求之后,提取与该时间段对应的至少一个切片文件。The slice capture module 32 is configured to extract at least one slice file corresponding to a certain time period after receiving a log request sent by the server to extract a certain time period.

日志生成模块33,用于基于该至少一个切片文件生成日志文件。The log generation module 33 is configured to generate a log file based on the at least one slice file.

日志发送模块34,用于将该日志文件上传给该服务器。具体地,该装置各模块的工作方法与实施例一所述的方法相同,在此不再赘述。The log sending module 34 is used to upload the log file to the server. Specifically, the working methods of each module of the device are the same as those described in Embodiment 1, and will not be described again here.

实施例三:Embodiment three:

请参阅图4,图4是本发明日志提取系统的一实施例的结构示意图。如图4所示,该日志提取系统包括多个终端41和服务器42。Please refer to Figure 4, which is a schematic structural diagram of an embodiment of the log extraction system of the present invention. As shown in Figure 4, the log extraction system includes multiple terminals 41 and servers 42.

终端41包括:至少一个处理器;以及与该至少一个处理器通信连接的存储器;其中,该存储器存储有可被该至少一个处理器执行的指令,该指令能够执行如实施例一所述的方法。The terminal 41 includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions can perform the method as described in Embodiment 1. .

服务器42用于与终端41进行通信。服务器42与终端41通信方式为有线通信或无线通信。其中,该服务器在获取该日志文件之后,将该日志文件保存在该服务器对应的存储位置,如果该存储位置保存的日志文件个数超出预定的数量,将该日志文件替换最先保存的文件。例如,设定该存储位置保存的日志文件数量最大为50个,如果该存储位置保存的日志文件数量<50,则将该日志文件存入到该存储位置中;反之,将该存储位置最先保存的文件进行删除,然后再存入该日志文件到该存储位置中。这样,有利于防止服务器42存储的日志文件数量过多,精简服务器空间。The server 42 is used to communicate with the terminal 41. The communication method between the server 42 and the terminal 41 is wired communication or wireless communication. After obtaining the log file, the server saves the log file in a storage location corresponding to the server. If the number of log files saved in the storage location exceeds a predetermined number, the log file replaces the first saved file. For example, set the maximum number of log files saved in this storage location to 50. If the number of log files saved in this storage location is <50, the log file will be stored in this storage location; otherwise, the storage location will be stored first. Delete the saved file, and then save the log file to the storage location. In this way, it is helpful to prevent the server 42 from storing too many log files and streamline the server space.

其中,服务器42可以为远程服务器。该日志提取系统的一应用场景可以为:多个终端41分布在用户位置,服务器42设置在集控中心,工作人员在服务器42端排除任一终端41的技术故障问题。The server 42 may be a remote server. An application scenario of the log extraction system can be: multiple terminals 41 are distributed at the user's location, the server 42 is set up in the centralized control center, and the staff eliminates technical faults of any terminal 41 on the server 42 side.

以上是对本发明的较佳实施进行了具体说明,但本发明创造并不限于所述实施例,熟悉本领域的技术人员在不违背本发明精神的前提下还可做出种种的等同变形或替换,这些等同的变形或替换均包含在本申请权利要求所限定的范围内。The above is a detailed description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can also make various equivalent modifications or substitutions without violating the spirit of the present invention. , these equivalent modifications or substitutions are included in the scope defined by the claims of this application.

Claims (7)

Translated fromChinese
1.一种日志提取方法,其特征在于,包括:1. A log extraction method, characterized by including:将终端日志进行切片存储,其中,每个切片文件的属性包括:文件生成时间;每个所述切片文件的所述文件生成时间包括:文件建立时间和文件最终修订时间;The terminal log is stored in slices, where the attributes of each slice file include: file generation time; the file generation time of each slice file includes: file creation time and file final revision time;在接收到服务器发送的提取某个时间段的日志请求之后,基于所述文件生成时间,提取与所述时间段对应的至少一个切片文件;包括:基于所述文件建立时间和所述文件最终修订时间,获取与所述时间段对应的至少一个切片文件;After receiving a log request sent by the server to extract a certain time period, extract at least one slice file corresponding to the time period based on the file creation time; including: based on the file creation time and the final revision of the file Time, obtain at least one slice file corresponding to the time period;基于所述至少一个切片文件生成日志文件;包括:将所述至少一个切片文件进行打包压缩,生成所述日志文件;Generating a log file based on the at least one slice file includes: packaging and compressing the at least one slice file to generate the log file;或,所述切片文件进一步包括多条记录生成时间,根据所述记录生成时间,从所述至少一个切片文件的每个文件中分别截取符合所述时间段的日志数据,并将所述每个文件中截取的日志数据均单独保存为一个文件;将截取到的所有文件集中压缩,生成所述日志文件;Or, the slice file further includes multiple record generation times. According to the record generation time, log data that conforms to the time period is intercepted from each file of the at least one slice file, and each of the log data is intercepted. The log data intercepted in the file is saved as a separate file; all intercepted files are compressed centrally to generate the log file;将所述日志文件上传给所述服务器。Upload the log file to the server.2.根据权利要求1所述的日志提取方法,其特征在于,每个所述切片文件的大小相同;2. The log extraction method according to claim 1, characterized in that the size of each slice file is the same;将终端日志进行切片存储之前,包括:Before slicing and storing the terminal log, include:通过所述服务器向所述终端设置所述切片文件的文件大小。The file size of the slice file is set to the terminal through the server.3.一种日志提取装置,其特征在于,包括:3. A log extraction device, characterized in that it includes:日志存储模块,用于将终端日志进行切片存储,其中,每个切片文件的属性包括:文件生成时间;每个所述切片文件的所述文件生成时间包括:文件建立时间和文件最终修订时间;The log storage module is used to store terminal logs in slices, where the attributes of each slice file include: file generation time; the file generation time of each slice file includes: file creation time and file final revision time;切片抓取模块,用于在接收到服务器发送的提取某个时间段的日志请求之后,基于所述文件生成时间,提取与所述时间段对应的至少一个切片文件;包括:基于所述文件建立时间和所述文件最终修订时间,获取与所述时间段对应的至少一个切片文件;A slice capture module, configured to extract at least one slice file corresponding to the time period based on the file generation time after receiving a log request sent by the server to extract a certain time period; including: establishing a file based on the file time and the last revision time of the file, and obtain at least one slice file corresponding to the time period;日志生成模块,用于基于所述至少一个切片文件生成日志文件;包括:将所述至少一个切片文件进行打包压缩,生成所述日志文件;A log generation module, configured to generate a log file based on the at least one slice file; including: packaging and compressing the at least one slice file to generate the log file;或,所述切片文件进一步包括多条记录生成时间,根据所述记录生成时间,从所述至少一个切片文件的每个文件中分别截取符合所述时间段的日志数据,并将所述每个文件中截取的日志数据均单独保存为一个文件;将截取到的所有文件集中压缩,生成所述日志文件;Or, the slice file further includes multiple record generation times. According to the record generation time, log data that conforms to the time period is intercepted from each file of the at least one slice file, and each of the log data is intercepted. The log data intercepted in the file is saved as a separate file; all intercepted files are compressed centrally to generate the log file;日志发送模块,用于将所述日志文件上传给所述服务器。A log sending module is used to upload the log file to the server.4.一种终端,其特征在于,包括:4. A terminal, characterized in that it includes:至少一个处理器;以及,at least one processor; and,与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令能够执行如权利要求1或2所述的方法。The memory stores instructions executable by the at least one processor, the instructions being able to perform the method of claim 1 or 2.5.一种服务器,其特征在于,用于从如权利要求4所述的终端提取日志。5. A server, characterized in that it is used to extract logs from the terminal according to claim 4.6.根据权利要求5所述的服务器,其特征在于,所述服务器用于获取所述日志文件后,将所述日志文件保存在所述服务器对应的存储位置,如果所述存储位置保存的日志文件个数超出预定的数量,将所述日志文件替换最先保存的文件。6. The server according to claim 5, characterized in that after the server obtains the log file, it saves the log file in a storage location corresponding to the server. If the log saved in the storage location The number of files exceeds the predetermined number, and the log file is replaced with the first saved file.7.一种日志提取系统,其特征在于,包括:7. A log extraction system, characterized by including:如权利要求4所述的终端;和The terminal of claim 4; and如权利要求5或6所述的服务器。A server as claimed in claim 5 or 6.
CN201910505732.9A2019-06-122019-06-12Log extraction method and related equipmentActiveCN110362548B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910505732.9ACN110362548B (en)2019-06-122019-06-12Log extraction method and related equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910505732.9ACN110362548B (en)2019-06-122019-06-12Log extraction method and related equipment

Publications (2)

Publication NumberPublication Date
CN110362548A CN110362548A (en)2019-10-22
CN110362548Btrue CN110362548B (en)2023-11-14

Family

ID=68215744

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910505732.9AActiveCN110362548B (en)2019-06-122019-06-12Log extraction method and related equipment

Country Status (1)

CountryLink
CN (1)CN110362548B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113055455A (en)*2021-03-092021-06-29中国联合网络通信集团有限公司File uploading method and equipment
CN115576908A (en)*2021-07-052023-01-06北京字节跳动网络技术有限公司Log file sending method and device and client

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108011966A (en)*2017-12-142018-05-08广东金赋科技股份有限公司The optimization method that a kind of self-aided terminal log compression uploads
CN108737549A (en)*2018-05-252018-11-02江苏联盟信息工程有限公司A kind of log analysis method and device of big data quantity

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US10678619B2 (en)*2011-07-272020-06-09Pure Storage, Inc.Unified logs and device statistics

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108011966A (en)*2017-12-142018-05-08广东金赋科技股份有限公司The optimization method that a kind of self-aided terminal log compression uploads
CN108737549A (en)*2018-05-252018-11-02江苏联盟信息工程有限公司A kind of log analysis method and device of big data quantity

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于数据仓库的Web日志挖掘技术研究;席景科等;《计算机工程与设计》;20071231(第24期);全文*

Also Published As

Publication numberPublication date
CN110362548A (en)2019-10-22

Similar Documents

PublicationPublication DateTitle
CN110147411B (en)Data synchronization method, device, computer equipment and storage medium
CN107423436A (en)A kind of method migrated for online data between distinct type data-base
CN103312544B (en)A kind of control terminal reports the method, apparatus and system of journal file
US9346562B2 (en)Aircraft troubleshooting network
CN110858192A (en)Log query method and system, log checking system and query terminal
CN110362548B (en)Log extraction method and related equipment
CN104219327A (en)Distributed cache system
CN106897159A (en)A kind of system and method for gathering Data of Automatic Weather
CN113572834B (en)Patrol data uploading method, device, system and storage medium
CN101883009A (en) Method, system and network management equipment for automatic collection of reliability data
CN111124603A (en)CD-ROM mounting method, device and related equipment
CN112925759B (en)Data file processing method and device, storage medium and electronic device
CN107153539B (en)File interface system
CN113348450A (en)Vehicle-mounted data storage method and system
CN108111589A (en)Collecting method, device, equipment and computer readable storage medium
EP2615563A1 (en)Device for synchronously sharing files and method for synchronously sharing files
CN114356043A (en)Hard disk anti-vibration control method, device and system and storage medium
CN106453663B (en)Improved storage expansion method and device based on cloud service
CN118334772A (en) Vehicle log upload method, device, vehicle-side control device and storage medium
CN112835978A (en)Data storage method and device and computer equipment
CN113568939B (en)Energy consumption monitoring method, device, server and computer readable storage medium
CN114726486A (en)Data transmission method, tool, electronic device and computer readable storage medium
CN108280017A (en)A kind of System Event Log method for uploading, device, equipment and system
CN113190410A (en)Log collection method, system, client and storage medium
CN104717241A (en)File network sharing method, terminal and server

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information

Address after:518000 401, building B, No. 2, lanshui Industrial Zone, Longxin community, Baolong street, Longgang District, Shenzhen, Guangdong Province

Applicant after:Ocdop Ltd.

Address before:518000 room 602, 6 / F, Langfeng building, No. 2 Kefa Road, Yuehai street, Nanshan District, Shenzhen, Guangdong

Applicant before:SHENZHEN OCTOPUS TECHNOLOGY Co.,Ltd.

CB02Change of applicant information
TA01Transfer of patent application right
TA01Transfer of patent application right

Effective date of registration:20230831

Address after:518000 401, building B, No. 2, lanshui Industrial Zone, Longxin community, Baolong street, Longgang District, Shenzhen, Guangdong Province

Applicant after:Shenzhen Shenghui Technology Co.,Ltd.

Address before:518000 401, building B, No. 2, lanshui Industrial Zone, Longxin community, Baolong street, Longgang District, Shenzhen, Guangdong Province

Applicant before:Ocdop Ltd.

CB02Change of applicant information

Address after:518000 401, building 1, nantaiyun chuanggu Park, Southeast of the intersection of Guangming Avenue and Dongchang Road, Tangwei community, Fenghuang street, Guangming District, Shenzhen City, Guangdong Province

Applicant after:Shenzhen Shenghui Technology Co.,Ltd.

Address before:518000 401, building B, No. 2, lanshui Industrial Zone, Longxin community, Baolong street, Longgang District, Shenzhen, Guangdong Province

Applicant before:Shenzhen Shenghui Technology Co.,Ltd.

CB02Change of applicant information
GR01Patent grant
GR01Patent grant
PP01Preservation of patent right

Effective date of registration:20250826

Granted publication date:20231114

PP01Preservation of patent right

[8]ページ先頭

©2009-2025 Movatter.jp