WO2016169145A1 - 一种云终端日志处理方法、装置及系统 - Google Patents

一种云终端日志处理方法、装置及系统 Download PDF

Info

Publication number
WO2016169145A1
WO2016169145A1 PCT/CN2015/085461 CN2015085461W WO2016169145A1 WO 2016169145 A1 WO2016169145 A1 WO 2016169145A1 CN 2015085461 W CN2015085461 W CN 2015085461W WO 2016169145 A1 WO2016169145 A1 WO 2016169145A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
module
cloud terminal
information
configuration
Prior art date
Application number
PCT/CN2015/085461
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 WO2016169145A1 publication Critical patent/WO2016169145A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks

Definitions

  • the present invention relates to the field of cloud terminal log processing technologies, and in particular, to a cloud terminal log processing method, device and system.
  • the log system is an indispensable tool and means to assist cloud terminal development and fault analysis and debugging.
  • the operating system includes various operating systems such as andriod, linux, and windows. From the development point of view, the log system needs to be easily transplanted; since the cloud terminal generally has a low configuration, the log system must occupy disk, memory, and CPU. Resources; due to the complexity of cloud terminal functional modules, logs must be easy to locate and analyze problems.
  • the technical problem to be solved by the present invention is to provide a cloud terminal log processing method, device and system, which are used to solve the problems of poor portability, high resource occupation or low analysis efficiency of the existing cloud terminal log system.
  • an embodiment of the present invention provides a cloud terminal log processing method, which is applied to a server, and includes: receiving log information uploaded by a client connected to a module on a cloud terminal; and acquiring a preset log save.
  • the configuration parameter is saved according to the log, and the log information is stored in the embedded database.
  • the step of acquiring the preset log save configuration parameter is: acquiring a log save configuration parameter in the shared memory shared by the client, where the log save configuration parameter is mapped from the configuration file to the share In memory.
  • the storing the configuration information according to the log includes: storing the log information in a cache queue; and storing the configuration parameters according to the log to store the log information in the cache queue to the embedded database when the preset condition is met.
  • the step of saving the configuration parameter according to the log, and storing the log information in the cache queue into the embedded database is: when the log information is cached in the cache queue When the number reaches the preset value or the cache time period is reached, and the embedded database is in an unfilled state, the log information in the cache queue is stored according to the log storage rate preset in the log storage configuration parameter.
  • the log information in the cache queue is stored according to the log storage rate preset in the log storage configuration parameter.
  • the cloud terminal log processing method further includes: acquiring an external configuration command, where the external configuration command includes configuration information for saving a configuration parameter to the log; and storing the configuration information included in the external configuration command a configuration file; mapping the configuration file to a shared memory shared with the client.
  • the cloud terminal log processing method further includes: acquiring an external operation command, where the external operation command includes a command to read and/or delete log information in the embedded database;
  • the embodiment of the present invention provides a cloud terminal log processing device, which is applied to a server, and includes: a receiving module, configured to receive log information uploaded by a client connected to a module on the cloud terminal; and a parameter obtaining module configured to obtain a pre- The set log saves the configuration parameter; the storage module is configured to save the configuration parameter according to the log, and store the log information into the embedded database.
  • the storage module includes: a cache unit, configured to store the log information in a cache queue; and the storage unit is configured to save the configuration parameter according to the log when the preset condition is met, and configure the cache queue
  • the log information in is stored in the embedded database.
  • the cloud terminal log processing device further includes: a configuration command obtaining module, configured to acquire an external configuration command, where the external configuration command includes configuration information for saving a configuration parameter to the log; and a saving module configured to: The configuration information included in the external configuration command is stored in the configuration file; and the mapping module is configured to map the configuration file to a shared memory shared with the client.
  • a configuration command obtaining module configured to acquire an external configuration command, where the external configuration command includes configuration information for saving a configuration parameter to the log
  • a saving module configured to: The configuration information included in the external configuration command is stored in the configuration file; and the mapping module is configured to map the configuration file to a shared memory shared with the client.
  • the cloud terminal log processing device further includes: an operation command obtaining module, configured to acquire an external operation command, where the external operation command includes log information in the embedded database a command for reading and/or deleting; the operation module is configured to obtain a log saving configuration parameter in the configuration file, and read and/or delete the log information in the embedded database according to the log saving configuration parameter. operating.
  • an operation command obtaining module configured to acquire an external operation command, where the external operation command includes log information in the embedded database a command for reading and/or deleting
  • the operation module is configured to obtain a log saving configuration parameter in the configuration file, and read and/or delete the log information in the embedded database according to the log saving configuration parameter.
  • An embodiment of the present invention provides a cloud terminal log processing method, which is applied to a client, including: establishing a connection relationship with a module on a cloud terminal; acquiring a log content of the module; and saving a configuration parameter according to a preset log, which is required
  • the saved log content is generated by the saved log information; the log information is uploaded to the server, so that the server end stores the log information into the embedded database.
  • the step of establishing a connection relationship with the module on the cloud terminal is: establishing a connection relationship with the module on the cloud terminal by using a log client process interface.
  • the step of generating the corresponding log information by using the saved log storage configuration parameter according to the preset log save configuration parameter includes: acquiring a log save configuration parameter in the shared memory shared by the server end; And generating, according to the module level information in the configuration parameter, the log content that needs to be saved to generate corresponding log information.
  • the step of generating the corresponding log information by using the saved log content according to the module level information in the log saving configuration parameter includes: if the module level information indicates the log content generated by the module If the save is required, the log content of the preset length is generated to generate log information in a standard format.
  • the log information in the standard format includes: a log level, a log generation time, a module name corresponding to the log information, and the generated log content.
  • the embodiment of the present invention provides a cloud terminal log processing device, which is applied to a client, and includes: a connection module, configured to establish a connection relationship with a module on the cloud terminal; and a log obtaining module configured to acquire a log content of the module;
  • the module is configured to save the configuration parameter according to the preset log, and generate the corresponding log information by using the saved log content;
  • the uploading module is configured to upload the log information to the server, so that the server end
  • the log information is stored in the embedded database.
  • the generating module includes: a first acquiring unit, configured to acquire a log saving configuration parameter in the shared memory shared by the server; and a generating unit configured to save the module level in the configuration parameter according to the log The information generates the corresponding log information by using the saved log content.
  • An embodiment of the present invention provides a cloud terminal log processing system, including: a cloud terminal first log processing device and a cloud terminal second log processing device; wherein the cloud terminal first log processing device includes: a connection module, configured to be established The connection relationship with the module on the cloud terminal; the log obtaining module is configured to obtain the log content of the module; the generating module is configured to save the configuration parameter according to the preset log, and generate the corresponding log of the log content to be saved.
  • the uploading module is configured to upload the log information to the second log processing device of the cloud terminal, so that the cloud terminal second log processing device stores the log information into an embedded database;
  • the cloud terminal includes: a receiving module, configured to receive log information uploaded by the first log processing device of the cloud terminal connected to the module on the cloud terminal; and a parameter obtaining module configured to acquire a preset log saving configuration a parameter; a storage module, configured to save the configuration parameter according to the log, and the log Information stored in an embedded database.
  • the second cloud processing device of the cloud terminal further includes: a configuration command obtaining module, configured to obtain an external configuration command, where the external configuration command includes configuration information for saving configuration parameters of the log; and the saving module is set to be The configuration information included in the external configuration command is stored in the configuration file; and the mapping module is configured to map the configuration file to a shared memory shared by the first log processing device of the cloud terminal.
  • a configuration command obtaining module configured to obtain an external configuration command, where the external configuration command includes configuration information for saving configuration parameters of the log
  • the saving module is set to be The configuration information included in the external configuration command is stored in the configuration file
  • the mapping module is configured to map the configuration file to a shared memory shared by the first log processing device of the cloud terminal.
  • the cloud terminal second log processing device further includes: an operation command obtaining module, configured to acquire an external operation command, where the external operation command includes reading the log information in the embedded database and/or The deleted command; the operation module is configured to obtain a log save configuration parameter in the configuration file, and perform read and/or delete operation on the log information in the embedded database according to the log save configuration parameter.
  • an operation command obtaining module configured to acquire an external operation command, where the external operation command includes reading the log information in the embedded database and/or The deleted command
  • the operation module is configured to obtain a log save configuration parameter in the configuration file, and perform read and/or delete operation on the log information in the embedded database according to the log save configuration parameter.
  • the foregoing solution saves the resource of the module log on the cloud terminal by saving the log on the cloud terminal to the embedded database according to the preset log storage configuration parameter, thereby saving resource overhead and facilitating the cloud terminal log processing system. transplant.
  • FIG. 1 is a general flowchart of a method for processing a cloud terminal log applied to a server according to an embodiment of the present invention
  • FIG. 2 is a schematic block diagram of the cloud terminal log processing apparatus applied to a server end according to an embodiment of the present invention
  • FIG. 3 is a general flowchart of a cloud terminal log processing method applied to a client according to an embodiment of the present invention
  • FIG. 4 is a schematic block diagram of the cloud terminal log processing apparatus applied to a client according to an embodiment of the present invention
  • FIG. 5 is a static diagram of the cloud terminal log processing system according to an embodiment of the present invention.
  • FIG. 6 is a flowchart showing a main implementation of the log client according to an embodiment of the present invention.
  • FIG. 7 is a flowchart showing a main implementation of the log server end according to an embodiment of the present invention.
  • FIG. 8 shows a main processing flow of the configuration program according to an embodiment of the present invention.
  • the embodiment of the present invention provides a cloud terminal log processing method, device, and system for the existing cloud terminal log system, which has poor portability, high resource occupation, or low analysis efficiency.
  • an embodiment of the present invention provides a cloud terminal log processing method, which is applied to a server, and includes:
  • Step 11 Receive log information uploaded by a client connected to a module on the cloud terminal;
  • Step 12 Obtain a preset log save configuration parameter.
  • step 13 the log information is stored in the embedded database according to the log saving configuration parameters.
  • the above solution saves the log information generated by the module on the cloud terminal to the embedded database, which facilitates the management of the module log.
  • the log information in the embedded database can be quickly Locate problems, analyze problems, and solve problems.
  • the embedded database is used to record the log information, which facilitates the search of the log information.
  • the SQLite3 database is preferably used in the present invention (SQLite is a lightweight database, a relational database management system that complies with ACID, ACID is Atomicity: atomicity, Consistency: consistency, Isolation: isolation, Durability: Hold Long), SQLite3 database is a completely free, open, multi-platform embedded database, there is no copyright and legal risk; the system is very portable, for the transplantation of each platform, only need to replace the SQLite3 library file Low system resource utilization and high analysis efficiency can improve the efficiency of R&D and maintenance, which makes the product have unique advantages over other products in the industry.
  • Step 12 of the embodiment of the present invention is specifically:
  • the log save configuration parameters are mapped from the configuration file to the shared memory.
  • log save configuration parameters are stored in the configuration file, and the data read rate is improved by directly mapping the information in the configuration file to the shared memory and reading the data in the memory.
  • Step 13 of the embodiment of the present invention includes:
  • step 131 the log information is stored in the cache queue.
  • Step 132 When the preset condition is met, save the configuration parameter according to the log, and store the log information in the cache queue into the embedded database.
  • the log information received by the server is the log information of the preset format that is generated by the client in advance, and the log information may be directly stored in the embedded database.
  • the log information includes: the log level, the log generation time, the module name corresponding to the log information, and the generated log content.
  • the log information format is: debug 2012-11-29 19:40:40.792362proc1:this is test log.
  • the log level is the save level of the log (that is, the save level of the log corresponding to the module, and can also be regarded as the level of the module).
  • the log level can be defined as the following four levels:
  • debug is for debugging information
  • info is for general prompt information
  • error is for error log.
  • the save level of the log and the database performance parameter settings of the log such as the rate at which the log is written to the database, the capacity of the database, and so on.
  • step 132 provided in the embodiment of the present invention is:
  • the log storage rate preset in the configuration parameter is saved (that is, the rate at which the log is written into the database), and the log information in the cache queue is stored in the embedded database.
  • the server When receiving multiple log information, the server first stores the log information in the cache queue according to the order in which the log information is received.
  • the cache queue performs the storage and counts the number of log information.
  • the value of the log information in the cache queue is greater than or equal to the default log storage rate.
  • the log storage rate is stored in the number of log information.
  • the default log is written to the database at a rate of 200 packets per second.
  • the log information in the cache queue is stored in the embedded database.
  • the time period of the cache queue can be used as the basis for storage.
  • the log information in the cache queue needs to be stored in the embedded database, for example, a preset cache queue.
  • the time period is 100 milliseconds. When the time period of 100 milliseconds arrives, it indicates that the log information in the cache queue needs to be cached.
  • the rate at which the log information is written to the database should not exceed the preset log storage rate. Assume that the default log storage rate is 200 packets per second. The number of log messages in the cache queue is 210, and the log rate is 200 per second. When the log is to be written, the number of log messages in the cache queue is 180. The entry rate is 180 per second. It should also be noted that when writing log information, it is first necessary to determine whether the database is not full. If the storage capacity of the database has reached the preset capacity value, the log information is not performed. Write, directly discard the log information.
  • the cloud terminal log processing method further includes:
  • the external configuration command mainly includes a configuration command for the log level, a configuration command for the database capacity, and a configuration command for the log storage rate.
  • the information in the configuration file can be directly written to the shared memory. Waiting for calls from other programs, you can also write information from the configuration file to shared memory when using the information in the configuration file.
  • the embodiment of the present invention further provides a method for processing log information in a database, that is, a cloud terminal log processing method, and further includes:
  • the external operation command includes a command to read and/or delete log information in the embedded database
  • the reading and deleting operations of the log information in the database are provided.
  • the reading rule of the log information to be read first needs to be set, such as reading by level. Take, read by module, etc., and then compare the rule with the log save configuration parameters in the configuration file, for example, the read rule is read by the log keyword, and the log saves the key information of the log in the configuration parameter. , the log information can not be read.
  • the above solution of the embodiment of the present invention facilitates the management of the log information by using the log information acquired by the client, and uses the embedded database with good portability, so that the above solution has good versatility.
  • an embodiment of the present invention provides a cloud terminal log processing device, which is applied to a server end, and includes:
  • the receiving module 110 is configured to receive log information uploaded by a client connected to the module on the cloud terminal;
  • the parameter obtaining module 120 is configured to obtain a preset log saving configuration parameter.
  • the storage module 130 is configured to save the configuration parameters according to the log and store the log information in the embedded database.
  • the parameter obtaining module 120 is configured to obtain a log saving configuration parameter in the shared memory shared by the client, and the log saving configuration parameter is mapped into the shared memory by the configuration file.
  • the storage module 130 includes:
  • a cache unit configured to store log information in a cache queue
  • the storage unit is configured to save the configuration parameters according to the log and store the log information in the cache queue to the embedded database when the preset condition is met.
  • the specific application of the storage unit is: when the number of log information cached in the cache queue reaches a preset value or the cache time period arrives, and the embedded database is in an unfilled state, the log preset in the configuration parameter is saved according to the log.
  • the deposit rate stores the log information in the cache queue to the embedded database.
  • the cloud terminal log processing device further includes:
  • the external configuration command contains configuration information for saving the configuration parameters of the log.
  • the save module is set to store the configuration information included in the external configuration command into the configuration file
  • a mapping module that is set to map a configuration file to shared memory that is shared with the client.
  • the cloud terminal log processing device further includes:
  • the operation command acquisition module is configured to obtain an external operation command, and the external operation command includes a command for reading and/or deleting log information in the embedded database;
  • the operation module is configured to obtain a log save configuration parameter in the configuration file, and perform read and/or delete operation on the log information in the embedded database according to the log save configuration parameter.
  • the embodiment of the present invention provides a cloud terminal log processing method, which is applied to a client, and includes:
  • Step 21 Establish a connection relationship with a module on the cloud terminal.
  • Step 22 Obtain a log content of the module.
  • Step 23 Save configuration parameters according to a preset log, and generate corresponding log information by using the saved log content.
  • Step 24 Upload the log information to the server, so that the server stores the log information in the embedded database.
  • step 21 is specifically:
  • Step 23 of the embodiment of the present invention includes:
  • Step 231 Obtain a log saving configuration parameter in the shared memory shared by the server.
  • step 232 the module level information in the configuration parameter is saved, and the log content to be saved is generated to generate corresponding log information.
  • step 232 is specifically:
  • the log content of the preset length is generated to generate log information in a standard format.
  • the client when the client establishes a connection relationship with the module on the cloud terminal, it starts to obtain the log content generated by the module on the cloud terminal at runtime, and the client reads the module level information in the shared memory, if the module The level information indicates that the log content needs to be saved.
  • the log content of the preset length is sequentially intercepted, and then the log content of the preset length is encapsulated into a standard format to form log information.
  • the standard The formatted log information includes: the log level, the log generation time, the module name corresponding to the log information, and the generated log content.
  • an embodiment of the present invention provides a cloud terminal log processing device, which is applied to a client, and includes:
  • connection module 210 is configured to establish a connection relationship with the module on the cloud terminal;
  • the log obtaining module 220 is configured to acquire the log content of the module.
  • the generating module 230 is configured to save configuration parameters according to a preset log, and generate corresponding log information by using the saved log content;
  • the uploading module 240 is configured to upload the log information to the server, so that the server stores the log information into the embedded database.
  • connection module 210 establishes a connection relationship with the module on the cloud terminal by calling the log client process interface.
  • the generating module 230 includes:
  • the first obtaining unit 231 is configured to acquire a log saving configuration parameter in the shared memory shared by the server end;
  • the generating unit 232 is configured to generate corresponding log information according to the module level information in the log saving configuration parameter and the log content to be saved.
  • the generating unit 232 is specifically configured to: if the module level information indicates that the log content generated by the module needs to be saved, generate log information in a standard format by using the preset length of the log content.
  • the embodiment of the invention provides a cloud terminal log processing system, including:
  • the first log processing device of the cloud terminal includes:
  • connection module configured to establish a connection relationship with a module on the cloud terminal
  • a log obtaining module configured to obtain a log content of the module
  • the generating module is configured to save configuration parameters according to a preset log, and generate corresponding log information by using the saved log content;
  • the uploading module is configured to upload the log information to the second log processing device of the cloud terminal, so that the second log processing device of the cloud terminal stores the log information in the embedded database;
  • the second log processing device of the cloud terminal includes:
  • the receiving module is configured to receive log information uploaded by the first log processing device of the cloud terminal connected to the module on the cloud terminal;
  • the parameter obtaining module is configured to obtain a preset log saving configuration parameter
  • the storage module is configured to save the configuration parameters according to the log and store the log information in the embedded database.
  • the cloud terminal second log processing device further includes:
  • the external configuration command contains configuration information for saving the configuration parameters of the log.
  • the save module is set to store the configuration information included in the external configuration command into the configuration file
  • the mapping module is configured to map the configuration file to a shared memory shared with the first log processing device of the cloud terminal.
  • the cloud terminal second log processing device further includes:
  • the operation command acquisition module is configured to obtain an external operation command, and the external operation command includes a command for reading and/or deleting log information in the embedded database;
  • the operation module is configured to obtain a log save configuration parameter in the configuration file, and perform read and/or delete operation on the log information in the embedded database according to the log save configuration parameter.
  • the configuration command acquisition module, the save module, the mapping module, the operation command acquisition module, and the operation module constitute a configuration module of the cloud terminal log processing system, and the configuration module mainly implements the log level, date, and module name in the database.
  • the log information is read and deleted, and the capacity of the database and the log write rate are configured.
  • the configuration module can process the second log with the cloud terminal.
  • the device is integrated, and can also be a separate module independently of the second log processing device of the cloud terminal.
  • the cloud terminal log processing system of the embodiment of the present invention includes: a log client (corresponding to the cloud terminal first log processing device) and a log server end (corresponding to the cloud terminal)
  • the second log processing device, the log client invokes the log client interface, and collects the log of the cloud terminal module by using multiple log client processes, that is, one log client process corresponds to one cloud terminal module, and needs to obtain the cloud terminal module.
  • the log information is saved, the log information is sent to the log server through the socket.
  • the log server obtains the log information through the receiving thread, the log server first hangs the log information in the buffer list in order, and then passes the preset condition.
  • the database is inserted into the thread, and the sql interface transaction insert is inserted to insert the log information into the SQLite3 database; the log configuration program is used to read and delete the log information in the SQLite3 database, and the log configuration program (that is, the above configuration module) will be The configuration information saved by the log is written to the shared memory for the log client. And log server-side call.
  • Step S11 the client process invokes the log interface to establish a connection relationship with the module on the cloud terminal;
  • Step S12 reading level information of the module in the shared memory
  • step S13 it is determined whether the log corresponding to the module is to be saved according to the level information; if the saving is not required, step S15 is performed to discard the log; if the saving is required, step S14 is performed, and the time of adding the log and the module name information are assembled into the sql standard format. ;
  • step S16 the log information is sent from the socket to the log server.
  • Step S21 the service process is started
  • Step S22 reading the configuration file to the shared memory
  • Step S23 checking the socket to receive the package
  • Step S24 determining whether the socket receives the log information; if the log information is not received, the process goes to step S23, and if the log information is received, step S25 is executed to save the log information to the cache list;
  • Step S26 determining whether the number of cache nodes is greater than or equal to a preset value or a time period is reached; if the number of cache nodes does not reach a preset value or the time period has not arrived, then the process proceeds to step S23; if the number of cache nodes reaches If the preset value or the time period arrives, proceed to step S27 to determine whether the database is full. If the database is not full, proceed to step S28, insert the log information into the database at a preset rate, and then jump. Go to step S24; if the data inventory is full, go to step S29, discard the cache node, and go to step S23.
  • Step S31 calling a configuration program
  • Step S32 reading the configuration file to the shared memory
  • step S33 the determination of the parameter selection is performed. If the parameter is set, step S34 is performed to set the level of the module, the database capacity value or the log writing rate value; if the log is read, proceed to step S35, according to the module, the level, The time reads the log from the database; if the log is deleted, step S36 is performed to delete the log from the database by module, level, and time.
  • the cloud terminal log processing system implements the storage of the logs of the modules on the cloud terminal, and saves the log information in a preset format through the embedded database, thereby facilitating the reading and writing of the log information, and also facilitating the query analysis.
  • the configuration information can be transmitted to all processes in real time without affecting the execution efficiency of each module, and the efficiency of the cloud terminal log processing system is improved.
  • the log information is stored in the embedded database, and the cross-platform compatibility is good. Only the library file can be replaced when the system is transplanted.
  • the cloud terminal log processing system is easy to operate, easy to transplant, low resource occupation, and efficient in analysis. Log processing of the cloud terminal provides convenience.
  • the log on the cloud terminal is stored in the embedded database according to the preset log storage configuration parameter, which facilitates management of the module log on the cloud terminal, thereby saving resource overhead. It facilitates the transplantation of the cloud terminal log processing system.

Abstract

一种云终端日志处理方法、装置及系统。云终端日志处理方法,应用于服务器端,包括:接收与云终端上的模块相连接的客户端上传的日志信息(11);获取预先设定的日志保存配置参数(12);根据日志保存配置参数,将日志信息存储至嵌入式数据库中(13)。上述方案,通过将云终端上的日志依据日志保存配置参数存储到嵌入式数据库中,方便了对云终端上模块日志的管理,节省了资源开销,同时方便了云终端日志处理系统的移植。

Description

一种云终端日志处理方法、装置及系统 技术领域
本发明涉及云终端日志处理技术领域,特别涉及一种云终端日志处理方法、装置及系统。
背景技术
日志系统是协助云终端开发及故障分析调试的必不可少的工具和手段。在目前的云终端系统中,操作系统包括了andriod、linux、windows等各型操作系统,从开发角度上日志系统需要易于移植;由于云终端一般配置较低,日志系统必须占用磁盘、内存、CPU资源;由于云终端功能模块复杂,日志必须方便定位和分析问题。
已有的日志系统往往不能顾及到所有的方面,存在着可移植性差、资源占用高或者分析效率低等一个或者几个问题。
发明内容
本发明要解决的技术问题是提供一种云终端日志处理方法、装置及系统,用以解决现有的云终端日志系统存在着可移植性差、资源占用高或者分析效率低等问题。
为了解决上述技术问题,本发明实施例提供一种云终端日志处理方法,应用于服务器端,包括:接收与云终端上的模块相连接的客户端上传的日志信息;获取预先设定的日志保存配置参数;根据所述日志保存配置参数,将所述日志信息存储至嵌入式数据库中。
可选地,所述获取预先设定的日志保存配置参数的步骤为:获取与所述客户端共用的共享内存中的日志保存配置参数,所述日志保存配置参数由配置文件映射到所述共享内存中。
可选地,所述根据所述日志保存配置参数,将所述日志信息存储至嵌入式 数据库中的步骤包括:将所述日志信息存入缓存队列;在满足预设条件时,按照所述日志保存配置参数,将所述缓存队列中的日志信息存储至嵌入式数据库中。
可选地,在满足预设条件时,按照所述日志保存配置参数,将所述缓存队列中的日志信息存储至嵌入式数据库中的步骤为:当所述缓存队列中缓存的日志信息的条数达到预设值或缓存时间周期到达,且嵌入式数据库处于未存满的状态时,按照所述日志保存配置参数中预设的日志存入速率,将所述缓存队列中的日志信息存储至嵌入式数据库中。
可选地,所述云终端日志处理方法,还包括:获取外部配置命令,所述外部配置命令包含对日志保存配置参数的配置信息;将所述外部配置命令中包含的所述配置信息存入配置文件;将所述配置文件映射到与所述客户端共用的共享内存中。
可选地,所述云终端日志处理方法,还包括:获取外部操作命令,所述外部操作命令包括对所述嵌入式数据库中的日志信息进行读取和/或删除的命令;
获取配置文件中的日志保存配置参数,并依据所述日志保存配置参数对所述嵌入式数据库中的日志信息进行读取和/或删除操作。
本发明实施例提供一种云终端日志处理装置,应用于服务器端,包括:接收模块,设置为接收与云终端上的模块相连接的客户端上传的日志信息;参数获取模块,设置为获取预先设定的日志保存配置参数;存储模块,设置为根据所述日志保存配置参数,将所述日志信息存储至嵌入式数据库中。
可选地,所述存储模块包括:缓存单元,设置为将所述日志信息存入缓存队列;存储单元,设置为在满足预设条件时,按照所述日志保存配置参数,将所述缓存队列中的日志信息存储至嵌入式数据库中。
可选地,所述云终端日志处理装置,还包括:配置命令获取模块,设置为获取外部配置命令,所述外部配置命令包含对日志保存配置参数的配置信息;保存模块,设置为将所述外部配置命令中包含的所述配置信息存入配置文件;映射模块,设置为将所述配置文件映射到与所述客户端共用的共享内存中。
可选地,所述云终端日志处理装置,还包括:操作命令获取模块,设置为获取外部操作命令,所述外部操作命令包括对所述嵌入式数据库中的日志信息 进行读取和/或删除的命令;操作模块,设置为获取配置文件中的日志保存配置参数,并依据所述日志保存配置参数对所述嵌入式数据库中的日志信息进行读取和/或删除操作。
本发明实施例提供一种云终端日志处理方法,应用于客户端,包括:建立与云终端上模块的连接关系;获取所述模块的日志内容;根据预先设定的日志保存配置参数,将需要保存的所述日志内容生成对应的日志信息;将所述日志信息上传给服务器端,使得所述服务器端将所述日志信息存储至嵌入式数据库中。
可选地,所述建立与云终端上模块的连接关系的步骤为:通过调用日志客户进程接口,建立与所述云终端上模块的连接关系。
可选地,所述根据预先设定的日志保存配置参数,将需要保存的所述日志内容生成对应的日志信息的步骤包括:获取与所述服务器端共用的共享内存中的日志保存配置参数;根据所述日志保存配置参数中的模块级别信息,将需要保存的所述日志内容生成对应的日志信息。
可选地,所述根据所述日志保存配置参数中的模块级别信息,将需要保存的所述日志内容生成对应的日志信息的步骤包括:若所述模块级别信息表明所述模块生成的日志内容需要保存,则将预设长度的所述日志内容生成标准格式的日志信息。
可选地,所述标准格式的日志信息中包含:日志级别、日志生成时间、所述日志信息对应的模块名以及生成的所述日志内容。
本发明实施例提供一种云终端日志处理装置,应用于客户端,包括:连接模块,设置为建立与云终端上模块的连接关系;日志获取模块,设置为获取所述模块的日志内容;生成模块,设置为根据预先设定的日志保存配置参数,将需要保存的所述日志内容生成对应的日志信息;上传模块,设置为将所述日志信息上传给服务器端,使得所述服务器端将所述日志信息存储至嵌入式数据库中。
可选地,所述生成模块包括:第一获取单元,设置为获取与所述服务器端共用的共享内存中的日志保存配置参数;生成单元,设置为根据所述日志保存配置参数中的模块级别信息,将需要保存的所述日志内容生成对应的日志信息。
本发明实施例提供一种云终端日志处理系统,包括:云终端第一日志处理装置和云终端第二日志处理装置;其中,所述云终端第一日志处理装置包括:连接模块,设置为建立与云终端上模块的连接关系;日志获取模块,设置为获取所述模块的日志内容;生成模块,设置为根据预先设定的日志保存配置参数,将需要保存的所述日志内容生成对应的日志信息;上传模块,设置为将所述日志信息上传给所述云终端第二日志处理装置,使得所述云终端第二日志处理装置将所述日志信息存储至嵌入式数据库中;所述云终端第二日志处理装置包括:接收模块,设置为接收与云终端上的模块相连接的所述云终端第一日志处理装置上传的日志信息;参数获取模块,设置为获取预先设定的日志保存配置参数;存储模块,设置为根据所述日志保存配置参数,将所述日志信息存储至嵌入式数据库中。
可选地,所述云终端第二日志处理装置还包括:配置命令获取模块,设置为获取外部配置命令,所述外部配置命令包含对日志保存配置参数的配置信息;保存模块,设置为将所述外部配置命令中包含的所述配置信息存入配置文件;映射模块,设置为将所述配置文件映射到与所述云终端第一日志处理装置共用的共享内存中。
可选地,所述云终端第二日志处理装置还包括:操作命令获取模块,设置为获取外部操作命令,所述外部操作命令包括对所述嵌入式数据库中的日志信息进行读取和/或删除的命令;操作模块,设置为获取配置文件中的日志保存配置参数,并依据所述日志保存配置参数对所述嵌入式数据库中的日志信息进行读取和/或删除操作。
本发明实施例的有益效果是:
上述方案,通过将云终端上的日志依据预设的日志保存配置参数存储到嵌入式数据库中,方便了对云终端上模块日志的管理,节省了资源开销,同时方便了云终端日志处理系统的移植。
附图说明
图1表示本发明实施例的应用于服务器端的所述云终端日志处理方法的总体流程图;
图2表示本发明实施例的应用于服务器端的所述云终端日志处理装置的模块示意图;
图3表示本发明实施例的应用于客户端的所述云终端日志处理方法的总体流程图;
图4表示本发明实施例的应用于客户端的所述云终端日志处理装置的模块示意图;
图5表示本发明实施例的所述云终端日志处理系统的静态图;
图6表示本发明实施例的所述日志客户端的主要实现流程图;
图7表示本发明实施例的所述日志服务器端的主要实现流程图;
图8表示本发明实施例的所述配置程序的主要处理流程。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图及具体实施例对本发明进行详细描述。
本发明实施例针对现有的云终端日志系统存在着可移植性差、资源占用高或者分析效率低的问题,提供一种云终端日志处理方法、装置及系统。
如图1所示,本发明实施例提供一种云终端日志处理方法,应用于服务器端,包括:
步骤11,接收与云终端上的模块相连接的客户端上传的日志信息;
步骤12,获取预先设定的日志保存配置参数;
步骤13,根据日志保存配置参数,将日志信息存储至嵌入式数据库中。
上述方案,通过将云终端上的模块在运行时生成的日志信息保存到嵌入式数据库中,方便了对模块日志的管理,在云终端出现问题时,能根据嵌入式数据库中的日志信息,快速定位问题、分析问题与解决问题。
这里应当说明的是,因数据库天然具有按关键字查询分析的特征,能满足复杂的分析需要,且操作简单,本发明实施例中使用嵌入式数据库来记录日志信息,方便了对日志信息的查找与定位;本发明中优选地使用SQLite3数据库(SQLite,是一款轻型的数据库,是遵守ACID的关系型数据库管理系统,ACID即Atomicity:原子性、Consistency:一致性、Isolation:隔离性、Durability:持 久性),SQLite3数据库是一种完全免费、开放的、支持多平台的嵌入式数据库,不存在版权和法律风险;本系统可移植性相当好,对于各平台的移植,只需要更换SQLite3库文件;系统资源占用低,分析效率高,可以提高研发和维护的效率,这样的话,使得产品相对于目前行业上的其它产品具有独特的优势。
本发明实施例的步骤12具体为:
获取与客户端共用的共享内存中的日志保存配置参数,日志保存配置参数由配置文件映射到共享内存中。
应当说明的是,日志保存配置参数存储在配置文件中,通过将配置文件中的信息映射到共享内存中,直接在内存中进行数据的读取,提高了数据的读取速率。
本发明实施例的步骤13包括:
步骤131,将日志信息存入缓存队列;
步骤132,在满足预设条件时,按照日志保存配置参数,将缓存队列中的日志信息存储至嵌入式数据库中。
应当说明的是,本发明实施例中,服务器端接收的日志信息为客户端预先生成的预设格式的日志信息,日志信息可以直接存储到嵌入式数据库中,本发明实施例的预设格式的日志信息,包括:日志级别、日志生成时间、日志信息对应的模块名以及生成的日志内容;例如,日志信息格式为:debug 2012-11-29 19:40:40.792362proc1:this is test log。
应当说明的是,日志级别为日志的保存等级(即模块对应的日志的保存等级,也可以认为是模块的级别),本发明实施例中,日志级别可以定义为以下四个等级:
nothing表示为不保存任何信息;debug表示为调试信息;info表示为一般提示信息;error表示为错误日志。
本发明实施例中定义的配置文件的基本格式包括:
日志的保存等级以及日志的数据库性能参数设置,如日志写入数据库的速率、数据库的容量等。
具体地,本发明实施例中提供的步骤132的一种实现方式为:
当缓存队列中缓存的日志信息的条数达到预设值或缓存时间周期到达,且 嵌入式数据库处于未存满的状态时,按照日志保存配置参数中预设的日志存入速率(即日志写入数据库的速率),将缓存队列中的日志信息存储至嵌入式数据库中。
对上述实现方式举例说明如下:
服务器端在接收到多条日志信息时,首先按照日志信息的接收顺序,将日志信息暂存到缓存队列中,缓存队列边进行存储边对日志信息的条数进行统计,在进行存储时,可以将当缓存队列中的日志信息的条数大于或等于预设的日志存入速率作为进行存储的依据,这里应当说明的是,日志存入速率以日志信息的条数为单位进行存储,举例说明为:预设的日志写入数据库的速率为200条每秒,当检测到缓存队列中的日志条数达到200条时,便将缓存队列中的日志信息存储到嵌入式数据库中;或者是在进行存储时,可以将缓存队列的时间周期作为进行存储的依据,当缓存队列的时间周期到达时,便需要将缓存队列中的日志信息存储到嵌入式数据库中,例如:预设的缓存队列的时间周期为100毫秒,在100毫秒的时间周期到达时,即表明需将缓存队列中的日志信息存入嵌入式数据库中;在进行写入时,日志信息的写入数据库的速率不应超过预设的日志存入速率,假设预设的日志存入速率为200条每秒,当需要进行日志写入时,缓存队列中的日志信息条数为210条,日志的存入速率为200条每秒;而当需要进行日志写入时,缓存队列中的日志信息条数为180条,日志的存入速率为180条每秒;这里还需要说明的是,在进行日志信息写入时,首先要判断数据库是否未存满,若数据库的存储容量已经达到预设容量值,则不进行日志信息的写入,直接将日志信息丢弃。
应当说明的是,本发明实施例中还实现了对配置文件的修改与配置,因此,本发明实施例中,云终端日志处理方法,还包括:
获取外部配置命令,外部配置命令包含对日志保存配置参数的配置信息;
将外部配置命令中包含的配置信息存入配置文件;
将配置文件映射到与客户端共用的共享内存中。
应当说明的是,外部配置命令主要包含对日志等级的配置命令,对数据库容量的配置命令和对日志存入速率的配置命令。
在进行配置文件的使用时,可以直接将配置文件中的信息写入到共享内存, 等待其他程序的调用,也可以在用到配置文件中的信息时,在将配置文件中的信息写入到共享内存。
本发明实施例中还提供了数据库中日志信息操作的方法,即云终端日志处理方法,还包括:
获取外部操作命令,外部操作命令包括对嵌入式数据库中的日志信息进行读取和/或删除的命令;
获取配置文件中的日志保存配置参数,并依据日志保存配置参数对嵌入式数据库中的日志信息进行读取和/或删除操作。
需要说明的是,本发明实施例中提供了数据库中日志信息的读取和删除操作,当需要读取日志信息时,首先需要设定要读取的日志信息的读取规则,如按级别读取、按模块读取等,然后将规则与配置文件中的日志保存配置参数进行比对,如:读取规则为按日志关键字读取,而日志保存配置参数中未记录日志的关键字信息,则无法实现对日志信息的读取。
本发明实施例上述方案,通过将客户端获取的日志信息存入嵌入式数据库,方便了对日志信息的管理,且使用移植性良好的嵌入式数据库,使得上述方案,具有良好的通用性。
对应于上述云终端日志处理方法,如图2所示,本发明实施例提供一种云终端日志处理装置,应用于服务器端,包括:
接收模块110,设置为接收与云终端上的模块相连接的客户端上传的日志信息;
参数获取模块120,设置为获取预先设定的日志保存配置参数;
存储模块130,设置为根据日志保存配置参数,将日志信息存储至嵌入式数据库中。
具体的,参数获取模块120主要为获取与客户端共用的共享内存中的日志保存配置参数,日志保存配置参数由配置文件映射到共享内存中。
可选地,存储模块130包括:
缓存单元,设置为将日志信息存入缓存队列;
存储单元,设置为在满足预设条件时,按照日志保存配置参数,将缓存队列中的日志信息存储至嵌入式数据库中。
存储单元的具体应用为:当缓存队列中缓存的日志信息的条数达到预设值或缓存时间周期到达,且嵌入式数据库处于未存满的状态时,按照日志保存配置参数中预设的日志存入速率,将缓存队列中的日志信息存储至嵌入式数据库中。
可选地,云终端日志处理装置,还包括:
配置命令获取模块,设置为获取外部配置命令,外部配置命令包含对日志保存配置参数的配置信息;
保存模块,设置为将外部配置命令中包含的配置信息存入配置文件;
映射模块,设置为将配置文件映射到与客户端共用的共享内存中。
可选地,云终端日志处理装置,还包括:
操作命令获取模块,设置为获取外部操作命令,外部操作命令包括对嵌入式数据库中的日志信息进行读取和/或删除的命令;
操作模块,设置为获取配置文件中的日志保存配置参数,并依据日志保存配置参数对嵌入式数据库中的日志信息进行读取和/或删除操作。
对应于上述服务器端,如图3所示,本发明实施例提供一种云终端日志处理方法,应用于客户端,包括:
步骤21,建立与云终端上模块的连接关系;
步骤22,获取模块的日志内容;
步骤23,根据预先设定的日志保存配置参数,将需要保存的日志内容生成对应的日志信息;
步骤24,将日志信息上传给服务器端,使得服务器端将日志信息存储至嵌入式数据库中。
可选地,步骤21具体为:
通过调用日志客户进程接口,建立与云终端上模块的连接关系。
本发明实施例的步骤23包括:
步骤231,获取与服务器端共用的共享内存中的日志保存配置参数;
步骤232,根据日志保存配置参数中的模块级别信息,将需要保存的日志内容生成对应的日志信息。
具体地,步骤232具体为:
若模块级别信息表明模块生成的日志内容需要保存,则将预设长度的日志内容生成标准格式的日志信息。
应当说明的是,当客户端与云终端上的模块建立连接关系后,便开始获取云终端上模块在运行时生成的日志内容,同时客户端会读取共享内存中的模块级别信息,若模块级别信息表明日志内容需要进行保存,则在获取的日志内容中,依次截取预设长度的日志内容,然后将预设长度的日志内容封装成标准格式,形成日志信息,本发明实施例中,标准格式的日志信息中包含:日志级别、日志生成时间、日志信息对应的模块名以及生成的日志内容。
在将日志信息上传给服务器端时,主要通过socket(套接字)方式实现与服务器端的通讯。
对应于上述方法,如图4所示,本发明实施例提供一种云终端日志处理装置,应用于客户端,包括:
连接模块210,设置为建立与云终端上模块的连接关系;
日志获取模块220,设置为获取模块的日志内容;
生成模块230,设置为根据预先设定的日志保存配置参数,将需要保存的日志内容生成对应的日志信息;
上传模块240,设置为将日志信息上传给服务器端,使得服务器端将日志信息存储至嵌入式数据库中。
具体地,连接模块210通过调用日志客户进程接口,建立与云终端上模块的连接关系。
具体地,生成模块230包括:
第一获取单元231,设置为获取与服务器端共用的共享内存中的日志保存配置参数;
生成单元232,设置为根据日志保存配置参数中的模块级别信息,将需要保存的日志内容生成对应的日志信息。
生成单元232具体为:若模块级别信息表明模块生成的日志内容需要保存,则将预设长度的日志内容生成标准格式的日志信息。
对应于客户端装置和服务器端装置,本发明实施例提供一种云终端日志处理系统,包括:
云终端第一日志处理装置和云终端第二日志处理装置;其中,
云终端第一日志处理装置包括:
连接模块,设置为建立与云终端上模块的连接关系;
日志获取模块,设置为获取模块的日志内容;
生成模块,设置为根据预先设定的日志保存配置参数,将需要保存的日志内容生成对应的日志信息;
上传模块,设置为将日志信息上传给云终端第二日志处理装置,使得云终端第二日志处理装置将日志信息存储至嵌入式数据库中;
云终端第二日志处理装置包括:
接收模块,设置为接收与云终端上的模块相连接的云终端第一日志处理装置上传的日志信息;
参数获取模块,设置为获取预先设定的日志保存配置参数;
存储模块,设置为根据日志保存配置参数,将日志信息存储至嵌入式数据库中。
可选地,云终端第二日志处理装置还包括:
配置命令获取模块,设置为获取外部配置命令,外部配置命令包含对日志保存配置参数的配置信息;
保存模块,设置为将外部配置命令中包含的配置信息存入配置文件;
映射模块,设置为将配置文件映射到与云终端第一日志处理装置共用的共享内存中。
可选地,云终端第二日志处理装置还包括:
操作命令获取模块,设置为获取外部操作命令,外部操作命令包括对嵌入式数据库中的日志信息进行读取和/或删除的命令;
操作模块,设置为获取配置文件中的日志保存配置参数,并依据日志保存配置参数对嵌入式数据库中的日志信息进行读取和/或删除操作。
应当说明的是,配置命令获取模块、保存模块、映射模块、操作命令获取模块以及操作模块构成云终端日志处理系统的配置模块,配置模块,主要实现按日志等级、日期、模块名对数据库中的日志信息进行读取、删除操作,以及对数据库的容量、日志写入速率的配置,配置模块可以与云终端第二日志处理 装置设置为一体,也可以独立于云终端第二日志处理装置,构成单独的模块。
如图5所示,以配置模块单独设置为例,本发明实施例云终端日志处理系统包括:日志客户端(对应于上述云终端第一日志处理装置)和日志服务器端(对应于上述云终端第二日志处理装置),日志客户端调用日志客户端接口,通过使用多个日志客户进程对云终端模块的日志进行采集,即一个日志客户进程对应一个云终端模块,在得到云终端模块的需保存的日志信息后,通过socket向日志服务器发送日志信息,日志服务端在通过收包线程得到日志信息后,先将日志信息按先后顺序挂在缓冲区链表上,然后在预设条件下,通过数据库插入线程,调用sql接口事务插入将日志信息插入到SQLite3数据库中;通过日志配置程序实现对SQLite3数据库中的日志信息的读取和删除操作,同时日志配置程序(即上述的配置模块)将对日志保存的配置信息写入到共享内存,供日志客户端和日志服务器端调用。
如图6所示,日志客户端的主要实现流程为:
步骤S11,客户进程调用日志接口建立与云终端上模块的连接关系;
步骤S12,读取共享内存中本模块的级别信息;
步骤S13,根据级别信息判定模块对应的日志是否要保存;如果不需要保存则执行步骤S15,丢弃该日志;如果需要保存,则执行步骤S14,添加日志的时间、模块名信息组装成sql标准格式;
步骤S16,将日志信息从socket发送到日志服务器端。
如图7所示,日志服务器端的主要实现流程为:
步骤S21,服务进程启动;
步骤S22,将配置文件读取到共享内存;
步骤S23,检查socket收包;
步骤S24,判断socket是否接收到日志信息;若没有收到日志信息,则跳转到步骤S23,若收到日志信息,则执行步骤S25,将日志信息保存到缓存列表;
步骤S26,判断缓存节点个数是否大于或等于预设值或者时间周期是否到达;若缓存节点个数未达到预设值或者时间周期未到达,则跳转到步骤S23;若缓存节点个数达到预设值或者时间周期到达,则进行步骤S27,判断数据库是否存满,若数据库未存满,则进行步骤S28,将日志信息按预设速率插入数据库,然后跳 转到步骤S24;若数据库存满,则执行步骤S29,丢弃该缓存节点,跳转到步骤S23。
如图8所示,配置程序的主要处理流程为:
步骤S31,调用配置程序;
步骤S32,将配置文件读取到共享内存;
步骤S33,进行参数选择的判定,若为参数设置,则进行步骤S34,设置模块的等级、数据库容量值或日志写入速率值;若为日志读取,则进行步骤S35,按模块、等级、时间从数据库读取日志;若为日志删除,则进行步骤S36,按模块、等级、时间从数据库删除日志。
应当说明的是,云终端日志处理系统实现了对云终端上的模块的日志的存储,通过嵌入式数据库保存预设格式的日志信息,方便了对日志信息的读写,同时也方便了查询分析;通过使用共享内存的方式对配置文件进行读写,由于是内存操作,既可以实时向所有进程传递配置信息,又不影响各模块的执行效率,提高了云终端日志处理系统的效率,通过将日志信息存入嵌入式数据库,跨平台兼容性较好,在进行系统移植时只需更换库文件即可;综上,云终端日志处理系统操作方便、易于移植、低资源占用、分析高效,为云终端的日志处理提供了便利。
以上的是本发明的优选实施方式,应当指出对于本技术领域的普通人员来说,在不脱离本发明实施例的原理前提下还可以作出若干改进和润饰,这些改进和润饰也在本发明的保护范围内。
工业实用性
如上,通过上述实施例及优选实施方式,通过将云终端上的日志依据预设的日志保存配置参数存储到嵌入式数据库中,方便了对云终端上模块日志的管理,节省了资源开销,同时方便了云终端日志处理系统的移植。

Claims (20)

  1. 一种云终端日志处理方法,应用于服务器端,包括:
    接收与云终端上的模块相连接的客户端上传的日志信息;
    获取预先设定的日志保存配置参数;
    根据所述日志保存配置参数,将所述日志信息存储至嵌入式数据库中。
  2. 根据权利要求1所述的云终端日志处理方法,其中,所述获取预先设定的日志保存配置参数的步骤为:
    获取与所述客户端共用的共享内存中的日志保存配置参数,所述日志保存配置参数由配置文件映射到所述共享内存中。
  3. 根据权利要求1所述的云终端日志处理方法,其中,所述根据所述日志保存配置参数,将所述日志信息存储至嵌入式数据库中的步骤包括:
    将所述日志信息存入缓存队列;
    在满足预设条件时,按照所述日志保存配置参数,将所述缓存队列中的日志信息存储至嵌入式数据库中。
  4. 根据权利要求3所述的云终端日志处理方法,其中,在满足预设条件时,按照所述日志保存配置参数,将所述缓存队列中的日志信息存储至嵌入式数据库中的步骤为:
    当所述缓存队列中缓存的日志信息的条数达到预设值或缓存时间周期到达,且嵌入式数据库处于未存满的状态时,按照所述日志保存配置参数中预设的日志存入速率,将所述缓存队列中的日志信息存储至嵌入式数据库中。
  5. 根据权利要求1所述的云终端日志处理方法,其中,所述云终端日志处理方法,还包括:
    获取外部配置命令,所述外部配置命令包含对日志保存配置参数的配置信息;
    将所述外部配置命令中包含的所述配置信息存入配置文件;
    将所述配置文件映射到与所述客户端共用的共享内存中。
  6. 根据权利要求5所述的云终端日志处理方法,其中,所述云终端日志处理方法,还包括:
    获取外部操作命令,所述外部操作命令包括对所述嵌入式数据库中的日志信息进行读取和/或删除的命令;
    获取配置文件中的日志保存配置参数,并依据所述日志保存配置参数对所述嵌入式数据库中的日志信息进行读取和/或删除操作。
  7. 一种云终端日志处理装置,应用于服务器端,包括:
    接收模块,设置为接收与云终端上的模块相连接的客户端上传的日志信息;
    参数获取模块,设置为获取预先设定的日志保存配置参数;
    存储模块,设置为根据所述日志保存配置参数,将所述日志信息存储至嵌入式数据库中。
  8. 根据权利要求7所述的云终端日志处理装置,其中,所述存储模块包括:
    缓存单元,设置为将所述日志信息存入缓存队列;
    存储单元,设置为在满足预设条件时,按照所述日志保存配置参数,将所述缓存队列中的日志信息存储至嵌入式数据库中。
  9. 根据权利要求7所述的云终端日志处理装置,其中,所述云终端日志处理装置,还包括:
    配置命令获取模块,设置为获取外部配置命令,所述外部配置命令包含对日志保存配置参数的配置信息;
    保存模块,设置为将所述外部配置命令中包含的所述配置信息存入配置文件;
    映射模块,设置为将所述配置文件映射到与所述客户端共用的共享内存中。
  10. 根据权利要求9所述的云终端日志处理装置,其中,所述云终端日志处理装置,还包括:
    操作命令获取模块,设置为获取外部操作命令,所述外部操作命令包括对所述嵌入式数据库中的日志信息进行读取和/或删除的命令;
    操作模块,设置为获取配置文件中的日志保存配置参数,并依据所述日志保存配置参数对所述嵌入式数据库中的日志信息进行读取和/或删除操作。
  11. 一种云终端日志处理方法,应用于客户端,包括:
    建立与云终端上模块的连接关系;
    获取所述模块的日志内容;
    根据预先设定的日志保存配置参数,将需要保存的所述日志内容生成对应的日志信息;
    将所述日志信息上传给服务器端,使得所述服务器端将所述日志信息存储至嵌入式数据库中。
  12. 根据权利要求11所述的云终端日志处理方法,其中,所述建立与云终端上模块的连接关系的步骤为:
    通过调用日志客户进程接口,建立与所述云终端上模块的连接关系。
  13. 根据权利要求11所述的云终端日志处理方法,其中,所述根据预先设定的日志保存配置参数,将需要保存的所述日志内容生成对应的日志信息的步骤包括:
    获取与所述服务器端共用的共享内存中的日志保存配置参数;
    根据所述日志保存配置参数中的模块级别信息,将需要保存的所述日志内容生成对应的日志信息。
  14. 根据权利要求13所述的云终端日志处理方法,其中,所述根据所述日志保存配置参数中的模块级别信息,将需要保存的所述日志内容生成对应的日志信息的步骤包括:
    若所述模块级别信息表明所述模块生成的日志内容需要保存,则将预设长度的所述日志内容生成标准格式的日志信息。
  15. 根据权利要求14所述的云终端日志处理方法,其中,所述标准格式的日志信息中包含:日志级别、日志生成时间、所述日志信息对应的模块名以及生成的所述日志内容。
  16. 一种云终端日志处理装置,应用于客户端,其中,包括:
    连接模块,设置为建立与云终端上模块的连接关系;
    日志获取模块,设置为获取所述模块的日志内容;
    生成模块,设置为根据预先设定的日志保存配置参数,将需要保存的所述日志内容生成对应的日志信息;
    上传模块,设置为将所述日志信息上传给服务器端,使得所述服务器端将所述日志信息存储至嵌入式数据库中。
  17. 根据权利要求16所述的云终端日志处理装置,其中,所述生成模块包 括:
    第一获取单元,设置为获取与所述服务器端共用的共享内存中的日志保存配置参数;
    生成单元,设置为根据所述日志保存配置参数中的模块级别信息,将需要保存的所述日志内容生成对应的日志信息。
  18. 一种云终端日志处理系统,包括:
    云终端第一日志处理装置和云终端第二日志处理装置;其中,
    所述云终端第一日志处理装置包括:
    连接模块,设置为建立与云终端上模块的连接关系;
    日志获取模块,设置为获取所述模块的日志内容;
    生成模块,设置为根据预先设定的日志保存配置参数,将需要保存的所述日志内容生成对应的日志信息;
    上传模块,设置为将所述日志信息上传给所述云终端第二日志处理装置,使得所述云终端第二日志处理装置将所述日志信息存储至嵌入式数据库中;
    所述云终端第二日志处理装置包括:
    接收模块,设置为接收与云终端上的模块相连接的所述云终端第一日志处理装置上传的日志信息;
    参数获取模块,设置为获取预先设定的日志保存配置参数;
    存储模块,设置为根据所述日志保存配置参数,将所述日志信息存储至嵌入式数据库中。
  19. 根据权利要求18所述的云终端日志处理系统,其中,所述云终端第二日志处理装置还包括:
    配置命令获取模块,设置为获取外部配置命令,所述外部配置命令包含对日志保存配置参数的配置信息;
    保存模块,设置为将所述外部配置命令中包含的所述配置信息存入配置文件;
    映射模块,设置为将所述配置文件映射到与所述云终端第一日志处理装置共用的共享内存中。
  20. 根据权利要求19所述的云终端日志处理系统,其中,所述云终端第二 日志处理装置还包括:
    操作命令获取模块,设置为获取外部操作命令,所述外部操作命令包括对所述嵌入式数据库中的日志信息进行读取和/或删除的命令;
    操作模块,设置为获取配置文件中的日志保存配置参数,并依据所述日志保存配置参数对所述嵌入式数据库中的日志信息进行读取和/或删除操作。
PCT/CN2015/085461 2015-04-21 2015-07-29 一种云终端日志处理方法、装置及系统 WO2016169145A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510189031.0A CN106161074A (zh) 2015-04-21 2015-04-21 一种云终端日志处理方法、装置及系统
CN201510189031.0 2015-04-21

Publications (1)

Publication Number Publication Date
WO2016169145A1 true WO2016169145A1 (zh) 2016-10-27

Family

ID=57143505

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/085461 WO2016169145A1 (zh) 2015-04-21 2015-07-29 一种云终端日志处理方法、装置及系统

Country Status (2)

Country Link
CN (1) CN106161074A (zh)
WO (1) WO2016169145A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109885496A (zh) * 2019-02-20 2019-06-14 北京百佑科技有限公司 测试日志管理方法及系统
CN111835562A (zh) * 2020-07-01 2020-10-27 北京爱笔科技有限公司 日志上传方法、日志查询方法、系统
CN112764961A (zh) * 2021-01-28 2021-05-07 西安超越申泰信息科技有限公司 云终端在线运维管理方法和装置
CN114780353A (zh) * 2022-06-15 2022-07-22 统信软件技术有限公司 一种文件日志监控方法、系统及计算设备

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255884A (zh) * 2016-12-29 2018-07-06 大唐移动通信设备有限公司 一种omc的日志信息的数据处理方法和装置
CN108170585A (zh) * 2017-12-26 2018-06-15 广东欧珀移动通信有限公司 日志处理方法、装置、终端设备及存储介质
CN108170576B (zh) * 2017-12-26 2021-12-07 Oppo广东移动通信有限公司 日志处理方法、装置、终端设备及存储介质
US11455292B2 (en) 2018-09-21 2022-09-27 Microsoft Technology Licensing, Llc Brokering persisted and unpersisted log records
CN109981652A (zh) * 2019-03-28 2019-07-05 北京中安兴坤科技有限公司 计算机安全检查系统以及方法
CN111143218B (zh) * 2019-12-27 2024-03-26 深圳市共进电子股份有限公司 适用于5G嵌入式设备的log调试方法、装置和可读存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1932812A (zh) * 2005-09-16 2007-03-21 腾讯科技(深圳)有限公司 一种日志保存方法及装置
JP2007299284A (ja) * 2006-05-01 2007-11-15 Hitachi Software Eng Co Ltd ログ収集システム、クライアント装置、及びログ収集エージェント装置
CN101465765A (zh) * 2008-12-31 2009-06-24 东信和平智能卡股份有限公司 日志系统及其使用方法
CN103532754A (zh) * 2013-10-12 2014-01-22 北京首信科技股份有限公司 一种通过高速内存、分布式处理海量日志的系统及方法
CN103944973A (zh) * 2014-04-02 2014-07-23 北京中交兴路车联网科技有限公司 一种日志采集方法及装置
JP2014229059A (ja) * 2013-05-22 2014-12-08 日本電信電話株式会社 端末操作履歴収集システム及び端末操作履歴収集方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1932812A (zh) * 2005-09-16 2007-03-21 腾讯科技(深圳)有限公司 一种日志保存方法及装置
JP2007299284A (ja) * 2006-05-01 2007-11-15 Hitachi Software Eng Co Ltd ログ収集システム、クライアント装置、及びログ収集エージェント装置
CN101465765A (zh) * 2008-12-31 2009-06-24 东信和平智能卡股份有限公司 日志系统及其使用方法
JP2014229059A (ja) * 2013-05-22 2014-12-08 日本電信電話株式会社 端末操作履歴収集システム及び端末操作履歴収集方法
CN103532754A (zh) * 2013-10-12 2014-01-22 北京首信科技股份有限公司 一种通过高速内存、分布式处理海量日志的系统及方法
CN103944973A (zh) * 2014-04-02 2014-07-23 北京中交兴路车联网科技有限公司 一种日志采集方法及装置

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109885496A (zh) * 2019-02-20 2019-06-14 北京百佑科技有限公司 测试日志管理方法及系统
CN111835562A (zh) * 2020-07-01 2020-10-27 北京爱笔科技有限公司 日志上传方法、日志查询方法、系统
CN111835562B (zh) * 2020-07-01 2023-10-17 北京爱笔科技有限公司 日志上传方法、日志查询方法、系统
CN112764961A (zh) * 2021-01-28 2021-05-07 西安超越申泰信息科技有限公司 云终端在线运维管理方法和装置
CN114780353A (zh) * 2022-06-15 2022-07-22 统信软件技术有限公司 一种文件日志监控方法、系统及计算设备

Also Published As

Publication number Publication date
CN106161074A (zh) 2016-11-23

Similar Documents

Publication Publication Date Title
WO2016169145A1 (zh) 一种云终端日志处理方法、装置及系统
WO2019085079A1 (zh) 接口测试方法、装置、计算机设备和存储介质
CN110069572B (zh) 基于大数据平台的hive任务调度方法、装置、设备及存储介质
US20180359140A1 (en) Method, device, and system for processing a terminal fault
WO2019085073A1 (zh) 接口测试方法、装置、计算机设备和存储介质
CN109344065B (zh) 远程调试方法、调试服务器及目标机
US8387076B2 (en) Standardized database connectivity support for an event processing server
US8321450B2 (en) Standardized database connectivity support for an event processing server in an embedded context
CN107451147B (zh) 一种kafka集群动态切换的方法和装置
US20080155348A1 (en) Tracing operations in multiple computer systems
WO2019051948A1 (zh) 监控数据的处理方法、设备、服务器及存储介质
CN110287696B (zh) 一种反弹shell进程的检测方法、装置和设备
CN109460343A (zh) 基于日志的系统异常监控方法、装置、设备及存储介质
WO2015062228A1 (zh) 一种访问共享内存的方法和装置
CN102497427A (zh) 实现可再生能源监测系统数据采集服务的方法和装置
WO2019178957A1 (zh) 分布式系统的测试方法、装置、计算机设备及存储介质
WO2019148657A1 (zh) 关联环境测试方法、电子装置及计算机可读存储介质
CN112202628B (zh) 一种WiFi模块串口协议自动化测试系统及方法
WO2009076827A1 (zh) 一种自动化测试方法、系统及一种测试设备
WO2019100690A1 (zh) 电子装置、测试的方法、系统及计算机可读存储介质
CN114598687B (zh) 一种https数据包的抓取方法、系统及终端
CN109257230A (zh) 一种半导体存储器老化测试的日志管理系统及方法
CN109145043A (zh) 一种多平台数据对接方法及设备
CN112835978A (zh) 一种数据存储方法、装置及计算机设备
CN112765246A (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: 15889633

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15889633

Country of ref document: EP

Kind code of ref document: A1