WO2017080190A1 - Two-dimensional code generation and display method and device - Google Patents

Two-dimensional code generation and display method and device Download PDF

Info

Publication number
WO2017080190A1
WO2017080190A1 PCT/CN2016/084357 CN2016084357W WO2017080190A1 WO 2017080190 A1 WO2017080190 A1 WO 2017080190A1 CN 2016084357 W CN2016084357 W CN 2016084357W WO 2017080190 A1 WO2017080190 A1 WO 2017080190A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
dimensional code
display
feature character
dimensional
Prior art date
Application number
PCT/CN2016/084357
Other languages
French (fr)
Chinese (zh)
Inventor
王云华
Original Assignee
深圳Tcl数字技术有限公司
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 深圳Tcl数字技术有限公司 filed Critical 深圳Tcl数字技术有限公司
Publication of WO2017080190A1 publication Critical patent/WO2017080190A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition

Definitions

  • the present invention relates to the field of two-dimensional code technologies, and in particular, to a two-dimensional code generation and display method and apparatus.
  • two-dimensional codes Compared with traditional barcodes, two-dimensional codes have the advantages of large information capacity, low cost and easy production. With the rapid development of information technology, QR codes have developed rapidly. As a medium for information exchange and transmission, the application of two-dimensional codes is becoming more widespread.
  • QR code A links the video website Youtube
  • QR code B links the video website Iqiyi
  • the user needs to obtain the connection of the video website Iqiyi, but because it cannot be used
  • the two-dimensional code A and the two-dimensional code B are distinguished by the naked eye, and the user needs to scan the two-dimensional code displayed on the screen in turn until the connection of the video website Iqiyi is obtained.
  • the two-dimensional code created by the smart TV can not distinguish the different two-dimensional codes before scanning, know the meaning of the two-dimensional code, easily scan the wrong two-dimensional code, or display the repeated scan screen on the user. QR code until you get the page or app you need. The display of the QR code is not clear enough to distinguish, which wastes the user's time and seriously affects the user experience.
  • the main object of the present invention is to provide a two-dimensional code generation and display method and apparatus, aiming at solving the technical problem of low recognition of two-dimensional codes.
  • the present invention provides a two-dimensional code generation display method, and the two-dimensional code generation display method includes the following steps:
  • the generated target two-dimensional code is displayed.
  • the display parameter of the feature character code includes a display size and a gain color of the feature character code
  • the display parameter of the feature character code is obtained according to the preset two-dimensional code display area and the display gray scale.
  • the steps include:
  • the step of acquiring the display size of the feature character code according to the preset two-dimensional code display area comprises:
  • the step of acquiring the gain color of the feature character code according to the preset display gray scale comprises:
  • the preset gray scale value is equally divided into gray scale values to obtain an equally divided gray scale value
  • the data information of the original two-dimensional code includes a positioning pattern position, a version information, a data code, and an error correction code of the original two-dimensional code, and the data information of the original two-dimensional code is obtained, according to the original two-dimensional code.
  • the step of generating the target two-dimensional code by the data information, the feature character code and the display parameter comprises:
  • the present invention further provides a two-dimensional code generation display method, and the two-dimensional code generation display method includes the following steps:
  • the generated target two-dimensional code is displayed.
  • the display parameter of the feature character code includes a display size and a gain color of the feature character code
  • the display parameter of the feature character code is obtained according to the preset two-dimensional code display area and the display gray scale.
  • the steps include:
  • the step of acquiring the display size of the feature character code according to the preset two-dimensional code display area comprises:
  • the step of acquiring the gain color of the feature character code according to the preset display gray scale comprises:
  • the preset gray scale value is equally divided into gray scale values to obtain an equally divided gray scale value
  • the present invention further provides a two-dimensional code generation display device, where the two-dimensional code generation display device includes:
  • a receiving module configured to receive a two-dimensional code display instruction, and acquire a feature character code according to the two-dimensional code display instruction
  • a parameter module configured to acquire a display parameter of the feature character code according to a preset two-dimensional code display area and display gray scale;
  • a creating module configured to acquire data information of the original two-dimensional code, and generate a target two-dimensional code according to the data information of the original two-dimensional code, the characteristic character code, and the display parameter;
  • a display module configured to display the generated target two-dimensional code.
  • the display parameter of the feature character code includes a display size and a gain color of the feature character code
  • the parameter module includes:
  • a size unit configured to obtain a display size of the feature character code according to a preset two-dimensional code display area
  • a gain unit configured to acquire a gain color of the feature character code according to a preset display gray level.
  • the size unit comprises:
  • Obtaining a subunit configured to acquire a horizontal size of the display area of the two-dimensional code according to a preset two-dimensional code display area
  • a multiple subunit configured to acquire a magnification of the feature character code according to a horizontal size of the two-dimensional code display area
  • an enlargement subunit configured to enlarge an initial size of the feature character code according to a magnification of the feature character code to obtain a display size of the feature character code.
  • the gain unit comprises:
  • a random subunit configured to obtain a random grayscale value of the aliquot value
  • a gain subunit configured to obtain a gain color of the feature character code according to the obtained random grayscale value.
  • the data information of the original two-dimensional code includes a positioning pattern position, a version information, a data code, and an error correction code of the original two-dimensional code
  • the creating module includes:
  • An error correction unit configured to acquire data information of the original two-dimensional code, correct the data code according to the error correction code, and obtain the corrected data code
  • An acquiring unit configured to acquire a second error correction code according to the corrected data code
  • a creating unit configured to create a target two according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correcting code, the feature character code, and the display parameter Dimension code
  • a correcting unit configured to correct the created two-dimensional code according to the second error correcting code to generate a target two-dimensional code.
  • the invention provides a two-dimensional code generation display method and device, and the television system obtains a corresponding feature character code by receiving a two-dimensional code display instruction and according to a two-dimensional code display instruction; displaying a region and a display according to the preset two-dimensional code Gray scale, obtain the display parameter of the feature character code; then, obtain the data information of the original two-dimensional code, generate a target two-dimensional code according to the data information of the original two-dimensional code, the feature character code and the display parameter, and generate the target character code identifier Different two-dimensional codes; then the generated target two-dimensional code is displayed according to a preset rule, so that the user can quickly distinguish different two-dimensional codes.
  • the invention enhances the recognition degree of the two-dimensional code, and realizes that the user can know the meaning of the two-dimensional code in advance when scanning the two-dimensional code, distinguish different two-dimensional codes, and improve the user experience.
  • FIG. 1 is a schematic flow chart of a first embodiment of a method for generating a two-dimensional code according to the present invention
  • FIG. 2 is a schematic diagram of a two-dimensional code mask scheme according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of an effect of a target two-dimensional code in an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of functional modules of a first embodiment of a two-dimensional code generation display device according to the present invention.
  • the invention provides a solution for the smart TV to generate a personalized two-dimensional code with a specific identifier based on the original initial two-dimensional code, and display according to a certain arrangement rule, so that the user can pre-scan the two-dimensional code. Know the meaning of the QR code.
  • a first embodiment of a two-dimensional code generation and display method of the present invention provides a two-dimensional code generation and display method, and the two-dimensional code generation display method includes:
  • Step S10 Receive a two-dimensional code display instruction, and acquire a feature character code according to the two-dimensional code display instruction.
  • the invention is mainly applied to a smart TV to create a two-dimensional code, and the user can use the two-dimensional code displayed by the smart television to download and install the application program, quickly link to the application website, obtain program information, and purchase television.
  • the present invention is also applicable to the creation of two-dimensional codes of other smart terminals.
  • the two-dimensional code display instruction may be triggered by the user using the remote controller, or may be triggered by the user voice, or may be triggered by the television system, or may be triggered by the television system according to the program being played, or It is another trigger method, which can be flexibly set according to actual needs.
  • the television system detects the two-dimensional code display instruction, and when the user or the television system triggers the two-dimensional code display instruction, the television system acquires the two-dimensional code display instruction.
  • the two-dimensional code display instruction may have one or multiple at the same time.
  • the two-dimensional code display instruction includes the target two-dimensional code to be generated by the two-dimensional code display instruction, for example, the link QR code of the video website Iqiyi and the link two-dimensional code of the video website Youtubu.
  • the television system reads the name of the target two-dimensional code application according to the two-dimensional code display instruction, and extracts the application package name.
  • the first character code of the application package name is searched according to the preset character code, and the character code is used as the feature character code corresponding to the current two-dimensional code display instruction, that is, the feature character code of the target two-dimensional code.
  • the corresponding feature character codes are sequentially acquired according to the time sequence of acquiring the two-dimensional code display instructions. If the feature character code obtained by the two-dimensional code display instruction has been used, the second character code obtained by comparing the application package name with the character code is obtained as the feature character code corresponding to the current two-dimensional code display instruction.
  • the current plurality of two-dimensional code display instructions all correspond to unique and different feature character codes.
  • Different two-dimensional code display instructions have unique corresponding feature character codes, so that the two-dimensional codes created by different two-dimensional code display instructions have unique and different identifiers.
  • the character code can be a character or a number, and can be flexibly set according to actual needs.
  • the preset character encoding can be ASCII (American Standard Code for Information Interchange, the US standard information exchange code) code, or other standard code, can be flexibly set according to actual needs.
  • ASCII American Standard Code for Information Interchange, the US standard information exchange code
  • the television system stores the acquired feature character code in the first buffer area.
  • the feature character code is separately stored, so that the subsequent acquisition of the feature character code by the television system is convenient and fast, and does not interfere with the cache file access in the subsequent generation process of the two-dimensional code of the television system.
  • the target two-dimensional code of the current two-dimensional code display instruction is exemplified by the link two-dimensional code of the video website Youtubu and the link two-dimensional code of the video website Iqiyi.
  • the television system receives the current two two-dimensional code display instructions.
  • the two-dimensional code display instruction reads the package name of the video website Youtubu application to get Youtubu, and then searches the application package name Youtubu according to the ASCII code.
  • the first character code get Y.
  • the package name of the video website Iqiyi application is obtained to obtain Iqiyi, and then the first character code corresponding to the application package name Iqiyi is searched for the ASCII code to obtain I.
  • AP_PK_Name(x1) YouTubu, the name of the package read by the TV system to the application;
  • AP_PK_Name(x2) Iqiyi, the name of the package read by the TV system to the application;
  • the television system obtains the feature character code Y corresponding to the link QR code display instruction of the video website Youtubu, and the feature character code I corresponding to the link two-dimensional code display instruction of the video website Iqiyi.
  • Step S20 Acquire a display parameter of the feature character code according to a preset two-dimensional code display area and a display gray scale.
  • the television system After obtaining the feature character code of the two-dimensional code display instruction, the television system obtains the display parameter of the feature character code when displaying the feature character code according to the preset two-dimensional code display area and the display gray scale.
  • the television system detects the feature character code in the first storage area.
  • the television system After detecting the feature character code, the television system reads the detected feature character code and stores it in the second buffer area for acquiring the feature character code display parameter and generating the subsequent target two-dimensional code.
  • the division of the first buffer area and the second buffer area by the television system enables data storage and use without interference, thereby improving data processing efficiency.
  • the television system reads the display area of the preset target two-dimensional code to obtain the target two-dimensional code display area size, and obtains the display size of the feature character code according to the preset ratio of the target two-dimensional code display area size.
  • the television system displays the gray scale according to the preset smart TV screen, takes the gray scale value of the gray scale displayed on the smart TV screen, and uses the gray level corresponding to the obtained random gray scale value to gain the initial color of the feature character code, and obtains The gain color of the feature character code.
  • the gain color of the feature character code display is used to highlight the feature character code and distinguish the different two-dimensional codes displayed at the same time. It should be noted that the gray scale of the smart TV screen can be 256 levels or other levels, and can be flexibly set according to actual needs.
  • the television system obtains the display parameters of the feature character code.
  • the display parameter of the feature character code includes a display size and a gain color of the feature character code.
  • Step S30 Obtain data information of the original two-dimensional code, and generate a target two-dimensional code according to the data information of the original two-dimensional code, the feature character code, and the display parameter.
  • the television system After obtaining the display parameter of the feature character code, the television system acquires the original two-dimensional code data information of the current two-dimensional code display instruction, and according to the data information of the original two-dimensional code, the feature character code corresponding to the current two-dimensional code display instruction And the display parameter of the character code, and generate the target two-dimensional code.
  • the television system reads the corresponding original two-dimensional code according to the current two-dimensional code display instruction.
  • the original two-dimensional code is parsed to obtain the data information of the original two-dimensional code.
  • the target two-dimensional code is created according to the data information of the original two-dimensional code, the feature character code, and the display parameters of the feature character code.
  • the display size of the target two-dimensional code can be obtained according to the display size of the feature character code at a preset ratio.
  • the feature character code is located in the filled area of the target two-dimensional code, and is displayed by the corresponding display parameter.
  • the data code of the target two-dimensional code is displayed in the initial color black, and the feature character code is highlighted.
  • the created target two-dimensional code is masked to generate a target two-dimensional code, so that the generated target two-dimensional code is balanced in black and white, and the data reading reliability is enhanced.
  • the target two-dimensional code can have a plurality of preset mask schemes in the embodiment, and the mask processing can be randomly selected from the mask scheme, and the mask processing is performed according to the corresponding mask formula.
  • the television system obtains the generated target two-dimensional code.
  • Step S40 Display the generated target two-dimensional code.
  • the television system displays the generated two-dimensional code according to a preset rule.
  • the television system reads the currently generated two-dimensional code.
  • the currently generated QR code can be one or more.
  • the television system displays the generated two-dimensional code in the preset two-dimensional code display area according to a preset arrangement rule.
  • the preset two-dimensional code arrangement rule may be according to the heat of the two-dimensional code icon as an arrangement order, for example, the higher the number of click generations of the two-dimensional code icon in the preset time, the priority is arranged, and displayed on the left side of the smart TV screen; The higher the number of clicks of the QR code related application, the priority is displayed on the left side of the smart TV screen; the longer the user stays in the QR code related application, the priority is arranged and displayed on the smart TV. The left side of the screen; the preset two-dimensional code of the number of user scans, prioritized, displayed on the left side of the smart TV screen.
  • the preset two-dimensional code arrangement rule may be other arrangement order, and can be flexibly set according to actual needs.
  • the television system displays the generated two-dimensional code for scanning by the user. Since the generated two-dimensional code has the corresponding feature character code for identification when displayed, the user can know the meaning of the two-dimensional code before scanning the two-dimensional code, scan the currently needed two-dimensional code, and obtain the data information.
  • the recognition degree of the two-dimensional code is enhanced, and the user can know the meaning of the two-dimensional code in advance when scanning the two-dimensional code, and distinguish different two-dimensional codes, thereby improving the user experience.
  • the second embodiment of the present invention provides a two-dimensional code generation and display method.
  • the display parameter of the feature character code includes the feature character code.
  • Display size and gain color the step S20 includes:
  • Step S21 Acquire a display size of the feature character code according to a preset two-dimensional code display area.
  • the television system After acquiring the feature character code corresponding to the two-dimensional code display instruction, the television system acquires the display size of the feature character code when the target two-dimensional code is generated.
  • the television system reads the display area of the preset target two-dimensional code to obtain the size of the preset target two-dimensional code display area.
  • the television system acquires the magnification of the feature character code according to the preset ratio according to the size of the target two-dimensional code display area.
  • the television system enlarges the initial size of the feature character code according to the obtained magnification to obtain the display size of the feature character code.
  • Step S22 Acquire a gain color of the feature character code according to a preset display gray scale.
  • the television system After acquiring the feature character code corresponding to the two-dimensional code display instruction, the television system acquires the gain color of the feature character code when the target two-dimensional code is displayed.
  • the television system is pre-configured with a grayscale display of the smart television screen, and the grayscale value is in one-to-one correspondence with different levels of color brightness that the smart television can represent.
  • the television system randomly selects n different grayscale values according to the total number n of the current two-dimensional code display instructions. If any of the randomly obtained grayscale values are the same, reselect them until n different grayscale values are obtained.
  • the initial color of the feature character code corresponding to the two-dimensional code instruction is a preset color, and the gray level corresponding to the grayscale value is filled, and the gain color of each feature character code is obtained.
  • the gain color of the feature character code display is used to highlight the feature character code and distinguish the different two-dimensional codes displayed at the same time.
  • the display size and the gain color of the feature character code are obtained, so that the feature character code can be highlighted, and the recognition degree of the two-dimensional code is enhanced, so that the user can know in advance when scanning the two-dimensional code.
  • the meaning of the QR code identifies different QR codes and enhances the user experience.
  • the third embodiment of the two-dimensional code generation and display method of the present invention provides a second-dimensional code generation and display method, based on the second embodiment of the above-described two-dimensional code generation and display method of the present invention, the step S21 includes:
  • Step S211 Acquire a horizontal size of the two-dimensional code display area according to a preset two-dimensional code display area.
  • the television system obtains the display size of the feature character code when generating the target two-dimensional code, specifically, as an implementation manner, first, the television system acquires the horizontal direction of the target two-dimensional code display area according to the preset target two-dimensional code display area.
  • the display size on the top gives the horizontal size of the target two-dimensional code display area.
  • the horizontal size of the target two-dimensional code display area is the horizontal size of the display area allocated to the target two-dimensional code after the television system performs pre-planning according to the number of target two-dimensional codes and the size of the display area displayed on the screen.
  • the planning of the target two-dimensional code display area in the screen by the television system may be preset, or the number of target two-dimensional codes and the display area that are required to be displayed according to the smart television screen after receiving the two-dimensional code display instruction.
  • the size can be flexibly set according to actual needs.
  • the representation of the size of the target two-dimensional code display area may be in units of pixels.
  • Step S212 Acquire a magnification factor of the feature character code according to a horizontal size of the two-dimensional code display area.
  • the television system After obtaining the horizontal size of the target two-dimensional code display area, the television system acquires the magnification of the corresponding characteristic character code according to the preset ratio according to the size of the target two-dimensional code display area.
  • the television system may obtain a preset scale value of the horizontal size of the target two-dimensional code display area as the feature character code and the size enlargement multiple of the two-dimensional code created by the current two-dimensional code display instruction.
  • the preset ratio value may be one tenth or other values, and may be flexibly set according to actual needs.
  • the television system obtains the magnification of the feature character code.
  • Step S213 Enlarge the initial size of the feature character code according to the magnification of the feature character code to obtain a display size of the feature character code.
  • the television system After obtaining the magnification of the feature character code, the television system can enlarge the initial size of the feature character code display according to the magnification.
  • the original size of the feature character code is a system preset value, for example, a 3 ⁇ 3 pixel matrix.
  • the television system enlarges the horizontal size and the vertical size of the feature character code according to the magnification, and obtains the enlarged size of the feature character code.
  • the feature character code is in the target two-dimensional code filling area, and the television system can use the magnification of the feature character code to enlarge the initial size of the target two-dimensional code, so that the target two-dimensional code and the feature character code The dimensions are kept in sync.
  • the target two-dimensional code of the current two-dimensional code display instruction is the link two-dimensional code of the video website Youtubu and the link two-dimensional code of the video website Iqiyi, and the current target two-dimensional code type is QR (Quick) Response, quick response) Two-dimensional code for illustration.
  • the television system obtains the horizontal size of the display area of the link QR code of the video website Youtubu, which is 40 pixels; then, the television system acquires one tenth of the 40 pixels, and obtains the magnification of the characteristic character code to 4; The television system simultaneously enlarges the horizontal direction and the vertical direction of the initial display size of the feature character code by four times, and obtains the characteristic character code display size of the linked two-dimensional code of the video website Youtubu.
  • the television system obtains the horizontal size of the display area of the link QR code of the video website Iqiyi, which is 20 pixels; then, the television system acquires one tenth of 20 pixels, and obtains a magnification of the characteristic character code of 2; then, the television system
  • the horizontal direction and the vertical direction of the initial display size of the feature character code are simultaneously magnified four times to obtain the feature character code display size of the linked two-dimensional code of the video website Iqiyi.
  • the display size of the feature character code is obtained.
  • the feature character code can be displayed in a suitable ratio, so that the generated two-dimensional code is beautiful, and the user can recognize different two-dimensional codes.
  • the fourth embodiment of the present invention provides a two-dimensional code generation and display method, which is based on the second embodiment or the third embodiment of the present invention.
  • the third embodiment of the invention for generating a two-dimensional code generation method is as an example), and the step S22 includes:
  • Step S221 Perform a grayscale value equalization on the preset display grayscale to obtain an equally divided grayscale value.
  • the television system After acquiring the feature character code corresponding to the two-dimensional code display instruction, the television system acquires the gain color of the feature character code when the target two-dimensional code is displayed.
  • the television system is pre-configured with a grayscale display of the smart TV screen display, and the grayscale display of the smart television screen is represented by grayscale values, and the grayscale value and the color of the different levels of the smart television screen can be expressed.
  • the brightness corresponds one by one.
  • the television system obtains the total number of current two-dimensional code display instructions, and takes the total number of current two-dimensional code display instructions to be n.
  • the obtained grayscale values are equally divided into n in the original arrangement order to obtain n-divided grayscale values.
  • Step S222 Acquire a random grayscale value of each of the grayscale values.
  • the television system randomly selects grayscale values in each of the gradation grayscale values to obtain random grayscale values.
  • the television system reselects the random grayscale values until the obtained random grayscale values are in different equally divided grayscale values.
  • the television system obtains n random grayscale values corresponding to different two-dimensional code display instructions, respectively.
  • Step S223 Obtain a gain color of the feature character code according to the acquired random grayscale value.
  • the random grayscale value is the color gain value of the feature character code.
  • the television system displays the initial color of the characteristic character code corresponding to the instruction by the two-dimensional code, and fills the gray level corresponding to the random grayscale value to obtain the gain color of the characteristic character code when the characteristic character code is displayed.
  • the random grayscale values of each feature character code are in different equal-gradation grayscale values, so that the gain color of the feature character code can be significantly distinguished, and the recognition degree of different two-dimensional codes is enhanced, so that It is easier for users to distinguish between different QR codes.
  • the fifth embodiment of the present invention provides a two-dimensional code generation and display method, which is based on the fourth embodiment of the present invention, and the data information of the original two-dimensional code includes The positioning pattern position, the version information, the data code, and the error correction code of the original two-dimensional code, the step S30 includes:
  • Step S310 Obtain data information of the original two-dimensional code, correct the data code according to the error correction code, and obtain the corrected data code.
  • the television system searches for the original two-dimensional code corresponding to the current two-dimensional code display instruction according to the two-dimensional code display instruction.
  • the television system parses the original two-dimensional code to obtain the data information carried by the original two-dimensional code.
  • the data information carried by the original two-dimensional code may include a positioning pattern position, a version information, a data code, and an error correction code of the original two-dimensional code, and may also include other information, and may be flexibly set according to actual needs.
  • the data information of the original two-dimensional code includes the positioning pattern position, version information, data code and error correction code of the original two-dimensional code, and the television system corrects the obtained Data code.
  • the television system acquires an error correction code and a data code of the original two-dimensional code, and corrects the data code by using an error correction code to avoid errors generated during data transmission.
  • the television system acquires the corrected data code.
  • Step S320 Acquire a second error correction code according to the corrected data code.
  • the television system acquires a second error correcting code for generating a target two-dimensional code according to the currently obtained corrected data code.
  • the television system acquires the character code of the corrected data code according to the preset character encoding.
  • the television system inverts the acquired character code to obtain a second error correction code.
  • the TV system first obtains the ASCII code of the video website data, and then inverts, the character code 0 is reversed to 1, and the 1 is inverted to 0, and the obtained object is inverted.
  • the character code is used as the second error correcting code.
  • Step S330 creating a target two-dimensional code according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correction code, the feature character code, and the display parameter.
  • the television system reads version information of the original two-dimensional code as version information of the target two-dimensional code, and obtains an initial size of the target two-dimensional code according to the version of the target two-dimensional code. Then, using the feature character code to display the magnification of the size, the initial size of the target two-dimensional code is enlarged, and the display size of the target two-dimensional code is obtained, so that the display size of the target two-dimensional code and the feature character code are kept synchronized.
  • the television system reads the position of the positioning pattern of the original two-dimensional code, and locates the data filling area of the target two-dimensional code.
  • the data code, the second error correction code, and the version information of the obtained original two-dimensional code are filled in the filling area, and the feature character code corresponding to the current two-dimensional code display instruction is filled in the filling area according to the corresponding display parameter.
  • Create a target QR code based on the display size of the target QR code.
  • the television system obtains the created target two-dimensional code.
  • the target two-dimensional code of the current two-dimensional code display instruction is a link two-dimensional code of the video website Youtubu and a link two-dimensional code of the video website Iqiyi, and the current target two-dimensional code type is a QR two-dimensional code for illustration.
  • Creat_QR_Rev(x1) Y
  • the television system generates a corresponding two-dimensional code icon according to the display parameters by linking the original two-dimensional code of the two-dimensional code and the characteristic character code Y of the video website Youtube.
  • Creat_QR_Rev(x2) I
  • the television system generates a corresponding two-dimensional code icon according to the display parameter by linking the original two-dimensional code of the two-dimensional code and the feature character code I of the video website Iqiyi.
  • Step S340 Correct the created two-dimensional code according to the second error correction code to generate a target two-dimensional code.
  • the television system After obtaining the created target two-dimensional code, the television system corrects the created target two-dimensional code using the second error correcting code.
  • the television system reads the second error correcting code and the current data code of the target two-dimensional code created this time.
  • the television system inverts the character code of the second error correcting code, and subtracts the character code of the current data code. If the obtained value is 0, the current data transmission is normal; if the obtained value If it is not 0, the second error correction code is used to correct the target two-dimensional code created this time.
  • a preset mask scheme is selected for the created target QR code to perform mask processing to generate a target two-dimensional code.
  • the generated target two-dimensional code includes a characteristic character code, and the feature character code is located in the filling area of the target two-dimensional code, and does not affect the reading of the data when the user scans the target two-dimensional code.
  • the correction of the original two-dimensional code and the target two-dimensional code avoids errors that may occur during data transmission, enhances the accuracy and recognition of the two-dimensional code, and enables the user to scan the two-dimensional code. Knowing the meaning of the two-dimensional code in advance, distinguishing different two-dimensional codes, and improving the user experience.
  • a first embodiment of the two-dimensional code generation display device of the present invention provides a two-dimensional code generation display device, and the two-dimensional code generation display device includes:
  • the receiving module 100 is configured to receive a two-dimensional code display instruction, and acquire a feature character code according to the two-dimensional code display instruction.
  • the invention is mainly applied to a smart TV to create a two-dimensional code, and the user can use the two-dimensional code displayed by the smart television to download and install the application program, quickly link to the application website, obtain program information, and purchase television.
  • the present invention is also applicable to the creation of two-dimensional codes of other smart terminals.
  • the receiving module 100 detects a two-dimensional code display instruction, and when the user or the television system triggers the two-dimensional code display instruction, the receiving module 100 acquires the two-dimensional code display instruction.
  • the two-dimensional code display instruction may have one or multiple at the same time.
  • the two-dimensional code display instruction includes the target two-dimensional code to be generated by the two-dimensional code display instruction, for example, the link QR code of the video website Iqiyi and the link two-dimensional code of the video website Youtubu.
  • the receiving module 100 reads the name of the target two-dimensional code application according to the two-dimensional code display instruction, and extracts the application package name.
  • the first character code of the application package name is searched according to the preset character code, and the character code is used as the feature character code corresponding to the current two-dimensional code display instruction, that is, the feature character code of the target two-dimensional code.
  • the corresponding feature character codes are sequentially acquired according to the time sequence of acquiring the two-dimensional code display instructions. If the feature character code obtained by the two-dimensional code display instruction has been used, the second character code obtained by comparing the application package name with the character code is obtained as the feature character code corresponding to the current two-dimensional code display instruction.
  • the current plurality of two-dimensional code display instructions all correspond to unique and different feature character codes. Different two-dimensional code display instructions have unique corresponding feature character codes, so that the two-dimensional codes created by different two-dimensional code display instructions have unique and different identifiers.
  • the character code can be a character or a number, and can be flexibly set according to actual needs.
  • the preset character encoding can be ASCII (American Standard Code for Information Interchange, the US standard information exchange code) code, can also be other standard codes, which can be flexibly set according to actual needs.
  • ASCII American Standard Code for Information Interchange, the US standard information exchange code
  • the receiving module 100 stores the acquired feature character code in the first buffer area.
  • the feature character code is separately stored, so that the subsequent access feature character code is convenient and fast, and does not interfere with the cache file access in the subsequent generation process of the two-dimensional code.
  • the parameter module 200 is configured to obtain display parameters of the feature character code according to the preset two-dimensional code display area and the display gray scale.
  • the parameter module 200 acquires the display parameter of the feature character code when displaying the feature character code according to the preset two-dimensional code display area and the display gray scale.
  • the parameter module 200 detects the feature character code in the first storage area. After detecting the feature character code, the parameter module 200 reads the detected feature character code and stores it in the second buffer area for acquiring the feature character code display parameter and generating the subsequent target two-dimensional code. The parameter module 200 divides the first buffer area and the second buffer area, so that the storage and use of data do not interfere with each other, thereby improving data processing efficiency. Then, the parameter module 200 reads the display area of the preset target two-dimensional code, obtains the target two-dimensional code display area size, and obtains the display size of the feature character code according to the preset ratio of the target two-dimensional code display area size.
  • the parameter module 200 displays the gray scale according to the preset smart TV screen, takes the gray scale value of the gray scale of the smart TV screen, and uses the gray level corresponding to the obtained random gray scale value to gain the initial color of the feature character code. Get the gain color of the feature character code.
  • the gain color of the feature character code display is used to highlight the feature character code and distinguish the different two-dimensional codes displayed at the same time. It should be noted that the gray scale of the smart TV screen can be 256 levels or other levels, and can be flexibly set according to actual needs.
  • the parameter module 200 obtains the display parameters of the feature character code.
  • the display parameter of the feature character code includes a display size and a gain color of the feature character code.
  • the creating module 300 is configured to acquire data information of the original two-dimensional code, and generate a target two-dimensional code according to the data information of the original two-dimensional code, the feature character code, and the display parameter.
  • the creating module 300 acquires the original two-dimensional code data information of the current two-dimensional code display instruction, and correspondingly according to the data information of the original two-dimensional code and the current two-dimensional code display instruction.
  • the characteristic character code and the display parameter of the feature character code generate a target two-dimensional code.
  • the creating module 300 reads the corresponding original two-dimensional code according to the current two-dimensional code display instruction.
  • the original two-dimensional code is parsed to obtain the data information of the original two-dimensional code.
  • the target two-dimensional code is created according to the data information of the original two-dimensional code, the feature character code, and the display parameters of the feature character code.
  • the display size of the target two-dimensional code can be obtained according to the display size of the feature character code at a preset ratio.
  • the feature character code is located in the filled area of the target two-dimensional code, and is displayed by the corresponding display parameter.
  • the data code of the target two-dimensional code is displayed in the initial color black, and the feature character code is highlighted.
  • the creating module 300 performs mask processing on the created target two-dimensional code to generate a target two-dimensional code, so that the generated target two-dimensional code is balanced in black and white, and the data reading reliability is enhanced.
  • the target two-dimensional code can have a plurality of preset mask schemes in the embodiment, and the mask processing can be randomly selected from the mask scheme, and the mask processing is performed according to the corresponding mask formula.
  • the creation module 300 obtains the generated target two-dimensional code.
  • the display module 400 is configured to display the generated target two-dimensional code.
  • the display module 400 displays the generated two-dimensional code according to a preset rule.
  • the display module 400 reads the currently generated two-dimensional code.
  • the currently generated QR code can be one or more.
  • the display module 400 displays the generated two-dimensional code in the preset two-dimensional code display area according to a preset arrangement rule.
  • the preset two-dimensional code arrangement rule may be according to the heat of the two-dimensional code icon as an arrangement order, for example, the higher the number of click generations of the two-dimensional code icon in the preset time, the priority is arranged, and displayed on the left side of the smart TV screen; The higher the number of clicks of the QR code related application, the priority is displayed on the left side of the smart TV screen; the longer the user stays in the QR code related application, the priority is arranged and displayed on the smart TV.
  • the preset two-dimensional code of the number of user scans prioritized, displayed on the left side of the smart TV screen.
  • the preset two-dimensional code arrangement rule may be other arrangement order, and can be flexibly set according to actual needs.
  • the display module 400 displays the generated two-dimensional code for scanning by the user. Since the generated two-dimensional code has the corresponding feature character code for identification when displayed, the user can know the meaning of the two-dimensional code before scanning the two-dimensional code, scan the currently needed two-dimensional code, and obtain the data information.
  • the recognition degree of the two-dimensional code is enhanced, and the user can know the meaning of the two-dimensional code in advance when scanning the two-dimensional code, and distinguish different two-dimensional codes, thereby improving the user experience.
  • the second embodiment of the two-dimensional code generation display device of the present invention provides a two-dimensional code generation display device.
  • the display parameters of the feature character code include The display size and gain color of the feature character code
  • the parameter module 200 includes:
  • a size unit configured to acquire a display size of the feature character code according to the preset two-dimensional code display area.
  • the size unit After acquiring the feature character code corresponding to the two-dimensional code display instruction, the size unit acquires the display size of the feature character code when the target two-dimensional code is generated.
  • the size unit reads the display area of the preset target two-dimensional code to obtain the size of the preset target two-dimensional code display area. Then, the size unit acquires the magnification of the feature character code according to the preset ratio according to the size of the target two-dimensional code display area. Then, the size unit enlarges the initial size of the feature character code according to the obtained magnification to obtain the display size of the feature character code.
  • a gain unit configured to acquire a gain color of the feature character code according to a preset display gray level.
  • the gain unit After acquiring the feature character code corresponding to the two-dimensional code display instruction, the gain unit acquires the gain color of the feature character code when the target two-dimensional code is displayed. Specifically, as an implementation manner, the gain unit is pre-configured with a grayscale display of the smart TV screen, and the grayscale value is in one-to-one correspondence with different levels of color brightness that the smart television can represent.
  • the total number of current two-dimensional code display instructions is n
  • the gain unit randomly selects n different grayscale values according to the total number n of the current two-dimensional code display instructions. If any of the randomly obtained grayscale values are the same, reselect them until n different grayscale values are obtained.
  • the gain unit obtains the gray scale value corresponding to each two-dimensional code display instruction.
  • the initial color of the characteristic character code corresponding to the two-dimensional code instruction is a preset color, and the gain unit fills the gray level corresponding to the grayscale value, and obtains the gain color when each character code is displayed.
  • the gain color of the feature character code display is used to highlight the feature character code and distinguish the different two-dimensional codes displayed at the same time.
  • the display size and the gain color of the feature character code are obtained, so that the feature character code can be highlighted, and the recognition degree of the two-dimensional code is enhanced, so that the user can know in advance when scanning the two-dimensional code.
  • the meaning of the QR code identifies different QR codes and enhances the user experience.
  • the third embodiment of the two-dimensional code generation display device of the present invention provides a two-dimensional code generation display device, which is based on the second embodiment of the present invention.
  • Obtaining a subunit configured to acquire a horizontal size of the two-dimensional code display area according to a preset two-dimensional code display area.
  • the acquiring sub-unit obtains the horizontal direction of the target two-dimensional code display area according to the preset target two-dimensional code display area.
  • the display size on the top gives the horizontal size of the target two-dimensional code display area.
  • the horizontal size of the target two-dimensional code display area is the horizontal size of the display area allocated to the target two-dimensional code after the acquisition sub-unit performs pre-planning according to the number of target two-dimensional codes required to be displayed on the screen and the size of the display area.
  • the planning of the target two-dimensional code display area in the screen may be preset, or may be planned according to the number of target two-dimensional codes and the size of the display area that are required to be displayed on the smart television screen after receiving the two-dimensional code display instruction. The obtained can be flexibly set according to actual needs.
  • the representation of the size of the target two-dimensional code display area may be in units of pixels.
  • a multiple subunit configured to acquire a magnification of the feature character code according to a horizontal size of the two-dimensional code display area.
  • the multiple subunit After acquiring the horizontal size of the target two-dimensional code display area, the multiple subunit acquires the magnification of the corresponding characteristic character code according to the preset ratio according to the size of the target two-dimensional code display area. Specifically, as an implementation manner, the multiple subunits may obtain a preset scale value of the horizontal size of the target two-dimensional code display area, as the feature character code and the size magnification of the two-dimensional code created by the current two-dimensional code display instruction. .
  • the preset ratio value may be one tenth or other values, and may be flexibly set according to actual needs. Thus, the multiple subunits obtain the magnification of the feature character code.
  • an enlargement subunit configured to enlarge an initial size of the feature character code according to a magnification of the feature character code to obtain a display size of the feature character code.
  • the enlargement subunit may enlarge the initial size of the feature character code display according to the magnification.
  • the original size of the feature character code is a system preset value, for example, a 3 ⁇ 3 pixel matrix.
  • the magnifying subunit enlarges the horizontal size and the vertical size of the feature character code according to the magnification, and obtains the enlarged size of the feature character code.
  • the feature character code is in the target two-dimensional code filling area, and the magnifying sub-unit can use the magnification of the feature character code to enlarge the initial size of the target two-dimensional code, so that the target two-dimensional code and the characteristic character The size of the code remains synchronized.
  • the display size of the feature character code is obtained.
  • the feature character code can be displayed in a suitable ratio, so that the generated two-dimensional code is beautiful, and the user can recognize different two-dimensional codes.
  • a fourth embodiment of the two-dimensional code generation display device of the present invention provides a two-dimensional code generation display device, which is based on the second embodiment or the third embodiment of the above-described two-dimensional code generation display device of the present invention.
  • the gain unit includes:
  • the equal molecular unit is used to divide the preset display gray scale into gray scale values to obtain an equally divided gray scale value.
  • the gain unit After acquiring the feature character code corresponding to the two-dimensional code display instruction, the gain unit acquires the gain color of the feature character code when the target two-dimensional code is displayed.
  • the molecular unit is pre-set with a gray scale of the display of the smart TV screen, and the gray scale of the display of the smart TV screen is represented by a gray scale value, and the gray scale value and the different levels of the smart television screen can be expressed.
  • the color brightness corresponds to each other.
  • the equal molecular unit obtains the total number of current two-dimensional code display instructions, and the total number of current two-dimensional code display instructions is n. Then, the obtained grayscale values are equally divided into n in the original arrangement order to obtain n-divided grayscale values.
  • a random subunit configured to obtain a random grayscale value of the aliquot value.
  • the random subunit After averaging the grayscale values, the random subunit randomly selects grayscale values in each of the gradation grayscale values to obtain random grayscale values. If any two random grayscale values obtained are in the same equal grayscale value, the random subunit reselects the random grayscale value until the obtained random grayscale value is in different equally divided grayscale values. Thus, the random subunit obtains n random grayscale values respectively corresponding to different two-dimensional code display instructions.
  • a gain subunit configured to obtain a gain color of the feature character code according to the obtained random grayscale value.
  • the random grayscale value is the color gain value of the feature character code.
  • the gain subunit displays the initial color of the characteristic character code corresponding to the instruction in the two-dimensional code, and fills the gray level corresponding to the random grayscale value to obtain the gain color of the characteristic character code when the characteristic character code is displayed.
  • the random grayscale values of each feature character code are in different equal-gradation grayscale values, so that the gain color of the feature character code can be significantly distinguished, and the recognition degree of different two-dimensional codes is enhanced, so that It is easier for users to distinguish between different QR codes.
  • the fifth embodiment of the two-dimensional code generation display device of the present invention provides a two-dimensional code generation display device.
  • the data information of the original two-dimensional code includes The positioning pattern position, the version information, the data code, and the error correction code of the original two-dimensional code
  • the creating module 300 includes:
  • an error correction unit configured to acquire data information of the original two-dimensional code, correct the data code according to the error correction code, and obtain the corrected data code.
  • the error correction unit searches for the original two-dimensional code corresponding to the current two-dimensional code display instruction according to the two-dimensional code display instruction. After obtaining the original two-dimensional code, the error correction unit parses the original two-dimensional code to obtain the data information carried by the original two-dimensional code.
  • the data information carried by the original two-dimensional code may include a positioning pattern position, a version information, a data code, and an error correction code of the original two-dimensional code, and may also include other information, and may be flexibly set according to actual needs.
  • the data information of the original two-dimensional code includes the positioning pattern position, version information, data code and error correction code of the original two-dimensional code, and is corrected by the television system.
  • Data code the error correction unit acquires an error correction code and a data code of the original two-dimensional code, and corrects the data code by using an error correction code to avoid an error generated during data transmission. Thereby, the error correction unit acquires the corrected data code.
  • an acquiring unit configured to acquire a second error correction code according to the corrected data code.
  • the obtaining unit acquires a second error correcting code according to the currently obtained corrected data code, and is used to generate a target two-dimensional code. Specifically, as an implementation manner, first, the acquiring unit compares the preset character encoding to obtain the character code of the corrected data code. Then, the obtaining unit inverts the obtained character code to obtain a second error correcting code.
  • a creating unit configured to create a target two according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correcting code, the feature character code, and the display parameter Dimension code.
  • the creating unit reads version information of the original two-dimensional code as version information of the target two-dimensional code, and obtains an initial size of the target two-dimensional code according to the version of the target two-dimensional code. Then, using the feature character code to display the magnification of the size, the initial size of the target two-dimensional code is enlarged, and the display size of the target two-dimensional code is obtained, so that the display size of the target two-dimensional code and the feature character code are kept synchronized. Then, the creating unit reads the positioning pattern position of the original two-dimensional code, and locates the data filling area of the target two-dimensional code.
  • the data code, the second error correction code, and the version information of the obtained original two-dimensional code are filled in the filling area, and the feature character code corresponding to the current two-dimensional code display instruction is filled in the filling area according to the corresponding display parameter.
  • the creation unit obtains the created target two-dimensional code.
  • a correcting unit configured to correct the created two-dimensional code according to the second error correcting code to generate a target two-dimensional code.
  • the correcting unit reads the second error correcting code, and creates a current data code of the target two-dimensional code created by the unit. Then, in contrast to the preset character encoding, the correcting unit inverts the character code of the second error correcting code, and subtracts the character code of the current data code. If the obtained value is 0, the current data transmission is normal; if obtained If the value is not 0, the second error correction code is used to correct the target two-dimensional code created this time. Then, a preset mask scheme is selected for the created target QR code to perform mask processing to generate a target two-dimensional code. The generated target two-dimensional code includes a characteristic character code, and the feature character code is located in the filling area of the target two-dimensional code, and does not affect the reading of the data when the user scans the target two-dimensional code.
  • the correction of the original two-dimensional code and the target two-dimensional code avoids errors that may occur during data transmission, enhances the accuracy and recognition of the two-dimensional code, and enables the user to scan the two-dimensional code. Knowing the meaning of the two-dimensional code in advance, distinguishing different two-dimensional codes, and improving the user experience.

Abstract

A two-dimensional code generation and display method. The method comprises: receiving a two-dimensional code display instruction, and acquiring a characteristic character code according to the two-dimensional code display instruction (S10); acquiring a display parameter of the characteristic character code according to a preset two-dimensional code display region and a display gray scale (S20); acquiring data information of an original two-dimensional code, and generating a target two-dimensional code according to the data information of the original two-dimensional code, the characteristic character code and the display parameter (S30); and displaying the generated target two-dimensional code (S40). Also disclosed is a two-dimensional code generation and display device. By means of the method and the device, the identification degree of two-dimensional codes is enhanced; when a user scans two-dimensional codes, the user can acquire meanings of the two-dimensional codes in advance and identify different two-dimensional codes, thereby improving user experience.

Description

二维码生成显示方法和装置  Two-dimensional code generation display method and device
技术领域Technical field
本发明涉及二维码技术领域,尤其涉及一种二维码生成显示方法和装置。The present invention relates to the field of two-dimensional code technologies, and in particular, to a two-dimensional code generation and display method and apparatus.
背景技术Background technique
二维码相较传统条形码具有信息容量大、成本低和易制作等优点,随着信息技术的快速发展,二维码得到了快速发展。作为信息交换、传递的介质,二维码的应用也愈加广泛。Compared with traditional barcodes, two-dimensional codes have the advantages of large information capacity, low cost and easy production. With the rapid development of information technology, QR codes have developed rapidly. As a medium for information exchange and transmission, the application of two-dimensional codes is becoming more widespread.
智能电视上二维码的出现,更是给人们的生活带来了巨大的便利。用户只需要扫一扫智能电视上的二维码,就可以下载智能电视的应用程序、快速链接到应用网址和电视购物等,操作简单快捷。The emergence of two-dimensional codes on smart TVs has brought great convenience to people's lives. Users only need to scan the QR code on the smart TV, you can download the smart TV application, quickly link to the application website and TV shopping, etc., the operation is simple and fast.
然而,由于二维码是使用一些0、1的黑白像素图案生成的一堆看似杂乱的黑白,因此导致智能电视创建的二维码图标比较单调,用户无法通过视觉分辨不同应用的二维码。当智能电视生成、显示多个二维码时,例如:二维码A链接视频网站Youtube,二维码B链接视频网站Iqiyi,此时,若用户需要获取视频网站Iqiyi的连接,但是由于无法用肉眼区分二维码A和二维码B,用户需要依次扫描屏幕上显示的二维码,直至获取到视频网站Iqiyi的连接。However, since the two-dimensional code is a pile of seemingly messy black and white generated by using some 0 and 1 black and white pixel patterns, the two-dimensional code icons created by the smart TV are relatively monotonous, and the user cannot visually distinguish the two-dimensional codes of different applications. . When the smart TV generates and displays multiple QR codes, for example: QR code A links the video website Youtube, QR code B links the video website Iqiyi, at this time, if the user needs to obtain the connection of the video website Iqiyi, but because it cannot be used The two-dimensional code A and the two-dimensional code B are distinguished by the naked eye, and the user needs to scan the two-dimensional code displayed on the screen in turn until the connection of the video website Iqiyi is obtained.
智能电视创建的二维码由于低辨识度,导致用户无法在扫描前判别不同的二维码,获知二维码的含义,容易扫描到错误的二维码,或者需要用户重复的扫描屏幕上显示的二维码,直至获取需要的网页或应用。二维码的显示不够清楚易分辨,浪费了用户的时间,严重影响用户体验。Due to the low recognition degree, the two-dimensional code created by the smart TV can not distinguish the different two-dimensional codes before scanning, know the meaning of the two-dimensional code, easily scan the wrong two-dimensional code, or display the repeated scan screen on the user. QR code until you get the page or app you need. The display of the QR code is not clear enough to distinguish, which wastes the user's time and seriously affects the user experience.
发明内容Summary of the invention
本发明的主要目的在于提供一种二维码生成显示方法和装置,旨在解决二维码辨识度低的技术问题。The main object of the present invention is to provide a two-dimensional code generation and display method and apparatus, aiming at solving the technical problem of low recognition of two-dimensional codes.
为实现上述目的,本发明提供一种二维码生成显示方法,所述二维码生成显示方法包括以下步骤:To achieve the above object, the present invention provides a two-dimensional code generation display method, and the two-dimensional code generation display method includes the following steps:
接收二维码显示指令,并根据所述二维码显示指令获取特征字符码;Receiving a two-dimensional code display instruction, and acquiring a feature character code according to the two-dimensional code display instruction;
根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数;Obtaining a display parameter of the feature character code according to a preset two-dimensional code display area and a display gray scale;
获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码;Obtaining data information of the original two-dimensional code, and generating a target two-dimensional code according to the data information of the original two-dimensional code, the feature character code, and the display parameter;
显示所述生成的目标二维码。The generated target two-dimensional code is displayed.
优选的,所述特征字符码的显示参数包括所述特征字符码的显示尺寸和增益颜色,所述根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数的步骤包括:Preferably, the display parameter of the feature character code includes a display size and a gain color of the feature character code, and the display parameter of the feature character code is obtained according to the preset two-dimensional code display area and the display gray scale. The steps include:
根据预设的二维码显示区域,获取所述特征字符码的显示尺寸;Obtaining a display size of the feature character code according to a preset two-dimensional code display area;
根据预设的显示灰阶,获取所述特征字符码的增益颜色。Obtaining a gain color of the feature character code according to a preset display gray scale.
优选的,所述根据预设的二维码显示区域,获取所述特征字符码的显示尺寸的步骤包括:Preferably, the step of acquiring the display size of the feature character code according to the preset two-dimensional code display area comprises:
根据预设的二维码显示区域,获取所述二维码显示区域的水平尺寸;Obtaining a horizontal size of the display area of the two-dimensional code according to a preset two-dimensional code display area;
根据所述二维码显示区域的水平尺寸,获取所述特征字符码的放大倍数;Obtaining a magnification of the feature character code according to a horizontal size of the two-dimensional code display area;
根据所述特征字符码的放大倍数放大所述特征字符码的初始尺寸,得到所述特征字符码的显示尺寸。Enlarging an initial size of the feature character code according to a magnification of the feature character code to obtain a display size of the feature character code.
优选的,所述根据预设的显示灰阶,获取所述特征字符码的增益颜色的步骤包括:Preferably, the step of acquiring the gain color of the feature character code according to the preset display gray scale comprises:
将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值;The preset gray scale value is equally divided into gray scale values to obtain an equally divided gray scale value;
获取所述每等分灰阶值的随机灰阶值;Obtaining a random grayscale value of the aliquot value;
根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。Obtaining a gain color of the feature character code according to the obtained random grayscale value.
优选的,所述原始二维码的数据信息包括原始二维码的定位图案位置、版本信息、数据码和纠错码,所述获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码的步骤包括:Preferably, the data information of the original two-dimensional code includes a positioning pattern position, a version information, a data code, and an error correction code of the original two-dimensional code, and the data information of the original two-dimensional code is obtained, according to the original two-dimensional code. The step of generating the target two-dimensional code by the data information, the feature character code and the display parameter comprises:
获取原始二维码的数据信息,根据所述纠错码校正所述数据码,获取校正后的数据码;Obtaining data information of the original two-dimensional code, correcting the data code according to the error correction code, and acquiring the corrected data code;
根据所述校正后的数据码,获取第二纠错码;Obtaining a second error correction code according to the corrected data code;
根据所述原始二维码的定位图案位置和版本信息、所述校正后的数据码、所述第二纠错码、所述特征字符码和所述显示参数,创建目标二维码;And creating a target two-dimensional code according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correction code, the feature character code, and the display parameter;
根据所述第二纠错码,校正所述创建的二维码,生成目标二维码。And correcting the created two-dimensional code according to the second error correction code to generate a target two-dimensional code.
此外,为实现上述目的,本发明还提供一种二维码生成显示方法,所述二维码生成显示方法包括以下步骤:In addition, in order to achieve the above object, the present invention further provides a two-dimensional code generation display method, and the two-dimensional code generation display method includes the following steps:
接收二维码显示指令,并根据所述二维码显示指令,读取目标二维码应用的名称,提取所述应用的包名;Receiving a two-dimensional code display instruction, and reading a name of the target two-dimensional code application according to the two-dimensional code display instruction, and extracting a package name of the application;
对照预设的字符编码,查找所述应用包名的第一个字符码,将此字符码作为所述二维码显示指令对应的特征字符码;Searching for the first character code of the application package name against the preset character code, and using the character code as the feature character code corresponding to the two-dimensional code display instruction;
根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数;Obtaining a display parameter of the feature character code according to a preset two-dimensional code display area and a display gray scale;
获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码;Obtaining data information of the original two-dimensional code, and generating a target two-dimensional code according to the data information of the original two-dimensional code, the feature character code, and the display parameter;
显示所述生成的目标二维码。The generated target two-dimensional code is displayed.
优选的,所述特征字符码的显示参数包括所述特征字符码的显示尺寸和增益颜色,所述根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数的步骤包括:Preferably, the display parameter of the feature character code includes a display size and a gain color of the feature character code, and the display parameter of the feature character code is obtained according to the preset two-dimensional code display area and the display gray scale. The steps include:
根据预设的二维码显示区域,获取所述特征字符码的显示尺寸;Obtaining a display size of the feature character code according to a preset two-dimensional code display area;
根据预设的显示灰阶,获取所述特征字符码的增益颜色。Obtaining a gain color of the feature character code according to a preset display gray scale.
优选的,所述根据预设的二维码显示区域,获取所述特征字符码的显示尺寸的步骤包括:Preferably, the step of acquiring the display size of the feature character code according to the preset two-dimensional code display area comprises:
根据预设的二维码显示区域,获取所述二维码显示区域的水平尺寸;Obtaining a horizontal size of the display area of the two-dimensional code according to a preset two-dimensional code display area;
根据所述二维码显示区域的水平尺寸,获取所述特征字符码的放大倍数;Obtaining a magnification of the feature character code according to a horizontal size of the two-dimensional code display area;
根据所述特征字符码的放大倍数放大所述特征字符码的初始尺寸,得到所述特征字符码的显示尺寸。Enlarging an initial size of the feature character code according to a magnification of the feature character code to obtain a display size of the feature character code.
优选的,所述根据预设的显示灰阶,获取所述特征字符码的增益颜色的步骤包括:Preferably, the step of acquiring the gain color of the feature character code according to the preset display gray scale comprises:
将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值;The preset gray scale value is equally divided into gray scale values to obtain an equally divided gray scale value;
获取所述每等分灰阶值的随机灰阶值;Obtaining a random grayscale value of the aliquot value;
根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。Obtaining a gain color of the feature character code according to the obtained random grayscale value.
此外,为实现上述目的,本发明还提供一种二维码生成显示装置,所述二维码生成显示装置包括:In addition, in order to achieve the above object, the present invention further provides a two-dimensional code generation display device, where the two-dimensional code generation display device includes:
接收模块,用于接收二维码显示指令,并根据所述二维码显示指令获取特征字符码;a receiving module, configured to receive a two-dimensional code display instruction, and acquire a feature character code according to the two-dimensional code display instruction;
参数模块,用于根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数;a parameter module, configured to acquire a display parameter of the feature character code according to a preset two-dimensional code display area and display gray scale;
创建模块,用于获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码;a creating module, configured to acquire data information of the original two-dimensional code, and generate a target two-dimensional code according to the data information of the original two-dimensional code, the characteristic character code, and the display parameter;
显示模块,用于显示所述生成的目标二维码。a display module, configured to display the generated target two-dimensional code.
优选的,所述特征字符码的显示参数包括所述特征字符码的显示尺寸和增益颜色,所述参数模块包括:Preferably, the display parameter of the feature character code includes a display size and a gain color of the feature character code, and the parameter module includes:
尺寸单元,用于根据预设的二维码显示区域,获取所述特征字符码的显示尺寸;a size unit, configured to obtain a display size of the feature character code according to a preset two-dimensional code display area;
增益单元,用于根据预设的显示灰阶,获取所述特征字符码的增益颜色。And a gain unit, configured to acquire a gain color of the feature character code according to a preset display gray level.
优选的,所述尺寸单元包括:Preferably, the size unit comprises:
获取子单元,用于根据预设的二维码显示区域,获取所述二维码显示区域的水平尺寸;Obtaining a subunit, configured to acquire a horizontal size of the display area of the two-dimensional code according to a preset two-dimensional code display area;
倍数子单元,用于根据所述二维码显示区域的水平尺寸,获取所述特征字符码的放大倍数;a multiple subunit, configured to acquire a magnification of the feature character code according to a horizontal size of the two-dimensional code display area;
放大子单元,用于根据所述特征字符码的放大倍数放大所述特征字符码的初始尺寸,得到所述特征字符码的显示尺寸。And an enlargement subunit, configured to enlarge an initial size of the feature character code according to a magnification of the feature character code to obtain a display size of the feature character code.
优选的,所述增益单元包括:Preferably, the gain unit comprises:
等分子单元,用于将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值;An equal molecular unit for dividing a preset gray scale value by a gray scale value to obtain an equally divided gray scale value;
随机子单元,用于获取所述每等分灰阶值的随机灰阶值;a random subunit, configured to obtain a random grayscale value of the aliquot value;
增益子单元,用于根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。And a gain subunit, configured to obtain a gain color of the feature character code according to the obtained random grayscale value.
优选的,所述原始二维码的数据信息包括原始二维码的定位图案位置、版本信息、数据码和纠错码,所述创建模块包括:Preferably, the data information of the original two-dimensional code includes a positioning pattern position, a version information, a data code, and an error correction code of the original two-dimensional code, and the creating module includes:
纠错单元,用于获取原始二维码的数据信息,根据所述纠错码校正所述数据码,获取校正后的数据码;An error correction unit, configured to acquire data information of the original two-dimensional code, correct the data code according to the error correction code, and obtain the corrected data code;
获取单元,用于根据所述校正后的数据码,获取第二纠错码;An acquiring unit, configured to acquire a second error correction code according to the corrected data code;
创建单元,用于根据所述原始二维码的定位图案位置和版本信息、所述校正后的数据码、所述第二纠错码、所述特征字符码和所述显示参数,创建目标二维码;a creating unit, configured to create a target two according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correcting code, the feature character code, and the display parameter Dimension code
校正单元,用于根据所述第二纠错码,校正所述创建的二维码,生成目标二维码。And a correcting unit, configured to correct the created two-dimensional code according to the second error correcting code to generate a target two-dimensional code.
本发明提出的一种二维码生成显示方法和装置,电视系统通过接收二维码显示指令,并根据二维码显示指令获取对应的特征字符码;根据预设的二维码显示区域和显示灰阶,获取特征字符码的显示参数;然后,获取原始二维码的数据信息,根据原始二维码的数据信息、特征字符码和显示参数生成目标二维码,由特征字符码标识生成的不同二维码;然后按预设的规则显示生成的目标二维码,使用户能够迅速的分辨不同二维码。本发明增强了二维码的辨识度,实现了用户在扫描二维码时能够预先获知二维码的含义,辨别不同的二维码,提升了用户体验。The invention provides a two-dimensional code generation display method and device, and the television system obtains a corresponding feature character code by receiving a two-dimensional code display instruction and according to a two-dimensional code display instruction; displaying a region and a display according to the preset two-dimensional code Gray scale, obtain the display parameter of the feature character code; then, obtain the data information of the original two-dimensional code, generate a target two-dimensional code according to the data information of the original two-dimensional code, the feature character code and the display parameter, and generate the target character code identifier Different two-dimensional codes; then the generated target two-dimensional code is displayed according to a preset rule, so that the user can quickly distinguish different two-dimensional codes. The invention enhances the recognition degree of the two-dimensional code, and realizes that the user can know the meaning of the two-dimensional code in advance when scanning the two-dimensional code, distinguish different two-dimensional codes, and improve the user experience.
附图说明DRAWINGS
图1为本发明二维码生成显示方法第一实施例的流程示意图;1 is a schematic flow chart of a first embodiment of a method for generating a two-dimensional code according to the present invention;
图2为本发明实施例中二维码掩膜方案示意图;2 is a schematic diagram of a two-dimensional code mask scheme according to an embodiment of the present invention;
图3为本发明实施例中目标二维码效果示意图;3 is a schematic diagram of an effect of a target two-dimensional code in an embodiment of the present invention;
图4为本发明二维码生成显示装置第一实施例的功能模块示意图。4 is a schematic diagram of functional modules of a first embodiment of a two-dimensional code generation display device according to the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
由于现有技术智能电视生成的二维码辨识度低,用户无法在扫描前判别不同的二维码,获知二维码的含义,容易扫描到错误的二维码,或者需要用户重复的扫描智能电视屏幕上显示的二维码,直至获取需要的网页或应用。浪费了用户的时间,严重影响用户体验。Since the recognition of the two-dimensional code generated by the prior art smart television is low, the user cannot discriminate different two-dimensional codes before scanning, know the meaning of the two-dimensional code, easily scan the wrong two-dimensional code, or need the user to repeat the scanning intelligence. The QR code displayed on the TV screen until you get the web page or application you need. It wastes the user's time and seriously affects the user experience.
本发明提供一种解决方案,使智能电视基于原有的初始二维码,生成个性化的有特定标识的二维码,并按照一定的排列规则显示,使用户在扫描二维码时能够预先获知二维码的含义。The invention provides a solution for the smart TV to generate a personalized two-dimensional code with a specific identifier based on the original initial two-dimensional code, and display according to a certain arrangement rule, so that the user can pre-scan the two-dimensional code. Know the meaning of the QR code.
参照图1,本发明二维码生成显示方法第一实施例提供一种二维码生成显示方法,所述二维码生成显示方法包括:Referring to FIG. 1, a first embodiment of a two-dimensional code generation and display method of the present invention provides a two-dimensional code generation and display method, and the two-dimensional code generation display method includes:
步骤S10、接收二维码显示指令,并根据所述二维码显示指令获取特征字符码。Step S10: Receive a two-dimensional code display instruction, and acquire a feature character code according to the two-dimensional code display instruction.
本发明主要应用于智能电视创建二维码,用户可使用智能电视显示的二维码进行应用程序的下载安装、快速链接到应用网址、获取节目信息和电视购物等操作。当然,本发明也可应用于其他智能终端二维码的创建。The invention is mainly applied to a smart TV to create a two-dimensional code, and the user can use the two-dimensional code displayed by the smart television to download and install the application program, quickly link to the application website, obtain program information, and purchase television. Of course, the present invention is also applicable to the creation of two-dimensional codes of other smart terminals.
本发明实施例中,二维码显示指令可以是由用户使用遥控器触发,也可以是用户语音触发,也可以是电视系统定时触发,也可以是电视系统预设根据播放的节目触发,也可以是其他触发方式,可根据实际需要灵活设定。In the embodiment of the present invention, the two-dimensional code display instruction may be triggered by the user using the remote controller, or may be triggered by the user voice, or may be triggered by the television system, or may be triggered by the television system according to the program being played, or It is another trigger method, which can be flexibly set according to actual needs.
具体的,作为一种实施方式,首先,电视系统侦测二维码显示指令,当用户或电视系统触发二维码显示指令后,电视系统获取二维码显示指令。Specifically, as an implementation manner, first, the television system detects the two-dimensional code display instruction, and when the user or the television system triggers the two-dimensional code display instruction, the television system acquires the two-dimensional code display instruction.
其中,二维码显示指令可以有一个,也可以同时有多个。二维码显示指令包含了本次二维码显示指令所要生成的目标二维码,例如:视频网站Iqiyi的链接二维码、视频网站Youtubu的链接二维码。Among them, the two-dimensional code display instruction may have one or multiple at the same time. The two-dimensional code display instruction includes the target two-dimensional code to be generated by the two-dimensional code display instruction, for example, the link QR code of the video website Iqiyi and the link two-dimensional code of the video website Youtubu.
然后,电视系统根据二维码显示指令,读取目标二维码应用的名称,提取应用的包名。对照预设的字符编码,查找应用包名的第一个字符码,将此字符码作为本次二维码显示指令对应的特征字符码,也即本次目标二维码的特征字符码。Then, the television system reads the name of the target two-dimensional code application according to the two-dimensional code display instruction, and extracts the application package name. The first character code of the application package name is searched according to the preset character code, and the character code is used as the feature character code corresponding to the current two-dimensional code display instruction, that is, the feature character code of the target two-dimensional code.
若当前有多个二维码显示指令,则根据获取二维码显示指令的时间顺序,依次获取对应的特征字符码。若本次二维码显示指令获取的特征字符码已被使用,则获取应用包名对照字符编码得到的第二个字符码,作为本次二维码显示指令对应的特征字符码。以此类推,使当前的多个二维码显示指令均对应有唯一且不同的特征字符码。If there are multiple two-dimensional code display instructions, the corresponding feature character codes are sequentially acquired according to the time sequence of acquiring the two-dimensional code display instructions. If the feature character code obtained by the two-dimensional code display instruction has been used, the second character code obtained by comparing the application package name with the character code is obtained as the feature character code corresponding to the current two-dimensional code display instruction. By analogy, the current plurality of two-dimensional code display instructions all correspond to unique and different feature character codes.
不同的二维码显示指令有唯一对应的特征字符码,从而使不同的二维码显示指令所创建的二维码具有唯一且不同的标识。其中,特征字符码可以是字符,也可以是数字,可根据实际需要灵活设定。Different two-dimensional code display instructions have unique corresponding feature character codes, so that the two-dimensional codes created by different two-dimensional code display instructions have unique and different identifiers. The character code can be a character or a number, and can be flexibly set according to actual needs.
需要说明的是,预设的字符编码可以是ASCII(American Standard Code for Information Interchange,美国标准信息交换代码)码,也可以是其他标准码,可根据实际需要灵活设置。It should be noted that the preset character encoding can be ASCII (American Standard Code for Information Interchange, the US standard information exchange code) code, or other standard code, can be flexibly set according to actual needs.
然后,电视系统将获取的特征字符码存储在第一缓存区。单独存储特征字符码,使电视系统后续取用特征字符码方便快捷,不干扰电视系统后续二维码生成过程中的缓存文件存取。Then, the television system stores the acquired feature character code in the first buffer area. The feature character code is separately stored, so that the subsequent acquisition of the feature character code by the television system is convenient and fast, and does not interfere with the cache file access in the subsequent generation process of the two-dimensional code of the television system.
以当前二维码显示指令的目标二维码依次为视频网站Youtubu的链接二维码和视频网站Iqiyi的链接二维码进行举例说明。The target two-dimensional code of the current two-dimensional code display instruction is exemplified by the link two-dimensional code of the video website Youtubu and the link two-dimensional code of the video website Iqiyi.
电视系统接收当前的两个二维码显示指令,首先,根据视频网站Youtubu的链接二维码显示指令,读取视频网站Youtubu应用的包名得到Youtubu,然后对照ASCII码查找应用包名Youtubu对应的第一个字符码,得到Y。The television system receives the current two two-dimensional code display instructions. First, according to the link of the video website Youtubu, the two-dimensional code display instruction, reads the package name of the video website Youtubu application to get Youtubu, and then searches the application package name Youtubu according to the ASCII code. The first character code, get Y.
然后,根据视频网站Iqiyi的链接二维码显示指令,读取视频网站Iqiyi应用的包名得到Iqiyi,然后对照ASCII码查找应用包名Iqiyi对应的第一个字符码,得到I。Then, according to the link QR code display instruction of the video website Iqiyi, the package name of the video website Iqiyi application is obtained to obtain Iqiyi, and then the first character code corresponding to the application package name Iqiyi is searched for the ASCII code to obtain I.
在获取视频网站Youtubu的链接二维码显示指令和视频网站Iqiyi的链接二维码显示指令对应的特征字符码时,可使用如下算法:When obtaining the link QR code display instruction of the video website Youtubu and the feature character code corresponding to the link QR code display instruction of the video website Iqiyi, the following algorithm can be used:
AP_PK_Name(x1)=YouTubu,电视系统读取到应用的包名;AP_PK_Name(x1)=YouTubu, the name of the package read by the TV system to the application;
Dif_AP_TAG(x1)=Y,电视系统用ASCII码对照查找到第一个字符码。Dif_AP_TAG(x1)=Y, the TV system uses the ASCII code to find the first character code.
AP_PK_Name(x2)=Iqiyi,电视系统读取到应用的包名;AP_PK_Name(x2)=Iqiyi, the name of the package read by the TV system to the application;
Dif_AP_TAG(x2)=I,电视系统用ASCII码对照查找到第一个字符码。Dif_AP_TAG(x2)=I, the TV system uses the ASCII code to find the first character code.
由此,电视系统得到视频网站Youtubu的链接二维码显示指令对应的特征字符码Y,视频网站Iqiyi的链接二维码显示指令对应的特征字符码I。Thus, the television system obtains the feature character code Y corresponding to the link QR code display instruction of the video website Youtubu, and the feature character code I corresponding to the link two-dimensional code display instruction of the video website Iqiyi.
步骤S20、根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数。Step S20: Acquire a display parameter of the feature character code according to a preset two-dimensional code display area and a display gray scale.
在获取二维码显示指令的特征字符码后,电视系统根据预设的二维码显示区域和显示灰阶,获取显示特征字符码时,特征字符码的显示参数。After obtaining the feature character code of the two-dimensional code display instruction, the television system obtains the display parameter of the feature character code when displaying the feature character code according to the preset two-dimensional code display area and the display gray scale.
具体的,作为一种实施方式,首先,电视系统侦测第一存储区中的特征字符码。Specifically, as an implementation manner, first, the television system detects the feature character code in the first storage area.
在侦测到特征字符码后,电视系统读取侦测到的特征字符码并存储到第二缓存区,用于特征字符码显示参数的获取和后续目标二维码的生成。电视系统通过第一缓存区和第二缓存区的划分,使数据的存储和使用互不干扰,提升了数据处理效率。After detecting the feature character code, the television system reads the detected feature character code and stores it in the second buffer area for acquiring the feature character code display parameter and generating the subsequent target two-dimensional code. The division of the first buffer area and the second buffer area by the television system enables data storage and use without interference, thereby improving data processing efficiency.
然后,电视系统读取预设的目标二维码的显示区域,得到目标二维码显示区域尺寸,按照目标二维码显示区域尺寸的预设比例得到特征字符码的显示尺寸。Then, the television system reads the display area of the preset target two-dimensional code to obtain the target two-dimensional code display area size, and obtains the display size of the feature character code according to the preset ratio of the target two-dimensional code display area size.
然后,电视系统根据预设的智能电视屏幕显示灰阶,取智能电视屏幕显示灰阶的随机灰阶值,使用得到的随机灰阶值对应的灰度对特征字符码的初始颜色进行增益,得到特征字符码的增益颜色。Then, the television system displays the gray scale according to the preset smart TV screen, takes the gray scale value of the gray scale displayed on the smart TV screen, and uses the gray level corresponding to the obtained random gray scale value to gain the initial color of the feature character code, and obtains The gain color of the feature character code.
特征字符码显示的增益颜色用于突出显示特征字符码,区别同时显示的不同二维码。需要说明的是,智能电视屏幕灰阶可以是256级,也可以是其他等级,可根据实际需要灵活设定。The gain color of the feature character code display is used to highlight the feature character code and distinguish the different two-dimensional codes displayed at the same time. It should be noted that the gray scale of the smart TV screen can be 256 levels or other levels, and can be flexibly set according to actual needs.
由此,电视系统得到特征字符码的显示参数。其中,特征字符码的显示参数包括特征字符码的显示尺寸和增益颜色。Thus, the television system obtains the display parameters of the feature character code. The display parameter of the feature character code includes a display size and a gain color of the feature character code.
步骤S30、获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码。Step S30: Obtain data information of the original two-dimensional code, and generate a target two-dimensional code according to the data information of the original two-dimensional code, the feature character code, and the display parameter.
在获取特征字符码的显示参数后,电视系统获取本次二维码显示指令的原始二维码数据信息,并根据原始二维码的数据信息、本次二维码显示指令对应的特征字符码和特征字符码的显示参数,生成目标二维码。After obtaining the display parameter of the feature character code, the television system acquires the original two-dimensional code data information of the current two-dimensional code display instruction, and according to the data information of the original two-dimensional code, the feature character code corresponding to the current two-dimensional code display instruction And the display parameter of the character code, and generate the target two-dimensional code.
具体的,作为一种实施方式,首先,电视系统根据本次二维码显示指令读取相应的原始二维码。解析原始二维码得到原始二维码的数据信息。Specifically, as an implementation manner, first, the television system reads the corresponding original two-dimensional code according to the current two-dimensional code display instruction. The original two-dimensional code is parsed to obtain the data information of the original two-dimensional code.
然后,根据原始二维码的数据信息、特征字符码和特征字符码的显示参数,创建目标二维码。目标二维码的显示尺寸可以根据特征字符码的显示尺寸,按预设的比例获取。Then, the target two-dimensional code is created according to the data information of the original two-dimensional code, the feature character code, and the display parameters of the feature character code. The display size of the target two-dimensional code can be obtained according to the display size of the feature character code at a preset ratio.
特征字符码位于目标二维码的填充区域内,以相应的显示参数显示,目标二维码的数据码以初始颜色黑色显示,突出显示特征字符码。The feature character code is located in the filled area of the target two-dimensional code, and is displayed by the corresponding display parameter. The data code of the target two-dimensional code is displayed in the initial color black, and the feature character code is highlighted.
然后,对创建的目标二维码进行掩膜处理,生成目标二维码,使生成的目标二维码黑白显示均衡,数据读取可靠性增强。参照图2,本实施例中目标二维码可有多种预设掩膜方案,掩膜处理时可随机选自掩膜方案,根据相应的掩膜公式进行掩膜处理。Then, the created target two-dimensional code is masked to generate a target two-dimensional code, so that the generated target two-dimensional code is balanced in black and white, and the data reading reliability is enhanced. Referring to FIG. 2, the target two-dimensional code can have a plurality of preset mask schemes in the embodiment, and the mask processing can be randomly selected from the mask scheme, and the mask processing is performed according to the corresponding mask formula.
由此,电视系统得到生成的目标二维码。Thereby, the television system obtains the generated target two-dimensional code.
步骤S40、显示所述生成的目标二维码。Step S40: Display the generated target two-dimensional code.
在得到生成的二维码后,电视系统按预设的规则排列显示生成的二维码。After the generated two-dimensional code is obtained, the television system displays the generated two-dimensional code according to a preset rule.
具体的,作为一种实施方式,首先,电视系统读取当前已生成的二维码。当前已生成的二维码可以是一个,也可以是多个。Specifically, as an implementation manner, first, the television system reads the currently generated two-dimensional code. The currently generated QR code can be one or more.
然后,电视系统按照预设的排列规则,在预设的二维码显示区域内,显示生成的二维码。Then, the television system displays the generated two-dimensional code in the preset two-dimensional code display area according to a preset arrangement rule.
预设的二维码排列规则可以是根据二维码图标的热度作为排列顺序,例如:预设时间内二维码图标的点击生成次数越高,优先排列,显示在智能电视屏幕的左边;预设时间内二维码相关应用的点击次数越高,优先排列,显示在智能电视屏幕的左边;预设时间内,用户在二维码相关应用的停留时间越长,优先排列,显示在智能电视屏幕的左边;预设时间内,用户扫描次数越多的二维码,优先排列,显示在智能电视屏幕左边。当然,预设的二维码排列规则可以是其他排列顺序,可根据实际需要灵活设定。The preset two-dimensional code arrangement rule may be according to the heat of the two-dimensional code icon as an arrangement order, for example, the higher the number of click generations of the two-dimensional code icon in the preset time, the priority is arranged, and displayed on the left side of the smart TV screen; The higher the number of clicks of the QR code related application, the priority is displayed on the left side of the smart TV screen; the longer the user stays in the QR code related application, the priority is arranged and displayed on the smart TV. The left side of the screen; the preset two-dimensional code of the number of user scans, prioritized, displayed on the left side of the smart TV screen. Of course, the preset two-dimensional code arrangement rule may be other arrangement order, and can be flexibly set according to actual needs.
由此,电视系统显示已生成的二维码,供用户扫描使用。由于生成的二维码在显示时均有对应的特征字符码做标识,可使用户在扫描二维码之前即可获知二维码的含义,扫描当前需要的二维码,得到数据信息。Thus, the television system displays the generated two-dimensional code for scanning by the user. Since the generated two-dimensional code has the corresponding feature character code for identification when displayed, the user can know the meaning of the two-dimensional code before scanning the two-dimensional code, scan the currently needed two-dimensional code, and obtain the data information.
本实施例增强了二维码的辨识度,实现了用户在扫描二维码时能够预先获知二维码的含义,辨别不同的二维码,提升了用户体验。In this embodiment, the recognition degree of the two-dimensional code is enhanced, and the user can know the meaning of the two-dimensional code in advance when scanning the two-dimensional code, and distinguish different two-dimensional codes, thereby improving the user experience.
进一步的,本发明二维码生成显示方法第二实施例提供一种二维码生成显示方法,基于上述图1所示的实施例,所述特征字符码的显示参数包括所述特征字符码的显示尺寸和增益颜色,所述步骤S20包括:Further, the second embodiment of the present invention provides a two-dimensional code generation and display method. Based on the embodiment shown in FIG. 1, the display parameter of the feature character code includes the feature character code. Display size and gain color, the step S20 includes:
步骤S21、根据预设的二维码显示区域,获取所述特征字符码的显示尺寸。Step S21: Acquire a display size of the feature character code according to a preset two-dimensional code display area.
在获取二维码显示指令对应的特征字符码后,电视系统获取生成目标二维码时特征字符码的显示尺寸。After acquiring the feature character code corresponding to the two-dimensional code display instruction, the television system acquires the display size of the feature character code when the target two-dimensional code is generated.
具体的,作为一种实施方式,首先,电视系统读取预设的目标二维码的显示区域,得到预设的目标二维码显示区域的尺寸。Specifically, as an implementation manner, first, the television system reads the display area of the preset target two-dimensional code to obtain the size of the preset target two-dimensional code display area.
然后,电视系统根据目标二维码显示区域的尺寸,按照预设的比例,获取特征字符码的放大倍数。Then, the television system acquires the magnification of the feature character code according to the preset ratio according to the size of the target two-dimensional code display area.
然后,电视系统将特征字符码的初始尺寸按照得到的放大倍数进行放大,得到特征字符码的显示尺寸。Then, the television system enlarges the initial size of the feature character code according to the obtained magnification to obtain the display size of the feature character code.
步骤S22、根据预设的显示灰阶,获取所述特征字符码的增益颜色。Step S22: Acquire a gain color of the feature character code according to a preset display gray scale.
在获取二维码显示指令对应的特征字符码后,电视系统获取显示目标二维码时特征字符码的增益颜色。After acquiring the feature character code corresponding to the two-dimensional code display instruction, the television system acquires the gain color of the feature character code when the target two-dimensional code is displayed.
具体的,作为一种实施方式,电视系统预设有智能电视屏幕的显示灰阶,灰阶值与智能电视能够表现的不同层次的颜色亮度一一对应。Specifically, as an implementation manner, the television system is pre-configured with a grayscale display of the smart television screen, and the grayscale value is in one-to-one correspondence with different levels of color brightness that the smart television can represent.
首先,取当前二维码显示指令的总数为n,电视系统根据当前二维码显示指令的总数n,随机选取n个不同的灰阶值。若随机得到的灰阶值有任意两个为相同的,则重新选取,直至得到n个不同的灰阶值。First, the total number of current two-dimensional code display instructions is n, and the television system randomly selects n different grayscale values according to the total number n of the current two-dimensional code display instructions. If any of the randomly obtained grayscale values are the same, reselect them until n different grayscale values are obtained.
由此,得到每个二维码显示指令对应的灰阶值。Thereby, the gray scale value corresponding to each two-dimensional code display instruction is obtained.
二维码指令对应的特征字符码初始颜色为预设颜色,填充灰阶值对应的灰度,得到每个特征字符码显示时的增益颜色。The initial color of the feature character code corresponding to the two-dimensional code instruction is a preset color, and the gray level corresponding to the grayscale value is filled, and the gain color of each feature character code is obtained.
特征字符码显示的增益颜色用于突出显示特征字符码,区别同时显示的不同二维码。The gain color of the feature character code display is used to highlight the feature character code and distinguish the different two-dimensional codes displayed at the same time.
本实施例获取了生成二维码时,特征字符码的显示尺寸和增益颜色,使得特征字符码能够突出显示,增强了二维码的辨识度,实现了用户在扫描二维码时能够预先获知二维码的含义,辨别不同的二维码,提升了用户体验。In this embodiment, when the two-dimensional code is generated, the display size and the gain color of the feature character code are obtained, so that the feature character code can be highlighted, and the recognition degree of the two-dimensional code is enhanced, so that the user can know in advance when scanning the two-dimensional code. The meaning of the QR code identifies different QR codes and enhances the user experience.
进一步的,本发明二维码生成显示方法第三实施例提供一种二维码生成显示方法,基于上述本发明二维码生成显示方法第二实施例,所述步骤S21包括:Further, the third embodiment of the two-dimensional code generation and display method of the present invention provides a second-dimensional code generation and display method, based on the second embodiment of the above-described two-dimensional code generation and display method of the present invention, the step S21 includes:
步骤S211、根据预设的二维码显示区域,获取所述二维码显示区域的水平尺寸。Step S211: Acquire a horizontal size of the two-dimensional code display area according to a preset two-dimensional code display area.
电视系统获取生成目标二维码时特征字符码的显示尺寸时,具体的,作为一种实施方式,首先,电视系统根据预设的目标二维码显示区域,获取目标二维码显示区域水平方向上的显示尺寸,得到目标二维码显示区域的水平尺寸。When the television system obtains the display size of the feature character code when generating the target two-dimensional code, specifically, as an implementation manner, first, the television system acquires the horizontal direction of the target two-dimensional code display area according to the preset target two-dimensional code display area. The display size on the top gives the horizontal size of the target two-dimensional code display area.
目标二维码显示区域的水平尺寸为电视系统根据屏幕中所需要显示的目标二维码数量、显示区域的尺寸进行预先规划后,得到的分配给目标二维码的显示区域的水平尺寸。The horizontal size of the target two-dimensional code display area is the horizontal size of the display area allocated to the target two-dimensional code after the television system performs pre-planning according to the number of target two-dimensional codes and the size of the display area displayed on the screen.
需要说明的是,电视系统对屏幕中目标二维码显示区域的规划可以是预设的,也可以接收二维码显示指令后根据智能电视屏幕所需要显示的目标二维码数量、显示区域的尺寸进行规划得到的,可根据实际需要灵活设置。It should be noted that the planning of the target two-dimensional code display area in the screen by the television system may be preset, or the number of target two-dimensional codes and the display area that are required to be displayed according to the smart television screen after receiving the two-dimensional code display instruction. The size can be flexibly set according to actual needs.
其中,目标二维码显示区域的尺寸的表征可以像素为单位。Wherein, the representation of the size of the target two-dimensional code display area may be in units of pixels.
步骤S212、根据所述二维码显示区域的水平尺寸,获取所述特征字符码的放大倍数。Step S212: Acquire a magnification factor of the feature character code according to a horizontal size of the two-dimensional code display area.
在获取目标二维码显示区域的水平尺寸后,电视系统根据目标二维码显示区域的尺寸,按照预设的比例,获取对应的特征字符码的放大倍数。After obtaining the horizontal size of the target two-dimensional code display area, the television system acquires the magnification of the corresponding characteristic character code according to the preset ratio according to the size of the target two-dimensional code display area.
具体的,作为一种实施方式,电视系统可以获取目标二维码显示区域水平尺寸的预设比例值,作为特征字符码和本次二维码显示指令所创建的二维码的尺寸放大倍数。Specifically, as an implementation manner, the television system may obtain a preset scale value of the horizontal size of the target two-dimensional code display area as the feature character code and the size enlargement multiple of the two-dimensional code created by the current two-dimensional code display instruction.
其中,预设比例值可以是十分之一,也可以是其他数值,可根据实际需要灵活设置。The preset ratio value may be one tenth or other values, and may be flexibly set according to actual needs.
由此,电视系统得到特征字符码的放大倍数。Thus, the television system obtains the magnification of the feature character code.
步骤S213、根据所述特征字符码的放大倍数放大所述特征字符码的初始尺寸,得到所述特征字符码的显示尺寸。Step S213: Enlarge the initial size of the feature character code according to the magnification of the feature character code to obtain a display size of the feature character code.
在获取特征字符码的放大倍数后,电视系统可以根据放大倍数,对特征字符码显示的初始尺寸进行放大。After obtaining the magnification of the feature character code, the television system can enlarge the initial size of the feature character code display according to the magnification.
特征字符码的原始尺寸为系统预设值,例如:3×3的像素矩阵。The original size of the feature character code is a system preset value, for example, a 3×3 pixel matrix.
电视系统将特征字符码的水平尺寸和竖直尺寸均按照放大倍数进行放大,获取特征字符码放大后的尺寸。The television system enlarges the horizontal size and the vertical size of the feature character code according to the magnification, and obtains the enlarged size of the feature character code.
为保持生成目标二维码时,特征字符码在目标二维码填充区域内,电视系统可以使用特征字符码的放大倍数,放大目标二维码的初始尺寸,使目标二维码和特征字符码的尺寸保持同步。In order to maintain the target two-dimensional code, the feature character code is in the target two-dimensional code filling area, and the television system can use the magnification of the feature character code to enlarge the initial size of the target two-dimensional code, so that the target two-dimensional code and the feature character code The dimensions are kept in sync.
以当前二维码显示指令的目标二维码依次为视频网站Youtubu的链接二维码和视频网站Iqiyi的链接二维码,当前目标二维码的类型为QR(Quick Response,快速反应)二维码进行举例说明。The target two-dimensional code of the current two-dimensional code display instruction is the link two-dimensional code of the video website Youtubu and the link two-dimensional code of the video website Iqiyi, and the current target two-dimensional code type is QR (Quick) Response, quick response) Two-dimensional code for illustration.
首先,电视系统获取视频网站Youtubu的链接二维码的显示区域水平尺寸,为40个像素;然后,电视系统获取40个像素的十分之一,得到特征字符码的放大倍数为4;然后,电视系统将特征字符码初始显示尺寸的水平方向和竖直方向同时放大四倍,得到视频网站Youtubu的链接二维码的特征字符码显示尺寸。First, the television system obtains the horizontal size of the display area of the link QR code of the video website Youtubu, which is 40 pixels; then, the television system acquires one tenth of the 40 pixels, and obtains the magnification of the characteristic character code to 4; The television system simultaneously enlarges the horizontal direction and the vertical direction of the initial display size of the feature character code by four times, and obtains the characteristic character code display size of the linked two-dimensional code of the video website Youtubu.
电视系统获取视频网站Iqiyi的链接二维码的显示区域水平尺寸,为20个像素;然后,电视系统获取20个像素的十分之一,得到特征字符码的放大倍数为2;然后,电视系统将特征字符码初始显示尺寸的水平方向和竖直方向同时放大四倍,得到视频网站Iqiyi的链接二维码的特征字符码显示尺寸。The television system obtains the horizontal size of the display area of the link QR code of the video website Iqiyi, which is 20 pixels; then, the television system acquires one tenth of 20 pixels, and obtains a magnification of the characteristic character code of 2; then, the television system The horizontal direction and the vertical direction of the initial display size of the feature character code are simultaneously magnified four times to obtain the feature character code display size of the linked two-dimensional code of the video website Iqiyi.
在获取特征字符码的放大倍数时,可使用如下算法:When obtaining the magnification of the feature character code, the following algorithm can be used:
QR_X_Size(x1)=40,电视系统获取视频网站Youtubu的链接二维码显示区域水平方向上的尺寸:40;QR_X_Size(x1)=40, the TV system obtains the link of the video website Youtubu, the size of the display area in the horizontal direction: 40;
Adap_QR(x1)=QR_X_Size(x1)/10=4,电视系统获取放大倍数:4。Adap_QR(x1)=QR_X_Size(x1)/10=4, the TV system obtains the magnification: 4.
QR_X_Size(x2)=20,电视系统获取视频网站Iqiyi的链接二维码显示区域水平方向上的尺寸:20;QR_X_Size(x2)=20, the TV system obtains the link of the video website Iqiyi QR code display area in the horizontal direction: 20;
Adap_QR(x2)=QR_X_Size(x2)/10=2,电视系统获取放大倍数:2。Adap_QR(x2)=QR_X_Size(x2)/10=2, the TV system obtains the magnification: 2.
本实施例获取了特征字符码的显示尺寸,生成二维码时能够以适合的比例显示特征字符码,使生成的二维码保持美观,便于用户识别不同的二维码。In this embodiment, the display size of the feature character code is obtained. When the two-dimensional code is generated, the feature character code can be displayed in a suitable ratio, so that the generated two-dimensional code is beautiful, and the user can recognize different two-dimensional codes.
进一步的,本发明二维码生成显示方法第四实施例提供一种二维码生成显示方法,基于上述本发明二维码生成显示方法第二实施例或第三实施例(本实施例以本发明二维码生成显示方法第三实施例为例),所述步骤S22包括:Further, the fourth embodiment of the present invention provides a two-dimensional code generation and display method, which is based on the second embodiment or the third embodiment of the present invention. The third embodiment of the invention for generating a two-dimensional code generation method is as an example), and the step S22 includes:
步骤S221、将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值。Step S221: Perform a grayscale value equalization on the preset display grayscale to obtain an equally divided grayscale value.
在获取二维码显示指令对应的特征字符码后,电视系统获取显示目标二维码时特征字符码的增益颜色。After acquiring the feature character code corresponding to the two-dimensional code display instruction, the television system acquires the gain color of the feature character code when the target two-dimensional code is displayed.
具体的,作为一种实施方式,电视系统预设有智能电视屏幕显示的显示灰阶,智能电视屏幕的显示灰阶使用灰阶值表征,灰阶值与智能电视屏幕能够表现的不同层次的颜色亮度一一对应。Specifically, as an implementation manner, the television system is pre-configured with a grayscale display of the smart TV screen display, and the grayscale display of the smart television screen is represented by grayscale values, and the grayscale value and the color of the different levels of the smart television screen can be expressed. The brightness corresponds one by one.
首先,电视系统获取当前二维码显示指令的总数,取当前二维码显示指令总数为n。First, the television system obtains the total number of current two-dimensional code display instructions, and takes the total number of current two-dimensional code display instructions to be n.
然后,将获取的灰阶值按照原有的排列次序进行n等分,得到n等分的灰阶值。Then, the obtained grayscale values are equally divided into n in the original arrangement order to obtain n-divided grayscale values.
步骤S222、获取所述每等分灰阶值的随机灰阶值。Step S222: Acquire a random grayscale value of each of the grayscale values.
在等分灰阶值后,电视系统在每等分灰阶值中,随机选取灰阶值,得到随机灰阶值。After averaging the grayscale values, the television system randomly selects grayscale values in each of the gradation grayscale values to obtain random grayscale values.
若得到的任一两个随机灰阶值在同一个等分灰阶值中,则电视系统重新选取随机灰阶值,直至获取的随机灰阶值在不同的等分灰阶值中。If any two random grayscale values obtained are in the same equally grayscale value, the television system reselects the random grayscale values until the obtained random grayscale values are in different equally divided grayscale values.
由此,电视系统得到与不同的二维码显示指令分别对应的n个随机灰阶值。Thus, the television system obtains n random grayscale values corresponding to different two-dimensional code display instructions, respectively.
步骤S223、根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。Step S223: Obtain a gain color of the feature character code according to the acquired random grayscale value.
在获取每个二维码显示指令对应的随机灰阶值后,随机灰阶值即为特征字符码的颜色增益值。After obtaining the random grayscale value corresponding to each two-dimensional code display instruction, the random grayscale value is the color gain value of the feature character code.
电视系统将二维码显示指令对应的特征字符码初始颜色,填充随机灰阶值对应的灰度,得到显示特征字符码时,特征字符码的增益颜色。The television system displays the initial color of the characteristic character code corresponding to the instruction by the two-dimensional code, and fills the gray level corresponding to the random grayscale value to obtain the gain color of the characteristic character code when the characteristic character code is displayed.
在本实施例中,每个特征字符码的随机灰阶值均在不同的等分灰阶值中,使特征字符码的增益颜色能够产生明显区别,增强了不同二维码的辨识度,使用户更容易辨别不同的二维码。In this embodiment, the random grayscale values of each feature character code are in different equal-gradation grayscale values, so that the gain color of the feature character code can be significantly distinguished, and the recognition degree of different two-dimensional codes is enhanced, so that It is easier for users to distinguish between different QR codes.
进一步的,本发明二维码生成显示方法第五实施例提供一种二维码生成显示方法,基于上述本发明二维码生成显示方法第四实施例,所述原始二维码的数据信息包括原始二维码的定位图案位置、版本信息、数据码和纠错码,所述步骤S30包括:Further, the fifth embodiment of the present invention provides a two-dimensional code generation and display method, which is based on the fourth embodiment of the present invention, and the data information of the original two-dimensional code includes The positioning pattern position, the version information, the data code, and the error correction code of the original two-dimensional code, the step S30 includes:
步骤S310、获取原始二维码的数据信息,根据所述纠错码校正所述数据码,获取校正后的数据码。Step S310: Obtain data information of the original two-dimensional code, correct the data code according to the error correction code, and obtain the corrected data code.
电视系统根据二维码显示指令,查找读取本次二维码显示指令对应的原始二维码。The television system searches for the original two-dimensional code corresponding to the current two-dimensional code display instruction according to the two-dimensional code display instruction.
获取原始二维码后,电视系统解析原始二维码,得到原始二维码携带的数据信息。其中,原始二维码携带的数据信息可以包括原始二维码的定位图案位置、版本信息、数据码和纠错码,还可以包括其他信息,可根据实际需要灵活设定。After obtaining the original two-dimensional code, the television system parses the original two-dimensional code to obtain the data information carried by the original two-dimensional code. The data information carried by the original two-dimensional code may include a positioning pattern position, a version information, a data code, and an error correction code of the original two-dimensional code, and may also include other information, and may be flexibly set according to actual needs.
在获取本次二维码生成指令对应的原始二维码数据信息后,原始二维码的数据信息包括原始二维码的定位图案位置、版本信息、数据码和纠错码,电视系统校正得到的数据码。After obtaining the original two-dimensional code data information corresponding to the current two-dimensional code generation instruction, the data information of the original two-dimensional code includes the positioning pattern position, version information, data code and error correction code of the original two-dimensional code, and the television system corrects the obtained Data code.
具体的,作为一种实施方式,电视系统获取原始二维码的纠错码和数据码,使用纠错码对数据码进行校正,避免数据传输过程中产生的错误。Specifically, as an implementation manner, the television system acquires an error correction code and a data code of the original two-dimensional code, and corrects the data code by using an error correction code to avoid errors generated during data transmission.
由此,电视系统获取校正后的数据码。Thereby, the television system acquires the corrected data code.
步骤S320、根据所述校正后的数据码,获取第二纠错码。Step S320: Acquire a second error correction code according to the corrected data code.
电视系统根据当前得到的校正后的数据码,获取第二纠错码,用于生成目标二维码。The television system acquires a second error correcting code for generating a target two-dimensional code according to the currently obtained corrected data code.
具体的,作为一种实施方式,首先,电视系统对照预设的字符编码,获取校正后数据码的字符码。Specifically, as an implementation manner, first, the television system acquires the character code of the corrected data code according to the preset character encoding.
然后,电视系统对获取的字符码进行取反,得到第二纠错码。Then, the television system inverts the acquired character code to obtain a second error correction code.
以视频网站数据www.iqiyi.com进行举例说明,电视系统首先获取视频网站数据的ASCII码,然后取反,将字符码0取反为1,将1取反为0,将得到的取反后的字符码作为第二纠错码。Taking the video website data www.iqiyi.com as an example, the TV system first obtains the ASCII code of the video website data, and then inverts, the character code 0 is reversed to 1, and the 1 is inverted to 0, and the obtained object is inverted. The character code is used as the second error correcting code.
步骤S330、根据所述原始二维码的定位图案位置和版本信息、所述校正后的数据码、所述第二纠错码、所述特征字符码和所述显示参数,创建目标二维码。Step S330, creating a target two-dimensional code according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correction code, the feature character code, and the display parameter. .
具体的,作为一种实施方式,首先,电视系统读取原始二维码的版本信息,作为目标二维码的版本信息,并根据目标二维码的版本得到目标二维码的初始尺寸。然后,使用特征字符码显示尺寸的放大倍数,放大目标二维码的初始尺寸,得到目标二维码的显示尺寸,使目标二维码和特征字符码的显示尺寸保持同步。Specifically, as an implementation manner, first, the television system reads version information of the original two-dimensional code as version information of the target two-dimensional code, and obtains an initial size of the target two-dimensional code according to the version of the target two-dimensional code. Then, using the feature character code to display the magnification of the size, the initial size of the target two-dimensional code is enlarged, and the display size of the target two-dimensional code is obtained, so that the display size of the target two-dimensional code and the feature character code are kept synchronized.
然后,电视系统读取原始二维码的定位图案位置,定位目标二维码的数据填充区域。Then, the television system reads the position of the positioning pattern of the original two-dimensional code, and locates the data filling area of the target two-dimensional code.
然后,将获取的原始二维码的数据码、第二纠错码、版本信息进行填充区域的填充,将本次二维码显示指令对应的特征字符码按照相应的显示参数进行填充区域的填充,根据目标二维码的显示尺寸,创建目标二维码。Then, the data code, the second error correction code, and the version information of the obtained original two-dimensional code are filled in the filling area, and the feature character code corresponding to the current two-dimensional code display instruction is filled in the filling area according to the corresponding display parameter. Create a target QR code based on the display size of the target QR code.
由此,电视系统得到创建的目标二维码。Thus, the television system obtains the created target two-dimensional code.
以当前二维码显示指令的目标二维码依次为视频网站Youtubu的链接二维码和视频网站Iqiyi的链接二维码,当前目标二维码的类型为QR二维码进行举例说明。The target two-dimensional code of the current two-dimensional code display instruction is a link two-dimensional code of the video website Youtubu and a link two-dimensional code of the video website Iqiyi, and the current target two-dimensional code type is a QR two-dimensional code for illustration.
在创建目标二维码时,可使用如下算法:When creating a target QR code, the following algorithm can be used:
Creat_QR_Rev(x1)=Y,电视系统将视频网站Youtube链接二维码的原始二维码和特征字符码Y按照显示参数生成相应的二维码图标。Creat_QR_Rev(x1)=Y, the television system generates a corresponding two-dimensional code icon according to the display parameters by linking the original two-dimensional code of the two-dimensional code and the characteristic character code Y of the video website Youtube.
Creat_QR_Rev(x2)=I,电视系统将视频网站Iqiyi链接二维码的原始二维码和特征字符码I按照显示参数生成相应的二维码图标。Creat_QR_Rev(x2)=I, the television system generates a corresponding two-dimensional code icon according to the display parameter by linking the original two-dimensional code of the two-dimensional code and the feature character code I of the video website Iqiyi.
步骤S340、根据所述第二纠错码,校正所述创建的二维码,生成目标二维码。Step S340: Correct the created two-dimensional code according to the second error correction code to generate a target two-dimensional code.
在得到创建的目标二维码后,电视系统使用第二纠错码校正创建的目标二维码。After obtaining the created target two-dimensional code, the television system corrects the created target two-dimensional code using the second error correcting code.
具体的,作为一种实施方式,电视系统读取第二纠错码,和本次创建的目标二维码的当前数据码。Specifically, as an implementation manner, the television system reads the second error correcting code and the current data code of the target two-dimensional code created this time.
然后,对照预设的字符编码,电视系统将第二纠错码的字符码取反,减去当前数据码的字符码,若得到的值为0,则本次数据传输正常;若得到的值不为0,则使用第二纠错码校正本次创建的目标二维码。Then, in contrast to the preset character encoding, the television system inverts the character code of the second error correcting code, and subtracts the character code of the current data code. If the obtained value is 0, the current data transmission is normal; if the obtained value If it is not 0, the second error correction code is used to correct the target two-dimensional code created this time.
然后,对创建的目标二维码选取预设的掩膜方案进行掩膜处理,生成目标二维码。Then, a preset mask scheme is selected for the created target QR code to perform mask processing to generate a target two-dimensional code.
生成的目标二维码包含有特征字符码,特征字符码位于目标二维码的填充区域内,不影响用户扫描目标二维码时数据的读取。The generated target two-dimensional code includes a characteristic character code, and the feature character code is located in the filling area of the target two-dimensional code, and does not affect the reading of the data when the user scans the target two-dimensional code.
本实施例通过对原始二维码和目标二维码的校正,避免了数据传输过程中可能产生的错误,增强了二维码的准确性和辨识度,实现了用户在扫描二维码时能够预先获知二维码的含义,辨别不同的二维码,提升了用户体验。In the embodiment, the correction of the original two-dimensional code and the target two-dimensional code avoids errors that may occur during data transmission, enhances the accuracy and recognition of the two-dimensional code, and enables the user to scan the two-dimensional code. Knowing the meaning of the two-dimensional code in advance, distinguishing different two-dimensional codes, and improving the user experience.
参照图4,本发明二维码生成显示装置第一实施例提供一种二维码生成显示装置,所述二维码生成显示装置包括:Referring to FIG. 4, a first embodiment of the two-dimensional code generation display device of the present invention provides a two-dimensional code generation display device, and the two-dimensional code generation display device includes:
接收模块100,用于接收二维码显示指令,并根据所述二维码显示指令获取特征字符码。The receiving module 100 is configured to receive a two-dimensional code display instruction, and acquire a feature character code according to the two-dimensional code display instruction.
本发明主要应用于智能电视创建二维码,用户可使用智能电视显示的二维码进行应用程序的下载安装、快速链接到应用网址、获取节目信息和电视购物等操作。当然,本发明也可应用于其他智能终端二维码的创建。The invention is mainly applied to a smart TV to create a two-dimensional code, and the user can use the two-dimensional code displayed by the smart television to download and install the application program, quickly link to the application website, obtain program information, and purchase television. Of course, the present invention is also applicable to the creation of two-dimensional codes of other smart terminals.
具体的,作为一种实施方式,首先,接收模块100侦测二维码显示指令,当用户或电视系统触发二维码显示指令后,接收模块100获取二维码显示指令。Specifically, as an implementation manner, first, the receiving module 100 detects a two-dimensional code display instruction, and when the user or the television system triggers the two-dimensional code display instruction, the receiving module 100 acquires the two-dimensional code display instruction.
其中,二维码显示指令可以有一个,也可以同时有多个。二维码显示指令包含了本次二维码显示指令所要生成的目标二维码,例如:视频网站Iqiyi的链接二维码、视频网站Youtubu的链接二维码。Among them, the two-dimensional code display instruction may have one or multiple at the same time. The two-dimensional code display instruction includes the target two-dimensional code to be generated by the two-dimensional code display instruction, for example, the link QR code of the video website Iqiyi and the link two-dimensional code of the video website Youtubu.
然后,接收模块100根据二维码显示指令,读取目标二维码应用的名称,提取应用的包名。对照预设的字符编码,查找应用包名的第一个字符码,将此字符码作为本次二维码显示指令对应的特征字符码,也即本次目标二维码的特征字符码。Then, the receiving module 100 reads the name of the target two-dimensional code application according to the two-dimensional code display instruction, and extracts the application package name. The first character code of the application package name is searched according to the preset character code, and the character code is used as the feature character code corresponding to the current two-dimensional code display instruction, that is, the feature character code of the target two-dimensional code.
若当前有多个二维码显示指令,则根据获取二维码显示指令的时间顺序,依次获取对应的特征字符码。若本次二维码显示指令获取的特征字符码已被使用,则获取应用包名对照字符编码得到的第二个字符码,作为本次二维码显示指令对应的特征字符码。以此类推,使当前的多个二维码显示指令均对应有唯一且不同的特征字符码。不同的二维码显示指令有唯一对应的特征字符码,从而使不同的二维码显示指令所创建的二维码具有唯一且不同的标识。其中,特征字符码可以是字符,也可以是数字,可根据实际需要灵活设定。If there are multiple two-dimensional code display instructions, the corresponding feature character codes are sequentially acquired according to the time sequence of acquiring the two-dimensional code display instructions. If the feature character code obtained by the two-dimensional code display instruction has been used, the second character code obtained by comparing the application package name with the character code is obtained as the feature character code corresponding to the current two-dimensional code display instruction. By analogy, the current plurality of two-dimensional code display instructions all correspond to unique and different feature character codes. Different two-dimensional code display instructions have unique corresponding feature character codes, so that the two-dimensional codes created by different two-dimensional code display instructions have unique and different identifiers. The character code can be a character or a number, and can be flexibly set according to actual needs.
需要说明的是,预设的字符编码可以是ASCII(American Standard Code for Information Interchange,美国标准信息交换代码)码,也可以是其他标准码,可根据实际需要灵活设置。然后,接收模块100将获取的特征字符码存储在第一缓存区。单独存储特征字符码,使后续取用特征字符码方便快捷,不干扰后续二维码生成过程中的缓存文件存取。It should be noted that the preset character encoding can be ASCII (American Standard Code for Information Interchange, the US standard information exchange code) code, can also be other standard codes, which can be flexibly set according to actual needs. Then, the receiving module 100 stores the acquired feature character code in the first buffer area. The feature character code is separately stored, so that the subsequent access feature character code is convenient and fast, and does not interfere with the cache file access in the subsequent generation process of the two-dimensional code.
参数模块200,用于根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数。The parameter module 200 is configured to obtain display parameters of the feature character code according to the preset two-dimensional code display area and the display gray scale.
在接收模块100获取二维码显示指令的特征字符码后,参数模块200根据预设的二维码显示区域和显示灰阶,获取显示特征字符码时,特征字符码的显示参数。After the receiving module 100 acquires the feature character code of the two-dimensional code display instruction, the parameter module 200 acquires the display parameter of the feature character code when displaying the feature character code according to the preset two-dimensional code display area and the display gray scale.
具体的,作为一种实施方式,首先,参数模块200侦测第一存储区中的特征字符码。在侦测到特征字符码后,参数模块200读取侦测到的特征字符码并存储到第二缓存区,用于特征字符码显示参数的获取和后续目标二维码的生成。参数模块200通过第一缓存区和第二缓存区的划分,使数据的存储和使用互不干扰,提升了数据处理效率。然后,参数模块200读取预设的目标二维码的显示区域,得到目标二维码显示区域尺寸,按照目标二维码显示区域尺寸的预设比例得到特征字符码的显示尺寸。然后,参数模块200根据预设的智能电视屏幕显示灰阶,取智能电视屏幕显示灰阶的随机灰阶值,使用得到的随机灰阶值对应的灰度对特征字符码的初始颜色进行增益,得到特征字符码的增益颜色。Specifically, as an implementation manner, first, the parameter module 200 detects the feature character code in the first storage area. After detecting the feature character code, the parameter module 200 reads the detected feature character code and stores it in the second buffer area for acquiring the feature character code display parameter and generating the subsequent target two-dimensional code. The parameter module 200 divides the first buffer area and the second buffer area, so that the storage and use of data do not interfere with each other, thereby improving data processing efficiency. Then, the parameter module 200 reads the display area of the preset target two-dimensional code, obtains the target two-dimensional code display area size, and obtains the display size of the feature character code according to the preset ratio of the target two-dimensional code display area size. Then, the parameter module 200 displays the gray scale according to the preset smart TV screen, takes the gray scale value of the gray scale of the smart TV screen, and uses the gray level corresponding to the obtained random gray scale value to gain the initial color of the feature character code. Get the gain color of the feature character code.
特征字符码显示的增益颜色用于突出显示特征字符码,区别同时显示的不同二维码。需要说明的是,智能电视屏幕灰阶可以是256级,也可以是其他等级,可根据实际需要灵活设定。The gain color of the feature character code display is used to highlight the feature character code and distinguish the different two-dimensional codes displayed at the same time. It should be noted that the gray scale of the smart TV screen can be 256 levels or other levels, and can be flexibly set according to actual needs.
由此,参数模块200得到特征字符码的显示参数。其中,特征字符码的显示参数包括特征字符码的显示尺寸和增益颜色。Thus, the parameter module 200 obtains the display parameters of the feature character code. The display parameter of the feature character code includes a display size and a gain color of the feature character code.
创建模块300,用于获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码。The creating module 300 is configured to acquire data information of the original two-dimensional code, and generate a target two-dimensional code according to the data information of the original two-dimensional code, the feature character code, and the display parameter.
在参数模块200获取特征字符码的显示参数后,创建模块300获取本次二维码显示指令的原始二维码数据信息,并根据原始二维码的数据信息、本次二维码显示指令对应的特征字符码和特征字符码的显示参数,生成目标二维码。After the parameter module 200 obtains the display parameter of the feature character code, the creating module 300 acquires the original two-dimensional code data information of the current two-dimensional code display instruction, and correspondingly according to the data information of the original two-dimensional code and the current two-dimensional code display instruction. The characteristic character code and the display parameter of the feature character code generate a target two-dimensional code.
具体的,作为一种实施方式,首先,创建模块300根据本次二维码显示指令读取相应的原始二维码。解析原始二维码得到原始二维码的数据信息。然后,根据原始二维码的数据信息、特征字符码和特征字符码的显示参数,创建目标二维码。目标二维码的显示尺寸可以根据特征字符码的显示尺寸,按预设的比例获取。特征字符码位于目标二维码的填充区域内,以相应的显示参数显示,目标二维码的数据码以初始颜色黑色显示,突出显示特征字符码。然后,创建模块300对创建的目标二维码进行掩膜处理,生成目标二维码,使生成的目标二维码黑白显示均衡,数据读取可靠性增强。参照图2,本实施例中目标二维码可有多种预设掩膜方案,掩膜处理时可随机选自掩膜方案,根据相应的掩膜公式进行掩膜处理。Specifically, as an implementation manner, first, the creating module 300 reads the corresponding original two-dimensional code according to the current two-dimensional code display instruction. The original two-dimensional code is parsed to obtain the data information of the original two-dimensional code. Then, the target two-dimensional code is created according to the data information of the original two-dimensional code, the feature character code, and the display parameters of the feature character code. The display size of the target two-dimensional code can be obtained according to the display size of the feature character code at a preset ratio. The feature character code is located in the filled area of the target two-dimensional code, and is displayed by the corresponding display parameter. The data code of the target two-dimensional code is displayed in the initial color black, and the feature character code is highlighted. Then, the creating module 300 performs mask processing on the created target two-dimensional code to generate a target two-dimensional code, so that the generated target two-dimensional code is balanced in black and white, and the data reading reliability is enhanced. Referring to FIG. 2, the target two-dimensional code can have a plurality of preset mask schemes in the embodiment, and the mask processing can be randomly selected from the mask scheme, and the mask processing is performed according to the corresponding mask formula.
由此,创建模块300得到生成的目标二维码。Thus, the creation module 300 obtains the generated target two-dimensional code.
显示模块400,用于显示所述生成的目标二维码。The display module 400 is configured to display the generated target two-dimensional code.
在得到创建模块300生成的二维码后,显示模块400按预设的规则排列显示生成的二维码。After the two-dimensional code generated by the creation module 300 is obtained, the display module 400 displays the generated two-dimensional code according to a preset rule.
具体的,作为一种实施方式,首先,显示模块400读取当前已生成的二维码。当前已生成的二维码可以是一个,也可以是多个。然后,显示模块400按照预设的排列规则,在预设的二维码显示区域内,显示生成的二维码。预设的二维码排列规则可以是根据二维码图标的热度作为排列顺序,例如:预设时间内二维码图标的点击生成次数越高,优先排列,显示在智能电视屏幕的左边;预设时间内二维码相关应用的点击次数越高,优先排列,显示在智能电视屏幕的左边;预设时间内,用户在二维码相关应用的停留时间越长,优先排列,显示在智能电视屏幕的左边;预设时间内,用户扫描次数越多的二维码,优先排列,显示在智能电视屏幕左边。当然,预设的二维码排列规则可以是其他排列顺序,可根据实际需要灵活设定。Specifically, as an implementation manner, first, the display module 400 reads the currently generated two-dimensional code. The currently generated QR code can be one or more. Then, the display module 400 displays the generated two-dimensional code in the preset two-dimensional code display area according to a preset arrangement rule. The preset two-dimensional code arrangement rule may be according to the heat of the two-dimensional code icon as an arrangement order, for example, the higher the number of click generations of the two-dimensional code icon in the preset time, the priority is arranged, and displayed on the left side of the smart TV screen; The higher the number of clicks of the QR code related application, the priority is displayed on the left side of the smart TV screen; the longer the user stays in the QR code related application, the priority is arranged and displayed on the smart TV. The left side of the screen; the preset two-dimensional code of the number of user scans, prioritized, displayed on the left side of the smart TV screen. Of course, the preset two-dimensional code arrangement rule may be other arrangement order, and can be flexibly set according to actual needs.
由此,显示模块400显示已生成的二维码,供用户扫描使用。由于生成的二维码在显示时均有对应的特征字符码做标识,可使用户在扫描二维码之前即可获知二维码的含义,扫描当前需要的二维码,得到数据信息。Thus, the display module 400 displays the generated two-dimensional code for scanning by the user. Since the generated two-dimensional code has the corresponding feature character code for identification when displayed, the user can know the meaning of the two-dimensional code before scanning the two-dimensional code, scan the currently needed two-dimensional code, and obtain the data information.
本实施例增强了二维码的辨识度,实现了用户在扫描二维码时能够预先获知二维码的含义,辨别不同的二维码,提升了用户体验。In this embodiment, the recognition degree of the two-dimensional code is enhanced, and the user can know the meaning of the two-dimensional code in advance when scanning the two-dimensional code, and distinguish different two-dimensional codes, thereby improving the user experience.
进一步的,本发明二维码生成显示装置第二实施例提供一种二维码生成显示装置,基于上述本发明二维码生成显示装置第一实施例,所述特征字符码的显示参数包括所述特征字符码的显示尺寸和增益颜色,所述参数模块200包括:Further, the second embodiment of the two-dimensional code generation display device of the present invention provides a two-dimensional code generation display device. According to the first embodiment of the above-described two-dimensional code generation display device of the present invention, the display parameters of the feature character code include The display size and gain color of the feature character code, the parameter module 200 includes:
尺寸单元,用于根据预设的二维码显示区域,获取所述特征字符码的显示尺寸。And a size unit, configured to acquire a display size of the feature character code according to the preset two-dimensional code display area.
在获取二维码显示指令对应的特征字符码后,尺寸单元获取生成目标二维码时特征字符码的显示尺寸。After acquiring the feature character code corresponding to the two-dimensional code display instruction, the size unit acquires the display size of the feature character code when the target two-dimensional code is generated.
具体的,作为一种实施方式,首先,尺寸单元读取预设的目标二维码的显示区域,得到预设的目标二维码显示区域的尺寸。然后,尺寸单元根据目标二维码显示区域的尺寸,按照预设的比例,获取特征字符码的放大倍数。然后,尺寸单元将特征字符码的初始尺寸按照得到的放大倍数进行放大,得到特征字符码的显示尺寸。Specifically, as an implementation manner, first, the size unit reads the display area of the preset target two-dimensional code to obtain the size of the preset target two-dimensional code display area. Then, the size unit acquires the magnification of the feature character code according to the preset ratio according to the size of the target two-dimensional code display area. Then, the size unit enlarges the initial size of the feature character code according to the obtained magnification to obtain the display size of the feature character code.
增益单元,用于根据预设的显示灰阶,获取所述特征字符码的增益颜色。And a gain unit, configured to acquire a gain color of the feature character code according to a preset display gray level.
在获取二维码显示指令对应的特征字符码后,增益单元获取显示目标二维码时特征字符码的增益颜色。具体的,作为一种实施方式,增益单元预设有智能电视屏幕的显示灰阶,灰阶值与智能电视能够表现的不同层次的颜色亮度一一对应。首先,取当前二维码显示指令的总数为n,增益单元根据当前二维码显示指令的总数n,随机选取n个不同的灰阶值。若随机得到的灰阶值有任意两个为相同的,则重新选取,直至得到n个不同的灰阶值。After acquiring the feature character code corresponding to the two-dimensional code display instruction, the gain unit acquires the gain color of the feature character code when the target two-dimensional code is displayed. Specifically, as an implementation manner, the gain unit is pre-configured with a grayscale display of the smart TV screen, and the grayscale value is in one-to-one correspondence with different levels of color brightness that the smart television can represent. First, the total number of current two-dimensional code display instructions is n, and the gain unit randomly selects n different grayscale values according to the total number n of the current two-dimensional code display instructions. If any of the randomly obtained grayscale values are the same, reselect them until n different grayscale values are obtained.
由此,增益单元得到每个二维码显示指令对应的灰阶值。二维码指令对应的特征字符码初始颜色为预设颜色,增益单元填充灰阶值对应的灰度,得到每个特征字符码显示时的增益颜色。特征字符码显示的增益颜色用于突出显示特征字符码,区别同时显示的不同二维码。Thereby, the gain unit obtains the gray scale value corresponding to each two-dimensional code display instruction. The initial color of the characteristic character code corresponding to the two-dimensional code instruction is a preset color, and the gain unit fills the gray level corresponding to the grayscale value, and obtains the gain color when each character code is displayed. The gain color of the feature character code display is used to highlight the feature character code and distinguish the different two-dimensional codes displayed at the same time.
本实施例获取了生成二维码时,特征字符码的显示尺寸和增益颜色,使得特征字符码能够突出显示,增强了二维码的辨识度,实现了用户在扫描二维码时能够预先获知二维码的含义,辨别不同的二维码,提升了用户体验。In this embodiment, when the two-dimensional code is generated, the display size and the gain color of the feature character code are obtained, so that the feature character code can be highlighted, and the recognition degree of the two-dimensional code is enhanced, so that the user can know in advance when scanning the two-dimensional code. The meaning of the QR code identifies different QR codes and enhances the user experience.
进一步的,本发明二维码生成显示装置第三实施例提供一种二维码生成显示装置,基于上述本发明二维码生成显示装置第二实施例,所述尺寸单元包括:Further, the third embodiment of the two-dimensional code generation display device of the present invention provides a two-dimensional code generation display device, which is based on the second embodiment of the present invention.
获取子单元,用于根据预设的二维码显示区域,获取所述二维码显示区域的水平尺寸。Obtaining a subunit, configured to acquire a horizontal size of the two-dimensional code display area according to a preset two-dimensional code display area.
在获取生成目标二维码时特征字符码的显示尺寸时,具体的,作为一种实施方式,首先,获取子单元根据预设的目标二维码显示区域,获取目标二维码显示区域水平方向上的显示尺寸,得到目标二维码显示区域的水平尺寸。When obtaining the display size of the feature character code when generating the target two-dimensional code, specifically, as an implementation manner, first, the acquiring sub-unit obtains the horizontal direction of the target two-dimensional code display area according to the preset target two-dimensional code display area. The display size on the top gives the horizontal size of the target two-dimensional code display area.
目标二维码显示区域的水平尺寸为获取子单元根据屏幕中所需要显示的目标二维码数量、显示区域的尺寸进行预先规划后,得到的分配给目标二维码的显示区域的水平尺寸。需要说明的是,屏幕中目标二维码显示区域的规划可以是预设的,也可以接收二维码显示指令后根据智能电视屏幕所需要显示的目标二维码数量、显示区域的尺寸进行规划得到的,可根据实际需要灵活设置。其中,目标二维码显示区域的尺寸的表征可以像素为单位。The horizontal size of the target two-dimensional code display area is the horizontal size of the display area allocated to the target two-dimensional code after the acquisition sub-unit performs pre-planning according to the number of target two-dimensional codes required to be displayed on the screen and the size of the display area. It should be noted that the planning of the target two-dimensional code display area in the screen may be preset, or may be planned according to the number of target two-dimensional codes and the size of the display area that are required to be displayed on the smart television screen after receiving the two-dimensional code display instruction. The obtained can be flexibly set according to actual needs. Wherein, the representation of the size of the target two-dimensional code display area may be in units of pixels.
倍数子单元,用于根据所述二维码显示区域的水平尺寸,获取所述特征字符码的放大倍数。a multiple subunit, configured to acquire a magnification of the feature character code according to a horizontal size of the two-dimensional code display area.
在获取子单元获取目标二维码显示区域的水平尺寸后,倍数子单元根据目标二维码显示区域的尺寸,按照预设的比例,获取对应的特征字符码的放大倍数。具体的,作为一种实施方式,倍数子单元可以获取目标二维码显示区域水平尺寸的预设比例值,作为特征字符码和本次二维码显示指令所创建的二维码的尺寸放大倍数。其中,预设比例值可以是十分之一,也可以是其他数值,可根据实际需要灵活设置。由此,倍数子单元得到特征字符码的放大倍数。After acquiring the horizontal size of the target two-dimensional code display area, the multiple subunit acquires the magnification of the corresponding characteristic character code according to the preset ratio according to the size of the target two-dimensional code display area. Specifically, as an implementation manner, the multiple subunits may obtain a preset scale value of the horizontal size of the target two-dimensional code display area, as the feature character code and the size magnification of the two-dimensional code created by the current two-dimensional code display instruction. . The preset ratio value may be one tenth or other values, and may be flexibly set according to actual needs. Thus, the multiple subunits obtain the magnification of the feature character code.
放大子单元,用于根据所述特征字符码的放大倍数放大所述特征字符码的初始尺寸,得到所述特征字符码的显示尺寸。And an enlargement subunit, configured to enlarge an initial size of the feature character code according to a magnification of the feature character code to obtain a display size of the feature character code.
在倍数子单元获取特征字符码的放大倍数后,放大子单元可以根据放大倍数,对特征字符码显示的初始尺寸进行放大。特征字符码的原始尺寸为系统预设值,例如:3×3的像素矩阵。放大子单元将特征字符码的水平尺寸和竖直尺寸均按照放大倍数进行放大,获取特征字符码放大后的尺寸。为保持生成目标二维码时,特征字符码在目标二维码填充区域内,放大子单元可以使用特征字符码的放大倍数,放大目标二维码的初始尺寸,使目标二维码和特征字符码的尺寸保持同步。After the multiple subunit obtains the magnification of the feature character code, the enlargement subunit may enlarge the initial size of the feature character code display according to the magnification. The original size of the feature character code is a system preset value, for example, a 3×3 pixel matrix. The magnifying subunit enlarges the horizontal size and the vertical size of the feature character code according to the magnification, and obtains the enlarged size of the feature character code. In order to maintain the target two-dimensional code, the feature character code is in the target two-dimensional code filling area, and the magnifying sub-unit can use the magnification of the feature character code to enlarge the initial size of the target two-dimensional code, so that the target two-dimensional code and the characteristic character The size of the code remains synchronized.
本实施例获取了特征字符码的显示尺寸,生成二维码时能够以适合的比例显示特征字符码,使生成的二维码保持美观,便于用户识别不同的二维码。In this embodiment, the display size of the feature character code is obtained. When the two-dimensional code is generated, the feature character code can be displayed in a suitable ratio, so that the generated two-dimensional code is beautiful, and the user can recognize different two-dimensional codes.
进一步的,本发明二维码生成显示装置第四实施例提供一种二维码生成显示装置,基于上述本发明二维码生成显示装置第二实施例或第三实施例(本实施例以本发明二维码生成显示装置第二实施例为例),所述增益单元包括:Further, a fourth embodiment of the two-dimensional code generation display device of the present invention provides a two-dimensional code generation display device, which is based on the second embodiment or the third embodiment of the above-described two-dimensional code generation display device of the present invention. In the second embodiment of the invention, the gain unit includes:
等分子单元,用于将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值。The equal molecular unit is used to divide the preset display gray scale into gray scale values to obtain an equally divided gray scale value.
在获取二维码显示指令对应的特征字符码后,增益单元获取显示目标二维码时特征字符码的增益颜色。具体的,作为一种实施方式,等分子单元预设有智能电视屏幕显示的显示灰阶,智能电视屏幕的显示灰阶使用灰阶值表征,灰阶值与智能电视屏幕能够表现的不同层次的颜色亮度一一对应。首先,等分子单元获取当前二维码显示指令的总数,取当前二维码显示指令总数为n。然后,将获取的灰阶值按照原有的排列次序进行n等分,得到n等分的灰阶值。After acquiring the feature character code corresponding to the two-dimensional code display instruction, the gain unit acquires the gain color of the feature character code when the target two-dimensional code is displayed. Specifically, as an implementation manner, the molecular unit is pre-set with a gray scale of the display of the smart TV screen, and the gray scale of the display of the smart TV screen is represented by a gray scale value, and the gray scale value and the different levels of the smart television screen can be expressed. The color brightness corresponds to each other. First, the equal molecular unit obtains the total number of current two-dimensional code display instructions, and the total number of current two-dimensional code display instructions is n. Then, the obtained grayscale values are equally divided into n in the original arrangement order to obtain n-divided grayscale values.
随机子单元,用于获取所述每等分灰阶值的随机灰阶值。a random subunit, configured to obtain a random grayscale value of the aliquot value.
在等分灰阶值后,随机子单元在每等分灰阶值中,随机选取灰阶值,得到随机灰阶值。若得到的任一两个随机灰阶值在同一个等分灰阶值中,则随机子单元重新选取随机灰阶值,直至获取的随机灰阶值在不同的等分灰阶值中。由此,随机子单元得到与不同的二维码显示指令分别对应的n个随机灰阶值。After averaging the grayscale values, the random subunit randomly selects grayscale values in each of the gradation grayscale values to obtain random grayscale values. If any two random grayscale values obtained are in the same equal grayscale value, the random subunit reselects the random grayscale value until the obtained random grayscale value is in different equally divided grayscale values. Thus, the random subunit obtains n random grayscale values respectively corresponding to different two-dimensional code display instructions.
增益子单元,用于根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。And a gain subunit, configured to obtain a gain color of the feature character code according to the obtained random grayscale value.
在获取每个二维码显示指令对应的随机灰阶值后,随机灰阶值即为特征字符码的颜色增益值。增益子单元将二维码显示指令对应的特征字符码初始颜色,填充随机灰阶值对应的灰度,得到显示特征字符码时,特征字符码的增益颜色。After obtaining the random grayscale value corresponding to each two-dimensional code display instruction, the random grayscale value is the color gain value of the feature character code. The gain subunit displays the initial color of the characteristic character code corresponding to the instruction in the two-dimensional code, and fills the gray level corresponding to the random grayscale value to obtain the gain color of the characteristic character code when the characteristic character code is displayed.
在本实施例中,每个特征字符码的随机灰阶值均在不同的等分灰阶值中,使特征字符码的增益颜色能够产生明显区别,增强了不同二维码的辨识度,使用户更容易辨别不同的二维码。In this embodiment, the random grayscale values of each feature character code are in different equal-gradation grayscale values, so that the gain color of the feature character code can be significantly distinguished, and the recognition degree of different two-dimensional codes is enhanced, so that It is easier for users to distinguish between different QR codes.
进一步的,本发明二维码生成显示装置第五实施例提供一种二维码生成显示装置,基于上述本发明二维码生成显示装置第四实施例,所述原始二维码的数据信息包括原始二维码的定位图案位置、版本信息、数据码和纠错码,所述创建模块300包括:Further, the fifth embodiment of the two-dimensional code generation display device of the present invention provides a two-dimensional code generation display device. Based on the fourth embodiment of the above-described two-dimensional code generation display device of the present invention, the data information of the original two-dimensional code includes The positioning pattern position, the version information, the data code, and the error correction code of the original two-dimensional code, the creating module 300 includes:
纠错单元,用于获取原始二维码的数据信息,根据所述纠错码校正所述数据码,获取校正后的数据码。And an error correction unit, configured to acquire data information of the original two-dimensional code, correct the data code according to the error correction code, and obtain the corrected data code.
纠错单元根据二维码显示指令,查找读取本次二维码显示指令对应的原始二维码。获取原始二维码后,纠错单元解析原始二维码,得到原始二维码携带的数据信息。其中,原始二维码携带的数据信息可以包括原始二维码的定位图案位置、版本信息、数据码和纠错码,还可以包括其他信息,可根据实际需要灵活设定。获取本次二维码生成指令对应的原始二维码数据信息后,原始二维码的数据信息包括原始二维码的定位图案位置、版本信息、数据码和纠错码,电视系统校正得到的数据码。具体的,作为一种实施方式,纠错单元获取原始二维码的纠错码和数据码,使用纠错码对数据码进行校正,避免数据传输过程中产生的错误。由此,纠错单元获取校正后的数据码。The error correction unit searches for the original two-dimensional code corresponding to the current two-dimensional code display instruction according to the two-dimensional code display instruction. After obtaining the original two-dimensional code, the error correction unit parses the original two-dimensional code to obtain the data information carried by the original two-dimensional code. The data information carried by the original two-dimensional code may include a positioning pattern position, a version information, a data code, and an error correction code of the original two-dimensional code, and may also include other information, and may be flexibly set according to actual needs. After obtaining the original two-dimensional code data information corresponding to the two-dimensional code generation instruction, the data information of the original two-dimensional code includes the positioning pattern position, version information, data code and error correction code of the original two-dimensional code, and is corrected by the television system. Data code. Specifically, as an implementation manner, the error correction unit acquires an error correction code and a data code of the original two-dimensional code, and corrects the data code by using an error correction code to avoid an error generated during data transmission. Thereby, the error correction unit acquires the corrected data code.
获取单元,用于根据所述校正后的数据码,获取第二纠错码。And an acquiring unit, configured to acquire a second error correction code according to the corrected data code.
获取单元根据当前得到的校正后的数据码,获取第二纠错码,用于生成目标二维码。具体的,作为一种实施方式,首先,获取单元对照预设的字符编码,获取校正后数据码的字符码。然后,获取单元对获取的字符码进行取反,得到第二纠错码。The obtaining unit acquires a second error correcting code according to the currently obtained corrected data code, and is used to generate a target two-dimensional code. Specifically, as an implementation manner, first, the acquiring unit compares the preset character encoding to obtain the character code of the corrected data code. Then, the obtaining unit inverts the obtained character code to obtain a second error correcting code.
创建单元,用于根据所述原始二维码的定位图案位置和版本信息、所述校正后的数据码、所述第二纠错码、所述特征字符码和所述显示参数,创建目标二维码。a creating unit, configured to create a target two according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correcting code, the feature character code, and the display parameter Dimension code.
具体的,作为一种实施方式,首先,创建单元读取原始二维码的版本信息,作为目标二维码的版本信息,并根据目标二维码的版本得到目标二维码的初始尺寸。然后,使用特征字符码显示尺寸的放大倍数,放大目标二维码的初始尺寸,得到目标二维码的显示尺寸,使目标二维码和特征字符码的显示尺寸保持同步。然后,创建单元读取原始二维码的定位图案位置,定位目标二维码的数据填充区域。然后,将获取的原始二维码的数据码、第二纠错码、版本信息进行填充区域的填充,将本次二维码显示指令对应的特征字符码按照相应的显示参数进行填充区域的填充,根据目标二维码的显示尺寸,创建目标二维码。由此,创建单元得到创建的目标二维码。Specifically, as an implementation manner, first, the creating unit reads version information of the original two-dimensional code as version information of the target two-dimensional code, and obtains an initial size of the target two-dimensional code according to the version of the target two-dimensional code. Then, using the feature character code to display the magnification of the size, the initial size of the target two-dimensional code is enlarged, and the display size of the target two-dimensional code is obtained, so that the display size of the target two-dimensional code and the feature character code are kept synchronized. Then, the creating unit reads the positioning pattern position of the original two-dimensional code, and locates the data filling area of the target two-dimensional code. Then, the data code, the second error correction code, and the version information of the obtained original two-dimensional code are filled in the filling area, and the feature character code corresponding to the current two-dimensional code display instruction is filled in the filling area according to the corresponding display parameter. Create a target QR code based on the display size of the target QR code. Thus, the creation unit obtains the created target two-dimensional code.
校正单元,用于根据所述第二纠错码,校正所述创建的二维码,生成目标二维码。And a correcting unit, configured to correct the created two-dimensional code according to the second error correcting code to generate a target two-dimensional code.
具体的,作为一种实施方式,校正单元读取第二纠错码,和创建单元创建的目标二维码的当前数据码。然后,对照预设的字符编码,校正单元将第二纠错码的字符码取反后,减去当前数据码的字符码,若得到的值为0,则本次数据传输正常;若得到的值不为0,则使用第二纠错码校正本次创建的目标二维码。然后,对创建的目标二维码选取预设的掩膜方案进行掩膜处理,生成目标二维码。生成的目标二维码包含有特征字符码,特征字符码位于目标二维码的填充区域内,不影响用户扫描目标二维码时数据的读取。Specifically, as an implementation manner, the correcting unit reads the second error correcting code, and creates a current data code of the target two-dimensional code created by the unit. Then, in contrast to the preset character encoding, the correcting unit inverts the character code of the second error correcting code, and subtracts the character code of the current data code. If the obtained value is 0, the current data transmission is normal; if obtained If the value is not 0, the second error correction code is used to correct the target two-dimensional code created this time. Then, a preset mask scheme is selected for the created target QR code to perform mask processing to generate a target two-dimensional code. The generated target two-dimensional code includes a characteristic character code, and the feature character code is located in the filling area of the target two-dimensional code, and does not affect the reading of the data when the user scans the target two-dimensional code.
本实施例通过对原始二维码和目标二维码的校正,避免了数据传输过程中可能产生的错误,增强了二维码的准确性和辨识度,实现了用户在扫描二维码时能够预先获知二维码的含义,辨别不同的二维码,提升了用户体验。In the embodiment, the correction of the original two-dimensional code and the target two-dimensional code avoids errors that may occur during data transmission, enhances the accuracy and recognition of the two-dimensional code, and enables the user to scan the two-dimensional code. Knowing the meaning of the two-dimensional code in advance, distinguishing different two-dimensional codes, and improving the user experience.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.

Claims (19)

  1. 一种二维码生成显示方法,其特征在于,所述二维码生成显示方法包括以下步骤:A two-dimensional code generation display method, characterized in that the two-dimensional code generation display method comprises the following steps:
    接收二维码显示指令,并根据所述二维码显示指令获取特征字符码;Receiving a two-dimensional code display instruction, and acquiring a feature character code according to the two-dimensional code display instruction;
    根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数;Obtaining a display parameter of the feature character code according to a preset two-dimensional code display area and a display gray scale;
    获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码;Obtaining data information of the original two-dimensional code, and generating a target two-dimensional code according to the data information of the original two-dimensional code, the feature character code, and the display parameter;
    显示所述生成的目标二维码。The generated target two-dimensional code is displayed.
  2. 如权利要求1所述的二维码生成显示方法,其特征在于,所述特征字符码的显示参数包括所述特征字符码的显示尺寸和增益颜色,所述根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数的步骤包括:The method for generating a two-dimensional code according to claim 1, wherein the display parameter of the feature character code comprises a display size and a gain color of the feature character code, and the display area according to the preset two-dimensional code And displaying the gray scale, the step of obtaining the display parameter of the feature character code includes:
    根据预设的二维码显示区域,获取所述特征字符码的显示尺寸;Obtaining a display size of the feature character code according to a preset two-dimensional code display area;
    根据预设的显示灰阶,获取所述特征字符码的增益颜色。Obtaining a gain color of the feature character code according to a preset display gray scale.
  3. 如权利要求2所述的二维码生成显示方法,其特征在于,所述根据预设的二维码显示区域,获取所述特征字符码的显示尺寸的步骤包括:The method for generating a two-dimensional code according to claim 2, wherein the step of acquiring the display size of the feature character code according to the preset two-dimensional code display area comprises:
    根据预设的二维码显示区域,获取所述二维码显示区域的水平尺寸;Obtaining a horizontal size of the display area of the two-dimensional code according to a preset two-dimensional code display area;
    根据所述二维码显示区域的水平尺寸,获取所述特征字符码的放大倍数;Obtaining a magnification of the feature character code according to a horizontal size of the two-dimensional code display area;
    根据所述特征字符码的放大倍数放大所述特征字符码的初始尺寸,得到所述特征字符码的显示尺寸。Enlarging an initial size of the feature character code according to a magnification of the feature character code to obtain a display size of the feature character code.
  4. 如权利要求2所述的二维码生成显示方法,其特征在于,所述根据预设的显示灰阶,获取所述特征字符码的增益颜色的步骤包括:The method for generating a two-dimensional code according to claim 2, wherein the step of acquiring the gain color of the feature character code according to the preset display gray scale comprises:
    将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值;The preset gray scale value is equally divided into gray scale values to obtain an equally divided gray scale value;
    获取所述每等分灰阶值的随机灰阶值;Obtaining a random grayscale value of the aliquot value;
    根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。Obtaining a gain color of the feature character code according to the obtained random grayscale value.
  5. 如权利要求3所述的二维码生成显示方法,其特征在于,所述根据预设的显示灰阶,获取所述特征字符码的增益颜色的步骤包括:The method for generating a two-dimensional code according to claim 3, wherein the step of acquiring the gain color of the feature character code according to the preset display gray scale comprises:
    将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值;The preset gray scale value is equally divided into gray scale values to obtain an equally divided gray scale value;
    获取所述每等分灰阶值的随机灰阶值;Obtaining a random grayscale value of the aliquot value;
    根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。Obtaining a gain color of the feature character code according to the obtained random grayscale value.
  6. 如权利要求4所述的二维码生成显示方法,其特征在于,所述原始二维码的数据信息包括原始二维码的定位图案位置、版本信息、数据码和纠错码,所述获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码的步骤包括:The two-dimensional code generation and display method according to claim 4, wherein the data information of the original two-dimensional code comprises a positioning pattern position, a version information, a data code, and an error correction code of the original two-dimensional code, and the obtaining The data information of the original two-dimensional code, the step of generating the target two-dimensional code according to the data information of the original two-dimensional code, the characteristic character code and the display parameter comprises:
    获取原始二维码的数据信息,根据所述纠错码校正所述数据码,获取校正后的数据码;Obtaining data information of the original two-dimensional code, correcting the data code according to the error correction code, and acquiring the corrected data code;
    根据所述校正后的数据码,获取第二纠错码;Obtaining a second error correction code according to the corrected data code;
    根据所述原始二维码的定位图案位置和版本信息、所述校正后的数据码、所述第二纠错码、所述特征字符码和所述显示参数,创建目标二维码;And creating a target two-dimensional code according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correction code, the feature character code, and the display parameter;
    根据所述第二纠错码,校正所述创建的二维码,生成目标二维码。And correcting the created two-dimensional code according to the second error correction code to generate a target two-dimensional code.
  7. 如权利要求5所述的二维码生成显示方法,其特征在于,所述原始二维码的数据信息包括原始二维码的定位图案位置、版本信息、数据码和纠错码,所述获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码的步骤包括:The two-dimensional code generation and display method according to claim 5, wherein the data information of the original two-dimensional code comprises a positioning pattern position, a version information, a data code, and an error correction code of the original two-dimensional code, and the obtaining The data information of the original two-dimensional code, the step of generating the target two-dimensional code according to the data information of the original two-dimensional code, the characteristic character code and the display parameter comprises:
    获取原始二维码的数据信息,根据所述纠错码校正所述数据码,获取校正后的数据码;Obtaining data information of the original two-dimensional code, correcting the data code according to the error correction code, and acquiring the corrected data code;
    根据所述校正后的数据码,获取第二纠错码;Obtaining a second error correction code according to the corrected data code;
    根据所述原始二维码的定位图案位置和版本信息、所述校正后的数据码、所述第二纠错码、所述特征字符码和所述显示参数,创建目标二维码;And creating a target two-dimensional code according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correction code, the feature character code, and the display parameter;
    根据所述第二纠错码,校正所述创建的二维码,生成目标二维码。And correcting the created two-dimensional code according to the second error correction code to generate a target two-dimensional code.
  8. 一种二维码生成显示方法,其特征在于,所述二维码生成显示方法包括以下步骤:A two-dimensional code generation display method, characterized in that the two-dimensional code generation display method comprises the following steps:
    接收二维码显示指令,并根据所述二维码显示指令,读取目标二维码应用的名称,提取所述应用的包名;Receiving a two-dimensional code display instruction, and reading a name of the target two-dimensional code application according to the two-dimensional code display instruction, and extracting a package name of the application;
    对照预设的字符编码,查找所述应用包名的第一个字符码,将此字符码作为所述二维码显示指令对应的特征字符码;Searching for the first character code of the application package name against the preset character code, and using the character code as the feature character code corresponding to the two-dimensional code display instruction;
    根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数;Obtaining a display parameter of the feature character code according to a preset two-dimensional code display area and a display gray scale;
    获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码;Obtaining data information of the original two-dimensional code, and generating a target two-dimensional code according to the data information of the original two-dimensional code, the feature character code, and the display parameter;
    显示所述生成的目标二维码。The generated target two-dimensional code is displayed.
  9. 如权利要求8所述的二维码生成显示方法,其特征在于,所述特征字符码的显示参数包括所述特征字符码的显示尺寸和增益颜色,所述根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数的步骤包括:The method for generating a two-dimensional code according to claim 8, wherein the display parameter of the feature character code comprises a display size and a gain color of the feature character code, and the display area according to the preset two-dimensional code And displaying the gray scale, the step of obtaining the display parameter of the feature character code includes:
    根据预设的二维码显示区域,获取所述特征字符码的显示尺寸;Obtaining a display size of the feature character code according to a preset two-dimensional code display area;
    根据预设的显示灰阶,获取所述特征字符码的增益颜色。Obtaining a gain color of the feature character code according to a preset display gray scale.
  10. 如权利要求9所述的二维码生成显示方法,其特征在于,所述根据预设的二维码显示区域,获取所述特征字符码的显示尺寸的步骤包括:The method for generating a two-dimensional code according to claim 9, wherein the step of acquiring the display size of the feature character code according to the preset two-dimensional code display area comprises:
    根据预设的二维码显示区域,获取所述二维码显示区域的水平尺寸;Obtaining a horizontal size of the display area of the two-dimensional code according to a preset two-dimensional code display area;
    根据所述二维码显示区域的水平尺寸,获取所述特征字符码的放大倍数;Obtaining a magnification of the feature character code according to a horizontal size of the two-dimensional code display area;
    根据所述特征字符码的放大倍数放大所述特征字符码的初始尺寸,得到所述特征字符码的显示尺寸。Enlarging an initial size of the feature character code according to a magnification of the feature character code to obtain a display size of the feature character code.
  11. 如权利要求9所述的二维码生成显示方法,其特征在于,所述根据预设的显示灰阶,获取所述特征字符码的增益颜色的步骤包括:The method for generating a two-dimensional code according to claim 9, wherein the step of acquiring the gain color of the feature character code according to the preset display gray scale comprises:
    将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值;The preset gray scale value is equally divided into gray scale values to obtain an equally divided gray scale value;
    获取所述每等分灰阶值的随机灰阶值;Obtaining a random grayscale value of the aliquot value;
    根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。Obtaining a gain color of the feature character code according to the obtained random grayscale value.
  12. 如权利要求10所述的二维码生成显示方法,其特征在于,所述根据预设的显示灰阶,获取所述特征字符码的增益颜色的步骤包括:The method for generating a two-dimensional code according to claim 10, wherein the step of acquiring the gain color of the feature character code according to the preset display gray scale comprises:
    将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值;The preset gray scale value is equally divided into gray scale values to obtain an equally divided gray scale value;
    获取所述每等分灰阶值的随机灰阶值;Obtaining a random grayscale value of the aliquot value;
    根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。Obtaining a gain color of the feature character code according to the obtained random grayscale value.
  13. 一种二维码生成显示装置,其特征在于,所述二维码生成显示装置包括:A two-dimensional code generation display device, wherein the two-dimensional code generation display device comprises:
    接收模块,用于接收二维码显示指令,并根据所述二维码显示指令获取特征字符码;a receiving module, configured to receive a two-dimensional code display instruction, and acquire a feature character code according to the two-dimensional code display instruction;
    参数模块,用于根据预设的二维码显示区域和显示灰阶,获取所述特征字符码的显示参数;a parameter module, configured to acquire a display parameter of the feature character code according to a preset two-dimensional code display area and display gray scale;
    创建模块,用于获取原始二维码的数据信息,根据所述原始二维码的数据信息、所述特征字符码和所述显示参数生成目标二维码;a creating module, configured to acquire data information of the original two-dimensional code, and generate a target two-dimensional code according to the data information of the original two-dimensional code, the characteristic character code, and the display parameter;
    显示模块,用于显示所述生成的目标二维码。a display module, configured to display the generated target two-dimensional code.
  14. 如权利要求13所述的二维码生成显示装置,其特征在于,所述特征字符码的显示参数包括所述特征字符码的显示尺寸和增益颜色,所述参数模块包括:The two-dimensional code generation and display device according to claim 13, wherein the display parameter of the feature character code comprises a display size and a gain color of the feature character code, and the parameter module comprises:
    尺寸单元,用于根据预设的二维码显示区域,获取所述特征字符码的显示尺寸;a size unit, configured to obtain a display size of the feature character code according to a preset two-dimensional code display area;
    增益单元,用于根据预设的显示灰阶,获取所述特征字符码的增益颜色。And a gain unit, configured to acquire a gain color of the feature character code according to a preset display gray level.
  15. 如权利要求14所述的二维码生成显示装置,其特征在于,所述尺寸单元包括:The two-dimensional code generation display device according to claim 14, wherein the size unit comprises:
    获取子单元,用于根据预设的二维码显示区域,获取所述二维码显示区域的水平尺寸;Obtaining a subunit, configured to acquire a horizontal size of the display area of the two-dimensional code according to a preset two-dimensional code display area;
    倍数子单元,用于根据所述二维码显示区域的水平尺寸,获取所述特征字符码的放大倍数;a multiple subunit, configured to acquire a magnification of the feature character code according to a horizontal size of the two-dimensional code display area;
    放大子单元,用于根据所述特征字符码的放大倍数放大所述特征字符码的初始尺寸,得到所述特征字符码的显示尺寸。And an enlargement subunit, configured to enlarge an initial size of the feature character code according to a magnification of the feature character code to obtain a display size of the feature character code.
  16. 如权利要求14所述的二维码生成显示装置,其特征在于,所述增益单元包括:The two-dimensional code generation display device according to claim 14, wherein the gain unit comprises:
    等分子单元,用于将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值;An equal molecular unit for dividing a preset gray scale value by a gray scale value to obtain an equally divided gray scale value;
    随机子单元,用于获取所述每等分灰阶值的随机灰阶值;a random subunit, configured to obtain a random grayscale value of the aliquot value;
    增益子单元,用于根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。And a gain subunit, configured to obtain a gain color of the feature character code according to the obtained random grayscale value.
  17. 如权利要求15所述的二维码生成显示装置,其特征在于,所述增益单元包括:The two-dimensional code generation display device according to claim 15, wherein the gain unit comprises:
    等分子单元,用于将预设的显示灰阶进行灰阶值等分,得到等分的灰阶值;An equal molecular unit for dividing a preset gray scale value by a gray scale value to obtain an equally divided gray scale value;
    随机子单元,用于获取所述每等分灰阶值的随机灰阶值;a random subunit, configured to obtain a random grayscale value of the aliquot value;
    增益子单元,用于根据所述获取的随机灰阶值,得到所述特征字符码的增益颜色。And a gain subunit, configured to obtain a gain color of the feature character code according to the obtained random grayscale value.
  18. 如权利要求16所述的二维码生成显示装置,其特征在于,所述原始二维码的数据信息包括原始二维码的定位图案位置、版本信息、数据码和纠错码,所述创建模块包括:The two-dimensional code generation display device according to claim 16, wherein the data information of the original two-dimensional code comprises a positioning pattern position, version information, a data code, and an error correction code of the original two-dimensional code, the creation Modules include:
    纠错单元,用于获取原始二维码的数据信息,根据所述纠错码校正所述数据码,获取校正后的数据码;An error correction unit, configured to acquire data information of the original two-dimensional code, correct the data code according to the error correction code, and obtain the corrected data code;
    获取单元,用于根据所述校正后的数据码,获取第二纠错码;An acquiring unit, configured to acquire a second error correction code according to the corrected data code;
    创建单元,用于根据所述原始二维码的定位图案位置和版本信息、所述校正后的数据码、所述第二纠错码、所述特征字符码和所述显示参数,创建目标二维码;a creating unit, configured to create a target two according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correcting code, the feature character code, and the display parameter Dimension code
    校正单元,用于根据所述第二纠错码,校正所述创建的二维码,生成目标二维码。And a correcting unit, configured to correct the created two-dimensional code according to the second error correcting code to generate a target two-dimensional code.
  19. 如权利要求17所述的二维码生成显示装置,其特征在于,所述原始二维码的数据信息包括原始二维码的定位图案位置、版本信息、数据码和纠错码,所述创建模块包括:The two-dimensional code generation display device according to claim 17, wherein the data information of the original two-dimensional code comprises a positioning pattern position, version information, a data code, and an error correction code of the original two-dimensional code, the creation Modules include:
    纠错单元,用于获取原始二维码的数据信息,根据所述纠错码校正所述数据码,获取校正后的数据码;An error correction unit, configured to acquire data information of the original two-dimensional code, correct the data code according to the error correction code, and obtain the corrected data code;
    获取单元,用于根据所述校正后的数据码,获取第二纠错码;An acquiring unit, configured to acquire a second error correction code according to the corrected data code;
    创建单元,用于根据所述原始二维码的定位图案位置和版本信息、所述校正后的数据码、所述第二纠错码、所述特征字符码和所述显示参数,创建目标二维码;a creating unit, configured to create a target two according to the positioning pattern position and version information of the original two-dimensional code, the corrected data code, the second error correcting code, the feature character code, and the display parameter Dimension code
    校正单元,用于根据所述第二纠错码,校正所述创建的二维码,生成目标二维码。And a correcting unit, configured to correct the created two-dimensional code according to the second error correcting code to generate a target two-dimensional code.
PCT/CN2016/084357 2015-11-12 2016-06-01 Two-dimensional code generation and display method and device WO2017080190A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510770675.9A CN105335771B (en) 2015-11-12 2015-11-12 Quick Response Code generates display methods and device
CN201510770675.9 2015-11-12

Publications (1)

Publication Number Publication Date
WO2017080190A1 true WO2017080190A1 (en) 2017-05-18

Family

ID=55286286

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/084357 WO2017080190A1 (en) 2015-11-12 2016-06-01 Two-dimensional code generation and display method and device

Country Status (2)

Country Link
CN (1) CN105335771B (en)
WO (1) WO2017080190A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111463900A (en) * 2020-04-07 2020-07-28 国家电网有限公司 HTM L-based intelligent substation optical fiber channel visual display method

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335771B (en) * 2015-11-12 2018-09-04 深圳Tcl数字技术有限公司 Quick Response Code generates display methods and device
CN109614838B (en) * 2018-11-05 2021-11-30 武汉天喻信息产业股份有限公司 Two-dimensional code generation method and system, implementation method and payment equipment
CN109685187B (en) * 2018-12-28 2021-12-14 优城(宁波)地铁科技有限公司 Module with batch code sending mode function
CN111415091A (en) * 2020-03-20 2020-07-14 绍兴数智科技有限公司 Dyeing scheduling equipment, production card number recording method and storage medium
CN112651475B (en) * 2021-01-06 2022-09-23 北京字节跳动网络技术有限公司 Two-dimensional code display method, device, equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1818926A (en) * 2006-03-17 2006-08-16 北京紫光捷通科技有限公司 Two-dimensional code area precisive positioning method for two-dimensional recognition
JP2011039878A (en) * 2009-08-13 2011-02-24 Fuji Xerox Co Ltd Image processing apparatus and program
US8194914B1 (en) * 2006-10-19 2012-06-05 Spyder Lynk, Llc Encoding and decoding data into an image using identifiable marks and encoded elements
JP2013126004A (en) * 2011-12-13 2013-06-24 Konica Minolta Business Technologies Inc Image processing device, image generation method, and computer program
CN103986752A (en) * 2014-05-08 2014-08-13 海信集团有限公司 Method, device and system for inputting information on input interface of smart television set
CN104781834A (en) * 2012-11-13 2015-07-15 共同印刷株式会社 Two-dimensional code, system for creation of two-dimensional code, and analysis program
CN105335771A (en) * 2015-11-12 2016-02-17 深圳Tcl数字技术有限公司 Two-dimensional code generating and displaying method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040078333A1 (en) * 2001-02-09 2004-04-22 David Hilton Document printed with graphical symbols which encode information

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1818926A (en) * 2006-03-17 2006-08-16 北京紫光捷通科技有限公司 Two-dimensional code area precisive positioning method for two-dimensional recognition
US8194914B1 (en) * 2006-10-19 2012-06-05 Spyder Lynk, Llc Encoding and decoding data into an image using identifiable marks and encoded elements
JP2011039878A (en) * 2009-08-13 2011-02-24 Fuji Xerox Co Ltd Image processing apparatus and program
JP2013126004A (en) * 2011-12-13 2013-06-24 Konica Minolta Business Technologies Inc Image processing device, image generation method, and computer program
CN104781834A (en) * 2012-11-13 2015-07-15 共同印刷株式会社 Two-dimensional code, system for creation of two-dimensional code, and analysis program
CN103986752A (en) * 2014-05-08 2014-08-13 海信集团有限公司 Method, device and system for inputting information on input interface of smart television set
CN105335771A (en) * 2015-11-12 2016-02-17 深圳Tcl数字技术有限公司 Two-dimensional code generating and displaying method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111463900A (en) * 2020-04-07 2020-07-28 国家电网有限公司 HTM L-based intelligent substation optical fiber channel visual display method

Also Published As

Publication number Publication date
CN105335771A (en) 2016-02-17
CN105335771B (en) 2018-09-04

Similar Documents

Publication Publication Date Title
WO2017080190A1 (en) Two-dimensional code generation and display method and device
WO2020009553A1 (en) Method and apparatus for nr sidelink ss/pbch block
WO2021002618A1 (en) Multi-link operation mode
WO2018086292A1 (en) Method and system for detecting security hole of application software, device, and storage medium
WO2020040589A1 (en) Method and device for configuring links for executing communication in wireless lan system
WO2021029553A1 (en) Method and device for receiving ppdu, for which ldpc tone mapping has been performed, in wireless lan system
WO2020045910A1 (en) Method and apparatus for applying phase rotation in broadband with 80mhz based preamble puncturing perormed in wlan system
WO2021006494A1 (en) Method and device for receiving ppdu having been subjected to ldpc tone mapping in broadband tone plan in wireless lan system
EP3677008A1 (en) Method and electronic device for providing communication service
WO2021091341A1 (en) Method for constructing preamble in wireless communication system
WO2021029552A1 (en) Method and apparatus for receiving ppdu through broadband in wireless lan system
WO2016018066A1 (en) Broadcast signal transmission method, broadcast signal reception method, broadcast signal transmission apparatus and broadcast signal reception apparatus
WO2020242106A1 (en) Method and device for receiving eht ppdu on basis of tone plan in wireless lan system
WO2015158133A1 (en) Error correction method and system for voice control instruction
WO2020242105A1 (en) Method and device for setting pilot tone in wideband in wireless lan system
WO2014173202A1 (en) Method and device for searching for contact in mobile phone
WO2022005194A1 (en) Method and apparatus for receiving ppdu with duplicated data through 80 mhz band in wireless lan system
WO2021010606A1 (en) Capability negotiation in multilink
WO2015124073A1 (en) Process monitoring method, apparatus, and system
WO2021006495A1 (en) Method and device for transmitting feedback frame in wide band in wireless lan system
WO2020171463A1 (en) Method and apparatus for receiving eht ppdu in wireless lan system
WO2021112585A1 (en) Method and apparatus for receiving ppdu in wireless lan system
WO2018086294A1 (en) Method and system for detecting security hole of application software, device, and storage medium
WO2015152668A1 (en) Method for transmitting broadcast signal, method for receiving broadcast signal, apparatus for transmitting broadcast signal, and apparatus for receiving broadcast signal
WO2019117409A1 (en) Central server and dramatic performance system including same

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: 16863371

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22/08/2018)

122 Ep: pct application non-entry in european phase

Ref document number: 16863371

Country of ref document: EP

Kind code of ref document: A1