CN112990406B - Two-dimensional code generation and identification method and device capable of adding dynamic extended information - Google Patents

Two-dimensional code generation and identification method and device capable of adding dynamic extended information Download PDF

Info

Publication number
CN112990406B
CN112990406B CN202110408266.XA CN202110408266A CN112990406B CN 112990406 B CN112990406 B CN 112990406B CN 202110408266 A CN202110408266 A CN 202110408266A CN 112990406 B CN112990406 B CN 112990406B
Authority
CN
China
Prior art keywords
request
generate
dynamic
code
extended information
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.)
Active
Application number
CN202110408266.XA
Other languages
Chinese (zh)
Other versions
CN112990406A (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.)
Jiashi Beijing Technology Co ltd
Original Assignee
Beijing Kite 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 Beijing Kite Technology Co ltd filed Critical Beijing Kite Technology Co ltd
Priority to CN202110408266.XA priority Critical patent/CN112990406B/en
Publication of CN112990406A publication Critical patent/CN112990406A/en
Application granted granted Critical
Publication of CN112990406B publication Critical patent/CN112990406B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1443Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1456Methods for optical code recognition including a method step for retrieval of the optical code determining the orientation of the optical code with respect to the reader and correcting therefore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • G06K7/1473Methods for optical code recognition the method including quality enhancement steps error correction

Abstract

The invention discloses a two-dimensional code generating and identifying method and a device capable of adding dynamic extended information, wherein the method comprises the following steps: collecting user requests of different time periods, and generating dynamic extended information based on the user requests of different time periods; acquiring the size of the dynamic extended information, and carrying out segmentation coding on the dynamic extended information based on the size of the dynamic extended information to generate a plurality of code word sequences; calculating the code word sequence to generate an error correction code sequence, and arranging the code word sequence and the error correction code sequence to generate a request code; and arranging and laying out the request codes according to a layout rule, setting a mask for the request codes after arrangement and laying out, and generating the two-dimensional code. According to the method, the dynamic expansion information can be added into the two-dimensional code, so that the two-dimensional code is suitable for different application scenes, and the response and control difficulty of a user is simplified through the two-dimensional code added with the dynamic expansion information.

Description

Two-dimensional code generation and identification method and device capable of adding dynamic extended information
Technical Field
The invention relates to the technical field of two-dimensional codes, in particular to a method and a device for generating and identifying a two-dimensional code capable of adding dynamic extended information.
Background
Currently, with the rapid popularization of smart phones, people live in the "Wangyang ocean" of two-dimensional codes, and the figure of the two-dimensional codes can be seen everywhere in newspapers, televisions, the Internet, coffee shops, supermarkets, subways and shopping malls. The two-dimensional code applied to the business scene is mostly generated based on the demand information in a current fixed time period, and cannot comprehensively reflect the dynamic information of the progress of a certain work and activity or the development and change condition of a certain event, so that the practicability of the two-dimensional code is reduced.
Moreover, in the development and change process of many jobs, activities and events, users are required to respond to dynamic information to perform corresponding operations. However, in practice, the user often cannot respond and control correctly in time due to the limitation of subjective and objective conditions. For example, for some elderly people, when watching smart tv programs, the user cannot respond to the change of the interactive screen interface to perform timely and correct operation.
Therefore, how to add dynamic extended information into a two-dimensional code makes the two-dimensional code suitable for different application scenarios, and simplifies the response and control difficulty of a user by adding the two-dimensional code of the dynamic extended information is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
In view of the foregoing problems, an embodiment of the present invention provides a two-dimensional code generating method capable of adding dynamic extended information, including:
collecting user requests of different time periods, and generating dynamic extended information based on the user requests of different time periods;
acquiring the size of the dynamic extended information, and performing segmentation coding on the dynamic extended information based on the size of the dynamic extended information to generate a plurality of codeword sequences;
calculating the code word sequence to generate an error correction code sequence, and arranging the code word sequence and the error correction code sequence to generate a request code;
and arranging and laying out the request codes according to a layout rule, setting a mask for the request codes after arrangement and laying out, and generating the two-dimensional code.
In one embodiment, the collecting user requests of different time periods and generating dynamic extension information based on the user requests of different time periods includes:
collecting user requests of different time periods, and performing attribute segmentation on the user requests based on preset attributes to generate request attributes;
extracting a time period requested by the user, and constructing a matrix based on the time period and the request attribute;
and sequencing and connecting the user requests based on the matrix to generate dynamic extension information.
In one embodiment, the obtaining the size of the dynamic extension information, and performing partition coding on the dynamic extension information based on the size of the dynamic extension information to generate a plurality of codeword sequences includes:
acquiring the size of the dynamic extended information, comparing the size of the dynamic extended information with a preset size, and segmenting the dynamic extended information according to a comparison result to generate a plurality of request data;
reading the position of the request data, generating a request frame serial number, and packaging the request frame serial number and the frame header of the request data to generate a data frame;
and coding the data frame to generate a code word sequence.
In a second aspect, the present invention further provides a two-dimensional code identification method capable of adding dynamic extension information, including:
acquiring a two-dimensional code image, preprocessing the two-dimensional code image, and performing positioning correction on the preprocessed two-dimensional code image to generate a corrected two-dimensional code;
reading format information of the corrected two-dimensional code, acquiring a mask graph, and performing XOR processing by using the mask graph to generate a request code;
reading the symbol character requested to be encoded, generating the code word sequence and the error correction code sequence, and correcting the error of the request data in the code word sequence based on the error correction code sequence;
and decoding the corrected code word sequence to generate dynamic expansion information, and generating user instructions in different time periods based on the dynamic expansion information.
In one embodiment, the decoding the error-corrected codeword sequence to generate dynamic extension information, and generating user instructions for different time periods based on the dynamic extension information includes:
reading the code word sequence, acquiring a data frame, and judging whether the data frame is data needing to be received according to a frame header structure of the data frame; if the data frame is a file needing to be received, generating a plurality of request data based on the data frame;
reading a data frame sequence number, and combining the request data based on the data frame sequence number to generate the dynamic extended information;
and extracting a request attribute and a time period in the dynamic extended information based on a preset word meaning attribute, and matching the request attribute with the time period to generate user instructions of different time periods.
In a third aspect, the present invention further provides a two-dimensional code generating device capable of adding dynamic extended information, including:
the dynamic extended information generating module is used for acquiring user requests of different time periods and generating dynamic extended information based on the user requests of the different time periods;
the segmentation coding module is used for acquiring the size of the dynamic extended information, and performing segmentation coding on the dynamic extended information based on the size of the dynamic extended information to generate a plurality of codeword sequences;
a request code generation module, configured to calculate the codeword sequence, generate an error correction code sequence, and arrange the codeword sequence and the error correction code sequence to generate a request code;
and the two-dimension code generating module is used for arranging and distributing the request codes according to a layout rule, setting a mask for the request codes after arrangement and distribution and generating the two-dimension code.
In one embodiment, the dynamic extended information generating module includes:
the attribute segmentation unit is used for collecting user requests of different time periods, performing attribute segmentation on the user requests based on preset attributes and generating request attributes;
the matrix construction unit is used for extracting the time period of the user request and constructing a matrix based on the time period and the request attribute;
and the sequencing connection unit is used for sequencing and connecting the user requests based on the matrix to generate dynamic extension information.
In one embodiment, the partition encoding module includes:
the request data generation unit is used for acquiring the size of the dynamic extended information, comparing the size of the dynamic extended information with a preset size, and segmenting the dynamic extended information according to a comparison result to generate a plurality of request data;
the encapsulation unit is used for reading the position of the request data, generating a request frame serial number, and encapsulating the request frame serial number and the frame header of the request data to generate a data frame;
and the coding unit is used for coding the data frame to generate a code word sequence.
In a fourth aspect, the present invention further provides a two-dimensional code identification device capable of adding dynamic extended information, including:
the positioning correction module is used for acquiring a two-dimensional code image, preprocessing the two-dimensional code image, positioning and correcting the preprocessed two-dimensional code image and generating a corrected two-dimensional code;
the XOR processing module is used for reading the format information of the corrected two-dimensional code, acquiring a mask graph, and carrying out XOR processing by using the mask graph to generate a request code;
the error correction module is used for reading the symbol characters requested to be encoded, generating the code word sequence and the error correction code sequence, and correcting the error of the request data in the code word sequence based on the error correction code sequence;
and the decoding module is used for decoding the corrected code word sequence to generate dynamic expansion information and generating user instructions in different time periods based on the dynamic expansion information.
In one embodiment, the decoding module includes:
the judging unit is used for reading the code word sequence, acquiring a data frame and judging whether the data frame is data needing to be received according to a frame header structure of the data frame; if the data frame is a file needing to be received, generating a plurality of request data based on the data frame;
the combination unit is used for reading a data frame serial number and combining the request data based on the data frame serial number to generate the dynamic extended information;
and the matching unit is used for extracting the request attribute and the time period in the dynamic extended information based on the preset word meaning attribute, matching the request attribute with the time period and generating user instructions of different time periods.
The technical scheme provided by the embodiment of the invention has the beneficial effects that at least:
according to the two-dimensional code generation method capable of adding dynamic extended information, provided by the embodiment of the invention, corresponding storage is carried out according to user requests with different data volumes, the maximum utilization of a storage space is realized, different user instructions can be integrated to generate dynamic extended information, different control instructions are implemented in different application scenes to control corresponding equipment at different time periods, integration of different control instructions is completed, the extended space of the two-dimensional code is increased, the user experience is improved, the response and control difficulty of a user is simplified by adding the two-dimensional code of the dynamic extended information, and the application scene of the two-dimensional code is expanded.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
fig. 1 is a flowchart of a two-dimensional code generation method capable of adding dynamic extended information according to an embodiment of the present invention;
FIG. 2 is a flowchart of a step S101 provided in an embodiment of the present invention;
FIG. 3 is a flowchart of step S102 according to an embodiment of the present invention;
fig. 4 is a flowchart of a two-dimensional code identification method capable of adding dynamic extended information according to an embodiment of the present invention;
FIG. 5 is a flowchart of step S204 provided by the embodiment of the present invention;
fig. 6 is a block diagram of a two-dimensional code generating apparatus capable of adding dynamic extended information according to an embodiment of the present invention;
fig. 7 is a block diagram of a two-dimensional code recognition apparatus capable of adding dynamic extended information according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Referring to fig. 1, a method for generating a two-dimensional code capable of adding dynamic extension information according to an embodiment of the present invention includes: S101-S104;
s101, collecting user requests of different time periods, and generating dynamic extension information based on the user requests of the different time periods.
S102, obtaining the size of the dynamic expansion information, and carrying out segmentation coding on the dynamic expansion information based on the size of the dynamic expansion information to generate a plurality of code word sequences.
S103, calculating the code word sequence to generate an error correction code sequence, arranging the code word sequence and the error correction code sequence, and generating a request code.
Specifically, the error correction code sequence is generated by error correction coding a plurality of codeword sequences.
Specifically, the first frame of each codeword sequence is arranged in sequence, then the second pointer of each codeword sequence is arranged, and so on until all codeword sequences are arranged.
Further, the error correction code sequence is also arranged according to the arrangement mode of the code word sequence.
Further, the arranged error correcting code sequence is arranged behind the arranged code word sequence, the arrangement is completed, and the request code is generated.
And S104, arranging and laying the request codes according to a layout rule, setting a mask for the request codes after arrangement and laying out, and generating the two-dimensional code.
Specifically, the size of the request code is obtained, the check code is set based on the size of the request code, and the size of the request code and the check code are combined to generate the header data.
Further, the request code is embedded into a data area of the two-dimensional code, and the head data is embedded into a head area of the two-dimensional code.
Further, a mask is set on the request code which is well laid out, a two-dimensional code is generated, and the two-dimensional code is displayed on a screen of the user terminal.
In the embodiment, corresponding storage is performed according to user requests of different data volumes, the maximum utilization of storage space is realized, different user instructions can be integrated, dynamic extended information is generated, different control instructions are implemented at different time periods in different application scenes to control corresponding equipment, integration of different control instructions is completed, the extended space of the two-dimensional code is increased, user experience is improved, the response and control difficulty of a user are simplified through the two-dimensional code added with the dynamic extended information, and the application scene of the two-dimensional code is enlarged.
In an embodiment, referring to fig. 2, the collecting user requests of different time periods in step S101, and generating dynamic extension information based on the user requests of different time periods includes:
s1011, collecting user requests of different time periods, and performing attribute segmentation on the user requests based on preset attributes to generate request attributes.
Specifically, the user requests of different time periods are segmented based on preset attributes (including time attributes, place attributes, person attributes, destination attributes and the like); for example, the preset attributes are set as time, person and task based on word senses, the time in the extraction of the user request that the owner is allowed to pass between 7 and 8 is 7 to 8, the person is the owner, and the task is allowed to pass through the entrance guard.
Further, the segmentation may be performed according to different time periods and corresponding different user requests. For example, a user request is generated by collecting the viewing requirements of 7-point viewing news simulcast and 8-point viewing health-preserving program XXX of parents, and the user request is divided into 7-point viewing news simulcast and 8-point viewing XXX.
S1012, extracting the time period requested by the user, and constructing a matrix based on the time period and the request attribute.
Specifically, the time periods are sequentially arranged as a first column of the matrix, and the request attribute corresponding to the time period is used as a second column of the matrix.
And S1013, sequencing and connecting the user requests based on the matrix to generate dynamic extension information.
Specifically, the time periods and the request attributes are bound and then connected in sequence based on the front-back position relationship of the time periods, and user instructions of different time periods are generated.
In one embodiment, referring to fig. 3, the obtaining the size of the dynamic extended information in step S102, and performing segmentation coding on the dynamic extended information based on the size of the dynamic extended information to generate a plurality of codeword sequences includes:
s1021, obtaining the size of the dynamic expansion information, comparing the size of the dynamic expansion information with a preset size, and segmenting the dynamic expansion information according to a comparison result to generate a plurality of request data.
Specifically, when the size of the dynamic extended information is smaller than a preset size, the size of the dynamic extended information conforms to the data size that can be accommodated by the two-dimensional code; when the size of the dynamic extended information is larger than the preset size, the size of the dynamic extended information exceeds the data volume that can be accommodated by the two-dimensional code, and in order to avoid data uncertainty, the dynamic extended information needs to be segmented based on the capacity of the two-dimensional code to generate a plurality of request data, wherein the size of the request data is smaller than or equal to the capacity of the two-dimensional code.
And S1022, reading the position of the request data, generating a request frame serial number, and encapsulating the request frame serial number and the frame header of the request data to generate a data frame.
Specifically, the number of coding symbols, the number of characters, and the end symbol are added after each data frame, and the number of bits is filled.
And S1023, encoding the data frame to generate a code word sequence.
Specifically, time data in the request data are extracted based on time attributes, a time difference between the request data is calculated according to the time data in every two request data, a time window is generated based on the time difference, the time window is sequentially embedded into the request data according to the position of the request data, and then a code word sequence is generated.
Based on the same inventive concept, referring to fig. 4, an embodiment of the present invention further provides a two-dimensional code identification method capable of adding dynamic extended information, including: S201-S204;
s201, collecting a two-dimension code image, preprocessing the two-dimension code image, positioning and correcting the preprocessed two-dimension code image, and generating a corrected two-dimension code.
Specifically, a camera is used for collecting a two-dimensional code image, the collected two-dimensional code image is subjected to graying processing, the two-dimensional code image subjected to graying processing is subjected to noise reduction by a median filtering algorithm, and a noise-reduced two-dimensional code image is generated.
Further, each pixel point in the two-dimensional code image after noise reduction is compared with a preset threshold, if the gray value of the pixel point is larger than the preset threshold, the pixel value is replaced by black, and otherwise, the pixel value is replaced by white.
Furthermore, four corners of the two-dimensional code image are positioned, a transformation matrix is generated by means of perspective transformation, the two-dimensional code image and the standard matrix are mapped one by one, actual coordinates of a square block at the upper left corner in the two-dimensional code image are obtained, and the actual coordinates of the square block at the upper left corner are multiplied by the transformation matrix to generate a corrected two-dimensional code.
S202, reading the format information of the corrected two-dimensional code, obtaining a mask graph, and performing XOR processing by using the mask graph to generate a request code.
S203, reading the symbol character requested to be encoded, generating the code word sequence and the error correction code sequence, and correcting the requested data in the code word sequence based on the error correction code sequence.
S204, decoding the corrected code word sequence to generate dynamic expansion information, and generating user instructions in different time periods based on the dynamic expansion information.
In one embodiment, referring to fig. 5, the decoding the error-corrected codeword sequence in step S204 to generate dynamic extended information, and generating user instructions for different time periods based on the dynamic extended information includes:
s2041, reading the code word sequence, acquiring a data frame, and judging whether the data frame is data needing to be received according to a frame header structure of the data frame; and if the data frame is a file needing to be received, generating a plurality of request data based on the data frame.
Specifically, the data frame is decapsulated, a request frame number is obtained, and whether the data frame is data to be received is judged according to the request frame number.
S2042, reading a data frame sequence number, and combining the request data based on the data frame sequence number to generate the dynamic extended information.
Specifically, the data frame is decoded, a data frame serial number is extracted, and a plurality of request data are sequenced and combined according to the data frame serial number; wherein, the data frame sequence number indicates the position of the request data in the dynamic extended information.
S2044, extracting the request attribute and the time period in the dynamic extended information based on the preset word meaning attribute, matching the request attribute with the time period, and generating user instructions of different time periods.
Specifically, the word meaning attribute is preset as time, time periods in the dynamic extended information are extracted based on the time, corresponding request attributes are inquired according to the time periods, and user instructions of different time periods are generated.
A two-dimensional code generation and identification method that can add dynamic extended information is described by the following embodiments.
Example 1:
when the application scene is access control, a user mobile phone end collects user identity information, access control codes (namely user access addresses or codes of visited persons), two-dimension code effective time and check strings, and generates dynamic extension information based on the information;
acquiring the size of the dynamic extended information, and performing segmentation coding on the dynamic extended information based on the size of the dynamic extended information to generate a plurality of codeword sequences;
calculating the code word sequence to generate an error correction code sequence, and arranging the code word sequence and the error correction code sequence to generate a request code;
arranging and distributing the request codes according to a distribution rule, setting a mask for the request codes after arrangement and distribution, generating a two-dimensional code, and displaying the access control two-dimensional code by a user mobile phone end; (ii) a
Scanning the code by the access control equipment, preprocessing the two-dimensional code image, and performing positioning correction on the preprocessed two-dimensional code image to generate a corrected two-dimensional code;
reading format information of the corrected two-dimensional code, acquiring a mask graph, and performing XOR processing by using the mask graph to generate a request code;
reading the symbol character requested to be encoded, generating the code word sequence and the error correction code sequence, and correcting the error of the request data in the code word sequence based on the error correction code sequence;
decoding the corrected code word sequence to generate dynamic extended information, and generating user instructions in different time periods based on the dynamic extended information;
the entrance guard equipment carries out different management to the user of different time quantums based on user instruction to, entrance guard equipment can register user's identity information, access address or visited person, information such as access time to realize visitor registration or owner business turn over registration, thereby be convenient for realize safe, convenient, to user's noninterference property management.
Example 2:
when the application scene is relatively complex operations of the old people watching the smart television, regulating and controlling the fresh air system of the air conditioner and the like in families, the children and the children generate dynamic extension information based on user requests of the old people such as watching channels, watching time (or setting of air volume, temperature and air speed of the fresh air system) and the like;
acquiring the size of the dynamic extended information, and performing segmentation coding on the dynamic extended information based on the size of the dynamic extended information to generate a plurality of codeword sequences;
calculating the code word sequence to generate an error correction code sequence, and arranging the code word sequence and the error correction code sequence to generate a request code;
arranging and laying out the request codes according to a layout rule, setting a mask for the request codes after arrangement and laying out, generating a two-dimensional code, and sending the two-dimensional code to a parent mobile phone;
after receiving the two-dimension code, the parent displays the two-dimension code at a television and a control panel device (a code scanning camera needs to be additionally arranged) of the smart home, or uses a camera accessed to a home gateway to scan the code and acquire a two-dimension code image, and the camera transmits the information analyzed in the two-dimension code to corresponding equipment;
the corresponding equipment preprocesses the two-dimension code image, and carries out positioning correction on the preprocessed two-dimension code image to generate a corrected two-dimension code;
reading format information of the corrected two-dimensional code, acquiring a mask graph, and performing XOR processing by using the mask graph to generate a request code;
reading the symbol character requested to be encoded, generating the code word sequence and the error correction code sequence, and correcting the error of the request data in the code word sequence based on the error correction code sequence;
decoding the corrected code word sequence to generate dynamic extended information, and generating user instructions in different time periods based on the dynamic extended information;
and the corresponding equipment directly controls related equipment in different time periods according to the analyzed user instruction, for example, the playing of a smart television program is controlled, or the air volume, the temperature, the air speed and the like of a fresh air system are controlled.
Based on the same inventive concept, the embodiment of the present invention further provides a two-dimensional code generating device capable of adding dynamic extended information, and as the principle of the problem solved by the device is similar to the aforementioned two-dimensional code generating method capable of adding dynamic extended information, the implementation of the device can refer to the implementation of the aforementioned method, and repeated parts are not described again.
The two-dimensional code generating device capable of adding dynamic extended information provided by the embodiment of the invention, as shown in fig. 6, includes:
and the dynamic extended information generating module 61 is configured to collect user requests in different time periods, and generate dynamic extended information based on the user requests in different time periods.
And a dividing and encoding module 62, configured to obtain the size of the dynamic extension information, and perform dividing and encoding on the dynamic extension information based on the size of the dynamic extension information to generate a plurality of codeword sequences.
And a request code generation module 63, configured to calculate the codeword sequence, generate an error correction code sequence, and arrange the codeword sequence and the error correction code sequence to generate a request code.
Specifically, the error correction code sequence is generated by error correction coding a plurality of codeword sequences.
Specifically, the first frame of each codeword sequence is arranged in sequence, then the second pointer of each codeword sequence is arranged, and so on until all codeword sequences are arranged.
Further, the error correction code sequence is also arranged according to the arrangement mode of the code word sequence.
Further, the arranged error correcting code sequence is arranged behind the arranged code word sequence, the arrangement is completed, and the request code is generated.
And a two-dimension code generating module 64, configured to arrange and arrange the request codes according to the arrangement rule, and set a mask for the arranged and arranged request codes, so as to generate a two-dimension code.
Specifically, the size of the request code is obtained, the check code is set based on the size of the request code, and the size of the request code and the check code are combined to generate the header data.
Further, the request code is embedded into a data area of the two-dimensional code, and the head data is embedded into a head area of the two-dimensional code.
Further, a mask is set on the request code which is well laid out, a two-dimensional code is generated, and the two-dimensional code is displayed on a screen of the user terminal.
In one embodiment, the dynamic extended information generating module 61 includes:
the attribute segmentation unit 611 is configured to collect user requests in different time periods, perform attribute segmentation on the user requests based on preset attributes, and generate request attributes.
Specifically, the user requests of different time periods are segmented based on preset attributes (including time attributes, place attributes, person attributes, destination attributes and the like); for example, the preset attributes are set as time, person and task based on word senses, the time in the extraction of the user request that the owner is allowed to pass between 7 and 8 is 7 to 8, the person is the owner, and the task is allowed to pass through the entrance guard.
Further, the segmentation may be performed according to different time periods and corresponding different user requests. For example, a user request is generated by collecting the viewing requirements of 7-point viewing news simulcast and 8-point viewing health-preserving program XXX of parents, and the user request is divided into 7-point viewing news simulcast and 8-point viewing XXX.
A matrix constructing unit 612, configured to extract the time period requested by the user, and construct a matrix based on the time period and the request attribute.
Specifically, the time periods are sequentially arranged as a first column of the matrix, and the request attribute corresponding to the time period is used as a second column of the matrix.
A sorting connection unit 613, configured to sort and connect the user requests based on the matrix, and generate dynamic extension information.
Specifically, the time periods and the request attributes are bound and then connected in sequence based on the front-back position relationship of the time periods, and user instructions of different time periods are generated.
In one embodiment, the partition encoding module 62 includes:
the request data generating unit 621 is configured to obtain the size of the dynamic extension information, compare the size of the dynamic extension information with a preset size, and divide the dynamic extension information according to a comparison result to generate a plurality of request data.
Specifically, when the size of the dynamic extended information is smaller than a preset size, the size of the dynamic extended information conforms to the data size that can be accommodated by the two-dimensional code; when the size of the dynamic extended information is larger than the preset size, the size of the dynamic extended information exceeds the data volume that can be accommodated by the two-dimensional code, and in order to avoid data uncertainty, the dynamic extended information needs to be segmented based on the capacity of the two-dimensional code to generate a plurality of request data, wherein the size of the request data is smaller than or equal to the capacity of the two-dimensional code.
The encapsulating unit 622 is configured to read the position of the request data, generate a request frame number, and encapsulate the request frame number and the frame header of the request data to generate a data frame.
Specifically, the number of coding symbols, the number of characters, and the end symbol are added after each data frame, and the number of bits is filled.
And an encoding unit 623, configured to encode the data frame to generate a codeword sequence.
Specifically, time data in the request data are extracted based on time attributes, a time difference between the request data is calculated according to the time data in every two request data, a time window is generated based on the time difference, the time window is sequentially embedded into the request data according to the position of the request data, and then a code word sequence is generated.
Based on the same inventive concept, the embodiment of the present invention further provides a two-dimensional code identification apparatus capable of adding dynamic extended information, and as the principle of the problem solved by the apparatus is similar to the aforementioned two-dimensional code identification method capable of adding dynamic extended information, the implementation of the apparatus can refer to the implementation of the aforementioned method, and repeated parts are not described again.
The two-dimensional code recognition device capable of adding dynamic extended information provided by the embodiment of the invention, as shown in fig. 7, includes:
and the positioning correction module 71 is configured to acquire a two-dimensional code image, preprocess the two-dimensional code image, perform positioning correction on the preprocessed two-dimensional code image, and generate a corrected two-dimensional code.
Specifically, a camera is used for collecting a two-dimensional code image, the collected two-dimensional code image is subjected to graying processing, the two-dimensional code image subjected to graying processing is subjected to noise reduction by a median filtering algorithm, and a noise-reduced two-dimensional code image is generated.
Further, each pixel point in the two-dimensional code image after noise reduction is compared with a preset threshold, if the gray value of the pixel point is larger than the preset threshold, the pixel value is replaced by black, and otherwise, the pixel value is replaced by white.
Furthermore, four corners of the two-dimensional code image are positioned, a transformation matrix is generated by means of perspective transformation, the two-dimensional code image and the standard matrix are mapped one by one, actual coordinates of a square block at the upper left corner in the two-dimensional code image are obtained, and the actual coordinates of the square block at the upper left corner are multiplied by the transformation matrix to generate a corrected two-dimensional code.
And an exclusive or processing module 72, configured to read format information of the corrected two-dimensional code, obtain a mask pattern, and perform exclusive or processing on the mask pattern to generate a request code.
And the error correction module 73 is configured to read the symbol character requested to be encoded, generate the codeword sequence and the error correction code sequence, and correct error of the requested data in the codeword sequence based on the error correction code sequence.
And a decoding module 74, configured to decode the corrected codeword sequence, generate dynamic extension information, and generate user instructions in different time periods based on the dynamic extension information.
In one embodiment, the decoding module 74 includes:
a determining unit 741, configured to read the codeword sequence, obtain a data frame, and determine whether the data frame is data that needs to be received according to a frame header structure of the data frame; and if the data frame is a file needing to be received, generating a plurality of request data based on the data frame.
Specifically, the data frame is decapsulated, a request frame number is obtained, and whether the data frame is data to be received is judged according to the request frame number.
A combining unit 742, configured to read a data frame number, and combine the request data based on the data frame number to generate the dynamic extension information.
Specifically, the data frame is decoded, a data frame serial number is extracted, and a plurality of request data are sequenced and combined according to the data frame serial number; wherein, the data frame sequence number indicates the position of the request data in the dynamic extended information.
A matching unit 743, configured to extract the request attribute and the time period in the dynamic extension information based on a preset word sense attribute, and match the request attribute with the time period to generate user instructions of different time periods.
Specifically, the word meaning attribute is preset as time, time periods in the dynamic extended information are extracted based on the time, corresponding request attributes are inquired according to the time periods, and user instructions of different time periods are generated.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (6)

1. A two-dimensional code generating method capable of adding dynamic extended information is characterized by comprising the following steps:
collecting user requests of different time periods, and generating dynamic extended information based on the user requests of different time periods;
acquiring the size of the dynamic extended information, and performing segmentation coding on the dynamic extended information based on the size of the dynamic extended information to generate a plurality of codeword sequences;
calculating the code word sequence to generate an error correction code sequence, and arranging the code word sequence and the error correction code sequence to generate a request code;
arranging and laying out the request codes according to a layout rule, setting a mask for the request codes after arrangement and laying out, and generating a two-dimensional code;
the collecting user requests of different time periods and generating dynamic extended information based on the user requests of different time periods includes:
collecting user requests of different time periods, and performing attribute segmentation on the user requests based on preset attributes to generate request attributes;
extracting a time period requested by the user, and constructing a matrix based on the time period and the request attribute;
and sequencing and connecting the user requests based on the matrix to generate dynamic extension information.
2. The method of claim 1, wherein the obtaining the size of the dynamic extension information, and performing partition coding on the dynamic extension information based on the size of the dynamic extension information to generate a plurality of codeword sequences comprises:
acquiring the size of the dynamic extended information, comparing the size of the dynamic extended information with a preset size, and segmenting the dynamic extended information according to a comparison result to generate a plurality of request data;
reading the position of the request data, generating a request frame serial number, and packaging the request frame serial number and the frame header of the request data to generate a data frame;
and coding the data frame to generate a code word sequence.
3. A two-dimensional code identification method capable of adding dynamic extended information is characterized by comprising the following steps:
acquiring a two-dimensional code image, preprocessing the two-dimensional code image, and performing positioning correction on the preprocessed two-dimensional code image to generate a corrected two-dimensional code;
reading format information of the corrected two-dimensional code, acquiring a mask graph, and performing XOR processing by using the mask graph to generate a request code;
reading the symbol character requested to be encoded, generating a code word sequence and an error correction code sequence, and correcting the error of the request data in the code word sequence based on the error correction code sequence;
decoding the corrected code word sequence to generate dynamic extended information, and generating user instructions in different time periods based on the dynamic extended information;
the decoding the corrected codeword sequence to generate dynamic extension information, and generating user instructions of different time periods based on the dynamic extension information, includes:
reading the code word sequence, acquiring a data frame, and judging whether the data frame is data needing to be received according to a frame header structure of the data frame; if the data frame is a file needing to be received, generating a plurality of request data based on the data frame;
reading a data frame sequence number, and combining the request data based on the data frame sequence number to generate the dynamic extended information;
and extracting a request attribute and a time period in the dynamic extended information based on a preset word meaning attribute, and matching the request attribute with the time period to generate user instructions of different time periods.
4. A two-dimensional code generating device capable of adding dynamic extended information is characterized by comprising:
the dynamic extended information generating module is used for acquiring user requests of different time periods and generating dynamic extended information based on the user requests of the different time periods;
the segmentation coding module is used for acquiring the size of the dynamic extended information, and performing segmentation coding on the dynamic extended information based on the size of the dynamic extended information to generate a plurality of codeword sequences;
a request code generation module, configured to calculate the codeword sequence, generate an error correction code sequence, and arrange the codeword sequence and the error correction code sequence to generate a request code;
the two-dimension code generating module is used for arranging and distributing the request codes according to a layout rule, setting a mask for the request codes after arrangement and distribution and generating the two-dimension code;
the dynamic extended information generation module comprises:
the attribute segmentation unit is used for collecting user requests of different time periods, performing attribute segmentation on the user requests based on preset attributes and generating request attributes;
the matrix construction unit is used for extracting the time period of the user request and constructing a matrix based on the time period and the request attribute;
and the sequencing connection unit is used for sequencing and connecting the user requests based on the matrix to generate dynamic extension information.
5. The apparatus of claim 4, wherein the partition encoding module comprises:
the request data generation unit is used for acquiring the size of the dynamic extended information, comparing the size of the dynamic extended information with a preset size, and segmenting the dynamic extended information according to a comparison result to generate a plurality of request data;
the encapsulation unit is used for reading the position of the request data, generating a request frame serial number, and encapsulating the request frame serial number and the frame header of the request data to generate a data frame;
and the coding unit is used for coding the data frame to generate a code word sequence.
6. A two-dimensional code recognition device capable of adding dynamic extended information is characterized by comprising:
the positioning correction module is used for acquiring a two-dimensional code image, preprocessing the two-dimensional code image, positioning and correcting the preprocessed two-dimensional code image and generating a corrected two-dimensional code;
the XOR processing module is used for reading the format information of the corrected two-dimensional code, acquiring a mask graph, and carrying out XOR processing by using the mask graph to generate a request code;
the error correction module is used for reading the symbol characters requested to be encoded, generating a code word sequence and an error correction code sequence, and correcting the error of the request data in the code word sequence based on the error correction code sequence;
the decoding module is used for decoding the corrected code word sequence to generate dynamic expansion information and generating user instructions in different time periods based on the dynamic expansion information;
the decoding module includes:
the judging unit is used for reading the code word sequence, acquiring a data frame and judging whether the data frame is data needing to be received according to a frame header structure of the data frame; if the data frame is a file needing to be received, generating a plurality of request data based on the data frame;
the combination unit is used for reading a data frame serial number and combining the request data based on the data frame serial number to generate the dynamic extended information;
and the matching unit is used for extracting the request attribute and the time period in the dynamic extended information based on the preset word meaning attribute, matching the request attribute with the time period and generating user instructions of different time periods.
CN202110408266.XA 2021-04-15 2021-04-15 Two-dimensional code generation and identification method and device capable of adding dynamic extended information Active CN112990406B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110408266.XA CN112990406B (en) 2021-04-15 2021-04-15 Two-dimensional code generation and identification method and device capable of adding dynamic extended information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110408266.XA CN112990406B (en) 2021-04-15 2021-04-15 Two-dimensional code generation and identification method and device capable of adding dynamic extended information

Publications (2)

Publication Number Publication Date
CN112990406A CN112990406A (en) 2021-06-18
CN112990406B true CN112990406B (en) 2021-08-31

Family

ID=76340691

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110408266.XA Active CN112990406B (en) 2021-04-15 2021-04-15 Two-dimensional code generation and identification method and device capable of adding dynamic extended information

Country Status (1)

Country Link
CN (1) CN112990406B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117350319A (en) * 2023-12-06 2024-01-05 深圳华龙讯达信息技术股份有限公司 Method and system for preventing error of product associated data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999772A (en) * 2012-11-14 2013-03-27 韩偲铭 Novel array-type two-dimension code encoding and decoding methods
CN104680114A (en) * 2015-03-03 2015-06-03 黄伟军 Method for processing multiple requests via two-dimension code and system thereof
CN107147729A (en) * 2017-05-31 2017-09-08 广州云移信息科技有限公司 Intelligent skip page method and system based on Quick Response Code
CN112449142A (en) * 2020-11-14 2021-03-05 深圳中神电子科技有限公司 Remote video conference system based on data cooperative transmission processing

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102034127A (en) * 2009-09-28 2011-04-27 上海易悠通信息科技有限公司 Novel high-capacity two-dimensional barcode and system, encoding and decoding methods and applications thereof
JPWO2011142133A1 (en) * 2010-05-11 2013-07-22 エイシップ・ソリューションズ株式会社 Error correction code processing method and apparatus
CN102760242B (en) * 2012-05-16 2016-09-14 孟智平 The encoding and decoding of a kind of three-dimension code and using method
WO2016095438A1 (en) * 2014-12-19 2016-06-23 深圳市金立通信设备有限公司 Two dimension code operating method and terminal
CN105373931A (en) * 2015-11-04 2016-03-02 成都汇智远景科技有限公司 Mobile terminal information processing method based on Internet of things

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999772A (en) * 2012-11-14 2013-03-27 韩偲铭 Novel array-type two-dimension code encoding and decoding methods
CN104680114A (en) * 2015-03-03 2015-06-03 黄伟军 Method for processing multiple requests via two-dimension code and system thereof
CN107147729A (en) * 2017-05-31 2017-09-08 广州云移信息科技有限公司 Intelligent skip page method and system based on Quick Response Code
CN112449142A (en) * 2020-11-14 2021-03-05 深圳中神电子科技有限公司 Remote video conference system based on data cooperative transmission processing

Also Published As

Publication number Publication date
CN112990406A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
EP2681922B1 (en) Synching one or more matrix codes to content related to a multimedia presentation
CN103279503B (en) Method and system for acquiring two-dimension code information from webpage
CN112789650B (en) Detecting translucent image watermarks
CN104820855A (en) Generation and identification method of dynamic two-dimensional codes based on mobile environment perception technology
CN112990406B (en) Two-dimensional code generation and identification method and device capable of adding dynamic extended information
CN111738280A (en) Image identification method, device, equipment and readable storage medium
JP2013041416A (en) Information processing device and method, program, and information processing system
CN109543072B (en) Video-based AR education method, smart television, readable storage medium and system
CN112269926A (en) Data pushing method and related device
CN104376291B (en) The method and device of data processing
CN113343895B (en) Target detection method, target detection device, storage medium and electronic equipment
CN111709851B (en) Hotel safety check-in method, device and equipment based on RFID and facial recognition
CN110175661A (en) The generation method and device in two dimensional code sharing path
CN111954154B (en) Positioning method and device, computer readable storage medium and electronic device
KR100371895B1 (en) Multimedia information service method using code image and apparatus thereof
CN113326405A (en) Park entrance recommendation method and system based on BIM technology
CN114677700A (en) Identification method and device of identity, storage medium and electronic equipment
KR20160128273A (en) System and method generating for multidimensional code
CN111401490A (en) Two-dimensional code obtaining method and related device
KR102457065B1 (en) Contents providing sever and control method thereof, method of providing contens, and system thereof
CN116740540B (en) Data processing method, device, equipment and computer readable storage medium
CN112581418B (en) Virtual content identification and display method and system based on augmented reality
CN113724065B (en) Auxiliary collecting method, device, equipment and storage medium based on flow guidance
CN116090422A (en) Method and device for inputting electric power industry expansion form
CN116682036A (en) Method, device, equipment and program product for detecting video shaking

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
TR01 Transfer of patent right

Effective date of registration: 20221130

Address after: 100070 03B04, Floor 3, No. 4, Fufeng Road, Science Park, Fengtai District, Beijing

Patentee after: Jiashi (Beijing) Technology Co.,Ltd.

Address before: 100089 1418, 14th floor, building a 1, East Jiayuan district, Qinghe, Haidian District, Beijing

Patentee before: Beijing kite technology Co.,Ltd.

TR01 Transfer of patent right