Summary of the invention
The objective of the invention is to propose a kind of network browser system and control method, can be by the mode of compile script instruction, the running of control operation web browser realizes the intellectuality control of web browser.
For reaching this purpose, the present invention by the following technical solutions:
A kind of network browser system, comprise browser kernel bottom operation module, also comprise intelligent instruction control module, described intelligent instruction control module is used to encapsulate described browser kernel bottom operation module, call described browser kernel bottom operation module by script, and carrying out information interaction, described intelligent instruction control module further comprises bottom encapsulation submodule, user interface module, script compile explanation submodule, intelligence instruction master control submodule and instruction group implementation sub-module
Described bottom encapsulation submodule explains that with described user interface module, script compile submodule, intelligence instruction master control submodule are connected with instruction group implementation sub-module respectively, be used to encapsulate described browser kernel bottom operation module, convert directive script to described browser kernel bottom operation module discernible form, call described browser kernel bottom operation module;
Described user interface module, script compile explain that submodule, intelligence instruction master control submodule are connected successively with instruction group implementation sub-module,
Described user interface module is used to receive operational order;
Described script compile explains that submodule is used for the mode by compiling or explanation, will convert the internal control order to from the script that described user interface module receives, and sends to described intelligence instruction master control submodule;
Described intelligence instruction master control submodule is used for explaining the internal control order that submodule is sent according to described script compile, calls corresponding instruction group implementation sub-module;
Described instruction group implementation sub-module is used to call described browser kernel bottom operation module.
Described instruction group implementation sub-module further comprises network bottom layer instruction group submodule, network browsing instruction group submodule, webpage source code processing instruction group submodule, character string instruction group submodule, file instruction group submodule, operational order group submodule, system directive group submodule and extended instruction group submodule, wherein
Described network bottom layer instruction group submodule adopts the HTTP underlying protocol, is used to download webpage, sends data to Website server;
Described network browsing instruction group submodule is used to control web page browsing;
Described webpage source code processing instruction group submodule is used to extract web page interlinkage, text, calls described system bottom package module, and webpage source code document object is converted to corresponding script variable;
Described character string instruction group submodule is used for that processing character polyphone connects, comparison operation;
Described file instruction group submodule is used to read and write the local file data;
Described operational order group submodule is used to handle mathematical operation;
Described system directive group submodule is used for module invokes and variable is handled;
Described extended instruction group submodule is used for supporting to call this machine of third party program, data and file.
Also comprise browser client input-output operation interface module, described browser client input-output operation interface module one end is connected with described user interface module, the other end is connected with described browser kernel bottom operation module, described user interface module sends to described browser client input-output operation interface module with the keyboard and mouse order in the operational order that receives, and described browser client input-output operation interface module is called described browser kernel bottom operation module; Described user interface module sends to described script compile with the directive script in the operational order that receives and explains submodule.
Also comprise browser client input-output operation interface module, described browser client input-output operation interface module is connected with described browser kernel bottom operation module with described user interface module respectively, and described browser client input-output operation interface module is with the operation of the described browser kernel of the keyboard and mouse command calls bottom in the operational order that receives module; Described browser client input-output operation interface module sends to described user interface module with the directive script in the operational order that receives, and described user interface module sends to described script compile and explains submodule.
Described browser kernel bottom operation module further comprises browser cell and web document object.A kind of control method of web browser, intelligent instruction control module encapsulates browser kernel bottom operation module, calls described browser kernel bottom operation module by script, and carries out information interaction, further may further comprise the steps:
The user interface module receives operational order;
Script compile is explained the mode of submodule by compiling or explanation, will convert the internal control order to from the script that the user interface module receives, and sends to intelligence instruction master control submodule;
Intelligence instruction master control submodule is explained the internal control order that submodule is sent according to script compile, calls corresponding instruction group implementation sub-module;
Instruction group implementation sub-module calls browser kernel bottom operation module;
Bottom encapsulation submodule encapsulation browser kernel bottom operation module converts directive script to browser kernel bottom operation module discernible form, calls browser kernel bottom operation module.
Further, the user interface module receives operational order;
The user interface module sends to browser client input-output operation interface module with the keyboard and mouse order in the operational order that receives, and browser client input-output operation interface module is called browser kernel bottom operation module;
The user interface module sends to described script compile with the directive script in the operational order that receives and explains submodule.
Perhaps further, browser client input-output operation interface module receives operational order;
Browser client input-output operation interface module is with the operation of the keyboard and mouse command calls browser kernel bottom in the operational order that receives module;
Browser client input-output operation interface module sends to the user interface module with the directive script in the operational order that receives, and the user interface module sends to script compile again and explains submodule.
Adopted technical scheme of the present invention, increased the programmable intelligent instruction control module of a cover at web browser, the user is by the compile script program, can be full-automatic or semi-automatic, analog manual operation's mode, thus the Based Intelligent Control function of realization browser improves man-machine work efficiency; Provide a cover complete, order set independently, need not to revise former webpage html code; Not limited by the html grammer, the operational efficiency height can or call this machine of third party program by internal module, finishes computings such as high-intensity picture recognition, semantic analysis; Variable displacement list assignment directive is considered as the record data form of a similar pascal with list, and the record variable that field is considered as writing down is simple and clear; Adopt the open API interface, can call the third party application (as the exe program under the windows) of standard arbitrarily, expand; Can be designed to independently programmable networks browser, also can adopt augmented patterns such as plug-in unit, be integrated in the middle of the existing network browser.
Embodiment
Further specify technical scheme of the present invention below in conjunction with accompanying drawing and by embodiment.
Fig. 1 is the structural representation of network browser system in the specific embodiment of the invention.As shown in Figure 1, this system comprises the operation of browser kernel bottom module 101, intelligent instruction control module 102 and browser client input-output operation interface module 103.
The intelligence instruction control module can encapsulate browser kernel bottom operation module, calls browser kernel bottom operation module by script, and carries out information interaction.
The intelligence instruction control module further comprises bottom encapsulation submodule 205, user interface module 201, script compile explanation submodule 202, intelligence instruction master control submodule 203 and instruction group implementation sub-module 204.
Bottom encapsulation submodule explains that with user interface module, script compile submodule, intelligence instruction master control submodule are connected with instruction group implementation sub-module respectively, encapsulation browser kernel bottom operation module, convert directive script to browser kernel bottom operation module discernible form, call browser kernel bottom operation module.
User interface module, script compile explain that submodule, intelligence instruction master control submodule are connected successively with instruction group implementation sub-module, and the user interface module receives operational order; Script compile is explained the mode of submodule by compiling or explanation, will convert the internal control order to from the script that the user interface module receives, and sends to intelligence instruction master control submodule; Intelligence instruction master control submodule is used for explaining the internal control order that submodule is sent according to script compile, calls corresponding instruction group implementation sub-module; Instruction group implementation sub-module is used to call browser kernel bottom operation module.
Wherein instruction group implementation sub-module further comprises network bottom layer instruction group submodule, network browsing instruction group submodule, webpage source code processing instruction group submodule, character string instruction group submodule, file instruction group submodule, operational order group submodule, system directive group submodule and extended instruction group submodule, network bottom layer instruction group submodule adopts the HTTP underlying protocol, is used to download webpage, sends data to Website server; Network browsing instruction group submodule is used to control web page browsing; Webpage source code processing instruction group submodule is used to extract web page interlinkage, text, and calling system bottom package module is converted to corresponding script variable with webpage source code document object; Character string instruction group submodule is used for that processing character polyphone connects, comparison operation; File instruction group submodule is used to read and write the local file data; Operational order group submodule is used to handle mathematical operation; System directive group submodule is used for module invokes and variable is handled; Extended instruction group submodule is used for supporting to call this machine of third party program, data and file.
Browser kernel bottom operation module further comprises browser cell and web document object.
Browser client input-output operation interface module and intelligent instruction control module have two kinds of array modes.
First kind is that browser client input-output operation interface module one end is connected with the user interface module, and the other end is connected with browser kernel bottom operation module.The user interface module can all or part of alternative browser client input-output operation interface module, and according to the different operating instruction of user's issue, calls relevant interface module respectively.
If user's issue is common keyboard, mouse command, the user interface module is directly called browser client input-output operation interface module, and browser client input-output operation interface module is called browser kernel bottom operation module again.
If shell script or directive script, the user interface module sends to script compile with the directive script in the operational order that receives and explains submodule, resolves and move relevant directive script.
Second kind is that browser client input-output operation interface module is connected with browser kernel bottom operation module with the user interface module respectively.
This mode is to adopt the plug-in unit pattern, expands on original browser basis, to realize the function of intelligent explorer.Under this pattern, browser client input-output operation interface module control can have precedence over the user interface module.
Browser client input-output operation interface module receives user's operational order, if user's issue is common keyboard, mouse command, browser client input-output operation interface module is directly called browser kernel bottom operation module.
If shell script or directive script, browser client input-output operation interface module elder generation invoke user operation interface module, the user interface module sends to script compile with the directive script in the operational order that receives and explains submodule, resolves and move relevant directive script.
Fig. 2 is the process flow diagram of web browser control in the specific embodiment of the invention.As shown in Figure 2, this flow process may further comprise the steps:
Step 301, user interface module receive operational order.It should be directive script or the shell script that the user issues that the user interface module receives operational order, and dual mode is arranged, and a kind of is the operational order that directly receives user's input, and wherein directive script or shell script received; Another kind is directive script or the shell script from the operational order of browser client input-output operation interface module reception user input.
Step 302, script compile are explained the mode of submodule by compiling or explanation, will convert the internal control order to from the script that the user interface module receives, and send to intelligence instruction master control submodule.
Existing browser plug-in is all by adopting html statement inserted mode.
Adopt html statement inserted mode except that needs are understood webpage html source code dom document object complex inner structure, also need to keep compatible with former webpage intrinsic function html grammer, actual code is loaded down with trivial details, complicated, and limited by the html grammer, can't realize complicated function, as this machine of calling program is handled, ocr image recognition, semantic analysis high strength arithmograph picture, is called this machine data storehouse etc. to webpage html source code.
This embodiment is by to browser increase independently script compile and explanation module, and function such as finish that browser control, web form object are filled in simultaneously, by system directive, also can directly be called this machine program, carries out various complex calculations and handles.
Adopt html statement inserted mode, for the processing of a plurality of different web pages or website, ability a little less than.
This embodiment adopts independent script pattern, can handle different webpages and website continuously, automatically, supports that mass calls different scripts, and each website is handled; At browser and webpage html source code dom object, carry out height optimization specially, can improve development efficiency greatly.
In addition, the user also expands existing computerese, as: c, java, python, vb, as the script of zBrow control system.
Step 303, intelligence instruction master control submodule are explained the internal control order that submodule is sent according to script compile, call corresponding instruction group implementation sub-module, and instruction group implementation sub-module calls browser kernel bottom operation module.
This machine of third party program and data, file are called in support, the user can be by built-in instruction or outside third party's program, carry out high strength calculation process such as ocr image recognition, semantic analysis, database, each extendible unit (as menu, button, skin) of control browser.
Instruction group implementation sub-module comprises with the implementation sub-module that gives an order in this embodiment:
Network bottom layer instruction group submodule: adopt the http underlying protocol, directly download the html webpage, adopt post, get pattern, send data to Website server, because http belongs to the network bottom layer agreement, need not download pictures, display web page, speed is fast.
Network browsing instruction group submodule: the simulation manual type, the network address of control browser access appointment is filled in the relevant field of web form from inside, even simulation is clicked relevant webpage button, preserved webpage capture etc.Webwl browsing instructions group adopts analog form, can height emulated artificial mode browsing page, can control the webpage of Rich Media's types such as webpage, especially flash that some http instruction groups can't handle.
Webpage source code processing instruction group submodule: extract web page interlinkage, text calls zCore system bottom encapsulation submodule, with webpage html source code dom document object, is converted to relevant script variable.
Character string instruction group submodule: the processing character polyphone connects, relatively waits computing.
File instruction group submodule: read-write local file data.
Operational order group submodule: handle relevant mathematical operation instruction.
System directive group submodule: system directives such as module invokes, variable processing.
Extended instruction group submodule: support to call this machine of third party program and data, file, the user can be by built-in instruction or outside third party's program, carry out high strength calculation process such as ocr image recognition, semantic analysis, database, each extendible unit (as menu, button, skin) of control browser.
Step 304, bottom encapsulation submodule encapsulation browser kernel bottom operation module convert directive script to browser kernel bottom operation module discernible form, call browser kernel bottom operation module.
Bottom encapsulation submodule for associative mode provides basic-level support, with script and relevant steering order, is converted to the discernible form of browser and webpage in whole flow process, and sends, calls relevant browser, webpage dom object interface.
Bottom encapsulation submodule encapsulates each extendible unit (as menu, button, skin), the webpage html source code dom document object of browser.
Variable displacement form list assignment directive is adopted in webpage form form object encapsulation, and list is considered as record (record) data layout of a similar pascal, and the record variable that field is considered as writing down is simple and clear.List is the most important human-computer conversational mode of html webpage, and conventional web form object assignment must adopt tediously long field, and for example to the form fields assignment, list is by name: login, field is by name: user)
Traditional mode statement: web.Document.forms.items (login) .user.value=xxx
Statement: $_login.user=xxx in this embodiment
By encapsulation to list form object, the user can pass through variable assignments or directive script mode, easily realizes original complicated list control function, as: fill in field, select drop-down menu, fill in the text message, even analog mouse is clicked the central associated button of list.
As everyone knows, browser and webpage html source code dom object are two covers different and huge, complicated frameworks fully, and inner control mode is different fully.
By with each extendible unit of browser program, as menu, button, skin etc., and webpage html source code dom object, carry out overall package in the script level, the user can need not to understand browser and webpage html source code dom document object complex inner structure, at unified script platform, adopt unified built-in instruction functions, script variable, directly call, related object in the middle of control browser and the webpage, reduce development difficulty greatly, whole shell script is more succinct simultaneously, each functional module structure of script is more clear, is convenient to exploitation and maintenance.
Existing browser plug-in all adopts the mode of adding statement in the middle of webpage html source code, realizes correlation function.
Though this embodiment is also supported html statement inserted mode, usually, the user only needs to need not to change any webpage html source code by directly calling built-in instruction functions, can finish corresponding function.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with the people of this technology in the disclosed technical scope of the present invention; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.