[detailed description of the invention]
For making the purpose of the embodiment of the present application, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present application, technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment is some embodiments of the present application, rather than whole embodiments。Based on the embodiment in the application, the every other embodiment that those of ordinary skill in the art obtain under not making creative work premise, broadly fall into the scope of the application protection。
The schematic flow sheet of the Graphics and Image Processing that Fig. 1 provides for the application one embodiment。As it is shown in figure 1, the method includes:
101, browser obtain user send for indicating the interactive command carrying out graph and image processing。
102, above-mentioned interactive command is sent to server by browser, to indicate server carry out graph and image processing and return the graph image that graph and image processing generates。
103, browser receives the graph image that server returns。
104, the above-mentioned graph image of browser display。
The present embodiment provides a kind of Graphics and Image Processing, can be performed by browser。The browser of the present embodiment has the function mutual with user, for instance it is mutual that browser can pass through that the interactive command system that carries realizes with user。Based on the function mutual with user, browser can obtain that user sends for indicating the interactive command carrying out graph and image processing。It addition, the browser of the present embodiment also has the function with server interaction, and based on this function, it is achieved with the communication of server。
What deserves to be explained is, the graph and image processing that the present embodiment relates to can be generate the process of new graph image, it is also possible to is the process of amendment existing graphics image。The process of amendment existing graphics image can be the various process such as the color of parts of images, shape, scaling in amendment existing graphics image。
Concrete, when user is desired with graph and image processing, it is possible to send interactive command to browser, this interactive command carries out graph and image processing for instruction。Browser obtains the interactive command that user sends。
Such as, user can pass through various external equipments to the incoming interactive command of browser。Such as, user specifically can send interactive command by modes such as click, right click, slips to browser。Again such as, browser can provide a user with an input frame, then user can input interactive command by keyboard to browser。
In the present embodiment, this interactive command is sent to server after getting the interactive command that the instruction that user sends carries out graph and image processing by browser, to indicate server carry out graph and image processing and return the graph image that graph and image processing generates。
For server, receive the interactive command that browser sends, determine the parameter carried out needed for graph and image processing according to this interactive command。In the present embodiment, the parameter carried out needed for graph and image processing is may determine that by interactive command。
Optionally, the interactive command that user sends can carry the various parameters carried out needed for graph and image processing, for instance may include that instruction carries out the first parameter of which kind of process and carries out the second parameter that the process indicated by the first parameter is required。Such as, the first parameter may indicate that draws new graph image, the second parameter may include that graph image draw position, the size of graph image, graphing image needed for data or desired data location index, draw color of using etc.。Again such as, the first parameter may indicate that amendment existing graphics image, and the second parameter may include that the mark of existing graphics image, modifier area, amended color and shape etc.。
Based on this optional embodiment, server directly can obtain the parameter carried out needed for graph and image processing from interactive command。
Optionally, the interactive command that user sends is corresponding with the various parameters carried out needed for graph and image processing。For example, it is possible to preset the parameter carried out needed for various graph and image processing, and it is set for the interactive command needed for various graph and image processing, the parameter needed for every kind of graph and image processing is formed corresponding relation with interactive command。
Based on this optional embodiment, server according to the corresponding relation between default interactive command and parameter, can obtain the parameter corresponding with the interactive command that user sends as the parameter carried out needed for graph and image processing。
Server is determined according to interactive command after the parameter carried out needed for graph and image processing, carries out graph and image processing according to these parameters, generates graph image, and the graph image of generation is returned to browser
Browser receives the graph image of server return and displays, realize the interactive graphic images system based on browser, give full play to the advantage of graphic image system that can be mutual, such as user can pass through the content sending commands to change the graph image shown by browser, or browser can also adopt the value and trend that show data of fluctuating of line segment, etc.。
In the present embodiment, browser can be mutual with user, obtain user send for indicating the interactive command carrying out graph and image processing, and by interactive command is sent to server, instruction server carries out graph and image processing and returns the graph image that graph and image processing generates, and then the graph image that display server returns, achieve the interactive graphic images system based on browser, owing to graph and image processing is completed by server, so whether do not supported the restriction of programmable graphics technology by browser, be conducive to giving full play to the advantage of graphic image system that can be mutual。
The schematic flow sheet of the Graphics and Image Processing that Fig. 2 provides for another embodiment of the application。As in figure 2 it is shown, the method includes:
201, browser obtain user send for indicating the interactive command carrying out graph and image processing。
202, browser judges self whether have the ability by being programmatically-generated graph image;If it is judged that be no, perform step 203;If it is judged that be yes, perform step 205。
203, above-mentioned interactive command is sent to server by browser, to indicate server carry out graph and image processing and return the graph image that graph and image processing generates, and performs step 204。
204, browser receives the graph image that server returns, and performs step 206。
205, browser carries out graph and image processing according to above-mentioned interactive command, to generate graph image, and performs step 206。
206, browser display graph image。
Optionally, browser specifically can judge self whether have the ability by being programmatically-generated graph image in the following ways:
Browser execution detection code, to detect whether browser provides graph image generation interface;
If detecting, graph image generates interface, it is determined that browser has the ability by being programmatically-generated graph image;
If being not detected by graph image to generate interface, it is determined that browser does not have the ability by being programmatically-generated graph image。
Above-mentioned detection code can use programming language JavaScript to write。
Consider that browser can use canvas technology or svg technology to generate graph image, then above-mentioned detection code can be used for detecting whether browser supports canvas technology or svg technology, specifically, it is used for detecting whether browser provides canvas technology graph of a correspondence image generation interface or svg technology graph of a correspondence image generation interface。
It is, for example possible to use one section of JavaScript code judges, whether browser has canvas technology graph of a correspondence image generates interface。The implementation of a kind of JavaScript code is as follows:
Varcanvas=document.createElement (' canvas ');
After running above-mentioned JavaScript code, if canvas is equal to undefined (undefined), it is determined that browser does not possess canvas technology graph of a correspondence image and generates interface (namely not supporting canvas technology)。
In like manner, it is possible to use one section of JavaScript code judges whether browser has svg technology graph of a correspondence image and generate interface。The implementation of a kind of JavaScript code is as follows:
Varsvg=document.createElement (' svg ');
After running above-mentioned JavaScript code, if svg is equal to undefined (undefined), it is determined that browser does not possess svg technology graph of a correspondence image and generates interface。
What deserves to be explained is, if browser possesses one of both the above technology graph of a correspondence image and generates interface, then browser possesses the ability by being programmatically-generated graph image;When only not possessing any of the above technology graph of a correspondence image generation interface, browser does not just possess the ability by being programmatically-generated graph image。
The method that the method that the present embodiment provides provides with embodiment illustrated in fig. 1 is similar, it is distinctive in that: in the present embodiment, browser needs to judge self whether have the ability by being programmatically-generated graph image, when browser does not have the ability by being programmatically-generated graph image, carry out graph and image processing to generate graph image by server;When browser has the ability by being programmatically-generated graph image, browser oneself carries out graph and image processing to generate graph image。Part similar with embodiment illustrated in fig. 1 in the present embodiment repeats no more, can referring to the description of Fig. 1。
In the present embodiment, browser is by judging whether the ability having by being programmatically-generated graph image, and when having the ability by being programmatically-generated graph image, browser oneself carries out graph and image processing to generate graph image, while ensureing to realize interactive graphic images system, it is possible to alleviate the processing load of server。
The another embodiment of the application provides a kind of server according to interactive command, carries out the graph and image processing method to generate graph image, and this embodiment can realize based on the embodiment shown in above-mentioned Fig. 1 and Fig. 2。Concrete, server according to interactive command, can run the Graphics Programming code adopting browser graphic image technique to realize, to carry out graph and image processing and to generate graph image。In simple terms, the server of the application can support the graphics technology that browser is supported, therefore can adopt same set of Graphics Programming code with browser。Based on this, developer only need to write a set of Graphics Programming code, it is possible to improves development efficiency。Optionally, it is possible in advance this Graphics Programming code is deployed on browser and server respectively, in order to browser and server uses。Wherein, developer can use programming language, for instance JavaScript controls the graph image of browser and generates interface to generate graph image。And the code that these graph images controlling browser generate interface generation graph image is referred to as Graphics Programming code。
For example, it is contemplated that can realize most graph image systematic functions of browser to node-webkit technology, therefore the Graphics Programming code of the application can adopt node-webkit technology to realize。Such server can realize based on nodejs platform。
What deserves to be explained is, the method that the application provides is applicable to various browsers, whether is not supported the restriction of programmable graphics technology by browser, for instance can be used for the browsers such as ie6, ie7, ie8。
It should be noted that, for aforesaid each embodiment of the method, in order to be briefly described, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the application is not by the restriction of described sequence of movement, because according to the application, some step can adopt other orders or carry out simultaneously。Secondly, those skilled in the art also should know, embodiment described in this description belongs to preferred embodiment, necessary to involved action and module not necessarily the application。
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, certain embodiment there is no the part described in detail, it is possible to referring to the associated description of other embodiments。
The structural representation of the browser that Fig. 3 provides for the application one embodiment。As it is shown on figure 3, this browser includes: acquisition module 31, sending module 32, receiver module 33 and display module 34。
Acquisition module 31, for obtain that user sends for indicating the interactive command carrying out graph and image processing。
Sending module 32, is connected with acquisition module 31, for the interactive command that acquisition module 31 obtains is sent to server, to indicate server carry out graph and image processing and return the graph image that graph and image processing generates。
Receiver module 33, for receiving the graph image that server sends。
Display module 34, is connected with receiver module 33, for showing the graph image that receiver module 33 receives。
Further, as shown in Figure 4, this browser also includes: detection module 35, it is connected with sending module 32, before interactive command being sent to server at sending module 32, whether detection browser self has the ability by being programmatically-generated graph image, and when detecting that browser does not have the ability by being programmatically-generated graph image, trigger sending module 32 to perform interactive command is sent to server, to indicate server carry out graph and image processing and return the operation of the graph image that graph and image processing generates。
In an optional embodiment, detection module 35 is particularly used in:
Run detection code, to detect whether browser possesses graph image generation interface;
If detecting, graph image generates interface, it is determined that browser has the ability by being programmatically-generated graph image;
If being not detected by graph image to generate interface, it is determined that browser does not have the ability by being programmatically-generated graph image。
The browser that the present embodiment provides, can be mutual with user, obtain user send for indicating the interactive command carrying out graph and image processing, and by interactive command is sent to server, instruction server carries out graph and image processing and returns the graph image that graph and image processing generates, and then the graph image that display server returns, achieve the interactive graphic images system based on browser, owing to graph and image processing is completed by server, so whether do not supported the restriction of programmable graphics technology by browser, be conducive to giving full play to the advantage of graphic image system that can be mutual。
The structural representation of the server that Fig. 5 provides for the application one embodiment。As it is shown in figure 5, this server includes: receiver module 51, graph and image processing module 52 and sending module 53。
Receiver module 51, for receive browser send for indicating the interactive command carrying out graph and image processing, this interactive command is that user sends。
Graph and image processing module 52, is connected with receiver module 51, carries out graph and image processing for the interactive command received according to receiver module 51, to generate graph image。
Sending module 53, is connected with graph and image processing module 52, for the graph image that graph and image processing module 52 generates is sent to browser, for browser display graph image。
In an optional embodiment, graph and image processing module 52 is particularly used in: the interactive command received according to receiver module 51, runs the Graphics Programming code adopting browser graphic image technique to realize, to carry out graph and image processing and to generate graph image。
The server that the present embodiment provides, the browser provided with above-described embodiment matches, graph and image processing is carried out according to the interactive command that browser sends, and the graph image of generation is sent to browser, making browser realize interactively graphic image system, the advantage for giving full play to graphic image system that can be mutual provides condition。
Those skilled in the art is it can be understood that arrive, for convenience and simplicity of description, the system of foregoing description, the specific works process of device and unit, it is possible to reference to the corresponding process in preceding method embodiment, do not repeat them here。
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method, it is possible to realize by another way。Such as, device embodiment described above is merely schematic, such as, the division of described unit, being only a kind of logic function to divide, actual can have other dividing mode when realizing, for instance multiple unit or assembly can in conjunction with or be desirably integrated into another system, or some features can ignore, or do not perform。Another point, shown or discussed coupling each other or direct-coupling or communication connection can be through INDIRECT COUPLING or the communication connection of some interfaces, device or unit, it is possible to be electrical, machinery or other form。
The described unit illustrated as separating component can be or may not be physically separate, and the parts shown as unit can be or may not be physical location, namely may be located at a place, or can also be distributed on multiple NE。Some or all of unit therein can be selected according to the actual needs to realize the purpose of the present embodiment scheme。
It addition, each functional unit in each embodiment of the application can be integrated in a processing unit, it is also possible to be that unit is individually physically present, it is also possible to two or more unit are integrated in a unit。Above-mentioned integrated unit both can adopt the form of hardware to realize, it would however also be possible to employ hardware adds the form of SFU software functional unit and realizes。
The above-mentioned integrated unit realized with the form of SFU software functional unit, it is possible to be stored in a computer read/write memory medium。Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions with so that a computer equipment (can be personal computer, server, or the network equipment etc.) or processor (processor) perform the part steps of method described in each embodiment of the application。And aforesaid storage medium includes: USB flash disk, portable hard drive, read only memory (Read-OnlyMemory, ROM), the various media that can store program code such as random access memory (RandomAccessMemory, RAM), magnetic disc or CD。
Last it is noted that above example is only in order to illustrate the technical scheme of the application, it is not intended to limit;Although with reference to previous embodiment to present application has been detailed description, it will be understood by those within the art that: the technical scheme described in foregoing embodiments still can be modified by it, or wherein portion of techniques feature is carried out equivalent replacement;And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of each embodiment technical scheme of the application。