Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended
The example of device and method being described in detail in claims, some aspects of the invention are consistent.
It is only to be not intended to limit the invention merely for for the purpose of describing particular embodiments in terminology used in the present invention.
It is also intended in the present invention and the "an" of singular used in the attached claims, " described " and "the" including majority
Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps
It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the present invention
A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from
In the case where the scope of the invention, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as
One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determination ".
In Android platform, when each user clicks some page in opening APP manually, system needs to call
Instrumentation function goes to create this page (Activity), to show the page to user.Since system is creating
The page needs to expend the regular hour, can be to a certain degree if user opens the page every time and requires that the page is waited to be created
The upper experience for influencing user.
To solve the above-mentioned problems, this application provides a kind of methods for preloading the page, open target pages in user
When, first judge whether target pages have the corresponding preloading page, the corresponding page that preloads refers to user's access target page
Afterwards, it is most likely that next page of access.It preloads the page if so, being then pre-created and is saved in page stack, so as to
User open preload the page when can directly from page stack will preload page switching to stack top, without creating the page,
The speed that user opens the page can be greatly promoted in this way.Specific the method is as shown in Figure 1, include step S102-S106:
S102, when receive user triggering opening target pages request when, create the target pages;
S104, judge whether the target pages have the corresponding preloading page according to preloading page-map relationship,
In, described to preload the next page accessed after user's access target page that the page is prediction, the preloading page reflects
Penetrating relation record has target pages and preloads the corresponding relationship of the page;
S106, if so, then create the preloading page and the target pages be switched to the stack top of page stack, with
The target pages are made to obtain user focus.
The method that the page that this specification provides preloads needs real based on Application (entrance of application program)
It is existing, thus can be used for any electronic equipment of Android platform, including mobile phone, tablet computer, laptop etc..
Under normal circumstances, when user clicks some target pages of opening manually, system will receive this finger for opening the page
It enables, then system can call Instrumentation function to go to create this target pages.Instrumentation function is
For monitoring a function of all user's alternative events in Android platform, function includes the creation of Activity, destroys
Deng.It is also that the process of this page is shown to user that system, which calls the process of the Instrumentation function creation page, works as page
Face creates, and all data loadeds, the page created can obtain user focus.The page obtains user focus and refers to use
Family can be operated on this page, be at this time not no user focus, user is not for example, in page loading procedure
Can function in normal use APP, to be finished until page creation and could normal use after data loaded.
In Android platform, after system calls the good page of Instrumentation function creation, the page created
It can be stored in a page stack, an application program has a page stack and goes to manage the page of this program.User clicks A
After the page, the complete A page of system creation, the A page is located at the stack top of page stack at this time, and the page positioned at stack top is displayed to use
Family, if user clicks the B page again at this time, system will create the B page again, and at this moment the B page can be located at the stack top of page stack simultaneously
It is shown to user.The return key in the A page when the user clicks, i.e., when returning from the A page, then system will be deleted stores in page stack
The A page, if returned from the B page, system will be deleted the B page.
It will temporarily call Instrumentation function to remove the creation page since user opens interface every time, use in this way
Family will undergo the process of a waiting page creation when opening the page every time, will affect user experience.Due to the behaviour of user
Work be it is linear, when opening and browsing some page, the expense of CPU and RAM at this time is not high.So can receive
When opening the instruction of target pages to user, judge whether target pages have according to the preloading page-map relationship predicted in advance
The corresponding preloading page then creates target pages and the corresponding preloading page and protects if there is the corresponding preloading page
There are in page stack, and target pages are switched to the stack top of page stack, so that target pages obtain user focus.Wherein, right
The preloading page answered refers to user after the access target page, it is most likely that next page of access, for example, user is beating
When opening Alipay homepage, the next page to be opened is likely to pay in homepage the page of the corresponding payment code of this control
Face, therefore, the corresponding preloading page of the Alipay homepage page is exactly the code page of paying the bill.Page-map relationship is preloaded then to record
There is the corresponding preloading page of each page, for example the corresponding preloading page of Alipay homepage is the payment code page.In this way, working as
User, can be directly by the stack of preloading page switching created to page stack when opening the preloading page manually next time
Top so that preloading the page obtains user focus, for example when user clicks and opens Alipay homepage, creates Alipay homepage
When, judge that Alipay homepage exists and preload the page payment code page, then when creating Alipay homepage, also creates payment code page
Face, when opening the payment code page when the user clicks, user no longer needs to wait pending payments code page creation, but directly will be created
The payment code page is shown to user, and the effect that the page second opens may be implemented in this way, be greatly improved user experience.
In one embodiment, the method for preloading the page can be realized based on customized function, can will be
The page creation function Instrumentation function for uniting original is substituted for custom function, with by custom function come real
Now preload the method for the page.When user clicks APP manually for the first time and opens some page, system needs to call
Instrumentation function removes the creation page, at this point it is possible to pass through Java's in application program entry Application
Reflection technology removes the Instrumentation intercepting api calls for calling system, and Instrumentation function is substituted for certainly
Defined function can create target pages by custom function, and judge the page according to page-map relationship is preloaded
With the presence or absence of the page is preloaded, if it is present creation preloads the page, after having created, it is located at due to preloading the page at this time
The stack top of page stack, it is possible to target pages are switched to the stack top of page stack, with to user's shows target pages, and mesh
The focus that the page obtains user is marked, so that user operates on target pages, and the page is preloaded and is then stored in page stack, with
It just, can be directly using the preloading page saved when user clicks the preloading page.
In one embodiment, if judging that preloading page is not present in target pages according to page-map relationship is preloaded
Face no longer needs to creation and preloads the page, target pages directly acquire user focus, so as to user then after creating target pages
It is operated on the page.For example, general user click open Alipay payment code page payment after, all can directly from
The page returns, and can seldom go to click from this page and open other pages, then this when, the preloading page predicted in advance
In mapping relations, the payment code page, so only needing to create the payment code page at this time, it is pre- to be not necessarily to creation there is no the page is preloaded
Loading page.
The prediction of user path is a kind of data analysing method risen in the recent period, it is mainly according to every user in App or net
Click user behaviors log in standing analyzes the circulation rule and feature of user's modules in App or website, excavates the visit of user
Blow mode is asked or put, and then realizes some specific traffic uses, as the access path of user in APP, App nucleus module arrive
Up to rate promotion, the mainstream path extraction of specific user group and browsing Characterizations, optimization and correcting of App product design etc..
And also there are various algorithms in the prediction for user path, accurately to predict the path of user.In one embodiment, institute
The algorithm that stating preloading page-map relationship can be predicted based on user path obtain.The prediction algorithm can be based on user each
The regular access path to predict user of click logs and access in a APP.For example, user is when opening Alipay homepage,
Next page can be entered from homepage, and next page can go to predict according to the control of homepage, such as possibly into paying
The money code page, possibly into transfer page, it is also possible to enter the ant forest page, then these pages can be the pre-add of homepage
Carry the page.It is of course also possible to go prediction to preload the page according to the use habit of user, for example, user opens payment each
After precious homepage, into the maximum probability of this page of ant forest, therefore can be using ant forest this page as homepage
Preload the page.
Certainly, it in the preloading page corresponding by user's path prediction algorithm prediction target pages, can only predict
For user after the access target page, user can also be accessed mesh as the page is preloaded by the page most possibly accessed
After marking the page, several pages that may be accessed are as the page is preloaded, since the preloading page of prediction is more, in load mesh
The preloading page to be loaded is also more simultaneously when the mark page, and the page for needing to be stored in page stack is also more, to a certain degree
On can occupy more resource, if user does not access these pages, will waste many resources go creation and
It stores these and preloads the page, but if the preloading page of prediction is more, predict that accurate probability is also big.Therefore, user
Setting can be gone to preload the quantity of the page according to the actual situation, it is best to achieve the effect that, in this specification with no restriction.
When the user clicks when some APP, pre-set user's path prediction algorithm can be passed through in background server
Obtain preloading the mapping relations of the page, the mapping relations record of the loading page has the corresponding preloading of each page in APP
The page, the preloading page than entering page A are B and C, and the preloading page of page B is D, and page F does not have corresponding preloading page
Face.Server will preload page-map relationship and send after coming out the corresponding preloading Web page predicting of each page in APP
To client, so that client goes judge target pages with the presence or absence of preloading page and right according to page-map relationship is preloaded
Which page the preloading page answered is.Preloading page-map relationship can be stored in the form of tables of data, relational graph etc.,
The application is with no restriction.
Background server is obtained after preloading page-map relationship by user's path prediction algorithm, can will preload page
Face mapping relations are handed down to client, and client, which saves, preloads page-map relationship.In one embodiment, when user for the first time
When opening some page in APP, then page-map relationship is preloaded in the entrance addition of application program, to click in user
When the page, target pages can be judged with the presence or absence of the preloading page according to pre-added preloading page-map relationship.
In one embodiment, the preloading page-map relationship can be stored in one in the form of key-value
In tables of data.It can be key, page with the page after obtaining the corresponding preloading page of each page by user's path prediction algorithm
The corresponding preloading page in face is value, the page and the mapping relations for preloading the page is stored in tables of data, so as to each
Which, when judging target pages with the presence or absence of page when preloading the page, and preloading the page, can rapidly find
The corresponding preloading page of target pages.For example, the corresponding preloading page of page A is B and C, then using page A as key, page
Face B and page C is the corresponding value of the key, when the user clicks when page A, can inquire the corresponding Value value of key page A
For the page B and C, it can it is B and C that rapidly inquiry, which obtains the preloading page of A,.
It due to when creating target pages, while creating and preloading the page and be stored in page stack, preload page meeting
The memory of occupancy system.If user is not switched on always the preloading page, the preloading page remains stored in page stack can be very unrestrained
Take memory.So in one embodiment, if the instruction that user returns from target pages has been received, there are no connect
The instruction opened and preload the page is received, then following user opens the probability for preloading the page with regard to smaller, it is possible to
It is deleted from from page stack and preloads the page, the preloading page is avoided to have been stored in committed memory in page stack.For example, user
It clicks after opening Alipay homepage, it is predicted that homepage preloads the page that the page is ant forest, but next user beats
The other pages opened are struck, the preloading page is not turned on, when user closes homepage, i.e., when returning from homepage, illustrate to use
Family is less likely entering the ant forest page from homepage, so can will be pre-created and be stored in page stack at this time
The ant forest page delete, avoid committed memory.
For the method for the preloading page being explained further in this specification, it is embodied below in conjunction with Fig. 2 with one
Example is described in detail.
When user clicks Alipay APP for the first time, system can call Instrumentation function to go creation Alipay first
Page (S201), at this point it is possible to which the entrance in Alipay application program is gone by the reflection technology of Java by system calling
Instrumentation intercepting api calls, and Instrumentation function is substituted for custom function (S202).Then exist
The record that the entrance addition server of Alipay application program issues has a tables of data for preloading page-map relationship, data
Table is stored with the corresponding preloading page (S203) of each page of Alipay APP in the form of key-value.Mapping is preloaded to close
System is that the algorithm based on prediction user path obtains, the prediction algorithm based on click logs of the user in each APP, visit
Rule, user's habit are asked to predict the access path of user, to obtain preloading page-map relationship.As general
After Instrumentation function is substituted for custom function, custom function will create user and click the target pages opened
The Alipay homepage page (S204) then judges Alipay homepage with the presence or absence of pre- according to the preloading page-map relationship of addition
Loading page (S205), if it is determined that Alipay homepage, which exists, preloads the page payment code page, then custom function will create
The page is preloaded, i.e. the payment code page (S206), after preloading the page due to creation, preloads the stack that the page is located at page stack
Top, so the stack top for also needing to need the target pages Alipay homepage opened to be switched to the page stack user, so that Alipay
Homepage obtains user focus, so that user is operated (S207) in the page.If closed according to the preloading page-map of addition
System judges the target pages Alipay page, and there is no the corresponding preloading pages, then directly create target pages Alipay homepage page
Face, so that Alipay homepage obtains user focus (S208).If the preloading page of Alipay homepage has been pre-created certainly
The payment code page, but user is not switched on always the payment code page, at this time when user returns from Alipay homepage, illustrates user
Substantially the payment code page will not be entered from Alipay homepage can be by the payment code page of preloading in order not to account for memory
(S209) is deleted from page stack.By this method for preloading the page, user is when opening the preloading page, due to pre-add
It carries the page to be also pre-created, thus the effect that the second opens may be implemented, improve the experience of user.
Corresponding with the preloading embodiment of the method for the page that this specification provides, this explanation additionally provides a kind of preloading
Page device, as shown in figure 3, described device 300 includes:
Page creation module 301 creates the page object when receiving the request of opening target pages of user's triggering
Face;And judging that the target pages there are when the corresponding preloading page, create institute according to preloading page-map relationship
State the preloading page;
Judgment module 302 judges whether the target pages have corresponding preloading according to page-map relationship is preloaded
The page, wherein described to preload the next page accessed after user's access target page that the page is prediction, the preloading
Page-map relation record has target pages and preloads the corresponding relationship of the page;
Page switching module 303 is judging that the target pages have that there are corresponding according to preloading page-map relationship
When preloading the page, the target pages are switched to the stack top of page stack, so that the target pages obtain user focus.
In one embodiment, before creating the target pages further include:
It inquires in the page stack and whether is stored with the target pages;And determined whether to create institute according to query result
The step of stating target pages;Wherein, the step of creating the target pages is in the not stored target pages of the page stack
It is performed;
When the page stack is stored with the target pages, further comprise the steps of: the target in the page stack
Page switching to page stack stack top, to obtain user focus.
In one embodiment, if the corresponding preloading page is not present in the target pages, the target is notified
The page obtains user focus.
In one embodiment, the instruction for preloading the page is opened if do not received, closes institute when receiving
When stating the instruction of target pages, the preloading page is deleted from the page stack.
In one embodiment, the page-map relationship that preloads is obtained based on the algorithm in prediction user path.
In one embodiment, the preloading page-map relationship is recorded in tables of data in the form of key-value.
In one embodiment, when receiving the request of the opening page of user's triggering for the first time, in application program entry
The middle addition preloading page-map relationship.
In one embodiment, the method is based on the customized function and realizes that the method also includes steps: institute
Customized function is stated when receiving the instruction for opening the page for the first time, intercepts the page creation function carried in application program.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with
It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual
The purpose for needing to select some or all of the modules therein to realize application scheme.Those of ordinary skill in the art are not paying
Out in the case where creative work, it can understand and implement.
For hardware view, as shown in figure 4, for a kind of hardware for preloading page device place equipment of this specification
Structure chart, it is real other than processor 401 shown in Fig. 4, network interface 404, memory 402 and nonvolatile memory 403
Applying the equipment in example where device usually can also include other hardware, such as be responsible for the forwarding chip of processing message;From hardware
The equipment is also possible to be distributed equipment from structure, may include multiple interface cards, to be reported in hardware view
The extension of text processing.
The nonvolatile memory 403 is stored with for storing executable computer instruction, and processor 404 executes institute
It is performed the steps of when stating computer instruction
When receiving the request of opening target pages of user's triggering, the target pages are created;
Judge the target pages with the presence or absence of the corresponding preloading page according to page-map relationship is preloaded, wherein
Described to preload the next page accessed after user's access target page that the page is prediction, the preloading page-map is closed
System's record has target pages and preloads the corresponding relationship of the page;
If so, then creating the preloading page and the target pages being switched to the stack top of page stack, so that institute
It states target pages and obtains user focus.
Since all or part of the application the part that contributes to existing technology or the technical solution can be with soft
The form of part product embodies, which is stored in a storage medium, including some instructions are to make
Obtain all or part of the steps that a terminal device executes each embodiment method of the application.And storage medium above-mentioned includes: U
Disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access
Memory, RAM), the various media that can store program code such as magnetic or disk.
The foregoing is merely the preferred embodiments of the application, not to limit the application, all essences in the application
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the application protection.