CN104572230A - Script file loading method, script file generating method and script file generating device - Google Patents
Script file loading method, script file generating method and script file generating device Download PDFInfo
- Publication number
- CN104572230A CN104572230A CN201510080503.9A CN201510080503A CN104572230A CN 104572230 A CN104572230 A CN 104572230A CN 201510080503 A CN201510080503 A CN 201510080503A CN 104572230 A CN104572230 A CN 104572230A
- Authority
- CN
- China
- Prior art keywords
- script file
- browser
- listed files
- new script
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
The invention relates to a script file loading method, a script file generating method and a script file generating device which are used for preventing a browser from generating a blocking phenomenon in a process of loading a script file. The script file loading method comprises the following steps: when the browser needs to load the script file, sending a file list of the script file to a cache server, and noticing the browser to perform tasks in a single process through an asynchronous loading method; receiving the script file generated by the cache server according to the fie list; noticing the browser to stop performing tasks in the single process, and loading a new scrip file through the single process. According to the technical scheme adopted by the invention, the blocking phenomenon can be effectively prevented from being generated in a process of loading the script file.
Description
Technical field
The disclosure relates to networking technology area, particularly relates to a kind of loading method of script file, script file generation method and device.
Background technology
Browser is by using one process process user interface (UI) and upgrading multiple tasks such as javascript (js) operation, because one process can only perform a task at one time, how long Javascript runs, how long the time that browser is waited for just has, therefore load at browser in the flow process of js script file, there will be the parsing because of js script, operation etc. makes the page of whole browser be in waiting status, also be, in the process that js script loads, the page parsing of browser, browser and user's is total blockage alternately, for user, the webpage of browser is in " seemingly-dead " state, now user cannot carry out mutual with browser.
Summary of the invention
For overcoming Problems existing in correlation technique, disclosure embodiment provides a kind of loading method of script file, script file generation method and device, produces choking phenomenon in order to avoid browser in the process of loading scripts file.
According to the first aspect of disclosure embodiment, provide a kind of loading method of script file, application on the terminal device, comprising:
When browser needs loading scripts file, send the listed files of described script file to caching server, notify that described browser is by the task in the mode fill order process of Asynchronous loading;
Receive the new script file that described caching server generates according to described listed files;
Described new script file is loaded by described one process.
In one embodiment, the function logics relation in described new script file can be determined by the function logics relation between the described script file needing to load, described by the described new script file of described one process loading, can comprise:
Described new script file is loaded by described one process according to the function logics relation in described new script file.
According to the second aspect of disclosure embodiment, a kind of script file generation method is provided, is applied on caching server, comprises:
Receive the listed files that browser needs the script file loaded;
Determine that described browser needs the new script file loaded according to described listed files, the function logics relation of described new script file is consistent with the function logics relation of described plural script file;
Described new script file is sent to described browser.
In one embodiment, the described new script file determining the loading of described browser needs according to described listed files, can comprise:
Detect the script file whether described caching server stored in described listed files;
If described caching server stores the script file in described listed files, generate the new script file of described browser needs loading according to described listed files;
If described caching server does not store the script file in described listed files, obtain described new script file to web browser.
In one embodiment, described to the described new script file of web browser acquisition, can comprise:
Described listed files is sent to described web server;
Receive the described new script file that described web server generates according to described listed files.
According to the third aspect of disclosure embodiment, provide a kind of charger of script file, application on the terminal device, comprising:
First sending module, is configured to, when described browser needs loading scripts file, send the listed files of described script file to caching server, notifies that described browser is by the task in the mode fill order process of Asynchronous loading;
First receiver module, is configured to the new script file receiving the described listed files generation that described caching server sends according to described first sending module;
Load-on module, is configured to notify that described browser stops performing the task in described one process, the described new script file received by described first receiver module of described one process loading.
In one embodiment, the function logics relation in described new script file can be determined by the function logics relation between the described script file needing to load, and described load-on module can comprise:
Load submodule, the function logics relation be configured in the described new script file received according to described first receiver module loads described new script file by described one process.
According to the fourth aspect of disclosure embodiment, provide a kind of generating apparatus of script file, be applied on caching server, comprise:
Second receiver module, is configured to the listed files receiving the script file that browser needs load;
Determination module, the described listed files being configured to receive according to described second receiver module determines that described browser needs the new script file loaded, and the function logics relation of described new script file is consistent with the function logics relation of described plural script file;
Second sending module, the described new script file being configured to described determination module to determine sends to described browser.
In one embodiment, described determination module can comprise:
Detection sub-module, is configured to detect the script file whether described caching server stored in described listed files that described second receiver module receives;
Generate submodule, if be configured to described detection sub-module to detect that described caching server stores the script file in described listed files, generate the new script file of described browser needs loading according to described listed files;
Obtain submodule, if be configured to described detection sub-module to detect that described caching server does not store the script file in described listed files, obtain described new script file to web browser.
In one embodiment, described acquisition submodule can comprise:
Send submodule, be configured to send described listed files to described web server;
Receive submodule, be configured to the described new script file receiving the described listed files generation that described web server sends according to described transmission submodule.
According to the 5th aspect of disclosure embodiment, a kind of charger of script file is provided, comprises:
Processor;
For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
When browser needs loading scripts file, send the listed files of described script file to caching server, notify that described browser is by the task in the mode fill order process of Asynchronous loading;
Receive the new script file that described caching server generates according to described listed files;
Notify that described browser stops performing the task in described one process, load described new script file by described one process.
According to the 6th aspect of disclosure embodiment, a kind of script file generating apparatus is provided, comprises:
Processor;
For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
Receive the listed files that browser needs the script file loaded;
Determine that described browser needs the new script file loaded according to described listed files, the function logics relation of described new script file is consistent with the function logics relation of described plural script file;
Described new script file is sent to described browser.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect: when browser needs loading scripts file, because browser still can by the task in the mode fill order process of Asynchronous loading, due to the script file of the current needs loadings of browser to be loaded such as browser is not in always, but the tasks such as the such as page parsing in fill order's process can also be continued, therefore browser and user's is normal alternately; Only have when receiving new script file, browser stops the task in fill order's process, and load new script file by one process, loading procedure due to whole script file does not make browser be in waiting process, and therefore disclosure embodiment can avoid the choking phenomenon that produces in the process of loading scripts file effectively.
Should be understood that, it is only exemplary and explanatory that above general description and details hereinafter describe, and can not limit the disclosure.
Accompanying drawing explanation
Accompanying drawing to be herein merged in instructions and to form the part of this instructions, shows embodiment according to the invention, and is used from instructions one and explains principle of the present invention.
Fig. 1 is the process flow diagram of the loading method of script file according to an exemplary embodiment.
Fig. 2 is the process flow diagram of the loading method of script file according to an exemplary embodiment one.
Fig. 3 is the process flow diagram of the script file generation method according to an exemplary embodiment.
Fig. 4 A is the process flow diagram of the script file generation method according to an exemplary embodiment one.
Fig. 4 B is the scene graph of the script file generation method according to an exemplary embodiment one.
Fig. 5 is the block diagram of the charger of script file according to an exemplary embodiment.
Fig. 6 is the block diagram of the charger of another kind of script file according to an exemplary embodiment.
Fig. 7 is the block diagram of the script file generating apparatus according to an exemplary embodiment.
Fig. 8 is the block diagram of the another kind of script file generating apparatus according to an exemplary embodiment.
Fig. 9 is a kind of block diagram being applicable to the charger of script file according to an exemplary embodiment.
Figure 10 is a kind of block diagram being applicable to script file generating apparatus according to an exemplary embodiment.
Embodiment
Here will be described exemplary embodiment in detail, its sample table shows in the accompanying drawings.When description below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawing represents same or analogous key element.Embodiment described in following exemplary embodiment does not represent all embodiments consistent with the present invention.On the contrary, they only with as in appended claims describe in detail, the example of apparatus and method that aspects more of the present invention are consistent.
Fig. 1 is the process flow diagram of the loading method of script file according to an exemplary embodiment, this Fig. 1 is that the process flow diagram of the loading method of script file according to an exemplary embodiment can be applied on terminal device (such as: smart mobile phone, panel computer, PC etc.), browser on the terminal device can be realized, as shown in Figure 1, the loading method of this script file comprises the following steps S101-S103:
In step S101, when browser needs loading scripts file, send the listed files of script file to caching server, notice browser is by the task in the mode fill order process of Asynchronous loading.
In one embodiment, such as, when browser needs to load file1.js, file2.js, file3.js tri-script files, the file name of above-mentioned three script files can be sent to the caching server (or content distributing network (CDN)) that communication distance is nearest according to the IP address at the current place of browser; In one embodiment, the title of these three script files can be sent in the mode of listed files, determine to return to terminal device the script file that browser can load according to listed files to make caching server or CDN.
In one embodiment, other js file of one process can be loaded by jsloader dynamic asynchronous, such as, other js file is the script file that webpage is played up, thus, browser can be made not need etc. to be loaded and execute the operation such as to play up that above-mentioned three script files can realize webpage, thus avoid webpage to be in " seemingly-dead " state, improves real-time mutual between browser and user.
In step s 102, the new script file that caching server generates according to listed files is received.
In one embodiment, new script file can generate according to the script file in listed files; In one embodiment, caching server can determine the logical relation of new script file according to the call relation each other of the script file in listed files.
In step s 103, notice browser stops the task in fill order's process, loads new script file by one process.
In one embodiment, such as, when browser needs to load file1.js, file2.js, during file3.js, the implementation procedure of correlation technique is when needs load file1.js, need to obtain file1.js to caching server, then load, when needing to record file2.js, file2.js is obtained to caching server, then load, when needing to record file3.js, file3.js is obtained to caching server, then load, thus, need to carry out three times with caching server alternately, when browser is one process Processing tasks, load file1.js, file2.js, the process of file3.js can be very very long, and disclosure embodiment passes through the new script file of loading one, can avoid needing to load in multiple script file when browser, time and the time of record of the script file needing to load is sent to caching server.
In the present embodiment, when browser needs loading scripts file, because browser still can by the task in the mode fill order process of Asynchronous loading, due to the script file of the current needs loadings of browser to be loaded such as browser is not in always, but the tasks such as the such as page parsing in fill order's process can also be continued, therefore browser and user's is normal alternately; Only have when receiving new script file, browser stops the task in fill order's process, and load new script file by one process, loading procedure due to whole script file does not make browser be in waiting process, and therefore disclosure embodiment can avoid the choking phenomenon that produces in the process of loading scripts file effectively.
In one embodiment, the function logics relation in new script file can be determined by the function logics relation between the script file needing to load, and step S102 can comprise:
New script file is loaded by one process according to the function logics relation in new script file.
Concrete how on a web browser loading scripts file, please refer to subsequent embodiment.
So far, the said method that disclosure embodiment provides, can avoid the choking phenomenon produced in the process of loading scripts file effectively.
With specific embodiment, the technical scheme that disclosure embodiment provides is described below.
Fig. 2 is the process flow diagram of the loading method of script file according to an exemplary embodiment one; The said method that the present embodiment utilizes disclosure embodiment to provide, to carry out exemplary illustration by loading scripts file on a web browser, as shown in Figure 2, comprises the steps:
In step s 201, when browser needs loading scripts file, send the listed files of script file to caching server, notice browser is by the task in the mode fill order process of Asynchronous loading.
The description of step S201 with reference to the description of above-mentioned steps S101, can be not described in detail in this.
In step S202, receive the new script file that caching server generates according to listed files.
The description of step S202 with reference to the description of above-mentioned steps S102, can be not described in detail in this.
In step S203, notice browser stops the task in fill order's process, loads this new script file according to the function logics relation in new script file.
The description of step S203 can with reference to the description of above-mentioned steps S103; In addition, in one embodiment, new script file can be determined according to the function logics relation each other of the script file in listed files, thus browser can be enable to load this new script file normally; In one embodiment, function logics relation can be determined according to the relation between the function call in script file.
Fig. 3 is the process flow diagram of the script file generation method according to an exemplary embodiment, this Fig. 1 is that the process flow diagram of the loading method of script file according to an exemplary embodiment can be applied on terminal device (such as: smart mobile phone, panel computer, PC etc.), browser on the terminal device can be realized, as shown in Figure 1, the loading method of this script file comprises the following steps S101-S103:
In step S301, receive the listed files that browser needs the script file loaded.
In one embodiment, such as, when browser requires it to return to need to load file1.js, file2.js, file3.js tri-script files to caching server in the mode of listed files, which script file what caching server can determine from listed files that browser needs to load is.
In step s 302, need the new script file loaded according to listed files determination browser, the function logics relation of new script file is consistent with needing the function logics relation of the script file loaded.
In one embodiment, if caching server stores the script file in listed files, then the script file in listed files can be merged into a new script file according to the logical relation between function calling relationship or function by caching server; In another embodiment, if the script file on caching server in non-storage file list, then caching server can send above-mentioned listed files to web server, and obtains script file from web server; In one embodiment, web server can merge into a new script file according to the logical relation between listed files foundation function calling relationship or function, in another embodiment, script file in listed files can be sent to caching server by web server, and caching server merges into a new script file according to the logical relation between function calling relationship or function.
In step S303, new script file is sent to browser.
In the present embodiment, by generating new script file and new script file being sent to browser, browser stops the task in fill order's process, and load new script file by one process, loading procedure due to whole script file does not make browser be in waiting process, and therefore disclosure embodiment can avoid the choking phenomenon that produces in the process of loading scripts file effectively.
In one embodiment, step S302 can comprise:
To detect on caching server the script file in whether storage file list;
If caching server stores the script file in listed files, generate the new script file of browser needs loading according to listed files;
If caching server does not store the script file in listed files, obtain new script file to web browser.
In one embodiment, obtain new script file to web browser, can comprise:
Listed files is sent to web server;
Receive the new script file that web server generates according to listed files.
Concrete how generation script file, please refer to subsequent embodiment.
So far, the said method that disclosure embodiment provides, can avoid the choking phenomenon produced in the process of loading scripts file effectively.
With specific embodiment, the technical scheme that disclosure embodiment provides is described below.
Fig. 4 A is the process flow diagram of the script file generation method according to an exemplary embodiment one, and Fig. 4 B is the scene graph of the script file generation method according to an exemplary embodiment one; The said method that the present embodiment utilizes disclosure embodiment to provide, to carry out exemplary illustration by loading scripts file on a web browser, as shown in Figure 4 A, comprises the steps:
In step S401, receive the listed files that browser needs the script file loaded.
The description of step S401 with reference to the description of above-mentioned steps S301, can be not described in detail in this.
In step S402, to detect on caching server the script file in whether storage file list, as existed, performing step S403, if do not existed, performing step S404.
In one embodiment, caching server (also can be called content source server) and between terminal device between web server, caching server can preserve according to the request of access of terminal device the copy that web server sends to the content of terminal device, copy is such as the html page, picture, file etc., when caching server receives the next request of access of terminal device, if the URL of this request of access is identical with the URL of a upper request of access, then caching server directly can respond this this request of access by copy, instead of again send request of access to web server, thus the time delay of response request can be reduced.
In step S403, if caching server stores the script file in listed files, generate the new script file of browser needs loading according to listed files, perform step 406.
In one embodiment, the script file in listed files can be merged into a new script file according to the logical relation between function calling relationship or function by caching server.
In step s 404, if caching server does not store the script file in listed files, obtain new script file to web browser, perform step S405.
In one embodiment, if the script file on caching server in non-storage file list, then caching server can send above-mentioned listed files to web server, and obtains script file from web server; In one embodiment, web server can merge into a new script file according to the logical relation between listed files foundation function calling relationship or function, in another embodiment, script file in listed files can be sent to caching server by web server, and caching server merges into a new script file according to the logical relation between function calling relationship or function.
In step S405, new script file is sent to browser, and flow process terminates.
As Fig. 4 B, terminal device 41 can realize dynamic asynchronous by jsloader and load js file, when needs loading scripts file, the listed files of the script file being badly in need of loading is sent to caching server 42 (or source contents distributing network), such as, need to load file1.js, file2.js, file3.js file, then the file name of these three script files is sent to caching server 42 in the mode of listed files.
After caching server 42 receives listed files, determine the script file whether caching server 42 stored in this listed files, if stored, then the script file in listed files is merged into a new script file according to function logics relation each other, and this new script file is returned to the browser on terminal device 41.
If caching server 42 does not store the script file in this listed files, caching server 42 sends this listed files to web server 43, script file in listed files is resolved by web server 43, and the script file in listed files is merged into a new script file according to function logics relation each other, the script file return cache server 42 new by this, this new script file is sent to the browser of terminal device 41 by caching server 42 again; Or, script file in listed files directly can directly be returned to caching server 42 by web server 43, caching server 42 generates a new script file according to the function logics relation between the script file in listed files again, and this new script file is sent to the browser of terminal device 41.
The task that the browser of terminal device 41 stops one process performing, by loading this new script file.
In the present embodiment, by generating new script file and new script file being sent to browser, browser stops the task in fill order's process, and load new script file by one process, loading procedure due to whole script file does not make browser be in waiting process, and therefore disclosure embodiment can avoid the choking phenomenon that produces in the process of loading scripts file effectively.
Fig. 5 is the block diagram of the charger of script file according to an exemplary embodiment, and on the terminal device, as shown in Figure 5, the charger of script file can comprise in application:
First sending module 51, is configured to when browser needs loading scripts file, sends the listed files of script file to caching server, and notice browser is by the task in the mode fill order process of Asynchronous loading;
First receiver module 52, is configured to the new script file receiving the listed files generation that caching server sends according to the first sending module 51;
Load-on module 53, is configured to load by one process the new script file that the first receiver module 52 receives.
Fig. 6 is the block diagram of the charger of another kind of script file according to an exemplary embodiment, as shown in Figure 6, on above-mentioned basis embodiment illustrated in fig. 5, function logics relation in new script file can be determined by the function logics relation between the script file needing to load, and load-on module 53 can comprise:
Load submodule 531, the function logics relation be configured in the new script file received according to the first receiver module 52 loads new script file by one process.
Fig. 7 is the block diagram of the script file generating apparatus according to an exemplary embodiment, is applied on caching server, and as shown in Figure 7, the charger of script file comprises:
Second receiver module 71, is configured to the listed files receiving the script file that browser needs load;
Determination module 72, the listed files determination browser being configured to receive according to the second receiver module 71 needs the new script file loaded, and the function logics relation of new script file is consistent with the function logics relation of plural script file;
Second sending module 73, the new script file being configured to determination module 72 to determine sends to browser.
Fig. 8 is the block diagram of the another kind of script file generating apparatus according to an exemplary embodiment, and as shown in Figure 8, on above-mentioned basis embodiment illustrated in fig. 7, determination module 72 can comprise:
Detection sub-module 721, is configured to detect the script file whether caching server stored in listed files that the second receiver module 71 receives;
Generate submodule 722, if be configured to detection sub-module 721 to detect that caching server stores the script file in listed files, generate the new script file of browser needs loading according to listed files;
Obtain submodule 723, if be configured to detection sub-module 721 to detect that caching server does not store the script file in listed files, obtain new script file to web browser.
In one embodiment, obtain submodule 723 can comprise:
Send submodule 7231, be configured to send listed files to web server;
Receive submodule 7232, be configured to receive web server according to the new script file sending the listed files generation that submodule 7231 sends.
About the device in above-described embodiment, wherein the concrete mode of modules executable operations has been described in detail in about the embodiment of the method, will not elaborate explanation herein.
Fig. 9 is the block diagram that a kind of according to an exemplary embodiment is applicable to the device into portable set charging.Such as, device 900 can be mobile phone, computing machine, digital broadcast terminal, messaging devices, game console, tablet device, Medical Devices, body-building equipment, personal digital assistant etc.
With reference to Fig. 9, device 900 can comprise following one or more assembly: processing components 902, storer 904, power supply module 906, multimedia groupware 908, audio-frequency assembly 910, the interface 912 of I/O (I/O), sensor module 914, and communications component 916.
The integrated operation of the usual control device 900 of processing components 902, such as with display, call, data communication, camera operation and record operate the operation be associated.Treatment element 902 can comprise one or more processor 920 to perform instruction, to complete all or part of step of above-mentioned method.In addition, processing components 902 can comprise one or more module, and what be convenient between processing components 902 and other assemblies is mutual.Such as, processing element 902 can comprise multi-media module, mutual with what facilitate between multimedia groupware 908 and processing components 902.
Storer 904 is configured to store various types of data to be supported in the operation of equipment 900.The example of these data comprises for any application program of operation on device 900 or the instruction of method, contact data, telephone book data, message, picture, video etc.Storer 904 can be realized by the volatibility of any type or non-volatile memory device or their combination, as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), ROM (read-only memory) (ROM), magnetic store, flash memory, disk or CD.
The various assemblies that electric power assembly 906 is device 900 provide electric power.Electric power assembly 906 can comprise power-supply management system, one or more power supply, and other and the assembly generating, manage and distribute electric power for device 900 and be associated.
Multimedia groupware 908 is included in the screen providing an output interface between described device 900 and user.In certain embodiments, screen can comprise liquid crystal display (LCD) and touch panel (TP).If screen comprises touch panel, screen may be implemented as touch-screen, to receive the input signal from user.Touch panel comprises one or more touch sensor with the gesture on sensing touch, slip and touch panel.Described touch sensor can the border of not only sensing touch or sliding action, but also detects the duration relevant to described touch or slide and pressure.In certain embodiments, multimedia groupware 908 comprises a front-facing camera and/or post-positioned pick-up head.When equipment 900 is in operator scheme, during as screening-mode or video mode, front-facing camera and/or post-positioned pick-up head can receive outside multi-medium data.Each front-facing camera and post-positioned pick-up head can be fixing optical lens systems or have focal length and optical zoom ability.
Audio-frequency assembly 910 is configured to export and/or input audio signal.Such as, audio-frequency assembly 910 comprises a microphone (MIC), and when device 900 is in operator scheme, during as call model, logging mode and speech recognition mode, microphone is configured to receive external audio signal.The sound signal received can be stored in storer 904 further or be sent via communications component 916.In certain embodiments, audio-frequency assembly 910 also comprises a loudspeaker, for output audio signal.
I/O interface 912 is for providing interface between processing components 902 and peripheral interface module, and above-mentioned peripheral interface module can be keyboard, some striking wheel, button etc.These buttons can include but not limited to: home button, volume button, start button and locking press button.
Sensor module 914 comprises one or more sensor, for providing the state estimation of various aspects for device 900.Such as, sensor module 914 can detect the opening/closing state of equipment 900, the relative positioning of assembly, such as described assembly is display and the keypad of device 900, the position of all right pick-up unit 900 of sensor module 914 or device 900 1 assemblies changes, the presence or absence that user contacts with device 900, the temperature variation of device 900 orientation or acceleration/deceleration and device 900.Sensor module 914 can comprise proximity transducer, be configured to without any physical contact time detect near the existence of object.Sensor module 914 can also comprise optical sensor, as CMOS or ccd image sensor, for using in imaging applications.In certain embodiments, this sensor module 914 can also comprise acceleration transducer, gyro sensor, Magnetic Sensor, pressure transducer or temperature sensor.
Communications component 916 is configured to the communication being convenient to wired or wireless mode between device 900 and other equipment.Device 900 can access the wireless network based on communication standard, as WiFi, 2G or 3G, or their combination.In one exemplary embodiment, communication component 916 receives from the broadcast singal of external broadcasting management system or broadcast related information via broadcast channel.In one exemplary embodiment, described communication component 916 also comprises near-field communication (NFC) module, to promote junction service.Such as, can based on radio-frequency (RF) identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, device 900 can be realized, for performing said method by one or more application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD) (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components.
In the exemplary embodiment, additionally provide a kind of non-transitory computer-readable recording medium comprising instruction, such as, comprise the storer 904 of instruction, above-mentioned instruction can perform said method by the processor 920 of device 900.Such as, described non-transitory computer-readable recording medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc.
Figure 10 is a kind of block diagram being applicable to the device controlling the pilot lamp be arranged on smart machine according to an exemplary embodiment.Such as, device 1000 may be provided in a smart mobile phone or panel computer.With reference to Figure 10, device 1000 comprises processing components 1022, and it comprises one or more processor further, and the memory resource representated by storer 1032, can such as, by the instruction of the execution of processing element 1022, application program for storing.The application program stored in storer 1032 can comprise each module corresponding to one group of instruction one or more.In addition, processing components 1022 is configured to perform instruction, to perform the generation method of above-mentioned script file.
Device 1000 can also comprise the power management that a power supply module 1026 is configured to actuating unit 1000, and a wired or wireless network interface 1050 is configured to device 1000 to be connected to network, and input and output (I/O) interface 1058.Device 1000 can operate the operating system based on being stored in storer 1032, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
Those skilled in the art, at consideration instructions and after putting into practice disclosed herein disclosing, will easily expect other embodiment of the present disclosure.The application is intended to contain any modification of the present disclosure, purposes or adaptations, and these modification, purposes or adaptations are followed general principle of the present disclosure and comprised the undocumented common practise in the art of the disclosure or conventional techniques means.Instructions and embodiment are only regarded as exemplary, and true scope of the present disclosure and spirit are pointed out by claim below.
Should be understood that, the disclosure is not limited to precision architecture described above and illustrated in the accompanying drawings, and can carry out various amendment and change not departing from its scope.The scope of the present disclosure is only limited by appended claim.
Claims (12)
1. a loading method for script file, on the terminal device, it is characterized in that, described method comprises in application:
When browser needs loading scripts file, send the listed files of described script file to caching server, notify that described browser is by the task in the mode fill order process of Asynchronous loading;
Receive the new script file that described caching server generates according to described listed files;
Notify that described browser stops performing the task in described one process, load described new script file by described one process.
2. method according to claim 1, it is characterized in that, function logics relation in described new script file is determined by the function logics relation between the described script file needing to load, described by the described new script file of described one process loading, comprising:
Described new script file is loaded by described one process according to the function logics relation in described new script file.
3. a generation method for script file, is applied on caching server, it is characterized in that, described method comprises:
Receive the listed files that browser needs the script file loaded;
Determine that described browser needs the new script file loaded according to described listed files, the function logics relation of described new script file is consistent with the described function logics relation of the script file loaded that needs;
Described new script file is sent to described browser.
4. method according to claim 3, is characterized in that, the described new script file determining the loading of described browser needs according to described listed files, comprising:
Detect the script file whether described caching server stored in described listed files;
If described caching server stores the script file in described listed files, generate the new script file of described browser needs loading according to described listed files;
If described caching server does not store the script file in described listed files, obtain described new script file to web browser.
5. method according to claim 4, is characterized in that, described to the described new script file of web browser acquisition, comprising:
Described listed files is sent to described web server;
Receive the described new script file that described web server generates according to described listed files.
6. a charger for script file, on the terminal device, it is characterized in that, described device comprises in application:
First sending module, is configured to, when described browser needs loading scripts file, send the listed files of described script file to caching server, notifies that described browser is by the task in the mode fill order process of Asynchronous loading;
First receiver module, is configured to the new script file receiving the described listed files generation that described caching server sends according to described first sending module;
Load-on module, is configured to notify that described browser stops performing the task in described one process, the described new script file received by described first receiver module of described one process loading.
7. device according to claim 6, is characterized in that, the function logics relation in described new script file is determined by the function logics relation between the described script file needing to load, and described load-on module comprises:
Load submodule, the function logics relation be configured in the described new script file received according to described first receiver module loads described new script file by described one process.
8. a generating apparatus for script file, is applied on caching server, it is characterized in that, described device comprises:
Second receiver module, is configured to the listed files receiving the script file that browser needs load;
Determination module, the described listed files being configured to receive according to described second receiver module determines that described browser needs the new script file loaded, and the function logics relation of described new script file is consistent with the function logics relation of described plural script file;
Second sending module, the described new script file being configured to described determination module to determine sends to described browser.
9. device according to claim 8, is characterized in that, described determination module comprises:
Detection sub-module, is configured to detect the script file whether described caching server stored in described listed files that described second receiver module receives;
Generate submodule, if be configured to described detection sub-module to detect that described caching server stores the script file in described listed files, generate the new script file of described browser needs loading according to described listed files;
Obtain submodule, if be configured to described detection sub-module to detect that described caching server does not store the script file in described listed files, obtain described new script file to web browser.
10. device according to claim 9, is characterized in that, described acquisition submodule comprises:
Send submodule, be configured to send described listed files to described web server;
Receive submodule, be configured to the described new script file receiving the described listed files generation that described web server sends according to described transmission submodule.
The charger of 11. 1 kinds of script files, is characterized in that, described device comprises:
Processor;
For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
When browser needs loading scripts file, send the listed files of described script file to caching server, notify that described browser is by the task in the mode fill order process of Asynchronous loading;
Receive the new script file that described caching server generates according to described listed files;
Notify that described browser stops performing the task in described one process, load described new script file by described one process.
The generating apparatus of 12. 1 kinds of script files, is characterized in that, described device comprises:
Processor;
For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
Receive the listed files that browser needs the script file loaded;
Determine that described browser needs the new script file loaded according to described listed files, the function logics relation of described new script file is consistent with the function logics relation of described plural script file;
Described new script file is sent to described browser.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510080503.9A CN104572230B (en) | 2015-02-13 | 2015-02-13 | Script file loading method and device and script file generating method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510080503.9A CN104572230B (en) | 2015-02-13 | 2015-02-13 | Script file loading method and device and script file generating method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104572230A true CN104572230A (en) | 2015-04-29 |
CN104572230B CN104572230B (en) | 2020-02-07 |
Family
ID=53088388
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510080503.9A Active CN104572230B (en) | 2015-02-13 | 2015-02-13 | Script file loading method and device and script file generating method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104572230B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106055367A (en) * | 2016-06-01 | 2016-10-26 | 腾讯科技(深圳)有限公司 | Script file loading method and device |
CN107623729A (en) * | 2017-09-08 | 2018-01-23 | 华为技术有限公司 | A kind of caching method, equipment and cache service system |
CN107844500A (en) * | 2016-09-20 | 2018-03-27 | 天脉聚源(北京)科技有限公司 | A kind of method and system of mobile terminal loading webpage |
CN110209973A (en) * | 2019-05-24 | 2019-09-06 | 厦门美柚信息科技有限公司 | A kind of web game loading method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080271046A1 (en) * | 2007-04-27 | 2008-10-30 | Microsoft Corporation | Dynamically loading scripts |
CN103020226A (en) * | 2012-12-12 | 2013-04-03 | 北京百度网讯科技有限公司 | Method and device for acquiring search result |
CN103269377A (en) * | 2013-05-31 | 2013-08-28 | 北京奇虎科技有限公司 | Script file processing method, server, client and system |
CN103530152A (en) * | 2013-10-10 | 2014-01-22 | 小米科技有限责任公司 | Method, device and terminal device for loading client-side scripts |
-
2015
- 2015-02-13 CN CN201510080503.9A patent/CN104572230B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080271046A1 (en) * | 2007-04-27 | 2008-10-30 | Microsoft Corporation | Dynamically loading scripts |
CN103020226A (en) * | 2012-12-12 | 2013-04-03 | 北京百度网讯科技有限公司 | Method and device for acquiring search result |
CN103269377A (en) * | 2013-05-31 | 2013-08-28 | 北京奇虎科技有限公司 | Script file processing method, server, client and system |
CN103530152A (en) * | 2013-10-10 | 2014-01-22 | 小米科技有限责任公司 | Method, device and terminal device for loading client-side scripts |
Non-Patent Citations (1)
Title |
---|
ALEXGAOYH: "《博客:https://my.oschina.net/alexgaoyh/blog/225000》", 22 April 2014 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106055367A (en) * | 2016-06-01 | 2016-10-26 | 腾讯科技(深圳)有限公司 | Script file loading method and device |
CN107844500A (en) * | 2016-09-20 | 2018-03-27 | 天脉聚源(北京)科技有限公司 | A kind of method and system of mobile terminal loading webpage |
CN107623729A (en) * | 2017-09-08 | 2018-01-23 | 华为技术有限公司 | A kind of caching method, equipment and cache service system |
CN110209973A (en) * | 2019-05-24 | 2019-09-06 | 厦门美柚信息科技有限公司 | A kind of web game loading method and device |
CN110209973B (en) * | 2019-05-24 | 2021-03-19 | 厦门美柚股份有限公司 | Webpage game loading method and device |
Also Published As
Publication number | Publication date |
---|---|
CN104572230B (en) | 2020-02-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104853136A (en) | Video communication method and device | |
CN105159672A (en) | Remote assistance method and client | |
CN104793846A (en) | Displaying method and device for interface of application program | |
CN104618511A (en) | Intelligent device detection method and device | |
CN106033397B (en) | Memory buffer area adjusting method, device and terminal | |
CN104766005A (en) | Management method and device for application software access authority | |
CN105491048A (en) | Account management method and apparatus | |
CN105120337A (en) | Video special effect processing method, video special effect processing device and terminal equipment | |
CN105204804A (en) | Mode switching method, device and system | |
JP2017530489A (en) | Terminal test method, apparatus, program, and recording medium | |
CN107393528B (en) | Voice control method and device | |
CN105354017A (en) | Information processing method and apparatus | |
CN103916468A (en) | System upgrading method, terminal, server and upgrading system | |
CN105430715A (en) | Method and apparatus for controlling WIFI scanning | |
CN105138564A (en) | Data file reading method and apparatus | |
CN105488145A (en) | Webpage content display method and apparatus and terminal | |
CN104536787A (en) | Resource preloading method and device | |
CN104951184A (en) | Application program downloading method and device | |
CN105872573A (en) | Video playing method and apparatus | |
CN104572230A (en) | Script file loading method, script file generating method and script file generating device | |
CN104111829A (en) | Data storage method and device | |
KR102258742B1 (en) | Touch signal processing method, apparatus and medium | |
CN105468417A (en) | Application software installation method and device | |
CN104881342A (en) | Terminal testing method and device | |
CN104636064A (en) | Gesture generating method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |