The method of claim data information type, device and terminal in a kind of two-dimension code
Technical field
The invention relates to planar bar code technology, is method, device and terminal about claim data information type in a kind of two-dimension code concretely.
Background technology
At present, planar bar code technology is widely used on mobile phone, and the mobile phone bar code is seen everywhere, and use two-dimension code on mobile phone, and mobile phone also will be downloaded corresponding decoding software except having camera function.Although the two-dimension code by different subject of operation's issues uses identical planar bar code technology, such as, QuickResponse (QR) sign indicating number technology, the form of different application layers can have nothing in common with each other.
As shown in Figure 1, be the composition of China Mobile's two-dimension code and the synoptic diagram of use.The mobile phone two-dimension code of China Mobile is supported DR sign indicating number and QR sign indicating number simultaneously.Sign indicating number figure among the figure is identified as 7000 by cell phone software, and generate a content and be 7000 note and send to 700066, then, in receiving an answer short message, comprised a WAP network address, cell phone software starts this WAP site of browser access after the address is prompted to user's affirmation.From this flow process, have only 7000 information that comprise among yard figure to be discerned by any DR sign indicating number software, but the process of follow-up content of sending short messages and startup WAP browser then is the specific action of China Mobile's two-dimension code business of networking, needs special software to realize.
Japanese Docomo two-dimension code is used phonebook registration for another example, and a two-dimension code figure is identified as text: MECARD:N:Docomo, Taro; SOUND:docomotaro; TEL:03XXXXXXXX; TEL:090XXXXXXXX; EMAIL:docomotaro@aa.bbb.co.jp; EMAIL:docomo.taro.xx@docomo.According to the requirement of Docomo, if comprise MECARD in the text:, then according to being shown to the user as shown in Figure 2, when the user selected " Add to phonebook ", this associated person information was directed in the yellow pages of mobile phone.Docomo also has other business, if any E-mailsynchronization (MATMSG) and Bookmark registration (MEBKM) etc.In order to support these business, Docomo will stipulate the form of data, has defined a plurality of identifiers (identifiers), as MECARD, MATMSG, MEBKM etc., different identifiers has different attribute (property), as SOUND, TEL, TEL-AV, EMAIL etc.
In addition, as shown in Figure 3, Docomo has also added information icons outside QR sign indicating number figure, to provide information to the user, is used for statement to the requirement of mobile phone software capability.
The form of two-dimension code self is paid attention in present two-dimension code standardization, for using, is what is then even more important to the content that sign indicating number carried.But, what we saw at present then is, each operator does things in his own way, for the user, even the business that similar this class of importing phone directory and operator are irrelevant, also need to install the different implementation methods that a plurality of softwares are dealt with each operator, for example, KDDI and Docomo have defined the form of different yellow pages.
Two-dimension code mainly is to text code at present, and text has different implications.Two-dimension code may be as the carrier of any literal, as the supplementary of literal identification.Therefore, we need a kind of unified coding method.
Summary of the invention
The purpose of the embodiment of the invention is to provide the method and the device of the information type of claim data in a kind of two-dimension code, is used to define a unified framework, realizes the various data type information of carrying on the two-dimension code.
To achieve these goals, the embodiment of the invention provides the method for the information type of claim data in a kind of two-dimension code, and this method comprises: generate the application data type information; Described application data type information and application data are carried out jointly two-dimensional encoded, generate two-dimension code sign indicating number figure.
To achieve these goals, the embodiment of the invention also provides the device of the information type of claim data in a kind of two-dimension code, and this device comprises: information generating unit is used to generate the application data type information; Sign indicating number figure generation unit, be used for described application data type information and application data are carried out jointly two-dimensional encoded, generation two-dimension code sign indicating number figure.
To achieve these goals, the embodiment of the invention also provides a kind of terminal, and described terminal comprises the device of claim data type in the two-dimension code, and wherein, described device comprises: information generating unit is used to generate the application data type information; Sign indicating number figure generation unit, be used for described application data type information and application data are carried out jointly two-dimensional encoded, generation two-dimension code sign indicating number figure.
The beneficial effect of the embodiment of the invention: as can be seen from such scheme, the method of the information type of claim data in a kind of two-dimension code that the embodiment of the invention provides, the device of the information type of claim data in a kind of two-dimension code, because the claim information of application data is added in the application data, formed a general framework, make the application scenarios of various two-dimension codes by normalization, make general recognition application software become possibility.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the composition of China Mobile's two-dimension code in the prior art and the synoptic diagram of use;
Fig. 2 is the synoptic diagram of phone registration among the prior art Docomo;
Fig. 3 is the additional communication icon of prior art QR sign indicating number figure and outside thereof;
Fig. 4 is the method flow diagram of the embodiment of the invention;
Fig. 5 is the installation drawing of the embodiment of the invention;
Fig. 6 is the terminal synoptic diagram of the embodiment of the invention;
Fig. 7 is the corresponding relation figure of two code streams of the embodiment of the invention;
Fig. 8 is the formation process flow diagram of embodiment of the invention two-dimension code sign indicating number figure.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
As shown in Figure 4, be the method flow diagram of the embodiment of the invention, concrete steps are as follows:
Step S401: generate the application data type information;
Step S401: described application data type information and application data are carried out jointly two-dimensional encoded, generate two-dimension code sign indicating number figure.
In a preferential embodiment, described application data type information and application data are carried out two-dimensional encoded comprising jointly: described application data is carried out two-dimensional encoded, generate the two-dimension code bit stream of application data; Described application data type information is carried out two-dimensional encoded, generate the two-dimension code bit stream of application data type information; The two-dimension code bit stream of the two-dimension code bit stream of described application data and application data type information is carried out jointly two-dimensional encoded, generate synthetic two-dimension code bit stream.Described application data is carried out two-dimensional encoded, the two-dimension code bit stream that generates application data comprises: according to extended channel explanation ECI described application data is carried out two-dimensional encodedly, generate the code stream that comprises at least two ECI; The described code stream that comprises at least two ECI is carried out two-dimensional encoded, generate the two-dimension code bit stream of described application data.Add padding data, error correcting code, layout data and mask data at described synthetic two-dimension code bit stream, generate described two-dimension code sign indicating number figure.Described generation application data type information is meant: adopt the form of the Content Type of http protocol to generate the application data type information.
As shown in Figure 5, be the structure drawing of device of the embodiment of the invention.Described device comprises: information generating unit 501 is used to generate the application data type information; Sign indicating number figure generation unit 502, be used for described application data type information and application data are carried out jointly two-dimensional encoded, generation two-dimension code sign indicating number figure.
In a preferential embodiment, described sign indicating number figure generation unit 502 comprises: application data bit stream generation module, be used for described application data is carried out two-dimensional encoded, and generate the two-dimension code bit stream of application data; Application data type information bit stream generation module is used for described application data type information is carried out two-dimensional encoded, generates the two-dimension code bit stream of application data type information; Synthetic two-dimension code bit stream generation module is used for two-dimension code bit stream with the two-dimension code bit stream of described application data and application data type information and carries out two-dimensional encodedly jointly, generates synthetic two-dimension code bit stream.Described two-dimension code sign indicating number map generalization mode is meant: add padding data, error correcting code, layout data and mask data at described synthetic two-dimension code bit stream.
The embodiment of the invention provides a kind of terminal, and described terminal comprises the device of the information type of claim data in the two-dimension code, and described terminal for example can be mobile phone, personal digital assistant, computing machine etc.Only be the terminal of the example explanation embodiment of the invention below with the mobile phone.Fig. 6 is the terminal synoptic diagram of the embodiment of the invention.As shown in Figure 6, described terminal is a mobile phone 600, and described mobile phone comprises the device 601 of the information type of claim data in the two-dimension code.Described device comprises: information generating unit 501 is used to generate the application data type information; Sign indicating number figure generation unit 502, be used for described application data type information and application data are carried out jointly two-dimensional encoded, generation two-dimension code sign indicating number figure.Described sign indicating number figure generation unit comprises: application data bit stream generation module, be used for described application data is carried out two-dimensional encoded, and generate the two-dimension code bit stream of application data; Application data type information bit stream generation module is used for described application data type information is carried out two-dimensional encoded, generates the two-dimension code bit stream of application data type information; Synthetic two-dimension code bit stream generation module is used for two-dimension code bit stream with the two-dimension code bit stream of described application data and application data type information and carries out two-dimensional encodedly jointly, generates synthetic two-dimension code bit stream.
Two-dimension code (2-dimensional bar code) is a kind of new coding techniques, the chequered with black and white graphic recording data symbol information that (on the two-dimensional directional) distributes on the plane according to certain rules with certain specific geometric figure; On coding, utilize " 0 ", the notion of " 1 " bit stream that constitutes the computer-internal logical foundations dexterously, use several and the corresponding geometrical body of scale-of-two to represent the literal numerical information, handle automatically with realization information by image input device or photoelectric scanning device automatically identifying and reading.
Extended channel explanation ECI (Extended Channel Interpretation) is supported by most planar bar code technology.ECI supports compress technique, and it requires data source is done compression, and states the compression algorithm that this data source adopts with ECI.In the two-dimension code, may comprise a plurality of compression algorithms, cut apart with different ECI.To QR sign indicating number cataloged procedure, ECI is given tacit consent in being encoded to of employing, and the octet pattern is carried out the two-dimension code coding.
The present invention introduces Content Type on the application data of two-dimension code, and follows the standard of rfc2046, makes this method for expressing have versatility.In order to introduce Content Type, defined a kind of data layout and carried out Content Type statement.Adopt the form of ContentType among the reponse header of similar HTTP to come the semanteme of claim data.Content Type form is as follows:
"Content-Type"":"type"/"subtype
*(";"parameter)
For example, Content-Type:text/html; Charset=ISO-8859-4.Wherein, Content-Type is optionally, if do not have, then represents text/plain; Charset=us-ascii.
It is two-dimensional encoded that application data is carried out data according to the octet pattern-coding, is code stream according to the ECI normative translation promptly, and this code stream may contain a plurality of ECI, so, this code stream is used the octet pattern-coding once more, obtain a new code stream, new code stream has only an ECI section.
Content Type claim information is appended in the application data, the ContentType claim information, for example, Content-Type:text/html; This character string of charset=ISO-8859-4 utilizes the alphanumeric pattern to carry out digital coding, also is converted to code stream.
Then, two code streams are coupled together.Section 2 corresponding Content-Type statements, section 1 corresponding application data.Corresponding relation as shown in Figure 7.
Carry out two-dimensional encoded according to the octet pattern-coding two code streams that couple together.Carry out operation as shown in Figure 8 then, just can obtain a two-dimension code sign indicating number figure.
Step S801: fill the data that comprise end mark, be filled into designated capabilities;
Step S802: add error correcting code, realize correct recognition to coding;
Step S803: as required the data of each several part are arranged;
Step S804: mask.
The beneficial effect of the embodiment of the invention: the method for the information type of claim data in a kind of two-dimension code that the embodiment of the invention provides, the device of the information type of claim data in a kind of two-dimension code, because the claim information of application data is added in the application data, formed a general framework, make the application scenarios of various two-dimension codes by normalization, make general recognition application software become possibility.