The content of the invention
According to one embodiment of the invention, there is provided a kind of method of fast start network application, applied to electronic equipmentIn, methods described includes:
When the electronic equipment starts, the empty network application thread of automatic start;
Receive the operation input for starting particular network application;
Input, generated by the first operation in the empty network application thread at least one new in response to the operationNetwork application sub-line journey;
The content of the particular network application is loaded by the new network application sub-line journey, wherein, it is the multiple to answerA network application process is formed with sub-line journey;And
Render and run the particular network application.
Preferably, starting the network application thread of sky includes:
Start counterfoil application;And
Load and initialize network video picture library, the network video picture library is used to render and the content of network application is presented.
Preferably, a new network application sub-line journey is generated in the empty network application thread by the first operationIncluding:
By calling fork functions, a new network application sub-line journey is replicated in the empty network application thread,The new network application sub-line journey has whole resources of the empty network application thread.
Preferably, the content for loading the particular network application by the new network application sub-line journey includes:
The code of the particular network application is loaded in the new network application sub-line journey;And/or
The page of the particular network application is loaded in the new network application sub-line journey.
Preferably, rendering and running the particular network application includes:
According to the code of the particular network application, render and run network application corresponding with the code;And/or
According to the page of the particular network application, render and run network application corresponding with the page.
According to another embodiment of the present invention, there is provided a kind of electronic equipment, including:
Thread start unit, for when the electronic equipment starts, the empty network application thread of automatic start;
Operation input unit, start the operation input of particular network application for receiving;
Sub-line journey generation unit, for being inputted in response to the operation, by the first operation in the empty network application lineAt least one new network application sub-line journey is generated in journey;
Content loading unit, for being loaded by the new network application sub-line journey in the particular network applicationHold, wherein, the multiple application sub-line journey forms a network application process;And
Running unit, for rendering and running the particular network application.
Preferably, the thread start unit is further used for:
Start counterfoil application;And
Load and initialize network video picture library, the network video picture library is used to render and the content of network application is presented.
Preferably, the sub-line journey generation unit is multiple in the empty network application thread by calling fork functionsA new network application sub-line journey is made, the new network application sub-line journey has the whole of the empty network application threadResource.
Preferably, the content loading unit loads the particular network application in the new network application sub-line journeyCode;And/or the page of the particular network application is loaded in the new network application sub-line journey.
Preferably, the running unit is rendered and run and the code pair according to the code of the particular network applicationThe network application answered;And/or the page according to the particular network application, rendering and run network corresponding with the page shouldWith.
Therefore, the method and electronic equipment of fast start network according to embodiments of the present invention application, it can quickly be openedDynamic network application, so as to improve user experience.
Embodiment
Hereinafter, by preferred embodiments of the present invention will be described in detail with reference to the annexed drawings.
Before the preferred embodiments of the present invention are described, the network application start-up course of prior art is first briefly described.
With support of the operating systems such as iOS, Android to HTML5, by counterfoil program load HTML5, CSS5,The network application of Javascript exploitations(Web App)As feasible, but Web App toggle speed is endured to the fullest extent denounce always.
As shown in figure 1, existing WebApp start-up course 100 includes following steps:
Step S101:User clicks on WebApp icon.
Step S102:Start counterfoil application.
Step S103:Load networks view(WebView)Storehouse.
Step S104:Load the WebApp page.
Step S105:Start to render and start WebApp.
That is, it is necessary to should by starting counterfoil after user starts to click on the icon for the WebApp for it is expected operationWith loading WebView storehouse, load the WebApp page, and start to render and start WebApp four-stages.Assuming that from stepIt is t1 the time required to rapid S101 to step S103, from step S104 to step S105, required time is t2, then is clicked on from userWebApp icon to WebApp content, which are shown, to be completed, and the required startup time is t1+t2, and the time, t1+t2 was often beyond 3Second.Therefore, even if the hardware configuration of electronic equipment is very high, also make it that user's sensory system performance is too poor, so as to cause user's bodyTest poor.
<First embodiment>
The method of fast start network application according to a first embodiment of the present invention considers problem above and made.NamelySay, to optimize WebApp toggle speed, it is necessary first to consider optimization WebApp Booting sequence.
During starting different WebApp in an operating system, " starting counterfoil application " and " loading, initializationThe two processes of WebView storehouse " are just as.On the other hand, " loading WebApp the page " and " start to render and startWebApp " process is then according to the different and different of WebApp.Accordingly, it is considered to case above is fast to improve WebApp startupDegree.
The method of fast start network application according to a first embodiment of the present invention is applied in electronic equipment, and the electronics is setStandby can be any electronic equipment, as long as the electronic equipment can run WebApp.The example bag of such electronic equipmentInclude desktop computer, tablet personal computer, smart mobile phone, intelligent television etc..
The method 200 of fast start network application includes:
Step S201:When the electronic equipment starts, the empty network application thread of automatic start;
Step S202:Receive the operation input for starting particular network application;
Step S203:Inputted in response to the operation, by the first operation generate in the empty network application thread toA few new network application sub-line journey;
Step S204:The content of the particular network application is loaded by the new network application sub-line journey, wherein, instituteState multiple application sub-line journeys and form a network application process;And
Step S205:Render and run the particular network application.
Specifically, in step s 201, when electronic equipment starts, after os starting, operating system is automaticStart an empty network application thread(That is, an empty WebApp is started).
Starting empty WebApp process includes:Start counterfoil application and load and initialize network view(WebView)Storehouse, the network video picture library are used to render and the content of network application is presented.
In addition, after loading WebView storehouses, Javascript storehouses can also be loaded, for running java applet.
In step S202, the operation input for starting particular network application is received.For example, user can be detected for specificThe clicking operation of WebApp icon inputs as operation.Or user can be detected and disappeared for webpage, mail, instant messagingThe clicking operation of link in breath is inputted as operation, and specific WebApp is pointed in the link.
In step S203, inputted in response to the operation, the life in the empty network application thread by the first operationInto at least one new network application sub-line journey.That is, when detecting that user starts particular Web App operation input,At least one new WebApp sub-lines are generated in the empty WebApp threads generated in step s 201 by the first operationJourney.
Specifically, by calling fork functions, replicating a new network in the empty network application thread shouldWith sub-line journey, the new network application sub-line journey has whole resources of the empty network application thread.
That is, fork()Function is called by system, creates one and the substantially identical thread of original thread,The thread has and original thread identical code, data and the resource for distributing to thread(For example, the sky of data storage and codeBetween).
Then, in step S204, loaded by the new network application sub-line journey in the particular network applicationHold.That is, by using fork()The thread of function creation, loading user select the content of the network application started(Such asWebApp codes, page etc.).
Specifically, the content for loading the particular network application by the new network application sub-line journey includes:The code of the particular network application is loaded in the new network application sub-line journey;And/or in new network applicationThe page of the particular network application is loaded in thread.
It should be noted that the institute including above-mentioned empty network application sub-line journey, the new network application sub-line journey replicatedState multiple application sub-line journeys and form a network application process.One thread is can to complete a complete application, so as to not onlyUnder LUNIX system situation, and under Windows system situation, aforesaid operations can also be carried out.
Then, in step S205, render and run WebApp codes, user selects what is started so as to bring into operationWebApp。
Specifically, rendering and running the particular network application includes:According to the code of the particular network application, wash with watercoloursContaminate and run network application corresponding with the code;And/or the page according to the particular network application, render and run withNetwork application corresponding to the page.
Understand as described above, " starting counterfoil application " and " loading, initialization WebView storehouse " the two processesStartup for all WebApp is all identical, required time t1.Load the WebApp page and start to render and openIt is t2 the time required to dynamic WebApp.
Therefore, when using the method for fast start network application according to a first embodiment of the present invention, as shown in figure 3,When user selects to start WebApp, WebApp start-up course includes:Fork goes out a sub-line in the WebApp threads of skyJourney, loads the WebApp page, and starts to render and start WebApp.Now, it is in sky the time required to starting WebAppThe time t1 ' that fork goes out needed for a sub-line journey in WebApp threads adds the loading WebApp page and starts to render and startT2 the time required to WebApp.However, in the WebApp threads of sky fork go out time t1 ' needed for a sub-line journey almost can be withIgnore, so method according to a first embodiment of the present invention, t2 is substantially equal to the time required to starting WebApp.
As can be seen here, compared with the WebApp of prior art startup method, it is possible to reduce " starting counterfoil application " and " addTime t1 needed for the storehouse of load, initialization WebView ", so as to which user feels that WebApp toggle speed is greatly speeded up.
Therefore, the method for fast start network application according to embodiments of the present invention, can fast start network application, fromAnd improve user experience.
<Second embodiment>
Below, the method 300 that fast start network according to a second embodiment of the present invention applies is described with reference to figure 4.This is fastThe method 300 that speed starts network application includes:
Step S301:When the electronic equipment starts, the empty network application process of automatic start;
Step S302:Receive the operation input for starting particular network application;
Step S303:Inputted in response to the operation, by the first operation generate in the empty network application process toA few new network application subprocess;
Step S304:The content of the particular network application is loaded by the new network application subprocess;And
Step S305:Render and run the particular network application.
According to a second embodiment of the present invention fast start network application method 300 with according to a first embodiment of the present inventionThe difference of method 200 of fast start network application be:In method 200, after electronic equipment startup, automatic startEmpty network application thread, and in method 300, after electronic equipment startup, the empty network application process of automatic start.SoAfterwards, in method 300, fork is passed through()Function generates at least one new network application in the network application process of sky and enteredJourney, and by the content of the new network application subprocess loading particular network application, to render and run the spyDetermine network application.
It is identical with first embodiment, it is that fork goes out one in the WebApp processes of sky the time required to now starting WebAppTime t1 ' ' needed for subprocess adds the loading WebApp page and starts to render and start t2 the time required to WebApp.SoAnd the time t1 ' ' that fork goes out needed for a subprocess in the WebApp processes of sky can almost ignore, so according to this hairThe method of bright first embodiment, t2 is substantially equal to the time required to starting WebApp.
According to a second embodiment of the present invention fast start network application method 300 other operations with according to the present inventionThe method 200 of first embodiment is similar.
Specifically, by calling fork functions, replicating a new network in the empty network application process shouldWith subprocess, the new network application subprocess has whole resources of the empty network application process.
That is, fork()Function is called by system, creates one and the substantially identical process of original process,The process has and original process identical code, data and the resource for distributing to process(For example, the sky of data storage and codeBetween).
Then, in step s 304, loaded by the new network application subprocess in the particular network applicationHold.That is, by using fork()The process of function creation, loading user select the content of the network application started(Such asWebApp codes, page etc.).
Specifically, the content for loading the particular network application by the new network application subprocess includes:The code of the particular network application is loaded in the new network application subprocess;And/or in new network applicationThe page of the particular network application is loaded in process.
As can be seen here, compared with the WebApp of prior art startup method, it is possible to reduce " starting counterfoil application " and " addTime t1 needed for the storehouse of load, initialization WebView ", so as to which user feels that WebApp toggle speed is greatly speeded up.
Therefore, the method for fast start network application according to embodiments of the present invention, can fast start network application, fromAnd improve user experience.
<3rd embodiment>
Below, electronic equipment 400 according to a third embodiment of the present invention is described with reference to figure 5.
Electronic equipment 400 according to a second embodiment of the present invention includes:
Thread start unit 401, for when the electronic equipment starts, the empty network application thread of automatic start;
Operation input unit 402, start the operation input of particular network application for receiving;
Sub-line journey generation unit 403, for being inputted in response to the operation, by the first operation in the empty network applicationAt least one new network application sub-line journey is generated in thread;
Content loading unit 404, for loading the particular network application by the new network application sub-line journeyContent, wherein, the multiple application sub-line journey forms a network application process;And
Running unit 405, for rendering and running the particular network application.
The thread start unit 401 is further used for:
Start counterfoil application;And
Load and initialize network video picture library, the network video picture library is used to render and the content of network application is presented.
The sub-line journey generation unit 403 replicates one by calling fork functions in the empty network application threadIndividual new network application sub-line journey, the new network application sub-line journey have whole moneys of the empty network application threadSource.
The content loading unit 404 loads the generation of the particular network application in the new network application sub-line journeyCode;And/or the page of the particular network application is loaded in the new network application sub-line journey.
The running unit 405 is rendered and run corresponding with the code according to the code of the particular network applicationNetwork application;And/or the page according to the particular network application, render and run network application corresponding with the page.
Therefore, electronic equipment according to embodiments of the present invention, can fast start network application, so as to improve user useExperience.
It should be noted that above embodiment is intended merely as example, the invention is not restricted to such example, but canTo carry out various change.
It should be noted that in this manual, term " comprising ", "comprising" or its any other variant are intended toNonexcludability includes, so that process, method, article or equipment including a series of elements not only will including thoseElement, but also the other element including being not expressly set out, or it is this process, method, article or equipment also to includeIntrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded thatOther identical element also be present in process, method, article or equipment including the key element.
Finally, it is to be noted that, a series of above-mentioned processing are not only included with order described here in temporal sequenceThe processing of execution, and the processing including performing parallel or respectively rather than in chronological order.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can be bySoftware adds the mode of required hardware platform to realize, naturally it is also possible to is all implemented by hardware.Based on such understanding,What technical scheme contributed to background technology can be embodied in the form of software product in whole or in part,The computer software product can be stored in storage medium, such as ROM(Read-only storage)/RAM(Random access memory), magneticDish, CD etc., including some instructions are causing a computer equipment(Can be personal computer, server, or networkEquipment etc.)Perform the method described in some parts of each embodiment of the present invention or embodiment.
The present invention is described in detail above, principle and embodiment party of the specific case used herein to the present inventionFormula is set forth, and the explanation of above example is only intended to help the method and its core concept for understanding the present invention;It is meanwhile rightIn those of ordinary skill in the art, according to the thought of the present invention, change is had in specific embodiments and applicationsPart, in summary, this specification content should not be construed as limiting the invention.