Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.
The present invention can describe in the general context of computer-executable instructions executed by a computer, such as program
Module.Generally, program module includes routines performing specific tasks or implementing specific abstract data types, programs, objects, member
Part, data structure etc..The present invention can also be practiced in a distributed computing environment, in these distributed computing environments, by
Task is executed by the connected remote processing devices of communication network.In a distributed computing environment, program module can be with
In the local and remote computer storage media including storage equipment.
In the present invention, the fingers such as " module ", " device ", " system " are applied to the related entities of computer, such as hardware, hardware
Combination, software or software in execution with software etc..In detail, for example, element can with but be not limited to run on processing
Process, processor, object, executable element, execution thread, program and/or the computer of device.In addition, running on server
Application program or shell script, server can be element.One or more elements can be in the process and/or thread of execution
In, and element can be localized and/or be distributed between two or multiple stage computers on one computer, and can be by each
Kind computer-readable medium operation.Element can also according to the signal with one or more data packets, for example, from one with
Another element interacts in local system, distributed system, and/or the network in internet passes through signal and other system interactions
The signals of data communicated by locally and/or remotely process.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise", not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or equipment institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence " including ... ", it is not excluded that including described want
There is also other identical elements in the process, method, article or equipment of element.
The method that the promotion WebView of the embodiment of the present invention interacts real-time with H5 can be applied to any need and pass through H5
Load linked is compared with the terminal device that large resource is shown, for example, being mounted with the smart phone of the application program of the demand, plate
The terminal devices such as computer, smart home, the invention is not limited in this regard.So that user is using these terminal devices
During obtain response more promptly and accurately, promote user experience.
The invention will now be described in further detail with reference to the accompanying drawings.
Fig. 1 schematically shows that promotion WebView according to an embodiment of the present invention interacts the side of real-time with H5
Method flow chart, as shown in Figure 1, the present embodiment includes the following steps:
Step S101: WindowManager is obtained.
Illustratively, the calling function that the calling interface carried according to Android system provides directly acquires
WindowManager。
Step S102: the WebView of the first display area of creation, and be loaded on WindowManager.
Illustratively, creation WebView component is carried out according to the function instruction that Android system carries, and its display is set
Area i.e. the first display area is 1px (pixel), then is loaded on the WindowManager control of step acquisition.Pass through
1 pixel is set by the first display area, it is ensured that is executed with the state that user is almost invisible, is not needed user and spend
Take excessive energy to go to pay close attention to, and WebView component is visible WindowManager, thus it can be carried out accordingly
Operation, such as carry out the preloading of H5 link, carry out all kinds of interactions of Native and H5.
Step S103: the static state for the H5 link for needing to access is preloaded on the WebView of the first display area of loading
Resource.The H5 that will be accessed is linked on WebView and is loaded, illustratively, the static resource in load H5 link, such as
Video link, picture link etc. will not be normal for the load of these resources with interactive and changed resource content
Often need to expend long time to load, by these static resources WebView preload can be prior carry out it is aobvious
Show preparation, so that user does not spend the extra waiting time.
Step S104: when receiving display trigger signal, the WebView of the first display area is amplified to the second display
Area is shown.Corresponding trigger signal, such as playing request input by user etc. are being received, it will be by prior pre-add
The static resource of load is shown as full frame by a pixel, does not need user and takes time to wait again, for users as real-time
Display is the same, greatly improves user experience.
Fig. 2 schematically shows that the promotion WebView of another embodiment according to the present invention interacts real-time with H5
Method flow diagram, as shown in Fig. 2, the present embodiment includes the following steps:
The specific implementation of step S201 to step S202 are referred to shown in step S101 to step S102.
Step S203: the WebView of the static resource in H5 link is preloaded with from unloading on WindowManager.For
The occupied space that economizes on resources and mitigate UI resource burden, do not influence processing and carry out, before being shown, can temporarily by
It is preloaded with the WebView unloading of the static resource in H5 link, illustratively, the static resource in linking to H5 adds
When load, adjusted back by monitoring the system that WebView loads H5, the load condition to link to H5 is monitored, when the system of being based on
Readjustment judges that the static resource in H5 link has loaded completion, the static money being loaded in H5 link that first will temporarily take less than
The WebView in source is unloaded, wherein unloading is realized by the unloading command inside Android system.
Step S204: when receiving display trigger signal, the WebView of the first display area is amplified to the second display
Area is shown.When receiving display trigger signal, it will be preloaded with the WebView of the static resource in H5 link first
It is installed, i.e., is loaded on WindowManager again again, amplified display later, amplify the specific implementation side of display
Formula is referred to step S104.
Step S205: it when being shown, obtains and loads the dynamic resource in H5 link.Wherein, dynamic resource includes
There is real time data, for what is dynamically obtained before being shown (in loaded and displayed, dynamic script data can be received, for example, peace
In tall and erect system, PhoneGap technology can be passed through by Native by the need obtained in real-time, interactive dynamic data to be shown with foot
This mode is sent to H5 and carries out loaded and displayed).In this manner it is possible to the dynamic that static resource is preloaded, and will acquire
Resource carries out real-time display, and loading velocity is fast, avoids excessive resource occupation.
The time for accelerating H5 load by shirtsleeve operation mode may be implemented according to the present embodiment, when making the user do not need long
Between waited, and for including map load or when audio-video inside H5 is linked, do not need excessive yet
Waiting time improves the traveling experience sense of user.It, will and when being not necessary to display in the present embodiment after the completion of preloading
WebView unloads (being not to destroy) from WindowManager, and WebView is directly loaded up and is put again when needing to show
Big display reduces the resource burden of UI component, optimizes UI performance.
The application scenarios example of the above method is, for example, to terminate to generally require the complete of progress navigation path in navigation when navigating
Whole display.In this way, start navigation when, by the above method first by WebView with the display area of 1px load to
On WindowManager, and the destination conduct map of pre-load user will be preloaded with map after the completion of map load
WebView unloaded from WindowManager.Terminate in navigation, when carrying out navigation path display, what is terminated according to navigation
The WebView for being preloaded with map is first refilled and is downloaded on WindowManager by signal, and this dynamic provides to navigation routine
Source is loaded, and the complete display content that has loaded is amplified and is shown, must real-time integrality map and navigation rail
Mark, so for users, the display process greatly improve user experience just as in real time.
Fig. 3 schematically shows that promotion WebView according to an embodiment of the present invention interacts the dress of real-time with H5
Functional block diagram is set, as shown in figure 3,
Promoting WebView and interacting the device of real-time with H5 includes: that display window obtains module 301, display component creation mould
Block 302, real-time display module 303, preloaded components 304 and dlm (dynamic loading module) 305.
Display window obtains module 301 for obtaining WindowManager, the calling function provided by android system
It realizes.Display component creation module 303 is used to create and load the WebView of the first display area on WindowManager.
Specific implementation is referred to above method part.
Preloaded components 304 on the WebView of the first display area of loading for preloading the H5 chain for needing to access
The static resource connect.When H5 link in obtain all static resources when, can in the pre-loaded static resource of the module,
To save the waiting time of user.
Real-time display module 303 is used to amplify the WebView of the first display area when receiving display trigger signal
It is shown to the second display area.The size that first display area can be invisible to the naked eye for user, illustratively 1px,
Second display area then according to display demand setting, such as is embodied as being displayed in full screen in operation.
It may be implemented to show the static resource in H5 link in advance according to the present apparatus, save the waiting time of user.
Fig. 4 schematically shows that the promotion WebView of another embodiment according to the present invention interacts real-time with H5
Device principle block diagram, as shown in figure 4,
Promote the device that WebView interacts real-time with H5 further include: dlm (dynamic loading module) 305, display component unload mould
Block 306 and it is reloading with module 307.
Dlm (dynamic loading module) 305 is used for when being shown, is obtained and is loaded H5 on the WebView of the first display area
Dynamic resource in link.
Display component Unload module 306 is used for when the static resource load listened in H5 link is completed, from
Unloading is preloaded with the WebView of the static resource in H5 link on WindowManager;
Module 307 is reloading with for the static resource of H5 link will to be preloaded with when receiving display trigger signal
The WebView of first display area is loaded on WindowManager.
It, can be flexibly to WindowManager the case where for including dynamic resource in H5 link according to the device
It is unloaded by display component Unload module 306, when needing to show static resource using the first display area, Ke Yitong
It crosses and is reloading with module 307 and is installed, it is simple to operate.Add thus, it is possible to realize and accelerate H5 by shirtsleeve operation mode
The time of load makes the user do not need to be waited for a long time, and for including map load or audio-video inside H5 is linked
When, the excessive waiting time is not needed yet, improves the traveling experience sense of user, and save UI resource occupation.
The WindowManager referred in the above embodiment of the present invention is the service that Android system provides
(service) provides globally unique view view management and Message Processing tool assembly, for view view increase, delete
It removes, update, sequence level, state, message collection and processing etc.;WebView be android system provide be specifically used to load
It shows the view component of webpage, is used for loaded and displayed webpage (common html or h5), i.e., becomes the code code in webpage
User is visible and the element of tangible control;H5 is the webpage (the html page) realized with the 5th generation html technical label, is used for
The realization of webpage and the display of webpage, Native are a kind of program languages used in Android system, can be based on
PhoneGap technology realizes the two-way communication with H5.
In some embodiments, the embodiment of the present invention provides a kind of non-volatile computer readable storage medium storing program for executing, described to deposit
Being stored in storage media one or more includes the programs executed instruction, it is described execute instruction can by electronic equipment (including but
It is not limited to computer, server or the network equipment etc.) it reads and executes, to be promoted for executing any of the above-described of the present invention
The method that WebView interacts real-time with H5.
In some embodiments, the embodiment of the present invention also provides a kind of computer program product, computer program product packet
The computer program being stored on non-volatile computer readable storage medium storing program for executing is included, computer program includes program instruction, works as institute
When program instruction is computer-executed, so that computer is executed any of the above-described and promote the method that WebView interacts real-time with H5.
In some embodiments, the embodiment of the present invention also provides a kind of electronic equipment comprising: at least one processor,
And the memory being connect at least one processor communication, wherein memory, which is stored with, to be executed by least one processor
Instruction, instruction by least one described processor execute so that at least one processor be able to carry out promoted WebView and H5
The method of interaction real-time.
In some embodiments, the embodiment of the present invention also provides a kind of storage medium, is stored thereon with computer program,
It is characterized in that, the method that WebView interacts real-time with H5 is promoted when which is executed by processor.
The device that the promotion WebView of the embodiments of the present invention interacts real-time with H5 can be used for executing implementation of the present invention
The method that the promotion WebView of example interacts real-time with H5, and the realization for reaching the embodiments of the present invention accordingly is promoted
WebView interacts the method technical effect achieved of real-time with H5, and which is not described herein again.It can lead in the embodiment of the present invention
Cross hardware processor (hardware processor) Lai Shixian related function module.
Fig. 5 is the electronics that the execution that another embodiment of the application provides promotes that WebView interacts the method for real-time with H5
The hardware structural diagram of equipment, as shown in figure 5, the equipment includes:
One or more processors 510 and memory 520, in Fig. 5 by taking a processor 510 as an example.
Executing the equipment for promoting the method that WebView interacts real-time with H5 can also include: input unit 530 and output
Device 540.
Processor 510, memory 520, input unit 530 and output device 540 can pass through bus or other modes
It connects, in Fig. 5 for being connected by bus.
Memory 520 is used as a kind of non-volatile computer readable storage medium storing program for executing, can be used for storing non-volatile software journey
Sequence, non-volatile computer executable program and module, as the promotion WebView in the embodiment of the present application is interacted in real time with H5
Corresponding program instruction/the module of method of property.The non-volatile software that processor 510 is stored in memory 520 by operation
Program, instruction and module, thereby executing the various function application and data processing of server, i.e. the realization above method is implemented
Example promotes the method that WebView interacts real-time with H5.
Memory 520 may include storing program area and storage data area, wherein storing program area can store operation system
Application program required for system, at least one function;Storage data area, which can be stored, interacts real-time with H5 according to promotion WebView
Device use created data etc..In addition, memory 520 may include high-speed random access memory, can also wrap
Include nonvolatile memory, for example, at least a disk memory, flush memory device or other non-volatile solid state memories
Part.In some embodiments, it includes the memory remotely located relative to processor 510 that memory 520 is optional, these are remotely deposited
Reservoir can interact the device of real-time by being connected to the network to promotion WebView with H5.The example of above-mentioned network includes but not
It is limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Input unit 530 can receive the number or character information of input, and generates and interact in fact with promotion WebView with H5
The related signal of user setting and function control of the device of when property.Output device 540 may include that display screen etc. shows equipment.
Said one or multiple modules are stored in the memory 520, when by one or more of processors
When 510 execution, the method that the promotion WebView in above-mentioned any means embodiment interacts real-time with H5 is executed.
Method provided by the embodiment of the present application can be performed in the said goods, has the corresponding functional module of execution method and has
Beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to method provided by the embodiment of the present application.
The electronic equipment of the embodiment of the present application exists in a variety of forms, including but not limited to:
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, data
Communication is main target.This Terminal Type includes: smart phone (such as iPhone), multimedia handset, functional mobile phone and low
Hold mobile phone etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing function
Can, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device: this kind of equipment can show and play multimedia content.Such equipment include: audio,
Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are total
Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy
Power, stability, reliability, safety, scalability, manageability etc. are more demanding.
(5) mobile unit: the characteristics of this kind of equipment is that have communication function, is main to provide easily vehicle-mounted service etc.
Target.This Terminal Type includes: vehicle audio, vehicle device, Che Jing, HUD, automobile data recorder, on-vehicle machines people etc..
(6) other electronic devices with data interaction function.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It is realized by the mode of software plus general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, above-mentioned technology
Scheme substantially in other words can be embodied in the form of software products the part that the relevant technologies contribute, the computer
Software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions to
So that computer equipment (can be personal computer, server or the network equipment etc.) execute each embodiment or
Method described in certain parts of embodiment.
Finally, it should be noted that above embodiments are only to illustrate the technical solution of the application, rather than its limitations;Although
The application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution spirit and
Range.