WO2017096968A1 - 日志上传方法及装置 - Google Patents

日志上传方法及装置 Download PDF

Info

Publication number
WO2017096968A1
WO2017096968A1 PCT/CN2016/097222 CN2016097222W WO2017096968A1 WO 2017096968 A1 WO2017096968 A1 WO 2017096968A1 CN 2016097222 W CN2016097222 W CN 2016097222W WO 2017096968 A1 WO2017096968 A1 WO 2017096968A1
Authority
WO
WIPO (PCT)
Prior art keywords
log information
abnormal log
program
server
time point
Prior art date
Application number
PCT/CN2016/097222
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 WO2017096968A1 publication Critical patent/WO2017096968A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • 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
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment

Definitions

  • the present application relates to the field of information technology, for example, to a log uploading method and apparatus.
  • the present invention provides a log uploading method and device for solving the problem that an abnormal log information cannot be automatically uploaded to a server when an abnormality occurs in a program.
  • An embodiment of the present application provides a log uploading method, where the method includes:
  • the storing the abnormal log information includes:
  • the abnormal log information named at the time point is stored.
  • the method before the uploading the abnormal log information to the server, the method further includes:
  • the uploading the abnormal log information to the server includes:
  • the abnormal log information named at the time point is uploaded to the server.
  • the method further includes:
  • the method further includes:
  • the abnormal log information named at the time point is successfully uploaded to the server, the abnormal log information named at the time point is deleted locally.
  • the abnormal log information of the acquiring program includes:
  • the abnormal log information of the program is obtained by a preset function function bound in the program.
  • the embodiment of the present application further provides a log uploading device, where the device includes:
  • the obtaining unit is set to acquire the abnormal log information of the program when the program terminates abnormally;
  • a storage unit configured to store the abnormal log information
  • the upload unit is configured to upload the abnormal log information to the server.
  • the storage unit includes:
  • Obtaining a module configured to obtain a corresponding time point when the program is abnormally terminated
  • a naming module configured to name the log information according to the time point
  • the storage module is configured to store the abnormal log information named at the time point.
  • the device further includes: an output unit;
  • the output unit is configured to output prompt information for uploading abnormal log information named at the time point to the server.
  • the uploading unit is configured to upload the abnormal log information named at the time point to the server when receiving the confirmation instruction of the prompt information.
  • the device further includes:
  • a determining unit configured to determine whether the abnormal log information named at the time point has been successfully Pass to the server.
  • the device further includes:
  • the deletion unit is configured to delete the abnormal log information named by the time point locally when the abnormal log information named at the time point is successfully uploaded to the server.
  • the obtaining unit is configured to acquire abnormal log information of the program by using a preset function function bound in the program.
  • the embodiment of the present application further provides an electronic device, including:
  • At least one processor and,
  • the memory stores instructions executable by the one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
  • the embodiment of the present application further provides a non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores computer instructions for causing the computer to execute in the embodiment of the present application. Any log upload method.
  • the embodiment of the present application further provides a computer program product, wherein the computer program product comprises a calculation program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instruction is When the computer is executed, the computer is caused to execute any of the log uploading methods in the embodiment of the present application.
  • the computer program product comprises a calculation program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instruction is When the computer is executed, the computer is caused to execute any of the log uploading methods in the embodiment of the present application.
  • the method and device for uploading a log provided by the embodiment of the present invention firstly acquire abnormal log information of the program when the program is abnormally terminated, and then store the abnormal log information, and finally upload the abnormal log information to the server.
  • the automatic acquisition program appears through the global capture exception class bound in the program.
  • the abnormal log information is then stored in the abnormal log information, and finally the abnormal log information is automatically uploaded to the server, thereby automatically uploading the abnormal log information to the server.
  • FIG. 1 is a flowchart of a log uploading method according to an embodiment of the present application
  • FIG. 2 is a flowchart of another log uploading method according to an embodiment of the present application.
  • FIG. 3 is a structural block diagram of a log uploading apparatus according to an embodiment of the present application.
  • FIG. 4 is a structural block diagram of another log uploading apparatus according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a physical structure of a server according to an embodiment of the present application.
  • the embodiment of the present application provides a log uploading method, as shown in FIG. 1 , including:
  • the abnormal exception log information of the program may be obtained by binding the global exception capture class in the program, wherein the global exception capture class is as follows:
  • Binding the global exception capture class in the program is as follows:
  • the abnormal log information of the program can be obtained by calling the following function:
  • the abnormal log information obtained in the embodiment of the present application is abnormal information generated in the program, and not all the system log information. Therefore, the abnormal log information obtained by the embodiment of the present application is a redundant system log. Therefore, the storage space of the abnormal log information obtained by the application is smaller, and the content is more clear, so that the program developer can quickly obtain the browser according to the abnormal log information. The reason for the crash is to improve the processing efficiency of the abnormal log information.
  • the abnormal log information may be stored in a local SD memory card or stored in an external storage device, which is not limited in this embodiment. It should be noted that the abnormal log information is stored to solve the problem that the abnormal log information is lost when the abnormal log information is uploaded, and the abnormal log information cannot be uploaded to the server again.
  • the abnormal log information is uploaded to the server.
  • the abnormal log information of the program is first obtained, and then the obtained abnormal log information is stored in the local SD memory card to prevent abnormal log information caused when the abnormal log information is failed to be uploaded. Lost, and finally upload the exception log information to the server. Therefore, in the embodiment of the present application, when the program abnormally terminates, the abnormal log information is automatically uploaded to the server.
  • the embodiment of the present application further provides a log uploading method, as shown in FIG. 2, including:
  • the preset function function is a global exception capture function. By binding a global exception capture function in the program, when the program terminates abnormally, the abnormal log information in the program is automatically acquired.
  • the global exception capture function is as follows:
  • the storing the abnormal log information includes: acquiring a corresponding time point when the program is abnormally terminated; and naming the abnormal log information according to the time point; Named exception log information is stored.
  • the corresponding time point is 14:12 on December 8, 2015.
  • the name corresponding to the abnormal log information is 2015.12.8-14:12.
  • by naming the abnormal log information at a time point it is possible to prevent duplicate abnormal log file generation.
  • the user by outputting whether the abnormal log information named at the time point is uploaded to the server prompt information, the user can select whether to upload the abnormal log information to the server, thereby avoiding the background sneak user. Traffic.
  • the abnormal log information cannot be successfully uploaded to the server. Therefore, after uploading the abnormal log information named at the time point to the server, It is necessary to determine whether the abnormal log information named by the time point has been successfully uploaded to the server. When the upload is not successful, a dialog box asking the user whether to continue uploading the abnormal log information to the server is displayed, thereby continuing to upload the abnormal log. information.
  • the embodiment of the present application provides a log uploading device, as shown in FIG. 3, the device includes: an obtaining unit 31, a storage unit 32, and an uploading unit 33;
  • the obtaining unit 31 is configured to obtain the abnormal log information of the program when the program is abnormally terminated.
  • the abnormal log information obtained in the embodiment of the present application is abnormal information that appears in the program, instead of all system log information, and therefore the application is passed.
  • the exception log information obtained by the embodiment is to remove the redundant system log, so that the storage space of the abnormal log information obtained by the application is smaller, the content is clearer, and the program developer can quickly obtain the browser according to the abnormal log information.
  • the reason for the crash is to improve the processing efficiency of the abnormal log information.
  • the storage unit 32 is configured to store the abnormal log information acquired by the obtaining unit 31.
  • the abnormal log information may be stored in a local SD memory card or stored in an external storage device.
  • the embodiment of the present application is not limited. It should be noted that the abnormal log information is stored to solve the problem that the abnormal log information is lost when the abnormal log information is uploaded, and the abnormal log information cannot be uploaded to the server again.
  • the uploading unit 33 is configured to upload the abnormal log information acquired by the obtaining unit 31 to the server.
  • the storage unit 32 includes:
  • the obtaining module 321 is configured to acquire a corresponding time point when the program abnormally terminates.
  • the naming module 322 is configured to name the log information according to the time point.
  • the storage module 323 is configured to store the abnormal log information named at the time point. For example, when the program terminates abnormally, the corresponding time is 14:12 on December 8, 2015. According to the time point, the name corresponding to the abnormal log information is 2015.12.8-14:12. In the embodiment of the present application, by naming the abnormal log information at a time point, it is possible to prevent duplicate file generation.
  • the device further includes: an output unit;
  • the output unit 34 is configured to output prompt information for uploading abnormal log information named at the time point to the server. By outputting whether to upload the abnormal log information named at the time point to the server prompt information, the user can select whether to upload the abnormal log information to the server, thereby avoiding the traffic of the user who sneaked in the background.
  • the uploading unit 33 is configured to upload the abnormal log information named at the time point to the server when receiving the confirmation instruction of the prompt information.
  • the device further includes:
  • the determining unit 35 is configured to determine whether the abnormal log information named at the time point has been successfully uploaded to the server. Due to network reasons or sudden power failure, the abnormal log information cannot be successfully uploaded to the server. Therefore, after uploading the abnormal log information named at the time point to the server, it is necessary to determine whether it has succeeded.
  • the abnormal log information named after the time point is uploaded to the server. When the upload is not successful, a dialog box is displayed to ask the user whether to continue uploading the abnormal log information to the server, so as to continue uploading the abnormal log information.
  • the device further includes:
  • the deleting unit 36 is configured to delete the abnormal log information named by the time point locally when the abnormal log information named at the time point has been successfully uploaded to the server.
  • the obtaining unit 31 is configured to acquire abnormal log information of the program by using a preset function function bound in the program.
  • the preset function function is a global exception capture function. By binding a global exception capture function in the program, when the program terminates abnormally, the log information of the abnormality in the program is automatically acquired.
  • the log uploading method and apparatus provided by the embodiment of the present application first acquires the abnormal log information of the program when the program is abnormally terminated, and then stores the abnormal log information, and finally the abnormal log.
  • the information is uploaded to the server.
  • the exception log information of the program is automatically obtained through the global capture exception class bound in the program, and then the obtained abnormal log information is stored, and finally the abnormal log information is automatically uploaded to the server, thereby realizing automatic upload.
  • the exception log information is sent to the server.
  • the embodiment of the present application provides a non-transitory computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the log uploading method in any of the foregoing method embodiments.
  • each unit module used in the embodiment of the present application can be implemented by a hardware processor.
  • FIG. 5 is a schematic diagram showing the physical structure of a server provided by an embodiment of the present application.
  • the server may include a processor 51, a communication interface 52, and a memory. (memory) 53 and bus 54, wherein the processor 51, the communication interface 52, and the memory 53 complete communication with each other via the bus 54.
  • Communication interface 52 can be used for information transfer between the server and the client.
  • the processor 51 can call the logic instructions in the memory 53 such that the log uploading device performs the method flow of Figures 1-2.
  • the logic instructions in the memory 53 described above may be implemented in the form of a software functional unit and sold or used as a stand-alone product, and may be stored in a computer readable storage medium.
  • portions of the technical solutions of the present application may be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for causing a computer device (which may be a personal computer, a server, Either a network device or the like) performs all or part of the steps of the method described in the various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Through the description of the above embodiments, those skilled in the art can understand that the embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware.
  • the above technical solution may be embodied in the form of a software product, which may be stored in a computer readable storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including a plurality of instructions for making one Computer device (can be a personal computer, server, or network device)
  • a computer readable storage medium such as a ROM/RAM, a magnetic disk, an optical disk, etc.
  • a plurality of instructions for making one Computer device can be a personal computer, server, or network device
  • the method described in the various embodiments or parts of the embodiments is performed.
  • the storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), or a random access memory (RAM).
  • the embodiment of the present application provides a log uploading method and apparatus.
  • the abnormality log information that appears in the program is automatically obtained by the globally caught exception class bound in the program, and then The obtained abnormal log information is stored, and finally the abnormal log information is automatically uploaded to the server, thereby automatically uploading the abnormal log information to the server.

Abstract

一种日志上传方法及装置,所述方法包括:当程序出现异常终止时,获取程序的异常日志信息;对所述异常日志信息进行存储;以及,将所述异常日志信息上传至服务器。

Description

日志上传方法及装置
本申请要求在2015年12月10日提交中国专利局、申请号为201510918169X、发明名称为“日志上传方法及装置”的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息技术领域,例如涉及一种日志上传方法及装置。
背景技术
随着浏览器用户的增多,每个浏览平台的差异程度也在增加,用户在使用浏览器浏览数据的时候,经常会出现浏览器崩溃的情况,这会导致用户对浏览器的不满。用户在遇到浏览器出现严重问题的时候,可能会通过QQ群,微信群或者论坛的方式联系开发者,来反映浏览器出现的问题,这个时候开发者会请用户帮忙复述错误产生的过程,并要求用户上传系统日志,然后根据系统日志获取浏览器崩溃的原因。
目前,由于大部分用户不知道如何获取系统日志,会导致开发者就无法获取到系统日志,从而无法根据系统日志获取浏览器崩溃的原因,进而导致浏览器崩溃的问题无法得到有效的解决。
发明内容
本申请提供的一种日志上传方法及装置,用以解决程序出现异常时无法将异常日志信息自动上传到服务器的问题。
本申请实施例提供一种日志上传方法,该方法包括:
当程序出现异常终止时,获取程序的异常日志信息;
对所述异常日志信息进行存储;以及,
将所述异常日志信息上传至服务器。
可选的,所述对所述异常日志信息进行存储包括:
获取所述程序出现异常终止时,对应的时间点;
根据所述时间点命名所述日志信息;以及,
将以所述时间点命名的异常日志信息进行存储。
可选的,所述将所述异常日志信息上传至服务器之前,所述方法还包括:
输出是否将以所述时间点命名的异常日志信息上传至服务器的提示信息;以及,
所述将所述异常日志信息上传至服务器包括:
当接收到所述提示信息的确认指令,则将以所述时间点命名的异常日志信息上传至服务器。
可选的,在所述将以所述时间点命名的异常日志信息上传至服务器之后,所述方法还包括:
判断是否已成功将以所述时间点命名的异常日志信息上传至所述服务器。
可选的,在所述判断是否已成功将以所述时间点命名的异常日志信息上传至所述服务器之后,所述方法还包括:
当已成功将以所述时间点命名的异常日志信息上传至所述服务器,则将本地以所述时间点命名的异常日志信息删除。
可选的,所述获取程序的异常日志信息包括:
通过在所述程序中绑定的预置功能函数,获取程序的异常日志信息。
本申请实施例还提供一种日志上传装置,该装置包括:
获取单元,设置为当程序出现异常终止时,获取程序的异常日志信息;
存储单元,设置为对所述异常日志信息进行存储;以及,
上传单元,设置为将所述异常日志信息上传至服务器。
可选的,所述存储单元包括:
获取模块,设置为获取所述程序出现异常终止时,对应的时间点;
命名模块,设置为根据所述时间点命名所述日志信息;以及,
存储模块,设置为将以所述时间点命名的异常日志信息进行存储。
可选的,所述装置还包括:输出单元;
所述输出单元,设置为输出是否将以所述时间点命名的异常日志信息上传至服务器的提示信息;以及,
所述上传单元,设置为当接收到所述提示信息的确认指令,则将以所述时间点命名的异常日志信息上传至服务器。
可选的,所述装置还包括:
判断单元,设置为判断是否已成功将以所述时间点命名的异常日志信息上 传至所述服务器。
可选的,所述装置还包括:
删除单元,设置为当已成功将以所述时间点命名的异常日志信息上传至所述服务器,则将本地以所述时间点命名的异常日志信息删除。
可选的,所述获取单元,设置为通过在所述程序中绑定的预置功能函数,获取程序的异常日志信息。
本申请实施例还提供了一种电子设备,包括:
至少一个处理器;以及,
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
当程序出现异常终止时,获取程序的异常日志信息;
对所述异常日志信息进行存储;以及,
将所述异常日志信息上传至服务器。
本申请实施例还提供了一种非暂态计算机可读存储介质,其中,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行本申请实施例中任一日志上传方法。
本申请实施例还提供了一种计算机程序产品,其中,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行本申请实施例中任一日志上传方法。
本申请实施例提供的一种日志上传方法及装置,当程序出现异常终止时,首先获取程序的异常日志信息,然后对所述异常日志信息进行存储,最后将所述异常日志信息上传至服务器。与目前在程序出现异常终止时通过用户将异常日志信息上传至服务器相比,在本申请实施例中,当程序出现异常终止时,通过在程序中绑定的全局捕获异常类,自动获取程序出现的异常日志信息,然后将获取的异常日志信息进存储,最后将异常日志信息自动上传至服务器,从而实现了自动上传异常日志信息至服务器。
附图说明
图1为本申请实施例提供的一种日志上传方法流程图;
图2为本申请实施例提供的另一种日志上传方法流程图;
图3为本申请实施例提供的一种日志上传装置的结构框图;
图4为本申请实施例提供的另一种日志上传装置的结构框图;
图5为本申请实施例提供的一种服务器的实体结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。在不冲突的情况下,实施例中的特征可以相互任意组合。
本申请实施例提供了日志上传方法,如图1所示,包括:
在S110中,当程序出现异常终止时,获取程序的异常日志信息。
在本申请实施例中,当程序出现异常终止时,可以通过在程序中绑定全局异常捕获类获取程序的异常日志信息,其中全局异常捕获类如下所示:
Figure PCTCN2016097222-appb-000001
在程序中绑定全局异常捕获类如下所示:
Thread.setDefaultUncaughtExceptionHandler(CrashHandler)
对于本申请实施例,在程序出现异常终止时,通过调用以下函数可实现获取程序的异常日志信息:
Figure PCTCN2016097222-appb-000002
需要说明的是,本申请实施例中获取的异常日志信息为程序中出现的异常信息,而非所有的系统日志信息,因此通过本申请实施例获取的异常日志信息为去除冗余的系统日志,从而通过本申请获取的异常日志信息的存储空间会较小,内容会更加清晰,可使程序开发者能够根据异常日志信息快速获取浏览器 崩溃的原因,提高了异常日志信息的处理效率。
在S120中,对所述异常日志信息进行存储。
在本申请实施例中,可将所述异常日志信息存储到本地SD存储卡中,或是存储到外部存储设备中,本申请实施例不做限定。需要说明的是,将所述异常日志信息进行存储是为了解决上传异常日志信息失败时,而造成的异常日志信息丢失的问题以及导致的不能将异常日志信息再次上传至服务器的问题。
在S130中,将所述异常日志信息上传至服务器。
对于本申请实施例,当程序出现异常终止时,首先获取程序的异常日志信息,然后将获取的异常日志信息在本地SD存储卡中进行存储,以防止上传异常日志信息失败时而造成的异常日志信息丢失,最后将异常日志信息上传至服务器。从而本申请实施例在程序出现异常终止时,会自动将异常日志信息上传至服务器。
与上述方法相对应地,本申请实施例还提供了一种日志上传方法,如图2所示,包括:
在S210中,当程序出现异常终止时,通过在程序中绑定的预置功能函数获取程序的异常日志信息。
其中,所述预置功能函数为全局异常捕获函数,通过在程序中绑定全局异常捕获函数,在程序出现异常终止时,会自动获取程序中异常的日志信息。所述全局异常捕获函数如下所示:
Figure PCTCN2016097222-appb-000003
在S220中,对所述异常日志信息进行存储。
对于本申请实施例,所述对所述异常日志信息进行存储包括:获取所述程序出现异常终止时,对应的时间点;根据所述时间点命名所述异常日志信息;将以所述时间点命名的异常日志信息进行存储。例如,在程序出现异常终止时,对应的时间点为2015年12月8日14点12分,则根据该时间点命名异常日志信息对应的名称为2015.12.8-14:12。在本申请实施例中,通过时间点命名所述异常日志信息,可以防止重复的异常日志文件产生。
在S230中,输出是否将以所述时间点命名的异常日志信息上传至服务器的提示信息。
在本申请实施例中,通过输出是否将以所述时间点命名的异常日志信息上传至服务器提示信息的方式,可让用户自主选择是否将异常日志信息上传至服务器,从而避免了后台偷跑用户的流量。
在S240中,当接收到所述提示信息的确认指令,则将以所述时间点命名的异常日志信息上传至服务器。
在S250中,判断是否已成功将以所述时间点命名的异常日志信息上传至所述服务器。
需要说明的是,由于网络原因或是突然断电等原因,将会导致异常日志信息不能够成功上传至所述服务器,因此在将以所述时间点命名的异常日志信息上传至服务器之后,还需要判断是否已成功将以所述时间点命名的异常日志信息上传至所述服务器,当未成功上传,则弹出询问用户是否继续上传异常日志信息至服务器的对话框,以此实现继续上传异常日志信息。
在S260中,当已成功将以所述时间点命名的异常日志信息上传至所述服务器,则将本地以所述时间点命名的异常日志信息删除。
可选的,作为对上述方法的实现,本申请实施例提供了一种日志上传装置,如图3所示,该装置包括:获取单元31、存储单元32以及上传单元33;
获取单元31,设置为当程序出现异常终止时,获取程序的异常日志信息,本申请实施例中获取的异常日志信息为程序中出现的异常信息,而非所有的系统日志信息,因此通过本申请实施例获取的异常日志信息为去除冗余的系统日志,从而通过本申请获取的异常日志信息的存储空间会较小,内容会更加清晰,可使程序开发者能够根据异常日志信息快速获取浏览器崩溃的原因,提高了异常日志信息的处理效率。
存储单元32,设置为对所述获取单元31获取的异常日志信息进行存储,在本申请实施例中,可将所述异常日志信息存储到本地SD存储卡中,或是存储到外部存储设备中,本申请实施例不做限定。需要说明的是,将所述异常日志信息进行存储是为了解决上传异常日志信息失败时,而造成的异常日志信息丢失的问题以及导致的不能将异常日志信息再次上传至服务器的问题。
上传单元33,设置为将所述获取单元31获取的异常日志信息上传至服务器。
可选的,如图4所示,所述存储单元32包括:
获取模块321,设置为获取所述程序出现异常终止时,对应的时间点。
命名模块322,设置为根据所述时间点命名所述日志信息。
存储模块323,设置为将以所述时间点命名的异常日志信息进行存储。例如,在程序出现异常终止时,对应的时间为2015年12月8日14点12分,则根据该时间点命名异常日志信息对应的名称为2015.12.8-14:12。在本申请实施例中,通过时间点命名所述异常日志信息,可以防止重复的文件产生。
可选的,所述装置还包括:输出单元;
所述输出单元34,设置为输出是否将以所述时间点命名的异常日志信息上传至服务器的提示信息。通过输出是否将以所述时间点命名的异常日志信息上传至服务器提示信息的方式,可让用户自主选择是否将异常日志信息上传至服务器,避免了后台偷跑用户的流量。
所述上传单元33,设置为当接收到所述提示信息的确认指令,则将以所述时间点命名的异常日志信息上传至服务器。
可选的,所述装置还包括:
判断单元35,设置为判断是否已成功将以所述时间点命名的异常日志信息上传至所述服务器。由于网络原因或是突然断电等原因,将会导致异常日志信息不能够成功上传至所述服务器,因此在将以所述时间点命名的异常日志信息上传至服务器之后,还需要判断是否已成功将以所述时间点命名的异常日志信息上传至所述服务器,当未成功上传,则弹出询问用户是否继续上传异常日志信息至服务器的对话框,以此实现继续上传异常日志信息。
可选的,所述装置还包括:
删除单元36,设置为当已成功将以所述时间点命名的异常日志信息上传至所述服务器,则将本地以所述时间点命名的异常日志信息删除。
所述获取单元31,设置为通过在所述程序中绑定的预置功能函数,获取程序的异常日志信息。所述预置功能函数为全局异常捕获函数,通过在程序中绑定全局异常捕获函数,在程序出现异常终止时,会自动获取程序中异常的日志信息。
综上所述,本申请实施例提供的一种日志上传方法及装置,当程序出现异常终止时,首先获取程序的异常日志信息,然后对所述异常日志信息进行存储,最后将所述异常日志信息上传至服务器。与目前在程序出现异常终止时通过用户将异常日志信息上传至服务器相比,在本申请实施例中,当程序出现异 常终止时,通过在程序中绑定的全局捕获异常类,自动获取程序出现的异常日志信息,然后将获取的异常日志信息进存储,最后将异常日志信息自动上传至服务器,从而实现了自动上传异常日志信息至服务器。
本申请实施例提供了一种非暂态计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的日志上传方法。
可选的,针对上述日志上传装置,凡是本申请实施例中使用到的各个单元模块的功能都可以通过硬件处理器(hardware processor)来实现。
示例性的,如图5所示,图5示出了本申请实施例提供的一种服务器的实体结构示意图,该服务器可以包括:处理器(processor)51、通信接口(Communications Interface)52、存储器(memory)53和总线54,其中,处理器51、通信接口52、存储器53通过总线54完成相互间的通信。通信接口52可以用于服务器与客户端之间的信息传输。处理器51可以调用存储器53中的逻辑指令,使得所述日志上传装置执行图1-图2的方法流程。
此外,上述的存储器53中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。通过以上的实施方式的描述,本领域的技术人员可以了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟以及光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备 等)执行各个实施例或者实施例的一些部分所述的方法。
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。
以上实施例仅用以说明本申请的技术方案,而非限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换。
工业实用性
本申请实施例提供了一种日志上传方法及装置,在本申请实施例中,当程序出现异常终止时,通过在程序中绑定的全局捕获异常类,自动获取程序出现的异常日志信息,然后将获取的异常日志信息进存储,最后将异常日志信息自动上传至服务器,从而实现了自动上传异常日志信息至服务器。

Claims (15)

  1. 一种日志上传方法,应用于终端,包括:
    当程序出现异常终止时,获取程序的异常日志信息;
    对所述异常日志信息进行存储;以及,
    将所述异常日志信息上传至服务器。
  2. 根据权利要求1所述的方法,其中,所述对所述异常日志信息进行存储包括:
    获取所述程序出现异常终止时,对应的时间点;
    根据所述时间点命名所述日志信息;以及,
    将以所述时间点命名的异常日志信息进行存储。
  3. 根据权利要求2所述的方法,,在所述将所述异常日志信息上传至服务器之前,所述方法还包括:
    输出是否将以所述时间点命名的异常日志信息上传至服务器的提示信息;以及,
    所述将所述异常日志信息上传至服务器包括:
    当接收到所述提示信息的确认指令,则将以所述时间点命名的异常日志信息上传至服务器。
  4. 根据权利要求3所述的方法,在所述将以所述时间点命名的异常日志信息上传至服务器之后,所述方法还包括:
    判断是否已成功将以所述时间点命名的异常日志信息上传至所述服务器。
  5. 根据权利要求4所述的方法,在所述判断是否已成功将以所述时间点命名的异常日志信息上传至所述服务器之后,所述方法还包括:
    当已成功将以所述时间点命名的异常日志信息上传至所述服务器,则将本地以所述时间点命名的异常日志信息删除。
  6. 根据权利要求1所述的方法,其中,所述获取程序的异常日志信息包括:
    通过在所述程序中绑定的预置功能函数,获取程序的异常日志信息。
  7. 一种日志上传装置,其中,包括:
    获取单元,设置为当程序出现异常终止时,获取程序的异常日志信息;
    存储单元,设置为对所述异常日志信息进行存储;以及,
    上传单元,设置为将所述异常日志信息上传至服务器。
  8. 根据权利要求7所述的装置,其中,所述存储单元包括:
    获取模块,设置为获取所述程序出现异常终止时,对应的时间点;
    命名模块,设置为根据所述时间点命名所述日志信息;以及,
    存储模块,设置为将以所述时间点命名的异常日志信息进行存储。
  9. 根据权了要求8所述的装置,所述装置还包括:输出单元;
    所述输出单元,设置为输出是否将以所述时间点命名的异常日志信息上传至服务器的提示信息;以及,
    所述上传单元,设置为当接收到所述提示信息的确认指令,则将以所述时间点命名的异常日志信息上传至服务器。
  10. 根据权利要求9所述的装置,所述装置还包括:
    判断单元,设置为判断是否已成功将以所述时间点命名的异常日志信息上传至所述服务器。
  11. 根据权利要求10所述的装置,所述装置还包括:
    删除单元,设置为当已成功将以所述时间点命名的异常日志信息上传至所述服务器,则将本地以所述时间点命名的异常日志信息删除。
  12. 根据权利要求1所述的装置,其中,
    所述获取单元,设置为通过在所述程序中绑定的预置功能函数,获取程序的异常日志信息。
  13. 一种电子设备,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
    当程序出现异常终止时,获取程序的异常日志信息;
    对所述异常日志信息进行存储;以及,
    将所述异常日志信息上传至服务器。
  14. 一种非暂态计算机可读存储介质,其中,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1-6任一项的日志上传方法。
  15. 一种计算机程序产品,其中,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-6任一项的日志上传方 法。
PCT/CN2016/097222 2015-12-10 2016-08-29 日志上传方法及装置 WO2017096968A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510918169.XA CN105871587A (zh) 2015-12-10 2015-12-10 日志上传方法及装置
CN201510918169.X 2015-12-10

Publications (1)

Publication Number Publication Date
WO2017096968A1 true WO2017096968A1 (zh) 2017-06-15

Family

ID=56624145

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/097222 WO2017096968A1 (zh) 2015-12-10 2016-08-29 日志上传方法及装置

Country Status (2)

Country Link
CN (1) CN105871587A (zh)
WO (1) WO2017096968A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213842A (zh) * 2018-04-23 2019-01-15 中国移动通信集团有限公司 一种智能客服实现方法、装置及存储介质
CN109614042A (zh) * 2018-11-30 2019-04-12 维沃移动通信有限公司 一种存储日志信息的方法及终端设备
CN110333964A (zh) * 2019-07-01 2019-10-15 Oppo广东移动通信有限公司 异常日志处理方法及装置、电子设备、存储介质
CN112073231A (zh) * 2020-08-31 2020-12-11 深圳市国电科技通信有限公司 局域网联动防护方法、装置、计算机设备及存储介质
CN112214463A (zh) * 2019-07-12 2021-01-12 中科云谷科技有限公司 Gps终端的监测方法、装置、系统及存储介质
CN112764963A (zh) * 2021-01-29 2021-05-07 恒鸿达科技有限公司 一种异常日志信息自动收集的方法、装置、设备和介质
CN113448762A (zh) * 2021-06-29 2021-09-28 东莞市小精灵教育软件有限公司 一种死机处理方法、系统、智能设备及存储介质
CN114844771A (zh) * 2022-05-05 2022-08-02 亚信科技(中国)有限公司 微服务系统的监测方法、装置、存储介质、程序产品

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105871587A (zh) * 2015-12-10 2016-08-17 乐视致新电子科技(天津)有限公司 日志上传方法及装置
CN106549807A (zh) * 2016-10-28 2017-03-29 武汉斗鱼网络科技有限公司 一种日志的分类上报方法及系统
CN108170584A (zh) * 2017-12-26 2018-06-15 广东欧珀移动通信有限公司 日志处理方法、装置、存储介质及终端设备
CN110825601A (zh) * 2019-10-29 2020-02-21 厦门亿联网络技术股份有限公司 一种嵌入式设备异常场景下的现场保存方法及装置
CN111274059B (zh) * 2020-01-21 2023-10-10 浙江大华技术股份有限公司 一种从设备的软件异常处理方法及装置
CN113479215A (zh) * 2021-07-15 2021-10-08 北京百度网讯科技有限公司 自动驾驶异常数据的传输方法、装置、设备和介质
CN115454954B (zh) * 2022-08-31 2023-07-25 上海移柯通信技术股份有限公司 数据处理方法、系统、装置及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389916A (zh) * 2012-05-11 2013-11-13 宇龙计算机通信科技(深圳)有限公司 应用程序异常的处理方法及移动终端
CN104216811A (zh) * 2013-05-30 2014-12-17 腾讯科技(深圳)有限公司 应用程序的日志收集方法和系统
CN104375928A (zh) * 2013-08-12 2015-02-25 鸿富锦精密工业(深圳)有限公司 异常日志管理方法及系统
CN105025318A (zh) * 2015-06-30 2015-11-04 北京奇艺世纪科技有限公司 一种应用程序的异常日志信息的反馈方法及装置
CN105871587A (zh) * 2015-12-10 2016-08-17 乐视致新电子科技(天津)有限公司 日志上传方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009151685A (ja) * 2007-12-21 2009-07-09 Fujitsu Ltd ディスクアレイ装置管理システム、ディスクアレイ装置、ディスクアレイ装置の制御方法および管理サーバ

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389916A (zh) * 2012-05-11 2013-11-13 宇龙计算机通信科技(深圳)有限公司 应用程序异常的处理方法及移动终端
CN104216811A (zh) * 2013-05-30 2014-12-17 腾讯科技(深圳)有限公司 应用程序的日志收集方法和系统
CN104375928A (zh) * 2013-08-12 2015-02-25 鸿富锦精密工业(深圳)有限公司 异常日志管理方法及系统
CN105025318A (zh) * 2015-06-30 2015-11-04 北京奇艺世纪科技有限公司 一种应用程序的异常日志信息的反馈方法及装置
CN105871587A (zh) * 2015-12-10 2016-08-17 乐视致新电子科技(天津)有限公司 日志上传方法及装置

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213842A (zh) * 2018-04-23 2019-01-15 中国移动通信集团有限公司 一种智能客服实现方法、装置及存储介质
CN109614042A (zh) * 2018-11-30 2019-04-12 维沃移动通信有限公司 一种存储日志信息的方法及终端设备
CN110333964A (zh) * 2019-07-01 2019-10-15 Oppo广东移动通信有限公司 异常日志处理方法及装置、电子设备、存储介质
CN110333964B (zh) * 2019-07-01 2023-06-02 Oppo广东移动通信有限公司 异常日志处理方法及装置、电子设备、存储介质
CN112214463A (zh) * 2019-07-12 2021-01-12 中科云谷科技有限公司 Gps终端的监测方法、装置、系统及存储介质
CN112073231A (zh) * 2020-08-31 2020-12-11 深圳市国电科技通信有限公司 局域网联动防护方法、装置、计算机设备及存储介质
CN112073231B (zh) * 2020-08-31 2023-08-18 深圳市国电科技通信有限公司 局域网联动防护方法、装置、计算机设备及存储介质
CN112764963A (zh) * 2021-01-29 2021-05-07 恒鸿达科技有限公司 一种异常日志信息自动收集的方法、装置、设备和介质
CN113448762A (zh) * 2021-06-29 2021-09-28 东莞市小精灵教育软件有限公司 一种死机处理方法、系统、智能设备及存储介质
CN114844771A (zh) * 2022-05-05 2022-08-02 亚信科技(中国)有限公司 微服务系统的监测方法、装置、存储介质、程序产品
CN114844771B (zh) * 2022-05-05 2024-03-08 亚信科技(中国)有限公司 微服务系统的监测方法、装置、存储介质、程序产品

Also Published As

Publication number Publication date
CN105871587A (zh) 2016-08-17

Similar Documents

Publication Publication Date Title
WO2017096968A1 (zh) 日志上传方法及装置
US11526342B2 (en) Cancel and rollback update stack requests
CN109040252B (zh) 文件传输方法、系统、计算机设备和存储介质
US9606703B2 (en) Techniques for detecting inactive browser windows
US9225617B2 (en) Techniques for detecting new browser windows
CN110262807B (zh) 集群创建进度日志采集系统、方法和装置
CN110716895A (zh) 目标数据归档方法、装置、计算机设备及介质
CN110659151B (zh) 数据校验方法及装置,存储介质
US10467424B2 (en) File system content based security
CN111400777B (zh) 一种网络存储系统、用户认证方法、装置及设备
CN110019873B (zh) 人脸数据处理方法、装置及设备
US9588945B2 (en) Comparing webpage elements having asynchronous functionality
US9002798B1 (en) Systems and methods for remedying corrupt backup images of host devices
EP3163447A1 (en) Data replication method, device and system
CN110650164B (zh) 文件的上传方法、装置、终端以及计算机存储介质
CN114185484A (zh) 一种文档存储集群化的方法、装置、设备和介质
US10318385B2 (en) Service recovery using snapshots and interservice messages
CN110881224B (zh) 一种网络长连接方法、装置、设备及存储介质
EP3349416A1 (en) Relationship chain processing method and system, and storage medium
CN109298928B (zh) 业务的处理方法及装置
CN111045787B (zh) 一种快速继续实验方法及系统
CN113434384A (zh) 一种压力测试方法和装置
CN110874238A (zh) 一种线上业务更新方法及其装置
US11252244B1 (en) System and method for web-session recording
US9961027B2 (en) Email webclient automatic failover

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: 16872164

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: 16872164

Country of ref document: EP

Kind code of ref document: A1