CN109032811A - Data monitoring method and device and electronic equipment - Google Patents

Data monitoring method and device and electronic equipment Download PDF

Info

Publication number
CN109032811A
CN109032811A CN201810676044.4A CN201810676044A CN109032811A CN 109032811 A CN109032811 A CN 109032811A CN 201810676044 A CN201810676044 A CN 201810676044A CN 109032811 A CN109032811 A CN 109032811A
Authority
CN
China
Prior art keywords
broadcast
specified
call back
back function
radio receiver
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.)
Granted
Application number
CN201810676044.4A
Other languages
Chinese (zh)
Other versions
CN109032811B (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.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201810676044.4A priority Critical patent/CN109032811B/en
Publication of CN109032811A publication Critical patent/CN109032811A/en
Application granted granted Critical
Publication of CN109032811B publication Critical patent/CN109032811B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Circuits Of Receivers In General (AREA)

Abstract

The embodiment of the invention provides a data monitoring method, a data monitoring device and electronic equipment, wherein the method comprises the following steps: obtaining an execution duration when executing time-consuming operation for a specified broadcast based on a broadcast callback function hooked in advance, wherein the broadcast callback function is as follows: receiving a callback function corresponding to a broadcast receiver of a specified broadcast; judging whether the execution time exceeds a preset monitoring threshold value or not; and when the judgment result is yes, executing the preset broadcast execution time feedback operation. The method and the device can monitor the time-consuming operation process of the broadcast execution of the callback function corresponding to the broadcast receiver, and can determine whether the execution time length of the time-consuming operation is too long.

Description

A kind of data monitoring method, device and electronic equipment
Technical field
The present invention relates to technical field of data processing, more particularly to a kind of data monitoring method, device and electronic equipment.
Background technique
Application program is usually present the demand monitored the broadcast of operating system.It is general to monitor process are as follows: application When the associated radio receiver of program receives a broadcast, radio receiver can call the corresponding call back function needle of radio receiver Time-consuming operation is executed to the broadcast, after the completion of above-mentioned time-consuming operation executes, application program feeds back corresponding monitor to operating system Feedback information.Wherein, above-mentioned radio receiver is properly termed as BroadcastReceiver, and above-mentioned call back function is properly termed as OnReceive function.
Wherein, execution duration when the corresponding call back function of radio receiver is for broadcast execution time-consuming operation, one Determine the performance that radio receiver can be characterized in degree, the performance of the above-mentioned longer characterization radio receiver of execution duration is more inadequate It is good, and there is influence to the performance of associated application program to a certain extent in the performance of radio receiver.Due to above-mentioned Reason needs to guarantee the performance of radio receiver, then deposits at this time to a certain extent in order to guarantee the performance of application program In the demand that the performance to radio receiver is detected, and when being detected to the performance of radio receiver, to broadcast reception The corresponding call back function of device for broadcast execute time-consuming operation monitoring, and determine execute time-consuming operation execution duration whether mistake Length is most important.
So, how to provide one kind to be monitored above-mentioned execution time-consuming operation process, and determine whether to execute time-consuming behaviour The whether too long strategy of the execution duration of work, becomes urgent problem to be solved.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of data monitoring method, device and electronic equipment, to realize to wide It broadcasts the corresponding call back function of receiver and executes the monitoring of time-consuming operation process for broadcast, and can determine to obtain and execute time-consuming behaviour Whether the execution duration of work is too long.Specific technical solution is as follows:
On the one hand, the embodiment of the invention provides a kind of data monitoring methods, which comprises
Based on the broadcast call back function linked up in advance, execution duration when executing time-consuming operation for specified broadcast is obtained, Wherein, the broadcast call back function are as follows: receive the corresponding call back function of radio receiver of the specified broadcast;
Judge whether the execution duration is more than default monitoring threshold value;
When the judgment result is yes, it executes preset broadcast and executes duration feedback operation.
It is optionally, described to execute the step of preset broadcast executes duration feedback operation, comprising:
When determining local environment for test environment, obtain the specified broadcast mark and the radio receiver Mark;
Output collapse prompt information, wherein the collapse prompt information includes: the mark of the specified broadcast and described The mark of radio receiver.
It is optionally, described to execute the step of preset broadcast executes duration feedback operation, comprising:
When determining local environment for publication environment, obtain the specified broadcast mark and the radio receiver Mark;
By the mark of the specified broadcast, the mark of the radio receiver and the execution duration, it is sent to backstage Server.
Optionally, it obtains based on the broadcast call back function linked up in advance described and executes time-consuming operation for specified broadcast When execution duration the step of before, the method also includes:
It is registered for specified broadcast, specified extensively for described based on the broadcast call back function linked up in advance Execution time-consuming operation is broadcast, and the process for executing time-consuming operation is monitored.
Optionally, it obtains based on the broadcast call back function linked up in advance described and executes time-consuming operation for specified broadcast When execution duration the step of before, the method also includes:
Based on Java reflection mechanism, the broadcast call back function is linked up with.
Optionally, specified broadcast when executing time-consuming operation is obtained based on the broadcast call back function linked up in advance described Before the step of executing duration, the method also includes:
When radio receiver receives specified broadcast, the broadcast call back function linked up in advance is triggered for described specified wide Broadcast execution time-consuming operation.
On the other hand, the embodiment of the invention provides a kind of data monitoring device, described device includes:
Module is obtained, for obtaining and executing time-consuming operation for specified broadcast based on the broadcast call back function linked up in advance When execution duration, wherein the broadcast call back function are as follows: receive the corresponding readjustment of radio receiver of the specified broadcast Function;
Judgment module, for judging whether the execution duration is more than default monitoring threshold value;
Feedback module executes duration feedback operation for when the judgment result is yes, executing preset broadcast.
Optionally, the feedback module, it is described specified wide specifically for obtaining when determining local environment to test environment The mark of the mark and the radio receiver broadcast;
Output collapse prompt information, wherein the collapse prompt information includes: the mark of the specified broadcast and described The mark of radio receiver.
Optionally, the feedback module, is specifically used for
When determining local environment for publication environment, obtain the specified broadcast mark and the radio receiver Mark;
By the mark of the specified broadcast, the mark of the radio receiver and the execution duration, it is sent to backstage Server.
Optionally, described device further include:
Registration module, for, based on the broadcast call back function linked up in advance, obtaining described and executing consumption for specified broadcast When execution duration when operating before, registered for specified broadcast, with based on the broadcast call back function linked up in advance, Time-consuming operation is executed for the specified broadcast, and the process for executing time-consuming operation is monitored.
Optionally, described device further include:
Hooking module, for, based on the broadcast call back function linked up in advance, obtaining described and executing consumption for specified broadcast When execution duration when operating before, be based on Java reflection mechanism, the broadcast call back function linked up with.
Optionally, described device further include:
Trigger module, for, based on the broadcast call back function linked up in advance, obtaining specified broadcast described and executing time-consuming behaviour Before execution duration when making, when radio receiver receives specified broadcast, the broadcast call back function needle linked up in advance is triggered Time-consuming operation is executed to the specified broadcast.
On the other hand, the embodiment of the invention provides a kind of electronic equipment, including processor, communication interface, memory and Communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the computer program stored on memory, is realized provided by the embodiment of the present invention Any data monitoring method step.
On the other hand, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storages Dielectric memory contains computer program, realizes when the computer program is executed by processor and appoints provided by the embodiment of the present invention Data monitoring method step described in one.
In the embodiment of the present invention, based on the broadcast call back function linked up in advance, obtains and execute time-consuming behaviour for specified broadcast Execution duration when making, wherein the broadcast call back function are as follows: receive the corresponding readjustment letter of radio receiver of specified broadcast Number;Judge to execute whether duration is more than default monitoring threshold value;When the judgment result is yes, it is anti-to execute preset broadcast execution duration Feedback operation.Using the embodiment of the present invention, can based on the broadcast call back function linked up in advance, to execute the process of time-consuming operation into Row monitors, and obtains the execution duration for executing time-consuming operation, and then based on default monitoring threshold value, judges whether execution duration is too long, When judging that executing duration is more than default monitoring threshold value, it is determined that execution duration is too long, continues to execute preset broadcast at this time Execute duration feedback operation, with prompt developer's corresponding radio receiver of broadcast call back function linked up in advance and/or There may be problems for the application program of association radio receiver.Certainly, it implements any of the products of the present invention or method must be not necessarily It needs to reach all the above advantage simultaneously.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of data monitoring method provided by the embodiment of the present invention;
Fig. 2 is a kind of process signal for executing preset broadcast provided by the embodiment of the present invention and executing duration feedback operation Figure;
Fig. 3 is to execute another process that preset broadcast executes duration feedback operation provided by the embodiment of the present invention to show It is intended to;
Fig. 4 is a kind of structural schematic diagram of data monitoring device provided by the embodiment of the present invention;
Fig. 5 is the structural schematic diagram of a kind of electronic equipment provided by the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention provides a kind of data monitoring method, device and electronic equipments, to realize to radio receiver Corresponding call back function executes the monitoring of time-consuming operation process for broadcast, and can determine to obtain the execution for executing time-consuming operation Whether duration is too long.
As shown in Figure 1, may include steps of the embodiment of the invention provides a kind of data monitoring method:
S101: based on the broadcast call back function linked up in advance, execution when executing time-consuming operation for specified broadcast is obtained Duration;
Wherein, call back function is broadcasted are as follows: receive the corresponding call back function of radio receiver of specified broadcast;
Data monitoring method provided by the embodiment of the present invention, can be applied in electronic equipment, which can be with For any type, this will not be repeated here.
The application program that electronic equipment can be installed to it sends broadcast, i.e. application program can monitor electronic equipment hair The broadcast sent.Wherein, it is provided with radio receiver in the electronic equipment, is installed on the application program of electronic equipment, can passed through Associated radio receiver monitors itself interested broadcast.Above-mentioned interested broadcast are as follows: application program passes through associated wide Broadcast the pre-registered broadcast to be monitored of receiver.Wherein, the application program of the above-mentioned radio receiver of above-mentioned association are as follows: realize The program of data monitoring process provided by the embodiment of the present invention.
In the embodiment of the present invention, above-mentioned application program can be supervised by the way that associated radio receiver is pre-registered The broadcast listened, the referred to as specified broadcast of the application program are referred to as the specified of the associated radio receiver of the application program Broadcast is referred to as the specified broadcast of the corresponding broadcast call back function linked up in advance of the associated radio receiver.I.e. Above-mentioned specified broadcast can be with are as follows: application program passes through the pre-registered broadcast to be monitored of associated radio receiver.
For the broadcast of electronic equipment, for an angle, the broadcast of electronic equipment may include: customized wide It broadcasts and system broadcasts etc., above-mentioned customized broadcast can be the broadcast that developer is independently arranged.Above system broadcast can be with Include: bright screen go out screen broadcast and charging pull out electricity broadcast etc., it is above-mentioned it is customized broadcast may include customized event broadcast etc..From For another angle, the broadcast of electronic equipment may include: static broadcast and dynamic broadcast.It is previously mentioned in the embodiment of the present invention It is specified to broadcast the broadcast that can be any of the above-described type.
In the embodiment of the present invention, when radio receiver receives the specified broadcast monitored, the broadcast can be triggered and connect The corresponding broadcast call back function linked up in advance of device is received, executes time-consuming operation for the specified broadcast, and simultaneously to above-mentioned execution The process of time-consuming operation is monitored, to obtain executing execution duration when time-consuming operation for specified broadcast, and then after execution Continuous data monitoring process.Wherein, different specified broadcast, there may be differences for performed time-consuming operation.
Wherein, a radio receiver can monitor one or more broadcast, and multiple radio receivers can be same When one broadcast is monitored, this can.
In oneainstance, radio receiver set in electronic equipment can connect for one or more, each broadcast Broadcast call back function can be corresponding with by receiving device.In the embodiment of the present invention, when the corresponding broadcast call back function of radio receiver is When the broadcast call back function linked up in advance, it is associated with the application program of the radio receiver, can be broadcast back to based on what is linked up in advance Letter of transfer number obtains execution duration when executing time-consuming operation for all registered broadcast.It is associated with the radio receiver Application program, can be based on the broadcast call back function linked up in advance, to the process for executing time-consuming operation for registered broadcast It is monitored, execution of the broadcast call back function linked up in advance for registered broadcast execution time-consuming operation when can be obtained Duration.
Wherein, when the operating system of above-mentioned electronic equipment is Android android system, above-mentioned radio receiver can be BroadcastReceiver, the above-mentioned broadcast call back function linked up in advance can be the onReceive function linked up in advance.
In the embodiment of the present invention, the corresponding broadcast call back function of above-mentioned radio receiver are as follows: the broadcast readjustment linked up in advance Function.Clear in order to be laid out, the subsequent process to broadcast call back function hook is introduced.
S102: judge to execute whether duration is more than default monitoring threshold value;
S103: it when the judgment result is yes, executes preset broadcast and executes duration feedback operation.
In this step, electronic equipment can based on the broadcast call back function linked up in advance, judge execute duration whether be more than Default monitoring threshold value.It is above-mentioned judge to execute duration whether be more than default monitoring threshold value process, be will execute duration with it is above-mentioned Default monitoring threshold value is compared, and determines the size for executing duration and above-mentioned default monitoring threshold value.When determining execution duration is not small In above-mentioned default monitoring threshold value, i.e., when judging result is more than default monitoring threshold value, preset broadcast can be continued to execute and executed Duration feedback operation.
Wherein, above-mentioned default monitoring threshold value can be the pre-set numerical value of developer.In a kind of situation, above-mentioned electronics The operating system of equipment is android system, which is generally less than the feedback threshold being arranged in android system Value.In a kind of situation, the feedback threshold being arranged in android system can be 10S (second).
It is understood that when above-mentioned execution duration is more than default monitoring threshold value, it is possible that above-mentioned execution duration The case where more than the feedback threshold being arranged in android system.At this point, android system will be considered that the above-mentioned broadcast reception of association The application program of device pops up corresponding ANR (Application Not Responding, i.e., application is without response) and mentions without response Show pop-up, the user of the prompting application program application program ANR situation occurs without response, i.e. application program.Above-mentioned application program ANR situation occur will affect user experience to a certain extent.
In one implementation, in order to improve the performance of application program and/or the associated broadcast player of application program, As shown in Fig. 2, the step of above-mentioned preset broadcast of execution executes duration feedback operation, may include:
S201: when determining local environment to test environment, the mark of specified broadcast and the mark of radio receiver are obtained Know;
S202: output collapse prompt information.
Wherein, collapse prompt information includes: the mark of specified broadcast and the mark of radio receiver.
When determine local environment for test environment when, can directly export collapse prompt information, with prompt developer or There may be exceptions for the application program of tester, radio receiver and/or association radio receiver.So that above-mentioned association broadcast The developer of the application program of receiver and/or or tester, can check above-mentioned collapse prompt information, and based on above-mentioned Collapse prompt information, analyze above-mentioned radio receiver and/or be associated with the application program of the radio receiver, in fact it could happen that it is different Often.In turn.Above-mentioned radio receiver and/or the application program for being associated with the radio receiver are improved, it is above-mentioned wide to improve It broadcasts receiver and/or is associated with the performance of the application program of the radio receiver.And then application program after issuing above-mentioned improvement Afterwards, the case where application program after the improvement can be with respect to the appearance ANR of reduction.And then user can be improved to a certain extent Experience.In oneainstance, above-mentioned collapse prompt information can also include executing duration, so that above-mentioned association radio receiver Application program developer and/or or tester, can preferably improve above-mentioned radio receiver and/or to be associated with this wide Broadcast the performance of the application program of receiver.
In another implementation, as shown in figure 3, the preset broadcast of above-mentioned execution executes the step of duration feedback operation Suddenly, may include:
S031: when determining local environment to issue environment, the mark of specified broadcast and the mark of radio receiver are obtained Know;
S302: by the mark of specified broadcast, the mark of radio receiver and duration is executed, is sent to background server.
When determining local environment as publication environment, that is, when being in the Release stage, i.e. the realization embodiment of the present invention is provided The product of data monitoring method can will be above-mentioned when being associated with the application program of above-mentioned radio receiver and being in issued state Mark, the mark of radio receiver and the execution duration of specified broadcast, packing is uploaded to background server, so that exploit person Member can check above- mentioned information, and be based on above- mentioned information, analyze above-mentioned radio receiver and/or be associated with answering for the radio receiver With program, in fact it could happen that exception, and then to above-mentioned radio receiver and/or be associated with the radio receiver application program carry out Improve, with improve above-mentioned radio receiver and/or be associated with the radio receiver application program performance.And then with the shape of upgrading Formula improves the application program and/or the associated above-mentioned radio receiver of application program for being in issued state.In turn, so that upgrading The case where application program afterwards can be with respect to the appearance ANR of reduction, can improve user experience to a certain extent.
In oneainstance, it can be identified by setting, still issue ring to distinguish above-mentioned local environment as test environment Border.At this point it is possible to be identified as determining local environment based on the above-mentioned setting of identification.
In the embodiment of the present invention, based on the broadcast call back function linked up in advance, obtains and execute time-consuming behaviour for specified broadcast Execution duration when making, wherein the broadcast call back function are as follows: receive the corresponding readjustment letter of radio receiver of specified broadcast Number;Judge to execute whether duration is more than default monitoring threshold value;When the judgment result is yes, it is anti-to execute preset broadcast execution duration Feedback operation.Using the embodiment of the present invention, can based on the broadcast call back function linked up in advance, to execute the process of time-consuming operation into Row monitors, and obtains the execution duration for executing time-consuming operation, and then based on default monitoring threshold value, judges whether execution duration is too long, When judging that executing duration is more than default monitoring threshold value, it is determined that execution duration is too long, continues to execute preset broadcast at this time Execute duration feedback operation, with prompt developer's corresponding radio receiver of broadcast call back function linked up in advance and/or There may be problems for the application program of association radio receiver.
Also, the embodiment of the present invention, to the process of above-mentioned execution time-consuming operation, can be monitored in the form of automatic, Cost of labor can be reduced to a certain extent.
Also, in the embodiment of the present invention, developer and/or tester can based on above-mentioned collapse prompt information or on The information for reaching background server, above-mentioned radio receiver associated to application program and/or application program improve, in turn It can make the application program after improving to a certain extent, reduction the case where ANR occurs, improves making for the user of application program With experience, the unloading rate of application program is reduced to a certain extent.
Wherein, the corresponding broadcast call back function linked up in advance of above-mentioned radio receiver executes time-consuming behaviour for specified broadcast The process of work is executed in the system framework layer of electronic equipment, and the embodiment of the present invention can be realized pair with interventional systems ccf layer The monitoring of the process of above-mentioned execution time-consuming operation, and realize to execute duration acquisition, and realize to execute duration whether be more than The judgement of default monitoring threshold value, and execute preset broadcast and execute duration feedback operation.
In one implementation, it obtains and is held for specified broadcast based on the broadcast call back function linked up in advance above-mentioned Before the step of execution duration when row time-consuming operation, the method can also include:
It is registered for specified broadcast, to execute consumption for specified broadcast based on the broadcast call back function linked up in advance When operate, and to execute time-consuming operation process be monitored.
It is registered for specified broadcast to the operating system of electronic equipment, so that application program can be by associated Radio receiver monitors the specified broadcast.When by associated radio receiver monitor (receptions) to this it is specified broadcast when, can be with It triggers the corresponding broadcast call back function linked up in advance of radio receiver and executes time-consuming operation for above-mentioned specified broadcast, pass through base The process of above-mentioned execution time-consuming operation is monitored in the above-mentioned broadcast call back function linked up in advance, to obtain for specified wide Execution duration when executing time-consuming operation is broadcast, and then judges whether above-mentioned execution duration is more than default monitoring threshold value, when judgement is tied When fruit is more than default monitoring threshold value, executes preset broadcast and execute duration feedback operation.
Specifically, obtaining specified broadcast when executing time-consuming operation based on the broadcast call back function linked up in advance above-mentioned Before the step of executing duration, the method can also include:
When radio receiver receives specified broadcast, triggers the broadcast call back function linked up in advance and held for specified broadcast Row time-consuming operation.
Wherein, the broadcast call back function that above-mentioned triggering is linked up in advance executes time-consuming operation for specified broadcast, it is possible to understand that Are as follows: the broadcast call back function that triggering is linked up in advance, so that the broadcast call back function linked up in advance executes consumption for specified broadcast When operate.
In one implementation, when the operating system of above-mentioned electronic equipment is android system.Described based on preparatory The broadcast call back function of hook, before obtaining the step of being directed to the specified execution duration broadcasted when executing time-consuming operation, the side Method can also include:
Based on Java reflection mechanism, broadcast call back function is linked up with.
It is understood that Java reflection mechanism is in electronic equipment is in operating status, it, can for any one class Enough know all properties and method of this class;For any one object, its any one method and category can be called Property;The function of the method for the information and dynamic call object of this dynamic acquisition is known as the reflection mechanism of Java language.
It is above-mentioned to be based on Java reflection mechanism in the embodiment of the present invention, to the process that broadcast call back function is linked up with, specifically It may is that based on Java reflection mechanism, the object of radio receiver obtained, to get the execution stream of the core of radio receiver Journey broadcasts call back function, that is, onRecevie function control, i.e. the execution entry address of the onRecevie function, wherein Above-mentioned execution entry address is execution entry address of the onRecevie function in the operating system of electronic equipment.It is being controlled On the basis of the onRecevie function of system, monitoring point and decision logic are set, execute time-consuming behaviour to obtain each specified broadcast The duration of work.Wherein, above-mentioned on the basis of the onRecevie function controlled, the mistake of monitoring point and decision logic is set Journey may is that at the starting position of the execution time-consuming operation of the onRecevie function, addition monitors starting point, and is executing At time-consuming operation end position, addition monitoring end point, and decision logic is added at the position after addition monitors end point. Wherein, above by added monitoring starting point and monitoring end point, it can count to obtain the onRecevie function for finger Fixed broadcast executes execution duration when time-consuming operation, and above-mentioned decision logic can obtain the execution duration that above-mentioned statistics obtains, and Judge whether the execution duration is more than default monitoring threshold value, and then corresponding operating is executed based on judging result.Wherein, when judgement is tied Fruit is to execute preset broadcast when being and execute duration feedback operation;When the judgment result is no, operation can not be executed.
It is subsequent, it is anti-based on Java by the object of the radio receiver of the logic comprising above-mentioned modification onRecevie function Mechanism is penetrated, the situ replaced to the object of radio receiver is added into, i.e., will be patrolled comprising the above modification onRecevie function The object for the radio receiver collected, replaces the object of original radio receiver, i.e., unmodified included onRecevie function The object of the radio receiver of logic.
Wherein, above-mentioned to be based on Java reflection mechanism, the object of radio receiver is obtained, to get the core of radio receiver The execution process of the heart broadcasts call back function, that is, onRecevie function control, i.e. the execution entrance of the onRecevie function During address, the object of above-mentioned radio receiver may be at run mode.
In oneainstance, the above-mentioned process linked up with to broadcast call back function, can also be referred to as and adjust back to broadcast The process that the object of the corresponding radio receiver of function is linked up with.Broadcast call back function after can claiming the hook is corresponding wide The object of receiver is broadcast, for the object for the radio receiver linked up in advance.This is all possible.
Corresponding to above method embodiment, the embodiment of the invention provides a kind of data monitoring devices, as shown in figure 4, institute Stating device may include:
Module 410 is obtained, for obtaining and executing time-consuming behaviour for specified broadcast based on the broadcast call back function linked up in advance Execution duration when making, wherein the broadcast call back function are as follows: receive radio receiver corresponding time of the specified broadcast Letter of transfer number;
Judgment module 420, for judging whether the execution duration is more than default monitoring threshold value;
Feedback module 430 executes duration feedback operation for when the judgment result is yes, executing preset broadcast.
In the embodiment of the present invention, based on the broadcast call back function linked up in advance, obtains and execute time-consuming behaviour for specified broadcast Execution duration when making, wherein the broadcast call back function are as follows: receive the corresponding readjustment letter of radio receiver of specified broadcast Number;Judge to execute whether duration is more than default monitoring threshold value;When the judgment result is yes, it is anti-to execute preset broadcast execution duration Feedback operation.Using the embodiment of the present invention, can based on the broadcast call back function linked up in advance, to execute the process of time-consuming operation into Row monitors, and obtains the execution duration for executing time-consuming operation, and then based on default monitoring threshold value, judges whether execution duration is too long, When judging that executing duration is more than default monitoring threshold value, it is determined that execution duration is too long, continues to execute preset broadcast at this time Execute duration feedback operation, with prompt developer's corresponding radio receiver of broadcast call back function linked up in advance and/or There may be problems for the application program of association radio receiver.
In one implementation, the feedback module 430, is specifically used for
When determining local environment for test environment, obtain the specified broadcast mark and the radio receiver Mark;
Output collapse prompt information, wherein the collapse prompt information includes: the mark of the specified broadcast and described The mark of radio receiver.
In one implementation, the feedback module 430, is specifically used for
When determining local environment for publication environment, obtain the specified broadcast mark and the radio receiver Mark;
By the mark of the specified broadcast, the mark of the radio receiver and the execution duration, it is sent to backstage Server.
In one implementation, described device further include:
Registration module, for, based on the broadcast call back function linked up in advance, obtaining described and executing consumption for specified broadcast When execution duration when operating before, registered for specified broadcast, with based on the broadcast call back function linked up in advance, Time-consuming operation is executed for the specified broadcast, and the process for executing time-consuming operation is monitored.
In one implementation, described device further include:
Hooking module, for, based on the broadcast call back function linked up in advance, obtaining described and executing consumption for specified broadcast When execution duration when operating before, be based on Java reflection mechanism, the broadcast call back function linked up with.
In one implementation, described device further include:
Trigger module, for, based on the broadcast call back function linked up in advance, obtaining specified broadcast described and executing time-consuming behaviour Before execution duration when making, when radio receiver receives specified broadcast, the broadcast call back function needle linked up in advance is triggered Time-consuming operation is executed to the specified broadcast.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of electronic equipment, as shown in figure 5, including Processor 510, communication interface 520, memory 530 and communication bus 540, wherein processor 510, communication interface 520, storage Device 530 completes mutual communication by communication bus 540,
Memory 530, for storing computer program;
Processor 510 when for executing the computer program stored on memory 530, realizes institute of the embodiment of the present invention Any data monitoring method provided, may include step:
Based on the broadcast call back function linked up in advance, execution duration when executing time-consuming operation for specified broadcast is obtained, Wherein, the broadcast call back function are as follows: receive the corresponding call back function of radio receiver of the specified broadcast;
Judge whether the execution duration is more than default monitoring threshold value;
When the judgment result is yes, it executes preset broadcast and executes duration feedback operation.
In the embodiment of the present invention, based on the broadcast call back function linked up in advance, obtains and execute time-consuming behaviour for specified broadcast Execution duration when making, wherein the broadcast call back function are as follows: receive the corresponding readjustment letter of radio receiver of specified broadcast Number;Judge to execute whether duration is more than default monitoring threshold value;When the judgment result is yes, it is anti-to execute preset broadcast execution duration Feedback operation.Using the embodiment of the present invention, can based on the broadcast call back function linked up in advance, to execute the process of time-consuming operation into Row monitors, and obtains the execution duration for executing time-consuming operation, and then based on default monitoring threshold value, judges whether execution duration is too long, When judging that executing duration is more than default monitoring threshold value, it is determined that execution duration is too long, continues to execute preset broadcast at this time Execute duration feedback operation, with prompt developer's corresponding radio receiver of broadcast call back function linked up in advance and/or There may be problems for the application program of association radio receiver.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.
It is described the embodiment of the invention also provides a kind of computer readable storage medium corresponding to above method embodiment It is stored with computer program in computer readable storage medium, realizes that the present invention is real when the computer program is executed by processor Any data monitoring method provided by example is applied, may include step:
Based on the broadcast call back function linked up in advance, execution duration when executing time-consuming operation for specified broadcast is obtained, Wherein, the broadcast call back function are as follows: receive the corresponding call back function of radio receiver of the specified broadcast;
Judge whether the execution duration is more than default monitoring threshold value;
When the judgment result is yes, it executes preset broadcast and executes duration feedback operation.
In the embodiment of the present invention, based on the broadcast call back function linked up in advance, obtains and execute time-consuming behaviour for specified broadcast Execution duration when making, wherein the broadcast call back function are as follows: receive the corresponding readjustment letter of radio receiver of specified broadcast Number;Judge to execute whether duration is more than default monitoring threshold value;When the judgment result is yes, it is anti-to execute preset broadcast execution duration Feedback operation.Using the embodiment of the present invention, can based on the broadcast call back function linked up in advance, to execute the process of time-consuming operation into Row monitors, and obtains the execution duration for executing time-consuming operation, and then based on default monitoring threshold value, judges whether execution duration is too long, When judging that executing duration is more than default monitoring threshold value, it is determined that execution duration is too long, continues to execute preset broadcast at this time Execute duration feedback operation, with prompt developer's corresponding radio receiver of broadcast call back function linked up in advance and/or There may be problems for the application program of association radio receiver.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method Part explanation.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (10)

1. a kind of data monitoring method, which is characterized in that the described method includes:
Based on the broadcast call back function linked up in advance, execution duration when executing time-consuming operation for specified broadcast is obtained, wherein The broadcast call back function are as follows: receive the corresponding call back function of radio receiver of the specified broadcast;
Judge whether the execution duration is more than default monitoring threshold value;
When the judgment result is yes, it executes preset broadcast and executes duration feedback operation.
2. the method according to claim 1, wherein the preset broadcast of the execution executes duration feedback operation Step, comprising:
When determining local environment to test environment, the mark of the specified broadcast and the mark of the radio receiver are obtained Know;
Output collapse prompt information, wherein the collapse prompt information includes: the mark and the broadcast of the specified broadcast The mark of receiver.
3. the method according to claim 1, wherein the preset broadcast of the execution executes duration feedback operation Step, comprising:
When determining local environment to issue environment, the mark of the specified broadcast and the mark of the radio receiver are obtained Know;
By the mark of the specified broadcast, the mark of the radio receiver and the execution duration, it is sent to background service Device.
4. the method according to claim 1, wherein being obtained described based on the broadcast call back function linked up in advance Before the step of obtaining execution duration when executing time-consuming operation for specified broadcast, the method also includes:
It is registered for specified broadcast, held for the specified broadcast based on the broadcast call back function linked up in advance Row time-consuming operation, and the process for executing time-consuming operation is monitored.
5. the method according to claim 1, wherein being obtained described based on the broadcast call back function linked up in advance Before the step of obtaining execution duration when executing time-consuming operation for specified broadcast, the method also includes:
Based on Java reflection mechanism, the broadcast call back function is linked up with.
6. the method according to claim 1, wherein being obtained described based on the broadcast call back function linked up in advance Before the step of broadcasting execution duration when executing time-consuming operation must be specified, the method also includes:
When radio receiver receives specified broadcast, triggers the broadcast call back function linked up in advance and held for the specified broadcast Row time-consuming operation.
7. a kind of data monitoring device, which is characterized in that described device includes:
Module is obtained, for obtaining and broadcasting when executing time-consuming operation for specified based on the broadcast call back function linked up in advance Execute duration, wherein the broadcast call back function are as follows: receive the corresponding readjustment letter of radio receiver of the specified broadcast Number;
Judgment module, for judging whether the execution duration is more than default monitoring threshold value;
Feedback module executes duration feedback operation for when the judgment result is yes, executing preset broadcast.
8. device according to claim 7, which is characterized in that the feedback module is specifically used for
When determining local environment to test environment, the mark of the specified broadcast and the mark of the radio receiver are obtained Know;
Output collapse prompt information, wherein the collapse prompt information includes: the mark and the broadcast of the specified broadcast The mark of receiver.
9. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the computer program stored on memory, realizes any data of claim 1-6 Monitoring method step.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium Program realizes claim 1-6 any data monitoring method step when the computer program is executed by processor.
CN201810676044.4A 2018-06-27 2018-06-27 Data monitoring method and device and electronic equipment Active CN109032811B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810676044.4A CN109032811B (en) 2018-06-27 2018-06-27 Data monitoring method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810676044.4A CN109032811B (en) 2018-06-27 2018-06-27 Data monitoring method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109032811A true CN109032811A (en) 2018-12-18
CN109032811B CN109032811B (en) 2021-05-14

Family

ID=64610943

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810676044.4A Active CN109032811B (en) 2018-06-27 2018-06-27 Data monitoring method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109032811B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710425A (en) * 2018-12-19 2019-05-03 北京金山安全软件有限公司 Message monitoring method and device
CN109710465A (en) * 2018-12-29 2019-05-03 出门问问信息科技有限公司 The initial method of smartwatch and its locating module, device and electronic equipment
CN111782421A (en) * 2020-06-29 2020-10-16 北京字节跳动网络技术有限公司 Method, device, equipment and storage medium for registering broadcast

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855148A (en) * 2012-08-02 2013-01-02 广东欧珀移动通信有限公司 Android-based startup management method
CN106357757A (en) * 2016-09-07 2017-01-25 华为技术有限公司 Monitoring method and monitored device in monitoring system
JP6311693B2 (en) * 2015-11-25 2018-04-18 日本精工株式会社 Control device and control method for in-vehicle electronic device
CN108132882A (en) * 2017-12-22 2018-06-08 北京奇虎科技有限公司 Information acquisition method, device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855148A (en) * 2012-08-02 2013-01-02 广东欧珀移动通信有限公司 Android-based startup management method
JP6311693B2 (en) * 2015-11-25 2018-04-18 日本精工株式会社 Control device and control method for in-vehicle electronic device
CN106357757A (en) * 2016-09-07 2017-01-25 华为技术有限公司 Monitoring method and monitored device in monitoring system
CN108132882A (en) * 2017-12-22 2018-06-08 北京奇虎科技有限公司 Information acquisition method, device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
佚名: "如何在 BroadcastReceiver 中执行耗时操作?", 《HTTPS://BLOG.CSDN.NET/CORALLINE_XSS/ARTICLE/DETAILS/70171175》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710425A (en) * 2018-12-19 2019-05-03 北京金山安全软件有限公司 Message monitoring method and device
CN109710425B (en) * 2018-12-19 2020-06-26 北京金山安全软件有限公司 Message monitoring method and device
CN109710465A (en) * 2018-12-29 2019-05-03 出门问问信息科技有限公司 The initial method of smartwatch and its locating module, device and electronic equipment
CN111782421A (en) * 2020-06-29 2020-10-16 北京字节跳动网络技术有限公司 Method, device, equipment and storage medium for registering broadcast
CN111782421B (en) * 2020-06-29 2024-04-30 北京字节跳动网络技术有限公司 Method, device, equipment and storage medium for registering broadcast

Also Published As

Publication number Publication date
CN109032811B (en) 2021-05-14

Similar Documents

Publication Publication Date Title
CN109032811A (en) Data monitoring method and device and electronic equipment
CN110363888B (en) Door lock management method and device, electronic equipment and readable storage medium
US8345560B2 (en) Methods and apparatus to pre-qualify user communities for communication services
CN104331488B (en) File clean-up method, apparatus and equipment based on suspended window
WO2016172050A1 (en) Detecting device movement through electronic fingerprint analysis
CN102710342A (en) Distributed examination room radio cheating counter measure equipment
CN103686376A (en) Method and device for software upgrading of smart television
CN104809046B (en) A kind of application program networking control method and application program networking control device
CN106815025A (en) Sensing data report method and device
CN112118300B (en) Cascade device data returning method, device and system and readable storage medium
CN103870319B (en) Information processing method, device and electronic equipment
CN104158993B (en) Communication mode confirms devices, systems, and methods and household electrical appliance
US20220413993A1 (en) Anomaly detection of firmware revisions in a network
CN111224809A (en) Fault log transmission method and device, electronic equipment and storage medium
CN106823372A (en) Game on line starts method, device and terminal
CN106341469A (en) Method and device for loading tree node data
CN104301235B (en) The control method and device of network flow
CN107608881A (en) The progress control method and device of a kind of software development kit
CN113507721B (en) Network state monitoring method, device, system and storage medium
CN111010308A (en) KVM service test method and device
CN110598797A (en) Fault detection method and device, storage medium and electronic device
CN106897091B (en) Method and device for storing application program
CN109388544A (en) A kind of fault monitoring method, device and electronic equipment
CN105357078A (en) Detection method and system of network state of intelligent equipment
CN111402454A (en) Method and device for associating intelligent lock with environmental parameters

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