Invention content
The object of the present invention is to provide a kind of coding/decoding method of image in 2 D code, the decoding apparatus of image in 2 D code, two dimensionsThe code generation method of image and the generating means of image in 2 D code, do not have confidentiality to solve conventional two-dimensional code image,There are problems that certain security risk.
In order to solve the above technical problems, the present invention provides a kind of coding/decoding method of image in 2 D code, including:
In response to the request being decoded to image in 2 D code that active user sends out, the image in 2 D code is presetSubregion is decoded, and obtains biological attribute data;
The biological attribute data with the standard biological characteristic to prestore is matched, determines matching value;
Judge whether the matching value is more than preset matching value;
If the matching value is more than preset matching value, the target data subregion of the image in 2 D code is decoded,Obtain target data.
Wherein, if being more than preset matching value in the matching value, to the target data point of the image in 2 D codeArea is decoded, after obtaining target data, including:
The target data is returned into the active user.
Wherein, judge that the matching value whether more than after preset matching value, further includes described:
If the matching value is not more than the preset matching value, prompt the active user can not be to the Quick Response Code figureAs being decoded.
Wherein, it is decoded in the default subregion to image in 2 D code, before obtaining biological attribute data, including:
Alignment code in image in 2 D code determines the default subregion of the image in 2 D code.
Wherein, the biological condition code is iris feature code.
Wherein, it is decoded in the default subregion to image in 2 D code, after obtaining biological attribute data, including:
Using the biological characteristic error correcting code in the image in 2 D code, error correction is carried out to the biological attribute data.
It is corresponding, the present invention also provides a kind of decoding apparatus of image in 2 D code, including:
Default subregion decoder module:For the request being decoded to image in 2 D code sent out in response to active user,The default subregion of the image in 2 D code is decoded, obtains biological attribute data;
Matching module:For the biological attribute data to be matched with the standard biological characteristic to prestore, determineMatching value;
Judgment module:For judging whether the matching value is more than preset matching value;
Target data subregion decoder module:If it is more than preset matching value for the matching value, to the Quick Response Code figureThe target data subregion of picture is decoded, and obtains target data.
In addition, the present invention also provides a kind of generation method of image in 2 D code, including:
Obtain the biological attribute data to prestore;
The biological attribute data is encoded, determines corresponding biological characteristic coding;
Target data is encoded, determines corresponding target data coding;
The first geometric figure and the second geometry are determined according to biological characteristic coding and target data coding respectivelyFigure;
First geometric figure is saved in the default subregion of image in 2 D code, second geometric figure is saved inThe target data subregion of the image in 2 D code, to complete the generation of the image in 2 D code.
Wherein, the biological attribute data is encoded described, after determining corresponding biological characteristic coding, packetIt includes:
It is encoded according to the biological characteristic, determines corresponding biological characteristic error correcting code.
Finally, the present invention also provides a kind of generating means of image in 2 D code, including:
Biological attribute data acquisition module:For obtaining the biological attribute data to prestore;
Biological attribute data coding module:For being encoded to the biological attribute data, determine that corresponding biology is specialAssemble-publish code;
Target data coding module:For being encoded to target data, corresponding target data coding is determined;
Geometric figure determining module:For determining the according to biological characteristic coding and target data coding respectivelyOne geometric figure and the second geometric figure;
Image in 2 D code generation module:For first geometric figure to be saved in the default subregion of image in 2 D code,Second geometric figure is saved in the target data subregion of the image in 2 D code, to complete the life of the image in 2 D codeInto.
In summary, the coding/decoding method of image in 2 D code provided by the present invention, can be first before being decoded to target dataThe biological attribute data in image in 2 D code is obtained, then biological attribute data and the standard biological characteristic to prestore are carried outMatching, determines matching value, then judges whether matching value is more than preset matching value, is only more than preset matching value in matching valueUnder the conditions of, it just will continue to be decoded the target data in image in 2 D code, so that image in 2 D code has secrecyProperty effectively reduces the security risk of image in 2 D code.
In addition, the present invention also provides a kind of decoding apparatus of image in 2 D code, the generation method of image in 2 D code, two dimensionsThe generating means of code image, effect is corresponding with the coding/decoding method of above-mentioned image in 2 D code, and which is not described herein again.
Specific embodiment
The core of the present invention is to provide a kind of coding/decoding method of image in 2 D code, the decoding apparatus of image in 2 D code, two dimensionThe code generation method of image and the generating means of image in 2 D code so that image in 2 D code has confidentiality, effectively reducesThe security risk of image in 2 D code.
In order to which those skilled in the art is made to more fully understand the present invention program, with reference to the accompanying drawings and detailed descriptionThe present invention is described in further detail.Obviously, described embodiment be only part of the embodiment of the present invention rather thanWhole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premiseLower all other embodiments obtained, shall fall within the protection scope of the present invention.
Start that a kind of image in 2 D code coding/decoding method embodiment provided by the invention is discussed in detail below, referring to Fig. 1, the realityExample is applied to include:
Step S11:In response to the request being decoded to image in 2 D code that active user sends out, to the Quick Response Code figureThe default subregion of picture is decoded, and obtains biological attribute data.
Specifically, alignment code that can first in image in 2 D code, the default subregion of the image in 2 D code is determined.
Default subregion mentioned in the present invention refers to the subregion for preserving biological attribute data coding information.BiologyCharacteristic refers to the characteristic with unique mark, for example, iris characteristic data, fingerprint characteristic data etc..
After biological attribute data is obtained, as a kind of preferred embodiment, it can also utilize in the image in 2 D codeBiological characteristic error correcting code carries out error correction to the biological attribute data.
Step S12:The biological attribute data with the standard biological characteristic to prestore is matched, determines matchingValue.
Herein, the standard biological characteristic to prestore is referred to target data permission in acquisition image in 2 D codeValidated user biological attribute data.
Step S13:Judge whether the matching value is more than preset matching value.
The preset matching value referred in step S13 is a pre-set numerical value before image in 2 D code is decoded, and is usedIn the identity for distinguishing active user and validated user.Specifically, matching value can be a percentage, the value range of matching valueCan be 0% to 100%, preset matching value could be provided as 70%.It is assumed that the matching value that step S12 is determined is 67%, then67% is less than 70%, then it is assumed that active user is not validated user.In this case, active user is not allowed to obtain Quick Response Code figureTarget data as in can return to a prompt message to active user, prompt active user can not be to the Quick Response Code figureAs being decoded.
Step S14:If the matching value is more than preset matching value, to the target data subregion of the image in 2 D code intoRow decoding, obtains target data.
Target data refers mainly to, and user wishes the part critical data transmitted by image in 2 D code.Specifically,To after target data, the target data is returned into the active user.
As it can be seen that the coding/decoding method embodiment of image in 2 D code provided by the present invention, before being decoded to target data, meetingFirst obtain the biological attribute data in image in 2 D code, then to biological attribute data and the standard biological characteristic that prestores intoRow matching, determines matching value, then judges whether matching value is more than preset matching value, is only more than preset matching value in matching valueUnder conditions of, it just will continue to be decoded the target data in image in 2 D code, so that image in 2 D code has guarantorClose property effectively reduces the security risk of image in 2 D code.
The decoding apparatus embodiment of image in 2 D code provided by the invention is introduced below, Quick Response Code described belowThe decoding apparatus of image can correspond reference with the coding/decoding method of above-described image in 2 D code.
Fig. 2 is the structure diagram of the decoding apparatus embodiment of image in 2 D code provided by the invention, with reference to Fig. 2, the deviceIt can include:
Default subregion decoder module 21:It is asked for what is sent out in response to active user to what image in 2 D code was decodedIt asks, the default subregion of the image in 2 D code is decoded, obtains biological attribute data.
Matching module 22:For the biological attribute data to be matched with the standard biological characteristic to prestore, reallyDetermine matching value.
Judgment module 23:For judging whether the matching value is more than preset matching value.
Target data subregion decoder module 24:If it is more than preset matching value for the matching value, to the Quick Response CodeThe target data subregion of image is decoded, and obtains target data.
The decoding apparatus of the image in 2 D code of the present embodiment is used to implement the coding/decoding method of aforementioned image in 2 D code, thereforeThe embodiment part of the coding/decoding method of the visible image in 2 D code hereinbefore of specific embodiment in the device, for example, defaultSubregion decoder module 21, matching module 22, judgment module 23, target data subregion decoder module 24, are respectively used to realize above-mentionedStep S11, step S12, step S 13, step S14 in the coding/decoding method embodiment of image in 2 D code, so, specific implementationMode is referred to the description of corresponding various pieces embodiment, and details are not described herein.
Due to the decoding apparatus embodiment of image in 2 D code provided by the invention, it is used to implement the solution of aforementioned image in 2 D codeCode method, therefore, the effect of the device embodiment are corresponding with the effect of the coding/decoding method embodiment of aforementioned image in 2 D code, thisIn repeat no more.
Corresponding with the coding/decoding method of image in 2 D code, the present invention also provides a kind of generation sides of image in 2 D codeMethod, for generating the image in 2 D code mentioned in a kind of coding/decoding method with image in 2 D code.
Start to be discussed in detail a kind of generation method embodiment of image in 2 D code provided by the invention below, it, should referring to Fig. 3Embodiment specifically includes:
Step S31:Obtain the biological attribute data to prestore.
Here the biological attribute data to prestore refers to the biological attribute data of validated user obtained in advance, specifically,It can be iris characteristic data.
Step S32:The biological attribute data is encoded, determines corresponding biological characteristic coding.
As a kind of preferred embodiment, can be encoded after the biological characteristic coding is obtained according to the biological characteristic,It determines corresponding biological characteristic error correcting code, for ensureing after part image in 2 D code is damaged, can still decodeThe biological attribute data.
Step S33:Target data is encoded, determines corresponding target data coding.
Target data can refer to user and wish the critical data transmitted by image in 2 D code.
Step S34:Respectively according to the biological characteristic coding and the target data coding determine the first geometric figure andSecond geometric figure.
Step S35:First geometric figure is saved in the default subregion of image in 2 D code, by second geometric graphShape is saved in the target data subregion of the image in 2 D code, to complete the generation of the image in 2 D code.
Default subregion can refer to the subregion of pre-specified storage biological attribute data, correspondingly, target data subregionRefer to the subregion of pre-specified stored target data.
As it can be seen that the generation method of image in 2 D code provided by the invention, can generate one kind and not only include target data,Image in 2 D code comprising biological attribute data.Coding/decoding method such as above-mentioned image in 2 D code is described, sets preset rules,Make user before target data is got, need first to obtain the biological attribute data included in image in 2 D code, then in advanceThe standard biological characteristic deposited is matched, and determines matching value, only in matching value under conditions of, just user is allowed to obtainTake the target data in image in 2 D code.So that image in 2 D code has confidentiality, greatly reduce and pass through Quick Response CodeThe security risk of image transmission data information.
The generating means embodiment of image in 2 D code provided by the invention is introduced below, Quick Response Code described belowThe generating means of image can correspond reference with the generation method of above-described image in 2 D code.
Fig. 4 is the structure diagram of the generating means embodiment of image in 2 D code provided by the invention, with reference to Fig. 4, the deviceIt can include
Biological attribute data acquisition module 41:For obtaining the biological attribute data to prestore.
Biological attribute data coding module 42:For being encoded to the biological attribute data, corresponding biology is determinedFeature coding.
Target data coding module 43:For being encoded to target data, corresponding target data coding is determined.
Geometric figure determining module 44:It is determined for being encoded respectively according to biological characteristic coding and the target dataFirst geometric figure and the second geometric figure.
Image in 2 D code generation module 45:For first geometric figure to be saved in default point of image in 2 D codeSecond geometric figure is saved in the target data subregion of the image in 2 D code by area, to complete the image in 2 D codeGeneration.
The generating means of the image in 2 D code of the present embodiment are used to implement the generation method of aforementioned image in 2 D code, thereforeThe embodiment part of the generation method of the visible image in 2 D code hereinbefore of specific embodiment in the device, for example, biologicalCharacteristic acquisition module 41, biological attribute data coding module 42, target data coding module 43, geometric figure determining module44th, image in 2 D code generation module 45, be respectively used to step S31 in the generation method embodiment for realizing above-mentioned image in 2 D code,Step S32, step S33, step S34, step S35, so, specific embodiment is referred to corresponding various pieces and implementsThe description of example, details are not described herein.
Due to the generating means embodiment of image in 2 D code provided by the invention, it is used to implement the life of aforementioned image in 2 D codeInto method, therefore, the effect of the device embodiment is corresponding with the effect of the generation method embodiment of aforementioned image in 2 D code, thisIn repeat no more.
Each embodiment is described by the way of progressive in this specification, the highlights of each of the examples are with it is otherThe difference of embodiment, just to refer each other for same or similar part between each embodiment.For dress disclosed in embodimentFor putting, since it is corresponded to the methods disclosed in the examples, so description is fairly simple, related part is referring to method partExplanation.
Professional further appreciates that, with reference to each exemplary unit of the embodiments described herein descriptionAnd algorithm steps, can be realized with the combination of electronic hardware, computer software or the two, in order to clearly demonstrate hardware andThe interchangeability of software generally describes each exemplary composition and step according to function in the above description.TheseFunction is performed actually with hardware or software mode, specific application and design constraint depending on technical solution.ProfessionTechnical staff can realize described function to each specific application using distinct methods, but this realization should notThink beyond the scope of this invention.
It can directly be held with reference to the step of method or algorithm that the embodiments described herein describes with hardware, processorThe combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only depositReservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technologyIn any other form of storage medium well known in field.
Coding/decoding method to image in 2 D code provided by the present invention, the decoding apparatus of image in 2 D code, Quick Response Code aboveThe generation method of image and the generating means of image in 2 D code are described in detail.Specific case used herein is to thisThe principle and embodiment of invention is expounded, the explanation of above example is only intended to help understand the present invention method andIts core concept.It should be pointed out that for those skilled in the art, in the premise for not departing from the principle of the inventionUnder, can also to the present invention some improvement and modification can also be carried out, these improvement and modification also fall into the protection of the claims in the present inventionIn the range of.