Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiments of the invention are described in detail.
Describe embodiments of the invention below in detail, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has the element of identical or similar functions from start to finish.Below by the embodiment being described with reference to the drawings, be exemplary, only for explaining the present invention, and can not be interpreted as limitation of the present invention.
Disclosing below provides many different embodiment or example to be used for realizing different structure of the present invention.Of the present invention open in order to simplify, hereinafter the parts to specific examples and setting are described.Certainly, they are only example, and object does not lie in restriction the present invention.In addition, the present invention can be in different examples repeat reference numerals and/or letter.This repetition is in order to simplify and object clearly, itself do not indicate the relation between discussed various embodiment and/or setting.It should be noted that illustrated parts are not necessarily drawn in proportion in the accompanying drawings.The present invention has omitted the description of known assemblies and treatment technology and technique to avoid unnecessarily limiting the present invention.
As shown in Figure 1, Fig. 1 is according to the schematic flow sheet of an embodiment of the high-speed synchronous method between a kind of PC provided by the invention and mobile terminal, comprise step S101 ~ S103, below in conjunction with specific embodiment, the method shown in Fig. 1 is described.
Step S101, to the picture to be transmitted in mobile terminal with transmit picture and contrast, obtain difference pixel.Method of the present invention is applicable to picture, the transfer of data between various mobile terminals and PC.Mobile terminal has little, the portable feature of volume, can make like this its display screen and processing unit ability all be less than PC.In order to carry out high-efficient automatic test to mobile terminal, just need to be by mobile terminal and PC UNICOM, use the high-performance of PC to carry out synchronous manipulation to mobile terminal, to realize the automatic test to mobile terminal.Described mobile terminal includes but not limited to PDA(personal digital assistant), mobile phone, panel computer etc.As an example of mobile phone example, explain below.
Before testing, mobile phone is carried out to frame buffer initialization, to guarantee the accuracy of test.Start, after test, the interface display of mobile phone terminal to be transferred to PC, on the display screen of PC, show.Although the interface display of mobile phone terminal comprises word, message, data, icon etc., it will be understood by those in the art that these contents are all to transfer to PC one end to scheme sheet mode.
Before each transmission, system can have been transmitted picture by picture to be transmitted and last time and contrast, to find difference pixel.For transmission the first width picture, because mobile phone buffer memory has carried out initialization zero clearing, therefore the pixel of the first width picture need to all transfer to PC, and by the current picture having transmitted at the enterprising row cache of mobile phone.Before each width picture transmission afterwards, capital contrasts picture waiting for transmission and the picture of transmission of buffer memory before, find difference pixel, in each transmitting procedure, only need to transmit difference pixel afterwards, because the conversion of mobile phone interface is local variation conventionally, between two continuous frame pictures, only have the pixel difference of minority, therefore by only transmitting difference pixel, can under the prerequisite that does not affect Image Display, effectively reduce the data volume of transmission, accelerate transmission speed.Have many methods can obtain the method for difference pixel, fairly simple method is that the pixel value that transmits the respective pixel between picture of picture to be transmitted and buffer memory is subtracted each other or carry out XOR.If respective pixel value is identical, subtract each other or the result of XOR is all 0.Most of numerical value of the difference pixel obtaining for two close frame pictures is all 0, thereby can process the data volume that greatly reduces transmission by simple compression algorithm.
After definite difference pixel, continue execution step S102, described difference pixel is compressed.Due to the size difference of the mobile terminal display screens such as mobile phone, therefore these mobile terminals require generally also different for the definition of picture; In addition, the display screen of mobile terminal is conventionally all less, and therefore for the definition of picture, requiring can be too not high.If can compress picture pixel under the prerequisite of assurance definition before picture transmission, also will effectively improve transmission speed.The storage cell of a pixel is generally a byte, two bytes and/or three bytes.Difference pixel can be compressed to two bytes or a byte from three bytes according to demand.The difference pixel that is 0 for large numerical quantity, can by selecting suitable compression algorithm to compress, for example, compress by run length encoding method.
In industrial quarters, conventionally adopt rgb color pattern to be used as color standard, by variation and their stacks each other of red (R), green (G), blue (B) three Color Channels are obtained to color miscellaneous, this standard almost comprised mankind eyesights can perception all colours, be to use at present one of the widest color system.Although the present embodiment is to carry out the expression of pixel with rgb color pattern, be appreciated that the present invention is not limited thereto, can also use other conventional picture method for expressing, as YUV, HIS color space, CMY pattern etc.
Rgb color pattern using RGB model is that the RGB component of each pixel in image distributes the intensity level in 0 ~ 255 scope.RGB image is only used three kinds of colors, just can make them according to different ratios, mix, and reappears 16777216 kinds of colors on screen.Can represent by three numerals the byte number of each pixel, three numerals wherein represent respectively occupy-place (Bit) situation of three kinds of colors, for example: represent three bytes with 888,565 represent two bytes, and 323 represent bytes.
For example, when existing in the difference pixel getting according to above-mentioned steps while continuously repeating pixel (, repetition 0), obtain the number that described repetition pixel repeats continuously.For example, when having the color in a region the same (being white as all) in the picture of needs transmission, traditional way is that the information of each pixel is transmitted one time.Described information comprises: the occupy-place situation of three kinds of colors, the data of pixel and the coordinate of pixel in pixel.And in the present invention, extract the continuous repetition number that repeats pixel, and so just can be in subsequent transmission process, simplify the number of transmissions of counterweight double image vegetarian refreshments, effectively save transmission bandwidth, improve the speed of transfer of data.
Find difference pixel, and after difference pixel is further processed, execution step S103, will carry out pixel described picture to be transmitted after treatment and transfer to PC.Adopt USB or WiFi host-host protocol to carry out picture transmission.By driver, by virtual the host-host protocol of the USB procotol that becomes, simplify development, and in speed, also can reach the general speed of USB, obviously exceed the transmission speed of wifi.
After PC receives difference pixel, the numerical value of described difference pixel and the numerical value of the last corresponding pixel points of transmitting or having Showed Picture receiving are added or carry out the picture that XOR can synthesize this transmission in described mobile terminal.After transmitting described difference pixel, in mobile terminal, using current image cache waiting for transmission as transmitting picture, during in order to transmission next time picture, enter contrast.
With reference to figure 2, Fig. 2 illustrates the structural representation of a kind of embodiment of the high speed synchro system 10 between a kind of PC and mobile terminal according to the present invention.System 10 comprises: compare device 11,compression set 12 and transmittingdevice 13.
Compare device 11, for to the picture to be transmitted of mobile terminal with transmit picture and contrast, obtain difference pixel.System of the present invention is for picture, transfer of data between various mobile terminals and PC.Mobile terminal has little, the portable feature of volume, can make like this its display screen and processing unit ability all be less than PC.In order to carry out high-efficient automatic test to mobile terminal, just need to be by mobile terminal and PC UNICOM, use the high-performance of PC to carry out synchronous manipulation to mobile terminal, to realize the automatic test to mobile terminal.Described mobile terminal includes but not limited to PDA(personal digital assistant), mobile phone, panel computer etc.As an example of mobile phone example, explain below.
Preferably, before testing, compare device 11 carries out frame buffer initialization to mobile phone, to guarantee the accuracy of test.Start after test, system 10 can transfer to PC by the interface display of mobile phone terminal, on the display screen of PC, shows.Although the interface display of mobile phone terminal comprises word, message, data, icon etc., it will be understood by those in the art that these contents are all to transfer to PC one end to scheme sheet mode.
Before each transmission, the compare device 11 in system 10 can and be transmitted picture by picture to be transmitted and be contrasted, to find difference pixel.For transmission the first width picture, because mobile phone buffer memory has carried out initialization zero clearing, therefore the pixel of the first width picture need to all transfer to PC, and by the current picture having transmitted at the enterprising row cache of mobile phone.Before each width picture transmission afterwards, capital is contrasted this picture waiting for transmission and the picture having transmitted of buffer memory before by compare device 11, find difference pixel, in each transmitting procedure, only need to transmit difference pixel afterwards, because the conversion of mobile phone interface is local variation conventionally, between two continuous frame pictures, only has the pixel difference of minority, therefore by only transmitting difference pixel, can under the prerequisite that does not affect Image Display, effectively reduce the data volume of transmission, accelerate transmission speed.Have many methods can obtain the method for difference pixel, fairly simple method is that the pixel value that transmits the respective pixel between picture of picture to be transmitted and buffer memory is subtracted each other or carry out XOR.If respective pixel value is identical, subtract each other or the result of XOR is all 0.Most of numerical value of the difference pixel obtaining for two close frame pictures is all 0, thereby can process the data volume that greatly reduces transmission by simple compression algorithm.
After definite difference pixel, by compression set 12, described difference pixel is compressed.Due to the size difference of the mobile terminal display screens such as mobile phone, therefore these mobile terminals require generally also different for the definition of picture; In addition, the display screen of mobile terminal is conventionally all less, and therefore for the definition of picture, requiring can be too not high.If can compress picture pixel under the prerequisite of assurance definition before picture transmission, also will effectively improve transmission speed.The storage cell of a pixel is generally a byte, two bytes and/or three bytes.Difference pixel can be compressed to two bytes or a byte from three bytes according to demand.
In industrial quarters, conventionally adopt rgb color pattern to be used as color standard, by variation and their stacks each other of red (R), green (G), blue (B) three Color Channels are obtained to color miscellaneous, this standard almost comprised mankind eyesights can perception all colours, be to use at present one of the widest color system.Although the present embodiment is to carry out the expression of pixel with rgb color pattern, be appreciated that the present invention is not limited thereto, can also use other conventional picture method for expressing, as YUV, HIS color space, CMY pattern etc.
Rgb color pattern using RGB model is that the RGB component of each pixel in image distributes the intensity level in 0 ~ 255 scope.RGB image is only used three kinds of colors, just can make them according to different ratios, mix, and reappears 16777216 kinds of colors on screen.Can represent by three numerals the byte number of each pixel, three numerals wherein represent respectively occupy-place (Bit) situation of three kinds of colors, for example: represent three bytes with 888,565 represent two bytes, and 323 represent bytes.
Preferably, with reference to figure 3, also comprise acquisition device 14.Be on duty and exist while repeating pixel in aniseikania vegetarian refreshments, byacquisition device 14, remove to obtain the number of times that described repetition pixel repeats.For example, when have the color in a region the same in the picture of needs transmission (being white as all) or a certain color carried out repeatedly repeating, traditional way is that the information of each pixel is transmitted one time.Described information comprises: the occupy-place situation of three kinds of colors, the data of pixel and the coordinate of pixel in pixel.And in the present invention, extract and repeat the number of repetition of pixel and the coordinate of pixel, so just can be in subsequent transmission process, simplify the number of transmissions of counterweight double image vegetarian refreshments, effectively save transmission bandwidth, improve the speed of transfer of data.
Acquisition device 13 gets after the information of repetition pixel, and transmittingdevice 13 transfers to PC for carrying out pixel described picture to be transmitted after treatment.Preferably, transmittingdevice 13 adopts USB or WiFi host-host protocol to carry out picture transmission.By driver, by virtual the host-host protocol of the USB procotol that becomes, simplify development, and in speed, also can reach the general speed of USB, obviously exceed the transmission speed of wifi.
After PC receives difference pixel, the numerical value of described difference pixel and the numerical value of the last corresponding pixel points of transmitting or having Showed Picture receiving are added or carry out the picture that XOR can synthesize this transmission in described mobile terminal.After transmitting described difference pixel, in mobile terminal, using current image cache waiting for transmission as transmitting picture, during in order to transmission next time picture, enter contrast.
Adopt method of the present invention, can significantly improve the speed of transfer of data, can effectively utilize the high-performance of PC in conjunction with UI testing tool, mobile terminal to be tested.
To those skilled in the art, obviously the invention is not restricted to the details of above-mentioned example embodiment, and in the situation that not deviating from spirit of the present invention or essential characteristic, can realize the present invention with other concrete form.Therefore, no matter from which point, all should regard embodiment as exemplary, and be nonrestrictive, scope of the present invention is limited by claims rather than above-mentioned explanation, is therefore intended to all changes that drop in the implication and the scope that are equal to important document of claim to be included in the present invention.Any Reference numeral in claim should be considered as limiting related claim.In addition, obviously other modules or step do not got rid of in " comprising " word, and odd number is not got rid of plural number.