CN106453161A - Method and device for transmitting and analyzing information - Google Patents
Method and device for transmitting and analyzing information Download PDFInfo
- Publication number
- CN106453161A CN106453161A CN201610970059.2A CN201610970059A CN106453161A CN 106453161 A CN106453161 A CN 106453161A CN 201610970059 A CN201610970059 A CN 201610970059A CN 106453161 A CN106453161 A CN 106453161A
- Authority
- CN
- China
- Prior art keywords
- picture
- image
- information
- coding
- converted
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000005540 biological transmission Effects 0.000 claims abstract description 25
- 238000006243 chemical reaction Methods 0.000 claims abstract description 12
- 230000000875 corresponding Effects 0.000 claims description 57
- 239000003086 colorant Substances 0.000 claims description 19
- 241000283220 Odobenus rosmarus Species 0.000 description 30
- 238000010586 diagram Methods 0.000 description 6
- 238000000034 method Methods 0.000 description 5
- 229910002056 binary alloy Inorganic materials 0.000 description 4
- 239000000463 material Substances 0.000 description 4
- 230000001154 acute Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 2
- 238000004040 coloring Methods 0.000 description 2
- 201000009910 diseases by infectious agent Diseases 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 235000004418 Durio kutejensis Nutrition 0.000 description 1
- 230000001413 cellular Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006011 modification reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L15/00—Apparatus or local circuits for transmitting or receiving dot-and-dash codes, e.g. Morse code
- H04L15/04—Apparatus or circuits at the transmitting end
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L15/00—Apparatus or local circuits for transmitting or receiving dot-and-dash codes, e.g. Morse code
- H04L15/24—Apparatus or circuits at the receiving end
- H04L15/34—Apparatus for recording received coded signals after translation, e.g. as type-characters
Abstract
The invention provides a method and device for transmitting and analyzing information. The transmission method comprises the following steps: acquiring plaintext information of to-be-transmitted information; converting the plaintext information into at least one group of image codes according to a first conversion rule; generating an image through the at least one group of image codes; and outputting the image so that the opposite terminal equipment can acquire the plaintext information by scanning the image. Therefore, after the information is converted into the image, a terminal for receiving the information can acquire the plaintext information only needing to utilize a camera at a receiving end to scan the image, the terminal is unnecessary to establish any connection with the terminal for sending the information and free from any network connection; the trivialness of the data transmission is reduced, and the operation efficiency is improved.
Description
Technical field
The present invention relates to communication technical field, more particularly, to a kind of transmission, the method and device of parsing information.
Background technology
Currently have transmission means miscellaneous information to be transmitted and receives, main stream approach be by wifi, bluetooth,
The modes such as cellular data are transmitting data.Or these transfer modes need to set up network connection and could transmit two ends
To connect between end and could transmit.
Content of the invention
The problem existing for prior art, embodiments provides a kind of transmission, the method for parsing information and dress
Put, for solving in prior art, in transmission information, to need network connection, or to need to set up between two terminals connection
Could transmit, lead to transmitting procedure loaded down with trivial details, the technical problem that operating efficiency reduces.
The present invention provides a kind of method of transmission information, and methods described includes:
Obtain the cleartext information of information to be transmitted;
Described cleartext information is converted to by least one set image code according to the first transformational rule;
Image is generated by described least one set image code;
Output described image, so that opposite equip. can obtain described cleartext information by scanning described image.
In such scheme, described cleartext information is converted to by least one set image code according to the first transformational rule and includes:
Described cleartext information is converted to character code;
Described character code is converted to least one set digital information;
Determine the numerical value of every group digital information;
Determine each digital corresponding picture coding in described numerical value;
Based on the numerical value of each digital corresponding picture coding described and every group digital information, by described every group digital information
Be converted to corresponding picture coding;
Corresponding picture coding is combined forming image code.
In such scheme, image is generated by described least one set image code, including:
Traversal described image code, obtains corresponding picture coding, and described image coding includes:First picture coding and second
Picture coding;
Described first image code conversion is completely black picture, described second picture coding is converted to white picture entirely, institute
State completely black picture and described entirely white picture forms picture queue;
First image information object is set up based on described picture queue, and arranges every in described first image information object
Frame number and the totalframes of described completely black picture and described entirely white picture that second plays;
Based on the frame number of broadcasting per second, using image generation algorithm by total frame of described completely black picture and described entirely white picture
Number generates image.
The present invention also provides a kind of method of parsing information, and methods described includes:
Receive and scanogram, obtain least one set image code;
Described least one set image code is converted to by cleartext information according to the second transformational rule.
In such scheme, scanogram, obtain least one set image code, including:
With default intermittent scanning described image, obtain picture queue;
Determine the picture color in described picture queue, described picture includes:Completely black picture and entirely white picture;
Travel through described picture queue, described completely black picture is converted to the first picture coding, by described entirely white picture conversion
For the second picture coding;
Corresponding picture coding is determined according to described first image coding and described second picture coding;
Described image coding is combined obtaining described least one set image code.
In such scheme, determine that the picture color in described queue includes:
Obtain the color value of photo current;
Determine the first Standard Colors value of completely black picture, determine the second Standard Colors value of white picture entirely;
Calculate the absolute value of the first difference of described color value and the first Standard Colors value, and described color value and described the
The absolute value of the second difference of two Standard Colors values;
The absolute value of the absolute value according to described first difference and described second difference determines the color of described photo current.
In such scheme, described least one set image code is converted to by cleartext information according to the second transformational rule and includes:
Described least one set image code is converted to digital information;
Described digital information is converted to character code;
Described character code is converted to described cleartext information.
In such scheme, described least one set image code is converted to digital information, including:
According to default extracting rule, described image code is split as least one set picture coding;
Determine each digital corresponding picture coding;
Based on each digital corresponding picture coding described and every group of picture coding, picture coding is converted to described numeral
Information.
The present invention provides a kind of device of transmission information, and described device includes:
Acquiring unit, for obtaining the cleartext information of information to be transmitted;
First converting unit, for being converted to least one set image code according to the first transformational rule by described digital information;
Signal generating unit, for generating image by described least one set image code;
Output unit, for exporting described image so that opposite equip. can by scan described image obtain described
Cleartext information.
The present invention also provides a kind of device of parsing information, and described device includes:
Receiving unit, for receiving image;
Scanning element, for scanning described image, obtains least one set image code;
Second converting unit, for being converted to cleartext information according to the second transformational rule by described least one set image code.
The invention provides the method and device of a kind of transmission, parsing information, described transmission method includes:Obtain to be transmitted
The cleartext information of information;Described cleartext information is converted to by least one set image code according to the first transformational rule;By described extremely
Few one group of image code generates image;Output described image, so that opposite equip. can be obtained by scanning described image stated clearly
Civilian information;So, after converting information into image, the terminal of receive information need not set up any company with the terminal of the information of transmission
Connect, without any network connection, only need to scan this image using the photographic head of receiving terminal, you can obtain cleartext information, so
Just decrease the triviality of data transfer, improve operating efficiency.
Brief description
The method flow schematic diagram of the transmission information that Fig. 1 provides for the embodiment of the present invention one;
The method flow schematic diagram of the parsing information that Fig. 2 provides for the embodiment of the present invention two;
The apparatus structure schematic diagram of the transmission information that Fig. 3 provides for the embodiment of the present invention three;
The apparatus structure schematic diagram of the parsing information that Fig. 4 provides for the embodiment of the present invention four.
Specific embodiment
In order to solve in prior art, in transmission information, to need network connection, or to need to build between two terminals
Vertical connection could be transmitted, and leads to transmitting procedure loaded down with trivial details, the technical problem that operating efficiency reduces, the invention provides a kind of transmission,
The method and device of parsing information, described transmission method includes:Obtain the cleartext information of information to be transmitted;According to the first conversion rule
Then described cleartext information is converted to least one set image code;Image is generated by described least one set image code;Output is described
Image, so that opposite equip. can obtain described cleartext information by scanning described image.
Below by drawings and the specific embodiments, technical scheme is described in further detail.
Embodiment one
The present embodiment provides a kind of method of transmission information, as shown in figure 1, methods described includes:
S101, obtains the cleartext information of information to be transmitted.
In this step, it is necessary first to obtain the cleartext information of information to be transmitted before to information transfer, described to be transmitted
Information can be obtained by user input or system directly gives;Described information to be transmitted can include:Word is believed
Breath, pictorial information etc..
Described digital information is converted to least one set image code according to the first transformational rule by S102.
In this step, after getting the cleartext information of information to be transmitted, according to the first transformational rule by described digital information
Be converted to least one set image code.Specifically, because cleartext information has the information of various codings it is possible to have Chinese, English,
Other words, in order to various countries' word can be switched to unified coded format, prevent mess code, or identification less than feelings
Condition, the unification of described cleartext information is converted to character code.
In the present embodiment, specifically described cleartext information is switched to base64 coding, base64 coding requirement is 38
Byte (3*8=24) is converted into the byte (4*6=24) of 46, mends two 0 afterwards before 6, forms 8 words
The form of section.If remaining character, less than 3 bytes, is filled with 0, output character use '=', export after therefore encoding
Text end it is possible that 1 or 2 '='.
So, cleartext information is converted to after character code, it will English alphabet occurs, numeral ,+,/,=these characters
Mixed characters string encoding.
The unification of described cleartext information is converted to after character code, because being to need to be converted to character code in the present embodiment
Color value carrys out blank map as therefore also needing in this step for character code to be converted to corresponding digital information, described numeral letter
Breath refers to specific numerical value.
It is that the character string because of unicode coded format is by base64 coding is switched to unicode coding in the present invention
One sets unified and unique binary coding, and therefore unicode coding is a piece of digital.
Here, because base64 coding is by English alphabet, numeral and+,/,=composition, therefore do not exist and be converted
For exceeding the situation of computer binary system greatest measure 65535 after unicode, therefore, all codings switching to unicode are all
Will be less than 65535.
Character code is converted to after digital information, each character code can correspond to set of number information, according to first
Described digital information is converted to least one set image code by transformational rule.
Specifically, for one of which digital information, it is first determined the numerical value of described digital information;Determine each numeral
Corresponding picture coding;Based on the numerical value of each digital corresponding picture coding described and every group digital information, by described every group
Digital information is converted to corresponding picture coding;Corresponding picture coding is combined forming image code.
In the present embodiment, described image coding can include Morse coding, Morse coding be by point, draw, point and
Pause between drawing, the short pause of each intercharacter (in point and draw between), between each word medium pause and sentence it
Between long pause expressing series of characters.
When determining each digital corresponding picture coding, only need to determine that 0~9 corresponding Morse encodes, such as
Shown in table 1:
Table 1
Character | Morse code |
0 | ----- |
1 | .---- |
2 | ..--- |
3 | ...-- |
4 | ....- |
5 | ..... |
6 | -.... |
7 | --... |
8 | ---.. |
9 | ----. |
. | .-.-.- |
From table 1 it follows that each numeral is made up of 5 Morse codings, waited using 3 between every group of numeral
Representing interval, described waiting signal can be represented signal with ". ", thus all digital informations can be converted to mole
This coded string, i.e. final image code.
Such as, two groups of digital number information are " 56 and 12 ", " 56 " can be converted to Morse according to above-mentioned logic
Be encoded to " ... ..-.... ";" 12 " are converted to Morse and are encoded to " .----..--- ";So by " 56 and 12 " mole
This coding is combined obtaining final Morse coded string, i.e. image code " ... ..-........----..--- ".
S103, generates image by described least one set image code.
In this step, after getting image code, whole image code only has ". " and two characters of "-", and this two characters
Between time interval can be 10ms.
When image is generated by described least one set image code, travel through described image code first, obtain corresponding image
Coding, corresponding picture coding refers to the corresponding picture coding of every group digital information, and described image coding includes the first figure
As coding and the second picture coding;Here, described first image coding can be ". ", and the second picture coding can be "-".
Here, ". " representative is gone out, "-" represents bright;Therefore, it is possible to use completely black picture acute pyogenic infection of finger tip ". ", with white picture generation entirely
Refer to "-", be thus completely black picture by described first image code conversion, described second picture coding is converted to white picture entirely
?;And completely black picture is 100ms with white picture transfer interval entirely.
Described first image coding is all converted to completely black picture, described second picture coding is all converted to entirely white
After picture, described completely black picture and described entirely white picture can a picture queue, material is thus formed one with Morse coding
On the basis of picture queue.
Then, DefaultMovieInfoProvider first image information pair is set up based on described picture queue
As determining the frame number of broadcasting per second, and the frame number of broadcasting per second being arranged on described first image information by setFPS (100)
In object.Here, the frame number of described broadcasting per second is to be determined by the length information of image code, and described image code refers to mole
The frame number of broadcasting per second is therefore set to 10 frames by this coding.
After the frame number of broadcasting per second is set, determine described completely black picture and the totalframes of described entirely white picture,
And totalframes is arranged in image object information;Here, described totalframes is the total bit determination according to image code, passes through
setNumberOfFrames(jpgs.length);Totalframes is set.
Width and the height of image, described width, after totalframes sets up, are set in the first image object information
Highly can be set according to different demands, in order to ensure terminal camera can accurately identify figure in the present embodiment
Picture, width and height are set to 60*60 by acquiescence.
After above- mentioned information is set, based on the frame number of broadcasting per second, using image generation algorithm by described completely black figure
The totalframes of piece and described entirely white picture generates image.
Specifically, it is possible to use the Jim2Mov method in java carrys out transition diagram picture, a newly-built first Jim2Mov file
Folder, by the above-mentioned incoming described file of picture queue, then calls image generation algorithm saveMovie
(MovieInfoProvider.TYPE_AVI_MJPEG);Start to read totalframes, generate image.
Certainly, after getting image code, generating image by described least one set image code can also include:Determine institute
State corresponding first brightness value of the first picture coding and corresponding second brightness value of described second picture coding;Set up the second image
Information object, and a control object is set in described second image information object;According to described first brightness value and described
Two brightness values control in described second image information object described control object flash brightness and different brightness flash frequency
Rate.And also represent interval using 3 waiting signals between every group of picture coding.
S104, exports described image, so that opposite equip. can obtain described cleartext information by scanning described image.
In this step, generate described image after, image is exported so that opposite equip. can by scan described image Lai
Obtain described cleartext information.Described image can be single picture or video.
Opposite equip. only needs to be scanned this image by the terminal with client of the present invention can get in plain text letter
Breath.Such as opposite equip. can be encrypted interaction in live video it is also possible to anywhere play, due to this image chi
Very little smaller, therefore can choose a corner to play this image when playing other videos.
Embodiment two
The present embodiment provides a kind of method of parsing information, as shown in Fig. 2 methods described includes:
S201, receives and scanogram, obtains least one set image code.
In this step, because completely black picture and full the transfer interval between white picture be 100ms, therefore receiving terminal is in scanning figure
During picture, extract a picture every 100ms in the stream of photographic head, after extraction finishes, you can obtain picture queue.
Due to being two kinds of pictures of black and white used in the present embodiment, and the aberration of two pictures is larger.And image
In playing process, due to environment, temperature, display screen material etc. affects, and the color that photographic head obtains not is black and white purely
Color, therefore when obtaining picture, also needs to determine the color of each picture in picture queue.
Specifically, it is determined that the color of each picture includes in picture queue:Obtain the color value of photo current;Determine completely black figure
First Standard Colors value of piece, determines the second Standard Colors value of white picture entirely;Calculate described color value and the first Standard Colors
The absolute value of the first difference of value, and the absolute value of the second difference of described color value and described second Standard Colors value;According to
The absolute value of the absolute value of described first difference and described second difference determines the color of described photo current.
The absolute value of the absolute value according to described first difference and described second difference determines the color of described photo current,
Including:When the absolute value of the first difference is less than the absolute value of the second difference, the color of photo current is defined as black;When
When the absolute value of one difference is more than the absolute value of the second difference, the color of photo current is defined as white.
When obtaining the color value of photo current, it is possible to use bitmap.getPixel ();Method is obtaining.Here, because
It is in Android device, described picture is typically made up of red (R), green (G), blue (B) three kinds of colors, and tri- kinds of colors of RGB are divided
Do not show, therefore described in the present embodiment, the color value of picture refers to RGB color value, each color Shi You255Zhong stratum.
Here, the code reading the RGB color value of picture is as follows:
Int color=bitmap.getPixel (x, y);The colouring information of // acquisition current point
Int r=Color.red (color);// analyze the value of R in color
Int g=Color.green (color);// analyze the value of G in color
Int b=Color.blue (color);// analyze the value of B in color
The RGB color value of each picture can be obtained with above code.
In this manner it is possible to accurately determine the picture color in picture queue, obtain the picture team of black, white picture entirely
Row.
Further, set up a character string queue, reuse the picture described in for searching loop in Android coding
Queue, in traversal, when getting picture, judges that described picture is white or black, after determining that picture is white or black,
Described completely black picture is converted to the first picture coding, described entirely white picture is converted to the second picture coding;In the present embodiment,
Described first image coding and described second picture coding are Morse codings.Described Morse coding only has ". " and "-" two
Character, will ". " represent goes out, "-" represent bright, therefore described first image coding can be ". ", the second picture coding can be "-".
After getting the first picture coding and the second picture coding, according to described first image coding and described second image
Coding determines corresponding picture coding;Described image coding is combined obtaining described least one set image code.
Described least one set image code is converted to cleartext information according to the second transformational rule by S202.
In this step, after getting the corresponding image code of all pictures, first according to the second transformational rule by described extremely
Few one group of image code is converted to digital information, including:
According to default extracting rule, described image code is split as least one set picture coding, determines that each numeral is right
The picture coding answered.In the present embodiment, described image coding can include Morse coding, Morse coding be by point, draw,
Medium pause and sentence between the short pause of pause between putting and drawing, each intercharacter (between putting and drawing), each word
Between son, long pause is expressing series of characters.
When determining each digital corresponding picture coding, only need to determine that 0~9 corresponding Morse encodes, such as
Shown in table 1:
Table 1
Character | Morse code |
0 | ----- |
1 | .---- |
2 | ..--- |
3 | ...-- |
4 | ....- |
5 | ..... |
6 | -.... |
7 | --... |
8 | ---.. |
9 | ----. |
. | .-.-.- |
From table 1 it follows that each numeral is made up of 5 Morse codings, and using 3 etc. between every group of numeral
Treat signal to represent interval, described waiting signal can be represented with ". ".So extract rule can be:In every group of image code
Extract once at interval of 5 characters, to obtain least one set picture coding.
So, extract once at interval of 5 characters in every group of picture coding, the corresponding number of this character is inquired about according to table 1
Word, will obtain the character string being made up of numeral and waiting signal ". " after inquiry finishes.After obtaining this character string, will be to wait
Signal ". " to cut character string for boundary line, just obtains data that one group of group is made up of numeral, so can be based on described every number
The corresponding picture coding of word and every group of picture coding, picture coding is converted to digital information.
Such as image code is " ... ..-........----..--- ", and described image code is split as picture coding respectively
For:“.....-....”…“.----..---”;According to table 1, the corresponding numeral of picture coding is respectively 56, three waits
Signal " ... " and 12;Finally understand, digital information is 56 and 12.
In the present embodiment, set unified and unique binary system because the character string of unicode coded format is one
Coding, therefore unicode coding is a piece of digital.So the present embodiment is that image code is converted to unicode coding realization figure
Conversion as code to digital information.
In addition it is also necessary to digital information is converted to character code after getting digital information, specifically unicode is encoded
Be converted to the coding of base64:
Unicode code conversion becomes the coding of base64, and the method for use is as follows:
Using above-mentioned code, the data of return is exactly the character-coded data of Base64.
After getting character code, it is possible to use code:
Base64.encodeToString(str.getBytes(),Base64.DEFAULT);
Just the character code of Base64 can be converted to cleartext information.
So, just complete resolving.
Embodiment three
Corresponding to embodiment two, the present embodiment provides a kind of device of transmission information, as shown in figure 3, described device includes:
Described device includes:Acquiring unit 31, the first converting unit 32, signal generating unit 33, output unit 34;Wherein,
Described acquiring unit 31 is used for obtaining the cleartext information of information to be transmitted.Specifically, before to information transfer, first
First need to obtain the cleartext information of information to be transmitted, described information to be transmitted can be obtained by user input or
System directly gives;Described information to be transmitted includes Word message.
After described acquiring unit 31 gets cleartext information, described first converting unit 32 is used for according to the first conversion rule
Then described digital information is converted to least one set image code;
Specifically, because cleartext information has the information of various codings it is possible to have Chinese, English, other words, in order to
Various countries' word can be switched to unified coded format, prevent mess code, or identification less than situation, described first turn
Change unit 32 and first the unification of described cleartext information is converted to character code.
In the present embodiment, the first converting unit 32 is that described cleartext information is switched to base64 coding, and base64 coding will
Seek the byte (4*6=24) 3 octets (3*8=24) being converted into 46, mend two 0 before 6 afterwards, shape
Become the form of 8 bytes.If remaining character, less than 3 bytes, is filled with 0, output character use '=', therefore
After coding, the text end of output is it is possible that 1 or 2 '='.
So, cleartext information is converted to after character code, it will English alphabet occurs, numeral ,+,/,=these characters
Mixed characters string encoding.
After cleartext information unification is converted to character code by described first converting unit 32, it is additionally operable to compile described character
Code is converted to corresponding digital information;Specifically, because being to need for character code to be converted to color value to fill in the present embodiment
Image, therefore described first converting unit 32 also needs for character code to be converted to corresponding digital information, described digital information
Refer to specific numerical value.
It is that the character string because of unicode coded format is by base64 coding is switched to unicode coding in the present invention
One sets unified and unique binary coding, and therefore unicode coding is a piece of digital.
Here, because base64 coding is by English alphabet, numeral and+,/,=composition, therefore do not exist and be converted
For exceeding the situation of computer binary system greatest measure 65535 after unicode, therefore, all codings switching to unicode are all
Will be less than 65535.
After described character code is converted to corresponding digital information by described first converting unit 32, each character code
Set of number information will be corresponded to, be additionally operable to, according to the first transformational rule, described digital information is converted to least one set image
Code.
Specifically, for one of which digital information, described first converting unit 32 determines described digital information first
Numerical value;Determine each digital corresponding picture coding;Based on each digital corresponding picture coding described and every group of numeral letter
The numerical value of breath, described every group digital information is converted to corresponding picture coding;Corresponding picture coding is combined being formed
Image code.
In the present embodiment, described image coding can include Morse coding, Morse coding be by point, draw, point and
Pause between drawing, the short pause of each intercharacter (in point and draw between), between each word medium pause and sentence it
Between long pause expressing series of characters.
When determining each digital corresponding picture coding, only need to determine that 0~9 corresponding Morse encodes, such as
Shown in table 1:
Table 1
Character | Morse code |
0 | ----- |
1 | .---- |
2 | ..--- |
3 | ...-- |
4 | ....- |
5 | ..... |
6 | -.... |
7 | --... |
8 | ---.. |
9 | ----. |
. | .-.-.- |
From table 1 it follows that each numeral is made up of 5 Morse codings, waited using 3 between every group of numeral
Representing interval, described waiting signal can be represented signal with ". ", and so described first converting unit 32 just can be all
Digital information is converted to Morse coded string, i.e. final image code.
Such as, two groups of digital number information are " 56 and 12 ", " 56 " can be converted to Morse according to above-mentioned logic
Be encoded to " ... ..-.... ";" 12 " are converted to Morse and are encoded to " .----..--- ";So by " 56 and 12 " mole
This coding is combined obtaining final Morse coded string, i.e. image code " ... ..-........----..--- ".
Digital information is converted to after image code by described first converting unit 32, and described signal generating unit 33 is used for by described
Least one set image code generates image.
Specifically, after getting image code, whole image code only have ". " and two characters of "-", and this two characters it
Between time interval can be 10ms.
Described signal generating unit 35, when generating image by described least one set image code, travels through described image code first,
Obtain corresponding picture coding, corresponding picture coding refers to the corresponding picture coding of every group digital information, described image
Coding includes the first picture coding and the second picture coding;Here, described first image coding can be ". ", and the second image is compiled
Code can be "-".
Here, ". " representative is gone out, "-" represents bright;Therefore, it is possible to use completely black picture acute pyogenic infection of finger tip ". ", with white picture generation entirely
Refer to "-", be thus completely black picture by described first image code conversion, described second picture coding is converted to white picture entirely
?;And completely black picture is 100ms with white picture transfer interval entirely.
Described first image coding is all converted to completely black picture, described second picture coding is all converted to entirely white
After picture, a picture queue will be obtained, material is thus formed a picture queue on the basis of Morse coding.
Then, described signal generating unit 33 sets up a DefaultMovieInfoProvider based on described picture queue
One image information object, determines the frame number of broadcasting per second, and the frame number of broadcasting per second is arranged on described by setFPS (100)
In first image information object.Here, the frame number of described broadcasting per second is to be determined by the length information of image code, described figure
As code refers to that Morse encodes, therefore the frame number of broadcasting per second is set to 10 frames.
After the frame number of broadcasting per second is set, determine described completely black picture and the totalframes of described entirely white picture,
And totalframes is arranged in image object information;Here, described totalframes is the total bit determination according to image code, passes through
setNumberOfFrames(jpgs.length);Totalframes is set.
Width and the height of image, described width, after totalframes sets up, are set in the first image object information
Highly can be set according to different demands, in order to ensure terminal camera can accurately identify figure in the present embodiment
Picture, width and height are set to 60*60 by acquiescence.
After above- mentioned information is set, based on the frame number of broadcasting per second, signal generating unit 33 will using image generation algorithm
The totalframes of described completely black picture and described entirely white picture generates image.
Specifically, it is possible to use the Jim2Mov method in java carrys out transition diagram picture, a newly-built first Jim2Mov file
Folder, by the above-mentioned incoming described file of picture queue, then calls image generation algorithm saveMovie
(MovieInfoProvider.TYPE_AVI_MJPEG);Start to read totalframes, generate image.
Certainly, after getting image code, generating image by described least one set image code can also include:Generate single
Unit 33 determines that described first image encodes corresponding first brightness value and corresponding second brightness value of described second picture coding;Build
Vertical second image information object, and a control object is set in described second image information object;According to described first brightness
What value and described second brightness value controlled described control object in described second image information object flashes brightness and different bright
The flash rate of degree.And also represent interval using 3 waiting signals between every group of picture coding.
After image generates, described output unit 34 is used for exporting described image, so that opposite equip. can be by scanning institute
State image to obtain described cleartext information.Described image can be single picture or video.
Opposite equip. only needs to be scanned this image by the terminal with client of the present invention can get in plain text letter
Breath.Such as opposite equip. can be encrypted interaction in live video it is also possible to anywhere play, due to this image chi
Very little smaller, therefore can choose a corner to play this image when playing other videos.
Example IV
Corresponding to embodiment two, the present embodiment provides a kind of device of parsing information, as shown in figure 4, described device includes:
Receiving unit 41, scanning element 42 and the second converting unit 43;Wherein,
Described receiving unit 41 is used for receiving image, and described image can be single picture or video.
Scanning element 42 is used for scanogram, obtains least one set image code.
Specifically, because completely black picture and full the transfer interval between white picture be 100ms, therefore scanning element 42 is in scanning
During image, extract a picture every 100ms in the stream of photographic head, after extraction finishes, you can obtain picture queue.
Due to being two kinds of pictures of black and white used in the present embodiment, and the aberration of two pictures is larger.And image
In playing process, due to environment, temperature, display screen material etc. affects, and the color that photographic head obtains not is black and white purely
Color, therefore when obtaining picture, also needs to determine the color of each picture in picture queue.
Specifically, it is determined that the color of each picture includes in picture queue:Obtain the color value of photo current;Determine completely black figure
First Standard Colors value of piece, determines the second Standard Colors value of white picture entirely;Calculate described color value and the first Standard Colors
The absolute value of the first difference of value, and the absolute value of the second difference of described color value and described second Standard Colors value;According to
The absolute value of the absolute value of described first difference and described second difference determines the color of described photo current.
The absolute value of the absolute value according to described first difference and described second difference determines the color of described photo current,
Including:When the absolute value of the first difference is less than the absolute value of the second difference, the color of photo current is defined as black;When
When the absolute value of one difference is more than the absolute value of the second difference, the color of photo current is defined as white.
When obtaining the color value of photo current, it is possible to use bitmap.getPixel ();Method is obtaining.Here, because
It is in Android device, described picture is typically made up of red (R), green (G), blue (B) three kinds of colors, and tri- kinds of colors of RGB are divided
Do not show, therefore described in the present embodiment, the color value of picture refers to RGB color value, each color Shi You255Zhong stratum.
Here, the code reading the RGB color value of picture is as follows:
Int color=bitmap.getPixel (x, y);The colouring information of // acquisition current point
Int r=Color.red (color);// analyze the value of R in color
Int g=Color.green (color);// analyze the value of G in color
Int b=Color.blue (color);// analyze the value of B in color
The RGB color value of each picture can be obtained with above code.
So, the picture color in picture queue just can accurately be determined by scanning element 42, obtains black, Quan Baitu
The picture queue of piece.
Further, scanning element 42 sets up a character string queue, reuses for circulation time in Android coding
Go through described picture queue, in traversal, when getting picture, judge that described picture is white or black, determine that picture is white
After color or black, described completely black picture is converted to the first picture coding, described entirely white picture is converted to the second picture coding;
In the present embodiment, described first image coding and described second picture coding are Morse codings.Described Morse coding only has
Two characters of ". " and "-", will ". " represent goes out, "-" represent bright, therefore described first image coding can be ". ", the second image
Coding can be "-".
After scanning element 42 gets the first picture coding and the second picture coding, according to described first image coding and
Described second picture coding determines corresponding picture coding;Described image coding is combined obtaining described least one set image
Code.
After scanning element 42 gets image code, described second converting unit 43 is used for institute according to the second transformational rule
State least one set image code and be converted to cleartext information.
Specifically, described least one set image code is converted to digital information by described second converting unit 43, including:
According to default extracting rule, described image code is split as least one set picture coding, determines that each numeral is right
The picture coding answered.In the present embodiment, described image coding can include Morse coding, Morse coding be by point, draw,
Medium pause and sentence between the short pause of pause between putting and drawing, each intercharacter (between putting and drawing), each word
Between son, long pause is expressing series of characters.
When determining each digital corresponding picture coding, only need to determine that 0~9 corresponding Morse encodes, such as
Shown in table 1:
Table 1
From table 1 it follows that each numeral is made up of 5 Morse codings, and using 3 etc. between every group of numeral
Treat signal to represent interval, described waiting signal can be represented with ". ".So extract rule can be:In every group of image code
Extract once at interval of 5 characters, to obtain least one set picture coding.
So, extract once at interval of 5 characters in every group of picture coding, the corresponding number of this character is inquired about according to table 1
Word, will obtain the character string being made up of numeral and waiting signal ". " after inquiry finishes.After obtaining this character string, will be to wait
Signal ". " to cut character string for boundary line, just obtains data that one group of group is made up of numeral, so can be based on described every number
The corresponding picture coding of word and every group of picture coding, picture coding is converted to digital information.
Such as image code is " ... ..-........----..--- ", and described image code is split as picture coding respectively
For:“.....-....”…“.----..---”;According to table 1, the corresponding numeral of picture coding is respectively 56, three waits
Signal " ... " and 12;Finally understand, digital information is 56 and 12.
In the present embodiment, set unified and unique binary system because the character string of unicode coded format is one
Coding, therefore unicode coding is a piece of digital.So the present embodiment is that image code is converted to unicode coding realization figure
Conversion as code to digital information.
After getting digital information, the second converting unit 43 is additionally operable to for described digital information to be converted to character code.
Specifically, in the present embodiment, the 4th converting unit 43 is the coding by unicode code conversion for base64:
Transcode is as follows:
4th converting unit 43 uses above-mentioned code, and the data of return is exactly the character-coded data of Base64.
After getting character code, described 4th converting unit 43 is additionally operable to be converted to described character code to be stated clearly
Civilian information.
After getting character code, described 4th converting unit 43 utilizes code:
Base64.encodeToString(str.getBytes(),Base64.DEFAULT);
Just the character code of Base64 can be converted to cleartext information.
So, just complete the process of parsing information.
The beneficial effect that one or more of present invention embodiment is brought is:
The invention provides the method and device of a kind of transmission, parsing information, described transmission method includes:Obtain to be transmitted
The cleartext information of information;Described cleartext information is converted to character code;Described character code is converted to numeral letter accordingly
Breath;Described digital information is converted to by least one set image code according to the first transformational rule;By described least one set image code
Generate image, described image is the transmission result that described cleartext information is transmitted;So, convert information into image
Afterwards, the terminal of receive information need not set up any connection with the terminal of the information of transmission, without any network connection, only needs to utilize
Photographic head scans this image, you can obtains cleartext information, which reduces the triviality of data transfer, improves operation effect
Rate.
The above, only presently preferred embodiments of the present invention, be not intended to limit protection scope of the present invention, all
Any modification, equivalent and improvement of being made within the spirit and principles in the present invention etc., should be included in the protection of the present invention
Within the scope of.
Claims (10)
1. a kind of method of transmission information is it is characterised in that methods described includes:
Obtain the cleartext information of information to be transmitted;
Described cleartext information is converted to by least one set image code according to the first transformational rule;
Image is generated by described least one set image code;
Output described image, so that opposite equip. can obtain described cleartext information by scanning described image.
2. the method for claim 1 it is characterised in that according to the first transformational rule by described cleartext information be converted to
Few one group of image code includes:
Described cleartext information is converted to character code;
Described character code is converted to least one set digital information;
Determine the numerical value of every group digital information;
Determine each digital corresponding picture coding in described numerical value;
Based on the numerical value of each digital corresponding picture coding described and every group digital information, described every group digital information is changed
For corresponding picture coding;
Corresponding picture coding is combined forming image code.
3. method as claimed in claim 2 it is characterised in that by described least one set image code generate image, including:
Traversal described image code, obtains corresponding picture coding, and described image coding includes:First picture coding and the second image
Coding;
Described first image code conversion is completely black picture, described second picture coding is converted to white picture entirely, described complete
Black picture and described entirely white picture form picture queue;
First image information object is set up based on described picture queue, and per second broadcasting is set in described first image information object
The frame number put and the totalframes of described completely black picture and described entirely white picture;
Based on the frame number of broadcasting per second, using image generation algorithm, the totalframes of described completely black picture and described entirely white picture is given birth to
Become image.
4. a kind of method of parsing information is it is characterised in that methods described includes:
Receive and scanogram, obtain least one set image code;
Described least one set image code is converted to by cleartext information according to the second transformational rule.
5. method as claimed in claim 4, it is characterised in that scanogram, obtains least one set image code, including:
With default intermittent scanning described image, obtain picture queue;
Determine the picture color in described picture queue, described picture includes:Completely black picture and entirely white picture;
Travel through described picture queue, described completely black picture is converted to the first picture coding, described entirely white picture is converted to the
Two picture codings;
Corresponding picture coding is determined according to described first image coding and described second picture coding;
Described image coding is combined obtaining described least one set image code.
6. method as claimed in claim 5 is it is characterised in that determine that the picture color in described queue includes:
Obtain the color value of photo current;
Determine the first Standard Colors value of completely black picture, determine the second Standard Colors value of white picture entirely;
Calculate the absolute value of described color value and the first difference of the first Standard Colors value, and described color value and described second mark
The absolute value of the second difference of quasi- color value;
The absolute value of the absolute value according to described first difference and described second difference determines the color of described photo current.
7. method as claimed in claim 4 is it is characterised in that turn described least one set image code according to the second transformational rule
It is changed to cleartext information to include:
Described least one set image code is converted to digital information;
Described digital information is converted to character code;
Described character code is converted to described cleartext information.
8. method as claimed in claim 7, it is characterised in that described least one set image code is converted to digital information, is wrapped
Include:
According to default extracting rule, described image code is split as least one set picture coding;
Determine each digital corresponding picture coding;
Based on each digital corresponding picture coding described and every group of picture coding, picture coding is converted to described numeral letter
Breath.
9. a kind of device of transmission information is it is characterised in that described device includes:
Acquiring unit, for obtaining the cleartext information of information to be transmitted;
First converting unit, for being converted to least one set image code according to the first transformational rule by described digital information;
Signal generating unit, for generating image by described least one set image code;
Output unit, for exporting described image, so that opposite equip. can obtain described plaintext by scanning described image
Information.
10. a kind of device of parsing information is it is characterised in that described device includes:
Receiving unit, for receiving image;
Scanning element, for scanning described image, obtains least one set image code;
Second converting unit, for being converted to cleartext information according to the second transformational rule by described least one set image code.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610970059.2A CN106453161A (en) | 2016-11-03 | 2016-11-03 | Method and device for transmitting and analyzing information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610970059.2A CN106453161A (en) | 2016-11-03 | 2016-11-03 | Method and device for transmitting and analyzing information |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106453161A true CN106453161A (en) | 2017-02-22 |
Family
ID=58181142
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610970059.2A Pending CN106453161A (en) | 2016-11-03 | 2016-11-03 | Method and device for transmitting and analyzing information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106453161A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103248416A (en) * | 2013-04-23 | 2013-08-14 | 北京小米科技有限责任公司 | Information transmission method and device |
US20130324171A1 (en) * | 2010-07-26 | 2013-12-05 | Scott Redmond | Mobile multi-network communications device |
CN104348761A (en) * | 2013-07-30 | 2015-02-11 | 北京千橡网景科技发展有限公司 | Signal coding and decoding method |
CN105610497A (en) * | 2014-11-21 | 2016-05-25 | 阿里巴巴集团控股有限公司 | Data processing method, data processing device and data processing system for information interaction |
-
2016
- 2016-11-03 CN CN201610970059.2A patent/CN106453161A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130324171A1 (en) * | 2010-07-26 | 2013-12-05 | Scott Redmond | Mobile multi-network communications device |
CN103248416A (en) * | 2013-04-23 | 2013-08-14 | 北京小米科技有限责任公司 | Information transmission method and device |
CN104348761A (en) * | 2013-07-30 | 2015-02-11 | 北京千橡网景科技发展有限公司 | Signal coding and decoding method |
CN105610497A (en) * | 2014-11-21 | 2016-05-25 | 阿里巴巴集团控股有限公司 | Data processing method, data processing device and data processing system for information interaction |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101416220B (en) | For strengthening the pre-processing image data of compression | |
CN106330976B (en) | Information encryption and decryption method and device | |
CN104657698B (en) | A kind of color 2 D code decoding method for carrying several black and white Quick Response Codes | |
CN102156611B (en) | Method and apparatus for creating animation message | |
CN106228581B (en) | Pixel format is converted to the method and system of NV12 by GPU by ARGB | |
CN109831668B (en) | Data compression method and device, data coding/decoding method and device | |
CN102333201B (en) | Telepresence caption transmission method, terminal and system | |
CN102821279A (en) | Picture compression method keeping with alpha channel | |
EP3796648A1 (en) | Method and device for video signal processing | |
CN104966115A (en) | Method for filling two-dimensional code through image | |
CN106899861A (en) | A kind of photograph document handling method and its equipment, system | |
CN109005426A (en) | A kind of photograph document handling method | |
CN104463296B (en) | A kind of generation, acquisition and the processing method and system of two-dimension code structure information | |
CN107071515B (en) | A kind of photograph document handling method and system | |
CN105227873B (en) | A kind of test method and device of on-screen display data | |
CN110084030B (en) | Verification method and device based on picture verification code and computer readable storage medium | |
CN109040789A (en) | A kind of photograph document handling method | |
CN107852517A (en) | Transmitting device, transmission method, reception device and method of reseptance | |
CN104641368A (en) | Image processing apparatus, image forming apparatus, and recording medium | |
CN107483942A (en) | The decoding of video data compression code stream, the coding method of video data and device | |
CN103428575B (en) | Encoding and decoding control method of information overlaid in media stream or media file images | |
CN106453161A (en) | Method and device for transmitting and analyzing information | |
TW200533204A (en) | Method of image display with real time compression | |
CN100471181C (en) | System and method for applying various information in network game instant chatting | |
CN109948766B (en) | Multi-code composite color anti-counterfeiting two-dimensional code and generation and reading method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170222 |