A method, device, equipment and medium for generating an art two-dimensional code

CN117172267BActive Publication Date: 2026-08-21ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311272261.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2026-08-21
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

[0003]本说明书实施例提供一种生成艺术二维码的方法、装置、设备及介质,以解决现有的艺术二维码生成方法存在的不确定性的问题

Benefits of technology

[0030]本说明书中至少一个实施例能够达到以下有益效果:通过目标数据对应的编码长度确定对应的二维码模板,基于二维码模板、目标数据以及第一数量的掩码图案生成多个二维码图像,将多个二维码图像与待拟合艺术图像进行融合,得到多个艺术二维码图像,多各个艺术二维码图像进行评分,输出评分最高的艺术二维码图像。以便用户可以得到可用性较高的艺术二维码图像,满足业务需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117172267B_ABST
    Figure CN117172267B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification disclose a method, device, equipment and medium for generating an artistic two-dimensional code. The method can include: obtaining target data for carrying in a two-dimensional code image; determining a two-dimensional code template according to the length of the encoding data corresponding to the target data; processing an initial two-dimensional code image for the target data generated based on the two-dimensional code template according to a first number of mask patterns to obtain a plurality of two-dimensional code images; the first number of mask patterns includes a plurality of different mask patterns; fusing the plurality of two-dimensional code images with to-be-fitted artistic images respectively to obtain a plurality of artistic two-dimensional code images; performing availability evaluation on the plurality of artistic two-dimensional code images by using a preset availability evaluation rule to obtain an evaluation score corresponding to each artistic two-dimensional code image; and outputting an artistic two-dimensional code image with the highest evaluation score.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer data processing technology, and in particular to a method, apparatus, device and medium for generating artistic QR codes. Background Technology

[0002] With the development of computer technology, QR code styles have become more diverse, and artistic QR codes have gained increasing attention online. Current artistic QR codes are mostly based on user-inputted QR code images and artistic images, using a pure AI (Artificial Intelligence) model to directly fuse the two images. However, this type of artistic QR code has uncertainties, and the generated artistic QR code may not meet business needs. Summary of the Invention

[0003] This specification provides a method, apparatus, device, and medium for generating artistic QR codes to address the uncertainty issues present in existing artistic QR code generation methods.

[0004] To solve the above-mentioned technical problems, the embodiments in this specification are implemented as follows:

[0005] This specification provides an embodiment of a method for generating artistic QR codes, including:

[0006] Acquire the target data to be carried in the QR code image;

[0007] The QR code template is determined based on the length of the encoded data corresponding to the target data;

[0008] The initial QR code image generated based on the QR code template for the target data is processed according to a first number of mask patterns to obtain multiple QR code images; the first number of mask patterns includes multiple different mask patterns;

[0009] The multiple QR code images are respectively fused with the artistic image to be fitted to obtain multiple artistic QR code images;

[0010] Using preset usability evaluation rules, the usability of the multiple art QR code images is evaluated to obtain the evaluation score corresponding to each art QR code image;

[0011] Output the art QR code image with the highest evaluation score.

[0012] This specification provides an embodiment of an apparatus for generating artistic QR codes, comprising:

[0013] Target data acquisition template, used to acquire target data to be carried in QR code images;

[0014] The QR code template determination module is used to determine the QR code template based on the length of the encoded data corresponding to the target data;

[0015] A mask processing module is used to process an initial QR code image generated based on the QR code template for the target data according to a first number of mask patterns, to obtain multiple QR code images; the first number of mask patterns includes multiple different mask patterns;

[0016] The fusion module is used to fuse the multiple QR code images with the art image to be fitted, respectively, to obtain multiple art QR code images;

[0017] The scoring module is used to evaluate the usability of the multiple art QR code images using preset usability evaluation rules, and obtain the evaluation score corresponding to each art QR code image.

[0018] The image output module is used to output the artistic QR code image with the highest evaluation score.

[0019] This specification provides an embodiment of a device for generating artistic QR codes, comprising:

[0020] At least one processor; and,

[0021] A memory communicatively connected to the at least one processor; wherein,

[0022] The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to:

[0023] Acquire the target data to be carried in the QR code image;

[0024] The QR code template is determined based on the length of the encoded data corresponding to the target data;

[0025] The initial QR code image generated based on the QR code template for the target data is processed according to a first number of mask patterns to obtain multiple QR code images; the first number of mask patterns includes multiple different mask patterns;

[0026] The multiple QR code images are respectively fused with the artistic image to be fitted to obtain multiple artistic QR code images;

[0027] Using preset usability evaluation rules, the usability of the multiple art QR code images is evaluated to obtain the evaluation score corresponding to each art QR code image;

[0028] Output the art QR code image with the highest evaluation score.

[0029] This specification provides an embodiment of a computer-readable medium storing computer-readable instructions that can be executed by a processor to implement a method for generating artistic QR codes.

[0030] At least one embodiment in this specification can achieve the following beneficial effects: A corresponding QR code template is determined based on the encoding length corresponding to the target data; multiple QR code images are generated based on the QR code template, the target data, and a first number of mask patterns; these multiple QR code images are fused with the artistic image to be fitted to obtain multiple artistic QR code images; each artistic QR code image is scored, and the artistic QR code image with the highest score is output. This allows users to obtain highly usable artistic QR code images to meet business needs. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a schematic diagram illustrating an application scenario of a method for generating artistic QR codes provided in the embodiments of this specification;

[0033] Figure 2 This is a flowchart illustrating a method for generating an artistic QR code provided in an embodiment of this specification;

[0034] Figure 3 This is a swimlane diagram of a method for generating an artistic QR code provided in the embodiments of this specification;

[0035] Figure 4 This is a schematic diagram of the structure of a device for generating artistic QR codes provided in the embodiments of this specification;

[0036] Figure 5 This is a schematic diagram of the structure of a device for generating artistic QR codes provided in the embodiments of this specification. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of one or more embodiments of this specification.

[0038] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0039] In current technology, with the development of computer technology, QR code styles have become more diversified, and the rise of artistic QR codes has gained increasing attention online. The medium of QR codes caters to both businesses' desire for personalized brand expression and users' need to attract traffic through the novelty of artistic codes. However, most existing artistic QR codes are based on user-inputted QR code images and artistic images, using pure AI (Artificial Intelligence) to simply merge the two images to generate an artistic QR code. This process introduces uncertainty, potentially resulting in artistic QR codes that differ significantly from business needs, such as low recognition probability or aesthetically unappealing artistic images.

[0040] To address the shortcomings of existing technologies, this solution provides the following embodiments. For ease of understanding, some concepts are explained below:

[0041] Mask: A mask can represent a string of binary code performing a bitwise AND operation on the target field to mask the current input bits; it can process data symbols and error correction symbols to avoid too many black or white blocks in the QR code. Existing technologies include eight different mask patterns.

[0042] Error correction level: The error correction level can represent the magnitude of the error tolerance rate. Different error correction levels have different ratios of the maximum area that can be obscured to the total area when the QR code can be scanned normally.

[0043] QR code mirroring: The QR code image is flipped horizontally or vertically so that the image after mirroring is visually symmetrical from left to right or top to bottom compared to the original image.

[0044] QR code rotation: Rotate the QR code image at a certain angle, such as clockwise or counterclockwise, such as 30 degrees, 45 degrees, 90 degrees, 180 degrees, etc.

[0045] QR code version: The QR code version can represent the base image used to generate the QR code. Different QR code templates have different data capacities. The higher the version, the larger the data capacity. The existing QR code versions can include forty different versions with different data capacities.

[0046] Style Transfer: Given a style image, convert any image to this style while preserving as much of the content of the original image as possible.

[0047] Figure 1 This is a schematic diagram illustrating an application scenario of a method for generating artistic QR codes in the embodiments of this specification.

[0048] like Figure 1 As shown, the scheme mainly includes: target data 1, artistic images to be merged 2, server 3, and target artistic QR code image 4. Target data 1 can be a URL, link, or characters to be recognized, representing the content carried in the QR code, which can be parsed and recognized after the QR code is scanned. Server 3 can select a suitable QR code template based on the length of target data 1. The data capacity of the QR code template needs to be greater than the encoded data length of the target data. The error correction level in the QR code template can be user-set or selected by server 3 based on the intended use of the target data. Server 3 can fill the QR code template with data based on the target data to obtain an initial QR code image. Based on the initial QR code image, it can perform masking, mirroring, and other processing, resulting in multiple QR code images for the same target data. Server 3 can merge the various QR code images based on the obtained artistic images to be merged 2 to obtain multiple artistic QR code images. Using a preset scoring rule, each artistic QR code image is scored for usability. The artistic QR code image with the highest score is output as the target artistic QR code image 4, thus obtaining an artistic QR code image with high usability.

[0049] Next, a method for generating artistic QR codes provided in the embodiments of the specification will be described in detail with reference to the accompanying drawings:

[0050] Figure 2 This is a flowchart illustrating a method for generating artistic QR codes provided in an embodiment of this specification. From a programming perspective, the entity executing the process can be a program hosted on an application server or an application client.

[0051] like Figure 2 As shown, the process may include the following steps:

[0052] Step 202: Obtain the target data to be carried in the QR code image.

[0053] In the embodiments of this specification, the target data may contain at least one of the following characters: uppercase letters, lowercase letters, numbers, Chinese characters, and special characters. The target data may be a string of characters that performs functions such as payment, receipt of payment, information retrieval, website redirection, and activity push notifications. Specifically, the target data may be a URL, a link, or characters that need to be recognized. The server can process the character data in the target data and fill the processed result into a QR code image so that users can complete the corresponding functions when scanning the QR code image.

[0054] Step 204: Determine the QR code template based on the length of the encoded data corresponding to the target data.

[0055] In this embodiment, the server can encode the target data based on preset rules to obtain the encoded data length corresponding to the target data. The QR code template can include forty different versions, each with a different data capacity; higher-version QR code templates have larger data capacities. For example, version 1 is a 21x21 matrix, version 2 is a 25x25 matrix, and version 40 is a 177x177 matrix. Based on the data capacity of each version, the server can select a QR code template that can accommodate the encoded data length corresponding to the target data, thereby determining the QR code template used to generate the subsequent artistic QR code.

[0056] Step 206: Process the initial QR code image generated based on the QR code template for the target data according to the first number of mask patterns to obtain multiple QR code images; the first number of mask patterns includes multiple different mask patterns.

[0057] In the embodiments of this specification, the mask pattern can be an existing QR code mask pattern. The first quantity can represent a quantity greater than 1, such as 3, 4, 5, etc. The initial QR code image can represent an image obtained by filling the QR code template with the encoded binary stream obtained based on the target data. The server can perform masking processing on the initial QR code image based on each mask image to obtain multiple QR code images.

[0058] Step 208: Fuse the multiple QR code images with the artistic image to be fitted to obtain multiple artistic QR code images.

[0059] In the embodiments of this specification, the artistic image to be fitted can be an image or some descriptive information. The user can select the images to be fused and provide some feature description information. The AI ​​image generation model generates the image based on the feature information. The server can use a preset image fusion method to fuse the various QR code images with the artistic image to be fused. For example, an existing AI model can be used to fuse the various QR code images with the artistic image to be fitted, outputting multiple artistic QR code images. Existing AI models can include one of the following models for infrared and visible light image fusion: supervised model, unsupervised / self-supervised model, GAN, saliency model, transformer / self-attention, task-driven, fusion model at different resolutions, guided filter-assisted model, etc. The artistic QR code image can contain some or all of the features of the artistic image to be fitted and can be successfully recognized. The artistic QR code image can be a static image or a dynamic image. Other fusion methods can also be used, which are not specifically limited here.

[0060] Step 210: Using preset usability evaluation rules, perform usability evaluation on the multiple art QR code images to obtain the evaluation score corresponding to each art QR code image.

[0061] The pre-defined usability evaluation rules in the embodiments of this specification can represent rules for evaluating the usability of artistic QR code images. Usability can include aspects such as recognition rate and aesthetics. For example, it can represent comparing the features contained in the artistic QR code with the features contained in the artistic image to be fitted, and obtaining an evaluation score for each artistic QR code image based on the degree of feature inclusion. It can also represent evaluating each artistic QR code based on its aesthetics. Furthermore, it can represent comparing the data sequence contained in the artistic QR code image with the data sequence used when generating the artistic QR code, and evaluating each artistic QR code based on the content of abnormal data, and so on.

[0062] Step 212: Output the art QR code image with the highest evaluation score.

[0063] In the embodiments described in this specification, the various art QR code images can be sorted according to their evaluation scores, and the art QR code image with the highest evaluation score can be output. In practical applications, the art QR code image with the highest evaluation score can be output, or multiple art QR code images with the highest evaluation scores can be output. For example, multiple art QR code images with evaluation scores higher than a preset threshold can be output. The specific number of art QR code images output is not limited here.

[0064] In practical applications, when scoring multiple art QR code images, they can be scored in a pre-set order. The bubble sort method can be used to determine and output the art QR code image with the highest evaluation score. If all art QR codes are evaluated at once, the images can be arranged in descending order of evaluation score, and the top-ranked image can be output, thus providing the most usable art QR code.

[0065] It should be understood that the order of some steps in the methods described in one or more embodiments of this specification may be interchanged according to actual needs, or some steps may be omitted or deleted.

[0066] Figure 2 The method described above determines the corresponding QR code template based on the encoding length of the target data. Multiple QR code images are generated based on the QR code template, the target data, and a first number of mask patterns. These multiple QR code images are then fused with the artistic image to be fitted, resulting in multiple artistic QR code images. Each artistic QR code image is scored, and the artistic QR code image with the highest score is output. This allows users to obtain highly usable artistic QR code images that meet their business needs.

[0067] based on Figure 2 In addition to the method described herein, this specification also provides some specific implementation schemes of the method, which will be described below.

[0068] To improve the quality of the output artistic QR codes, the QR code image can be mirrored to obtain more artistic QR codes for filtering. Optionally, the method described in the embodiments of this specification may further include:

[0069] The initial QR code image is mirrored to obtain a mirrored initial QR code image;

[0070] The mirrored initial QR code image is processed according to a second number of mask patterns to obtain several mirrored QR code images; the second number of mask patterns includes one or more different mask patterns;

[0071] The step of fitting the plurality of QR code images to the art image to be fitted specifically includes:

[0072] The plurality of QR code images and the plurality of mirrored QR code images are respectively fitted to the artistic image to be fitted.

[0073] In the embodiments of this specification, the initial QR code image can be processed according to existing mirroring methods. The second quantity can be greater than or equal to 1, and can be the same as or different from the first quantity. The mask pattern of the second quantity can be selected from the mask patterns of the first quantity, or it can be selected from all existing mask patterns. In the embodiments of this specification, the mirrored and unmirrored QR code images can be processed separately with the artistic image to be merged to obtain a larger number of artistic QR code images to be evaluated.

[0074] In practical applications, masking can be performed first, followed by mirroring. Specifically, some or all of the QR code images obtained from the initial QR code image of the target data generated based on the QR code template according to the first number of mask patterns can be mirrored.

[0075] As a method for expanding the QR code base, the embodiments of this specification can also obtain multiple code images by rotating the QR code image, which is more conducive to generating artistic QR code images with high usability. Optionally, the method in the embodiments of this specification may also include:

[0076] The initial QR code image is rotated to obtain a rotated initial QR code image;

[0077] The rotated initial QR code image is processed according to a third number of mask patterns to obtain several rotated QR code images; the third number of mask patterns includes one or more different mask patterns;

[0078] The step of fitting the plurality of QR code images to the art image to be fitted specifically includes:

[0079] The plurality of QR code images and the plurality of rotated QR code images are respectively fitted to the artistic image to be fitted.

[0080] This feature allows for image rotation according to preset rules, which can include information such as rotation angle and direction. For example, an initial QR code image can be rotated according to a preset rotation direction and angle. For a given initial QR code image to be rotated, it can be rotated once or multiple times in a preset unit rotation angle and preset rotation direction. For instance, it can rotate in 45-degree units; one rotation is equivalent to rotating the QR code by 45 degrees, two rotations are equivalent to rotating the QR code by 90 degrees, and so on. Alternatively, a rotation angle can be set for a single rotation, such as setting the rotation angle to 30 degrees, which rotates the image 30 degrees clockwise.

[0081] One or more rotated QR code images can be generated from a single initial QR code image. If there are multiple initial QR code images, rotation can be applied to portions of them, and different rotation rules can be used to process the same or different initial QR code images. No specific limitations are specified here.

[0082] In practical applications, there may be multiple QR code templates capable of accommodating target data. As one implementation method, in this embodiment, multiple different QR code templates can be selected to process the data, resulting in multiple initial QR code images. This provides greater flexibility in selecting artistic QR code images that meet business requirements. Optionally, the QR code templates described in this embodiment include multiple QR code templates with a capacity greater than the length of the encoded data corresponding to the target data.

[0083] The process of processing the initial QR code image for the target data generated based on the QR code template according to the first number of mask patterns specifically includes:

[0084] For any QR code template among the plurality of QR code templates, an initial QR code image for the target data is generated based on the arbitrary QR code template according to a first number of mask patterns.

[0085] A QR code template can include information such as the QR code version and error correction level. The error correction level can be selected by the user or determined by the server based on factors such as the intended use of the target data. In practical applications, the data capacity of each QR code version and its corresponding error correction level is known, and a QR code template larger than the encoded data length of the target data can be selected.

[0086] In practical applications, a preset number of QR code templates capable of accommodating the encoded data corresponding to the target data can be randomly selected; alternatively, a preset number of QR code templates capable of accommodating the encoded data corresponding to the target data can be selected in ascending order of QR code version. Alternatively, QR code templates can be selected based on the application scenario or function of the artistic QR code image. For example, if the scenario is an artistic QR code used for payment, prioritizing recognition rate, one or more lower-version QR code versions capable of accommodating the encoded data corresponding to the target data can be selected; if the scenario is an artistic QR code used for promotion, prioritizing aesthetics, one or more higher-version QR code versions capable of accommodating the encoded data corresponding to the target data can be selected.

[0087] In practical applications, once the QR code template and the corresponding encoded data of the target data are determined, the initial QR code image can be fixed. In the embodiments of this specification, multiple initial QR code images based on different QR code templates are obtained. Each different initial QR code image is then masked to obtain several QR code images. It can be understood that when there are M QR code templates and N mask patterns, N*M QR code images can be obtained.

[0088] Optionally, the multiple QR code templates described in the embodiments of this specification may include different versions of QR code templates and / or QR code templates with different error correction levels.

[0089] The error correction level of a QR code can include four levels: H, Q, M, and L. In the embodiments of this specification, different versions of QR code templates can include multiple QR code templates with the same error correction level but different QR code versions. For example, there are two different versions of QR code templates: QR code template 1 has a QR code version 10 and an error correction level of H; QR code template 2 has a QR code version 15 and also an error correction level of H. Different versions of QR code templates can also include multiple QR code templates with different error correction levels but the same QR code version. For example, QR code template 1 has a QR code version 10 and an error correction level of H; QR code template 3 has a QR code version 10 and an error correction level of L. This allows for various combinations of QR code templates, resulting in multiple different artistic QR codes, making the output artistic QR codes more suitable for business needs.

[0090] In practical applications, the higher the QR code version, the larger the data capacity; the higher the error correction level of the QR code, the larger the amount of data contained in the error correction code, and the smaller the amount of other data that can be filled in. If the user does not set an error correction level, the server can determine the error correction level of the QR code based on the user's needs and the purpose of the QR code. Understandably, the higher the error correction level, the lower the requirement for successful QR code recognition. If the user sets an error correction level, processing can be performed according to the user's specified error correction level.

[0091] In the embodiments of this specification, a suitable encoding method can be selected according to the character type of the target data so that the generated encoded data meets the requirements. Optionally, the method described in the embodiments of this specification may further include:

[0092] The encoding method is determined based on the character types contained in the target data;

[0093] The target data is encoded according to the encoding method to obtain the encoded data.

[0094] The target data may contain at least one character type, including uppercase letters, lowercase letters, numbers, and special symbols. Encoding methods may include Numeric mode, Alphanumeric mode, Byte mode, and Kanji mode. Different encoding methods can encode different character types, and the number of bits occupied by a single character also varies. For example, Numeric mode can only encode numbers and cannot encode other character types, but each character occupies 3.3 bits, making it the shortest encoding method among those mentioned. In the embodiments of this specification, the encoding method that minimizes the length of the resulting encoded data can be selected based on the character types contained in the target data.

[0095] In the embodiments of this specification, the target data can be encoded using various encoding methods, and then the shortest encoding result is selected as the encoding used to generate the QR code image. Furthermore, when the encoding length corresponding to the target data is short, a lower version of the QR code can be selected to improve the recognition rate.

[0096] Optionally, in the embodiments of this specification, the method may further include:

[0097] The target data is encoded using multiple encoding methods to obtain several alternative encoded data;

[0098] The shortest encoded data is selected from the plurality of candidate encoded data as the encoded data corresponding to the target data.

[0099] Different encoding methods can result in different bit lengths of encoded data for the same character. In the embodiments of this specification, the data lengths of the candidate encoded data obtained using different encoding methods can be different. The data length represents the number of binary data contained in the encoded data, allowing the determination of the shortest encoded data as the target data used when generating the QR code image. This reduces the proportion of binary data corresponding to the target data in the QR code template, mitigating the impact on the target data when the QR code image is fused with the artistic image to be fitted. Furthermore, the shortest encoding also facilitates the selection of a lower version of the QR code template, which helps improve the recognition rate.

[0100] The server can encode the target data using various encoding methods based on the character types in the target data, selecting the shortest encoded data. Taking the target data 01aaaED as an example, since Numeric mode and Alphanumeric mode cannot encode lowercase letters, the server cannot use either of these methods alone to encode target data containing lowercase letters. Instead, it can use Byte mode to encode the target data containing lowercase letters. Byte mode can be used alone to encode the target data, or at least one of Numeric mode and Alphanumeric mode can be combined with Byte mode to encode the target data, selecting the shortest encoded data from the options provided.

[0101] As one implementation method, optionally, encoding the target data in the embodiments of this specification may include:

[0102] If the target data contains numbers, the data is encoded using the first encoding rule;

[0103] If the target data contains uppercase letters, the uppercase letters are encoded using the second encoding rule.

[0104] The first encoding rule can represent the rules for encoding numbers, such as using the Numeric mode encoding method corresponding to the numeric number mode to encode numbers; the second encoding rule can represent the rules for encoding uppercase letters, such as using the Alphanumeric mode encoding method corresponding to the alphanumeric alphanumeric special character mode to encode uppercase letters.

[0105] In practical applications, if the target data contains lowercase letters, a third encoding rule can be used to encode them, such as the Byte mode encoding method corresponding to byte ASCII. If the target data contains multiple different character types, a fourth encoding rule can be used to encode each character. When the target data contains multiple different types of character data, a mixed encoding mode can be used. The mixed encoding mode can be determined based on the correspondence between the character types in the target data and the encoding length. For example, if the target data is H: / 3.M, based on the correspondence between character types and encoding length, the Numeric mode encoding method has the shortest encoding length for numbers, and the Alphanumeric mode encoding method has the shortest encoding length for uppercase letters and special symbols. Therefore, a numeric-character mixed encoding mode can be selected to minimize the encoding length after encoding H: / 3.M.

[0106] In practical applications, different encoding rules can be selected to encode the target data based on the character type. For example, byte mode can be used alone for encoding, or other encoding methods can be obtained, and then the encoding result that meets the user's needs can be selected for subsequent processing. In practical applications, since the encoded result obtained by byte mode is usually longer than that obtained by other modes, such as the hybrid encoding method mentioned above, it is not recommended to use byte mode for data that can be processed by other encoding methods. Of course, the encoding method can also be determined according to actual needs.

[0107] As one implementation method, optionally, the various encoding methods described in the embodiments of this specification may include encoding methods that use a single encoding mode and / or encoding methods that use a mixed encoding mode.

[0108] In the embodiments of this specification, a single encoding mode can represent an encoding method that uses one encoding method to encode the target data; a mixed encoding mode can represent an encoding method that uses at least two encoding methods to encode the target data. For example, if the target data is 10Aa, it can be encoded using the Byte mode encoding method corresponding to the single encoding mode to obtain the encoded data; alternatively, it can be encoded using the Numeric mode, Alphanumeric mode, and Byte mode encoding methods corresponding to the mixed encoding mode to encode the numeric characters, uppercase letters, and lowercase letters in the target data respectively to obtain the encoded data corresponding to the target data.

[0109] The specific encoding mode used in the embodiments of this specification can be determined based on the length of the number of bits corresponding to a character in various encoding methods, as well as the character types that each encoding method can encode. Regardless of whether a single encoding mode or a hybrid encoding mode is used, the main purpose is to reduce the number of bits occupied by the target data in the QR code template and improve the QR code recognition rate.

[0110] As one implementation method, the art QR code can be evaluated based on abnormal binarized values ​​present in the art QR code image. Optionally, in the embodiments of this specification, a preset usability evaluation rule is used to perform usability evaluation on the plurality of art QR code images, which may specifically include:

[0111] For any one of the plurality of art QR code images, obtain the binarized values ​​of several sampling points in the any one art QR code image;

[0112] Based on the binarized values ​​of the plurality of sampling points, abnormal sampling points are identified among the plurality of sampling points; the binarized values ​​of the abnormal sampling points are inconsistent with the preset binarized values; the preset binarized values ​​are the binarized values ​​in the encoded data stream used to generate the initial QR code image;

[0113] Based on the number of abnormal sampling points, the recognizability of each art QR code image is evaluated.

[0114] In the embodiments of this specification, sampling points can represent a matrix based on the QR code template used to generate the artistic QR code. Dividing the QR code template into unit rectangles results in sampling locations that can be used as sample data to verify whether the artistic QR code image meets the requirements. Binarized values ​​can be obtained by binarizing the artistic QR code. Preset binarized values ​​can represent the binarized values ​​filled into each unit rectangle during the generation of the artistic QR code image. Abnormal sampling points can represent sampling points whose corresponding binarized values ​​differ from those filled during the generation of the artistic QR code. The encoded data stream can represent a string of binary data obtained by arranging the binarized values ​​corresponding to each unit rectangle in the initial QR code image according to the filling order. The recognizability evaluation can represent the proportion of abnormal sampling points in the total sampling points, and the artistic QR code image can be scored based on this proportion. For example, if there are 200 sampling points and 4 abnormal sampling points, the proportion can be 2%, then the artistic QR code image can be evaluated as 98 points.

[0115] To make the binarized values ​​corresponding to the sampling points more accurate, the method described in the embodiments of this specification may optionally include:

[0116] Binarize any of the aforementioned art QR code images to obtain a binarized image;

[0117] Obtain several sampling points from the binarized image; each sampling point corresponds to a unit rectangle in the QR code template;

[0118] Determine the binarized value of each sampling point in the binarized image.

[0119] The binarization process for the artistic QR code in this embodiment can be as follows: The artistic QR code is processed into grayscale to obtain a grayscale artistic QR code image; the mask pattern contained in the grayscale artistic QR code is removed to obtain a first QR code image; it can be determined whether the artistic QR code image has undergone mirroring; if the artistic QR code image has undergone mirroring, the first QR code image can be reverse-mirrorized to obtain a second QR code image; the binarization value corresponding to each unit rectangle in the second QR code image can be determined based on the brightness of each unit rectangle to obtain a binarized image containing the binarization value.

[0120] As one implementation method, the aesthetics of the artistic QR code images can also be evaluated. Optionally, in the embodiments of this specification, a preset usability evaluation rule is used to evaluate the usability of the plurality of artistic QR code images, which may specifically include:

[0121] We use a pre-trained beautification evaluation model to evaluate each artistic QR code image.

[0122] The aesthetic evaluation model in the embodiments of this specification can be obtained by training an existing model using labeled samples. Labeling can be done manually or by a model, and the existing model can include classification models, image recognition models, etc. In practical applications, scores can also be calculated based on the features of the image contained in the artistic QR code and the weights of those features. Alternatively, the positional relationship between each feature and the artistic QR code can be used to determine whether the artistic QR code contains key features, thus determining the score. Scores can also be based on the clarity and completeness of each feature, etc.

[0123] In practical applications, the server can perform a weighted summation based on methods such as aesthetic evaluation, recognizability evaluation, and feature evaluation to obtain a total evaluation score. The artistic QR code image with the highest comprehensive score can be selected as the target artistic QR code image. For example, using recognizability and aesthetic evaluation to comprehensively evaluate the artistic QR code, the weight of recognizability evaluation can be 0.7, and the weight of aesthetic evaluation can be 0.3. Artistic QR code image 1 has a recognizability evaluation score of 98 and an aesthetic evaluation score of 95, resulting in a total score of 97.1; artistic QR code image 2 has a recognizability evaluation score of 90 and an aesthetic evaluation score of 99, resulting in a total score of 92.7. If the output artistic QR code image has the highest score, artistic QR code image 1 can be output; if the output artistic QR code image has a score greater than or equal to the threshold score of 90, both artistic QR code image 1 and artistic QR code image 2 can be output.

[0124] To ensure that the generated artistic QR code image better reflects the characteristics of the artistic image and improves the success rate of recognizing the artistic QR code image, the initial QR code image generation method described in the embodiments of this specification may optionally include:

[0125] Obtain a first region image from the art image to be merged that corresponds to the filled region in the QR code template; the filled region is the area in the QR code template used to place the fill characters in the encoded data stream.

[0126] Based on the binarized sequence value corresponding to the first region image, the padding data sequence in the padding bit region of the encoded data stream corresponding to the QR code template is generated;

[0127] The initial QR code image is generated based on the encoded data corresponding to the target data and the filling data sequence.

[0128] In the embodiments of this specification, the filling area can represent the padding characters in the encoded data stream, also known as filler characters, filler codes, etc., and is a positional area in the QR code template. It can be clustered or discretely distributed. Clustered distribution can be understood as the display positions of each character in the template being adjacent, continuous, or the number of consecutive adjacent characters being greater than a preset number, with most characters clustered together. Discrete distribution can be understood as the display positions of each character in the template being scattered, with most characters not clustered together, or as the number of consecutive adjacent characters being relatively small. The first region image can be a set of sub-images corresponding to the unit rectangles of the filling area in the art image to be merged, after adjusting the QR code template and the art image to be merged to the same size.

[0129] In the embodiments of this specification, the binarized sequence value can represent the data obtained after binarizing each sub-image in the first region image of the art image to be merged. Specifically, the first region image can be first processed into grayscale, and the binarized data of each sub-image can be determined based on the relationship between the grayscale value of each sub-image after grayscale processing and a preset grayscale threshold. In practical applications, the sorting position of each binarized character in the binarized sequence value in the filling data sequence can be determined based on the filling order of the QR code, so that the QR code image generated using the coded data stream containing the filling data sequence can present the first region image or image features of the art image to be merged.

[0130] In practical applications, existing techniques for processing the filling area can also be used to fill the filling area in the QR code template. For example, repeating 1110110000010001 can yield a repeating data sequence with the same length as the filling area to be filled, which can then be used as the data sequence for the filling area.

[0131] To reduce data interference caused by the mask to the filled area of ​​the data sequence corresponding to the already filled first region image, optionally, in this embodiment of the specification, the initial QR code image generated based on the QR code template for the target data is processed according to a first number of mask patterns, specifically including:

[0132] The regions in the initial QR code image other than the filled region are processed according to a first number of mask patterns.

[0133] In the embodiments of this specification, other areas may include the areas in the QR code template used for filling target data, error correction codes, 8-bit padding codes, etc. They can be processed using existing methods for adding mask patterns, such as XORing the binarized data of the mask pattern with the binarized data of the initial QR code image to obtain the binarized data corresponding to each unit rectangle in other areas. This reduces the number of overly dense black or white areas in the QR code image, improving its aesthetics.

[0134] To ensure the generated artistic QR code image possesses more features of the artistic image to be integrated, thereby improving its aesthetics and meeting business requirements, the embodiment of this specification may optionally include the following: [Details of the fusion process are needed for the original document.]

[0135] For at least one of the plurality of QR code images, the at least one QR code image is merged with a second region image of the art image to be merged, wherein the second region image is an image in the art image to be merged other than the first region image.

[0136] In the embodiments of this specification, existing AI models can be used to perform image fusion on images of other regions and the second region. When using the AI ​​model for fusion, the fusion region can be set. For example, the initial QR code image and the artistic image to be fused can be used as inputs to the model, and other regions in the initial QR code image and their corresponding regions in the artistic image to be fused can be set as fusion regions. This allows the AI ​​model to process based on the set regions and output an artistic QR code image. Alternatively, before performing AI model fusion, the initial QR code can be extracted to obtain images of other regions; the corresponding regions in the artistic image to be fused can also be extracted. The extracted images of other regions and their corresponding regions can be used as inputs to the AI ​​model to obtain a region fusion image output by the AI ​​model. Then, the region fusion image can be overlaid on the other regions in the initial QR code to obtain the artistic QR code image.

[0137] As one implementation method, optionally, the method described in the embodiments of this specification may further include:

[0138] The first region image is overlaid onto the filled area of ​​the initial QR code image.

[0139] In the embodiments of this specification, the first region image can be overlaid on the filling area before the QR code image and the second region image of the art image to be merged are merged; alternatively, the first region image can be overlaid on the filling area after the QR code image and the second region image of the art image to be merged are merged, but before the art QR code image is generated, so as to ensure the aesthetics of the art QR code image without affecting the recognition of the art QR code.

[0140] To more clearly illustrate the method for generating artistic QR codes provided in the embodiments of this specification, Figure 3 This is a swimlane diagram of a method for generating artistic QR codes provided in the embodiments of this specification. For example... Figure 3 As shown, the method may include a template acquisition stage, a data preprocessing stage, and an art QR code generation stage, specifically including:

[0141] Step 302: The user enters the target data on the terminal.

[0142] The target data in the embodiments of this specification may include at least one of the following: URLs, links, or strings of characters that need to be identified. The terminal may include at least a user interface for operation. Users can input target data in the user interface and also select the error correction level. The error correction level is not a mandatory option in the user interface; the server can later set a suitable error correction level based on the QR code template and the security level of the information.

[0143] Step 304: The server obtains the target data, encodes the target data, and obtains the data encoding.

[0144] The target data can be encoded using the above-mentioned encoding methods, either as a single encoding or a hybrid encoding, to obtain multiple different data sequences. The shortest data sequence can be used as the data code. Alternatively, the target data can be encoded according to a user-specified encoding method to obtain the data code.

[0145] Step 306: Based on the encoded data, the server determines M target QR code templates that can carry the data encoding.

[0146] In the embodiments of this specification, the determination of the QR code template can be based on the data capacity of each version of the QR code template and the length of the encoded data of the target data. If the user sets an error correction level, a QR code template that can accommodate the encoded data can also be determined based on the length of the encoded data and the error correction level. The M QR code templates may include templates with the same version but different error correction levels, templates with different versions but the same error correction level, and templates with different versions but different error correction levels, etc.

[0147] Step 308: The server generates M initial QR code images based on M target QR code templates.

[0148] In practical applications, based on the filling requirements of each QR code template and the corresponding encoded data of the target data, the binary encoded stream of each QR code template can be obtained. The binary encoded stream can then be filled into the corresponding QR code template in the filling order to obtain the initial QR code image.

[0149] Step 310: The server can mirror each initial QR code image to obtain Y mirrored initial QR code images.

[0150] In the embodiments described in this specification, existing mirroring methods can be used to mirror part or all of the initial QR code image. Y can be a value less than or equal to M.

[0151] Step 312: For each of the M initial QR code images and Y mirrored initial QR code images, select N target mask patterns from the preset mask patterns.

[0152] The target mask pattern selected in the embodiments of this specification can be an existing mask pattern or a custom mask pattern; no specific limitation is made here.

[0153] Step 314: Perform masking processing on each initial QR code image and the mirrored initial QR code image according to the N target mask patterns to obtain K QR code images.

[0154] In the embodiments of this specification, each unmirrored initial QR code image can be processed based on the target mask pattern to obtain M x N QR code images; or each mirrored initial QR code image can be processed based on the target mask pattern to obtain Y x N QR code images, where K can be the sum of the two. It is understood that the first part of the N mask patterns can be selected to process the initial QR code image, and the second part of the N mask patterns can be selected to process the mirrored initial QR code image; the first and second parts of the patterns may overlap. If the filling area in the initial QR code image is filled with existing repeatable data, masking can be performed on the entire initial QR code image and the mirrored initial QR code image; if the filling area in the initial QR code image is filled with the data sequence after binarization of the first region image in the art image to be merged, masking can be performed on the other regions outside the filling area.

[0155] In practical applications, the obtained QR code image can also be rotated. This can be done on the initial QR code image, on a mirrored QR code, or on a QR code image after masking. The processing order of these methods—masking, mirroring, and rotation—can be set according to actual needs. For example, the QR code image can be processed in the order of mirroring, rotation, and masking, or vice versa, etc. No specific limitation is made here. Multiple processing methods can be selected for a single QR code image, or only one method can be chosen; this can also be set according to actual needs and is not specifically limited here.

[0156] Step 316: Users can select the art image to be merged or enter descriptive information on the terminal.

[0157] In the embodiments of this specification, the terminal may include at least an interface for users to select artistic images. This interface may be the same as or different from the interface for users to input target data. Users can select or input descriptive tags for the artistic images to be merged, such as people, animals, and landscapes, in the artistic image selection interface. An AI model can be used to generate the artistic images to be merged based on these descriptive tags. Users can also select images from a preset image library displayed in the artistic image selection interface as the artistic images to be merged. It is understood that the artistic images to be merged can be dynamic or static images.

[0158] Step 318: The server obtains the art image to be merged, fits the QR code image to the art image to be merged, and obtains the art QR code image.

[0159] In the embodiments of this specification, if the filling region in the QR code image is filled using the data sequence after binarization of the first region image in the art image to be merged, a second region image corresponding to other regions in the QR code image can be determined in the art image to be merged. Based on an existing AI model, the second region image and other regions in the QR code image are fitted to obtain the art QR code image. If the filling region in the initial QR code image is filled using existing repeatable data, the QR code image and the art image to be merged can be fitted based on an existing AI model.

[0160] Step 320: The server uses preset scoring rules to score the art QR code image.

[0161] In the embodiments of this specification, the preset scoring rules can be at least one of the following: scoring the aesthetics of the art QR code image, scoring the proportion of abnormal data in the art QR code image, or scoring the similarity between the features in the art QR code image and the features of the art image to be fused. Alternatively, multiple scoring methods can be used to calculate the score of each art QR code image by weighted summation.

[0162] Step 322: The server outputs the highest-rated artistic QR code image.

[0163] In the embodiments of this specification, the artistic QR code images can be arranged according to their scores, and the artistic QR code image with the highest score can be selected as the target artistic QR code image that meets the business requirements, or the artistic QR code image with a score higher than a threshold score can be selected as the target artistic QR code image.

[0164] Step 324: The terminal displays the target art QR code image.

[0165] In the embodiments of this specification, the terminal can display an artistic QR code image on the display interface. The display interface can show one or more artistic QR code images. If multiple artistic QR code images are displayed, the user can select one according to their needs. The user can choose to save the artistic QR code image as a picture on the display interface; they can also choose to transmit or share the artistic QR code image to a target object; the display interface may contain a print control so that the user can choose to print a paper version of the artistic QR code image.

[0166] The above method can generate multiple artistic QR code images, from which the artistic QR code image that meets business needs can be selected, thereby improving the aesthetics of the artistic QR code image and the success rate of recognition.

[0167] Based on the same idea, embodiments of this specification also provide apparatus corresponding to the above methods. Figure 4 This is a schematic diagram of a device for generating artistic QR codes, provided as an embodiment of this specification. Figure 4 As shown, the device may include:

[0168] The target data acquisition module 402 is used to acquire target data to be carried in the QR code image;

[0169] The QR code template determination module 404 is used to determine the QR code template based on the length of the encoded data corresponding to the target data;

[0170] The mask processing module 406 is used to process the initial QR code image generated based on the QR code template for the target data according to a first number of mask patterns to obtain multiple QR code images; the first number of mask patterns includes multiple different mask patterns.

[0171] The fusion module 408 is used to fuse the multiple QR code images with the art image to be fitted, respectively, to obtain multiple art QR code images;

[0172] The scoring module 410 is used to evaluate the usability of the plurality of art QR code images using preset usability evaluation rules, and obtain the evaluation score corresponding to each art QR code image.

[0173] Image output module 412 is used to output the art QR code image with the highest evaluation score.

[0174] Based on the same idea, this specification also provides devices corresponding to the above methods in its embodiments.

[0175] Figure 5 This is a schematic diagram of a device for generating artistic QR codes, provided as an embodiment of this specification. Figure 5 As shown, device 500 may include:

[0176] At least one processor 510; and,

[0177] Memory 530 communicatively connected to the at least one processor; wherein,

[0178] The memory 530 stores instructions 520 that can be executed by the at least one processor 510, the instructions being executed by the at least one processor 510 to enable the at least one processor 510 to:

[0179] Acquire the target data to be carried in the QR code image;

[0180] The QR code template is determined based on the length of the encoded data corresponding to the target data;

[0181] The initial QR code image generated based on the QR code template for the target data is processed according to a first number of mask patterns to obtain multiple QR code images; the first number of mask patterns includes multiple different mask patterns;

[0182] The multiple QR code images are respectively fused with the artistic image to be fitted to obtain multiple artistic QR code images;

[0183] Using preset usability evaluation rules, the usability of the multiple art QR code images is evaluated to obtain the evaluation score corresponding to each art QR code image;

[0184] Output the art QR code image with the highest evaluation score.

[0185] Following the same approach, embodiments of this specification also provide a computer-readable medium corresponding to the above method. The computer-readable medium stores computer-readable instructions, which can be executed by a processor to implement the above method for generating artistic QR codes.

[0186] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, for... Figure 5 As the device shown is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0187] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0188] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, ASICs, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0189] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0190] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0191] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0192] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0193] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0194] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0195] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0196] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0197] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0198] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0199] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0200] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0201] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for generating an art QR code, comprising: Acquire the target data to be carried in the QR code image; The QR code template is determined based on the length of the encoded data corresponding to the target data; The initial QR code image generated based on the QR code template for the target data is processed according to a first number of mask patterns to obtain multiple QR code images; the first number of mask patterns includes multiple different mask patterns; The multiple QR code images are respectively fused with the artistic image to be fitted to obtain multiple artistic QR code images; Using preset usability evaluation rules, the usability of the multiple art QR code images is evaluated to obtain the evaluation score corresponding to each art QR code image; Output the art QR code image with the highest evaluation score.

2. The method according to claim 1, further comprising: The initial QR code image is mirrored to obtain a mirrored initial QR code image; The mirrored initial QR code image is processed according to a second number of mask patterns to obtain several mirrored QR code images; the second number of mask patterns includes one or more different mask patterns; The step of fitting the plurality of QR code images to the art image to be fitted specifically includes: The plurality of QR code images and the plurality of mirrored QR code images are respectively fitted to the artistic image to be fitted.

3. The method according to claim 1, wherein the QR code template comprises a plurality of QR code templates having a capacity greater than the length of the encoded data corresponding to the target data; The process of processing the initial QR code image for the target data generated based on the QR code template according to the first number of mask patterns specifically includes: For any QR code template among the plurality of QR code templates, an initial QR code image for the target data is generated based on the arbitrary QR code template according to a first number of mask patterns.

4. The method according to claim 3, wherein the plurality of QR code templates includes different versions of QR code templates and / or QR code templates with different error correction levels.

5. The method according to claim 1, further comprising: The encoding method is determined based on the character types contained in the target data; The target data is encoded according to the encoding method to obtain the encoded data.

6. The method according to claim 1, further comprising: The target data is encoded using multiple encoding methods to obtain several alternative encoded data; The shortest encoded data is selected from the plurality of candidate encoded data as the encoded data corresponding to the target data.

7. The method according to claim 5, further comprising: If the target data contains numbers, the data is encoded using the first encoding rule; If the target data contains uppercase letters, the uppercase letters are encoded using the second encoding rule.

8. The method according to claim 6, wherein the multiple encoding methods include encoding methods using a single encoding mode and / or encoding methods using a mixed encoding mode.

9. The method according to claim 1, wherein a usability assessment is performed on the plurality of artistic QR code images using a preset usability assessment rule, specifically including: For any one of the plurality of art QR code images, obtain the binarized values ​​of several sampling points in the any one art QR code image; Based on the binarized values ​​of the plurality of sampling points, abnormal sampling points are identified among the plurality of sampling points; the binarized values ​​of the abnormal sampling points are inconsistent with the preset binarized values; The preset binarization value is the binarization value in the encoded data stream used to generate the initial QR code image; Based on the number of abnormal sampling points, the recognizability of each art QR code image is evaluated.

10. The method according to claim 1, wherein a usability assessment is performed on the plurality of artistic QR code images using a preset usability assessment rule, specifically including: We use a pre-trained beautification evaluation model to evaluate each artistic QR code image.

11. The method according to claim 1, wherein the initial QR code image is generated in the following manner: Obtain the first region image in the art image to be fitted, which corresponds to the filled region in the QR code template; The filling area is the area in the QR code template used to place the filling characters in the encoded data stream; Based on the binarized sequence value corresponding to the first region image, the padding data sequence in the padding bit region of the encoded data stream corresponding to the QR code template is generated; The initial QR code image is generated based on the encoded data corresponding to the target data and the filling data sequence.

12. The method according to claim 11, wherein the initial QR code image generated based on the QR code template for the target data is processed according to a first number of mask patterns, specifically comprising: The regions in the initial QR code image other than the filled region are processed according to a first number of mask patterns.

13. The method according to claim 12, wherein fusing the plurality of QR code images with the artistic image to be fitted specifically includes: For at least one of the plurality of QR code images, the at least one QR code image is fused with a second region image of the art image to be fitted, wherein the second region image is an image in the art image to be fitted other than the first region image.

14. A device for generating art QR codes, comprising: The target data acquisition module is used to acquire the target data to be carried in the QR code image; The QR code template determination module is used to determine the QR code template based on the length of the encoded data corresponding to the target data; A mask processing module is used to process an initial QR code image generated based on the QR code template for the target data according to a first number of mask patterns, to obtain multiple QR code images; the first number of mask patterns includes multiple different mask patterns; The fusion module is used to fuse the multiple QR code images with the art image to be fitted, respectively, to obtain multiple art QR code images; The scoring module is used to evaluate the usability of the multiple art QR code images using preset usability evaluation rules, and obtain the evaluation score corresponding to each art QR code image. The image output module is used to output the artistic QR code image with the highest evaluation score.

15. A device for generating art QR codes, comprising: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: Acquire the target data to be carried in the QR code image; The QR code template is determined based on the length of the encoded data corresponding to the target data; The initial QR code image generated based on the QR code template for the target data is processed according to a first number of mask patterns to obtain multiple QR code images; the first number of mask patterns includes multiple different mask patterns; The multiple QR code images are respectively fused with the artistic image to be fitted to obtain multiple artistic QR code images; Using preset usability evaluation rules, the usability of the multiple art QR code images is evaluated to obtain the evaluation score corresponding to each art QR code image; Output the art QR code image with the highest evaluation score.

16. A computer-readable medium having stored thereon computer-readable instructions that can be executed by a processor to implement the method for generating an artistic QR code according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Generation method and device of artistic two-dimensional code fused with image

    CN106778995A

  • Method for beautifying QR (Quick Response) codes after fusing images

    CN108491747A