Summary of the invention
Because between traditional mobile phone and digital camera, can't utilize the high power capacity transmission between general digital camera and computer, carry out the shortcoming of image data transmission, the inventor is through the permanent research and experiment of making great efforts, finally development and Design goes out the method for mutual data transmission between digital camera of the present invention and portable electronic communication equipment, the image data communications protocol that this method utilization defines voluntarily, with the order package that portable electronic communication equipment produced, be sent to digital camera, make this digital camera order package according to this, with image data stored on it, utilize this communications protocol, convert at least more than one response packet to, pass this electronic communication equipment again back, make this telecommunications dress can utilize this communications protocol,, carry out error checking the verification field that is comprised in this response packet.
A purpose of the present invention is to be provided with a verification field in this order package or response packet, in order to store the whether correct checking parameter of these packages of verification, this verification field mainly comprises a data length field, in order to the length of whole data in the data field that stores this package respectively; One data summation field is in order to store the summation of whole data value in this data field; An and packet header summation field, summation in order to each field value in the head (header) that stores these packages (packet), with as the parameter value that these packages are tested, make this electronic communication equipment or the digital camera can be at stored parameters value in this verification field, carry out verification, to judge the content of this order package or response packet, whether any mistake takes place in the process of transmission, if judge stored parameters value in this verification field, when not being inconsistent with the packet data of actual reception, a message that retransfers these packages will be sent, to corresponding digital camera or electronic communication equipment, in the order package or response packet that receives up to checking out, stored parameters value in this verification field, when conforming to, just carry out subsequent treatment, receive accurate image data from this digital camera to guarantee this telecommunications dress with these packet datas.
Another object of the present invention is to this electronic communication equipment before receiving the image data that this digital camera transmits, can be earlier with in its buffer, the image data of former storage, full scale clearance, after waiting this electronic communication equipment to receive this image data, utilize a coding checkout mechanism again, check the image data in this buffer, whether be whole identical codings, if, represent that then these data make a mistake, this electronic communication equipment will send an order package to this digital camera, require this digital camera response packet that retransfers, image data in checking out this buffer, behind the non-all identical coding, just carry out subsequent treatment, receive accurate image data to guarantee this electronic communication equipment.
Therefore, content to sum up, the method of mutual data transmission between digital camera provided by the invention and portable electronic communication equipment, this method is utilized an image data communications protocol that defines voluntarily, with the order package that this portable electronic communication equipment produced, be sent to a digital camera, make this digital camera order package according to this, with image data stored on it, utilize this communications protocol, convert at least more than one response packet to, be transmitted back to this electronic communication equipment again, make this telecommunications dress can utilize this communications protocol, at least one verification field that is comprised in this response packet, carry out error checking, receive accurate image data from this digital camera to guarantee this telecommunications dress;
In said method, this electronic communication equipment receives the image data that also verification is transmitted by this digital camera according to the following step:
At first, this electronic communication equipment is after sending an order package to this digital camera, requiring this digital camera to transmit image data, with the former image data of removing in its buffer;
Then, receive each response packet that this digital camera sends, and read respectively the stored parameters value of this verification field in this response packet respectively;
Judge the stored parameters value of this verification field, whether do not conform to the image data of actual reception;
If the parameters value is consistent with the image data of actual reception, then read the image data in this response packet respectively;
Then, judge that more whether this image data belongs to all is identical data;
If received data are not all identical, judge whether to have read whole image data again; With
If read whole image data, then this image data is stored in the storage device set in this electronic communication equipment;
This digital camera is handled according to the following step after receiving the order package that this electronic communication equipment sends:
At first, the stored parameters value of this verification field in the order package that reads this electronic communication equipment and sent;
Then, judge the stored parameters value of this verification field, whether do not conform to the packet data of actual reception;
If the parameters value is consistent with the packet data of actual reception, then read the data in this order package;
Then, judge whether to receive complete data; With
If receive complete data,, produce response packet then according to the instruction that is comprised in these data.
For ease of to purpose of the present invention, shape, constructing apparatus feature and effect thereof, do further understanding and understanding, for the embodiment conjunction with figs., be described in detail as follows now:
Embodiment
The present invention is the method for mutual data transmission between a kind of digital camera and portable electronic communication equipment, the image data communications protocol that this method utilization defines voluntarily, with the order package that this portable electronic communication equipment produced, be sent to a digital camera, make this digital camera order package according to this, with image data stored on it, utilize this communications protocol, convert at least more than one response packet to, be transmitted back to this electronic communication equipment again, make this telecommunications dress can utilize this communications protocol, to at least one verification field that is comprised in this response packet, carry out error checking, receive accurate image data from this digital camera to guarantee this telecommunications dress.So, can avoid in the process of transmission image data,, cause this electronic communication equipment and receive wrong image data, and it correctly can't be shown from this digital camera because of making a mistake.
In the present invention,, mainly comprise following field, consult shown in Figure 1 according to defined order package of this image data communications protocol or response packet:
(1) initial field 3 is in order to store the initial address of package, when making this digital camera or this electronic communication equipment utilize this communications protocol to read these packages, can judge the initial address of these packages according to stored parameter value in this initial field 3;
(2) identification field 2, be in order to store the identification parameter of this digital camera or this electronic communication equipment, when making this digital camera or this electronic communication equipment utilize this communications protocol to read these packages, can discern stored parameter value in the field 2 according to this, judge these packages and whether sent by compatible digital camera or electronic communication equipment;
(3) whether correct the verification field 1, be in order to storing these packages of verification checking parameter, and this verification field 1 mainly comprises following three fields:
A) data length (length of data field) field 10 is the length in order to whole data in the storage data field 5;
B) data summation (summation of data field) field 12 is the summations in order to whole data value in the storage data field 5;
C) packet header summation (summation of packet hrader) field 14, it is summation in order to each field value in the head (header) that stores these packages (packet), with as the parameter value that these packages are tested, each field of this head comprises this identification field 2, data length field 10 and data summation field 12, for the order package, each field of this head still comprises at least one parameter field (not shown) relevant with the order of being assigned;
(4) finish field 4, be in order to store the end address of package (packet) head (header), when making this digital camera or this electronic communication equipment utilize this communications protocol to read these packages, can finish stored parameter value in the field 4, judge the end address in packet header according to this;
(5) the data field 5, are the data of transmitting in order to storage (as: image data and relevent information thereof), and this data system is divided into several blocks, can be stored in regular turn in a plurality of fields that comprised in this data field 5 in order to do these blocks.
In the present invention, after this digital camera receives the order package that this electronic communication equipment sends, this digital camera will be carried out a signal test instruction, an archives move instruction and image information instruction in regular turn, and utilize the defined package form of this communications protocol, the response packet that this test instruction produced will be carried out, be sent to this electronic communication equipment, make this electronic communication equipment can determine and this digital camera between keep normal communication state; With carrying out the response packet that this image move instruction is produced, be sent to this electronic communication equipment, can receive the image data that this digital camera is spread out of to make this electronic communication equipment; And will carry out the response packet that the instruction of this image information is produced, be sent to this electronic communication equipment, with the relevent information of the image data that makes this electronic communication equipment confirm being received (as: this image wide, high ... Deng).
Because, in general wireless transmission process, the situation that the transmission data make a mistake, nothing more than following two kinds:
(1) data are omitted;
(2) data content mistake;
So, if can take precautions against above-mentioned two kinds of situations in advance, can be in data transmission procedure, it is minimum to make mistake reduce to.In the present invention, for solving the situation of aforementioned generation error in data, mainly be to make this electronic communication equipment or the digital camera can be at stored parameters value in this verification field, carry out verification, to judge the content of this order package or response packet, whether any mistake takes place in the process of transmission, if judge stored parameters value in this verification field, when not being inconsistent with the packet data of actual reception, a message that retransfers these packages will be sent, to corresponding digital camera or electronic communication equipment, in the order package or response packet that receives up to checking out, stored parameters value in this verification field is when conforming to these packet datas, just carry out subsequent treatment, receive accurate image data from this digital camera to guarantee this telecommunications dress.
General speech, the image data of digital camera all is made up of digital signal (as: with 0 or 1), this digital signal is under extreme situation, it all is 0 or 1 that its content is, and all be preset with several screening-modes on the general digital camera, make it under various shooting state, can be respectively with the screening-mode of correspondence, to scenery, take, to capture best digital image data, so under normal condition, 0 or 1 state content should be unlikely appear and all be in the digital image data that digital camera captured.
In the present invention, for solving the situation that transfer of data makes a mistake, this electronic communication equipment is before the image data that receives this digital camera, earlier in the buffer with this electronic communication equipment, the image data full scale clearance of former storage, wait this electronic communication equipment after receiving the image data that this digital camera transmits, utilize a coding checkout mechanism again, check the data in this buffer, judge whether all to be the state of same-code, if then represent this data content mistake, at this moment, this electronic communication equipment will transmit an order package again to this digital camera, require this digital camera image data that retransfers, and judge the non-all identical codings of the data that received up to this electronic communication equipment, beginning is confirmed to receive correct image data, and then intactly presents this image data on the display of this communication device.
In preferred embodiment of the present invention, see also shown in Figure 2ly, after this digital camera receives the order package that this electronic communication equipment sends, handle according to the following step:
(201) at first, read the stored parameters value of this verification field in the order package that this electronic communication equipment sends;
(202) then, judge the stored parameters value of this verification field, whether do not conform to the packet data of actual reception; If the parameters value is consistent with the packet data of actual reception, continue step (203); Otherwise, carry out step (206);
(203) read data in this order package;
(204) then, judge whether to receive complete data; If receive complete data, then continue step (205); Otherwise, carry out step (206);
(205), carry out subsequent treatment according to the instruction that is comprised in these data;
(206) produce a response packet, require this electronic communication equipment this order package that retransfers, and carry out step (201), continue this order package that is received is carried out verification, till affirmation receives correct order package.
In this embodiment, this electronic communication equipment then is according to the following step, sees also shown in Figure 3ly, receives and image data that verification is transmitted by this digital camera:
(301) at first, this electronic communication equipment is after sending an order package to this digital camera, requiring this digital camera to transmit image data, with the former image data of removing in its buffer;
(302) then, receive each response packet that this digital camera sends, and read respectively the stored parameters value of this verification field in this response packet respectively;
(303) judge the stored parameters value of this verification field, whether do not conform to the image data of actual reception; If the parameters value is consistent with the image data of actual reception, continue step (304); Otherwise, carry out step (308);
(304) read image data in this response packet respectively;
(305) then, judge that whether this image data belongs to all is zero data; If received data are not all to be zero, then continue step (306); Otherwise,, then carry out step (308) if received data all are zero;
(306) judge whether to read whole image data; If read whole image data, then continue step (307); Otherwise, carry out step (304), continue to read the image data in the response packet;
(307) this image data is stored in the storage device set in this electronic communication equipment;
(308) produce an order package, require this digital camera respectively this response packet that retransfers, and carry out step (301), continue respectively this response packet that is received is carried out verification, up to confirming till this digital camera receives accurate image data.
Press, the above only is the specific embodiment of the best of the present invention, and structural feature of the present invention is not limited thereto, and anyly is familiar with present technique field person, in field of the present invention, can think easily and variation or modification, all can be encompassed in the claim of following this case.