CN103065177A - Coding method and system of two-dimension code - Google Patents
Coding method and system of two-dimension code Download PDFInfo
- Publication number
- CN103065177A CN103065177A CN2012105436535A CN201210543653A CN103065177A CN 103065177 A CN103065177 A CN 103065177A CN 2012105436535 A CN2012105436535 A CN 2012105436535A CN 201210543653 A CN201210543653 A CN 201210543653A CN 103065177 A CN103065177 A CN 103065177A
- Authority
- CN
- China
- Prior art keywords
- character
- color value
- color
- dimension code
- server
- 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.)
- Granted
Links
Images
Landscapes
- Information Transfer Between Computers (AREA)
- Color Image Communication Systems (AREA)
Abstract
The invention provides a coding method and a system of a two-dimension code, the method comprises the steps of a client-side converting characters into a byte digital group of corresponding to character utf-8 code, confirming the corresponding color value of the characters in accordance with a first preset strategy, portraying the color value in the two-dimension code data region, forming a two-dimension code image and sending the image to a server, the server reading and analyzing the two-dimension code image under process, obtaining the color value of the two-dimension code image, inquiring a color section table, and obtaining the corresponding characters, wherein the server confirming the color section table on the basis of the corresponding color value of the characters and a in accordance with second preset strategy.
Description
Technical field
The invention belongs to the instant messaging field, relate in particular to a kind of Quick Response Code coding method and system.
Background technology
Along with social develop rapidly, science and technology is applied in people's life more and more.At present, in the process of circulation of extensive stock, for increasing information capacity, on many commodity, can identify Quick Response Code, than bar code before, Quick Response Code can hold more Word message.Quick Response Code is mainly the combination of black and white color lump at present, and the character capacity that can store is less, greatly reduces the Quick Response Code actual application value.
Summary of the invention
The invention provides a kind of Quick Response Code coding method and system to address the above problem.
The invention provides a kind of Quick Response Code coding method, comprise the following steps.Client becomes the utf-8 of the character corresponding byte array of encoding by character conversion, determines according to the first preset strategy the color value that character is corresponding, and described color value is plotted in to the Quick Response Code data area, forms two-dimension code image and also sends to server.Described server reads and resolves pending two-dimension code image, obtains described pending two-dimension code image color value and inquires about the color interval table, obtains corresponding character.Wherein, the color value that described server is corresponding according to character, according to the second preset strategy, determine the color interval table.
The invention provides a kind of Quick Response Code coded system, comprise client and server, described client connects described server.Described client, for character conversion being become to the utf-8 of the character corresponding byte array of encoding, determine according to the first preset strategy the color value that character is corresponding, and described color value is plotted in to the Quick Response Code data area, form two-dimension code image and send to server.Described server, for reading and resolve pending two-dimension code image, obtain described pending two-dimension code image color value and inquire about the color interval table, obtains corresponding character.Also, for the color value corresponding according to character, according to the second preset strategy, determine the color interval table.
Compared to prior art, according to Quick Response Code coding method provided by the invention and system, client becomes the utf-8 of the character corresponding byte array of encoding by character conversion, determine according to the first preset strategy the color value that character is corresponding, and described color value is plotted in to the Quick Response Code data area, form two-dimension code image and send to server.The two-dimension code image that multiple color forms has been expanded the Quick Response Code capacity greatly.Described server reads and resolves pending two-dimension code image, obtains described pending two-dimension code image color value and inquires about the color interval table, obtains corresponding character.Wherein, the color value that described server is corresponding according to character, according to the second preset strategy, determine the color interval table.So, effectively expand the 2 D code information amount, improved actual application value.
The accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms the application's a part, and schematic description and description of the present invention the present invention does not form inappropriate limitation of the present invention for explaining.In the accompanying drawings:
Figure 1 shows that the process flow diagram of the Quick Response Code coding method that preferred embodiment according to the present invention provides,
Figure 2 shows that the schematic diagram of the Quick Response Code coded system that preferred embodiment according to the present invention provides.
Embodiment
Hereinafter with reference to accompanying drawing, also describe the present invention in detail in conjunction with the embodiments.It should be noted that, in the situation that do not conflict, embodiment and the feature in embodiment in the application can combine mutually.
Figure 1 shows that the process flow diagram of the Quick Response Code coding method that preferred embodiment according to the present invention provides.As shown in Figure 1, the Quick Response Code coding method that preferred embodiment of the present invention provides comprises step 101 ~ 102.
Step 101: client becomes the utf-8 of the character corresponding byte array of encoding by character conversion, determine according to the first preset strategy the color value that character is corresponding, and described color value is plotted in to the Quick Response Code data area, form two-dimension code image and send to server.
Particularly, the computing machine bottom has character and unique utf-8 coding corresponding to described character, and wherein the utf-8 of each character corresponding byte array length of encoding is 3, and the value of bits per inch value is between 1 ~ 255.Take partial character as example, and the utf-8 of described computing machine bottom character and character encodes corresponding byte array form for example shown in table 1.
Character | The utf-8 of the character corresponding byte array of encoding |
You | 230,130,168 |
Good | 229,165,189 |
Not | 230,156,170 |
Fly | 233,163,158 |
Table 1
The utf-8 of described character corresponding 3 the byte array values of encoding correspond respectively to R, G and the B value of color.In this, described the first preset strategy is that if the utf-8 of single character encodes corresponding byte array, three numerical value are a, b and c, wherein, described a, b and c be R, G and the B value of corresponding color respectively, color value=65536*R+256*G+B that described character is corresponding=65536*a+256*b+c.After described client is calculated the color value that described character is corresponding, described color value is converted to sexadecimal by the decimal system, and color is plotted in to Quick Response Code data area formation two-dimension code image.
Step 102: described server reads and resolves pending two-dimension code image, obtains described pending two-dimension code image color value and inquires about the color interval table, obtains corresponding character, wherein, the color value that described server is corresponding according to character, according to the second preset strategy, determine the color interval table.
Particularly, described the second preset strategy is, if the color value that single character is corresponding is Sn, the color value of Sn interval is Sn-(Sn-S (n-1))/2 to Sn+ (S (n+1)-Sn)/2, wherein n gets 1 o'clock, corresponding color value interval is 0 to s1+ (s2-s1)/2, and when n gets maximal value, corresponding color value interval is that Sn-(Sn-S (n-1))/2 is to 255*255*255=16581375.Wherein, the maximal value that described n is corresponding is all character sums in character repertoire, if Chinese characters in common use and other character add up to 6000, the maximal value of n is 6000.Described server stores color interval table, described color interval table comprises character and color value interval corresponding to described character.
For example, if client need be in two-dimension code image canned data comprise a word used for translation, eh, Sha and A Si character, described four character utf-8 corresponding byte array of encoding is respectively a word used for translation (229,144,150), (229,149,138), Sha (229,151,132) and Ah (233,152,191).If described four color values corresponding to character are respectively S1, S2, S3 and S4, client is calculated S1=65536*229+256*144+150=15044758 according to the first preset strategy, S2=65536*229+256*149+138=15046026, S3=65536*229+256*151+132=15046532, S4=65536*233+256*152+191=15308991.Described client is plotted in respectively the Quick Response Code data area by corresponding color after described S1 ~ S4 is converted to respectively to sexadecimal numerical value, after the formation two-dimension code image, sends to server.In the present embodiment, described two-dimension code image also comprises other character and corresponding color, and for ease of explanation, above-mentioned four characters of only take are example.
Described server stores color interval table, in the present embodiment, server is determined corresponding " a word used for translation " character of S1(according to the second preset strategy) the color value interval be 0 to 15044758+(15046026-15044758)/2,0 to 15045391.Calculate respectively S2(correspondence " " character) the color value interval be 15045392 to 15046278, S3(corresponding " Sha " characters) the color value interval be 15046279 to 15177761.In this, if S5 is 15508991, S4(corresponding " Ah "'s character) the color value interval be 15177762 to S4+(S5-S4)/2,15177762 to 15408991.Described color interval table comprises all characters of character repertoire and corresponding color value interval, and four characters of the present embodiment of take are example, and between described chromatic zones, the sheet format example is as shown in table 2.
Character | Corresponding color value interval |
A word used for translation | 0~15045391(15044758) |
? | 15045392~15046278(15046026) |
Sha | 15046279~15177761(15046532) |
Ah | 15177762~15408991(15308991) |
Table 2
If server reads and resolve a certain color in described two-dimension code image corresponding data zone, after obtaining the hexadecimal code of described color, converting decimal system color value to is 15044900.The color interval table of described server lookup self storage, determine that described color value 15044900 is in interval 0 ~ 15045391, corresponding " a word used for translation " character, and to obtain this character be a word used for translation to server.Similarly, server can obtain other character successively, and detailed process repeats no more.
Figure 2 shows that the schematic diagram of the Quick Response Code coded system that preferred embodiment according to the present invention provides.As shown in Figure 2, the Quick Response Code coded system that preferred embodiment of the present invention provides comprises client 201 and server 202, and described client 201 connects described server 202.Described client 201, for character conversion being become to the utf-8 of the character corresponding byte array of encoding, determine according to the first preset strategy the color value that character is corresponding, and described color value is plotted in to the Quick Response Code data area, form two-dimension code image and send to server 202.Described server 202, for reading and resolve pending two-dimension code image, obtain described pending two-dimension code image color value and inquire about the color interval table, obtains corresponding character.Also, for the color value corresponding according to character, according to the second preset strategy, determine the color interval table.Operating process about said system is described with above-mentioned method, therefore repeat no more in this.
In sum, Quick Response Code coding method and system that according to the present invention, preferred embodiment provides, client becomes the utf-8 of the character corresponding byte array of encoding by character conversion, determine according to the first preset strategy the color value that character is corresponding, and described color value is plotted in to the Quick Response Code data area, form two-dimension code image and send to server.The two-dimension code image that multiple color forms has been expanded the Quick Response Code capacity greatly.Described server reads and resolves pending two-dimension code image, obtains described pending two-dimension code image color value and inquires about the color interval table, obtains corresponding character.Wherein, the color value that described server is corresponding according to character, according to the second preset strategy, determine the color interval table.So, effectively expand the 2 D code information amount, improved actual application value.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.
Claims (5)
1. a Quick Response Code coding method, is characterized in that, comprises the following steps:
Client becomes the utf-8 of the character corresponding byte array of encoding by character conversion, determines according to the first preset strategy the color value that character is corresponding, and described color value is plotted in to the Quick Response Code data area, forms two-dimension code image and also sends to server;
Described server reads and resolves pending two-dimension code image, obtains described pending two-dimension code image color value and inquires about the color interval table, obtains corresponding character,
Wherein, the color value that described server is corresponding according to character, according to the second preset strategy, determine the color interval table.
2. method according to claim 1, it is characterized in that, described the first preset strategy is, if the utf-8 of single character encodes corresponding byte array, three numerical value are a, b and c, wherein, described a, b and c be R, G and the B value of corresponding color respectively, color value=65536*R+256*G+B that described character is corresponding=65536*a+256*b+c.
3. method according to claim 1, is characterized in that, described server stores color interval table, and described color interval table comprises character and color value interval corresponding to described character.
4. method according to claim 1, it is characterized in that, described the second preset strategy is, if the color value that single character is corresponding is Sn, the color value of Sn interval is Sn-(Sn-S (n-1))/2 to Sn+ (S (n+1)-Sn)/2, wherein n gets 1 o'clock, corresponding color value interval is 0 to s1+ (s2-s1)/2, when n gets maximal value, corresponding color value interval is that Sn-(Sn-S (n-1))/2 is to 255*255*255=16581375, wherein, described maximal value refers to all character sums in character repertoire.
5. a Quick Response Code coded system, is characterized in that, comprises client and server, and described client connects described server,
Described client, for character conversion being become to the utf-8 of the character corresponding byte array of encoding, determine according to the first preset strategy the color value that character is corresponding, and described color value is plotted in to the Quick Response Code data area, form two-dimension code image and send to server;
Described server, for reading and resolve pending two-dimension code image, obtain described pending two-dimension code image color value and inquire about the color interval table, obtains corresponding character;
Also, for the color value corresponding according to character, according to the second preset strategy, determine the color interval table.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210543653.5A CN103065177B (en) | 2012-12-14 | 2012-12-14 | Coding method and system of two-dimension code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210543653.5A CN103065177B (en) | 2012-12-14 | 2012-12-14 | Coding method and system of two-dimension code |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103065177A true CN103065177A (en) | 2013-04-24 |
CN103065177B CN103065177B (en) | 2015-05-27 |
Family
ID=48107800
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210543653.5A Expired - Fee Related CN103065177B (en) | 2012-12-14 | 2012-12-14 | Coding method and system of two-dimension code |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103065177B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105117758A (en) * | 2015-08-31 | 2015-12-02 | 武汉大学 | Colored two-dimensional code based mobile platform security communication method |
CN107423797A (en) * | 2017-07-31 | 2017-12-01 | 成都新得利电子有限公司 | A kind of security code information generating method |
CN111353321A (en) * | 2020-02-24 | 2020-06-30 | 口碑(上海)信息技术有限公司 | Data generating and analyzing method and device, computer storage medium and electronic device |
CN112395830A (en) * | 2019-07-31 | 2021-02-23 | 腾讯科技(深圳)有限公司 | Form processing method based on Wan Guo code and related device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1818935A (en) * | 2006-03-17 | 2006-08-16 | 北京紫光捷通科技有限公司 | Two-dimensional code construction based on hexadecimal coding |
CN1862525A (en) * | 2005-05-11 | 2006-11-15 | 上海迪比特实业有限公司 | Code conversion method |
CN102117419A (en) * | 2011-02-23 | 2011-07-06 | 深圳市融创天下科技发展有限公司 | Method, device, system and terminal equipment for generating and recognizing two-dimension code |
CN102243712A (en) * | 2010-05-14 | 2011-11-16 | 上海彩码信息科技有限公司 | Generation method and system thereof for colored bar code, and analytic method and system thereof for colored bar code |
-
2012
- 2012-12-14 CN CN201210543653.5A patent/CN103065177B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1862525A (en) * | 2005-05-11 | 2006-11-15 | 上海迪比特实业有限公司 | Code conversion method |
CN1818935A (en) * | 2006-03-17 | 2006-08-16 | 北京紫光捷通科技有限公司 | Two-dimensional code construction based on hexadecimal coding |
CN102243712A (en) * | 2010-05-14 | 2011-11-16 | 上海彩码信息科技有限公司 | Generation method and system thereof for colored bar code, and analytic method and system thereof for colored bar code |
CN102117419A (en) * | 2011-02-23 | 2011-07-06 | 深圳市融创天下科技发展有限公司 | Method, device, system and terminal equipment for generating and recognizing two-dimension code |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105117758A (en) * | 2015-08-31 | 2015-12-02 | 武汉大学 | Colored two-dimensional code based mobile platform security communication method |
CN107423797A (en) * | 2017-07-31 | 2017-12-01 | 成都新得利电子有限公司 | A kind of security code information generating method |
CN107423797B (en) * | 2017-07-31 | 2020-11-06 | 成都新得利电子有限公司 | Anti-counterfeiting code information generation method |
CN112395830A (en) * | 2019-07-31 | 2021-02-23 | 腾讯科技(深圳)有限公司 | Form processing method based on Wan Guo code and related device |
CN111353321A (en) * | 2020-02-24 | 2020-06-30 | 口碑(上海)信息技术有限公司 | Data generating and analyzing method and device, computer storage medium and electronic device |
CN111353321B (en) * | 2020-02-24 | 2023-11-10 | 口碑(上海)信息技术有限公司 | Data generation and analysis method and device, computer storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN103065177B (en) | 2015-05-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103065177A (en) | Coding method and system of two-dimension code | |
CN103400174B (en) | The coded method of a kind of Quick Response Code, coding/decoding method and system | |
CN106170921A (en) | Relate to source code and the decoding method and device of the data of sign compression | |
CN101350858B (en) | Method for decoding short message and user terminal | |
CN107145730A (en) | DICOM medical images file reads adaption system | |
US11202083B2 (en) | Encoder, decoder and method employing palette utilization and compression | |
CN105450232A (en) | Encoding method, decoding method, encoding device and decoding device | |
US11070231B2 (en) | Reducing storage of blockchain metadata via dictionary-style compression | |
CN114286102A (en) | Binary image compression coding and decoding method based on Base62 coding | |
CN101557399A (en) | Method for compression and decompression of XMPP protocol transmission data | |
CN106919882A (en) | A kind of method that two-dimentional digital content switchs to pure digi-tal symbolic coding | |
RU2013153468A (en) | DATA CODING METHOD, DATA DECODING METHOD, CODER, DECODER AND CODEC | |
CN104380832A (en) | Compression devices, decompression devices, compression methods, and decompression methods | |
CN103020686B (en) | A kind of Quick Response Code colour coding method and system | |
CN103702133A (en) | Image compression display method and image compression display device | |
US20200321079A1 (en) | Encoding/decoding method, encoder/decoder, storage method and device | |
CN103020685B (en) | A kind of Quick Response Code coding extending method and system | |
CN105468712A (en) | Data storage compatibility method | |
JP2012085274A (en) | Computer-implemented method of encoding text on matrix code symbol, computer-implemented method of decoding matrix code symbol, encoder for encoding text on matrix code symbol, and decoder for decoding matrix code symbol | |
CN103034835B (en) | Two-dimensional code processing method and two-dimensional code client-side | |
CN111368575B (en) | One-dimensional bar code encoding and decoding method and system | |
CN102521261A (en) | Method for manufacturing dot matrix word stock according to vector word stock | |
CN102982046A (en) | Storage method and system for webpage data compression | |
CN111447427B (en) | Depth data transmission method and device | |
US9235610B2 (en) | Short string compression |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C56 | Change in the name or address of the patentee | ||
CP01 | Change in the name or title of a patent holder |
Address after: Suzhou City, Jiangsu province 215121 Fengting Avenue Suzhou Industrial Park No. 666 Weiting Intelligent Industrial Park Building 8 Patentee after: Kuo Di education and science company limited Address before: Suzhou City, Jiangsu province 215121 Fengting Avenue Suzhou Industrial Park No. 666 Weiting Intelligent Industrial Park Building 8 Patentee before: Suzhou Kuodi Network Technology Co., Ltd. |
|
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20150527 Termination date: 20191214 |