CN107133150B - Method and device for preventing Android from retransmitting - Google Patents

Method and device for preventing Android from retransmitting Download PDF

Info

Publication number
CN107133150B
CN107133150B CN201710339161.7A CN201710339161A CN107133150B CN 107133150 B CN107133150 B CN 107133150B CN 201710339161 A CN201710339161 A CN 201710339161A CN 107133150 B CN107133150 B CN 107133150B
Authority
CN
China
Prior art keywords
code
preset
main thread
abnormal
abnormal information
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.)
Active
Application number
CN201710339161.7A
Other languages
Chinese (zh)
Other versions
CN107133150A (en
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.)
Hangzhou Shiqu Information Technology Co ltd
Original Assignee
Hangzhou Shiqu Information Technology 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 Hangzhou Shiqu Information Technology Co ltd filed Critical Hangzhou Shiqu Information Technology Co ltd
Priority to CN201710339161.7A priority Critical patent/CN107133150B/en
Publication of CN107133150A publication Critical patent/CN107133150A/en
Application granted granted Critical
Publication of CN107133150B publication Critical patent/CN107133150B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Abstract

The invention discloses an Android retransmission prevention method, which comprises the steps of capturing abnormal information when a service boardcast is called; judging whether the preset bottom pocket condition is met or not according to the abnormal information; and if so, carrying out bottom wrapping on the preset code, wherein the preset code is any one or any combination of a first main thread code, a second main thread code and a non-main thread code created by the first main thread code and the second main thread code. The method judges whether the condition for preventing retransmission is met or not according to the captured abnormal information, and carries out bottom-wrapping on the corresponding code when the condition for preventing retransmission is met, thereby preventing the situation that the abnormal code is continuously executed for some reason from occurring, and further preventing the retransmission problem from continuously occurring. In addition, the invention also discloses an Android retransmission-preventing device, which has the advantage of one-to-one correspondence with the method.

Description

Method and device for preventing Android from retransmitting
Technical Field
The invention relates to the field of internet, in particular to an Android retransmission prevention method and device.
Background
In the operation process of the Android system, the retransmission problem frequently occurs. The retransmission problem may mean that some code in some applications that normally runs on most devices may be abnormal, and the system may continuously loop through the abnormal code for some unknown reasons. Namely some non-human clicks, the Service BoardStart is continuously called up, and abnormal codes are executed. Retransmission problems can eventually lead to application crashes.
The prior art can only capture the crash by using the crash capture mechanism of the Android system, but cannot prevent the crash from occurring. If the retransmission cannot be stopped in time, the power of the user equipment may be wasted, the user traffic is continuously consumed, and more seriously, the user cannot use the application. In summary, how to solve the problem that the Android retransmission continuously occurs is a problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
The invention aims to provide an Android retransmission-preventing method and device, and aims to solve the problem that the Android retransmission cannot be prevented from occurring continuously in the prior art.
In order to solve the technical problem, the invention provides an Android retransmission-prevention method, which comprises the following steps:
capturing abnormal information when the service boardcast is called;
judging whether preset bottom conditions are met or not according to the abnormal information;
if yes, performing bottom wrapping on a preset code, wherein the preset code is any one or any combination of a first main thread code, a second main thread code and a non-main thread code created by the first main thread code and the second main thread code.
Optionally, the determining whether a preset bottom pocket condition is met according to the abnormal information includes:
judging whether the abnormal times are greater than or equal to a preset threshold value or not according to the abnormal information;
and when the abnormal times are larger than or equal to the preset threshold value, judging that the preset code meets the preset bottom-holding condition.
Optionally, the first main thread code is an application main thread code, and the second main thread code is a main thread code in a service boardcast full life cycle.
Optionally, after the pre-set code is subjected to bottom-pocketing, the method further includes:
and recording the abnormal information.
In addition, the invention also provides an Android retransmission-preventing device, which comprises:
the capture module is used for capturing abnormal information when the service boardcast is called;
the judging module is used for judging whether the preset bottom pocket condition is met or not according to the abnormal information;
and the bottom-trapping module is used for trapping bottoms of preset codes if the preset codes are the first main thread codes, the second main thread codes and any one or any combination of non-main thread codes created by the first main thread codes and the second main thread codes.
Optionally, the determining module includes:
the first judging unit is used for judging whether the abnormal frequency is greater than or equal to a preset threshold value or not according to the abnormal information;
and the second judging unit is used for judging that the preset code meets the preset bottom-trapping condition when the abnormal times are greater than or equal to the preset threshold value.
Optionally, the method further comprises:
and the recording module is used for recording the abnormal information.
According to the Android retransmission-preventing method and device, when the service boardcast is called, abnormal information is captured; judging whether the preset bottom pocket condition is met or not according to the abnormal information; and if so, carrying out bottom wrapping on the preset code, wherein the preset code is any one or any combination of a first main thread code, a second main thread code and a non-main thread code created by the first main thread code and the second main thread code. According to the method and the device, whether the condition for preventing the retransmission is met or not is judged according to the captured abnormal information, when the condition for preventing the retransmission is met, the corresponding codes are subjected to bottom pocket processing, the situation that the abnormal codes are continuously executed due to a certain reason is prevented from occurring, and then the problem of the retransmission is prevented from continuously occurring.
Drawings
In order to more clearly illustrate the embodiments or technical solutions of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart illustrating a specific implementation of an Android retransmission-prevention method according to an embodiment of the present invention;
fig. 2 is a block diagram of an Android retransmission-prevention device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a specific implementation manner of an Android retransmission-prevention method provided in an embodiment of the present invention, where the method includes the following steps:
step 101: capturing abnormal information when the service boardcast is called;
it should be noted that the self-response exception mechanism of the Android system may be used to capture exception information.
The exception information may be embodied as exception code and related code information, that is, when the system runs, the exception code may be automatically captured, that is, the system may automatically throw the exception code, so as to obtain which codes in the system are abnormal.
Step 102: judging whether preset bottom conditions are met or not according to the abnormal information;
it can be understood that the preset bottom-entering condition may be embodied as how many times the same region is abnormal, that is, whether to perform bottom-entering on the corresponding code region is determined by determining the number of times the abnormal information occurs.
As a specific implementation manner, the above process of determining whether the preset pocket bottom condition is met according to the abnormal information may specifically be: judging whether the abnormal times are greater than or equal to a preset threshold value or not according to the abnormal information; and when the abnormal times are larger than or equal to the preset threshold value, judging that the preset code meets the preset bottom-holding condition.
It should be noted that the preset threshold may be set according to an actual requirement, and optionally, may be set to 3, that is, when the same abnormal information is continuously collected for 3 times or more than 3 times, it is determined that the corresponding code meets the bottom-finding condition, and the bottom-finding processing may be performed on the corresponding code.
In order to count the number of times of occurrence of an anomaly, the current version may be specifically used as a flag bit, and when an anomaly occurs, the flag bit is incremented by one, and the flag bits are sequentially accumulated. At this time, the number of times the same abnormality information occurs can be confirmed by the flag bit.
It can be seen that the occurrence of repeated retransmission can be effectively avoided by using the number of times of occurrence of the same abnormality as the condition of whether the base is present or not.
Step 103: if yes, performing bottom wrapping on a preset code, wherein the preset code is any one or any combination of a first main thread code, a second main thread code and a non-main thread code created by the first main thread code and the second main thread code.
It should be noted that the preset code may refer to a code causing a retransmission problem. Considering that when the system continuously wakes up the application-related service boardcast for unknown reasons, the main thread code of application, the main thread code of service boardcast-related life cycle and the non-main thread code created by the two main threads are executed. Therefore, when the codes in the three regions are abnormal, the system has a retransmission problem.
As a specific embodiment, the first main thread code may be an application main thread code, and the second main thread code may be a main thread code in a service boardcast full lifecycle. The non-main thread code may be the non-main thread code created by the application main thread code and the main thread code in the service boardcast full lifecycle.
And when the bottom-trapping conditions are met, performing bottom-trapping on the codes in the three areas. Obviously, the codes in the three regions may be simultaneously pocketed, or one of the regions may be singly pocketed, or of course, the codes in some regions may be pocketed.
It can be seen that, based on the occurrence principle of the retransmission problem, the code region causing the uninterrupted retransmission problem is determined, and then the corresponding code region is subjected to bottom-packing, so that the uninterrupted occurrence of the retransmission problem can be effectively prevented and protected.
To facilitate querying of relevant anomaly information, captured anomaly information may be recorded.
As a specific embodiment, after the bottom pocketing of the preset code, the method may further include: and recording the abnormal information.
Specifically, after the corresponding code region is bottomed, the exception information may be reported and recorded through a background.
Of course, the related abnormal information may be recorded before the bottom is pocketed, and is not limited herein.
According to the Android retransmission-preventing method provided by the embodiment of the invention, when the service boardcast is called, abnormal information is captured; judging whether the preset bottom pocket condition is met or not according to the abnormal information; and if so, carrying out bottom wrapping on the preset code, wherein the preset code is any one or any combination of a first main thread code, a second main thread code and a non-main thread code created by the first main thread code and the second main thread code. The method judges whether the condition for preventing retransmission is met or not according to the captured abnormal information, and carries out bottom-wrapping on the corresponding code when the condition for preventing retransmission is met, thereby preventing the situation that the abnormal code is continuously executed for some reason from occurring, and further preventing the retransmission problem from continuously occurring.
In the following, the Android retransmission-preventing device provided by the embodiment of the present invention is introduced, and the Android retransmission-preventing device described below and the Android retransmission-preventing method described above may be referred to correspondingly.
Fig. 2 is a block diagram of an Android retransmission-prevention device according to an embodiment of the present invention, and referring to fig. 2, the Android retransmission-prevention device may include:
a capturing module 201, configured to capture abnormal information when the service boardcast is invoked;
the judging module 202 is configured to judge whether a preset bottom pocket condition is met according to the abnormal information;
and the bottom-hooking module 203 is configured to, if yes, perform bottom hooking on a preset code, where the preset code is any one or any combination of a first main thread code, a second main thread code, and a non-main thread code created by the first main thread code and the second main thread code.
Optionally, the determining module includes:
the first judging unit is used for judging whether the abnormal frequency is greater than or equal to a preset threshold value or not according to the abnormal information;
and the second judging unit is used for judging that the preset code meets the preset bottom-trapping condition when the abnormal times are greater than or equal to the preset threshold value.
Optionally, the method further comprises:
and the recording module is used for recording the abnormal information.
According to the Android retransmission-preventing device provided by the embodiment of the invention, when the service boardcast is called, abnormal information is captured; judging whether the preset bottom pocket condition is met or not according to the abnormal information; and if so, carrying out bottom wrapping on the preset code, wherein the preset code is any one or any combination of a first main thread code, a second main thread code and a non-main thread code created by the first main thread code and the second main thread code. The device judges whether the condition for preventing retransmission is met or not according to the captured abnormal information, and when the condition for preventing retransmission is met, the device carries out bottom-packing on the corresponding codes to prevent the situation that the abnormal codes are continuously executed for some reason from occurring, so that the problem of retransmission is prevented from continuously occurring.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The Android retransmission-prevention method and device provided by the invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (7)

1. An Android retransmission-prevention method is characterized by comprising the following steps:
capturing abnormal information when the service boardcast is called, wherein the abnormal information is an abnormal code and related code information;
judging whether preset bottom conditions are met or not according to the abnormal information;
if yes, performing bottom wrapping on a preset code, wherein the preset code is any one or any combination of a first main thread code, a second main thread code and a non-main thread code created by the first main thread code and the second main thread code.
2. The method of claim 1, wherein the determining whether a predetermined pocket floor condition is met according to the abnormality information comprises:
judging whether the abnormal times are greater than or equal to a preset threshold value or not according to the abnormal information;
and when the abnormal times are larger than or equal to the preset threshold value, judging that the preset code meets the preset bottom-holding condition.
3. The method of claim 2, wherein the first main-thread code is application main-thread code and the second main-thread code is main-thread code in a service boardcast full lifecycle.
4. The method of claim 3, further comprising, after the pocketing preset code:
and recording the abnormal information.
5. An Android retransmission-prevention device, comprising:
the capture module is used for capturing abnormal information when the service boardcast is called;
the judging module is used for judging whether the preset bottom pocket condition is met or not according to the abnormal information;
and the bottom-trapping module is used for trapping bottoms of preset codes if the preset codes are the first main thread codes, the second main thread codes and any one or any combination of the first main thread codes and the second main thread codes.
6. The apparatus of claim 5, wherein the determining module comprises:
the first judging unit is used for judging whether the abnormal frequency is greater than or equal to a preset threshold value or not according to the abnormal information;
and the second judging unit is used for judging that the preset code meets the preset bottom-trapping condition when the abnormal times are greater than or equal to the preset threshold value.
7. The apparatus of claim 6, further comprising:
and the recording module is used for recording the abnormal information.
CN201710339161.7A 2017-05-15 2017-05-15 Method and device for preventing Android from retransmitting Active CN107133150B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710339161.7A CN107133150B (en) 2017-05-15 2017-05-15 Method and device for preventing Android from retransmitting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710339161.7A CN107133150B (en) 2017-05-15 2017-05-15 Method and device for preventing Android from retransmitting

Publications (2)

Publication Number Publication Date
CN107133150A CN107133150A (en) 2017-09-05
CN107133150B true CN107133150B (en) 2020-12-15

Family

ID=59733102

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710339161.7A Active CN107133150B (en) 2017-05-15 2017-05-15 Method and device for preventing Android from retransmitting

Country Status (1)

Country Link
CN (1) CN107133150B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104798355A (en) * 2012-09-18 2015-07-22 思杰系统有限公司 Mobile device management and security
CN104885092A (en) * 2012-11-13 2015-09-02 奥克兰服务有限公司 Security system and method for operating systems
CN106294167A (en) * 2016-08-16 2017-01-04 济南大学 The automatic traversal method of Android Application Program Interface and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140004819A (en) * 2012-06-20 2014-01-14 (주)쉬프트웍스 Method for detecting fake and falsification of application by using android obfuscation
CN103309668B (en) * 2013-06-17 2017-07-25 深圳Tcl新技术有限公司 Application program does not intercept and capture abnormal processing method and processing device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104798355A (en) * 2012-09-18 2015-07-22 思杰系统有限公司 Mobile device management and security
CN104885092A (en) * 2012-11-13 2015-09-02 奥克兰服务有限公司 Security system and method for operating systems
CN106294167A (en) * 2016-08-16 2017-01-04 济南大学 The automatic traversal method of Android Application Program Interface and system

Also Published As

Publication number Publication date
CN107133150A (en) 2017-09-05

Similar Documents

Publication Publication Date Title
CN106776099B (en) Service fusing isolation system and method
KR101853676B1 (en) Appratus and method for detecting vehicle intrusion
WO2017219855A1 (en) Root cause locating method and device
CN111078453B (en) Method, device, computer equipment and storage medium for automatically fusing and recovering micro-service
CN107204875B (en) Data reporting link monitoring method and device, electronic equipment and storage medium
CN107615250B (en) Application-oriented processing method and device and intelligent terminal
CN110837432A (en) Method and device for determining abnormal node in service cluster and monitoring server
CN108845912A (en) Service interface calls the alarm method of failure and calculates equipment
CN111865665B (en) Network equipment fault self-healing method and device
CN106201753B (en) Method and system for processing PCIE errors in linux
CN107133150B (en) Method and device for preventing Android from retransmitting
CN109117263A (en) A kind of method and device of user terminal memory release
CN108279993B (en) Method and device for realizing service degradation and electronic equipment
CN112100029B (en) Client state monitoring method and related components
CN107196815B (en) Method and equipment for determining difference of flow analysis capacity
JP5780553B2 (en) Fault monitoring apparatus and fault monitoring method
CN111062503B (en) Power grid monitoring alarm processing method, system, terminal and storage medium
CN109617905B (en) Multicast attack processing method, device and implementation device
JP2013214859A5 (en)
CN108964992B (en) Node fault detection method and device and computer readable storage medium
CN101610168A (en) The inhibition method and apparatus of alarm windstorm in the network management system
CN107025148B (en) Mass data processing method and device
CN108023741B (en) Monitoring resource use method and server
CN109240747A (en) A kind of information inspection method and its relevant apparatus of multistage server management system
CN111159139B (en) Data processing method and device, storage medium and monitoring equipment

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
GR01 Patent grant
GR01 Patent grant