Invention content
The purpose of the embodiment of the present invention is to provide a kind of image transmission control method and device, and the phase can reduce image transmitting
Time in the process and space consuming.
To achieve these goals, the embodiment of the present invention provides a kind of image transmission control method, and this method includes:It reads
First size of data of current image to be transmitted;Read the second size of data that image is transmitted in a upper transformation task;By institute
The first size of data is stated to be compared with second size of data;And in first size of data and second data
In the case of equal in magnitude, cancel the transmission current image to be transmitted.
Optionally, the method further includes:In first size of data and the unequal feelings of the second size of data
Under condition, first size of data and maximum allowable data size are compared;And it is more than in first size of data
In the case of the maximum allowable data size, cancel the transmission current image to be transmitted.
Optionally, in the case where first size of data is not more than the maximum allowable data size, the method
It further includes:It reads at the beginning of performing a upper transformation task;Read current time;According to time started, described
Current time, second size of data calculate average transmission rate;By the average transmission rate and maximum allowable bandwidth
It is compared;And in the case where the average transmission rate is more than the maximum allowable bandwidth, it is described current to cancel transmission
Image to be transmitted.
Optionally, it is described to be calculated averagely according to the time started, the current time and second size of data
Transmission rate includes calculating the average transmission rate according to the following formula:
S0=L0/ (Tb-Ta),
Wherein, S0 represents the average transmission rate, and L0 represents second size of data, when Tb represents described current
Between, Ta represents the time started.
Optionally, the method includes:In the case where the average transmission rate is not more than the maximum allowable bandwidth,
The current image to be transmitted is transmitted.
Correspondingly, the embodiment of the present invention also provides a kind of image transmitting control device, and described device includes:First reads mould
Block, for reading the first size of data of current image to be transmitted;Second read module, for reading institute in a upper transformation task
Transmit the second size of data of image;First comparison module, for by first size of data and second size of data
It is compared;And first cancel module, in first size of data situation equal with second size of data
Under, cancel the transmission current image to be transmitted.
Optionally, described device further includes:Second comparison module, in first size of data and the described second number
According to size it is unequal in the case of, first size of data and maximum allowable data size are compared;Second cancels mould
Block, in the case of being more than the maximum allowable data size in first size of data, cancellation transmission is described currently to be treated
Transmit image.
Optionally, in the case where first size of data is not more than the maximum allowable data size, described device
It further includes:Third read module, at the beginning of reading an execution upper transformation task;4th read module, is used for
Read current time;Computing module, by according to the time started, the current time and second size of data come based on
Calculate average transmission rate;Third comparison module, for the average transmission rate and maximum allowable bandwidth to be compared;And
Third cancels module, in the case of being more than the maximum allowable bandwidth in the average transmission rate, cancels described in transmission
Current image to be transmitted.
Optionally, the computing module calculates the average transmission rate according to the following formula:
S0=L0/ (Tb-Ta),
Wherein, S0 represents the average transmission rate, and L0 represents second size of data, when Tb represents described current
Between, Ta represents the time started.
Optionally, described device includes:Transmission module, it is described maximum allowable for being not more than in the average transmission rate
In the case of bandwidth, the current image to be transmitted is transmitted.
Through the above technical solutions, by image is transmitted in the size of data of current image to be transmitted and a upper transformation task
Size of data be compared, in the case where the two is equal, it may be considered that the image transmitted does not change, then cancel
Transmit the current image to be transmitted.The method calculate it is simple, and while running occupy less room and time, thus can drop
Time and space consuming in low image transmitting process.
The other feature and advantage of the embodiment of the present invention will be described in detail in subsequent specific embodiment part.
Specific embodiment
The specific embodiment of the embodiment of the present invention is described in detail below in conjunction with attached drawing.It should be understood that this
Locate described specific embodiment and be merely to illustrate and explain the present invention embodiment, be not intended to restrict the invention embodiment.
Fig. 1 shows the flow chart of image transmission control method in an embodiment.As shown in Figure 1, the embodiment of the present invention carries
For a kind of image transmission control method, this method is used to perform in terminal, and the terminal for example can be smart mobile phone, tablet electricity
Brain etc..It the described method comprises the following steps:
Step S11 reads the first size of data of current image to be transmitted.The data of image are big in image transmitting process
Small is variation.Such as when terminal screen being mapped to engine end being shown, current image to be transmitted is obtained by screenshotss
Image, the size of the image that screenshotss are obtained depends on terminal screen size, and therefore, for same terminal, screenshotss are obtained
The size of each image be changeless, but due to screen content difference, then can cause the obtained picture number of screenshotss
According to of different sizes, content is more, then image data size is bigger.
Step S12 reads the second size of data that image is transmitted in a upper transformation task.Every time transmission one image it
The size of data of the image of the transmission can be stored, therefore, can be read from the size of data of the image stored afterwards
Take the second size of data that image is transmitted in a transformation task.
First size of data and second size of data are compared by step S13, big in first data
It is small it is equal with second size of data in the case of, it is believed that current image to be transmitted in a upper transformation task with being passed
Defeated image is identical, and the content of the two does not change, therefore, current image to be transmitted can not be transmitted, i.e., described
In the case that first size of data is equal with second size of data, step S14 can be performed, cancellation transmission is described currently to be treated
Image is transmitted, cancels transmission image, just refers to cancel the transformation task corresponding to the image.Optionally, described first
In the case of size of data and second size of data are unequal, step S15 can be performed, transmits the current figure to be transmitted
Picture.
It should be appreciated that in embodiments of the present invention, a upper transformation task refers to the transformation task performed rather than cancels
The transformation task of execution.
It is the application serially performed that the embodiment of the present invention, which provides image transmission control method suitable for transformation task queue,
It is suitable for the application of at most one transformation task of execution of same time.The method is by the size of data of current image to be transmitted
Size of data with transmitting image in a upper transformation task is compared, in the case where the two is equal, it may be considered that institute
The image of transmission does not change, then cancels the transmission current image to be transmitted.The method calculate it is simple, and while running account for
With less room and time, thus the time in image transmitting process and space consuming can be reduced.
Fig. 2 shows the flow charts of image transmission control method in another embodiment.As shown in Fig. 2, the embodiment of the present invention
The image transmission control method provided can also be included in first size of data and second size of data is unequal
In the case of, step S21 is performed, first size of data and maximum allowable data size are compared.This is maximum allowable
Size of data be limited to image receiving terminal the size of data of treatable single image maximum value, for example, by end panel
When curtain is mapped to engine end and is shown, the maximum allowable data size is the maximum of single image that engine end can be handled
Size of data.The maximum allowable data size can be pre-stored in terminal.
In the case where first size of data is more than the maximum allowable data size, it is believed that the figure to be transmitted
The size of data of picture is excessive so that image receiving terminal cannot be handled it, thus can perform step S22, and institute is transmitted in cancellation
State current image to be transmitted.Optionally, in the case where first size of data is not more than the maximum allowable data size,
Step S23 can be performed, transmits the current image to be transmitted.
Fig. 3 shows the flow chart of image transmission control method in another embodiment.As shown in figure 3, in the described first number
According to size no more than the image transmitting control that in the case of the maximum allowable data size, the embodiment of the present invention is provided
Method can also include performing following steps:
Step S31 is read at the beginning of performing a upper transformation task.Here, opening for a upper transformation task is performed
Time beginning and end time are at the beginning of transmitting image in a transformation task in execution and the end time, every performing
During one transformation task, can record perform the transformation task at the beginning of and the end time.
Step S32 reads current time.Here, current time refers to the time that terminal is currently shown.The current time can
To be later than the end time for performing a upper transformation task.
Step S33 calculates average transmission according to the time started, the current time, second size of data
Rate.Here average transmission rate refers to the average transmission in from the time started to this period of the current time
Rate.
Optionally, in step S33, the average transmission rate can be calculated according to the following formula:
S0=L0/ (Tb-Ta) (1)
Wherein, S0 represents the average transmission rate, and L0 represents second size of data, when Tb represents described current
Between, Ta represents the time started.
The average transmission rate and maximum allowable bandwidth are compared by step S34, big in the average transmission rate
In the case of the maximum allowable bandwidth, it is believed that in from the time started to this period of the current time
Average transmission rate is excessively high, then performs step S34, cancels the transmission current image to be transmitted.It is described current to cancel transmission again
When performing next transformation task after image to be transmitted, shown step performs the transmission of the next image according to fig. 3, at this point, public
In formula (1), the second size of data L0 and the time started Ta are constant, and the current time Tb becomes larger, then described average
Transmission rate S0 becomes smaller, and is equivalent to the average transmission rate reduced in this period, so as to balance in image transmitting process
Ensemble average transmission rate.Preferably, maximum allowable bandwidth can be pre-stored in terminal.For example, by terminal screen
When being mapped to engine end and being shown, maximum allowable bandwidth can test acquisition according to the hardware performance of engine end.
In the average transmission rate no more than in the case of the maximum allowable bandwidth, then step S35 is performed, to described
Current image to be transmitted is transmitted.Optionally, after image transmitting completion, what can be stored in more new terminal upper one passes
Transmit the second size of data of image at the beginning of defeated task and in a upper transformation task, to facilitate next use when is direct
It is read out.
Fig. 4 shows the structure diagram of image transmitting control device 40 provided by the invention in an embodiment.Such as Fig. 4 institutes
Show, the embodiment of the present invention also provides a kind of image transmitting control device 40, which is suitable for terminal, which for example can be with
It is smart mobile phone, tablet computer etc., described device 40 can include:First read module 41, for reading current figure to be transmitted
First size of data of picture;Second read module 42, for read transmitted in a upper transformation task image the second data it is big
It is small;First comparison module 43, for first size of data and second size of data to be compared;And first take
The module that disappears 44, in the case where first size of data is equal with second size of data, cancelling, transmission is described to work as
Preceding image to be transmitted.To be transmitted in the size of data of current image to be transmitted and a upper transformation task size of data of image into
Row compares, and in the case where the two is equal, it may be considered that the image transmitted does not change, then it is described current to cancel transmission
Image to be transmitted, implementation procedure calculate it is simple, and while running occupy less room and time, thus image biography can be reduced
Time and space consuming during defeated.
Further, described device can also include:Second comparison module, for first size of data with it is described
In the case of second size of data is unequal, first size of data and maximum allowable data size are compared;Second
Cancel module, in the case of being more than the maximum allowable data size in first size of data, cancel described in transmission
Current image to be transmitted.In the case where first size of data is more than the maximum allowable data size, it is believed that should
The size of data of image to be transmitted is excessive so that image receiving terminal cannot be handled it, thus can be cancelled and be worked as described in transmission
Preceding image to be transmitted.
Further, in the case where first size of data is not more than the maximum allowable data size, the dress
Putting can also include:Third read module, at the beginning of reading an execution upper transformation task;4th reads mould
Block, for reading current time;Computing module, for big according to the time started, the current time, second data
It is small to calculate average transmission rate;Third comparison module, for the average transmission rate and maximum allowable bandwidth to be compared
Compared with;And third cancels module, in the case of being more than the maximum allowable bandwidth in the average transmission rate, cancels and passing
The defeated current image to be transmitted.In the average transmission rate no more than in the case of the maximum allowable bandwidth, mould is transmitted
Block can be transmitted the current image to be transmitted.
Preferably, the computing module calculates the average transmission rate according to the following formula:S0=L0/ (Tb-Ta),
Wherein, S0 represents the average transmission rate, and L0 represents second size of data, and Tb represents the current time, and Ta is represented
The time started.
Image transmitting control device provided in an embodiment of the present invention passed through in control a period of time in transmission image every time
Average transmission rate achieve the purpose that balance overall transmission rate in image transmitting process, calculate simple and when running
Less room and time is occupied, is particularly suitable for the application that terminal screen is mapped to engine end and shown.
The operation principle of image transmitting control device provided in an embodiment of the present invention and benefit and the embodiments of the present invention
The specific workflow and benefit of the image transmission control method of offer are similar, will not be described in great detail here.
The alternative embodiment of the present invention is described in detail above in association with attached drawing, still, the embodiment of the present invention is not limited to
The detail in embodiment is stated, it, can be to the technology of the embodiment of the present invention in the range of the technology design of the embodiment of the present invention
Scheme carries out a variety of simple variants, these simple variants belong to the protection domain of the embodiment of the present invention.
It is further to note that specific technical features described in the above specific embodiments, in not lance
In the case of shield, it can be combined by any suitable means.In order to avoid unnecessary repetition, the embodiment of the present invention pair
Various combinations of possible ways no longer separately illustrate.
It will be appreciated by those skilled in the art that all or part of the steps of the method in the foregoing embodiments are can to pass through
Program is completed to instruct relevant hardware, which is stored in a storage medium, is used including some instructions so that one
A (can be microcontroller, chip etc.) or processor (processor) perform the whole of each embodiment the method for the application
Or part steps.And aforementioned storage medium includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
In addition, arbitrary combination can also be carried out between a variety of different embodiments of the embodiment of the present invention, as long as it is not disobeyed
The thought of the embodiment of the present invention is carried on the back, should equally be considered as disclosure of that of the embodiment of the present invention.