WO2019153867A1 - 二维码生成及识别 - Google Patents

二维码生成及识别 Download PDF

Info

Publication number
WO2019153867A1
WO2019153867A1 PCT/CN2018/119983 CN2018119983W WO2019153867A1 WO 2019153867 A1 WO2019153867 A1 WO 2019153867A1 CN 2018119983 W CN2018119983 W CN 2018119983W WO 2019153867 A1 WO2019153867 A1 WO 2019153867A1
Authority
WO
WIPO (PCT)
Prior art keywords
error correction
sequence
dimensional code
data
code
Prior art date
Application number
PCT/CN2018/119983
Other languages
English (en)
French (fr)
Inventor
杨崇灵
Original Assignee
北京三快在线科技有限公司
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 北京三快在线科技有限公司 filed Critical 北京三快在线科技有限公司
Priority to CA3090716A priority Critical patent/CA3090716A1/en
Priority to US16/967,128 priority patent/US11263416B2/en
Priority to JP2020540589A priority patent/JP2021513141A/ja
Publication of WO2019153867A1 publication Critical patent/WO2019153867A1/zh

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
    • G06K1/00Methods or arrangements for marking the record carrier in digital fashion
    • G06K1/12Methods or arrangements for marking the record carrier in digital fashion otherwise than by punching
    • 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/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

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to the generation and identification of two-dimensional codes.
  • QR codes are widely used in various fields due to their simple and convenient features.
  • QR code has become a new channel for mobile terminals to be infected with viruses.
  • the cases of user information leakage and property loss are numerous, so the security of the two-dimensional code in the application has great hidden dangers.
  • An object of the present disclosure is to provide a two-dimensional code generation method, a two-dimensional code generation device, a two-dimensional code recognition method, a two-dimensional code recognition device, an electronic device, and a computer-readable storage medium.
  • a method for generating a two-dimensional code includes: generating a data codeword sequence according to input information; performing encryption processing on the data codeword sequence to generate a codeword sequence; and determining an error correction code block And generating a two-dimensional code by using the data codeword sequence and the encrypted codeword sequence according to a configuration corresponding to the number of the error correction blocks.
  • encrypting the sequence of data codewords to generate a sequence of cryptographic words includes: generating a key corresponding to the sequence of data codewords according to a key management system; utilizing The key is encrypted according to an encryption algorithm, and the encrypted data codeword sequence is converted into the encrypted password sequence according to a preset encoding algorithm.
  • determining the number of the error correction blocks includes: acquiring a length of the data codeword sequence and an error correction level; according to a length of the data codeword sequence and an error correction level Find the number of corresponding error correction blocks in the preset error correction feature table.
  • generating the two-dimensional code by using the data codeword sequence and the encrypted code sequence according to a configuration corresponding to the number of the error correction blocks includes: determining the Whether the number of the error correction blocks is greater than a preset threshold, if yes, searching for a corresponding error correction block according to the preset error correction characteristic entry, and filling the sequence of the encryption code into the corresponding error correction block; otherwise, The sequence of cryptographic words is filled into the last data codeword block constituting the two-dimensional code.
  • a method for recognizing a two-dimensional code includes: reading and parsing an encrypted two-dimensional code; acquiring an error correction block; recovering according to a data recovery manner corresponding to the number of error correction code blocks a sequence of data codewords of the two-dimensional code and a sequence of cryptographic words; performing security verification on the sequence of cryptographic words, and obtaining input information after the sequence of cryptographic words passes security verification.
  • the restoring the data codeword sequence of the two-dimensional code and the encryption code sequence according to a data recovery manner corresponding to the number of error correction code blocks includes: determining the correction Whether the number of the wrong block is greater than a preset threshold, if yes, searching for a corresponding error correction block according to the preset error correction characteristic entry, and acquiring a sequence of the encrypted code in the error correction block by using a decoding algorithm; The algorithm obtains the sequence of cryptographic words in the last data codeword block that constitutes the two-dimensional code.
  • a two-dimensional code generating apparatus includes: a data codeword generating module, configured to generate a data codeword sequence according to the input information; and a password generating module, configured to use the data codeword sequence Performing an encryption process to generate a sequence of cryptographic words; an error correction code block determining module for determining the number of error correction code blocks; and a two-dimensional code information generating module for constructing according to the number of error correction code blocks The method generates the two-dimensional code by using the data codeword sequence and the encrypted code sequence.
  • a two-dimensional code identification apparatus includes: a two-dimensional code information reading module for reading and parsing an encrypted two-dimensional code; and an error correction code block determining module for determining a correction a codeword recovery module, configured to recover a data codeword sequence and a codeword sequence of the two-dimensional code according to a data recovery manner corresponding to the number of error correction blocks; and input an information acquisition module, configured to The encryption code sequence is described for security verification, and the input information is obtained after the encrypted password sequence passes security verification.
  • an electronic device comprising: a processor; and a storage medium storing machine readable instructions on which the machine readable instructions are implemented by the processor.
  • a computer readable storage medium having stored thereon a computer program, the computer program being executed by a processor, implements the method according to any one of the above.
  • the two-dimensional code generating method in the exemplary embodiment of the present disclosure generates a data codeword sequence according to the input information, and performs encryption processing on the data codeword sequence to generate a coded word sequence, and determines the number of error correction blocks. Then, the data codeword sequence and the encrypted codeword sequence are generated into a two-dimensional code according to a configuration corresponding to the number of error correction blocks.
  • the data code word sequence can be encrypted, the data content can be prevented from being tampered, and the security of the two-dimensional code can be improved; on the other hand, the data is constructed according to the configuration corresponding to the number of error correction blocks.
  • the code word sequence and the encrypted code word sequence generate two-dimensional code information, and the complete filling of the encrypted code word sequence can also be completed with higher efficiency.
  • FIG. 1 illustrates a flow chart of a two-dimensional code generation method according to an exemplary embodiment of the present disclosure.
  • FIG. 2 illustrates a flow chart of a two-dimensional code recognition method according to an exemplary embodiment of the present disclosure.
  • FIG. 3 shows a schematic block diagram of a two-dimensional code generating device according to an exemplary embodiment of the present disclosure.
  • FIG. 4 shows a schematic block diagram of a two-dimensional code recognition apparatus according to an exemplary embodiment of the present disclosure.
  • FIG. 5 schematically illustrates a block diagram of an electronic device in accordance with an exemplary embodiment of the present disclosure.
  • FIG. 6 schematically illustrates a schematic diagram of a computer readable storage medium in accordance with an exemplary embodiment of the present disclosure.
  • a two-dimensional code generation method is first provided, which can be applied to a network device; for example, the network device can be an electronic device such as a server.
  • the two-dimensional code generating method may include the following steps.
  • Step S110 Generate a data codeword sequence according to the input information.
  • Step S120 Perform encryption processing on the data codeword sequence to generate a codeword sequence.
  • Step S130 Determine the number of error correction blocks.
  • Step S140 Generate the two-dimensional code information by using the data codeword sequence and the encrypted codeword sequence according to a configuration manner corresponding to the number of the error correction blocks.
  • the data code word sequence can be encrypted, the data content can be prevented from being tampered, and the security of the two-dimensional code can be improved;
  • the construction method corresponding to the number of error correction blocks generates the two-dimensional code information by the data code word sequence and the encryption code sequence, and the complete filling of the encryption code sequence can be completed with higher efficiency.
  • step S110 a sequence of data codewords may be generated based on the input information.
  • the input information is the input data stream, which is information that needs to generate a two-dimensional code.
  • the input information is first analyzed, its length is determined, and the format and version of the corresponding two-dimensional code are determined according to the length of the input information.
  • the format of the two-dimensional code includes information such as an error correction level, a mask number, and an error correction code.
  • the version of the two-dimensional code may have multiple versions, and each version represents Inherent symbol structure. Since the mask number can be obtained subsequently in the mask operation, the mask number at this time can be empty.
  • an RS code data code corresponding to the input information may be generated by an algorithm such as Reed-Solomon Error Correction (RS). Word sequence.
  • RS Reed-Solomon Error Correction
  • step S120 the data codeword sequence is subjected to encryption processing to generate a codeword sequence.
  • the step may include: generating a key corresponding to the data codeword sequence according to the key management system, and encrypting the data codeword sequence according to an encryption algorithm by using the generated key;
  • the data codeword sequence is converted to the encrypted codeword sequence according to a preset encoding algorithm.
  • generating the key corresponding to the RS code data codeword sequence according to the key management system may include: inputting the RS code data codeword sequence to the key management a system to generate a key corresponding to the RS code data codeword sequence.
  • the code symbol corresponding to the RS code data codeword sequence may be generated, and a key corresponding to the code symbol may be generated by inputting the code symbol to the key management system.
  • the key generation rules of different key management systems are different, different key management systems generate keys in different ways, so that the RS code data generated by different key management systems is generated.
  • the key corresponding to the codeword sequence may also be different.
  • the present disclosure has no particular limitation on the key management system and the key generation rules.
  • the data codeword sequence can be encrypted by the encryption algorithm using the key. Then, the encrypted data codeword sequence is subjected to finite field conversion, and then encoded by an algorithm such as RS error correction coding to obtain a securely encrypted RS code plus ciphertext sequence.
  • the encryption algorithm may be a DES (Data Encryption Standard) encryption algorithm, an AES (Advanced Encryption Standard) encryption algorithm, or the like, which is not specifically limited in this disclosure.
  • step S130 the number of error correction blocks is determined.
  • the step may include: acquiring a length of the data codeword sequence (eg, represented by a number of codewords) and an error correction level; according to the length of the data codeword sequence and the error correction level. Find the number of error correction blocks in the preset error correction feature table.
  • the preset error correction characteristic entry may be preset according to information such as the length of the data codeword sequence and the error correction level, for example, as shown in the following table:
  • Table 1 shows a preset error correction characteristic entry, which is only used to further understand the examples of the present disclosure, and is not used to limit the specific content in the preset error correction characteristic table.
  • the preset error correction characteristic table item is preset with a version, a total number of codewords, an error correction level, a corresponding number of error correction blocks, and a correspondence relationship between error correction codes of each error correction block.
  • the corresponding error correction can be found in Table 1 according to the length of the RS code data codeword sequence (ie, the total number of codewords in the sequence), the predetermined version number, and the error correction level. The number of blocks.
  • step S140 the data codeword sequence and the encrypted codeword sequence are generated into two-dimensional code information according to a configuration manner corresponding to the number of error correction blocks.
  • the step may include: determining whether the number of the error correction blocks is greater than a preset threshold, and if so, searching for a corresponding specified error correction block according to the preset error correction characteristic entry, and adding the A sequence of cipher words is filled into the error correction block; otherwise, the sequence of cipher words is padded into the last block of data code words constituting the two-dimensional code.
  • the configuration may include a block crossover configuration and a supplementary configuration.
  • the preset threshold may be set to 1. If the number of the error correction blocks is greater than 1, the block crossover construction mode is adopted. If the number of wrong blocks is less than or equal to 1, the supplementary construction mode is adopted. For example:
  • the error correction level is Q
  • the data length of the data codeword sequence is 70
  • the number of corresponding error correction blocks can be found in Table 1. Since the number 2 of the error correction blocks is greater than the preset threshold 1, the final information may be constructed by using a block crossover construction manner, that is, each of the lookup table 1 corresponding to the error correction level Q, the data length 70, and the version number 3.
  • the error correction code (35, 17, 9) of the error block is filled, and the RS code plus cipher word sequence is filled into the complement bits in each error correction block (35, 17, 9), thereby constructing the final information.
  • the version is determined to be 2 in step S110, the error correction level is Q, and the data length of the data codeword sequence is 44, then the number of corresponding error correction blocks can be found in Table 1. Since the number of the error correction block is equal to the preset threshold 1, the final information can be constructed using a supplementary configuration, that is, the coded word sequence is filled to the complement of the last data code block constituting the two-dimensional code. In this, the final information is constructed.
  • the length of the cipher-word sequence may be determined according to the configuration manner corresponding to the number of error-correcting blocks before generating the cipher-word sequence.
  • the length of the cryptographic word sequence is controlled to be less than or equal to the number of padding bits that can be filled in the error correction block of the corresponding configuration, so that the cryptographic word sequence can be completely filled into the error correction block.
  • the final information is arranged in the matrix, and the selected mask pattern is added, the mask serial number information in the format is supplemented according to the selected mask pattern, and finally, the format and version information are added to generate two Dimension code (ie QR code symbol).
  • the present embodiment further provides a two-dimensional code identification method, which can be applied to a terminal device.
  • the terminal device can be, for example, a mobile phone, a computer, a PDA, or the like, and has various electronic devices with a two-dimensional code scanning function.
  • the two-dimensional code recognition method may include the following steps.
  • Step S210 Read and parse the encrypted two-dimensional code.
  • reading and parsing the encrypted two-dimensional code includes: scanning and reading the encrypted two-dimensional code by using an electronic device, parsing the deep and shallow module in the two-dimensional code, performing format information decoding, and acquiring the two-dimensional code The length of the data codeword sequence in the data, and eliminate the added mask pattern to determine the version and format information, and then obtain information such as error correction level, mask number, and error correction code.
  • Step S220 Determine the number of error correction blocks.
  • step S130 For the manner of determining the number of error correction blocks in this step, reference may be made to the method for determining the number of error correction blocks in step S130, and details are not described herein again.
  • Step S230 Restore the data codeword sequence and the encryption code sequence of the two-dimensional code according to the data recovery manner corresponding to the number of error correction blocks.
  • Recovering the data codeword sequence of the two-dimensional code and the encryption code sequence according to the data recovery manner corresponding to the number of error correction blocks includes: determining whether the number of the error correction blocks is greater than a preset threshold, and if so, according to preset correction The error characteristic entry is searched for the corresponding padding block corresponding to the padding, and the coded word sequence in the error correction block is obtained by the decoding algorithm; otherwise, the last data code constituting the two-dimensional code is obtained by the decoding algorithm. The sequence of cryptographic words in the block.
  • the preset threshold in this step may be the same as the preset threshold in the foregoing step S140.
  • the data recovery manner corresponding to the number of error correction blocks may include a block recovery data mode and a segmentation recovery. Data method.
  • the block recovery data mode is adopted. If the number of the error correction blocks is not greater than (less than or equal to) the preset threshold, the segmentation recovery data mode is adopted.
  • the error correction level is Q
  • the data length is 70
  • the number of corresponding error correction blocks is 2 in the preset error correction characteristic entry (Table 1)
  • the data code word sequence and the encryption code word sequence may be recovered by using the block recovery data mode, that is, each block corresponding to the error correction level and the data length in the lookup table 1 is obtained.
  • An error correcting code from which an error correcting code (35, 17, 9) of the corresponding error correcting block is found, and sequentially obtains an RS code plus a cipher word sequence from the complementary bits in the error correcting block (35, 17, 9), This recovers the RS code data codeword sequence and the RS code plus password sequence; however, if it is determined that the number of error correction blocks is 1, since the number of error correction blocks is equal to the preset threshold 1, then segmentation recovery can be used.
  • the data mode recovers the RS code plus cipher word sequence, that is, obtains the filled RS code plus cipher word sequence from the supplementary bits of the last data code word block constituting the two-dimensional code, thereby recovering the RS code data code word sequence and RS code plus password word sequence.
  • Step S240 Perform a security check on the encrypted code sequence, and obtain input information after the encrypted password sequence passes security verification.
  • the security check is performed on the sequence of the encrypted code, including: after acquiring the RS code plus the password sequence, first performing finite field conversion on the RS code plus the password sequence by using the RS code error correction decoding algorithm, and The cryptographic word sequence after the finite field conversion is decrypted according to the key management system to obtain a corresponding key. Then, the key can be verified.
  • the manner of verifying the key may be different according to the key management system.
  • the acquired key may be matched with the key obtained in step S120, or may be Matching the obtained key with the RS code data codeword sequence, if it is determined that the two match, it is determined that the original input information in the two-dimensional code symbol can be restored through the security check; if it is determined that the two do not match, Or the obtained key is 0, indicating that the information may be tampered with, and if the security check is not passed, the original input information in the two-dimensional code symbol cannot be restored. It can be seen that the present disclosure can also check whether the two-dimensional code information has been tampered with the security verification of the two-dimensional code information, thereby ensuring the security of the two-dimensional code information in the actual application scenario.
  • the two-dimensional code generating apparatus 300 may include a data codeword generating module 310, an encryption code generating module 320, an error correcting code block determining module 330, and a two-dimensional code generating module 340.
  • the data codeword generating module 310 can be configured to generate a data codeword sequence according to the input information.
  • the cryptographic word generation module 320 can be configured to perform encryption processing on the data codeword sequence to generate a cryptographic word sequence.
  • the error correction code block determining module 330 can be used to determine the number of error correction blocks.
  • the two-dimensional code generating module 340 is configured to generate the two-dimensional code by using the data codeword sequence and the encrypted codeword sequence according to a configuration manner corresponding to the number of the error correction blocks.
  • the two-dimensional code recognition apparatus 400 may include a two-dimensional code reading module 410, an error correction code block determination module 420, a codeword recovery module 430, and an input information acquisition module 440.
  • the two-dimensional code reading module 410 is configured to read and parse the encrypted two-dimensional code.
  • the error correction code block determining module 420 is configured to determine the number of error correction blocks.
  • the codeword recovery module 430 is configured to recover the data codeword sequence and the encryption code sequence of the two-dimensional code according to a data recovery manner corresponding to the number of error correction blocks.
  • the input information obtaining module 440 is configured to perform security verification on the sequence of the encrypted passwords, and obtain the input information after the encrypted password sequence passes the security verification.
  • modules or units of the two-dimensional code generating device 300 are mentioned in the above detailed description, such division is not mandatory. Indeed, in accordance with embodiments of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one of the modules or units described above may be further divided into multiple modules or units.
  • an electronic device capable of implementing the above method is also provided.
  • aspects of the present disclosure can be implemented as a system, method, or program product. Accordingly, aspects of the present disclosure may be embodied in the form of a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or a combination of hardware and software aspects, which may be collectively referred to herein. "Circuit,” “module,” or “system.”
  • FIG. 5 An electronic device 500 according to an embodiment of the present disclosure is described below with reference to FIG. 5.
  • the electronic device 500 shown in FIG. 5 is merely an example and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
  • electronic device 500 is embodied in the form of a general purpose computing device.
  • the components of the electronic device 500 may include, but are not limited to, the at least one processing unit 510, the at least one storage unit 520, the bus 530 connecting the different system components (including the storage unit 520 and the processing unit 510), and the display unit 540.
  • the storage unit 520 stores machine executable instructions that can be executed by the processing unit 510 such that the processing unit 510 performs the according to the present description described in the "Exemplary Method" section of the present specification.
  • the steps of various exemplary embodiments are invented.
  • the processing unit 510 can perform steps S110 to S140 as shown in FIG. 1, and steps S210 to S240 as shown in FIG. 2.
  • the storage unit 520 can include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 5201 and/or a cache storage unit 5202, and can further include a read only storage unit (ROM) 5203.
  • RAM random access storage unit
  • ROM read only storage unit
  • the storage unit 520 can also include an instruction/utility 5204 having a set (at least one) of the instruction modules 5205, such as, but not limited to, an operating system, one or more applications, other program modules, and program data, Implementations of the network environment may be included in each or some of these examples.
  • an instruction/utility 5204 having a set (at least one) of the instruction modules 5205, such as, but not limited to, an operating system, one or more applications, other program modules, and program data, Implementations of the network environment may be included in each or some of these examples.
  • Bus 530 may be representative of one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any of a variety of bus structures. bus.
  • the electronic device 500 can also communicate with one or more external devices 570 (eg, a keyboard, pointing device, Bluetooth device, etc.), and can also communicate with one or more devices that enable the user to interact with the electronic device 500, and/or with Any device (eg, router, modem, etc.) that enables the electronic device 500 to communicate with one or more other computing devices. This communication can take place via an input/output (I/O) interface 550. Also, electronic device 500 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) via network adapter 560. As shown, network adapter 560 communicates with other modules of electronic device 500 via bus 530.
  • network adapter 560 communicates with other modules of electronic device 500 via bus 530.
  • the exemplary embodiments described herein may be implemented by software, or may be implemented by software in combination with necessary hardware. Therefore, the technical solution according to an embodiment of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network.
  • a non-volatile storage medium which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.
  • a number of instructions are included to cause a computing device (which may be a personal computer, server, terminal device, or network device, etc.) to perform a method in accordance with an embodiment of the present disclosure.
  • a computer readable storage medium having stored thereon a program product capable of implementing the above method of the present specification.
  • various aspects of the present disclosure may also be embodied in the form of a program product comprising program code for causing said program product to run on a terminal device The terminal device performs the steps according to various exemplary embodiments of the present invention described in the "Exemplary Method" section of the present specification.
  • a program product 600 for implementing the above method which may employ a portable compact disk read only memory (CD-ROM) and includes program code, and may be at a terminal device, is described in accordance with an embodiment of the present disclosure.
  • CD-ROM portable compact disk read only memory
  • the program product of the present disclosure is not limited thereto, and in this document, the readable storage medium may be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
  • the program product can employ any combination of one or more readable media.
  • the readable medium can be a readable signal medium or a readable storage medium.
  • the readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive lists) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • the computer readable signal medium may include a data signal that is propagated in the baseband or as part of a carrier, carrying readable program code. Such propagated data signals can take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the readable signal medium can also be any readable medium other than a readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
  • Program code embodied on a readable medium can be transmitted using any suitable medium, including but not limited to wireless, wireline, optical cable, RF, etc., or any suitable combination of the foregoing.
  • Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language, such as Java, C++, etc., including conventional procedural Programming language—such as the "C" language or a similar programming language.
  • the program code can execute entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the remote computing device on the user computing device, or entirely on the remote computing device or server. Execute on.
  • the remote computing device can be connected to the user computing device via any kind of network, including a local area network (LAN) or wide area network (WAN), or can be connected to an external computing device (eg, provided using an Internet service) Businesses are connected via the Internet).
  • LAN local area network
  • WAN wide area network
  • Businesses are connected via the Internet.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Storage Device Security (AREA)
  • Detection And Correction Of Errors (AREA)

Abstract

一种二维码生成方法及装置、二维码识别方法及装置、电子设备以及存储介质。该方法包括:根据输入信息生成数据码字序列(S110);将所述数据码字序列进行加密处理,以生成加密码字序列(S120);确定纠错块个数(S130);根据所述纠错块个数对应的构造方式将所述数据码字序列以及所述加密码字序列生成二维码(S140)。

Description

二维码生成及识别
相关申请的交叉引用
本专利申请要求于2018年2月7日提交的、申请号为201810123416.0、发明名称为“二维码生成方法及装置、二维码识别方法及装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本文中。
技术领域
本公开涉及计算机技术领域,具体而言,涉及二维码的生成及识别。
背景技术
随着互联网技术和通信技术的发展,二维码由于其简单、便利的特性被广泛应用于各类领域。然而,也正因为其简单、便利的特性,二维码已经成为移动终端感染病毒的新渠道。在使用移动终端进行扫码登录或支付等应用场景中,用户信息泄露、财产损失的案例不胜枚举,因此二维码在应用中的安全性存在极大隐患。
发明内容
本公开的目的在于提供一种二维码生成方法、二维码生成装置、二维码识别方法、二维码识别装置、电子设备以及计算机可读存储介质。
根据本公开的一个方面,提供一种二维码生成方法,包括:根据输入信息生成数据码字序列;对所述数据码字序列进行加密处理,以生成加密码字序列;确定纠错码块个数;根据与所述纠错块个数对应的构造方式,将所述数据码字序列以及所述加密码字序列生成二维码。
在本公开的一种示例性实施例中,对所述数据码字序列进行加密,以生成加密码字序列,包括:根据密钥管理***生成与所述数据码字序列对应的密钥;利用所述密钥、根据加密算法对所述数据码字序列进行加密;将加密后的所述数据码字序列按照预设编 码算法转换为所述加密码字序列。
在本公开的一种示例性实施例中,确定所述纠错块个数,包括:获取所述数据码字序列的长度以及纠错等级;根据所述数据码字序列的长度以及纠错等级,在预设纠错特性表项中查找对应的纠错块个数。
在本公开的一种示例性实施例中,根据与所述纠错块个数对应的构造方式,将所述数据码字序列以及所述加密码字序列生成二维码,包括:判断所述纠错块个数是否大于预设阈值,若是,根据预设纠错特性表项查找对应的纠错块,并将所述加密码字序列填充至所述对应的纠错块中;否则,将所述加密码字序列填充至构成所述二维码的最后一个数据码字块中。
根据本公开的一个方面,提供一种二维码识别方法,包括:读取并解析加密后的二维码;获取纠错块个数;根据与纠错码块个数对应的数据恢复方式恢复所述二维码的数据码字序列以及加密码字序列;对所述加密码字序列进行安全校验,并在所述加密码字序列通过安全验证后获取输入信息。
在本公开的一种示例性实施例中,所述根据与纠错码块个数对应的数据恢复方式恢复所述二维码的数据码字序列以及加密码字序列,包括:判断所述纠错块个数是否大于预设阈值,若是,根据预设纠错特性表项查找对应的纠错块,并通过译码算法获取所述纠错块中的加密码字序列;否则,通过译码算法获取构成所述二维码的最后一个数据码字块中的所述加密码字序列。
根据本公开的一个方面,提供一种二维码生成装置,包括:数据码字生成模块,用于根据输入信息生成数据码字序列;加密码字生成模块,用于将所述数据码字序列进行加密处理,以生成加密码字序列;纠错码块确定模块,用于确定纠错码块个数;二维码信息生成模块,用于根据与所述纠错码块个数对应的构造方式将所述数据码字序列以及所述加密码字序列生成二维码。
根据本公开的一个方面,提供一种二维码识别装置,包括:二维码信息读取模块,用于读取并解析加密后的二维码;纠错码块确定模块,用于确定纠错块个数;码字恢复模块,用于根据与纠错块个数对应的数据恢复方式恢复所述二维码的数据码字序列以及加密码字序列;输入信息获取模块,用于对所述加密码字序列进行安全校验,并在所述加密码字序列通过安全验证后获取输入信息。
根据本公开的一个方面,提供一种电子设备,包括:处理器;以及存储介质,所述 存储介质上存储有机器可读指令,所述机器可读指令被所述处理器执行时实现根据上述任意一项所述的方法。
根据本公开的一个方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现根据上述任意一项所述的方法。
本公开的示例性实施例中的二维码生成方法,根据输入信息生成数据码字序列,并对所述数据码字序列进行加密处理,以生成加密码字序列,在确定纠错块个数后,根据纠错块个数对应的构造方式将数据码字序列以及加密码字序列生成二维码。一方面,由于可以通过对数据码字序列进行加密处理,因此可防止数据内容被篡改,提高了二维码的安全性;另一方面,由于根据与纠错块个数对应的构造方式将数据码字序列以及加密码字序列生成二维码信息,还可以在较高效率的情况下完成加密码字序列的完整填充。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
通过参照附图来详细描述其示例实施例,本公开的上述和其它特征及优点将变得更加明显。
图1示出了根据本公开一示例性实施例的二维码生成方法的流程图。
图2示出了根据本公开一示例性实施例的二维码识别方法的流程图。
图3示出了根据本公开一示例性实施例的二维码生成装置的示意框图。
图4示出了根据本公开一示例性实施例的二维码识别装置的示意框图。
图5示意性示出了根据本公开一示例性实施例的电子设备的框图。
图6示意性示出了根据本公开一示例性实施例的计算机可读存储介质的示意图。
具体实施方式
现在将参考附图更全面地描述示例实施例。然而,示例实施例能够以多种形式实施,且不应被理解为限于在此阐述的实施例;相反,提供这些实施例使得本公开将全面和完 整,并将示例实施例的构思全面地传达给本领域的技术人员。在图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本公开的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而没有所述特定细节中的一个或更多,或者可以采用其它的方法、组元、材料、装置、步骤等。在其它情况下,不详细示出或描述公知结构、方法、装置、实现、材料或者操作以避免模糊本公开的各方面。
附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个软件硬化的模块中实现这些功能实体或功能实体的一部分,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
在本示例中,首先提供了一种二维码生成方法,可以应用于一网络设备;所述网络设备例如可以为服务器等电子设备。参考图1中所示,该二维码生成方法可以包括以下步骤。
步骤S110.根据输入信息生成数据码字(data codeword)序列。
步骤S120.对所述数据码字序列进行加密处理,以生成加密码字序列。
步骤S130.确定纠错块个数(number of error correction blocks)。
步骤S140.根据与所述纠错块个数对应的构造方式,将所述数据码字序列以及所述加密码字序列生成二维码信息。
根据本示例中的二维码生成方法,一方面,由于可以通过对数据码字序列进行加密处理,因此可防止数据内容被篡改,提高了二维码的安全性;另一方面,由于根据与纠错块个数对应的构造方式将数据码字序列以及加密码字序列生成二维码信息,可以在较高效率的情况下完成加密码字序列的完整填充。
下面,将对本示例中的二维码生成方法进行进一步的说明。
在步骤S110中,可以根据输入信息生成数据码字序列。
输入信息即输入的数据流,为需要生成二维码的信息。本示例实施方式中,首先对输入信息进行分析,确定其长度,并根据输入信息的长度确定对应的二维码的格式以及版本。其中,二维码的格式包括纠错等级(error correction level)、掩模(mask)序号 以及纠错码(error correction code)等信息,二维码的版本可以有多个,每个版本都代表固有的码元结构。由于掩模序号为后续在掩模操作中才能获得,因此,此时的掩模序号可以为空。
之后,通过数据编码将输入信息转换为位流,以及确定是否需要进行模式转换将数据位流转换为较短的长度。并且,在对输入信息进行数据编码转换为位流之后,可通过例如里德-所罗门纠错(Reed-solomon Error Correction,RS纠错)编码等的算法,生成与输入信息对应的RS码数据码字序列。
在步骤S120中,对所述数据码字序列进行加密处理,以生成加密码字序列。
本示例中,该步骤可以包括:根据密钥管理***生成所述数据码字序列对应的密钥,并利用生成的密钥、根据加密算法对所述数据码字序列进行加密;将加密后的数据码字序列按照预设编码算法转换为所述加密码字序列。
在获得RS码数据码字序列后,在一实施例中,根据密钥管理***生成所述RS码数据码字序列对应的密钥可以包括:将该RS码数据码字序列输入至密钥管理***,以生成与该RS码数据码字序列对应的密钥。在另一实施例中,也可以是生成该RS码数据码字序列对应的编码符号,并通过将该编码符号输入至该密钥管理***来生成与该编码符号对应的密钥。
本示例中,由于不同的密钥管理***的密钥生成规则不相同,使得不同的密钥管理***生成密钥的方式也不相同,从而根据不同密钥管理***生成的与所述RS码数据码字序列对应的密钥也可能不同。本公开对密钥管理***以及密钥生成规则均无特殊限定。
在生成与数据码字序列对应的密钥后,可以利用该密钥、通过加密算法对该数据码字序列进行加密。然后,对加密后的数据码字序列进行有限域转换后通过例如RS纠错编码等的算法进行编码,从而得到安全加密过的RS码加密码字序列。其中,该加密算法可以是DES(Data Encryption Standard,数据加密标准)加密算法、AES(Advanced Encryption Standard,高级加密标准)加密算法等等,本公开对此不做具体限定。
在步骤S130中,确定纠错块个数。
本示例实施方式中,该步骤可以包括:获取所述数据码字序列的长度(例如,用码字个数来表示)以及纠错等级;根据所述数据码字序列的长度以及纠错等级在预设纠错特性表项中查找纠错块个数。
该预设纠错特性表项可以是根据数据码字序列的长度以及纠错等级等信息预先设定的,例如可参考下表所示:
Figure PCTCN2018119983-appb-000001
表1
表1示出了预设纠错特性表项,仅用于进一步理解本公开内容的示例,并不用于限制预设纠错特性表项中的具体内容。
预设纠错特性表项中预先设置了版本、码字总数、纠错等级、对应的纠错块个数以及每一纠错块的纠错码之间的对应关系。每一纠错块的纠错码可表示为(c,k,r)。其中,c表示每个纠错块中的码字总数(total number of codewords),k表示该纠错块中数据码字的个数(number of data codewords),r表示该纠错块的纠错码容量(number of error correction capacity),并且c、k、r满足以下关系式:c=k+2*r。
当生成RS码数据码字序列后,即可根据RS码数据码字序列的长度(即该序列中码字总数)、预先确定的版本号以及纠错等级在表1中查找到对应的纠错块个数。
在步骤S140中,根据所述纠错块个数对应的构造方式,将所述数据码字序列以及所述加密码字序列生成二维码信息。
本示例实施方式中,该步骤可以包括:判断所述纠错块个数是否大于预设阈值,若是,根据预设纠错特性表项查找对应的指定填充的纠错块,并将所述加密码字序列填充至所述纠错块中;否则,将所述加密码字序列填充至构成二维码的最后一个数据码字块中。所述构造方式可以包括分块交叉构造方式以及补充构造方式,例如:可以将预设阈值设置为1,若判断所述纠错块个数大于1则采用分块交叉构造方式,若所述纠错块个数小于或等于1,则采用补充构造方式。举例而言:
若步骤S110中确定版本为3,纠错等级为Q,数据码字序列的数据长度为70,那么可以在表1中查找到对应的纠错块个数为2。由于该纠错块个数2大于预设阈值1,可以使用分块交叉构造方式构造出最终信息,即:查找表1中与该纠错等级Q、数据长度70、版本号3对应的每一纠错块的纠错码(35,17,9),并将RS码加密码字序列填充至每一纠错块(35,17,9)中的补充位,由此构造出最终信息。
然而,若步骤S110中确定版本为2,纠错等级为Q,数据码字序列的数据长度为44,那么可以在表1中查找到对应的纠错块个数为1。由于该纠错块个数1等于预设阈值1,那么则可以使用补充构造方式构造出最终信息,即:将该加密码字序列填充至构成二维码的最后一个数据码字块的补充位中,由此构造出最终信息。
本示例实施方式中,为了保证加密码字构造的完整性,可以在生成加密码字序列前,事先根据纠错块个数对应的构造方式确定出加密码字序列的长度、即加密码字序列所包含的码字总数。例如,将加密码字序列的长度控制为小于或等于对应的构造方式的纠错块中可填充的补充位数量,以使加密码字序列可完整的被填充至纠错块中。
在构造出最终信息后,将该最终信息布置于矩阵中,并添加选取的掩模图形,根据选取的掩模图形补充格式中的掩模序号信息,最后,添加格式和版本信息,以生成二维码(即二维码符号)。
进一步的,本示例实施方式中还提供了一种二维码识别方法,可以应用于一终端设备;所述终端设备例如可以为手机、电脑、PDA等具有二维码扫描功能的各种电子设备。参考图2所示,所述二维码识别方法可以包括以下步骤。
步骤S210.读取并解析加密后的二维码。
在本步骤中,读取并解析加密后的二维码包括:通过电子设备扫描读取加密后的二 维码,解析二维码中的深浅模块,进行格式信息译码,获取该二维码中的数据码字序列长度,并消除添加的掩模图形,以确定出版本以及格式信息,进而获取纠错等级、掩模序号以及纠错码等信息。
步骤S220.确定纠错块个数。
本步骤中确定纠错块个数的方式可以参考步骤S130中的纠错块个数的确定方式,在此不再赘述。
步骤S230.根据纠错块个数对应的数据恢复方式恢复所述二维码的数据码字序列以及加密码字序列。
根据纠错块个数对应的数据恢复方式恢复所述二维码的数据码字序列以及加密码字序列,包括:判断所述纠错块个数是否大于预设阈值,若是,根据预设纠错特性表项查找对应的指定填充的纠错块,并通过译码算法获取所述纠错块中的加密码字序列;否则,通过译码算法获取构成所述二维码的最后一个数据码字块中的所述加密码字序列。
本步骤中的预设阈值与上述步骤S140中的预设阈值可以相同,在确定纠错块个数后,与纠错块个数对应的数据恢复方式可以包括分块恢复数据方式以及分段恢复数据方式。当纠错块个数大于预设阈值时,则采用分块恢复数据方式,若所述纠错块个数不大于(小于或等于)预设阈值,则采用分段恢复数据方式。
举例来说:若确定的版本为3,纠错等级为Q,数据长度为70,且在预设纠错特性表项(表1)中查找到对应的纠错块个数为2,由于该纠错块个数2大于预设阈值1,可以使用分块恢复数据方式恢复出数据码字序列以及加密码字序列,即:查找表1中与该纠错等级、数据长度对应的每一块的纠错码,从中查找到对应的纠错块的纠错码(35,17,9),并依次从纠错块(35,17,9)中的补充位获取RS码加密码字序列,由此恢复出RS码数据码字序列以及RS码加密码字序列;然而,若确定纠错块个数为1,由于该纠错块个数1等于预设阈值1,那么则可以使用分段恢复数据方式恢复出RS码加密码字序列,即:从构成二维码的最后一个数据码字块的补充位中获取填充的RS码加密码字序列,由此恢复出RS码数据码字序列以及RS码加密码字序列。
步骤S240.对所述加密码字序列进行安全校验,并在所述加密码字序列通过安全验证后获取输入信息。
本步骤中,对所述加密码字序列进行安全校验,包括:在获取RS码加密码字序列后,首先通过RS码纠错译码算法对RS码加密码字序列进行有限域转换,并根据密钥 管理***对进行有限域转换后的加密码字序列进行解密,以得到对应的密钥。接着,可以对该密钥进行验证,对密钥进行验证的方式可以根据密钥管理***的不同而不同,例如:可以将获取的密钥与步骤S120中获取的密钥进行匹配,也可以是将获取的密钥与RS码数据码字序列进行匹配等,如果确定两者匹配,则确定通过安全校验,可以还原出二维码符号中原始的输入信息;若确定两者并不匹配,或者获取的密钥为0,说明信息可能被篡改,确定未通过安全校验,则不能还原出二维码符号中原始的输入信息。由此可见,本公开还可以通过对二维码信息的安全验证,及时检查出二维码信息是否被篡改,进而保证了二维码信息在实际应用场景中的安全性。
需要说明的是,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。
此外,在本示例中,还提供了一种二维码生成装置。参照图3所示,该二维码生成装置300可以包括:数据码字生成模块310、加密码字生成模块320、纠错码块确定模块330以及二维码生成模块340。
数据码字生成模块310,可以用于根据输入信息生成数据码字序列。
加密码字生成模块320,可以用于将所述数据码字序列进行加密处理,以生成加密码字序列。
纠错码块确定模块330,可以用于确定纠错块个数。
二维码生成模块340,可以用于根据所述纠错块个数对应的构造方式将所述数据码字序列以及所述加密码字序列生成二维码。
上述中各二维码生成装置模块的具体细节已经在对应的二维码生成方法中进行了详细的描述,因此此处不再赘述。
此外,在本示例实施例中,还提供了一种二维码识别装置。参照图4所示,该二维码识别装置400可以包括:二维码读取模块410、纠错码块确定模块420、码字恢复模块430以及输入信息获取模块440。
二维码读取模块410,用于读取并解析加密后的二维码。
纠错码块确定模块420,用于确定纠错块个数。
码字恢复模块430,用于根据纠错块个数对应的数据恢复方式恢复所述二维码的数据码字序列以及加密码字序列。
输入信息获取模块440,用于对所述加密码字序列进行安全校验,并在所述加密码字序列通过安全验证后获取输入信息。
上述中各二维码识别装置模块的具体细节已经在对应的二维码识别方法中进行了详细的描述,因此此处不再赘述。
应当注意,尽管在上文详细描述中提及了二维码生成装置300的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
此外,在本公开的示例性实施例中,还提供了一种能够实现上述方法的电子设备。
所属技术领域的技术人员能够理解,本公开的各个方面可以实现为***、方法或程序产品。因此,本公开的各个方面可以具体实现为以下形式,即:完全的硬件实施例、完全的软件实施例(包括固件、微代码等),或硬件和软件方面结合的实施例,这里可以统称为“电路”、“模块”或“***”。
下面参照图5来描述根据本公开的实施例的电子设备500。图5显示的电子设备500仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图5所示,电子设备500以通用计算设备的形式表现。电子设备500的组件可以包括但不限于:上述至少一个处理单元510、上述至少一个存储单元520、连接不同***组件(包括存储单元520和处理单元510)的总线530、显示单元540。
其中,所述存储单元520存储有机器可执行指令,所述机器可执行指令可以被所述处理单元510执行,使得所述处理单元510执行本说明书上述“示例性方法”部分中描述的根据本发明各种示例性实施例的步骤。例如,所述处理单元510可以执行如图1中所示的步骤S110-步骤S140,以及如图2中所示的步骤S210-步骤S240。
存储单元520可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)5201和/或高速缓存存储单元5202,还可以进一步包括只读存储单元(ROM)5203。
存储单元520还可以包括具有一组(至少一个)指令模块5205的指令/实用工具5204, 这样的指令模块5205包括但不限于:操作***、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。
总线530可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、***总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。
电子设备500也可以与一个或多个外部设备570(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备500交互的设备通信,和/或与使得该电子设备500能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口550进行。并且,电子设备500还可以通过网络适配器560与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器560通过总线530与电子设备500的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备500使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID***、磁带驱动器以及数据备份存储***等。
通过以上的实施例的描述,本领域的技术人员易于理解,这里描述的示例实施例可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本公开实施例的方法。
在本公开的示例性实施例中,还提供了一种计算机可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。在一些可能的实施例中,本公开的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在终端设备上运行时,所述程序代码用于使所述终端设备执行本说明书上述“示例性方法”部分中描述的根据本发明各种示例性实施例的步骤。
参考图6所示,描述了根据本公开的实施例的用于实现上述方法的程序产品600,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本公开的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行***、装置或者器件使用或者与其结合使用。
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的***、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行***、装置或者器件使用或者与其结合使用的程序。
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。
此外,上述附图仅是根据本公开示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。
本领域技术人员在考虑说明书及实践本公开后,将容易想到本公开的其他实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限。

Claims (10)

  1. 一种二维码生成方法,包括:
    根据输入信息生成数据码字序列;
    对所述数据码字序列进行加密处理,以生成加密码字序列;
    确定纠错块个数;
    根据与所述纠错块个数对应的构造方式,将所述数据码字序列以及所述加密码字序列生成二维码。
  2. 如权利要求1所述的方法,其特征在于,对所述数据码字序列进行加密,以生成所述加密码字序列,包括:
    根据密钥管理***生成与所述数据码字序列对应的密钥;
    利用所述密钥、根据加密算法对所述数据码字序列进行加密;
    将加密后的所述数据码字序列按照预设编码算法转换为所述加密码字序列。
  3. 如权利要求1所述的方法,其特征在于,确定所述纠错块个数,包括:
    获取所述数据码字序列的长度以及纠错等级;
    根据所述数据码字序列的长度以及所述纠错等级,在预设纠错特性表项中查找对应的纠错块个数。
  4. 如权利要求1所述的方法,其特征在于,根据与所述纠错块个数对应的构造方式,将所述数据码字序列以及所述加密码字序列生成二维码,包括:
    判断所述纠错块个数是否大于预设阈值,
    若是,根据预设纠错特性表项查找对应的纠错块,并将所述加密码字序列填充至所述对应的纠错块中;
    否则,将所述加密码字序列填充至构成所述二维码的最后一个数据码字块中。
  5. 一种二维码识别方法,包括:
    读取并解析加密后的二维码;
    获取纠错块个数;
    根据与纠错块个数对应的数据恢复方式恢复所述二维码的数据码字序列以及加密码字序列;
    对所述加密码字序列进行安全校验,并在所述加密码字序列通过安全验证后获取输入信息。
  6. 如权利要求5所述的方法,其特征在于,所述根据与纠错块个数对应的数据恢复方式恢复所述二维码的数据码字序列以及加密码字序列,包括:
    判断所述纠错块个数是否大于预设阈值,
    若是,根据预设纠错特性表项查找对应的纠错块,并通过译码算法获取所述对应的纠错块中的加密码字序列;
    否则,通过译码算法获取构成所述二维码的最后一个数据码字块中的所述加密码字序列。
  7. 一种二维码生成装置,包括:
    数据码字生成模块,用于根据输入信息生成数据码字序列;
    加密码字生成模块,用于将所述数据码字序列进行加密处理,以生成加密码字序列;
    纠错码块确定模块,用于确定纠错块个数;
    二维码信息生成模块,用于根据与所述纠错块个数对应的构造方式将所述数据码字序列以及所述加密码字序列生成二维码。
  8. 一种二维码识别装置,包括:
    二维码信息读取模块,用于读取并解析加密后的二维码;
    纠错码块确定模块,用于确定纠错块个数;
    码字恢复模块,用于根据与纠错块个数对应的数据恢复方式恢复所述二维码的数据码字序列以及加密码字序列;
    输入信息获取模块,用于对所述加密码字序列进行安全校验,并在所述加密码字序列通过安全验证后获取输入信息。
  9. 一种电子设备,包括:
    处理器;以及
    存储介质,所述存储介质上存储有机器可读指令,所述机器可读指令被所述处理器执行时实现根据权利要求1至6中任一项所述的方法。
  10. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现根据权利要求1至6中任一项所述方法。
PCT/CN2018/119983 2018-02-07 2018-12-10 二维码生成及识别 WO2019153867A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CA3090716A CA3090716A1 (en) 2018-02-07 2018-12-10 Two-dimensional code generation and identification
US16/967,128 US11263416B2 (en) 2018-02-07 2018-12-10 Two-dimensional code generation and identification
JP2020540589A JP2021513141A (ja) 2018-02-07 2018-12-10 2次元バーコードの生成及び識別

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810123416.0A CN110119643B (zh) 2018-02-07 2018-02-07 二维码生成方法及装置、二维码识别方法及装置
CN201810123416.0 2018-02-07

Publications (1)

Publication Number Publication Date
WO2019153867A1 true WO2019153867A1 (zh) 2019-08-15

Family

ID=67520118

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/119983 WO2019153867A1 (zh) 2018-02-07 2018-12-10 二维码生成及识别

Country Status (5)

Country Link
US (1) US11263416B2 (zh)
JP (1) JP2021513141A (zh)
CN (1) CN110119643B (zh)
CA (1) CA3090716A1 (zh)
WO (1) WO2019153867A1 (zh)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11010233B1 (en) 2018-01-18 2021-05-18 Pure Storage, Inc Hardware-based system monitoring
US11941116B2 (en) * 2019-11-22 2024-03-26 Pure Storage, Inc. Ransomware-based data protection parameter modification
US11651075B2 (en) 2019-11-22 2023-05-16 Pure Storage, Inc. Extensible attack monitoring by a storage system
US11675898B2 (en) * 2019-11-22 2023-06-13 Pure Storage, Inc. Recovery dataset management for security threat monitoring
US11720692B2 (en) 2019-11-22 2023-08-08 Pure Storage, Inc. Hardware token based management of recovery datasets for a storage system
US20210382992A1 (en) * 2019-11-22 2021-12-09 Pure Storage, Inc. Remote Analysis of Potentially Corrupt Data Written to a Storage System
US11645162B2 (en) 2019-11-22 2023-05-09 Pure Storage, Inc. Recovery point determination for data restoration in a storage system
US11720714B2 (en) 2019-11-22 2023-08-08 Pure Storage, Inc. Inter-I/O relationship based detection of a security threat to a storage system
US11615185B2 (en) 2019-11-22 2023-03-28 Pure Storage, Inc. Multi-layer security threat detection for a storage system
US11520907B1 (en) * 2019-11-22 2022-12-06 Pure Storage, Inc. Storage system snapshot retention based on encrypted data
US11500788B2 (en) 2019-11-22 2022-11-15 Pure Storage, Inc. Logical address based authorization of operations with respect to a storage system
US11657155B2 (en) 2019-11-22 2023-05-23 Pure Storage, Inc Snapshot delta metric based determination of a possible ransomware attack against data maintained by a storage system
US11341236B2 (en) 2019-11-22 2022-05-24 Pure Storage, Inc. Traffic-based detection of a security threat to a storage system
US11687418B2 (en) 2019-11-22 2023-06-27 Pure Storage, Inc. Automatic generation of recovery plans specific to individual storage elements
US11755751B2 (en) 2019-11-22 2023-09-12 Pure Storage, Inc. Modify access restrictions in response to a possible attack against data stored by a storage system
US11625481B2 (en) 2019-11-22 2023-04-11 Pure Storage, Inc. Selective throttling of operations potentially related to a security threat to a storage system
CN110991589A (zh) * 2019-12-09 2020-04-10 李蕴光 一种二维码及其加密方法
CN111461279A (zh) * 2020-04-01 2020-07-28 张晓鸿 多功能载体一字码结构及其使用方法
CN112069543B (zh) * 2020-09-15 2021-06-18 广州市微柏软件股份有限公司 一种基于大数据的档案智能分析管理***

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102034127A (zh) * 2009-09-28 2011-04-27 上海易悠通信息科技有限公司 新型大容量二维条码与***及其编解码方法和应用
CN103778453A (zh) * 2014-01-18 2014-05-07 谭洪舟 一种基于容错机制的可写二维条码及其生成方法
CN104376356A (zh) * 2014-12-02 2015-02-25 合肥城市云数据中心有限公司 一种带有加密功能的二维码生成方法
CN107169395A (zh) * 2017-06-20 2017-09-15 重庆大学 一种更加安全的qr码生成及读取方法

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3541731B2 (ja) * 1999-06-18 2004-07-14 株式会社デンソー 偽造判定方法、偽造判定装置及び記録媒体
US7391917B2 (en) * 2003-02-13 2008-06-24 Canon Kabushiki Kaisha Image processing method
JP4181892B2 (ja) * 2003-02-21 2008-11-19 キヤノン株式会社 画像処理方法
JP3796500B2 (ja) * 2003-11-21 2006-07-12 キヤノン株式会社 画像処理装置及びその制御方法、プログラム
JP4510535B2 (ja) * 2004-06-24 2010-07-28 キヤノン株式会社 画像処理装置及びその制御方法、プログラム
CN102118710A (zh) 2011-03-08 2011-07-06 上海红松信息技术有限公司 手机终端之间数据传输***及其传输方法
US9858518B2 (en) * 2013-10-30 2018-01-02 Toppan Tdk Label Co., Ltd. Method for generating two-dimensional barcode, device for generating two-dimensional barcode, method for reading two-dimensional barcode, device for reading two-dimensional barcode, two-dimensional barcode, and program
JP6489464B2 (ja) * 2014-04-14 2019-03-27 株式会社テララコード研究所 光学コード、情報伝達方法、及び認証方法
CN104618334A (zh) 2014-12-29 2015-05-13 通邮(中国)科技有限公司 动态二维码生成验证方法及***
CN106156820B (zh) * 2015-03-25 2019-04-19 北大方正集团有限公司 二维码生成方法及装置
CN106529633B (zh) 2015-09-10 2019-11-15 阿里巴巴集团控股有限公司 二维码的生成方法、解码方法以及装置
CN106651734A (zh) 2015-10-30 2017-05-10 重庆邮电大学 二值二维码图像加密、解密的方法和装置
CN105825257B (zh) * 2016-03-09 2018-05-29 东北大学 基于二维条码的信息隐藏与隐藏信息提取方法及***
CN106296170A (zh) 2016-07-28 2017-01-04 北京小米移动软件有限公司 二维码付款的方法、装置及***
CN108345925A (zh) * 2017-01-24 2018-07-31 北京大码技术有限公司 复合型二维码的生成、识读方法及装置
CN107067056A (zh) * 2017-02-14 2017-08-18 阿里巴巴集团控股有限公司 二维码生成方法及其设备和二维码识别方法及其设备
CN107395581B (zh) * 2017-07-11 2020-11-17 上海众人网络安全技术有限公司 二维码生成及读取方法、装置、***、设备和存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102034127A (zh) * 2009-09-28 2011-04-27 上海易悠通信息科技有限公司 新型大容量二维条码与***及其编解码方法和应用
CN103778453A (zh) * 2014-01-18 2014-05-07 谭洪舟 一种基于容错机制的可写二维条码及其生成方法
CN104376356A (zh) * 2014-12-02 2015-02-25 合肥城市云数据中心有限公司 一种带有加密功能的二维码生成方法
CN107169395A (zh) * 2017-06-20 2017-09-15 重庆大学 一种更加安全的qr码生成及读取方法

Also Published As

Publication number Publication date
CN110119643A (zh) 2019-08-13
US20200364429A1 (en) 2020-11-19
CN110119643B (zh) 2020-11-03
CA3090716A1 (en) 2019-08-15
JP2021513141A (ja) 2021-05-20
US11263416B2 (en) 2022-03-01

Similar Documents

Publication Publication Date Title
WO2019153867A1 (zh) 二维码生成及识别
US8862897B2 (en) Increasing data security in enterprise applications by using formatting, checksums, and encryption to detect tampering of a data buffer
US8689087B2 (en) Method and entity for probabilistic symmetrical encryption
US20180253559A1 (en) Secured lossless data compression using encrypted headers
JP5510590B2 (ja) 伝送システムと方法ならびにプログラム
CN105359155B (zh) 使用压缩破坏口令攻击
KR101852526B1 (ko) 암호 파일을 관리하는 모바일 장치의 방법 및 그것을 포함하는 암호 파일 관리 시스템
Guo et al. Sca-ldpc: A code-based framework for key-recovery side-channel attacks on post-quantum encryption schemes
US10115323B2 (en) Encrypted-data processing method, system, and apparatus
KR101894566B1 (ko) 인증 및 오류 정정이 통합된 부호화가 가능한 데이터 전송 장치 및 방법
CN116664123A (zh) 一种基于区块链技术的数字钱包设计方法
US9203607B2 (en) Keyless challenge and response system
CN110517045B (zh) 区块链数据处理方法、装置、设备和存储介质
CN112613879A (zh) 一种基于grs码的金融交易数据处理方法
CN115935299A (zh) 授权控制方法、装置、计算机设备和存储介质
CN112613054A (zh) 一种基于grs码的电子档案验证方法、装置、电子设备
KR102425916B1 (ko) 가변 길이 퍼지 데이터를 지원하는 격자 기반 퍼지 추출 장치 및 방법
JP6780953B2 (ja) 認証装置、認証方法及び認証プログラム
KR102398962B1 (ko) 격자 기반 퍼지 추출 장치 및 방법
US11816242B2 (en) Log compression and obfuscation using embeddings
Abdul-Jabbar Secure QR-code generation in healthcare
US20230370093A1 (en) Error correcting codes for noisy channels
US11050437B1 (en) Implementation of invertible functions using party logic
CN112633711A (zh) 基于grs码的建筑招标文件加密方法、***及存储介质
CN117009987A (zh) 处理数字型字符串的方法、装置、存储介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18905262

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020540589

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 3090716

Country of ref document: CA

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18905262

Country of ref document: EP

Kind code of ref document: A1