WO2020233212A1 - 一种日志记录的处理方法、服务器及存储介质 - Google Patents

一种日志记录的处理方法、服务器及存储介质 Download PDF

Info

Publication number
WO2020233212A1
WO2020233212A1 PCT/CN2020/080081 CN2020080081W WO2020233212A1 WO 2020233212 A1 WO2020233212 A1 WO 2020233212A1 CN 2020080081 W CN2020080081 W CN 2020080081W WO 2020233212 A1 WO2020233212 A1 WO 2020233212A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
server
log records
log
cache queue
Prior art date
Application number
PCT/CN2020/080081
Other languages
English (en)
French (fr)
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 WO2020233212A1 publication Critical patent/WO2020233212A1/zh

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/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • 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

Definitions

  • the present invention relates to the big data field of financial technology, in particular to a processing method, server and storage medium for log records.
  • a big data platform built on a microservice architecture usually consists of a cluster consisting of a large number of servers, and the log records generated by the microservice are stored on the servers in the cluster.
  • users need to log in to each server to view them separately, which is very inconvenient for troubleshooting and replacing valid logs for users.
  • microservice log collection systems (ElasticSearch, LogStash, Kibana, ELK) can be used to collect log records from various servers and display them to users.
  • the working process of ELK includes: First, deploy the distributed log collection framework Logstash on all servers that need to collect log records. Logstash is used to monitor the current server and filter and collect log records; secondly, send the filtered log records to Redis (Database), and the distributed log collection framework storage Logstash indexer will collect the log records and deliver them to the full-text search service ElasticSearch; finally, use ElasticSearch for custom search, and combine the open source analysis and visualization platform Kibana for page display.
  • ELK can perform distributed collection of log records in the cluster, it is limited by the above-mentioned work process of ELK and cannot push logs to users in real time.
  • the invention provides a log record processing method, a server and a storage medium to solve the technical problem of low real-time acquisition of log records in the prior art.
  • an embodiment of the present invention provides a method for processing log records.
  • the method is applied to any one of a plurality of first servers in a specified cluster, and at least one of the first servers is deployed.
  • At least one microservice of the task, the designated cluster further includes a second server, and the technical solution of the method is as follows:
  • the status of the cache queue is monitored, and when the transmission condition for transmitting the log record in the cache queue is reached, the All log records are transmitted to the second server, so that the second server processes all log records according to the identification information of each task corresponding to all log records, and pushes the current processing results of each task to the initiator The user interface corresponding to each task.
  • monitoring the state of the cache queue includes:
  • the method further includes:
  • the cache queue is a blocking queue
  • the storage medium used by the cache queue is an internal memory
  • an embodiment of the present invention provides a method for processing log records.
  • the method is applied to a second server in a designated cluster, and the designated cluster further includes a plurality of first servers, and the first server At least one microservice with at least one task is deployed in, the technical solution of this method is as follows:
  • each log record carries identification information of the corresponding task
  • the second server in the designated cluster receive the log records generated by the running microservices sent from at least one first server in the designated cluster, and according to the identification information of the corresponding task carried in each log record,
  • the received log records are processed separately according to the identification information of each task to obtain the current processing result of each task, and finally the current processing result of each task is pushed to the user interface corresponding to the initiation of each task, so that the second server can be timely Obtain the log records generated during the execution of each task from the first server, without waiting for the task to be completed before obtaining the log records, which can effectively improve the real-time nature of obtaining log records.
  • the received log records are processed separately according to the identification information of each task to obtain the current processing result of each task, including:
  • an embodiment of the present invention provides a first server, which is applied to a designated cluster, the designated cluster includes a plurality of the first server and a second server, and at least one of the first servers is deployed At least one microservice of the task, the first server includes:
  • An obtaining unit configured to obtain log records generated by a microservice in a running state in the first server
  • the cache unit is used to cache the log records in the cache queue
  • the monitoring unit is configured to monitor the state of the cache queue before any task corresponding to the log record in the cache queue is completed, and when the transmission condition for transmitting the log record in the cache queue is reached, the All log records in the cache queue are transmitted to the second server, so that the second server processes all the log records according to the identification information of each task corresponding to all the log records, and compares the current status of each task The processing result is pushed to the user interface corresponding to the initiation of each task.
  • the monitoring unit is used for:
  • the monitoring unit is further used for:
  • the cache queue is a blocking queue
  • the storage medium used by the cache queue is an internal memory
  • an embodiment of the present invention provides a second server, which is applied to a designated cluster.
  • the designated cluster includes a plurality of the first server and a second server, and at least one of the first servers is deployed.
  • At least one microservice of the task, the second server includes:
  • a receiving unit configured to receive log records generated by at least one microservice in a running state sent by the first server
  • the processing unit is configured to process the received log records separately according to the identification information of each task to obtain the current processing result of each task; wherein each log record carries identification information of the corresponding task;
  • the pushing unit is used to push the current processing result of each task to the user interface corresponding to the initiation of each task.
  • processing unit is used to:
  • an embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method of the first aspect or the second aspect are implemented.
  • an embodiment of the present invention also provides a server, including:
  • At least one memory for storing program instructions
  • At least one processor is configured to call the program instructions stored in the memory, and execute the method according to the first aspect or the second aspect according to the obtained program instructions.
  • an embodiment of the present invention provides a computer program product, the computer program product includes a calculation program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are When executed by a computer, the computer is caused to execute the steps of the method described in the first aspect or the second aspect.
  • the embodiments of the present invention have at least the following technical effects:
  • the log records generated by the microservices in the running state in the first server are obtained from the specified cluster; the log records are cached in the cache queue; any one of the log records in the cache queue Before the task is completed, monitor the status of the cache queue.
  • the transmission condition of the log records in the transmission cache queue is reached, all log records in the cache queue are transmitted to the second server, so that the second server records the corresponding
  • the identification information of each task processes all log records, and pushes the current processing results of each task to the user interface corresponding to the initiation of each task, so that the log records can be obtained in time during the task execution process without waiting until the task is completed Obtaining log records can effectively improve the real-time performance of obtaining log records.
  • FIG. 1 is a flowchart of a method for processing log records on a first server side according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a log record processing method provided on the second server side according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a first server according to an embodiment of the present invention.
  • Fig. 4 is a schematic structural diagram of a second server provided by an embodiment of the present invention.
  • the embodiment of the present invention provides a log record processing method, server and storage medium to solve the technical problem of low real-time acquisition of log records in the prior art.
  • a log record processing method is provided, which is applied to any one of a plurality of first servers in a designated cluster, at least one microservice with at least one task is deployed in the first server, and a second server is further included in the designated cluster, the method Including: Obtain the log records generated by the running microservices in the first server; cache the log records in the cache queue; monitor the status of the cache queue before any task corresponding to the log record in the cache queue is completed , When the transmission condition of the log records in the transmission buffer queue is reached, all the log records in the buffer queue are transmitted to the second server, so that the second server processes all the log records according to the identification information of each task corresponding to all the log records, And push the current processing results of each task to the user interface corresponding to the initiation of each task.
  • the log records generated by the microservices in the running state of the first server are obtained from the specified cluster; the log records are cached in the cache queue; any task corresponding to the log records in the cache queue is not completed Before, monitor the status of the cache queue.
  • all the log records in the cache queue are transmitted to the second server, so that the second server records the corresponding tasks according to all the logs.
  • the identification information processes all log records, and pushes the current processing results of each task to the user interface corresponding to the initiation of each task, so that the log records can be obtained in time during the execution of the task, instead of waiting until the task is completed. , Which can effectively improve the real-time performance of obtaining log records.
  • the real-time performance is stronger, which is more in line with the needs of banks and other financial institutions.
  • an embodiment of the present invention provides a method for processing log records, which is applied to any one of a plurality of first servers in a specified cluster, and at least one microservice of at least one task is deployed in the first server, and in the specified cluster It also includes a second server, and the process of this method is as follows.
  • Step 101 Obtain log records generated by a microservice in a running state in the first server.
  • Step 101 Before performing step 101, it is necessary to deploy Spring Cloud (a microservice architecture cloud platform) on each server in the designated cluster, and deploy a component (specifically log4j2) on each first server in the designated cluster.
  • Spring Cloud a microservice architecture cloud platform
  • component specifically log4j2
  • step 102 may be executed.
  • Step 102 Cache the log records in the cache queue.
  • the log records After obtaining the log records, the log records need to be cached in the cache queue.
  • the second server by caching the log records in the cache queue, it can effectively avoid that when the log records are sent to the second server, the second server is always busy due to too frequent HTTP requests.
  • the second server can interpret more log records sent by the first server, thereby improving work efficiency.
  • the cache queue may be a blocking queue.
  • the blocking queue can be designed as a blocking queue with a preset number of caches. When high concurrency generates logs, it can effectively prevent the log records from being lost due to the inability to be cached in time, thereby effectively Protect the integrity of log records.
  • the storage medium used by the cache queue is an internal memory.
  • step 103 can be executed.
  • Step 103 Before any task corresponding to the log record in the cache queue is completed, monitor the status of the cache queue, and when the transmission condition of the log record in the transmission cache queue is reached, transmit all the log records in the cache queue to The second server enables the second server to process all log records according to the identification information of each task corresponding to all log records, and push the current processing result of each task to the user interface corresponding to the initiation of each task.
  • the status of the cache queue is monitored, which can specifically include the following two methods:
  • the first method is to determine whether the storage space of the cache queue is fully occupied; if the storage space of the cache queue is fully occupied, it is determined that the transmission condition is reached.
  • a cache queue in the first server has 256 storage units. After the log records newly generated by a microservice are stored, it is determined whether the 256 storage units of the cache queue are fully occupied. If the result of the judgment is fully occupied, then It is determined that the transmission condition is reached, and the first server sends all log records in the cache queue to the second server. If the judgment result is that it is not fully occupied, the log records in the buffer queue are not sent temporarily.
  • the second method is to determine whether it is time to send the log records in the buffer queue regularly; if the time to send the log records in the buffer queue regularly, it is determined that the transmission condition is reached.
  • the log records in the cache queue of the first server are sent every 1 minute, and the current time is less than 1 minute from the last time it was sent. At this time, it is determined that the time to send the log records in the cache queue is not reached.
  • the log records in the cache queue are not sent temporarily; after a period of time, the first server determines that the current time is 1 minute from the time of the last transmission, and determines that the transmission conditions are met. At this time, no matter whether the storage space in the cache queue is full or not, Send all log records in the cache queue to the second server.
  • the first server monitors on the monitoring bus whether the task status of any one of the at least one task is completed; wherein, the monitoring bus is used to receive all the tasks in the first server The task status of the task; if any task is in a completed status, all log records in the cache queue are transmitted to the second server.
  • the completion time of these tasks may not be the same.
  • relevant information will be sent to the monitoring bus to make the corresponding information in the monitoring bus.
  • the status of the task is changed to a completed status.
  • the first server monitors the status of any task on the monitoring bus to be completed, in order to transmit the log records of the task to the second server in time, it transmits all log records in the cache queue to the second server.
  • microservices with 10 tasks (denoted as tasks 1-10) in the first server are running, and there are a total of 256 storage units in the cache queue.
  • the first server monitors that the task status of task 3 has changed to a completed state through the monitoring bus, and the first server sends all log records in the cache queue to the second server.
  • the first service transmits all log records in the cache queue to the second server, it sends all log records to the second server in a queued manner through the HTTP protocol.
  • the second server After the second server receives the log records sent by the first server, it will process all log records according to the identification information of each task corresponding to all log records, and push the current processing results of each task to the user who initiated each task. interface.
  • the above-mentioned log record processing method (the log record generated by the running microservice in the first server, the log record cache) in actual application can be designed as a component (Such as the Appender component), whether the buffer queue is full or whether it reaches the time for sending regularly, and the task status of each task can be monitored by the listener set in the Appender component.
  • an embodiment of the present invention provides a log record processing method, which is applied to a second server in a designated cluster, and the designated cluster also includes multiple first servers, and at least one of the first servers is deployed At least one microservice of the task, the method includes:
  • Step 201 Receive log records generated by a microservice in a running state sent by at least one first server.
  • Step 202 Process the received log records separately according to the identification information of each task to obtain the current processing result of each task; wherein each log record carries identification information of the corresponding task.
  • a designated cluster usually includes multiple first servers, after the user initiates a task, the task is divided into multiple microservices, which are deployed in at least one first server.
  • the microservices of the same task and the log records generated by them will be carried Corresponding task ID, so after receiving the log record sent by each first server, the second server can determine the task to which each log record belongs according to the task ID in the log record.
  • the second server processes the received log records separately according to the identification information of each task, and obtains the current processing result of each task, including:
  • the second server currently receives log records sent by three first servers (denoted as first server A, first server B, and first server C), and there are 3 tasks in the log records sent by first server A
  • the log records generated by the microservices (denoted as tasks 1 to 3).
  • the log records sent by the first server B include the log records generated by the microservices of 2 tasks (denoted as task 4 and task 5).
  • the first server C There are log records generated by the microservices of 3 tasks (denoted as tasks 6-8) in the sent log records.
  • the second server After the second server receives the log records sent by the three first servers, it divides the log records into 8 groups according to the task ID, and obtains the log record sets of tasks 1 to 8. Since some of the 8 log records are system logs, and some are logs required by users, it is necessary to filter the logs (such as system logs) that are not required by users in the log record set to obtain the respective filtering results of these 8 tasks, and then , And then sort the filter results of the 8 tasks according to the time when the log records were generated, and obtain the sort results of the 8 tasks. If the preset keywords of tasks 1 to 8 are keyword 1 to keyword 8, Then search for keyword 1 in the sorted result of task 1, search for keyword 2 in the sorted result of task 2, and so on for other tasks, and finally get the current processing results of tasks 1-8.
  • step 203 After obtaining the current processing result of each task, step 203 can be executed.
  • Step 203 Push the current processing result of each task to the user interface corresponding to initiating each task.
  • the second server pushes the current processing result of each task to the user interface corresponding to initiating each task.
  • the second server pushes the current processing result of task 1 to user 1 according to the task identifier, and sends the current processing result of task 2 to user 1.
  • the processing result is pushed to user 2, and so on until the 8 tasks are pushed to the corresponding user.
  • the second server Before or after the second server separately processes the received log records according to the identification information of each task, the second server may also control the designated thread to asynchronously store the log records in the designated storage medium.
  • the second server can store the log records to the disk of the corresponding task according to the task identification information in the log records, and back up the log records of the corresponding tasks for each user, so that they can be read from the disk when the user needs it Logging of tasks.
  • an embodiment of the present invention provides a first server for processing log records in a designated cluster.
  • the designated cluster includes a plurality of the first server and a second server, and the first server At least one microservice with at least one task deployed in the first server.
  • the log record processing method of the first server please refer to the description of the first server-side method embodiment. The repetition will not be repeated, please refer to Figure 3.
  • the first server includes:
  • the obtaining unit 301 is configured to obtain log records generated by a microservice in a running state in the first server;
  • the cache unit 302 is configured to cache the log records in a cache queue
  • the monitoring unit 303 is configured to monitor the state of the cache queue before any task corresponding to the log record in the cache queue is completed, and when the transmission condition for transmitting the log record in the cache queue is reached, All log records in the cache queue are transmitted to the second server, so that the second server processes all the log records according to the identification information of each task corresponding to all the log records, and transfers all the log records of each task.
  • the current processing result is pushed to the user interface corresponding to the initiation of each task.
  • the monitoring unit 303 is configured to:
  • the monitoring unit 303 is further configured to:
  • the cache queue is a blocking queue
  • the storage medium used by the cache queue is an internal memory
  • an embodiment of the present invention provides a second server for processing log records in a designated cluster.
  • the designated cluster includes a plurality of the first server and a second server, and the first server At least one microservice with at least one task deployed in the second server.
  • the second server includes:
  • the receiving unit 401 is configured to receive log records generated by at least one microservice in a running state sent by the first server;
  • the processing unit 402 is configured to separately process the received log records according to the identification information of each task to obtain the current processing result of each task; wherein each log record carries identification information of the corresponding task;
  • the pushing unit 403 is configured to push the current processing result of each task to the user interface corresponding to the initiation of each task.
  • processing unit 402 is configured to:
  • an embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed by a processor, the log record can be performed on the first server side or the second server side. Processing method steps.
  • an embodiment of the present invention provides a server, including:
  • At least one memory for storing program instructions
  • At least one processor is configured to call the program instructions stored in the memory, and execute the method for processing log records on the first server side or the second server side according to the obtained program instructions.
  • the embodiments of the present application also provide a computer program product.
  • the computer program product includes a calculation program stored on a non-transitory computer-readable storage medium.
  • the computer program includes program instructions. When the program instructions are executed by the computer, the computer executes the steps of the method for processing log records on the first server side or the second server side.
  • the log records generated by the microservices in the running state in the first server are obtained from the specified cluster; the log records are cached in the cache queue; any one of the log records in the cache queue Before the task is completed, monitor the status of the cache queue.
  • the transmission condition of the log records in the transmission cache queue is reached, all log records in the cache queue are transmitted to the second server, so that the second server records the corresponding
  • the identification information of each task processes all log records, and pushes the current processing results of each task to the user interface corresponding to the initiation of each task, so that the log records can be obtained in time during the task execution process without waiting until the task is completed Obtaining log records can effectively improve the real-time performance of obtaining log records.
  • the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Abstract

一种日志记录的处理方法、服务器及存储介质,用以解决现有技术中存在的获取日志记录的实时性较低的技术问题,应用于指定集群中多个第一服务器的任一个,第一服务器中部署有至少一个任务的至少一个微服务,该方法包括:获取第一服务器中处于运行状态的微服务产生的日志记录(101);将日志记录缓存到缓存队列中(102);在缓存队列中的日志记录对应的任一个任务未完成前,对缓存队列的状态进行监听,当达到传输缓存队列中日志记录的传输条件时,将缓存队列中的所有日志记录传输到第二服务器,使第二服务器按所有日志记录对应的各个任务的标识信息对所有日志记录进行处理,并将各个任务的当前处理结果推送到发起各个任务对应的用户界面(103)。

Description

一种日志记录的处理方法、服务器及存储介质
相关申请的交叉引用
本申请要求在2019年05月17日提交中国专利局、申请号为201910414763.3、申请名称为“一种日志记录的处理方法、服务器及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及金融科技的大数据领域,尤其是涉及一种日志记录的处理方法、服务器及存储介质。
背景技术
在对金融科技领域(FinTech)中的数据进行大数据分析时,往往需要先收集用户在大数据平台所使用的各种服务的日志记录。
建立在微服务架构上的大数据平台,通常是由包含数量众多的服务器构成的集群组成的,微服务产生的日志记录存在集群中的服务器上。用户要查看大数据平台中各微服务产生的日志记录,就需要登陆到各台服务器中分别进行查看,这样对于排错及为用户替换有效日志都十分不便。
在现有技术中,可以通过微服务日志收集系统(ElasticSearch、LogStash、Kibana,ELK),从各个服务器中收集日志记录,并展示给用户。ELK的工作过程包括:首先,在需要收集日志记录的所有服务器上部署分布式日志收集框架Logstash,Logstash用于对当前服务器进行监控并过滤收集日志记录;其次,将过滤后的日志记录发送到Redis(数据库),并由分布式日志收集框架存储器Logstash indexer将日志记录收集后交给全文搜索服务ElasticSearch;最后使用ElasticSearch进行自定义搜索,并结合开源分析和可视化平台Kibana进行页面展示。
然而,尽管ELK可以对集群中的日志记录进行分散收集,但是其受限于 ELK的上述工作过程,而不能实时的向用户推送日志。
鉴于此,如何提高获取日志记录的实时性成为一个亟待解决的技术问题。
发明内容
本发明提供一种日志记录的处理方法、服务器及存储介质,用以解决现有技术中存在的获取日志记录的实时性较低的技术问题。
第一方面,为解决上述技术问题,本发明实施例提供一种日志记录的处理方法,所述方法应用于指定集群中多个第一服务器的任一个,所述第一服务器中部署有至少一个任务的至少一个微服务,所述指定集群中还包括一个第二服务器,该方法的技术方案如下:
获取所述第一服务器中处于运行状态的微服务产生的日志记录;
将所述日志记录缓存到缓存队列中;
在所述缓存队列中的日志记录对应的任一个任务未完成前,对所述缓存队列的状态进行监听,当达到传输所述缓存队列中日志记录的传输条件时,将所述缓存队列中的所有日志记录传输到第二服务器,使所述第二服务器按所述所有日志记录对应的各个任务的标识信息对所述所有日志记录进行处理,并将所述各个任务的当前处理结果推送到发起所述各个任务对应的用户界面。
通过从指定集群获取第一服务器中处于运行状态的微服务产生的日志记录;并将日志记录缓存到缓存队列中;在缓存队列中的日志记录对应的任一个任务未完成前,对缓存队列的状态进行监听,当达到传输缓存队列中日志记录的传输条件时,将缓存队列中的所有日志记录传输到第二服务器,使第二服务器按所有日志记录对应的各个任务的标识信息对所有日志记录进行处理,并将各个任务的当前处理结果推送到发起各个任务对应的用户界面,从而能够在任务执行过程中及时获取日志记录,而不需等到任务完成后才获取日志记录,进而能够有效的提高获取日志记录的实时性。
可选的,对所述缓存队列的状态进行监听,包括:
判断所述缓存队列的存储空间是否已全占满;若所述缓存队列的存储空 间为全占满,则确定达到所述传输条件;或,
判断是否到达定时发送所述缓存队列中的日志记录的时间;若到达定时发送所述缓存队列中的日志记录的时间时,则确定达到所述传输条件。
可选的,将所述日志记录缓存到缓存队列中之后,还包括:
在监听总线上监听所述至少一个任务中任一个任务的任务状态是否为已完成状态;其中,所述监听总线用于接收所述第一服务器中所有任务的任务状态;
若所述任一个任务为已完成状态,则将所述缓存队列中的所有日志记录传输到所述第二服务器。
可选的,所述缓存队列为阻塞队列,所述缓存队列使用的存储介质为内部存储器。
第二方面,本发明实施例提供的一种日志记录的处理方法,所述方法应用于指定集群中的一个第二服务器,所述指定集群中还包括多个第一服务器,所述第一服务器中部署有至少一个任务的至少一个微服务,该方法的技术方案如下:
接收至少一个所述第一服务器发送的处于运行状态的微服务产生的日志记录;
对接收到的日志记录按各个任务的标识信息进行分别处理,获得所述各个任务的当前处理结果;其中,每条日志记录中携带有对应任务的标识信息;
将所述各个任务的当前处理结果,推送到发起所述各个任务对应的用户界面。
通过让指定集群中的第二服务器,接收从指定集群中的至少一个第一服务器发送的处于运行状态的微服务产生的日志记录,并按每条日志记录中携带的对应任务的标识信息,对接收到的日志记录按各个任务的标识信息进行分别处理,获得各个任务的当前处理结果,最后将各个任务的当前处理结果,推送到发起各个任务对应的用户界面,从而能够让第二服务器及时的从第一服务器中获取各个任务在执行过程中产生的日志记录,而不需等到任务完成 后才获取日志记录,进而能够有效的提高获取日志记录的实时性。
可选的,对接收到的日志记录按各个任务的标识信息进行分别处理,获得所述各个任务的当前处理结果,包括:
按所述各个任务的标识信息,对所述接收到的日志记录进行分组,获得所述各个任务当前包含的日志记录集;
对所述各个任务当前包含的日志记录集执行以下处理过程:对所述日志记录集中非用户需要的日志进行过滤,获得过滤结果;按日志记录产生的时间,对所述过滤结果中的所有日志记录进行排序,获得排序结果;
按预设关键字,对所述排序结果进行搜索,获得所述各个任务的当前处理结果。
第三方面,本发明实施例提供了一种第一服务器,应用于指定集群,所述指定集群中包括多个所述第一服务器和一个第二服务器,所述第一服务器中部署有至少一个任务的至少一个微服务,该第一服务器包括:
获取单元,用于获取所述第一服务器中处于运行状态的微服务产生的日志记录;
缓存单元,用于将所述日志记录缓存到缓存队列中;
监听单元,用于在所述缓存队列中的日志记录对应的任一个任务未完成前,对所述缓存队列的状态进行监听,当达到传输所述缓存队列中日志记录的传输条件时,将所述缓存队列中的所有日志记录传输到第二服务器,使所述第二服务器按所述所有日志记录对应的各个任务的标识信息对所述所有日志记录进行处理,并将所述各个任务的当前处理结果推送到发起所述各个任务对应的用户界面。
可选的,所述监听单元用于:
判断所述缓存队列的存储空间是否已全占满;若所述缓存队列的存储空间为全占满,则确定达到所述传输条件;或,
判断是否到达定时发送所述缓存队列中的日志记录的时间;若到达定时发送所述缓存队列中的日志记录的时间时,则确定达到所述传输条件。
可选的,所述监听单元还用于:
在监听总线上监听所述至少一个任务中任一个任务的任务状态是否为已完成状态;其中,所述监听总线用于接收所述第一服务器中所有任务的任务状态;
若所述任一个任务为已完成状态,则将所述缓存队列中的所有日志记录传输到所述第二服务器。
可选的,所述缓存队列为阻塞队列,所述缓存队列使用的存储介质为内部存储器。
第四方面,本发明实施例提供了一种第二服务器,应用于指定集群,所述指定集群中包括多个所述第一服务器和一个第二服务器,所述第一服务器中部署有至少一个任务的至少一个微服务,该第二服务器包括:
接收单元,用于接收至少一个所述第一服务器发送的处于运行状态的微服务产生的日志记录;
处理单元,用于对接收到的日志记录按各个任务的标识信息进行分别处理,获得所述各个任务的当前处理结果;其中,每条日志记录中携带有对应任务的标识信息;
推送单元,用于将各个任务的当前处理结果,推送到发起所述各个任务对应的用户界面。
可选的,所述处理单元用于:
按所述各个任务的标识信息,对所述接收到的日志记录进行分组,获得所述各个任务当前包含的日志记录集;
对所述各个任务当前包含的日志记录集执行以下处理过程:对所述日志记录集中非用户需要的日志进行过滤,获得过滤结果;按日志记录产生的时间,对所述过滤结果中的所有日志记录进行排序,获得排序结果;按预设关键字,对所述排序结果进行搜索,获得所述各个任务的当前处理结果。
第三方面,本发明实施例还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如第一方面或第二方面方 法的步骤。
第四方面,本发明实施例还提供一种服务器,包括:
至少一个存储器,用于存储程序指令;
至少一个处理器,用于调用所述存储器中存储的程序指令,按照获得的程序指令执行如第一方面或第二方面所述的方法。
第五方面,本发明实施例提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行如第一方面或第二方面所述的方法的步骤。
通过本发明实施例的上述一个或多个实施例中的技术方案,本发明实施例至少具有如下技术效果:
在本发明提供的实施例中,通过从指定集群获取第一服务器中处于运行状态的微服务产生的日志记录;并将日志记录缓存到缓存队列中;在缓存队列中的日志记录对应的任一个任务未完成前,对缓存队列的状态进行监听,当达到传输缓存队列中日志记录的传输条件时,将缓存队列中的所有日志记录传输到第二服务器,使第二服务器按所有日志记录对应的各个任务的标识信息对所有日志记录进行处理,并将各个任务的当前处理结果推送到发起各个任务对应的用户界面,从而能够在任务执行过程中及时获取日志记录,而不需等到任务完成后才获取日志记录,进而能够有效的提高获取日志记录的实时性。
附图说明
图1为本发明实施例提供在第一服务器侧的一种日志记录的处理方法的流程图;
图2为本发明实施例提供在第二服务器侧的一种日志记录的处理方法的流程图;
图3为本发明实施例提供的一种第一服务器的结构示意图;
图4为本发明实施例提供的一种第二服务器的结构示意图。
具体实施方式
本发明实施列提供一种日志记录的处理方法、服务器及存储介质,以解决现有技术中存在的获取日志记录的实时性较低的技术问题。
金融科技及计算机技术的发展,使得金融机构(如银行机构、保险机构、证券机构和理财机构等)下的大数据应用越来越广,在现有的大数据领域中,对海量日志记录进行获取处理时,按照常规的ELK工具会导致日志记录获取的实时性较差,而这种情况严重不符合金融机构的需求。
本申请实施例中的技术方案为解决上述的技术问题,总体思路如下:
提供一种日志记录的处理方法,应用于指定集群中多个第一服务器的任一个,第一服务器中部署有至少一个任务的至少一个微服务,指定集群中还包括一个第二服务器,该方法包括:获取第一服务器中处于运行状态的微服务产生的日志记录;将日志记录缓存到缓存队列中;在缓存队列中的日志记录对应的任一个任务未完成前,对缓存队列的状态进行监听,当达到传输缓存队列中日志记录的传输条件时,将缓存队列中的所有日志记录传输到第二服务器,使第二服务器按所有日志记录对应的各个任务的标识信息对所有日志记录进行处理,并将各个任务的当前处理结果推送到发起各个任务对应的用户界面。
由于在上述方案中,通过从指定集群获取第一服务器中处于运行状态的微服务产生的日志记录;并将日志记录缓存到缓存队列中;在缓存队列中的日志记录对应的任一个任务未完成前,对缓存队列的状态进行监听,当达到传输缓存队列中日志记录的传输条件时,将缓存队列中的所有日志记录传输到第二服务器,使第二服务器按所有日志记录对应的各个任务的标识信息对所有日志记录进行处理,并将各个任务的当前处理结果推送到发起各个任务对应的用户界面,从而能够在任务执行过程中及时获取日志记录,而不需等到任务完成后才获取日志记录,进而能够有效的提高获取日志记录的实时性。 通过上述处理方式,使得银行等金融机构在进行日志记录获取的时候,实时性更强,更加符合银行等金融机构的需求。
为了更好的理解上述技术方案,下面通过附图以及具体实施例对本发明技术方案做详细的说明,应当理解本发明实施例以及实施例中的具体特征是对本发明技术方案的详细的说明,而不是对本发明技术方案的限定,在不冲突的情况下,本发明实施例以及实施例中的技术特征可以相互组合。
请参考图1,本发明实施例提供一种日志记录的处理方法,应用于指定集群中多个第一服务器的任一个,第一服务器中部署有至少一个任务的至少一个微服务,指定集群中还包括一个第二服务器,该方法的处理过程如下。
步骤101:获取第一服务器中处于运行状态的微服务产生的日志记录。
在执行步骤101之前,需要在指定集群中的每台服务器中部署Spring Cloud(一种微服务架构云平台),并在指定集群的每台第一服务器上部署组件(具体可以是log4j2)。这样第一服务器便可对运行在其中的微服务产生的日志记录进行收集。
在获取日志记录之后,便可执行步骤102。
步骤102:将日志记录缓存到缓存队列中。
在获取日志记录之后,需将日志记录缓存到缓存队列中。
在本发明提供的实施例中,通过将日志记录缓存到缓存队列中,可以有效地避免在将日志记录发送给第二服务器时,由于HTTP请求过于频繁而导致第二服务器一直处于繁忙状态,让第二服务器能够解释更多的第一服务器发送的日志记录,从而提高工作效率。
进一步的,缓存队列可以为阻塞队列。通过将缓存队列设置为阻塞队列,该阻塞队列可设计为预设缓存数目的阻塞队列,在高并发产生日志时,可以有效地防止日志记录因不能被及时缓存而丢失的问题,从而能够有效的保护日志记录的完整性。
在本发明提供的实施例中,缓存队列使用的存储介质为内部存储器。通过将缓存队列使用的存储介质设置为内部存储器,在日志记录生成之后,可 以不必写入第一服务器的磁盘中,而是写入第一服务器的内部存储器中,这样可有效地节约第一服务器读写磁盘时消耗的IO时间,提高缓存效率。
在将日志记录缓存到日志队列中之后,便可执行步骤103。
步骤103:在缓存队列中的日志记录对应的任一个任务未完成前,对缓存队列的状态进行监听,当达到传输缓存队列中日志记录的传输条件时,将缓存队列中的所有日志记录传输到第二服务器,使第二服务器按所有日志记录对应的各个任务的标识信息对所有日志记录进行处理,并将各个任务的当前处理结果推送到发起各个任务对应的用户界面。
在缓存队列中的日志记录对应的任一个任务未完成前,对缓存队列的状态进行监听,具体可以包括以下两种方式:
第一种:判断缓存队列的存储空间是否已全占满;若缓存队列的存储空间为全占满,则确定达到传输条件。
例如,第一服务器中一个缓存队列有256个存储单元,在存储完一个微服务新产生的日志记录之后,判断缓存队列的256个存储单元是否全占满,假设判断结果为全占满,则确定达到传输条件,第一服务器将缓存队列中的所有日志记录都发送给第二服务器。若判断结果为未全占满,则暂不发送缓存队列中的日志记录。
第二种:判断是否到达定时发送缓存队列中的日志记录的时间;若到达定时发送缓存队列中的日志记录的时间时,则确定达到传输条件。
例如,假设第一服务器的缓存队列中的日志记录是按每隔1分钟发送一次,当前时间距离上次发送的时间小于1分钟,此时判断出未到达发送缓存队列中的日志记录的时间,暂不发送缓存队列中的日志记录;一段时间之后,第一服务器判断出当前时间距离上次发送的时间为1分钟,确定达到传输条件,此时无论缓存队列中的存储空间是否存满,都将缓存队列中的全部日志记录发送给第二服务器。
可选的,将日志记录缓存到缓存队列中之后,第一服务器在监听总线上监听至少一个任务中任一个任务的任务状态是否为已完成状态;其中,监听 总线用于接收第一服务器中所有任务的任务状态;若任一个任务为已完成状态,则将缓存队列中的所有日志记录传输到第二服务器。
由于在第一服务器中可能同时存在多个任务的微服务在同时运行,这些任务的完成时间不一定相同,每个任务在完成之后,都会将相关信息发送到监听总线上,使监听总线中对应任务的状态修改为已完成状态。第一服务器在监听总线上监听到任一个任务的状态变为已完成状态后,为了及时将该任务的日志记录传输到第二服务器,便将缓存队列中的所有日志记录传输到第二服务器。
例如,第一服务器中有10个任务(记为任务1~10)的微服务在运行,缓存队列中共有256个存储单元,当前在将任务3的微服务产生的日志记录缓存到缓存队列后,判断出缓存队列的存储空间未占满,但第一服务器通过监听总线监听到任务3的任务状态变为已完成状态,第一服务器将缓存队列中的所有日志记录发送给第二服务器。
若达到传输条件采用的上述第二种方式,在未达到定时发送缓存队列中的日志记录的时间,而第一服务器监听到任一个任务的任务状态为已完成状态时,仍需将缓存队列中的所有日志记录发送给第二服务器。
具体的,在第一服务将缓存队列中的所有日志记录传输到第二服务器时,是通过HTTP协议,以排队的方式将所有日志记录发送到第二服务器的。
在第二服务器接收到第一服务器发送的日志记录之后,将按所有日志记录对应的各个任务的标识信息对所有日志记录进行处理,并将各个任务的当前处理结果推送到发起各个任务对应的用户界面。
需要说明的是,在本发明提供的实施例中,在实际应用时上述日志记录的处理方法(第一服务器中处于运行状态的微服务产生的日志记录、日志记录的缓存)可以设计为一个组件(如Appender组件),对缓存队列是否已满或是否达到定时发送的时间,以及监听各任务的任务状态可以通过设置在Appender组件中的监听器来实现。
请参见图2,本发明一实施例中提供一种日志记录的处理方法,应用于指 定集群中的一个第二服务器,指定集群中还包括多个第一服务器,第一服务器中部署有至少一个任务的至少一个微服务,该方法包括:
步骤201:接收至少一个第一服务器发送的处于运行状态的微服务产生的日志记录。
步骤202:对接收到的日志记录按各个任务的标识信息进行分别处理,获得各个任务的当前处理结果;其中,每条日志记录中携带有对应任务的标识信息。
由于指定集群中通常包括有多个第一服务器,在用户发起任务后,将任务分为多个微服务,部署在至少一个第一服务器中,同一任务的微服务及其产生的日志记录都会携带对应的任务标识,所以第二服务器在接收到各第一服务器发送的日志记录后,可以根据日志记录中的任务标识,确定各日志记录所属的任务。
第二服务器对接收到的日志记录按各个任务的标识信息进行分别处理,获得各个任务的当前处理结果,包括:
先按各个任务的标识信息,对接收到的日志记录进行分组,获得各个任务当前包含的日志记录集。
再对各个任务当前包含的日志记录集执行以下处理过程:首先,对日志记录集中非用户需要的日志进行过滤,获得过滤结果;其次,按日志记录产生的时间,对过滤结果中的所有日志记录进行排序,获得排序结果;最后,按预设关键字,对排序结果进行搜索,获得各个任务的当前处理结果。
例如,假设第二服务器当前接收到3台第一服务器(记为第一服务器A、第一服务器B、第一服务器C)发送的日志记录,第一服务器A发送的日志记录中有3个任务(记为任务1~3)的微服务产生的日志记录,第一服务器B发送的日志记录中有2个任务(记为任务4、任务5)的微服务产生的日志记录,第一服务器C发送的日志记录中有3个任务(记为任务6~8)的微服务产生的日志记录。
第二服务器在接收到这3台第一服务器发送的日志记录后,按任务标识 将这些日志记录分为8组,得到任务1~任务8各自的日志记录集。由于这8个日志记录集中有些是系统日志,有些是用户需要的日志,所以需要先对日志记录集中非用户需要的日志(例如系统日志)进行过滤,获得这8个任务各自的过滤结果,然后,再对这8个任务各自的过滤结果按照日志记录产生的时间进行排序,获得8个任务各自的排序结果,若任务1~8各个的预设关键字依次为关键字1~关键字8,则在任务1的排序结果中搜索关键字1,在任务2的排序结果中搜索关键字2,其他任务依次类推,最终得到任务1~8的当前处理结果。
在得到各个任务的当前处理结果之后,便可执行步骤203。
步骤203:将各个任务的当前处理结果,推送到发起各个任务对应的用户界面。
第二服务器在得到各个任务的当前处理结果后,将各个任务的当前处理结果,推送到发起各个任务对应的用户界面。
例如,依然以前面的8个任务为例,假设这8个任务分别来自用户1~用户8,则第二服务器根据任务标识,将任务1的当前处理结果推送给用户1,将任务2的当前处理结果推送给用户2,依次类推直到将这8个任务都推送到对应的用户。
在第二服务器对接收到的日志记录,按各个任务的标识信息进行分别处理之前或之后,第二服务器还可以控制指定线程将日志记录异步存储到指定存储介质。
例如,第二服务器可以按照日志记录中的任务的标识信息,将日志记录存储到对应任务的磁盘中,为每个用户备份对应的任务的日志记录,这样可以在用户需要时从磁盘中读取任务的日志记录。
基于同一发明构思,本发明一实施例中提供一种在指定集群中用于处理日志记录的第一服务器,指定集群中包括多个所述第一服务器和一个第二服务器,所述第一服务器中部署有至少一个任务的至少一个微服务,该第一服务器的日志记录的处理方法的具体实施方式可参见第一服务器侧方法实施例 部分的描述,重复之处不再赘述,请参见图3,该第一服务器包括:
获取单元301,用于获取所述第一服务器中处于运行状态的微服务产生的日志记录;
缓存单元302,用于将所述日志记录缓存到缓存队列中;
监听单元303,用于在所述缓存队列中的日志记录对应的任一个任务未完成前,对所述缓存队列的状态进行监听,当达到传输所述缓存队列中日志记录的传输条件时,将所述缓存队列中的所有日志记录传输到第二服务器,使所述第二服务器按所述所有日志记录对应的各个任务的标识信息对所述所有日志记录进行处理,并将所述各个任务的当前处理结果推送到发起所述各个任务对应的用户界面。
可选的,所述监听单元303用于:
判断所述缓存队列的存储空间是否已全占满;若所述缓存队列的存储空间为全占满,则确定达到所述传输条件;或,
判断是否到达定时发送所述缓存队列中的日志记录的时间;若到达定时发送所述缓存队列中的日志记录的时间时,则确定达到所述传输条件。
可选的,所述监听单元303还用于:
在监听总线上监听所述至少一个任务中任一个任务的任务状态是否为已完成状态;其中,所述监听总线用于接收所述第一服务器中所有任务的任务状态;
若所述任一个任务为已完成状态,则将所述缓存队列中的所有日志记录传输到所述第二服务器。
可选的,所述缓存队列为阻塞队列,所述缓存队列使用的存储介质为内部存储器。
基于同一发明构思,本发明一实施例中提供一种在指定集群中用于处理日志记录的第二服务器,指定集群中包括多个所述第一服务器和一个第二服务器,所述第一服务器中部署有至少一个任务的至少一个微服务,该第二服务器的日志记录的处理方法的具体实施方式可参见第二服务器侧方法实施例 部分的描述,重复之处不再赘述,请参见图4,该第二服务器包括:
接收单元401,用于接收至少一个所述第一服务器发送的处于运行状态的微服务产生的日志记录;
处理单元402,用于对接收到的日志记录按各个任务的标识信息进行分别处理,获得所述各个任务的当前处理结果;其中,每条日志记录中携带有对应任务的标识信息;
推送单元403,用于将各个任务的当前处理结果,推送到发起所述各个任务对应的用户界面。
可选的,所述处理单元402用于:
按所述各个任务的标识信息,对所述接收到的日志记录进行分组,获得所述各个任务当前包含的日志记录集;
对所述各个任务当前包含的日志记录集执行以下处理过程:对所述日志记录集中非用户需要的日志进行过滤,获得过滤结果;按日志记录产生的时间,对所述过滤结果中的所有日志记录进行排序,获得排序结果;
按预设关键字,对所述排序结果进行搜索,获得所述各个任务的当前处理结果。
基于同一发明构思,本发明实施例还提一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如第一服务器侧或第二服务器侧对日志记录进行处理方法的步骤。
基于同一发明构思,本发明实施例中提供了一种服务器,包括:
至少一个存储器,用于存储程序指令;
至少一个处理器,用于调用所述存储器中存储的程序指令,按照获得的程序指令执行如第一服务器侧或第二服务器侧对日志记录进行处理的方法。
基于同一发明构思,本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行如第一服务器侧或第二服务器侧对日志记录进行处理的方法的步骤。
在本发明提供的实施例中,通过从指定集群获取第一服务器中处于运行状态的微服务产生的日志记录;并将日志记录缓存到缓存队列中;在缓存队列中的日志记录对应的任一个任务未完成前,对缓存队列的状态进行监听,当达到传输缓存队列中日志记录的传输条件时,将缓存队列中的所有日志记录传输到第二服务器,使第二服务器按所有日志记录对应的各个任务的标识信息对所有日志记录进行处理,并将各个任务的当前处理结果推送到发起各个任务对应的用户界面,从而能够在任务执行过程中及时获取日志记录,而不需等到任务完成后才获取日志记录,进而能够有效的提高获取日志记录的实时性。
本领域内的技术人员应明白,本发明实施例可提供为方法、系统、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明实施例是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (12)

  1. 一种日志记录的处理方法,其特征在于,所述方法应用于指定集群中多个第一服务器的任一个,所述第一服务器中部署有至少一个任务的至少一个微服务,所述指定集群中还包括一个第二服务器,所述方法包括:
    获取所述第一服务器中处于运行状态的微服务产生的日志记录;
    将所述日志记录缓存到缓存队列中;
    在所述缓存队列中的日志记录对应的任一个任务未完成前,对所述缓存队列的状态进行监听,当达到传输所述缓存队列中日志记录的传输条件时,将所述缓存队列中的所有日志记录传输到第二服务器,使所述第二服务器按所述所有日志记录对应的各个任务的标识信息对所述所有日志记录进行处理,并将所述各个任务的当前处理结果推送到发起所述各个任务对应的用户界面。
  2. 如权利要求1所述的方法,其特征在于,对所述缓存队列的状态进行监听,包括:
    判断所述缓存队列的存储空间是否已全占满;若所述缓存队列的存储空间为全占满,则确定达到所述传输条件;或,
    判断是否到达定时发送所述缓存队列中的日志记录的时间;若到达定时发送所述缓存队列中的日志记录的时间时,则确定达到所述传输条件。
  3. 如权利要求1或2任一项所述的方法,其特征在于,将所述日志记录缓存到缓存队列中之后,还包括:
    在监听总线上监听所述至少一个任务中任一个任务的任务状态是否为已完成状态;其中,所述监听总线用于接收所述第一服务器中所有任务的任务状态;
    若所述任一个任务为已完成状态,则将所述缓存队列中的所有日志记录传输到所述第二服务器。
  4. 如权利要求3所述的方法,其特征在于,所述缓存队列为阻塞队列,所述缓存队列使用的存储介质为内部存储器。
  5. 一种日志记录的处理方法,其特征在于,所述方法应用于指定集群中的一个第二服务器,所述指定集群中还包括多个第一服务器,所述第一服务器中部署有至少一个任务的至少一个微服务,所述方法包括:
    接收至少一个所述第一服务器发送的处于运行状态的微服务产生的日志记录;
    对接收到的日志记录按各个任务的标识信息进行分别处理,获得所述各个任务的当前处理结果;其中,每条日志记录中携带有对应任务的标识信息;
    将所述各个任务的当前处理结果,推送到发起所述各个任务对应的用户界面。
  6. 如权利要求5所述的方法,其特征在于,对接收到的日志记录按各个任务的标识信息进行分别处理,获得所述各个任务的当前处理结果,包括:
    按所述各个任务的标识信息,对所述接收到的日志记录进行分组,获得所述各个任务当前包含的日志记录集;
    对所述各个任务当前包含的日志记录集执行以下处理过程:对所述日志记录集中非用户需要的日志进行过滤,获得过滤结果;按日志记录产生的时间,对所述过滤结果中的所有日志记录进行排序,获得排序结果;按预设关键字,对所述排序结果进行搜索,获得所述各个任务的当前处理结果。
  7. 一种第一服务器,应用于指定集群,其特征在于,所述指定集群中包括多个所述第一服务器和一个第二服务器,所述第一服务器中部署有至少一个任务的至少一个微服务,所述第一服务器包括:
    获取单元,用于获取所述第一服务器中处于运行状态的微服务产生的日志记录;
    缓存单元,用于将所述日志记录缓存到缓存队列中;
    监听单元,用于在所述缓存队列中的日志记录对应的任一个任务未完成前,对所述缓存队列的状态进行监听,当达到传输所述缓存队列中日志记录的传输条件时,将所述缓存队列中的所有日志记录传输到第二服务器,使所述第二服务器按所述所有日志记录对应的各个任务的标识信息对所述所有日 志记录进行处理,并将所述各个任务的当前处理结果推送到发起所述各个任务对应的用户界面。
  8. 一种第二服务器,应用于指定集群,其特征在于,所述指定集群中包括多个所述第一服务器和一个第二服务器,所述第一服务器中部署有至少一个任务的至少一个微服务,所述第二服务器包括:
    接收单元,用于接收至少一个所述第一服务器发送的处于运行状态的微服务产生的日志记录;
    处理单元,用于对接收到的日志记录按各个任务的标识信息进行分别处理,获得所述各个任务的当前处理结果;其中,每条日志记录中携带有对应任务的标识信息;
    推送单元,用于将各个任务的当前处理结果,推送到发起所述各个任务对应的用户界面。
  9. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-4或者5、6任一项方法的步骤。
  10. 一种服务器,其特征在于,包括:
    至少一个存储器,用于存储程序指令;
    至少一个处理器,用于调用所述存储器中存储的程序指令,按照获得的程序指令执行上述权利要求1-4或者5、6任一项所述的方法。
  11. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行:
    获取所述第一服务器中处于运行状态的微服务产生的日志记录;
    将所述日志记录缓存到缓存队列中;
    在所述缓存队列中的日志记录对应的任一个任务未完成前,对所述缓存队列的状态进行监听,当达到传输所述缓存队列中日志记录的传输条件时,将所述缓存队列中的所有日志记录传输到第二服务器,使所述第二服务器按 所述所有日志记录对应的各个任务的标识信息对所述所有日志记录进行处理,并将所述各个任务的当前处理结果推送到发起所述各个任务对应的用户界面。
  12. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行:
    接收至少一个所述第一服务器发送的处于运行状态的微服务产生的日志记录;
    对接收到的日志记录按各个任务的标识信息进行分别处理,获得所述各个任务的当前处理结果;其中,每条日志记录中携带有对应任务的标识信息;
    将所述各个任务的当前处理结果,推送到发起所述各个任务对应的用户界面。
PCT/CN2020/080081 2019-05-17 2020-03-18 一种日志记录的处理方法、服务器及存储介质 WO2020233212A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910414763.3 2019-05-17
CN201910414763.3A CN110175154A (zh) 2019-05-17 2019-05-17 一种日志记录的处理方法、服务器及存储介质

Publications (1)

Publication Number Publication Date
WO2020233212A1 true WO2020233212A1 (zh) 2020-11-26

Family

ID=67691551

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/080081 WO2020233212A1 (zh) 2019-05-17 2020-03-18 一种日志记录的处理方法、服务器及存储介质

Country Status (2)

Country Link
CN (1) CN110175154A (zh)
WO (1) WO2020233212A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113065142A (zh) * 2021-03-12 2021-07-02 华控清交信息科技(北京)有限公司 多方安全计算方法、装置、服务器及存储介质
CN113419872A (zh) * 2021-06-24 2021-09-21 陕西优百信息技术有限公司 一种应用系统接口集成系统、集成方法、设备及存储介质
CN117066743A (zh) * 2023-06-01 2023-11-17 广州富士汽车整线集成有限公司 包含多车型加工位的汽车加工产线系统

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175154A (zh) * 2019-05-17 2019-08-27 深圳前海微众银行股份有限公司 一种日志记录的处理方法、服务器及存储介质
CN110611592B (zh) * 2019-09-20 2023-04-07 中国联合网络通信集团有限公司 日志记录方法及设备
CN111078648A (zh) * 2019-11-29 2020-04-28 珠海金山网络游戏科技有限公司 实时获取GoCD执行任务的方法及系统
CN111176951A (zh) * 2019-12-31 2020-05-19 上海擎感智能科技有限公司 日志输出的配置/日志处理方法/系统、介质及服务器
CN112131196A (zh) * 2020-09-09 2020-12-25 华人运通(上海)云计算科技有限公司 一种分布式日志处理方法、装置、终端设备及存储介质
CN112612675B (zh) * 2020-12-25 2023-02-28 山东经伟晟睿数据技术有限公司 微服务架构下的分布式大数据日志链路跟踪方法及系统
CN113051243A (zh) * 2021-03-31 2021-06-29 上海阵量智能科技有限公司 日志处理方法、装置、系统、芯片、设备及存储介质
CN114495378A (zh) * 2022-01-21 2022-05-13 浪潮卓数大数据产业发展有限公司 基于atm机的取现信息获取及处理方法及系统
CN115328755A (zh) * 2022-10-11 2022-11-11 中化现代农业有限公司 一种并发日志记录方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103617287A (zh) * 2013-12-12 2014-03-05 用友软件股份有限公司 一种分布式环境下的日志管理方法和装置
CN106777371A (zh) * 2017-01-23 2017-05-31 北京齐尔布莱特科技有限公司 日志收集系统和方法
US20180349121A1 (en) * 2017-05-30 2018-12-06 International Business Machines Corporation Dynamic deployment of an application based on micro-services
CN109213742A (zh) * 2018-11-02 2019-01-15 大唐网络有限公司 日志采集方法及装置
CN109743199A (zh) * 2018-12-25 2019-05-10 中国联合网络通信集团有限公司 基于微服务的容器化管理系统
CN110175154A (zh) * 2019-05-17 2019-08-27 深圳前海微众银行股份有限公司 一种日志记录的处理方法、服务器及存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176888B (zh) * 2011-12-22 2018-01-23 阿里巴巴集团控股有限公司 一种日志记录的方法和系统
CN103036961A (zh) * 2012-12-07 2013-04-10 蓝盾信息安全技术股份有限公司 一种日志分布式收集及存储方法
CN103902646B (zh) * 2013-12-27 2017-04-19 北京天融信软件有限公司 一种分布式任务管理系统与方法
US20170004188A1 (en) * 2015-06-30 2017-01-05 Ca, Inc. Apparatus and Method for Graphically Displaying Transaction Logs
CN107979490A (zh) * 2017-11-17 2018-05-01 北京联想超融合科技有限公司 日志数据的记录方法及服务器集群
CN107861859B (zh) * 2017-11-22 2021-04-02 北京汇通金财信息科技有限公司 一种基于微服务架构的日志管理方法及系统
CN109669915A (zh) * 2018-12-12 2019-04-23 浪潮(北京)电子信息产业有限公司 一种计算机任务管理方法、装置及相关设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103617287A (zh) * 2013-12-12 2014-03-05 用友软件股份有限公司 一种分布式环境下的日志管理方法和装置
CN106777371A (zh) * 2017-01-23 2017-05-31 北京齐尔布莱特科技有限公司 日志收集系统和方法
US20180349121A1 (en) * 2017-05-30 2018-12-06 International Business Machines Corporation Dynamic deployment of an application based on micro-services
CN109213742A (zh) * 2018-11-02 2019-01-15 大唐网络有限公司 日志采集方法及装置
CN109743199A (zh) * 2018-12-25 2019-05-10 中国联合网络通信集团有限公司 基于微服务的容器化管理系统
CN110175154A (zh) * 2019-05-17 2019-08-27 深圳前海微众银行股份有限公司 一种日志记录的处理方法、服务器及存储介质

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113065142A (zh) * 2021-03-12 2021-07-02 华控清交信息科技(北京)有限公司 多方安全计算方法、装置、服务器及存储介质
CN113419872A (zh) * 2021-06-24 2021-09-21 陕西优百信息技术有限公司 一种应用系统接口集成系统、集成方法、设备及存储介质
CN113419872B (zh) * 2021-06-24 2023-11-07 陕西优百信息技术有限公司 一种应用系统接口集成系统、集成方法、设备及存储介质
CN117066743A (zh) * 2023-06-01 2023-11-17 广州富士汽车整线集成有限公司 包含多车型加工位的汽车加工产线系统
CN117066743B (zh) * 2023-06-01 2024-04-16 广州富士汽车整线集成有限公司 包含多车型加工位的汽车加工产线系统

Also Published As

Publication number Publication date
CN110175154A (zh) 2019-08-27

Similar Documents

Publication Publication Date Title
WO2020233212A1 (zh) 一种日志记录的处理方法、服务器及存储介质
US10552287B2 (en) Performance metrics for diagnosing causes of poor performing virtual machines
US11074560B2 (en) Tracking processed machine data
US11036540B2 (en) Transaction commit operations with thread decoupling and grouping of I/O requests
US10262032B2 (en) Cache based efficient access scheduling for super scaled stream processing systems
US10409650B2 (en) Efficient access scheduling for super scaled stream processing systems
US11886284B2 (en) System and method for data redistribution in a database
US20160179919A1 (en) Asynchronous data replication using an external buffer table
CN106919675B (zh) 一种数据存储方法及装置
US11036608B2 (en) Identifying differences in resource usage across different versions of a software application
CN111143286B (zh) 一种云平台日志管理方法及系统
DE112012005275T5 (de) Datenauswahl zur Sicherung von Datenspeichern
WO2013078583A1 (zh) 优化数据访问的方法及装置、优化数据存储的方法及装置
CN109657007A (zh) 基于异步提交的数据库数据同步并行执行方法及设备
CN105511812A (zh) 一种存储系统大数据优化方法及装置
CN110851473A (zh) 一种数据处理方法、装置和系统
US7895247B2 (en) Tracking space usage in a database
CN114090580A (zh) 数据处理方法、装置、设备、存储介质及产品
CN110321364B (zh) 信用卡管理系统的交易数据查询方法、装置及终端
US10996855B2 (en) Memory allocation in a data analytics system
CN112650739A (zh) 煤矿数据中台的数据存储处理方法和装置
CN106681939B (zh) 磁盘页面的读取方法和装置
WO2019196287A1 (zh) 缓存清理方法、装置、计算机装置及存储介质
CN112214290B (zh) 日志信息处理方法、边缘节点、中心节点和系统
CN114969139A (zh) 大数据运维管理方法、系统、装置及存储介质

Legal Events

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

Ref document number: 20808818

Country of ref document: EP

Kind code of ref document: A1

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 010322)

122 Ep: pct application non-entry in european phase

Ref document number: 20808818

Country of ref document: EP

Kind code of ref document: A1