CN111338835A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN111338835A
CN111338835A CN202010113348.7A CN202010113348A CN111338835A CN 111338835 A CN111338835 A CN 111338835A CN 202010113348 A CN202010113348 A CN 202010113348A CN 111338835 A CN111338835 A CN 111338835A
Authority
CN
China
Prior art keywords
log data
application program
thread
information
server side
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010113348.7A
Other languages
Chinese (zh)
Inventor
梁汉光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010113348.7A priority Critical patent/CN111338835A/en
Publication of CN111338835A publication Critical patent/CN111338835A/en
Pending legal-status Critical Current

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
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0775Content or structure details of the error report, e.g. specific table structure, specific error fields
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a data processing method and a data processing device, wherein the method comprises the following steps: when the application program does not respond, acquiring the designated thread information of the application program, and generating log data by adopting the designated thread information; the specified thread information carries version information; uploading the log data to a server side; the server side is used for extracting the version information in the log data. Therefore, the server side can determine the version corresponding to the log data based on the version information in the log data, so that subsequent developers can restore the obfuscated codes conveniently, and the difficulty of the developers in positioning is reduced.

Description

Data processing method and device
Technical Field
The present invention relates to the field of software application technologies, and in particular, to a data processing method and a data processing apparatus.
Background
In the Android system, when an Application (Application) generates ANR (Application notification responding no Application), the system records a log, and when the Application is started again, the log can be read and uploaded to a server to check problems.
However, since the specific version number of App when ANR occurs cannot be determined through the log, false alarm may result. For example, a log of ANR occurring in version 2.5.8 would be considered ANR occurring in version 2.6.0 if it was reported up when the user installed version 2.6.0. Furthermore, since the codes of the application programs are all obfuscated, when restoring the codes, an obfuscated file with a specific version number is needed for code restoration, and if a developer uses the obfuscated code mapping table with the version 2.6.0 to restore the stack, there may be no way to restore the codes.
Therefore, in the prior art, the ANR is marked on the reported App version, but the ANR does not necessarily occur on the reported App version, and may be a very long-term version, and an incorrect version number increases the difficulty of positioning problems of developers. Moreover, since the log in which the ANR occurs is generated systematically and cannot interfere with the generation of this log within the App, it is not possible to mark to which version of this App this log belongs.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a data processing method and a corresponding data processing apparatus that overcome or at least partially solve the above problems.
The embodiment of the invention discloses a data processing method, which comprises the following steps:
when the application program does not respond, acquiring the designated thread information of the application program, and generating log data by adopting the designated thread information; the specified thread information carries version information;
uploading the log data to a server side; the server side is used for extracting the version information in the log data.
Optionally, the thread name of the specified thread information carries version information of the application program.
Optionally, before the step of obtaining the specified thread information of the application program, the method further includes:
when an application program is started, acquiring version information of the application program;
and setting the name of the designated thread according to the version information, and creating the designated thread.
Optionally, the method further comprises:
and starting the designated thread and keeping the designated thread in a running state.
Optionally, the uploading the log data to a server side includes:
and uploading the log data to a server side when the application program is started next time.
Optionally, the log data is ANR data.
Optionally, the server side is further configured to generate a version label according to the version information and the log data.
The embodiment of the invention also discloses a data processing device, which comprises:
the data generation module is used for acquiring the designated thread information of the application program when the application program does not respond, and generating log data by adopting the designated thread information; the specified thread information carries version information;
the data uploading module is used for uploading the log data to a server side; the server side is used for extracting the version information in the log data.
Optionally, the thread name of the specified thread information carries version information of the application program.
Optionally, the apparatus further comprises:
the version acquisition module is used for acquiring the version information of the application program when the application program is started;
and the thread creating module is used for setting the name of the specified thread according to the version information and creating the specified thread.
Optionally, the apparatus further comprises:
and the thread starting module is used for starting the specified thread and keeping the specified thread in a running state.
Optionally, the data uploading module includes:
and the data uploading sub-module is used for uploading the log data to the server side when the application program is started next time.
Optionally, the log data is ANR data.
Optionally, the server side is further configured to generate a version label according to the version information and the log data.
The embodiment of the invention also discloses an electronic device, which comprises:
one or more processors; and
one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the electronic device to perform one or more of the method steps as described in embodiments of the invention.
Embodiments of the invention also disclose a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform one or more of the method steps as described in embodiments of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, when the application program has no response, the appointed thread information of the application program is obtained, and the appointed thread information is adopted to generate the log data; the appointed thread information carries version information; and uploading the log data to the server side. Therefore, the server side can determine the version corresponding to the log data based on the version information in the log data, so that subsequent developers can restore the obfuscated codes conveniently, and the difficulty of the developers in positioning is reduced.
Drawings
FIG. 1 is a flow chart of the steps of one data processing method embodiment of the present invention;
FIG. 2 is a flow chart diagram of a data processing method of the present invention;
fig. 3 is a block diagram of a data processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a data processing method according to the present invention is shown, which may specifically include the following steps:
step 101, when an application program has no response, acquiring appointed thread information of the application program, and generating log data by adopting the appointed thread information; the specified thread information carries version information;
the embodiment of the invention can be applied to a mobile terminal, such as a mobile phone, a tablet computer, a PDA, and the like, and an operating system of the mobile terminal can be an Android system and can generally support the running of various APPs (applications).
On Android, if the Application is Not responsive enough for a while, the system displays a dialog box called ANR (Application Not Responding) dialog box to the user. The user may choose to "wait" for the program to continue running, or may choose to "force shut down". ANR cannot occur in a smooth and reasonable application, leaving the user to handle this dialog each time. Therefore, it is important to design responsiveness in the application so that the system does not display ANR to the user. By default, the maximum execution time of an Activity component in Android is 5 seconds, and the maximum execution time of a broadcastireiver broadcast receiver is 10 seconds.
In order to analyze the reason why the application generates the ANR, so that a developer can improve the application, when the application does not respond (that is, ANR occurs), the specified thread information of the application may be acquired, and the log data may be generated by using the specified thread information.
The designated thread information may be basic information of the designated thread created when the application is started. For example, the specified thread information may include a name of the specified thread, a state of the specified thread, a running duration of the specified thread, priority information of the specified thread, and the like.
The specified thread information may carry version information, which may be information for identifying the version of the application program, for example, the version information is a version number.
In the embodiment of the invention, the log data is generated by adopting the specified thread information carrying the version information, so that the generated log data also carries the version information.
102, uploading the log data to a server side; the server side is used for extracting the version information in the log data.
In the embodiment of the invention, the Android system can upload the log data to the server side of the application program corresponding to the log data, so that the server side can extract the version information in the log data to determine the version corresponding to the log data.
Specifically, the log data may carry an identification code of the application program, the identification code is used for uniquely identifying the application program, and the Android system may determine the application program corresponding to the log data by extracting the identification code of the application program in the log data, and then upload the log data to the application program corresponding to the log data. After receiving the log data, the server side may extract version information in the log data, and determine a version corresponding to the log data according to the version information.
In a preferred embodiment of the present invention, the thread name of the specified thread information carries version information of the application program. The designated thread may be a preset thread, and the designated thread may have a name attribute.
In embodiments of the present invention, version information may be encapsulated in the name of a given thread. As an example, the name of a given thread may be expressed as: anrversionv2.9.0_88888, wherein v2.9.0_88888 is version information. It should be noted that, in the implementation, the name of the designated thread may be set in a required form, and the implementation of the present invention is not limited thereto.
In a preferred embodiment of the present invention, before the step 101, the method further includes:
when an application program is started, acquiring version information of the application program; and setting the name of the designated thread according to the version information, and creating the designated thread.
In the embodiment of the present invention, the name of the designated thread may include a prefix portion and a suffix portion, wherein the prefix portion may be a preset string combination, such as an inversion, and the suffix portion may be version information. After obtaining version information for the application, the name of the specified thread may be further determined.
Specifically, the version information of the application program may be obtained when the application program is started, for example, the version information may be a version number v2.9.0_ 88888. Further, the name of the specified thread may be set according to the version information, for example, the name of the specified thread is set as: anrversionv2.9.0_ 88888. Further, a creation name is: designated thread of anrversionv2.9.0_ 88888.
In a preferred embodiment of the present invention, the method may further comprise the steps of:
and starting the designated thread and keeping the designated thread in a running state.
After the designated thread is created, the designated thread can be started and kept in a running state, so that when the ANR occurs in an application program and a system acquires thread information of the application program to generate log data, the designated thread information can be acquired at the same time, the designated thread information includes a name of the designated thread, and the name of the designated thread is encapsulated in the log data. In addition, the designated thread is not used for processing other tasks, and the occupied resource memory is small, so that the operation of the application program can be prevented from being influenced.
In a preferred embodiment of the present invention, the step 102 may include the following sub-steps:
and uploading the log data to a server side when the application program is started next time.
After the application program generates the ANR, the system can automatically record the thread information of the application program and generate log data. When the application program is started next time, the log data are uploaded to the server side of the application program, so that the server side of the application program can analyze the log data to determine the reason for the ANR, and the application program is improved.
In a preferred embodiment of the present invention, the log data may be ANR data, and the ANR data may be data that is automatically recorded by the system when the application program performs ANR.
In a preferred embodiment of the present invention, the server side is further configured to generate a version label according to the version information and the log data.
Specifically, the server side may search for a thread named with a prefix portion of a specified thread in log data, and determine version information from the searched data. For example, the prefix part of the designated thread is anrversion, and one piece of data is found in the log data: and the version information can be determined to be v2.9.0_88888 according to the anrversionv2.9.0_88888, and the application version can be determined to be v2.9.0_88888 according to the version information. Furthermore, the version tag can be generated according to the version information and the log data, so that when a developer needs to analyze the log data of which the ANR is generated, the developer can directly determine the version corresponding to the log data according to the version tag, and the difficulty of the developer in positioning is reduced.
Fig. 2 shows a flow chart of a data processing method according to the present invention, and in fig. 2, the data processing procedure is as follows:
s1, starting an application program;
s2, generating a thread named by a version number; the version number can be a version number corresponding to the application program;
s3, recording ANR data of the application program when the ANR occurs by the system;
s4, restarting the application program;
s5, uploading ANR data of a corresponding version number;
and S6, reading the thread name in the ANR data, and marking the version number when the ANR occurs.
In the embodiment of the invention, when the application program has no response, the appointed thread information of the application program is obtained, and the appointed thread information is adopted to generate the log data; the appointed thread information carries version information; and uploading the log data to the server side. Therefore, the server side can determine the version corresponding to the log data based on the version information in the log data, so that subsequent developers can restore the obfuscated codes conveniently, and the difficulty of the developers in positioning is reduced.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a block diagram of a data processing apparatus according to an embodiment of the present invention is shown, which may specifically include the following modules:
the data generating module 301 is configured to, when an application does not respond, obtain specified thread information of the application, and generate log data by using the specified thread information; the specified thread information carries version information;
a data uploading module 302, configured to upload the log data to a server side; the server side is used for extracting the version information in the log data.
In a preferred embodiment of the present invention, the thread name of the specified thread information carries version information of the application program.
In a preferred embodiment of the present invention, the apparatus further comprises:
the version acquisition module is used for acquiring the version information of the application program when the application program is started;
and the thread creating module is used for setting the name of the specified thread according to the version information and creating the specified thread.
In a preferred embodiment of the present invention, the apparatus further comprises:
and the thread starting module is used for starting the specified thread and keeping the specified thread in a running state.
In a preferred embodiment of the present invention, the data uploading module 302 may include the following sub-modules:
and the data uploading sub-module is used for uploading the log data to the server side when the application program is started next time.
In a preferred embodiment of the present invention, the log data is ANR data.
In a preferred embodiment of the present invention, the server side is further configured to generate a version label according to the version information and the log data.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, including:
one or more processors; and
one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the electronic device to perform steps of a method as described by embodiments of the invention.
Embodiments of the present invention also provide a computer-readable storage medium having stored thereon instructions, which, when executed by one or more processors, cause the processors to perform the steps of the method according to embodiments of the present invention.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The data processing method and the data processing apparatus provided by the present invention are described in detail above, and the principle and the implementation of the present invention are explained in the present document by applying specific examples, and the description of the above examples is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A data processing method, comprising:
when the application program does not respond, acquiring the designated thread information of the application program, and generating log data by adopting the designated thread information; the specified thread information carries version information;
uploading the log data to a server side; the server side is used for extracting the version information in the log data.
2. The method of claim 1, wherein the thread name of the specified thread information carries version information of the application program.
3. The method according to claim 2, further comprising, before the step of obtaining the specified thread information of the application program:
when an application program is started, acquiring version information of the application program;
and setting the name of the designated thread according to the version information, and creating the designated thread.
4. The method of claim 3, further comprising:
and starting the designated thread and keeping the designated thread in a running state.
5. The method of claim 1, wherein uploading the log data to a server side comprises:
and uploading the log data to a server side when the application program is started next time.
6. The method of claim 1, wherein the log data is ANR data.
7. The method of claim 1, wherein the server side is further configured to generate a version tag according to the version information and log data.
8. A data processing apparatus, comprising:
the data generation module is used for acquiring the designated thread information of the application program when the application program does not respond, and generating log data by adopting the designated thread information; the specified thread information carries version information;
the data uploading module is used for uploading the log data to a server side; the server side is used for extracting the version information in the log data.
9. An electronic device, comprising:
one or more processors; and
one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the electronic device to perform the steps of the method of one or more of claims 1-7.
10. A computer-readable storage medium having stored thereon instructions, which, when executed by one or more processors, cause the processors to perform the steps of the method of one or more of claims 1-7.
CN202010113348.7A 2020-02-24 2020-02-24 Data processing method and device Pending CN111338835A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010113348.7A CN111338835A (en) 2020-02-24 2020-02-24 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010113348.7A CN111338835A (en) 2020-02-24 2020-02-24 Data processing method and device

Publications (1)

Publication Number Publication Date
CN111338835A true CN111338835A (en) 2020-06-26

Family

ID=71185580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010113348.7A Pending CN111338835A (en) 2020-02-24 2020-02-24 Data processing method and device

Country Status (1)

Country Link
CN (1) CN111338835A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107622000A (en) * 2017-09-19 2018-01-23 北京京东尚科信息技术有限公司 A kind of collection of application crash information and report method, device
CN109582536A (en) * 2018-11-05 2019-04-05 广州华多网络科技有限公司 Report method, device and computer equipment of the application program without response
CN109840189A (en) * 2018-12-15 2019-06-04 中国平安人寿保险股份有限公司 Caton formation gathering method, device, computer installation and readable storage medium storing program for executing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107622000A (en) * 2017-09-19 2018-01-23 北京京东尚科信息技术有限公司 A kind of collection of application crash information and report method, device
CN109582536A (en) * 2018-11-05 2019-04-05 广州华多网络科技有限公司 Report method, device and computer equipment of the application program without response
CN109840189A (en) * 2018-12-15 2019-06-04 中国平安人寿保险股份有限公司 Caton formation gathering method, device, computer installation and readable storage medium storing program for executing

Similar Documents

Publication Publication Date Title
CN107066519B (en) Task detection method and device
CN106933887B (en) Data visualization method and device
CN107783766B (en) Method and device for cleaning files of application program
CN110020339B (en) Webpage data acquisition method and device based on non-buried point
CN112016283A (en) Form generation method and device
CN110968822A (en) Page detection method and device, electronic equipment and storage medium
CN109992501B (en) Availability check of small program, available small program list generating method and device
CN111459465A (en) Method and device for generating Flutter engineering file
CN108874379B (en) Page processing method and device
CN113238795A (en) Component distribution method, device, electronic equipment, storage medium and program product
CN113656107A (en) Mobile application loading method and device and electronic equipment
CN110825600B (en) Page information processing method, server and page display device
CN110245074B (en) Log record generation method and device, storage medium and server
CN106484779B (en) File operation method and device
CN109558548B (en) Method for eliminating CSS style redundancy and related product
CN111124525A (en) Website function implementation method and device
CN111338835A (en) Data processing method and device
CN110737588A (en) automatic point burying method, device, medium and electronic equipment
CN112181798B (en) Data recording method and device
CN110968810A (en) Webpage data processing method and device
CN110020073B (en) Live broadcast webpage crawling method and device
CN111400245B (en) Art resource migration method and device
CN110971578B (en) User identity confirmation method and device
CN109561121B (en) Method and device for monitoring deployment
CN109948075B (en) Webpage data marking method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination