CN109902242A - A kind of picture storage method in two dimensional code - Google Patents

A kind of picture storage method in two dimensional code Download PDF

Info

Publication number
CN109902242A
CN109902242A CN201910151332.2A CN201910151332A CN109902242A CN 109902242 A CN109902242 A CN 109902242A CN 201910151332 A CN201910151332 A CN 201910151332A CN 109902242 A CN109902242 A CN 109902242A
Authority
CN
China
Prior art keywords
dimensional code
picture
storage method
critical value
length
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
Application number
CN201910151332.2A
Other languages
Chinese (zh)
Other versions
CN109902242B (en
Inventor
沈怡
刘少磊
罗年庆
祝哲海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Unitec (jiaxing) Information Technology Co Ltd
Original Assignee
Unitec (jiaxing) Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Unitec (jiaxing) Information Technology Co Ltd filed Critical Unitec (jiaxing) Information Technology Co Ltd
Priority to CN201910151332.2A priority Critical patent/CN109902242B/en
Publication of CN109902242A publication Critical patent/CN109902242A/en
Application granted granted Critical
Publication of CN109902242B publication Critical patent/CN109902242B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

A kind of picture storage method in two dimensional code includes the following steps: to obtain image data and two dimensional code parameter, determines length critical value based on two dimensional code parameter;After image data is converted and encoded, data length and length critical value relationship after transform coding are judged;Length critical value is compressed and/or adjusted to picture based on judgement relationship, the clearest picture that this method can store guarantees that picture can be stored in two dimensional code.Picture storage mode can solve the storage of the multi-form mixed information containing picture, can also accelerate picture storage speed under the premise of guaranteeing picture perfection deposit two dimensional code.

Description

A kind of picture storage method in two dimensional code
Technical field
The present invention relates to computer application fields, are related to planar bar code technology, and in particular to the picture in a kind of two dimensional code is deposited Method for storing.
Background technique
With the development of society, two dimensional code identification, payment technology fast development, become side important in people's life Formula.Two dimensional code is the chequered with black and white square of the plane distribution with specific set figure according to certain rule in the two-dimensional direction Shape square matrix records the barcode technology of new generation of data symbol information, usually saying by two dimensional code battle array and two dimensional code number and lower section The features such as plaintext word composition, has and contain much information, and error correcting capability is strong, and recognition speed is fast, comprehensive recognition, application field is wide It is general.
URL is uniform resource locator, one kind of position and access method to the resource that can be obtained from internet Succinct expression is the address of standard resource on internet.Each file on internet has a unique URL, it is wrapped The information contained points out how the position of file and browser should handle it.Time complexity refers to an algorithm degree Taken time grade is completed in operation.Constant rank is that most fastly, index rank is most slow.
In the prior art, due to the limitation of two dimensional code capacity, such as QR code, it can not store and clearly scheme relatively Piece.So general existing technology is the URL by storing in two dimensional code to obtain picture.Or there are some a small number of feelings Under condition, by way of limiting picture size, to guarantee that picture is possibly stored in two dimensional code, picture space is also either reserved Picture is inserted into, but this mode needs big memory capacity, the size of picture is unable to control, waste of resource.
Summary of the invention
It is an object of the invention to overcome the deficiencies of the prior art and provide the picture storage methods in a kind of two dimensional code, should The clearest picture that method can store guarantees that picture can be stored in two dimensional code, and picture storage mode can solve containing picture Multi-form mixed information storage, can also guarantee picture perfection deposit two dimensional code under the premise of, accelerate picture storage speed Degree.
The present invention provides the picture storage methods in a kind of two dimensional code, include the following steps:
S1. image data and two dimensional code parameter are obtained, length critical value is determined based on two dimensional code parameter;
S2. after image data being converted and encoded, judge data length and length critical value relationship after transform coding;
S3. length critical value is compressed and/or adjusted to picture based on judgement relationship.
Further, two dimensional code parameter includes two dimensional code capacity and/or fault-tolerant coefficient.
Further, length critical value is the one third or so of two dimensional code residual capacity.
Further, two dimensional code residual capacity subtracts word segment code length and other for two dimensional code total capacity and must join Capacity after the occupied capacity of number.
It further, is specially that image data is converted into character string by image data conversion in the step S2.
Further, character string is the form of number and monogram.
It further, is specially that character string is converted into binary coding by image data coding in the step S2.
Further, judge relationship for size relation in the step S2.
Further, if data length is greater than length critical value, return step S2 after compressing to picture.
Further, the boil down to equal proportion compression.
Further, the step S3 further includes coded data fault-tolerant processing, is finally encoded.
Further, the coded data is the coded data after image data and other Data Integrations.
Further, the coding form is binary coding.
Further, the step S3 further includes judging whether the final data for meeting fault-tolerant condition can be stored in two dimension Code, is to generate two dimensional code;Otherwise return step S2 after adjustment length critical value.
Further, length or fixed coefficient of the adjustment length critical value based on final data beyond two dimensional code capacity are true It is fixed.
The present invention provides the picture storage methods in a kind of two dimensional code, may be implemented:
(1) in order to improve the speed in picture deposit two dimensional code, length critical value is devised, is reduced by this critical value Time-consuming operation, to improve efficiency.
(2) critical value designed, also the storage for text picture mixed form data provides a kind of scheme.
(3) in order to guarantee that picture can be all put into two dimensional code, it is also provided with a circulation, if two corresponding to picture Hex value is too long, has been more than the capacity of two dimensional code.So need to reset length critical value, cycle calculations.This circulation is forced The mode of nearly result, it is ensured that the picture being calculated is the clearest picture that its two dimensional code may store.
(4) picture storage mode of the invention can solve the storage of the multi-form mixed information containing picture, can also be Under the premise of guaranteeing picture perfection deposit two dimensional code, accelerate picture storage speed.
Detailed description of the invention
Fig. 1 is the picture Stored Procedure figure in two dimensional code.
Specific embodiment
The following detailed description of specific implementation of the invention, it is necessary to it is indicated herein to be, implement to be only intended to this hair below Bright further explanation, should not be understood as limiting the scope of the invention, and field person skilled in the art is according to above-mentioned Some nonessential modifications and adaptations that summary of the invention makes the present invention, still fall within protection scope of the present invention.
The present invention provides the picture storage method in a kind of two dimensional code, detailed process is as shown in Figure 1.
In order to improve the speed in picture deposit two dimensional code, length critical value is devised, is reduced and is consumed by this critical value When operate, to improve efficiency.
Critical value in certain the design, also the storage for text picture mixed form data provides a kind of scheme.
In order to guarantee that picture can be all put into two dimensional code, be also provided with a circulation, if corresponding to picture two into System value is too long, has been more than the capacity of two dimensional code.So need to reset length critical value, cycle calculations.This cyclic approximation As a result mode, it is ensured that the picture being calculated is the clearest picture that its two dimensional code may store.
In the following, further illustrating the process of the picture storage method in two dimensional code of the invention comprising following step:
1. obtaining image data and two dimensional code parameter
Picture type can be JPEG, TIFF, RAW, BMP, GIF, PNG etc.;
The type of two dimensional code can be the figure of depth dot matrix composition;
Two dimensional code parameter includes two dimensional code capacity and/or fault-tolerant parameter.
Length critical value is obtained 2. calculating;
The effect that above-mentioned length critical value is arranged is in order to accelerate speed, in specific application, due to depositing for critical value So not needing to carry out fault-tolerant calculation every time after picture processing.Because tolerant fail algorithm is very time-consuming algorithm, If constantly needing to carry out fault-tolerant calculation, not only low efficiency, and the time is long, its time complexity is exponential other.
Initial length critical value is mainly determined according to two dimensional code residual capacity.General initial length critical value is surplus for two dimensional code The one third or so of covolume amount.Certainly, initial length critical value can also be determined according to other influences parameter, such as fault-tolerant calculation Method and fault-tolerant coefficient etc..
Above-mentioned two dimensional code residual capacity, generally referred to as two dimensional code total capacity subtract word segment code length and other one The occupied capacity of a little required arguments.So this method be support containing picture can binary system conversion all types of mixing letter The encryption of breath.
3. image data is converted to character string forms;
Aforesaid way can be the method that all picture types are converted to number and monogram, and said combination is most typical For base64.
4. character string is converted to binary coding;
Here character code process can be also possible to disclosed coding schedule such as by the coding schedule oneself defined ASCII;
5. judging the size of binary length and critical value;If binary length is greater than critical value size, picture It is compressed, returns third step;If binary length is less than or equal to critical value, into next step;
In order to guarantee the ratio of picture, above-mentioned related picture compression method is mainly picture level specific pressure contracting method.
6. binary coding carries out fault-tolerant calculation;
Above-mentioned binary coding is the binary coding that after image data and other Data Integrations, will be converted to;
It needs exist for calculating by tolerant fail algorithm, most common tolerant fail algorithm is Reed Solomon.Fault-tolerant parameter is general Less than 40%.Certain fault-tolerant parameter can also be determined according to the capacity of different two dimensional codes and the data capacity of required encryption.
7. judging whether final data can be stored in two dimensional code;If it is not possible, returning to second step, optimization length is critical Value;
If you need to return to second step, the optimization method of length critical value can be according to the exceeded two dimensional code capacity of final data Length determine.
8. generating two dimensional code;
Theoretically it may be said that the capacity of two dimensional code determines that the clarity of picture, the present invention utilize the two dimensional code of high capacity, The picture of high-resolution can be supported to store.
By the critical value setting before processing, the coding rate of picture can be accelerated, improved efficiency;Critical value is set Meter also solves the data storage of picture character mixed information form in two dimensional code;The method of loop parameter setting, ensure that figure Piece can store into two dimensional code, and the picture clearest picture that two dimensional code may store thus.
Although for illustrative purposes, it has been described that exemplary embodiments of the present invention, those skilled in the art Member it will be understood that, can be in form and details in the case where the scope and spirit for not departing from invention disclosed in appended claims On the change that carry out various modifications, add and replace etc., and all these changes all should belong to appended claims of the present invention Protection scope, and each step in the claimed each department of product and method, can in any combination Form is combined.Therefore, to disclosed in this invention the description of embodiment be not intended to limit the scope of the invention, But for describing the present invention.Correspondingly, the scope of the present invention is not limited by embodiment of above, but by claim or Its equivalent is defined.

Claims (12)

1. the picture storage method in a kind of two dimensional code, which comprises the steps of:
S1. image data and two dimensional code parameter are obtained, length critical value is determined based on two dimensional code parameter;
S2. after image data being converted and encoded, judge data length and length critical value relationship after transform coding;
S3. length critical value is compressed and/or adjusted to picture based on judgement relationship.
2. storage method as described in claim 1, it is characterised in that: two dimensional code parameter includes two dimensional code capacity and/or fault-tolerant Parameter.
3. storage method as claimed in claim 2, it is characterised in that: length critical value be two dimensional code residual capacity three/ One or so.
4. storage method as claimed in claim 2 or claim 3, it is characterised in that: two dimensional code residual capacity is that two dimensional code total capacity subtracts Capacity after removing word segment code length and the occupied capacity of other required arguments.
5. storage method as described in claim 1, it is characterised in that: image data conversion refers to picture in the step S2 Data are converted to character string.
6. storage method as claimed in claim 1 or 5, it is characterised in that: encode image data specifically in the step S2 For character string is converted to binary coding.
7. storage method as claimed in claim 6, it is characterised in that: if data length is greater than length critical value, to picture Return step S2 after being compressed.
8. storage method as claimed in claim 7, it is characterised in that: the boil down to equal proportion compression.
9. such as claim 1-3,5-6, storage method described in any one of 7-8, it is characterised in that: the step S3 further includes Coded data fault-tolerant processing, is finally encoded.
10. storage method as claimed in claim 9, it is characterised in that: the coded data is image data and other data Coded data after integration.
11. storage method as described in claim 1, it is characterised in that: the step S3 further includes that judgement meets fault-tolerant condition Final data whether can be stored in two dimensional code, be to generate two dimensional code;Otherwise return step S2 after adjustment length critical value.
12. storage method as claimed in claim 11, it is characterised in that: adjustment length critical value is based on final data and exceeds two The length or fixed coefficient for tieing up code capacity determine.
CN201910151332.2A 2019-02-28 2019-02-28 Picture storage method in two-dimensional code Active CN109902242B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910151332.2A CN109902242B (en) 2019-02-28 2019-02-28 Picture storage method in two-dimensional code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910151332.2A CN109902242B (en) 2019-02-28 2019-02-28 Picture storage method in two-dimensional code

Publications (2)

Publication Number Publication Date
CN109902242A true CN109902242A (en) 2019-06-18
CN109902242B CN109902242B (en) 2021-09-21

Family

ID=66945743

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910151332.2A Active CN109902242B (en) 2019-02-28 2019-02-28 Picture storage method in two-dimensional code

Country Status (1)

Country Link
CN (1) CN109902242B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110610218A (en) * 2019-08-09 2019-12-24 浙江万里学院 Portrait image two-dimensional code generation method
CN111625166A (en) * 2020-05-21 2020-09-04 维沃移动通信有限公司 Picture display method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202694340U (en) * 2012-07-20 2013-01-23 江苏缨思贝睿物联网科技有限公司 Data transmission system
CN103532564A (en) * 2013-05-27 2014-01-22 Tcl集团股份有限公司 Two-dimensional code data encoding method, decoding method, system and intelligent device
CN103731589A (en) * 2013-12-20 2014-04-16 南威软件股份有限公司 Method for transmitting large data flow through two-dimension code
CN107545289A (en) * 2017-09-19 2018-01-05 闫河 The coding method of matrix two-dimensional code and coding/decoding method
CN107807973A (en) * 2017-10-20 2018-03-16 国云科技股份有限公司 A kind of method for being embedded into picture according to URL addresses generation Quick Response Code

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202694340U (en) * 2012-07-20 2013-01-23 江苏缨思贝睿物联网科技有限公司 Data transmission system
CN103532564A (en) * 2013-05-27 2014-01-22 Tcl集团股份有限公司 Two-dimensional code data encoding method, decoding method, system and intelligent device
CN103731589A (en) * 2013-12-20 2014-04-16 南威软件股份有限公司 Method for transmitting large data flow through two-dimension code
CN107545289A (en) * 2017-09-19 2018-01-05 闫河 The coding method of matrix two-dimensional code and coding/decoding method
CN107807973A (en) * 2017-10-20 2018-03-16 国云科技股份有限公司 A kind of method for being embedded into picture according to URL addresses generation Quick Response Code

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110610218A (en) * 2019-08-09 2019-12-24 浙江万里学院 Portrait image two-dimensional code generation method
CN110610218B (en) * 2019-08-09 2022-09-13 浙江万里学院 Portrait image two-dimensional code generation method
CN111625166A (en) * 2020-05-21 2020-09-04 维沃移动通信有限公司 Picture display method and device
CN111625166B (en) * 2020-05-21 2021-11-30 维沃移动通信有限公司 Picture display method and device

Also Published As

Publication number Publication date
CN109902242B (en) 2021-09-21

Similar Documents

Publication Publication Date Title
CN101375597B (en) Temporal classified filtering for video compression
CN103400174A (en) Encoding method, decoding method and system of two-dimensional code
CN109902242A (en) A kind of picture storage method in two dimensional code
CN104794619B (en) Anti-channel conflict digital information mapping code method for commodity packaging
CN103632179B (en) Code And Decode method and the device of Three-Dimensional Bar Code
CN110489466A (en) Generation method, device, terminal device and the storage medium of invitation code
CN110322386A (en) A kind of insertion of digital text watermarking and detection method and device
Li et al. Deep multi-similarity hashing for multi-label image retrieval
CN113297435A (en) Material management method and system based on gene codes
CN104915698B (en) Chemical producting safety information quick search and complete period tracking digital labelling system
CN102842052A (en) Identity code generation method
CN107944525A (en) A kind of method and system of the expansion Quick Response Code capacity based on data segmentation
CN107203764A (en) Long microblog picture recognition methods and device
CN109886711A (en) A kind of bar code coding method and device
CN105790768B (en) Date storage method and system
CN109858588A (en) A kind of two dimensional code parallel generation method based on chaotic maps
US9087252B2 (en) Grayscale incremental information object
CN109271797B (en) Method and system for improving security of database sensitive information
US9235610B2 (en) Short string compression
CN110033218A (en) A kind of Intelligent logistics Warehouse Management System based on Internet of Things
CN105930521B (en) A kind of data bank management device and method
CN111130554B (en) File compression method and device, electronic equipment and readable storage medium
CN113887201A (en) Text fixed-length error correction method, device, equipment and storage medium
CN112883301A (en) Method and device for generating short link based on 55 system and storage medium
CN116192402B (en) Communication method with information coding

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant