The content of the invention
It is a primary object of the present invention to propose that one kind buries point methods, equipment and computer-readable recording medium, it is intended to realNow automation is buried a little, so as to lift the maintainability buried point efficiency and bury point code.
To achieve the above object, the present invention provides one kind and buries point methods, and the point methods that bury comprise the following steps:
When packing application program, obtain the application program buries point interface class source file, described to bury point interface class sourceFile includes default burying point interface class and for realizing the method for burying point interface class;
Point interface class source file is buried described in getting to be compiled as burying point interface class file, and buries point interface described in readingIt is described for realizing the method for burying point interface class in class file;
Inserted in being used to realizing the method for burying point interface class described in reading it is default bury point function, with generationNew buries point interface class file, wherein, it is described bury that point function is used to obtaining the application program bury point data.
Alternatively, it is described when packing application program, obtain the step of burying point interface class source file of the application programBefore, in addition to:
Defined for the application program and bury point interface class and for realizing the method for burying point interface class;
Point interface class is buried according to definition and for realizing that point interface class is buried in the method generation for burying point interface classSource file.
Alternatively, described defined for the application program buries point interface class and for realizing the method for burying point interface classThe step of include:
Receive first and instruction is set, point interface class is buried according to the described first setting instruction definition, it is described to bury under point interface classIt is used to realize the method for burying point interface class including at least one;
Receive second and instruction be set, according to described second set instruction it is described be used to realizing described in bury the side of point interface classWait to bury a control and corresponding Action Events defined in method.
Alternatively, described defined for the application program buries point interface class and for realizing the method for burying point interface classThe step of before, in addition to:
Definition buries point data and uploads function, and point data is buried described in foundation and uploads function and the pass buried between point functionConnection relation, the point data of burying upload function for the application program buried point function and got to be buried into point dataReach corresponding server.
Alternatively, the point methods that bury also include:
The application program is packed according to the new point interface class file that buries.
In addition, to achieve the above object, the present invention also provides one kind and buries point device, and the equipment includes:Memory, processingDevice and what is be stored on the memory and can run on the processor bury a program, a program of burying is by the processingDevice realizes following steps when performing:
When packing application program, obtain the application program buries point interface class source file, described to bury point interface class sourceFile includes default burying point interface class and for realizing the method for burying point interface class;
Point interface class source file is buried described in getting to be compiled as burying point interface class file, and buries point interface described in readingIt is described for realizing the method for burying point interface class in class file;
Inserted in being used to realizing the method for burying point interface class described in reading it is default bury point function, with generationNew buries point interface class file, wherein, it is described bury that point function is used to obtaining the application program bury point data.
Alternatively, it is described also to realize following steps when burying a program by the computing device:
Defined for the application program and bury point interface class and for realizing the method for burying point interface class;
Point interface class is buried according to definition and for realizing that point interface class is buried in the method generation for burying point interface classSource file.
Alternatively, it is described also to realize following steps when burying a program by the computing device:
Receive first and instruction is set, point interface class is buried according to the described first setting instruction definition, it is described to bury under point interface classIt is used to realize the method for burying point interface class including at least one;
Receive second and instruction be set, according to described second set instruction it is described be used to realizing described in bury the side of point interface classWait to bury a control and corresponding Action Events defined in method.
Alternatively, it is described also to realize following steps when burying a program by the computing device:
Definition buries point data and uploads function, and point data is buried described in foundation and uploads function and the pass buried between point functionConnection relation, the point data of burying upload function for the application program buried point function and got to be buried into point dataReach corresponding server.
In addition, to achieve the above object, the present invention also provides a kind of computer-readable recording medium, described computer-readableIt is stored with storage medium and buries a program, described bury realizes the step as described above for burying point methods when a program is executed by processorSuddenly.
For the present invention when packing application program, obtain the application program buries point interface class source file, and described bury a little connectsMouthful class source file includes default burying point interface class and the method for burying point interface class described in realizing;Described in gettingBury point interface class source file to be compiled as burying point interface class file, and buried described in reading described for realizing in point interface class fileThe method for burying point interface class;Described in reading default bury is being inserted for realizing in the method for burying point interface classPoint function, with generate it is new bury point interface class file, wherein, it is described bury that point function is used to obtaining the application program bury pointsAccording to.The present invention is pre-defined to be buried point interface class, realizes the method for burying point interface class and bury point function, subsequently applies journey in packingDuring sequence, point interface class is buried by detection, and then reads the method realized and bury point interface class, and inserts default bury a letter whereinNumber with generate it is new bury point interface class file, that is, realize automation and bury a little, so as to which developer is not necessarily based on different codesPosition bury a little manually, moreover, when point code is buried in maintenance, also only needs accordingly to change and buries point interface class, realizes and bury point interfaceThe method of class buries point function, and application program is carried out to beat again bag, and point efficiency and tieing up for point code is buried so as to improve to buryShield property.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are:When packing application program, burying a little for the application program is obtainedInterface class source file, the point interface class source file that buries include default burying point interface class and described burying point interface for realizingThe method of class;Point interface class source file is buried described in getting to be compiled as burying point interface class file, and is buried described in reading and a little connectIt is described for realizing the method for burying point interface class in mouth class file;It is used to described in read realize that described bury a little connectsInserted in the method for mouthful class it is default bury point function, with generate it is new bury point interface class file, wherein, the point function that buries is used forObtain the application program buries point data.
Developer arranges in APP bags at present typically buries a little, i.e., based on business statistics demand in APP when burying manuallyThe diverse location of bag add it is different bury point code, and a little numerous due to actually burying, quantities is very big, buries mode a little manually notOnly efficiency is low and is easy to mistake occur, and in follow-up code maintenance, developer is also required to based on different code bitsPut and carry out burying point code modification, operation is very cumbersome, therefore the mode buried a little manually can not meet the exploitation of developerDemand.
The present invention is pre-defined to be buried point interface class, realizes the method for burying point interface class and bury point function, is subsequently being packedDuring application program, point interface class is buried by detection, and then reads the method realized and bury point interface class, and is inserted wherein defaultBury point function with generate it is new bury point interface class file, that is, realize automation and bury a little, so as to which developer is not necessarily based on differenceCode position bury a little manually, moreover, when point code is buried in maintenance, also only need accordingly to change bury point interface class, realization is buriedThe method of point interface class buries point function, and application program is carried out to beat again bag, and point efficiency and point code is buried so as to improve to buryMaintainability.
The present invention provides one kind and buries point methods.
As shown in figure 1, Fig. 1 is the device structure schematic diagram for the hardware running environment that scheme of the embodiment of the present invention is related to.
It can be PC that the embodiment of the present invention, which buries point device, notebook, the terminal device such as pocket computer.
As shown in figure 1, the equipment can include:Processor 1001, such as CPU, network interface 1004, user interface1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is used to realize the connection communication between these components.User interface 1003 can include display screen (Display), input block such as keyboard (Keyboard), optional user interface1003 can also include wireline interface, the wave point of standard.Network interface 1004 can optionally connect including the wired of standardMouth, wave point (such as WI-FI interfaces).Memory 1005 can be high-speed RAM memory or stable memory(non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor1001 storage device.
It will be understood by those skilled in the art that the restriction of the device structure shown in Fig. 1 not structure paired terminal, can be wrappedInclude than illustrating more or less parts, either combine some parts or different parts arrangement.
As shown in figure 1, it can lead to as in a kind of memory 1005 of computer-readable storage medium including operating system, networkBelieve module, Subscriber Interface Module SIM and bury a program.
In the terminal shown in Fig. 1, network interface 1004 is mainly used in connecting background server, is carried out with background serverData communicate;User interface 1003 is mainly used in connecting client (user terminal), enters row data communication with client;And processor1001 can be used for calling the program of burying stored in memory 1005, and perform following operate:
When packing application program, obtain the application program buries point interface class source file, described to bury point interface class sourceFile includes default burying point interface class and for realizing the method for burying point interface class;
Point interface class source file is buried described in getting to be compiled as burying point interface class file, and buries point interface described in readingIt is described for realizing the method for burying point interface class in class file;
Inserted in being used to realizing the method for burying point interface class described in reading it is default bury point function, with generationNew buries point interface class file, wherein, it is described bury that point function is used to obtaining the application program bury point data.
Further, processor 1001 can call what is stored in memory 1005 to bury a program, also perform following operate:
Defined for the application program and bury point interface class and for realizing the method for burying point interface class;
Point interface class is buried according to definition and for realizing that point interface class is buried in the method generation for burying point interface classSource file.
Further, processor 1001 can call what is stored in memory 1005 to bury a program, also perform following operate:
Receive first and instruction is set, point interface class is buried according to the described first setting instruction definition, it is described to bury under point interface classIt is used to realize the method for burying point interface class including at least one;
Receive second and instruction be set, according to described second set instruction it is described be used to realizing described in bury the side of point interface classWait to bury a control and corresponding Action Events defined in method.
Further, processor 1001 can call what is stored in memory 1005 to bury a program, also perform following operate:
Definition buries point data and uploads function, and point data is buried described in foundation and uploads function and the pass buried between point functionConnection relation, the point data of burying upload function for the application program buried point function and got to be buried into point dataReach corresponding server.
Further, processor 1001 can call what is stored in memory 1005 to bury a program, also perform following operate:
The application program is packed according to the new point interface class file that buries.
Based on above-mentioned hardware configuration, propose that the present invention buries point methods embodiment.
Reference picture 2, Fig. 2 are the schematic flow sheet that the present invention buries point methods first embodiment, and the point methods that bury include:
Step S10, when packing application program, obtain the application program buries point interface class source file, described to bury a littleInterface class source file includes default burying point interface class and for realizing the method for burying point interface class;
It is a little one of the Main Means of current APP manufacturers counting user based on APP operation behaviors to bury, by being installed in APPPoint code is buried in injection in bag, when subsequent user installs the APP on the subscriber terminal and carries out various operations (such as based on the APPOpen some option in some page or the selection page) when, the behavioral data of user will be captured and report to by burying point codeCorresponding server, so that server analysis user behavior, and the user obtained according to analysis draws a portrait and recommends to feel to userThe content of interest.
The present embodiment buries the packing process that point methods are applied to application program, and this buries point methods can be by PC, penOriginally, the agency service Agent that buries run on the terminal device such as pocket computer is realized note.First, when packing application program,That buries that point Agent obtains the application program buries point interface class source file, and this, which buries point interface class source file, includes developer's rootPoint interface class is buried according to what business statistics demand was pre-set and for realizing the method for burying point interface class.
To bury point interface class source file to be illustrated exemplified by Login.java, it is by developing that this, which buries point interface class source file,Personnel write according to business statistics demand, include in its code and bury point interface class Login Interface and for realityExisting Login Interface method, when it is implemented, burying what point Agent can be provided by using JavaClassFileTransform classes obtain Login.java source files.
Reference picture 3, Fig. 3 are the constituent schematic diagram that point interface class Login Interface are buried in the embodiment of the present invention,Two implementation methods in the case where burying point interface class Login Interface be present:Login and register, wherein Login methods relate toAnd statistical parameter include String userName and String psw, correspond to user name and login password, register respectivelyThe statistical parameter that method is related to includes String userName, corresponding user name.Designed by the composition, subsequent user is being stepped onWhen recording triggering login on the page or registering operation, bury the statistical parameter that can a little capture correlation and report server, thusRealize the statistics that behavior is logged in user.
Step S20, will get described in bury point interface class source file and be compiled as burying point interface class file, and described in readingBury described for realizing the method for burying point interface class in point interface class file;
After getting and burying point interface class source file, burying point Agent will call Java compiler that this is buried into point interface class sourceFile is compiled as burying point interface class file, then by Java reflex mechanisms (in running status, for any one class, allIt is able to know that all properties and method of this class;For any one object, can call its any one method andAttribute;The function of the information of this dynamic access and the method for dynamic call object is referred to as the reflex mechanism of Java language) readTake this to bury to be used to realize the method for burying point interface class in point interface class file.For example above-mentioned bury point interface class source fileLogin.java generates Login.class interface class files after being compiled, and wherein class represents a class, encapsulates in suchThe Method of description method, Method in Login.class can be read by Java reflex mechanisms by burying point Agent, i.e.,Read Login and register.
Step S30, inserted in being used to realizing the method for burying point interface class described in reading and default bury a letterNumber, with generate it is new bury point interface class file, wherein, it is described bury that point function is used to obtaining the application program bury point data.
In the step, bury point Agent and insert default bury a little in the method for being used for realization and burying point interface class readFunction, with generate it is new bury point interface class file, wherein, that buries that point function is used to obtaining application program buries point data.More than stillState exemplified by burying point interface class Login Interface, to realize Login the and register methods under Login Interface,Developer need to pre-define and bury point function accordingly, for example be mainly used in obtaining for Login methods, its point function that buries definedTake the two statistical parameters of String userName and String psw;Point Agent is buried after getting and burying point function, will be buriedIn method corresponding to point function insertion, that is, realize and bury being automatically injected for point code.
By the above-mentioned means, subsequently accordingly buried a little when user logs in triggering on login page or registers operationCapture login name, login password of user etc. and bury point data, and then this is buried into point data and reports server, thus achieveThe statistics of behavior is logged in user.
Further, after step S30, can also include:Answered according to the new point interface class file that buries describedPacked with program.
Generation it is new bury point interface class file after, bury point Agent and point interface class file new buried to applying according to thisProgram is packed, and installation is downloaded for user so as to generate corresponding installation kit.
In the present embodiment, when packing application program, obtain the application program buries point interface class source file, describedBurying point interface class source file includes default burying point interface class and for realizing the method for burying point interface class;It will getThe point interface class source file that buries be compiled as burying point interface class file, and the use in point interface class file is buried described in readingIn the method that point interface class is buried described in realization;Insertion is pre- in being used to realize the method for burying point interface class described in readingIf bury point function, with generate it is new bury point interface class file, wherein, the point function that buries is used to obtain the application programBury point data.The present embodiment is pre-defined to be buried point interface class, realizes the method for burying point interface class and bury point function, is subsequently being beatenDuring bag application program, point interface class is buried by detection, and then reads the method realized and bury point interface class, and insertion is default whereinBury point function with generate it is new bury point interface class file, that is, realize automation and bury a little, so as to which developer is not necessarily based on notSame code position bury a little manually, moreover, when point code is buried in maintenance, also only needs accordingly to change and buries point interface class, realizesBury the method for point interface class or bury point function, and application program is carried out to beat again bag, point efficiency and a generation is buried so as to improve to buryThe maintainability of code.
Further, reference picture 4, Fig. 4 are the schematic flow sheet that the present invention buries point methods second embodiment.Based on above-mentioned figureEmbodiment shown in 2, before step S10, it can also include:
Step S40, defined for the application program and bury point interface class and for realizing the method for burying point interface class;
Step S50, point interface class is buried according to definition and for realizing that the method generation for burying point interface class is buriedPoint interface class source file.
In the present embodiment, the setting instruction of developer can be received by burying point Agent, think that application program definition is buried a littleInterface class and the method for burying point interface class for realization, afterwards, bury point Agent and bury point interface class and for realizing according to definitionPoint interface class source file is buried in the method generation for burying point interface class.
Reference picture 5, Fig. 5 are the refinement step schematic diagram of step S40 in Fig. 4.As a kind of embodiment, step S40 canWith including:
Step S41, receive first and instruction is set, point interface class is buried according to the described first setting instruction definition, it is described to bury a littleInclude under interface class at least one for realizing the method for burying point interface class;
Step S42, receive second and instruction be set, according to described second set instruction it is described be used to realizing described in bury and a little connectWait to bury a control and corresponding Action Events defined in the method for mouth class.
Specifically, the first setting instruction of developer can be received by burying point Agent, and fixed according to the first setting instructionJustice is some to bury point interface class, and each bury is used to realize the method for burying point interface class under point interface class including at least one, thanSuch as Login Interface interface classes, two method for realizing interface class Login and register can be defined, withRealize that the login to user and registration behavior count respectively.Afterwards, bury point Agent and receive the second of developer and set and refer toOrder, and second set instruction waiting to bury a control and corresponding defined in the method for point interface class for burying described in realizing according to thisAction Events, such as, it can wait that it is " button1 " (login) to bury a control defined in Login methods, and operated corresponding to itEvent is " click ", waits that it is " button2 " (registration) to bury a control defined in register methods, operation thing corresponding to itPart is " click ", in this way, when user is subsequently clicking on the two controls on the APP pages, will trigger and bury a little accordingly, buryThe point data of burying for obtaining correlation is reported server by point, and server is that basis buries point data counting user behavior, is such as clicked on secondaryNumber, number of persons logging, enrollment etc., and it is business recommended with this to carry out precision.
It should be noted that to meet the statistics needs of different business, an above-mentioned control that buries can define one or more,When define it is multiple bury control when, corresponding Action Events can also be combination operation, for example first click on button1, then click onButton2, or adopting consecutive click chemical reaction button1 and button2 etc. in preset duration, can flexibly it set during specific implementation.In addition,Realizing that the statistical parameter that buries defined in the method for point interface class is also not limited to above-mentioned wait to bury a control and corresponding operation thingPart, for example page stay time, current system time, the geographical position etc. of user, specific defined parameters can also be includedIt can need flexibly to be set according to statistics, when subsequent user, which is based on APP, carries out corresponding operating, bury a little i.e. according to defined parametersCollection is related to bury point data and reports server.
Afterwards, point Agent is buried to be generated simultaneously according to the method buried point interface class and bury point interface class for realizing of definitionPoint interface class source file is buried in preservation.
The present embodiment is defined by advance application program buries point interface class and for realizing the method for burying point interface class,And then point interface class source file is buried corresponding to generating, bury point code to realize to be automatically injected in APP bags and provide premise.
Further, reference picture 6, Fig. 6 are the schematic flow sheet that the present invention buries point methods 3rd embodiment.Based on above-mentioned figureEmbodiment shown in 4, before step S40, it can also include:
Step S60, definition bury point data and upload function, and point data upload function is buried described in foundation and buries point function with describedBetween incidence relation, it is described bury point data upload function be used for burying the application program buried point function and gotPoint data is uploaded to corresponding server.
In the present embodiment, instructed according to the setting of developer, bury point Agent and can pre-define one and bury point dataFunction is uploaded, and establishes this and buries point data upload function and bury the incidence relation between point function, wherein, bury point data and upload letterNumber is used to the point data of burying for burying the application program that point function is got being uploaded to corresponding server.
Specifically, realize that a kind of way for burying point data upload is that the software development that a data upload is integrated in APPKit SDK, bury after a little getting and burying point data, point data will be buried and be sent to SDK, realized and uploaded by SDK, therefore, Ke YidingThe point data of burying corresponding with SDK of justice one uploads function, and establishes this and bury point data upload function and bury the pass between point functionConnection relation, so, when subsequent user triggering is buried, bury point function and get first and bury point data, it is then automatic to call therewithThe point data of burying of association uploads function and carries out data upload, and background server carries out user behavior point after point data being collected into buryAnalysis, it is possible to it is business recommended to carry out precision for different user.Certainly, bury point data upload function and be not limited to above-mentioned SDKIt is corresponding bury point data upload function or other bury buried corresponding to point data uploading tools point data upload function, toolBody can flexibly be set when implementing.
The present invention also provides one kind and buries point device.
The present invention, which buries point device, to be included:Memory, processor and it is stored on the memory and can be in the processorA program is buried in upper operation, described to realize following steps when burying a program by the computing device:
When packing application program, obtain the application program buries point interface class source file, described to bury point interface class sourceFile includes default burying point interface class and for realizing the method for burying point interface class;
Point interface class source file is buried described in getting to be compiled as burying point interface class file, and buries point interface described in readingIt is described for realizing the method for burying point interface class in class file;
Inserted in being used to realizing the method for burying point interface class described in reading it is default bury point function, with generationNew buries point interface class file, wherein, it is described bury that point function is used to obtaining the application program bury point data.
Further, it is described also to realize following steps when burying a program by the computing device:
Defined for the application program and bury point interface class and for realizing the method for burying point interface class;
Point interface class is buried according to definition and for realizing that point interface class is buried in the method generation for burying point interface classSource file.
Further, it is described also to realize following steps when burying a program by the computing device:
Receive first and instruction is set, point interface class is buried according to the described first setting instruction definition, it is described to bury under point interface classIt is used to realize the method for burying point interface class including at least one;
Receive second and instruction be set, according to described second set instruction it is described be used to realizing described in bury the side of point interface classWait to bury a control and corresponding Action Events defined in method.
Further, it is described also to realize following steps when burying a program by the computing device:
Definition buries point data and uploads function, and point data is buried described in foundation and uploads function and the pass buried between point functionConnection relation, the point data of burying upload function for the application program buried point function and got to be buried into point dataReach corresponding server.
Wherein, the method realized when a program is performed of burying run on the processor can refer to the present invention and bury a littleThe each embodiment of method, here is omitted.
The present invention also provides a kind of computer-readable recording medium.
It is stored with computer-readable recording medium of the present invention and buries a program, it is described to bury reality when a program is executed by processorExisting following steps:
When packing application program, obtain the application program buries point interface class source file, described to bury point interface class sourceFile includes default burying point interface class and for realizing the method for burying point interface class;
Point interface class source file is buried described in getting to be compiled as burying point interface class file, and buries point interface described in readingIt is described for realizing the method for burying point interface class in class file;
Inserted in being used to realizing the method for burying point interface class described in reading it is default bury point function, with generationNew buries point interface class file, wherein, it is described bury that point function is used to obtaining the application program bury point data.
Further, described bury when a program is executed by processor also realizes following steps:
Defined for the application program and bury point interface class and for realizing the method for burying point interface class;
Point interface class is buried according to definition and for realizing that point interface class is buried in the method generation for burying point interface classSource file.
Further, described bury when a program is executed by processor also realizes following steps:
Receive first and instruction is set, point interface class is buried according to the described first setting instruction definition, it is described to bury under point interface classIt is used to realize the method for burying point interface class including at least one;
Receive second and instruction be set, according to described second set instruction it is described be used to realizing described in bury the side of point interface classWait to bury a control and corresponding Action Events defined in method.
Further, described bury when a program is executed by processor also realizes following steps:
Definition buries point data and uploads function, and point data is buried described in foundation and uploads function and the pass buried between point functionConnection relation, the point data of burying upload function for the application program buried point function and got to be buried into point dataReach corresponding server.
Further, described bury when a program is executed by processor also realizes following steps:
The application program is packed according to the new point interface class file that buries.
Wherein, the method realized when a program is performed of burying run on the processor can refer to the present invention and bury a littleThe each embodiment of method, here is omitted.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-rowHis property includes, so that process, method, article or system including a series of elements not only include those key elements, andAnd also include the other element being not expressly set out, or also include for this process, method, article or system institute inherentlyKey element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including thisOther identical element also be present in the process of key element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment sideMethod can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many casesThe former is more preferably embodiment.Based on such understanding, technical scheme is substantially done to prior art in other wordsGoing out the part of contribution can be embodied in the form of software product, and the computer software product is stored in one as described aboveIn storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions to cause a station terminal equipment (can be mobile phone,Computer, server, air conditioner, or network equipment etc.) perform method described in each embodiment of the present invention.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hairThe equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skillsArt field, is included within the scope of the present invention.