Nothing Special   »   [go: up one dir, main page]

WO2019140828A1 - Electronic apparatus, method for querying logs in distributed system, and storage medium - Google Patents

Electronic apparatus, method for querying logs in distributed system, and storage medium Download PDF

Info

Publication number
WO2019140828A1
WO2019140828A1 PCT/CN2018/089452 CN2018089452W WO2019140828A1 WO 2019140828 A1 WO2019140828 A1 WO 2019140828A1 CN 2018089452 W CN2018089452 W CN 2018089452W WO 2019140828 A1 WO2019140828 A1 WO 2019140828A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
query
keyword
storage address
predetermined
Prior art date
Application number
PCT/CN2018/089452
Other languages
French (fr)
Chinese (zh)
Inventor
王丽
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019140828A1 publication Critical patent/WO2019140828A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing

Definitions

  • the present invention relates to the field of log processing and query, and in particular, to an electronic device, a distributed system log query method, and a storage medium.
  • the service background usually uses a distributed system to work, and stores the applications running on each server in the distributed system through a predetermined database.
  • the log (the log includes the keyword and the log generation time). If there is an application failure, the professional needs to generate a corresponding linux, vim, less, or tail text query command according to the business operation keyword and the time when the failure occurs. Log to determine the cause of the failure. This way of querying logs is very expensive for the host resources, the query efficiency is low, and the operation process is complicated and error-prone.
  • the present application provides an electronic device, a distributed system log query method, and a storage medium, which saves the occupancy rate of host resources in the log query process, improves query efficiency, and is simple and easy to implement.
  • the present application provides an electronic device including a memory and a processor connected to the memory, the processor for executing a distributed system log query program stored on the memory
  • the processor for executing a distributed system log query program stored on the memory
  • A1 The real-time acquisition of the log generation time of each application in the distributed system and the storage address of the log in the predetermined log storage file, and the mapping relationship between the acquired log generation time and the storage address is generated.
  • the mapping relationship is stored in a predetermined database;
  • the query parameter After receiving the log query command with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining the log corresponding to the log generation time that matches the query time.
  • Storage address the query parameter includes the query time;
  • A3 Obtain a log stored in the determined storage address, traverse the obtained log based on the query keyword, query a preset type keyword that matches the query keyword, and match the preset type keyword.
  • the corresponding log is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
  • the present application further provides a distributed system log query method, where the method includes the following steps:
  • S3 Obtain a log stored in the determined storage address, traverse the obtained log based on the query keyword, query a preset type keyword that matches the query keyword, and match the preset type keyword.
  • the corresponding log is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
  • the present application further provides a computer readable storage medium storing a distributed system log query program, the distributed system log query program being executable by at least one processor So that the at least one processor performs the following steps:
  • the real-time acquisition of the log generation time of each application in the distributed system and the storage address of the log in the predetermined log storage file, and the mapping relationship between the acquired log generation time and the storage address is generated.
  • the mapping relationship is stored in a predetermined database;
  • the query parameter After receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining the storage of the log corresponding to the log generation time that matches the query time.
  • An address, the query parameter includes the query time;
  • the log is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
  • the electronic device, the distributed system log query method, and the storage medium provided by the present application store the log generation time in the predetermined database and the log in the predetermined log storage file.
  • a mapping relationship between the storage addresses after receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to a predetermined log query rule, and determining the matching with the query time
  • the storage address of the log, the query parameter includes the query time, the log includes a log generation time, the log stored in the determined storage address is obtained, and the log obtained by traversing the query keyword is queried, and the query is queried.
  • the keyword matching the preset type keyword, and the log corresponding to the matched preset type keyword is returned to the client, the query parameter further includes a query keyword, and the log further includes a preset type keyword.
  • the occupancy rate of the host resources in the log query process is saved, the query efficiency is improved, and the operation process is simple and easy to implement.
  • FIG. 1 is a schematic diagram of an optional hardware architecture of an electronic device proposed by the present application.
  • FIG. 2 is a schematic diagram of a program module of a distributed system log query program in an embodiment of an electronic device of the present application
  • FIG. 3 is a flow chart of an implementation of a preferred embodiment of the distributed system log query method of the present application.
  • the electronic device 10 may include, but is not limited to, the memory 11, the processor 12, and the network interface 13 being communicably connected to each other through the communication bus 14. It should be noted that FIG. 1 only shows the electronic device 10 having the components 11-14, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the memory 11 includes at least one type of computer readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, SD or DX memory, etc.), a random access memory (RAM), and a static memory.
  • the memory 11 may be an internal storage unit of the electronic device 10, such as a hard disk or memory of the electronic device 10.
  • the memory 11 may also be an outsourced storage device of the electronic device 10, such as a plug-in hard disk equipped on the electronic device 10, a smart memory card (SMC), and a secure digital (Secure Digital, SD) ) cards, flash cards, etc.
  • the memory 11 can also include both an internal storage unit of the electronic device 10 and an outsourced storage device thereof.
  • the memory 11 is generally used to store an operating system installed on the electronic device 10 and various types of application software, such as a distributed system log query program. Further, the memory 11 can also be used to temporarily store various types of data that have been output or are to be output.
  • Processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments.
  • the processor 12 is typically used to control the overall operation of the electronic device 10.
  • the processor 12 is configured to run program code or processing data stored in the memory 11, such as a distributed distributed system log query program or the like.
  • the network interface 13 may include a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the electronic device 10 and other electronic devices.
  • Communication bus 14 is used to implement a communication connection between components 11-13.
  • Figure 1 shows only the electronic device 10 with components 11-14 and a distributed system log query program, but it should be understood that not all illustrated components may be implemented and that more or fewer components may be implemented instead. .
  • the electronic device 10 may further include a user interface (not shown in FIG. 1), and the user interface may include a display, an input unit such as a keyboard, wherein the user interface may further include a standard wired interface, a wireless interface, and the like.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED touch sensor or the like. Further, the display may also be referred to as a display screen or display unit for displaying information processed in the electronic device 10 and a user interface for displaying visualizations.
  • a controller interface is configured on a predetermined control center of the distributed system based on the springwebmvc architecture, and a request for calling a log is sent to the controller interface, and the controller interface responds to the request for calling the log,
  • the log-collector is invoked to execute a log collection command.
  • the log-collector is a preset type log collection system installed on each server in advance. After receiving the call request of the controller interface, the log collection system collects corresponding commands. a log generation time on the server and a storage address of the log in a predetermined log storage file, and returning the collected log generation time in the distributed system and the log in a predetermined log storage file Storage address
  • a mapping relationship between the acquired log generation time and the storage address is generated, and the mapping relationship is stored in a predetermined database.
  • the predetermined log storage file may be the same storage address on each server.
  • the predetermined log storage file is stored in the local disk C of each server.
  • the predetermined The log storage file may also be a different storage address on each server.
  • the predetermined log storage file is stored in the local disk C in some servers and in the local disk D in other servers.
  • the log collection system obtains a log generated by each application during operation and a storage address of the log in a predetermined log storage file by accessing a storage address of the predetermined log storage file, where the log includes Preset type keywords and log generation time.
  • preset type keywords include operation keywords and business keywords
  • the log generation time is in seconds.
  • the query parameter After receiving the log query command with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining a log corresponding to the log generation time that matches the query time.
  • Storage address the query parameter includes the query time;
  • the predetermined log query rule is, for example, if a log generation time matching the query time is searched from the predetermined database, the log generation time is generated according to the log. Determining a mapping relationship between storage addresses, and determining a storage address of a log corresponding to the log generation time;
  • the index of the storage address of the predetermined log storage file is generated according to a predetermined index generation rule
  • the index includes an initial query address and an end query address
  • the predetermined index generation rule is, for example, acquiring an initial storage address and an ending storage address of the predetermined log storage file, and calculating the location An initial storage address and an intermediate storage address of the end storage address
  • the initial query address is set as the initial storage address, and the end query address is defined as the intermediate storage address;
  • the initial query address is set as the intermediate storage address
  • the end query address is set as the end storage address
  • the log is returned to the client, and the query parameter further includes a query keyword, and the log further includes a preset type keyword.
  • the electronic device proposed by the present application records the relationship between the generation time of the log in the predetermined database and the storage address of the log in the predetermined log storage file; After the log query command with the query parameter is sent, the query parameter and the mapping relationship are analyzed according to a predetermined log query rule, and the storage address of the log matching the query time is determined, and the query parameter includes the The query time includes the log generation time, the log stored in the determined storage address, the log obtained by the query keyword traversal, and the preset type keyword matching the query keyword, and Returning the log corresponding to the matched preset type keyword to the client, the query parameter further includes a query keyword, and the log further includes a preset type keyword.
  • the occupancy rate of the host resources in the log query process is saved, the query efficiency is improved, and the operation process is simple and easy to implement.
  • the distributed system log query program of the present application may be described by using a program module having the same function according to different functions implemented by each part thereof.
  • FIG. 2 is a schematic diagram of a program module of a distributed system log query program in an embodiment of the electronic device of the present application.
  • the distributed system log query program may be divided into the obtaining module 201, the analyzing module 202, and the query module 203 according to different functions implemented by the respective parts.
  • the program module referred to in the present application refers to a series of computer program instruction segments capable of performing a specific function, and is more suitable than the program to describe the execution process of the distributed system log query program in the electronic device 10.
  • the functions or operational steps implemented by the modules 201 to 203 are similar to the above, and are not described in detail herein, by way of example, for example:
  • the obtaining module 201 is configured to obtain, in real time, a generation time of a corresponding log of each application in the distributed system and a storage address of the log in a predetermined log storage file, and generate a mapping between the acquired log generation time and the storage address. Relationship, storing the mapping relationship in a predetermined database;
  • the analyzing module 202 is configured to analyze the query parameter and the mapping relationship according to a predetermined log query rule after receiving a log query instruction with a query parameter sent by the client, and determine a log generation time that matches the query time. a storage address of the corresponding log, where the query parameter includes the query time;
  • the query module 203 is configured to obtain a log stored in the determined storage address, traverse the obtained log based on the query keyword, query a preset type keyword that matches the query keyword, and match the preset
  • the log corresponding to the type keyword is returned to the client, and the query parameter further includes a query keyword, and the log further includes a preset type keyword.
  • the present application also provides a distributed system log query method.
  • the distributed system log query method includes the following steps:
  • step S301 the generation time of the corresponding log of each application in the distributed system and the storage address of the log in the predetermined log storage file are obtained in real time, and the mapping relationship between the acquired log generation time and the storage address is generated. Storing the mapping relationship in a predetermined database;
  • a controller interface is configured on a predetermined control center of the distributed system based on the springwebmvc architecture, and a request for calling a log is sent to the controller interface, and the controller interface responds to the request for calling the log,
  • the log-collector is invoked to execute a log collection command.
  • the log-collector is a preset type log collection system installed on each server in advance. After receiving the call request of the controller interface, the log collection system collects corresponding commands. a log generation time on the server and a storage address of the log in a predetermined log storage file, and returning the collected log generation time in the distributed system and the log in a predetermined log storage file Storage address
  • a mapping relationship between the acquired log generation time and the storage address is generated, and the mapping relationship is stored in a predetermined database.
  • the predetermined log storage file may be the same storage address on each server.
  • the predetermined log storage file is stored in the local disk C of each server.
  • the predetermined The log storage file may also be a different storage address on each server.
  • the predetermined log storage file is stored in the local disk C in some servers and in the local disk D in other servers.
  • the log collection system obtains a log generated by each application during operation and a storage address of the log in a predetermined log storage file by accessing a storage address of the predetermined log storage file, where the log includes Preset type keywords and log generation time.
  • preset type keywords include operation keywords and business keywords
  • the log generation time is in seconds.
  • Step S302 after receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining the log generation time corresponding to the query time. a storage address of the log, where the query parameter includes the query time;
  • the predetermined log query rule is, for example, if a log generation time matching the query time is searched from the predetermined database, the log generation time is generated according to the log. Determining a mapping relationship between storage addresses, and determining a storage address of a log corresponding to the log generation time;
  • the index of the storage address of the predetermined log storage file is generated according to a predetermined index generation rule
  • the index includes an initial query address and an end query address
  • the predetermined index generation rule is, for example, acquiring an initial storage address and an ending storage address of the predetermined log storage file, and calculating the location An initial storage address and an intermediate storage address of the end storage address
  • the initial query address is set as the initial storage address, and the end query address is defined as the intermediate storage address;
  • the initial query address is set as the intermediate storage address
  • the end query address is set as the end storage address
  • Step S303 Acquire a log stored in the determined storage address, traverse the obtained log based on the query keyword, and query a preset type keyword that matches the query keyword, and match the preset type key.
  • the log corresponding to the word is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
  • the distributed system proposed by the present application stores the log generation time in the predetermined database and the storage relationship between the log and the storage address in the predetermined log storage file; After the log query command with the query parameter is sent, the query parameter and the mapping relationship are analyzed according to a predetermined log query rule, and the storage address of the log matching the query time is determined, and the query parameter includes the The query time includes the log generation time, the log stored in the determined storage address, the log obtained by the query keyword traversal, and the preset type keyword matching the query keyword, and Returning the log corresponding to the matched preset type keyword to the client, the query parameter further includes a query keyword, and the log further includes a preset type keyword.
  • the occupancy rate of the host resources in the log query process is saved, the query efficiency is improved, and the operation process is simple and easy to implement.
  • the present application further provides a computer readable storage medium on which a distributed system log query program is stored, and when the distributed system log query program is executed by the processor, the following operations are implemented:
  • the real-time acquisition of the log generation time of each application in the distributed system and the storage address of the log in the predetermined log storage file, and the mapping relationship between the acquired log generation time and the storage address is generated.
  • the mapping relationship is stored in a predetermined database;
  • the query parameter After receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining the storage of the log corresponding to the log generation time that matches the query time.
  • An address, the query parameter includes the query time;
  • the log is returned to the client, and the query parameter further includes a query keyword, and the log further includes a preset type keyword.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
  • Implementation Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.

Landscapes

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

Abstract

Disclosed are an electronic apparatus, a method for querying logs in a distributed system, and a storage medium. The method comprises: storing, in a pre-determined database, a mapping relationship between the generation time of logs and the storage addresses of the logs in a pre-determined log storage file; after a log query instruction which is sent by a client and carries query parameters is received, according to a pre-determined log query rule, analyzing the query parameters and the mapping relationship to determine the storage address of the log generation time matching the query time; and acquiring logs stored at the determined storage address, traversing the acquired logs based on a query keyword to query a keyword of pre-set type matching the query keyword, and returning a log corresponding to the matching keyword of pre-set type to the client. An occupancy rate of host resources in the log query process is reduced, the query efficiency is improved, and the operating process is simple and is easy to implement.

Description

电子装置、分布式系统日志查询方法及存储介质Electronic device, distributed system log query method and storage medium
本申请要求于2018年01月17日提交中国专利局、申请号为201810042991.8、发明名称为“电子装置、分布式系统日志查询方法及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims priority to Chinese Patent Application No. 201810042991.8, entitled "Electronic Device, Distributed System Log Query Method and Storage Medium", filed on January 17, 2018, the entire contents of which are hereby incorporated by reference. Combined in the application.
技术领域Technical field
本申请涉互日志处理查询领域,尤其涉及一种电子装置、分布式系统日志查询方法及存储介质。The present invention relates to the field of log processing and query, and in particular, to an electronic device, a distributed system log query method, and a storage medium.
背景技术Background technique
随着互联网技术的发展以及互联网应用的普及,企业为了满足日益增长的业务需求,服务后台通常采用分布式系统来工作,并通过预先确定的数据库存储分布式系统中每台服务器上运行的应用程序的日志(日志包括关键字和日志生成时间),一旦有应用程序出现故障,则需要专业人员根据业务操作关键字和故障发生的时间生成对应的linux、vim、less、或tail等文本查询命令查询日志,以确定故障发生的原因。这种查询日志的方式对主机资源消耗很大,查询效率低不高,且操作过程复杂容易出错。With the development of Internet technology and the popularity of Internet applications, in order to meet the growing business needs, the service background usually uses a distributed system to work, and stores the applications running on each server in the distributed system through a predetermined database. The log (the log includes the keyword and the log generation time). If there is an application failure, the professional needs to generate a corresponding linux, vim, less, or tail text query command according to the business operation keyword and the time when the failure occurs. Log to determine the cause of the failure. This way of querying logs is very expensive for the host resources, the query efficiency is low, and the operation process is complicated and error-prone.
发明内容Summary of the invention
有鉴于此,本申请提出一种电子装置、分布式系统日志查询方法及存储介质,节省了日志查询过程中对主机资源的占用率,提高查询效率,且操作过程简单易实现。In view of this, the present application provides an electronic device, a distributed system log query method, and a storage medium, which saves the occupancy rate of host resources in the log query process, improves query efficiency, and is simple and easy to implement.
首先,为实现上述目的,本申请提出一种电子装置,所述电子装置包括存储器、及与所述存储器连接的处理器,所述处理器用于执行所述存储器上存储的分布式系统日志查询程序,所述分布式系统日志查询程序被所述处理 器执行时实现如下步骤:First, in order to achieve the above object, the present application provides an electronic device including a memory and a processor connected to the memory, the processor for executing a distributed system log query program stored on the memory When the distributed system log query program is executed by the processor, the following steps are implemented:
A1、实时获取分布式系统中各个应用程序对应日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址,生成获取的日志生成时间与所述存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中;A1. The real-time acquisition of the log generation time of each application in the distributed system and the storage address of the log in the predetermined log storage file, and the mapping relationship between the acquired log generation time and the storage address is generated. The mapping relationship is stored in a predetermined database;
A2、在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志生成时间对应的日志的存储地址,所述查询参数包括所述查询时间;After receiving the log query command with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining the log corresponding to the log generation time that matches the query time. Storage address, the query parameter includes the query time;
A3、获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志包括预设类型关键字。A3: Obtain a log stored in the determined storage address, traverse the obtained log based on the query keyword, query a preset type keyword that matches the query keyword, and match the preset type keyword. The corresponding log is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
此外,为实现上述目的,本申请还提供一种分布式系统日志查询方法,所述方法包括如下步骤:In addition, to achieve the above object, the present application further provides a distributed system log query method, where the method includes the following steps:
S1、实时获取分布式系统中各个应用程序对应日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址,生成获取的日志生成时间与所述存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中;S1. The real-time acquisition of the log generation time of each application in the distributed system and the storage address of the log in the predetermined log storage file, and the mapping relationship between the acquired log generation time and the storage address is generated. The mapping relationship is stored in a predetermined database;
S2、在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志生成时间对应的日志的存储地址,所述查询参数包括所述查询时间,所述日志包括日志生成时间;S2: After receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining a log corresponding to the log generation time that matches the query time. Storage address, the query parameter includes the query time, and the log includes a log generation time;
S3、获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志包括预设类型关键字。S3: Obtain a log stored in the determined storage address, traverse the obtained log based on the query keyword, query a preset type keyword that matches the query keyword, and match the preset type keyword. The corresponding log is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述 计算机可读存储介质存储有分布式系统日志查询程序,所述分布式系统日志查询程序可被至少一个处理器执行,以使所述至少一个处理器执行如下步骤:In addition, in order to achieve the above object, the present application further provides a computer readable storage medium storing a distributed system log query program, the distributed system log query program being executable by at least one processor So that the at least one processor performs the following steps:
实时获取分布式系统中各个应用程序对应日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址,生成获取的日志生成时间与所述存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中;The real-time acquisition of the log generation time of each application in the distributed system and the storage address of the log in the predetermined log storage file, and the mapping relationship between the acquired log generation time and the storage address is generated. The mapping relationship is stored in a predetermined database;
在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志生成时间对应的日志的存储地址,所述查询参数包括所述查询时间;After receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining the storage of the log corresponding to the log generation time that matches the query time. An address, the query parameter includes the query time;
获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志包括预设类型关键字。Obtaining a log stored in the determined storage address, traversing the obtained log based on the query keyword, and querying a preset type keyword that matches the query keyword, and matching the matching preset type keyword The log is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
相较于现有技术,本申请所提出的电子装置、分布式系统日志查询方法及存储介质,通过在预先确定的数据库中存储日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址之间的映射关系;在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志的存储地址,所述查询参数包括所述查询时间,所述日志包括日志生成时间;获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志还包括预设类型关键字。节省了日志查询过程中对主机资源的占用率,提高查询效率,且操作过程简单易实现。Compared with the prior art, the electronic device, the distributed system log query method, and the storage medium provided by the present application store the log generation time in the predetermined database and the log in the predetermined log storage file. A mapping relationship between the storage addresses; after receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to a predetermined log query rule, and determining the matching with the query time The storage address of the log, the query parameter includes the query time, the log includes a log generation time, the log stored in the determined storage address is obtained, and the log obtained by traversing the query keyword is queried, and the query is queried. The keyword matching the preset type keyword, and the log corresponding to the matched preset type keyword is returned to the client, the query parameter further includes a query keyword, and the log further includes a preset type keyword. The occupancy rate of the host resources in the log query process is saved, the query efficiency is improved, and the operation process is simple and easy to implement.
附图说明DRAWINGS
图1是本申请提出的电子装置一可选的硬件架构的示意图;1 is a schematic diagram of an optional hardware architecture of an electronic device proposed by the present application;
图2是本申请电子装置一实施例中分布式系统日志查询程序的程序模块示意图;2 is a schematic diagram of a program module of a distributed system log query program in an embodiment of an electronic device of the present application;
图3是本申请分布式系统日志查询方法较佳实施例的实施流程图。3 is a flow chart of an implementation of a preferred embodiment of the distributed system log query method of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the descriptions of "first", "second" and the like in the present application are for the purpose of description only, and are not to be construed as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. . Thus, features defining "first" or "second" may include at least one of the features, either explicitly or implicitly. In addition, the technical solutions between the various embodiments may be combined with each other, but must be based on the realization of those skilled in the art, and when the combination of the technical solutions is contradictory or impossible to implement, it should be considered that the combination of the technical solutions does not exist. Nor is it within the scope of protection required by this application.
参阅图1所示,是本申请提出的电子装置一可选的硬件架构示意图。本实施例中,电子装置10可包括,但不仅限于,可通过通信总线14相互通信连接存储器11、处理器12、网络接口13。需要指出的是,图1仅示出了具有组件11-14的电子装置10,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。Referring to FIG. 1 , it is an optional hardware architecture diagram of the electronic device proposed by the present application. In this embodiment, the electronic device 10 may include, but is not limited to, the memory 11, the processor 12, and the network interface 13 being communicably connected to each other through the communication bus 14. It should be noted that FIG. 1 only shows the electronic device 10 having the components 11-14, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
其中,存储器11至少包括一种类型的计算机可读存储介质,计算机可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器 等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器11可以是电子装置10的内部存储单元,例如电子装置10的硬盘或内存。在另一些实施例中,存储器11也可以是电子装置10的外包存储设备,例如电子装置10上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器11还可以既包括电子装置10的内部存储单元也包括其外包存储设备。本实施例中,存储器11通常用于存储安装于电子装置10的操作系统和各类应用软件,例如分布式系统日志查询程序等。此外,存储器11还可以用于暂时地存储已经输出或者将要输出的各类数据。The memory 11 includes at least one type of computer readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, SD or DX memory, etc.), a random access memory (RAM), and a static memory. Random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, and the like. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 10, such as a hard disk or memory of the electronic device 10. In other embodiments, the memory 11 may also be an outsourced storage device of the electronic device 10, such as a plug-in hard disk equipped on the electronic device 10, a smart memory card (SMC), and a secure digital (Secure Digital, SD) ) cards, flash cards, etc. Of course, the memory 11 can also include both an internal storage unit of the electronic device 10 and an outsourced storage device thereof. In this embodiment, the memory 11 is generally used to store an operating system installed on the electronic device 10 and various types of application software, such as a distributed system log query program. Further, the memory 11 can also be used to temporarily store various types of data that have been output or are to be output.
处理器12在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。处理器12通常用于控制电子装置10的总体操作。本实施例中,处理器12用于运行存储器11中存储的程序代码或者处理数据,例如运行的分布式系统日志查询程序等。 Processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 12 is typically used to control the overall operation of the electronic device 10. In this embodiment, the processor 12 is configured to run program code or processing data stored in the memory 11, such as a distributed distributed system log query program or the like.
网络接口13可包括无线网络接口或有线网络接口,网络接口13通常用于在电子装置10与其他电子设备之间建立通信连接。The network interface 13 may include a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the electronic device 10 and other electronic devices.
通信总线14用于实现组件11-13之间的通信连接。 Communication bus 14 is used to implement a communication connection between components 11-13.
图1仅示出了具有组件11-14以及分布式系统日志查询程序的电子装置10,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。Figure 1 shows only the electronic device 10 with components 11-14 and a distributed system log query program, but it should be understood that not all illustrated components may be implemented and that more or fewer components may be implemented instead. .
可选地,电子装置10还可以包括用户接口(图1中未示出),用户接口可以包括显示器、输入单元比如键盘,其中,用户接口还可以包括标准的有线接口、无线接口等。Optionally, the electronic device 10 may further include a user interface (not shown in FIG. 1), and the user interface may include a display, an input unit such as a keyboard, wherein the user interface may further include a standard wired interface, a wireless interface, and the like.
可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触 控式液晶显示器以及OLED触摸器等。进一步地,显示器也可称为显示屏或显示单元,用于显示在电子装置10中处理信息以及用于显示可视化的用户界面。Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED touch sensor or the like. Further, the display may also be referred to as a display screen or display unit for displaying information processed in the electronic device 10 and a user interface for displaying visualizations.
在一实施例中,存储器11中存储的分布式系统日志查询程序被处理器12执行时,实现如下操作:In an embodiment, when the distributed system log query program stored in the memory 11 is executed by the processor 12, the following operations are implemented:
获取分布式系统中日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址,生成获取的日志生成时间与存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中;Obtaining a log generation time in the distributed system and a storage address of the log in a predetermined log storage file, generating a mapping relationship between the acquired log generation time and the storage address, and storing the mapping relationship in a predetermined In the database;
在本实施例中,通过基于springwebmvc架构在预先确定的所述分布式系统的控制中心上构建controller接口,向所述controller接口发送调用日志的请求,所述controller接口响应所述调用日志的请求,调用log-collector来执行日志收集指令,所述log-collector为预先分别在各服务器上安装的预设类型日志收集系统,所述日志收集系统接收到所述controller接口的调用请求后,收集对应的服务器上的日志生成时间及所述日志在预先确定的日志存储文件中的存储地址,并返回收集到的所述分布式系统中日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址;In this embodiment, a controller interface is configured on a predetermined control center of the distributed system based on the springwebmvc architecture, and a request for calling a log is sent to the controller interface, and the controller interface responds to the request for calling the log, The log-collector is invoked to execute a log collection command. The log-collector is a preset type log collection system installed on each server in advance. After receiving the call request of the controller interface, the log collection system collects corresponding commands. a log generation time on the server and a storage address of the log in a predetermined log storage file, and returning the collected log generation time in the distributed system and the log in a predetermined log storage file Storage address
生成获取的日志生成时间与存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中。A mapping relationship between the acquired log generation time and the storage address is generated, and the mapping relationship is stored in a predetermined database.
在本实施例中,预先确定的日志存储文件可以是各服务器上相同的存储地址,例如,预先确定的日志存储文件存储在各台服务器的本地磁盘C中,在其他实施方式中,预先确定的日志存储文件也可以是各服务器上不同的存储地址,例如,预先确定的日志存储文件在部分服务器中存储在本地磁盘C中,在其他的服务器中存储在本地磁盘D中。In this embodiment, the predetermined log storage file may be the same storage address on each server. For example, the predetermined log storage file is stored in the local disk C of each server. In other embodiments, the predetermined The log storage file may also be a different storage address on each server. For example, the predetermined log storage file is stored in the local disk C in some servers and in the local disk D in other servers.
所述日志收集系统通过访问预先确定的日志存储文件的存储地址来获取各个应用程序在运行过程中产生的日志及所述日志在预先确定的日志存储文件中的存储地址;其中,所述日志包括预设类型关键字和日志生成时间,例 如预设类型关键字包括操作关键字和业务关键字,日志生成时间以秒为单位。The log collection system obtains a log generated by each application during operation and a storage address of the log in a predetermined log storage file by accessing a storage address of the predetermined log storage file, where the log includes Preset type keywords and log generation time. For example, preset type keywords include operation keywords and business keywords, and the log generation time is in seconds.
在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与所述查询时间相匹配的日志生成时间对应的日志的存储地址,所述查询参数包括所述查询时间;After receiving the log query command with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining a log corresponding to the log generation time that matches the query time. Storage address, the query parameter includes the query time;
在本实施例中,所述预先确定的日志查询规则是,例如,若从所述预先确定的数据库中搜索出与所述查询时间相匹配的日志生成时间,则根据所述日志生成时间与所述存储地址之间的映射关系,确定该日志生成时间对应的日志的存储地址;In this embodiment, the predetermined log query rule is, for example, if a log generation time matching the query time is searched from the predetermined database, the log generation time is generated according to the log. Determining a mapping relationship between storage addresses, and determining a storage address of a log corresponding to the log generation time;
若从所述预先确定的数据库中搜索不出与所述查询时间相匹配的日志生成时间,则根据预先确定的索引生成规则生成所述预先确定的日志存储文件的存储地址的索引;And if the log generation time that matches the query time is not found in the predetermined database, the index of the storage address of the predetermined log storage file is generated according to a predetermined index generation rule;
基于所述索引遍历所述预先确定的日志存储文件的存储地址,查询出与所述查询参数相匹配的日志生成时间对应的日志的存储地址。And storing, according to the index, the storage address of the predetermined log storage file, and querying a storage address of a log corresponding to the log generation time that matches the query parameter.
在本实施例中,所述索引包括初始查询地址及结束查询地址;所述预先确定的索引生成规则是,例如,获取所述预先确定的日志存储文件的初始存储地址及结束存储地址,计算所述初始存储地址及所述结束存储地址的中间存储地址;In this embodiment, the index includes an initial query address and an end query address; the predetermined index generation rule is, for example, acquiring an initial storage address and an ending storage address of the predetermined log storage file, and calculating the location An initial storage address and an intermediate storage address of the end storage address;
获取所述中间存储地址存储的日志,判断获取的日志对应的日志生成时间与查询时间之间的大小关系;Acquiring the log stored in the intermediate storage address, and determining the size relationship between the log generation time and the query time corresponding to the obtained log;
若获取的日志生成时间大于查询时间,则设置所述初始查询地址为所述初始存储地址,定义所述结束查询地址为该中间存储地址;If the generated log generation time is greater than the query time, the initial query address is set as the initial storage address, and the end query address is defined as the intermediate storage address;
若获取的日志生成时间小于查询时间,则设置所述初始查询地址为该中间存储地址,设置所述结束查询地址为所述结束存储地址。If the obtained log generation time is less than the query time, the initial query address is set as the intermediate storage address, and the end query address is set as the end storage address.
获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设 类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志还包括预设类型关键字。Obtaining a log stored in the determined storage address, traversing the obtained log based on the query keyword, and querying a preset type keyword that matches the query keyword, and matching the matching preset type keyword The log is returned to the client, and the query parameter further includes a query keyword, and the log further includes a preset type keyword.
由上述事实施例可知,本申请提出的电子装置通过在预先确定的数据库中存储日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址之间的映射关系;在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志的存储地址,所述查询参数包括所述查询时间,所述日志包括日志生成时间;获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志还包括预设类型关键字。节省了日志查询过程中对主机资源的占用率,提高查询效率,且操作过程简单易实现。It can be seen from the above embodiments that the electronic device proposed by the present application records the relationship between the generation time of the log in the predetermined database and the storage address of the log in the predetermined log storage file; After the log query command with the query parameter is sent, the query parameter and the mapping relationship are analyzed according to a predetermined log query rule, and the storage address of the log matching the query time is determined, and the query parameter includes the The query time includes the log generation time, the log stored in the determined storage address, the log obtained by the query keyword traversal, and the preset type keyword matching the query keyword, and Returning the log corresponding to the matched preset type keyword to the client, the query parameter further includes a query keyword, and the log further includes a preset type keyword. The occupancy rate of the host resources in the log query process is saved, the query efficiency is improved, and the operation process is simple and easy to implement.
进一步需要说明的是,本申请的分布式系统日志查询程序依据其各部分所实现的功能不同,可用具有相同功能的程序模块进行描述。请参阅图2所示,是本申请电子装置一实施例中分布式系统日志查询程序的程序模块示意图。本实施例中,分布式系统日志查询程序依据其各部分所实现的功能的不同,可以被分割成获取模块201、分析模块202、查询模块203。由上面的描述可知,本申请所称的程序模块是指能够完成特定功能的一系列计算机程序指令段,比程序更适合于描述分布式系统日志查询程序在电子装置10中的执行过程。所述模块201至模块203所实现的功能或操作步骤均与上文类似,此处不再详述,示例性地,例如其中:It should be further noted that the distributed system log query program of the present application may be described by using a program module having the same function according to different functions implemented by each part thereof. Please refer to FIG. 2 , which is a schematic diagram of a program module of a distributed system log query program in an embodiment of the electronic device of the present application. In this embodiment, the distributed system log query program may be divided into the obtaining module 201, the analyzing module 202, and the query module 203 according to different functions implemented by the respective parts. As can be seen from the above description, the program module referred to in the present application refers to a series of computer program instruction segments capable of performing a specific function, and is more suitable than the program to describe the execution process of the distributed system log query program in the electronic device 10. The functions or operational steps implemented by the modules 201 to 203 are similar to the above, and are not described in detail herein, by way of example, for example:
获取模块201用于实时获取分布式系统中各个应用程序对应日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址,生成获取的日志生成时间与所述存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中;The obtaining module 201 is configured to obtain, in real time, a generation time of a corresponding log of each application in the distributed system and a storage address of the log in a predetermined log storage file, and generate a mapping between the acquired log generation time and the storage address. Relationship, storing the mapping relationship in a predetermined database;
分析模块202用于在接收到客户端发送的带有查询参数的日志查询指令 后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志生成时间对应的日志的存储地址,所述查询参数包括所述查询时间;The analyzing module 202 is configured to analyze the query parameter and the mapping relationship according to a predetermined log query rule after receiving a log query instruction with a query parameter sent by the client, and determine a log generation time that matches the query time. a storage address of the corresponding log, where the query parameter includes the query time;
查询模块203用于获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志还包括预设类型关键字。The query module 203 is configured to obtain a log stored in the determined storage address, traverse the obtained log based on the query keyword, query a preset type keyword that matches the query keyword, and match the preset The log corresponding to the type keyword is returned to the client, and the query parameter further includes a query keyword, and the log further includes a preset type keyword.
此外,本申请还提出一种分布式系统日志查询方法,请参阅图3所示,所述分布式系统日志查询方法包括如下步骤:In addition, the present application also provides a distributed system log query method. Referring to FIG. 3, the distributed system log query method includes the following steps:
步骤S301,实时获取分布式系统中各个应用程序对应日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址,生成获取的日志生成时间与所述存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中;In step S301, the generation time of the corresponding log of each application in the distributed system and the storage address of the log in the predetermined log storage file are obtained in real time, and the mapping relationship between the acquired log generation time and the storage address is generated. Storing the mapping relationship in a predetermined database;
在本实施例中,通过基于springwebmvc架构在预先确定的所述分布式系统的控制中心上构建controller接口,向所述controller接口发送调用日志的请求,所述controller接口响应所述调用日志的请求,调用log-collector来执行日志收集指令,所述log-collector为预先分别在各服务器上安装的预设类型日志收集系统,所述日志收集系统接收到所述controller接口的调用请求后,收集对应的服务器上的日志生成时间及所述日志在预先确定的日志存储文件中的存储地址,并返回收集到的所述分布式系统中日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址;In this embodiment, a controller interface is configured on a predetermined control center of the distributed system based on the springwebmvc architecture, and a request for calling a log is sent to the controller interface, and the controller interface responds to the request for calling the log, The log-collector is invoked to execute a log collection command. The log-collector is a preset type log collection system installed on each server in advance. After receiving the call request of the controller interface, the log collection system collects corresponding commands. a log generation time on the server and a storage address of the log in a predetermined log storage file, and returning the collected log generation time in the distributed system and the log in a predetermined log storage file Storage address
生成获取的日志生成时间与存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中。A mapping relationship between the acquired log generation time and the storage address is generated, and the mapping relationship is stored in a predetermined database.
在本实施例中,预先确定的日志存储文件可以是各服务器上相同的存储地址,例如,预先确定的日志存储文件存储在各台服务器的本地磁盘C中,在其他实施方式中,预先确定的日志存储文件也可以是各服务器上不同的存 储地址,例如,预先确定的日志存储文件在部分服务器中存储在本地磁盘C中,在其他的服务器中存储在本地磁盘D中。In this embodiment, the predetermined log storage file may be the same storage address on each server. For example, the predetermined log storage file is stored in the local disk C of each server. In other embodiments, the predetermined The log storage file may also be a different storage address on each server. For example, the predetermined log storage file is stored in the local disk C in some servers and in the local disk D in other servers.
所述日志收集系统通过访问预先确定的日志存储文件的存储地址来获取各个应用程序在运行过程中产生的日志及所述日志在预先确定的日志存储文件中的存储地址;其中,所述日志包括预设类型关键字和日志生成时间,例如预设类型关键字包括操作关键字和业务关键字,日志生成时间以秒为单位。The log collection system obtains a log generated by each application during operation and a storage address of the log in a predetermined log storage file by accessing a storage address of the predetermined log storage file, where the log includes Preset type keywords and log generation time. For example, preset type keywords include operation keywords and business keywords, and the log generation time is in seconds.
步骤S302,在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志生成时间对应的日志的存储地址,所述查询参数包括所述查询时间;Step S302, after receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining the log generation time corresponding to the query time. a storage address of the log, where the query parameter includes the query time;
在本实施例中,所述预先确定的日志查询规则是,例如,若从所述预先确定的数据库中搜索出与所述查询时间相匹配的日志生成时间,则根据所述日志生成时间与所述存储地址之间的映射关系,确定该日志生成时间对应的日志的存储地址;In this embodiment, the predetermined log query rule is, for example, if a log generation time matching the query time is searched from the predetermined database, the log generation time is generated according to the log. Determining a mapping relationship between storage addresses, and determining a storage address of a log corresponding to the log generation time;
若从所述预先确定的数据库中搜索不出与所述查询时间相匹配的日志生成时间,则根据预先确定的索引生成规则生成所述预先确定的日志存储文件的存储地址的索引;And if the log generation time that matches the query time is not found in the predetermined database, the index of the storage address of the predetermined log storage file is generated according to a predetermined index generation rule;
基于所述索引遍历所述预先确定的日志存储文件的存储地址,查询出与所述查询参数相匹配的日志生成时间对应的日志的存储地址。And storing, according to the index, the storage address of the predetermined log storage file, and querying a storage address of a log corresponding to the log generation time that matches the query parameter.
在本实施例中,所述索引包括初始查询地址及结束查询地址;所述预先确定的索引生成规则是,例如,获取所述预先确定的日志存储文件的初始存储地址及结束存储地址,计算所述初始存储地址及所述结束存储地址的中间存储地址;In this embodiment, the index includes an initial query address and an end query address; the predetermined index generation rule is, for example, acquiring an initial storage address and an ending storage address of the predetermined log storage file, and calculating the location An initial storage address and an intermediate storage address of the end storage address;
获取所述中间存储地址存储的日志,判断获取的日志对应的日志生成时间与查询时间之间的大小关系;Acquiring the log stored in the intermediate storage address, and determining the size relationship between the log generation time and the query time corresponding to the obtained log;
若获取的日志生成时间大于查询时间,则设置所述初始查询地址为所述 初始存储地址,定义所述结束查询地址为该中间存储地址;And if the obtained log generation time is greater than the query time, the initial query address is set as the initial storage address, and the end query address is defined as the intermediate storage address;
若获取的日志生成时间小于查询时间,则设置所述初始查询地址为该中间存储地址,设置所述结束查询地址为所述结束存储地址。If the obtained log generation time is less than the query time, the initial query address is set as the intermediate storage address, and the end query address is set as the end storage address.
步骤S303,获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志包括预设类型关键字。Step S303: Acquire a log stored in the determined storage address, traverse the obtained log based on the query keyword, and query a preset type keyword that matches the query keyword, and match the preset type key. The log corresponding to the word is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
由上述事实例可知,本申请提出的分布式系统通过在预先确定的数据库中存储日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址之间的映射关系;在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志的存储地址,所述查询参数包括所述查询时间,所述日志包括日志生成时间;获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志还包括预设类型关键字。节省了日志查询过程中对主机资源的占用率,提高查询效率,且操作过程简单易实现。It can be seen from the above facts that the distributed system proposed by the present application stores the log generation time in the predetermined database and the storage relationship between the log and the storage address in the predetermined log storage file; After the log query command with the query parameter is sent, the query parameter and the mapping relationship are analyzed according to a predetermined log query rule, and the storage address of the log matching the query time is determined, and the query parameter includes the The query time includes the log generation time, the log stored in the determined storage address, the log obtained by the query keyword traversal, and the preset type keyword matching the query keyword, and Returning the log corresponding to the matched preset type keyword to the client, the query parameter further includes a query keyword, and the log further includes a preset type keyword. The occupancy rate of the host resources in the log query process is saved, the query efficiency is improved, and the operation process is simple and easy to implement.
此外,本申请还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有分布式系统日志查询程序,所述分布式系统日志查询程序被处理器执行时实现如下操作:In addition, the present application further provides a computer readable storage medium on which a distributed system log query program is stored, and when the distributed system log query program is executed by the processor, the following operations are implemented:
实时获取分布式系统中各个应用程序对应日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址,生成获取的日志生成时间与所述存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中;The real-time acquisition of the log generation time of each application in the distributed system and the storage address of the log in the predetermined log storage file, and the mapping relationship between the acquired log generation time and the storage address is generated. The mapping relationship is stored in a predetermined database;
在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志生成时间对应的日志的存储地址,所述查询参数包括所述查询时间;After receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining the storage of the log corresponding to the log generation time that matches the query time. An address, the query parameter includes the query time;
获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志还包括预设类型关键字。Obtaining a log stored in the determined storage address, traversing the obtained log based on the query keyword, and querying a preset type keyword that matches the query keyword, and matching the matching preset type keyword The log is returned to the client, and the query parameter further includes a query keyword, and the log further includes a preset type keyword.
本申请计算机可读存储介质具体实施方式与上述电子装置以及分布式系统日志查询方法各实施例基本相同,在此不作累述。The specific embodiment of the computer readable storage medium of the present application is substantially the same as the foregoing embodiments of the electronic device and the distributed system log query method, and is not described herein.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only a preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.

Claims (20)

  1. 一种电子装置,其特征在于,所述电子装置包括存储器、及与所述存储器连接的处理器,所述处理器用于执行所述存储器上存储的分布式系统日志查询程序,所述分布式系统日志查询程序被所述处理器执行时实现如下步骤:An electronic device, comprising: a memory, and a processor coupled to the memory, the processor configured to execute a distributed system log query program stored on the memory, the distributed system The log query program is implemented by the processor to implement the following steps:
    A1、实时获取分布式系统中各个应用程序对应日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址,生成获取的日志生成时间与所述存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中;A1. The real-time acquisition of the log generation time of each application in the distributed system and the storage address of the log in the predetermined log storage file, and the mapping relationship between the acquired log generation time and the storage address is generated. The mapping relationship is stored in a predetermined database;
    A2、在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志生成时间对应的日志的存储地址,所述查询参数包括所述查询时间;After receiving the log query command with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining the log corresponding to the log generation time that matches the query time. Storage address, the query parameter includes the query time;
    A3、获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志包括预设类型关键字。A3: Obtain a log stored in the determined storage address, traverse the obtained log based on the query keyword, query a preset type keyword that matches the query keyword, and match the preset type keyword. The corresponding log is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
  2. 如权利要求1所述的电子装置,其特征在于,所述预先确定的日志查询规则包括:The electronic device of claim 1, wherein the predetermined log query rule comprises:
    若从所述预先确定的数据库中搜索出与所述查询时间相匹配的日志生成时间,则根据所述日志生成时间与所述存储地址之间的映射关系,确定该日志生成时间对应的日志的存储地址;If the log generation time that matches the query time is searched from the predetermined database, the log corresponding to the log generation time is determined according to the mapping relationship between the log generation time and the storage address. Storage address
    若从所述预先确定的数据库中搜索不出与所述查询时间相匹配的日志生成时间,则根据预先确定的索引生成规则生成所述预先确定的日志存储文件的存储地址的索引;And if the log generation time that matches the query time is not found in the predetermined database, the index of the storage address of the predetermined log storage file is generated according to a predetermined index generation rule;
    基于所述索引遍历所述预先确定的日志存储文件的存储地址,查询出与所述查询时间相匹配的日志生成时间对应的日志的存储地址。And storing, according to the index, the storage address of the predetermined log storage file, and querying a storage address of a log corresponding to the log generation time that matches the query time.
  3. 如权利要求2所述的电子装置,其特征在于,所述索引包括初始查询地址及结束查询地址,所述预先确定的索引生成规则包括:The electronic device according to claim 2, wherein the index comprises an initial query address and an end query address, and the predetermined index generation rule comprises:
    获取所述预先确定的日志存储文件的初始存储地址及结束存储地址,计算所述初始存储地址及所述结束存储地址的中间存储地址;Obtaining an initial storage address and an ending storage address of the predetermined log storage file, and calculating an intermediate storage address of the initial storage address and the ending storage address;
    获取所述中间存储地址存储的日志,判断获取的日志对应的日志生成时间与查询时间之间的大小关系;Acquiring the log stored in the intermediate storage address, and determining the size relationship between the log generation time and the query time corresponding to the obtained log;
    若获取的日志生成时间大于查询时间,则设置所述初始查询地址为所述初始存储地址,定义所述结束查询地址为该中间存储地址;If the generated log generation time is greater than the query time, the initial query address is set as the initial storage address, and the end query address is defined as the intermediate storage address;
    若获取的日志生成时间小于查询时间,则设置所述初始查询地址为该中间存储地址,设置所述结束查询地址为所述结束存储地址。If the obtained log generation time is less than the query time, the initial query address is set as the intermediate storage address, and the end query address is set as the end storage address.
  4. 如权利要求1所述的电子装置,其特征在于,所述获取分布式系统中日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址的步骤包括:The electronic device according to claim 1, wherein the step of acquiring a log generation time in the distributed system and a storage address of the log in a predetermined log storage file comprises:
    基于springwebmvc架构在预先确定的所述分布式系统的控制中心上构建controller接口;Constructing a controller interface on a predetermined control center of the distributed system based on the springwebmvc architecture;
    向所述controller接口发送调用日志请求;Sending a call log request to the controller interface;
    接收所述controller接口返回的调用预先安装在所述分布式系统的各服务器上的预设类型日志收集系统收集的所述分布式系统中日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址。Receiving, by the controller interface, a log generation time in the distributed system collected by a preset type log collection system pre-installed on each server of the distributed system, and the log is in a predetermined log storage file The storage address in .
  5. 如权利要求1所述的电子装置,其特征在于,所述预设类型关键字包括操作关键字和业务关键字,所述查询关键字包括操作关键字和业务关键字。The electronic device according to claim 1, wherein the preset type keyword comprises an operation keyword and a service keyword, and the query keyword comprises an operation keyword and a business keyword.
  6. 如权利要求2所述的电子装置,其特征在于,所述预设类型关键字包括操作关键字和业务关键字,所述查询关键字包括操作关键字和业务关键字。The electronic device according to claim 2, wherein the preset type keyword comprises an operation keyword and a service keyword, and the query keyword comprises an operation keyword and a business keyword.
  7. 如权利要求3所述的电子装置,其特征在于,所述预设类型关键字包括操作关键字和业务关键字,所述查询关键字包括操作关键字和业务关键字。The electronic device according to claim 3, wherein the preset type keyword comprises an operation keyword and a service keyword, and the query keyword comprises an operation keyword and a business keyword.
  8. 如权利要求4所述的电子装置,其特征在于,所述预设类型关键字包括操作关键字和业务关键字,所述查询关键字包括操作关键字和业务关键字。The electronic device according to claim 4, wherein the preset type keyword comprises an operation keyword and a service keyword, and the query keyword comprises an operation keyword and a business keyword.
  9. 一种分布式系统日志查询方法,其特征在于,所述方法包括如下步骤:A distributed system log query method, characterized in that the method comprises the following steps:
    S1、实时获取分布式系统中各个应用程序对应日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址,生成获取的日志生成时间与所述存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中;S1. The real-time acquisition of the log generation time of each application in the distributed system and the storage address of the log in the predetermined log storage file, and the mapping relationship between the acquired log generation time and the storage address is generated. The mapping relationship is stored in a predetermined database;
    S2、在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志生成时间对应的日志的存储地址,所述查询参数包括所述查询时间;S2: After receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining a log corresponding to the log generation time that matches the query time. Storage address, the query parameter includes the query time;
    S3、获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志包括预设类型关键字。S3: Obtain a log stored in the determined storage address, traverse the obtained log based on the query keyword, query a preset type keyword that matches the query keyword, and match the preset type keyword. The corresponding log is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
  10. 如权利要求9所述的分布式系统日志查询方法,其特征在于,所述预先确定的日志查询规则包括:The distributed system log query method according to claim 9, wherein the predetermined log query rule comprises:
    若从所述预先确定的数据库中搜索出与所述查询时间相匹配的日志生成时间,则根据所述日志生成时间与所述存储地址之间的映射关系,确定该日志生成时间对应的日志的存储地址;If the log generation time that matches the query time is searched from the predetermined database, the log corresponding to the log generation time is determined according to the mapping relationship between the log generation time and the storage address. Storage address
    若从所述预先确定的数据库中搜索不出与所述查询时间相匹配的日志生成时间,则根据预先确定的索引生成规则生成所述预先确定的日志存储文件的存储地址的索引;And if the log generation time that matches the query time is not found in the predetermined database, the index of the storage address of the predetermined log storage file is generated according to a predetermined index generation rule;
    基于所述索引遍历所述预先确定的日志存储文件的存储地址,查询出与所述查询时间相匹配的日志生成时间对应的日志的存储地址。And storing, according to the index, the storage address of the predetermined log storage file, and querying a storage address of a log corresponding to the log generation time that matches the query time.
  11. 如权利要求9所述的分布式系统日志查询方法,其特征在于,所述索引包括初始查询地址及结束查询地址,所述预先确定的索引生成规则包括:The distributed system log query method according to claim 9, wherein the index includes an initial query address and an end query address, and the predetermined index generation rule includes:
    获取所述预先确定的日志存储文件的初始存储地址及结束存储地址,计算所述初始存储地址及所述结束存储地址的中间存储地址;Obtaining an initial storage address and an ending storage address of the predetermined log storage file, and calculating an intermediate storage address of the initial storage address and the ending storage address;
    获取所述中间存储地址存储的日志,判断获取的日志对应的日志生成时间与查询时间之间的大小关系;Acquiring the log stored in the intermediate storage address, and determining the size relationship between the log generation time and the query time corresponding to the obtained log;
    若获取的日志生成时间大于查询时间,则设置所述初始查询地址为所述初始存储地址,定义所述结束查询地址为该中间存储地址;If the generated log generation time is greater than the query time, the initial query address is set as the initial storage address, and the end query address is defined as the intermediate storage address;
    若获取的日志生成时间小于查询时间,则设置所述初始查询地址为该中间存储地址,设置所述结束查询地址为所述结束存储地址。If the obtained log generation time is less than the query time, the initial query address is set as the intermediate storage address, and the end query address is set as the end storage address.
  12. 如权利要求9所述的分布式系统日志查询方法,其特征在于,所述获取分布式系统中日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址的步骤包括:The method for querying a distributed system log according to claim 9, wherein the step of obtaining a log generation time in the distributed system and a storage address of the log in a predetermined log storage file comprises:
    基于springwebmvc架构在预先确定的所述分布式系统的控制中心上构建controller接口;Constructing a controller interface on a predetermined control center of the distributed system based on the springwebmvc architecture;
    向所述controller接口发送调用日志请求;Sending a call log request to the controller interface;
    接收所述controller接口返回的调用预先安装在所述分布式系统的各服务器上的预设类型日志收集系统收集的所述分布式系统中日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址。Receiving, by the controller interface, a log generation time in the distributed system collected by a preset type log collection system pre-installed on each server of the distributed system, and the log is in a predetermined log storage file The storage address in .
  13. 如权利要求9所述的分布式系统日志查询方法,其特征在于,所述预设类型关键字包括操作关键字和业务关键字,所述查询关键字包括操作关键字和业务关键字。The distributed system log query method according to claim 9, wherein the preset type keyword comprises an operation keyword and a service keyword, and the query keyword comprises an operation keyword and a service keyword.
  14. 如权利要求10所述的分布式系统日志查询方法,其特征在于,所述预设类型关键字包括操作关键字和业务关键字,所述查询关键字包括操作关键字和业务关键字。The distributed system log query method according to claim 10, wherein the preset type keyword comprises an operation keyword and a service keyword, and the query keyword comprises an operation keyword and a service keyword.
  15. 如权利要求11所述的分布式系统日志查询方法,其特征在于,所述预设类型关键字包括操作关键字和业务关键字,所述查询关键字包括操作关键字和业务关键字。The distributed system log query method according to claim 11, wherein the preset type keyword comprises an operation keyword and a service keyword, and the query keyword comprises an operation keyword and a service keyword.
  16. 如权利要求12所述的分布式系统日志查询方法,其特征在于,所述预设类型关键字包括操作关键字和业务关键字,所述查询关键字包括操作关键字和业务关键字。The distributed system log query method according to claim 12, wherein the preset type keyword comprises an operation keyword and a service keyword, and the query keyword comprises an operation keyword and a service keyword.
  17. 一种计算机可读存储介质,所述计算机可读存储介质存储有分布式系统日志查询程序,所述分布式系统日志查询程序可被至少一个处理器执行,以使所述至少一个处理器执行如下步骤:A computer readable storage medium storing a distributed system log query program, the distributed system log query program being executable by at least one processor to cause the at least one processor to execute as follows step:
    实时获取分布式系统中各个应用程序对应日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址,生成获取的日志生成时间与所述存储地址之间的映射关系,将所述映射关系存储在预先确定的数据库中;The real-time acquisition of the log generation time of each application in the distributed system and the storage address of the log in the predetermined log storage file, and the mapping relationship between the acquired log generation time and the storage address is generated. The mapping relationship is stored in a predetermined database;
    在接收到客户端发送的带有查询参数的日志查询指令后,根据预先确定的日志查询规则分析所述查询参数与所述映射关系,确定与查询时间相匹配的日志生成时间对应的日志的存储地址,所述查询参数包括所述查询时间;After receiving the log query instruction with the query parameter sent by the client, analyzing the query parameter and the mapping relationship according to the predetermined log query rule, and determining the storage of the log corresponding to the log generation time that matches the query time. An address, the query parameter includes the query time;
    获取确定的存储地址中存储的日志,基于所述查询关键字遍历获取的日志,查询出与所述查询关键字相匹配的预设类型关键字,并将相匹配的预设类型关键字对应的日志返回该客户端,所述查询参数还包括查询关键字,所述日志包括预设类型关键字。Obtaining a log stored in the determined storage address, traversing the obtained log based on the query keyword, and querying a preset type keyword that matches the query keyword, and matching the matching preset type keyword The log is returned to the client, and the query parameter further includes a query keyword, and the log includes a preset type keyword.
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述预先确定的日志查询规则包括:The computer readable storage medium of claim 17, wherein the predetermined log query rule comprises:
    若从所述预先确定的数据库中搜索出与所述查询时间相匹配的日志生成时间,则根据所述日志生成时间与所述存储地址之间的映射关系,确定该日志生成时间对应的日志的存储地址;If the log generation time that matches the query time is searched from the predetermined database, the log corresponding to the log generation time is determined according to the mapping relationship between the log generation time and the storage address. Storage address
    若从所述预先确定的数据库中搜索不出与所述查询时间相匹配的日志生成时间,则根据预先确定的索引生成规则生成所述预先确定的日志存储文件的存储地址的索引;And if the log generation time that matches the query time is not found in the predetermined database, the index of the storage address of the predetermined log storage file is generated according to a predetermined index generation rule;
    基于所述索引遍历所述预先确定的日志存储文件的存储地址,查询出与所述查询时间相匹配的日志生成时间对应的日志的存储地址。And storing, according to the index, the storage address of the predetermined log storage file, and querying a storage address of a log corresponding to the log generation time that matches the query time.
  19. 如权利要求18所述的计算机可读存储介质,其特征在于,其特征在于,所述预设类型关键字包括操作关键字和业务关键字,所述查询关键字包括操作关键字和业务关键字。The computer readable storage medium according to claim 18, wherein said preset type keyword comprises an operation keyword and a business keyword, said query keyword comprising an operation keyword and a business keyword .
  20. 如权利要求17所述的计算机可读存储介质,其特征在于,所述获取分布式系统中日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址的步骤包括:The computer readable storage medium of claim 17, wherein the step of obtaining a log generation time in the distributed system and a storage address of the log in a predetermined log storage file comprises:
    基于springwebmvc架构在预先确定的所述分布式系统的控制中心上构建controller接口;Constructing a controller interface on a predetermined control center of the distributed system based on the springwebmvc architecture;
    向所述controller接口发送调用日志请求;Sending a call log request to the controller interface;
    接收所述controller接口返回的调用预先安装在所述分布式系统的各服务器上的预设类型日志收集系统收集的所述分布式系统中日志的生成时间及所述日志在预先确定的日志存储文件中的存储地址。Receiving, by the controller interface, a log generation time in the distributed system collected by a preset type log collection system pre-installed on each server of the distributed system, and the log is in a predetermined log storage file The storage address in .
PCT/CN2018/089452 2018-01-17 2018-06-01 Electronic apparatus, method for querying logs in distributed system, and storage medium WO2019140828A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810042991.8 2018-01-17
CN201810042991.8A CN108427705B (en) 2018-01-17 2018-01-17 Electronic device, distributed system log query method and storage medium

Publications (1)

Publication Number Publication Date
WO2019140828A1 true WO2019140828A1 (en) 2019-07-25

Family

ID=63155975

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/089452 WO2019140828A1 (en) 2018-01-17 2018-06-01 Electronic apparatus, method for querying logs in distributed system, and storage medium

Country Status (2)

Country Link
CN (1) CN108427705B (en)
WO (1) WO2019140828A1 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727641A (en) * 2019-10-21 2020-01-24 中国民航信息网络股份有限公司 Log searching method and device
CN111258853A (en) * 2020-01-20 2020-06-09 深圳壹账通智能科技有限公司 Log identification method and device, terminal and storage medium
CN111400368A (en) * 2020-03-06 2020-07-10 网宿科技股份有限公司 Log searching method and device of distributed server system
CN111522922A (en) * 2020-03-26 2020-08-11 浙江口碑网络技术有限公司 Log information query method and device, storage medium and computer equipment
CN111522714A (en) * 2020-04-20 2020-08-11 京东数字科技控股有限公司 Log query method and device, electronic equipment and storage medium
CN111858115A (en) * 2019-11-28 2020-10-30 北京嘀嘀无限科技发展有限公司 Service problem positioning method, positioning device, computer equipment and storage medium
CN112214465A (en) * 2020-10-19 2021-01-12 珠海金山网络游戏科技有限公司 Log storage system and method
CN112732665A (en) * 2021-01-04 2021-04-30 歌尔股份有限公司 Log processing method, system and storage medium based on Linux platform
CN112835856A (en) * 2021-02-01 2021-05-25 长沙市到家悠享网络科技有限公司 Log data query method and device, equipment and medium
CN112905548A (en) * 2021-03-25 2021-06-04 昆仑数智科技有限责任公司 Safety audit system and method
CN113656243A (en) * 2021-07-28 2021-11-16 连连(杭州)信息技术有限公司 Service index monitoring method, device, equipment and storage medium
CN114785677A (en) * 2022-04-22 2022-07-22 武汉联影医疗科技有限公司 Log management method, apparatus, computer device, storage medium, and program product
CN115225345A (en) * 2022-06-29 2022-10-21 济南浪潮数据技术有限公司 Log downloading method, device and medium

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109687991B (en) * 2018-09-07 2023-04-18 平安科技(深圳)有限公司 User behavior identification method, device, equipment and storage medium
CN111698109A (en) * 2019-03-14 2020-09-22 北京京东尚科信息技术有限公司 Method and device for monitoring log
CN110134615B (en) * 2019-04-10 2022-03-01 百度在线网络技术(北京)有限公司 Method and device for acquiring log data by application program
CN111813756B (en) * 2019-04-12 2024-06-28 北京嘀嘀无限科技发展有限公司 Log retrieval system, method and device, electronic equipment and storage medium
CN110309150A (en) * 2019-06-14 2019-10-08 杭州迪普科技股份有限公司 A kind of log storage, querying method and device
CN110457363B (en) * 2019-07-05 2023-11-21 中国平安人寿保险股份有限公司 Query method, device and storage medium based on distributed database
CN112685329B (en) * 2019-10-17 2024-08-02 云丁网络技术(北京)有限公司 Method for processing data and related device
CN110990362A (en) * 2019-11-15 2020-04-10 浙江大搜车软件技术有限公司 Log query processing method and device, computer equipment and storage medium
CN110955757A (en) * 2019-12-06 2020-04-03 阳光电源股份有限公司 Photovoltaic power station equipment log retrieval method and system
CN111581172B (en) * 2020-05-09 2023-11-07 深圳市卡数科技有限公司 Query method, system, server and storage medium of operation log
CN112084193A (en) * 2020-09-04 2020-12-15 山东英信计算机技术有限公司 Log query method, log storage method and related equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103617287A (en) * 2013-12-12 2014-03-05 用友软件股份有限公司 Log management method and device in distributed environment
CN103853743A (en) * 2012-11-29 2014-06-11 百度在线网络技术(北京)有限公司 Distributed system and log query method thereof

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944115B (en) * 2010-09-14 2012-07-25 杭州海康威视数字技术股份有限公司 Method and system for searching logs
CN102136005B (en) * 2011-03-29 2013-07-17 北京航空航天大学 Data searching method and device
CN102929936B (en) * 2012-09-26 2016-08-24 东软集团股份有限公司 Log recording method, log inquiring method and system
CN103177116B (en) * 2013-04-08 2016-05-04 国电南瑞科技股份有限公司 A kind of distributed information log based on two-stage index is processed and querying method
CN105335406B (en) * 2014-07-30 2018-10-02 阿里巴巴集团控股有限公司 Daily record data processing method and processing device
US9087090B1 (en) * 2014-07-31 2015-07-21 Splunk Inc. Facilitating execution of conceptual queries containing qualitative search terms
CN104252536B (en) * 2014-09-16 2017-12-08 福建新大陆软件工程有限公司 A kind of internet log data query method and device based on hbase
CN104281672B (en) * 2014-09-28 2021-02-12 网神信息技术(北京)股份有限公司 Method and device for processing log data
US20170169078A1 (en) * 2015-12-14 2017-06-15 Siemens Aktiengesellschaft Log Mining with Big Data
CN106682210B (en) * 2016-12-30 2020-12-04 广州华多网络科技有限公司 Log file query method and device
CN106992886A (en) * 2017-04-05 2017-07-28 国家电网公司 A kind of log analysis method and device based on distributed storage

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103853743A (en) * 2012-11-29 2014-06-11 百度在线网络技术(北京)有限公司 Distributed system and log query method thereof
CN103617287A (en) * 2013-12-12 2014-03-05 用友软件股份有限公司 Log management method and device in distributed environment

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727641A (en) * 2019-10-21 2020-01-24 中国民航信息网络股份有限公司 Log searching method and device
CN110727641B (en) * 2019-10-21 2023-10-27 中国民航信息网络股份有限公司 Log searching method and device
CN111858115A (en) * 2019-11-28 2020-10-30 北京嘀嘀无限科技发展有限公司 Service problem positioning method, positioning device, computer equipment and storage medium
CN111258853A (en) * 2020-01-20 2020-06-09 深圳壹账通智能科技有限公司 Log identification method and device, terminal and storage medium
CN111400368A (en) * 2020-03-06 2020-07-10 网宿科技股份有限公司 Log searching method and device of distributed server system
CN111400368B (en) * 2020-03-06 2023-12-12 网宿科技股份有限公司 Log searching method and device of distributed server system
CN111522922B (en) * 2020-03-26 2023-08-22 浙江口碑网络技术有限公司 Log information query method and device, storage medium and computer equipment
CN111522922A (en) * 2020-03-26 2020-08-11 浙江口碑网络技术有限公司 Log information query method and device, storage medium and computer equipment
CN111522714A (en) * 2020-04-20 2020-08-11 京东数字科技控股有限公司 Log query method and device, electronic equipment and storage medium
CN112214465A (en) * 2020-10-19 2021-01-12 珠海金山网络游戏科技有限公司 Log storage system and method
CN112732665A (en) * 2021-01-04 2021-04-30 歌尔股份有限公司 Log processing method, system and storage medium based on Linux platform
CN112835856A (en) * 2021-02-01 2021-05-25 长沙市到家悠享网络科技有限公司 Log data query method and device, equipment and medium
CN112905548B (en) * 2021-03-25 2023-12-08 昆仑数智科技有限责任公司 Security audit system and method
CN112905548A (en) * 2021-03-25 2021-06-04 昆仑数智科技有限责任公司 Safety audit system and method
CN113656243A (en) * 2021-07-28 2021-11-16 连连(杭州)信息技术有限公司 Service index monitoring method, device, equipment and storage medium
CN113656243B (en) * 2021-07-28 2024-05-31 连连(杭州)信息技术有限公司 Service index monitoring method, device, equipment and storage medium
CN114785677A (en) * 2022-04-22 2022-07-22 武汉联影医疗科技有限公司 Log management method, apparatus, computer device, storage medium, and program product
CN114785677B (en) * 2022-04-22 2023-12-22 武汉联影医疗科技有限公司 Log management method, device, computer equipment, storage medium and program product
CN115225345A (en) * 2022-06-29 2022-10-21 济南浪潮数据技术有限公司 Log downloading method, device and medium

Also Published As

Publication number Publication date
CN108427705B (en) 2022-04-12
CN108427705A (en) 2018-08-21

Similar Documents

Publication Publication Date Title
WO2019140828A1 (en) Electronic apparatus, method for querying logs in distributed system, and storage medium
WO2019148722A1 (en) Electronic device, data migrating and calling method and storage medium
WO2019179027A1 (en) Electronic device, firewall provisioning verification method, system and storage medium
US20210149895A1 (en) Query conversion for querying disparate data sources
CN111414407A (en) Data query method and device of database, computer equipment and storage medium
US10732964B2 (en) Systems and methods for updating multi-tier cloud-based application stacks
WO2019148727A1 (en) Electronic device, redis-based exception warning method and storage medium
WO2019179026A1 (en) Electronic device, method for automatically generating cluster access domain name, and storage medium
CN112162965B (en) Log data processing method, device, computer equipment and storage medium
WO2019136812A1 (en) Electronic device, data calling log generation and query method, and storage medium
WO2019100619A1 (en) Electronic apparatus, method and system for multi-table correlated query, and storage medium
WO2019169763A1 (en) Electronic apparatus, service system risk control method, and storage medium
CN110555072A (en) Data access method, device, equipment and medium
WO2019071898A1 (en) Electronic device, database query script generation method and storage medium
CN113238815B (en) Interface access control method, device, equipment and storage medium
CN111177113A (en) Data migration method and device, computer equipment and storage medium
US10855750B2 (en) Centralized management of webservice resources in an enterprise
WO2019169771A1 (en) Electronic device, access instruction information acquisition method and storage medium
WO2019071907A1 (en) Method for identifying help information based on operation page, and application server
CN112363814A (en) Task scheduling method and device, computer equipment and storage medium
CN115455058A (en) Cache data processing method and device, computer equipment and storage medium
CN107657155B (en) Method and device for authenticating user operation authority
WO2019024238A1 (en) Range value data statistical method and system, electronic device, and computer readable storage medium
CN111475468A (en) Log access method, device, equipment and storage medium of newly added system
CN108197041B (en) Method, device and storage medium for determining parent process of child process

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.10.2020)

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18900978

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 18900978

Country of ref document: EP

Kind code of ref document: A1