Two-dimensional code generation method, two-dimensional code reading method and related devices

By splitting the data to be transmitted on the electronic terminal and generating multiple QR code images, the problem of low-cost large data information transmission in the field of security attendance is solved, and efficient information transmission is achieved under low-cost conditions.

CN120087397APending Publication Date: 2025-06-03DONGGUAN ZKTECO ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411424243.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

The prior art cannot achieve low-cost and large-data information transmission at the same time, especially in the field of security attendance, it is difficult for low-precision camera equipment to effectively collect high-density QR code images.

Method used

By obtaining the data to be transmitted and the screen size data of the electronic terminal, the data carrying the QR code is determined, and the number of QR code splits is calculated according to the color block arrangement density, the data to be transmitted is split into multiple data fragments, multiple QR code images are generated, and displayed in a loop.

Benefits of technology

It realizes the transmission of large data information under low-cost conditions, and is suitable for security attendance and other fields, avoiding the high cost of replacing high-precision camera equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120087397A_ABST
    Figure CN120087397A_ABST
Patent Text Reader

Abstract

The invention provides a two-dimensional code generation method, a two-dimensional code reading method and related devices. In the two-dimensional code generation process, the two-dimensional code bearing data volume of a single two-dimensional code can be determined according to the screen size data of the electronic terminal and the preset color block arrangement density, the to-be-transmitted data with the large data volume is divided into N data fragments with the small data volume, and a two-dimensional code image is generated for each data fragment. The electronic terminal can circularly display the N two-dimensional code images according to a preset display refresh rate. Because the arrangement density of the color blocks of the single two-dimensional code image is predetermined according to the precision of the two-dimensional code acquisition equipment, even if the precision of the two-dimensional code acquisition equipment is low, each complete two-dimensional code image can be acquired, and the accuracy of the two-dimensional code image is improved. Therefore, the two-dimensional code reading device can obtain the to-be-transmitted data with a large data size according to the two-dimensional code images acquired by the two-dimensional code acquisition device. Therefore, low-cost and large-data-volume information transmission can be realized at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of graphic recognition code technology, and in particular to a two-dimensional code generation method, a two-dimensional code reading method and related devices. Background Art

[0002] Due to its advantages of large information capacity, strong fault tolerance and low cost, QR codes are widely used in many fields such as logistics management, document management, and information transmission. The QR code image is collected by a QR code collection device such as a camera, and the collected QR code image is detected and identified by a QR code reading device, so that the information carried by the QR code image can be obtained and information transmission can be realized. It can be understood that the greater the amount of information carried by the QR code image, the higher the density of its color block arrangement, the higher the accuracy required by the QR code collection device, and the higher the cost of the QR code collection device.

[0003] However, in the field of security attendance, camera equipment is generally not high-precision equipment. Therefore, low-density QR codes are often used for information transmission in the field of security attendance, and the amount of information transmitted is limited. If the amount of information transmitted is to be increased, the current camera equipment needs to be replaced with high-precision equipment that can capture high-density QR code images, which has the problem of high implementation cost.

[0004] It can be seen that the existing technology cannot achieve low cost and large amount of data transmission at the same time. Summary of the invention

[0005] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect that the prior art cannot simultaneously achieve low-cost and large-volume information transmission.

[0006] In a first aspect, an embodiment of the present application provides a method for generating a two-dimensional code, which is applied to an electronic terminal, and the method includes:

[0007] Acquire data to be transmitted and screen size data of the electronic terminal;

[0008] Determine the amount of data carried by the two-dimensional code according to the screen size data and the color block arrangement density; wherein the color block arrangement density is predetermined according to the accuracy of the two-dimensional code acquisition device;

[0009] Calculate the number of splits of the QR code based on the amount of data carried by the QR code and the total amount of data to be transmitted;

[0010] Splitting the data to be transmitted into N data segments, and generating N two-dimensional code images one by one according to the N data segments; wherein N is the number of the two-dimensional code segments;

[0011] The N two-dimensional code images are displayed cyclically according to a preset display refresh rate.

[0012] In one embodiment, generating N two-dimensional code images corresponding to the N data segments one by one includes:

[0013] Obtain the overall package identifier corresponding to the data to be transmitted;

[0014] For each of the data segments, determine the split sequence number of the data segment in the data to be transmitted, and according to a preset split package generation protocol, generate split package data based on the overall package identifier, the split sequence number, the number of two-dimensional code splits, and the data segment, and generate a two-dimensional code image corresponding to the data segment based on the split package data.

[0015] In one embodiment, generating a two-dimensional code image corresponding to the data segment based on the split package data includes:

[0016] Obtain registration verification information, and generate registration verification package data according to the registration verification information;

[0017] For each of the data segments, perform CRC check on the registration verification package data and the split package data to obtain check data, and according to a preset overall data protocol, generate image data packets based on the registration verification package data, the split package data, and the check data, and generate the two-dimensional code image based on the image data packets.

[0018] In one embodiment, the step of obtaining the screen size data of the electronic terminal includes:

[0019] Obtain the screen DPI and screen resolution of the electronic terminal respectively;

[0020] Determine the screen size data according to the screen DPI and the screen resolution.

[0021] In a second aspect, an embodiment of the present application provides a two-dimensional code reading method, which is applied to a two-dimensional code reading device, and the method includes:

[0022] Obtain a target two-dimensional code image, and perform two-dimensional code recognition on the target two-dimensional code image; wherein, the target two-dimensional code image is generated according to the two-dimensional code generation method described in any of the above embodiments;

[0023] If the recognition is successful, obtain a target data segment according to the two-dimensional code recognition result of the target two-dimensional code image;

[0024] Obtain target received data according to the target data segment.

[0025] In one embodiment, the method further includes:

[0026] If the recognition is unsuccessful, calculate the image resolution of the target QR code image;

[0027] If the image resolution is greater than a preset pixel upper limit value, generate a first piece of advice information; the first piece of advice information is used to prompt the user of the target electronic terminal to move the target electronic terminal away from the QR code acquisition device; the QR code acquisition device is a device for acquiring the target QR code image, and the target electronic terminal is an electronic terminal for displaying the target QR code image;

[0028] If the image resolution is less than a preset pixel lower limit value, generate a second piece of advice information; the second piece of advice information is used to prompt the user to move the target electronic terminal closer to the QR code acquisition device;

[0029] Push the first piece of advice information or the second piece of advice information to the target electronic terminal.

[0030] In one embodiment, the QR code recognition result includes a target general package identifier, the number of splits of the target QR code, the target data segment, and the split serial number corresponding to the target data segment;

[0031] The obtaining of the target received data from the target data segment includes:

[0032] Based on the number of splits of the target QR code, the target general package identifier, and each piece of cached data, determine whether all data segments of the target received data have been obtained;

[0033] If all data segments of the target received data have been obtained, perform data splicing on the target data segment and each piece of cached data according to the split serial number corresponding to the target data segment and the split serial numbers corresponding to each piece of cached data, and obtain the target received data;

[0034] If all data segments of the target received data have not been obtained, cache the target general package identifier, the target data segment, and the split serial number corresponding to the target data segment.

[0035] In a third aspect, an embodiment of the present application provides a QR code generation device, which is applied to an electronic terminal, and the device includes:

[0036] A data acquisition module, configured to acquire data to be transmitted and screen size data of the electronic terminal;

[0037] A data carrying amount determination module, configured to determine the QR code data carrying amount according to the screen size data and the color block arrangement density; wherein, the color block arrangement density is determined in advance according to the accuracy of the QR code acquisition device;

[0038] A splitting number calculation module, configured to calculate the splitting number of the two-dimensional code based on the data volume carried by the two-dimensional code and the total data volume of the data to be transmitted;

[0039] A two-dimensional code generation module, configured to split the data to be transmitted into N data segments, and generate N two-dimensional code images corresponding to the N data segments one by one; where N is the splitting number of the two-dimensional code;

[0040] A two-dimensional code display module, configured to cyclically display the N two-dimensional code images at a preset display refresh rate.

[0041] Fourthly, an embodiment of the present application provides a two-dimensional code reading device, which is applied to a two-dimensional code reading device, and the device includes:

[0042] A two-dimensional code recognition module, configured to obtain a target two-dimensional code image and perform two-dimensional code recognition on the target two-dimensional code image; where the target two-dimensional code image is generated according to the two-dimensional code generation method described in any of the above embodiments;

[0043] A target data segment obtaining module, configured to, if the recognition is successful, obtain a target data segment according to the two-dimensional code recognition result of the target two-dimensional code image;

[0044] A target received data obtaining module, configured to obtain target received data according to the target data segment.

[0045] Fifthly, an embodiment of the present application provides a storage medium, in which computer-readable instructions are stored, and when the computer-readable instructions are executed by one or more processors, the steps of the two-dimensional code generation method described in any of the above embodiments and / or the steps of the two-dimensional code reading method described in any of the above embodiments are executed by the one or more processors.

[0046] Sixthly, an embodiment of the present application provides an electronic terminal, which includes: one or more processors, and a memory;

[0047] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the two-dimensional code generation method described in any of the above embodiments are executed.

[0048] Seventhly, an embodiment of the present application provides a two-dimensional code reading device, which includes: one or more processors, and a memory;

[0049] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the two-dimensional code reading method described in any of the above embodiments are executed.

[0050] In the two-dimensional code generation method, two-dimensional code reading method and related devices provided in some embodiments of the present application, in the process of generating a two-dimensional code, the two-dimensional code carrying data volume of a single two-dimensional code can be determined according to the screen size data of the electronic terminal and the preset color block arrangement density, and the data to be transmitted with a larger data volume can be split into N data fragments with smaller data volume, and a two-dimensional code image is generated for each data fragment. The electronic terminal can display N two-dimensional code images in a loop according to the preset display refresh rate. Since the color block arrangement density of a single two-dimensional code image is predetermined according to the accuracy of the two-dimensional code acquisition device, even if the accuracy of the two-dimensional code acquisition device is low, the complete two-dimensional code image can be acquired, so that the two-dimensional code reading device can obtain the data to be transmitted with a larger data volume according to each two-dimensional code image. It can be seen that the present application can simultaneously achieve low-cost and large-volume information transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0052] Figure 1 A diagram of an application environment of a two-dimensional code generating method and a two-dimensional code reading method in one embodiment;

[0053] Figure 2 A schematic diagram of a process for generating a two-dimensional code in one embodiment;

[0054] Figure 3 A schematic diagram of a flow chart of a two-dimensional code reading method in one embodiment;

[0055] Figure 4 is a schematic structural diagram of a two-dimensional code generating device in one embodiment;

[0056] Figure 5 is a schematic structural diagram of a two-dimensional code reading device in one embodiment;

[0057] Figure 6 is a diagram of the internal structure of an electronic terminal in one embodiment;

[0058] Figure 7 FIG. 1 is a diagram of the internal structure of a two-dimensional code reading device in one embodiment. DETAILED DESCRIPTION

[0059] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0060] In one embodiment, the QR code generation method and QR code reading method of the present application can be applied to Figure 1 the application environment shown. Among them, the electronic terminal 102 refers to an electronic device that can be used to refresh and display a QR code graphic, which can be but is not limited to a smart phone, a tablet computer, a wearable device, etc. The QR code acquisition device 104 refers to a device used to acquire a QR code image, such as a camera device. The QR code reading device 106 refers to a device that can read data from a QR code image, such as a notebook computer, a desktop computer, a server, etc.

[0061] In the process of data transmission based on the QR code, the electronic terminal 102 can generate a QR code image according to the data to be transmitted and display it to the QR code acquisition device 104. The QR code acquisition device 104 can acquire the QR code image displayed in the electronic terminal according to the accuracy of this device to obtain a target QR code image. The QR code reading device 106 can obtain the target QR code image acquired by the QR code acquisition device 104 and identify and decode the QR code in the target QR code image to obtain the data carried in the target QR code image. In this way, data transmission can be realized between the electronic terminal 102 and the QR code reading device 106 through the QR code.

[0062] It should be noted that in the present application, the QR code acquisition device and the QR code reading device can be two independent devices or integrated into one. When the QR code acquisition device and the QR code reading device are integrated into one, the integrated device can have the functions of QR code acquisition and QR code reading.

[0063] In one embodiment, the present application provides a QR code generation method, which can be applied to Figure 1 the electronic terminal shown. As Figure 2 shown, the QR code generation method includes the following steps:

[0064] S202: Obtain the data to be transmitted and the screen size data of the electronic terminal.

[0065] Among them, the data to be transmitted refers to the data that needs to be transmitted between the electronic terminal and the QR code reading device, which can be determined according to the actual situation and is not specifically limited in this article. For example, the data to be transmitted can be face data, fingerprint data, palmprint data, palm vein data, finger vein data, hand shape data, retina data, iris data, voice data, etc.

[0066] The screen size data of the electronic terminal can be the area size of the displayable area in the electronic terminal screen. For example, the screen size data can include any one or any combination of data such as the length, width, and diagonal length of the displayable area.

[0067] In this step, the electronic terminal can obtain the data to be transmitted and the screen size data of this device. It can be understood that the acquisition method of the screen size data can be determined according to the situation. In one example, the acquisition steps of the screen size data of the electronic terminal can include the following sub-steps:

[0068] Step A1: Obtain the screen DPI and screen resolution of the electronic terminal respectively;

[0069] Step A3: Determine the screen size data according to the screen DPI and screen resolution.

[0070] Among them, the screen DPI (dots per inch, the number of pixels displayed per inch) can be used to reflect the pixel density of the electronic terminal screen. The screen resolution refers to the number of pixels displayed on the screen, which can be expressed as the number of pixels in the horizontal direction × the number of pixels in the vertical direction. Based on this, this application can calculate the screen size data of the electronic terminal based on the pixel density and the number of pixels to achieve automatic acquisition of the screen size.

[0071] S204: Determine the data volume carried by the QR code according to the screen size data and the color block arrangement density; among them, the color block arrangement density is determined in advance according to the accuracy of the QR code acquisition device.

[0072] It can be understood that the QR code image is formed by arranging specific geometric figures in a certain pattern on a plane. A geometric figure is filled with one color to form a color block. In other words, the QR code pattern is formed by arranging multiple color blocks in a certain pattern. The color block arrangement density in this application refers to the number of color blocks per unit length, which can be used to determine the size of a single color block. It can be understood that the higher the color block arrangement density, the smaller the size of a single color block; the lower the color block arrangement density, the larger the size of a single color block. When the size of the QR code image remains unchanged, the higher the color block arrangement density, the larger the data volume that the QR code image can carry; on the contrary, the lower the color block arrangement density, the smaller the data volume that the QR code image can carry.

[0073] In this step, the electronic terminal can preset the color block arrangement density in advance, which is determined according to the accuracy of the two-dimensional code acquisition device. The accuracy of the two-dimensional code acquisition device can be determined by parameters such as the resolution and / or sensor size of the two-dimensional code acquisition device, and this is not specifically limited in this article.

[0074] The electronic terminal can determine the data volume that can be carried by a single two-dimensional code adapted to the two-dimensional code acquisition device, that is, the two-dimensional code data volume, based on the screen size data of the electronic terminal and the preset color block arrangement density.

[0075] S206: Calculate the number of two-dimensional code splits based on the two-dimensional code data volume and the total data volume of the data to be transmitted.

[0076] In this step, after determining the data volume that can be carried by a single two-dimensional code, the number of two-dimensional code splits N can be calculated according to the total data volume of the data to be transmitted and the two-dimensional code data volume. For example, the ratio of the total data volume of the data to be transmitted to the two-dimensional code data volume can be calculated, and the ceiling function is applied to this ratio, and the resulting integer is the number of two-dimensional code splits.

[0077] In an example, since the acquisition of the two-dimensional code image is affected by factors such as illumination and display angle, the number of two-dimensional code splits calculated by the electronic terminal may not be conducive to the two-dimensional code acquisition device to acquire a complete two-dimensional code image. Therefore, the electronic terminal can obtain the number input by the user and use the number input by the user as the number of two-dimensional code splits to support the manual setting function.

[0078] S208: Split the data to be transmitted into N data segments, and generate N two-dimensional code images corresponding to the N data segments one by one; where N is the number of two-dimensional code splits.

[0079] In this step, when the number of two-dimensional code splits N is determined, the electronic terminal can split the data to be transmitted into N data segments, and generate a two-dimensional code image for each data segment respectively. For example, when N = 2, the electronic terminal can generate the first two-dimensional code image according to one of the data segments, and generate the second two-dimensional code image according to the other data segment.

[0080] S210: Display the N two-dimensional code images in a loop according to the preset display refresh rate.

[0081] In this step, the display refresh rate can be a value manually set by the user or a default value. The electronic terminal can display the N two-dimensional code images in a loop according to the preset display refresh rate. For example, when the display refresh rate is 1 image per second and N = 3, the electronic terminal can display 3 two-dimensional code images in a loop, and each two-dimensional code image is continuously displayed for 1 second each time.

[0082] It is understandable that when the display refresh rate is too high, the QR code acquisition device may repeatedly acquire the same QR code image, causing it to consume more time to acquire N QR code images, reducing the subsequent QR code reading efficiency. To improve the QR code reading efficiency, in one example, the display refresh rate can be 3 QR code images per second.

[0083] In this embodiment, in the process of generating a two-dimensional code, the amount of data carried by the two-dimensional code of a single two-dimensional code can be determined according to the screen size data of the electronic terminal and the preset color block arrangement density, and the data to be transmitted with a larger amount of data can be split into N data fragments with smaller amounts of data, and a two-dimensional code image is generated for each data fragment. The electronic terminal can display N two-dimensional code images in a loop according to the preset display refresh rate. Since the color block arrangement density of a single two-dimensional code image is predetermined according to the accuracy of the two-dimensional code acquisition device, even if the accuracy of the two-dimensional code acquisition device is low, a complete two-dimensional code image can be acquired, so that the two-dimensional code reading device can obtain a large amount of data to be transmitted according to each two-dimensional code image. It can be seen that the present application can simultaneously achieve low-cost and large-volume information transmission.

[0084] In one embodiment, N two-dimensional code images are generated according to the N data fragments in a one-to-one correspondence, including:

[0085] Step B1: Obtain the total package identifier corresponding to the data to be transmitted;

[0086] Step B3: For each data fragment, determine the splitting sequence number of the data fragment in the data to be transmitted, and generate splitting package data according to the total package identifier, splitting sequence number, number of QR code splits and the data fragment in accordance with the preset splitting package generation protocol, and generate the QR code image corresponding to the data fragment based on the splitting package data.

[0087] The total package identifier of the data to be transmitted may be the data identifier corresponding to the data to be transmitted, which is used to distinguish different data to be transmitted. For example, the total package identifier corresponding to the data to be transmitted A may be identifier A, and the total package identifier corresponding to the data to be transmitted B may be identifier B, and A is different from B.

[0088] In the process of generating a two-dimensional code image, the electronic terminal may first determine the splitting sequence number of the data segment used to generate the two-dimensional code image in the data to be transmitted, and the splitting sequence number may be used to indicate the data position of the data segment in the data to be transmitted. Then, the electronic terminal may generate splitting packet data according to a preset splitting packet generation protocol, so that the splitting data packet may include the total package identifier corresponding to the data to be transmitted, the splitting sequence number corresponding to the data segment, the number of two-dimensional code splits, and the specific data of the data segment, so that the two-dimensional code reading device can determine whether the received data has been split based on the data in the splitting data packet and determine how to splice the data.

[0089] It can be understood that the split packet generation protocol can be determined according to the actual situation, and this application does not make specific restrictions on this. In one example, this application can adopt the split packet generation protocol shown in Table 1:

[0090] Table 1

[0091]

[0092] After obtaining the split packet data, the electronic terminal can generate a two-dimensional code image corresponding to the data segment according to the split packet data.

[0093] In one embodiment, generating the two-dimensional code image corresponding to the data segment based on the split packet data includes:

[0094] Step B31: Obtain registration verification information and generate registration verification packet data according to the registration verification information;

[0095] Step B33: For each data segment, perform CRC check on the registration verification packet data and the split packet data to obtain check data, and according to the preset total data protocol, generate an image data packet based on the registration verification packet data, the split packet data, and the check data, and generate a two-dimensional code image based on the image data packet.

[0096] Among them, the registration verification information can be, but is not limited to, digital card numbers, Weigang card numbers, verification template information, registration template information, multi-type information combinations, etc. in the field of security attendance.

[0097] In this embodiment, to ensure the integrity and correctness of the data, this application can perform CRC (Cyclic Redundancy Check) check according to the registration verification data and the split packet data, and generate an image data packet according to the preset total data protocol, so that the image data packet can include the registration verification packet data, the split packet data, and the check data.

[0098] It can be understood that the total data protocol can be determined according to the actual situation, and this application does not make specific restrictions on this. In one example, this application can adopt the total data protocol shown in Table 2:

[0099] Table 2

[0100]

[0101] In one embodiment, this application provides a two-dimensional code reading method, which can be applied to Figure 1 the two-dimensional code reading device shown. As Figure 3 shown, the two-dimensional code reading method of this application can include the following steps:

[0102] S302: Obtain the target QR code image and perform QR code recognition on the target QR code image; wherein, the target QR code image is generated according to the QR code generation method of any of the above embodiments.

[0103] Wherein, the target QR code image can be an image obtained by a QR code acquisition device collecting the QR code image displayed on an electronic terminal, and the electronic terminal can generate the QR code image it displays based on the QR code generation method of any of the above embodiments.

[0104] In this step, the QR code reading device can obtain the target QR code image collected by the QR code acquisition device and perform QR code recognition on the target QR code image to attempt to obtain the data packet carried by the target QR code image.

[0105] Further, in an example, before performing QR code recognition on the target QR code image, a QR code detection algorithm can be used to detect the QR code on the target QR code image to determine the QR code area in the target QR code image, and thus judge whether the target QR code image includes a recognizable QR code. If the target QR code image includes a recognizable QR code, QR code recognition can be performed based on the QR code area.

[0106] S304: If the recognition is successful, obtain the target data segment according to the QR code recognition result of the target QR code image.

[0107] In this step, if the QR code recognition is successful, it indicates that the target QR code image includes a recognizable QR code, and the QR code reading device has obtained the data packet carried by the QR code. In this case, the QR code reading device can obtain the target data segment carried by the target QR code image according to the QR code recognition result.

[0108] S306: Obtain the target received data according to the target data segment.

[0109] In this step, the QR code reading device can obtain the complete target received data based on at least one target data segment to realize data transmission between the electronic terminal and the QR code reading device.

[0110] In one embodiment, the QR code recognition result includes a target total packet identifier, the number of target QR code splits, the target data segment, and the split sequence number corresponding to the target data segment. Among them, the target total packet identifier can be the total packet identifier corresponding to the target data segment, and the number of target QR code splits can be the number of QR code splits corresponding to the target data segment.

[0111] Obtaining the target received data according to the target data segment includes:

[0112] Step C1: Based on the number of splits of the target QR code, the target overall package identifier, and each cached data, determine whether all data segments of the target received data have been obtained;

[0113] Step C3: If all data segments of the target received data have been obtained, then based on the split serial number corresponding to the target data segment and the split serial numbers corresponding to each cached data, splice the target data segment and each cached data, and obtain the target received data;

[0114] Step C5: If all data segments of the target received data have not been obtained, then cache the target overall package identifier, the target data segment, and the split serial number corresponding to the target data segment.

[0115] In this embodiment, after obtaining the target data segment carried by the target QR code image, the QR code reading device can, according to the number of splits of the QR code corresponding to the target data segment, determine whether the target data segment is split data. If so, the QR code reading device can, according to the overall package identifier corresponding to the target data segment and each cached data in the QR code reading device, determine whether the QR code reading device has read all data segments of the target received data.

[0116] If all data segments of the target received data have been read, then the QR code reading device can, according to the split serial numbers corresponding to each data segment, splice each data segment corresponding to the target received data in sequence to obtain the complete target received data. Further, in an example, if the target received data includes verification information, the verification information can be used to verify the spliced target received data to ensure data integrity and consistency, and push the target received data to the corresponding application when the verification passes.

[0117] If all data segments of the target received data have not been obtained, that is, at least one data segment corresponding to the target received data is missing, then the target data segment and the split serial number corresponding to the target data segment can be cached for subsequent data splicing.

[0118] In one embodiment, the QR code reading method of the present application may further include the following steps:

[0119] Step D1: If the recognition is unsuccessful, calculate the image resolution of the target QR code image;

[0120] Step D3: If the image resolution is greater than a preset pixel upper limit value, generate a first suggestion message; the first suggestion message is used to prompt the user of the target electronic terminal to move the target electronic terminal away from the QR code acquisition device; the QR code acquisition device is a device for acquiring the target QR code image, and the target electronic terminal is an electronic terminal for displaying the target QR code image;

[0121] Step D5: if the image resolution is less than the preset pixel lower limit, generating second suggestion information; the second suggestion information is used to prompt the user to bring the target electronic terminal close to the two-dimensional code acquisition device;

[0122] Step D7: Push the first suggestion information or the second suggestion information to the target electronic terminal.

[0123] In this embodiment, when the electronic terminal is too close or too far from the two-dimensional code acquisition device, the two-dimensional code reading device may not be able to successfully identify the data carried by the target two-dimensional code image. Therefore, in the case of failure in two-dimensional code recognition, the two-dimensional code reading device can calculate the image resolution of the target two-dimensional code image, and judge whether the target electronic terminal is too close or too far from the two-dimensional code acquisition device based on this, and trigger the interaction mechanism.

[0124] If the image resolution is greater than the preset pixel upper limit, it indicates that the target electronic terminal is too close to the two-dimensional code acquisition device. Therefore, the two-dimensional code reading device can generate a first suggestion message to prompt the user to move the target electronic terminal away from the two-dimensional code acquisition device.

[0125] If the image resolution is less than the preset pixel lower limit, it indicates that the target electronic terminal is too far away from the two-dimensional code acquisition device. Therefore, the two-dimensional code reading device can generate second suggestion information to prompt the user to move the target electronic terminal closer to the two-dimensional code acquisition device.

[0126] In this way, the success rate of QR code recognition can be further improved, thereby improving the reliability of data transmission.

[0127] The following is a description of a two-dimensional code generating device provided in an embodiment of the present application. The two-dimensional code generating device described below and the two-dimensional code generating method described above can be referenced to each other.

[0128] In one embodiment, the present application provides a two-dimensional code generating device 400, which can be applied to an electronic terminal. Figure 4 As shown, the two-dimensional code generating device 400 of the present application may include:

[0129] The data acquisition module 402 is used to acquire the data to be transmitted and the screen size data of the electronic terminal;

[0130] The data carrying amount determination module 404 is used to determine the data carrying amount of the two-dimensional code according to the screen size data and the color block arrangement density; wherein the color block arrangement density is predetermined according to the accuracy of the two-dimensional code acquisition device;

[0131] A split number calculation module 406, used to calculate the number of splits of the two-dimensional code based on the amount of data carried by the two-dimensional code and the total amount of data to be transmitted;

[0132] A QR code generation module 408 is configured to split the data to be transmitted into N data segments, and generate N QR code images corresponding to the N data segments one by one; where N is the number of QR code splits.

[0133] A QR code display module 410 is configured to cyclically display the N QR code images at a preset display refresh rate.

[0134] In one embodiment, the QR code generation module 408 of the present application includes:

[0135] A total package identification acquisition unit is configured to acquire the total package identification corresponding to the data to be transmitted.

[0136] A QR code generation unit is configured to, for each of the data segments, determine the split sequence number of the data segment in the data to be transmitted, and generate split package data according to the total package identification, the split sequence number, the number of QR code splits, and the data segment according to a preset split package generation protocol, and generate a QR code image corresponding to the data segment based on the split package data.

[0137] In one embodiment, the QR code generation unit of the present application includes:

[0138] A registration verification unit is configured to acquire registration verification information and generate registration verification package data according to the registration verification information.

[0139] A verification unit is configured to, for each of the data segments, perform CRC verification on the registration verification package data and the split package data to obtain verification data, and generate image data packets according to the registration verification package data, the split package data, and the verification data according to a preset total data protocol, and generate the QR code image based on the image data packets.

[0140] In one embodiment, the data acquisition module 402 of the present application includes:

[0141] A screen display data acquisition unit is configured to acquire the screen DPI and screen resolution of the electronic terminal respectively.

[0142] A screen size data acquisition unit is configured to determine the screen size data according to the screen DPI and the screen resolution.

[0143] Next, a QR code reading device provided by an embodiment of the present application will be described. The QR code reading device described below can be correspondingly referred to the QR code reading method described above.

[0144] In one embodiment, the present application provides a QR code reading device 500, which can be applied to a QR code reading device. As Figure 5As shown, the QR code reading device 500 of the present application may include:

[0145] A QR code recognition module 502, configured to obtain a target QR code image and perform QR code recognition on the target QR code image; wherein, the target QR code image is generated according to the QR code generation method described in any of the above embodiments;

[0146] A target data segment acquisition module 504, configured to, if the recognition is successful, obtain a target data segment according to the QR code recognition result of the target QR code image;

[0147] A target received data acquisition module 506, configured to obtain target received data according to the target data segment.

[0148] In one embodiment, the QR code reading device 500 of the present application may further include:

[0149] An image resolution calculation module, configured to, if the recognition is unsuccessful, calculate the image resolution of the target QR code image;

[0150] A first suggestion information generation module, configured to, if the image resolution is greater than a preset pixel upper limit value, generate first suggestion information; the first suggestion information is used to prompt the user of the target electronic terminal to move the target electronic terminal away from the QR code acquisition device; the QR code acquisition device is a device for acquiring the target QR code image, and the target electronic terminal is an electronic terminal for displaying the target QR code image;

[0151] A second suggestion information generation module, configured to, if the image resolution is less than a preset pixel lower limit value, generate second suggestion information; the second suggestion information is used to prompt the user to move the target electronic terminal closer to the QR code acquisition device;

[0152] Push the first suggestion information or the second suggestion information to the target electronic terminal.

[0153] In one embodiment, the QR code recognition result includes a target general package identifier, the number of target QR code splits, the target data segment, and the split serial number corresponding to the target data segment.

[0154] The target received data acquisition module 506 of the present application includes:

[0155] A judgment unit, configured to judge whether all data segments of the target received data have been acquired according to the number of target QR code splits, the target general package identifier, and each cached data;

[0156] A splicing unit, which is configured to, if all data segments of the target received data have been obtained, splice the target data segment and each of the cached data according to the splitting serial number corresponding to the target data segment and the splitting serial numbers corresponding to each of the cached data, and obtain the target received data;

[0157] A caching unit, which is configured to, if all data segments of the target received data have not been obtained, cache the target total packet identifier, the target data segment, and the splitting serial number corresponding to the target data segment.

[0158] In one embodiment, the present application further provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to execute the steps of the QR code generation method in any of the embodiments and / or the steps of the QR code reading method in any of the embodiments.

[0159] In one embodiment, the present application further provides an electronic terminal storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to execute the steps of the QR code generation method in any of the embodiments.

[0160] Schematically, Figure 6 is an internal structural schematic diagram of an electronic terminal provided by an embodiment of the present application. Referring to Figure 6 , the electronic terminal 600 includes a first processing component 602, which further includes one or more first processors, and memory resources represented by a first memory 601 for storing instructions executable by the first processing component 602, such as application programs. The application programs stored in the first memory 601 may include one or more modules each corresponding to a set of instructions. In addition, the first processing component 602 is configured to execute instructions to perform the steps of the QR code generation method described in any of the above embodiments.

[0161] The electronic terminal 600 may further include a first power supply component 603 configured to perform power management of the electronic terminal 600, a wired or wireless first network interface 604 configured to connect the electronic terminal 600 to a network, and a first input / output (I / O) interface 605. The electronic terminal 600 may operate based on an operating system stored in the first memory 601, such as Android, iOS, HarmonyOS, Windows Phone, BlackBerry OS, or the like.

[0162] In one embodiment, the present application further provides a two-dimensional code reading device, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to execute the steps of the two-dimensional code reading method in any of the embodiments.

[0163] Schematically, Figure 7 is an internal structural schematic diagram of a two-dimensional code reading device provided by an embodiment of the present application. In one example, the two-dimensional code reading device may be a server. Referring to Figure 7 , the two-dimensional code reading device 900 includes a second processing component 902, which further includes one or more second processors, and memory resources represented by a second memory 901 for storing instructions executable by the second processing component 902, such as application programs. The application programs stored in the second memory 901 may include one or more modules each corresponding to a set of instructions. In addition, the second processing component 902 is configured to execute instructions to perform the steps of the two-dimensional code reading method described in any of the above embodiments.

[0164] The two-dimensional code reading device 900 may further include a second power supply component 903 configured to perform power management of the two-dimensional code reading device 900, a wired or wireless second network interface 904 configured to connect the two-dimensional code reading device 900 to a network, and a second input / output (I / O) interface 905. The two-dimensional code reading device 900 may operate based on an operating system stored in the second memory 901, such as Windows Server TM, Mac OS XTM, Unix TM, Linux TM, FreeBSDTM or the like.

[0165] Those skilled in the art can understand that the internal structures of the electronic terminal and the two-dimensional code reading device shown in the present application are only block diagrams of some structures related to the solution of the present application, and do not constitute a limitation on the electronic terminal and the two-dimensional code reading device to which the solution of the present application is applied. The specific electronic terminal and two-dimensional code reading device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0166] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the said element. In this text, "a", "an", "the", "this" and "its" may also include the plural form, unless the context clearly indicates otherwise. "Plural" means at least two cases, such as 2, 3, 5 or 8, etc. "And / or" includes any and all combinations of the related listed items.

[0167] The various embodiments in this specification are described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0168] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

Claims

1. A two-dimensional code generation method, characterized in that: Applied to an electronic terminal, the method comprises: Acquire data to be transmitted and screen size data of the electronic terminal; Determine the amount of data carried by the two-dimensional code according to the screen size data and the color block arrangement density; wherein the color block arrangement density is predetermined according to the accuracy of the two-dimensional code acquisition device; Calculate the number of splits of the QR code based on the amount of data carried by the QR code and the total amount of data to be transmitted; Splitting the data to be transmitted into N data segments, and generating N two-dimensional code images one by one according to the N data segments; wherein N is the number of the two-dimensional code segments; The N two-dimensional code images are displayed cyclically according to a preset display refresh rate.

2. The two-dimensional code generation method according to claim 1, characterized in that: Generating N two-dimensional code images according to the N data fragments in a one-to-one correspondence includes: Obtaining a total package identifier corresponding to the data to be transmitted; For each of the data fragments, determine the splitting sequence number of the data fragment in the data to be transmitted, and generate splitting package data according to the total package identifier, the splitting sequence number, the number of QR code splits and the data fragment in accordance with the preset splitting package generation protocol, and generate a QR code image corresponding to the data fragment based on the splitting package data.

3. The two-dimensional code generation method according to claim 2, characterized in that: The generating a two-dimensional code image corresponding to the data segment based on the split package data includes: Acquire registration verification information, and generate registration verification package data according to the registration verification information; For each of the data fragments, CRC check is performed on the registration verification package data and the split package data to obtain check data, and according to the preset total data protocol, an image data packet is generated based on the registration verification package data, the split package data and the check data, and the QR code image is generated based on the image data packet.

4. The two-dimensional code generation method according to any one of claims 1 to 3, characterized in that: The step of acquiring the screen size data of the electronic terminal comprises: Obtaining the screen DPI and screen resolution of the electronic terminal respectively; The screen size data is determined according to the screen DPI and the screen resolution.

5. A two-dimensional code reading method, characterized in that: Applied to a two-dimensional code reading device, the method comprises: Acquire a target two-dimensional code image, and perform two-dimensional code recognition on the target two-dimensional code image; wherein the target two-dimensional code image is generated according to the two-dimensional code generation method according to any one of claims 1 to 4; If the recognition is successful, the target data segment is obtained according to the two-dimensional code recognition result of the target two-dimensional code image; Target received data is obtained according to the target data segment.

6. The two-dimensional code reading method according to claim 5, characterized in that: The method further comprises: If the recognition is unsuccessful, the image resolution of the target two-dimensional code image is calculated; If the image resolution is greater than a preset pixel upper limit, a first suggestion information is generated; the first suggestion information is used to prompt the user of the target electronic terminal to move the target electronic terminal away from the two-dimensional code acquisition device; the two-dimensional code acquisition device is a device used to acquire the target two-dimensional code image, and the target electronic terminal is an electronic terminal used to display the target two-dimensional code image; If the image resolution is less than the preset pixel lower limit, second suggestion information is generated; the second suggestion information is used to prompt the user to bring the target electronic terminal close to the two-dimensional code acquisition device; Pushing the first suggestion information or the second suggestion information to the target electronic terminal.

7. The two-dimensional code reading method according to claim 5 or 6, characterized in that: The two-dimensional code recognition result includes the target total package identifier, the number of target two-dimensional code splits, the target data segments and the split sequence numbers corresponding to the target data segments; The step of obtaining target received data according to the target data fragment comprises: According to the number of splits of the target two-dimensional code, the target total package identifier and each cached data, determining whether all data segments of the target received data have been obtained; If all data fragments of the target received data have been obtained, then according to the split sequence numbers corresponding to the target data fragments and the split sequence numbers corresponding to the respective cached data, data splicing is performed on the target data fragments and the respective cached data to obtain the target received data; If all the data fragments of the target received data are not obtained, the target total package identifier, the target data fragments and the split sequence numbers corresponding to the target data fragments are cached.

8. A two-dimensional code generating device, characterized in that: Applied to an electronic terminal, the device comprises: A data acquisition module, used to acquire data to be transmitted and screen size data of the electronic terminal; A data carrying amount determination module, used to determine the data carrying amount of the two-dimensional code according to the screen size data and the color block arrangement density; wherein the color block arrangement density is predetermined according to the accuracy of the two-dimensional code acquisition device; A split number calculation module, used to calculate the number of splits of the two-dimensional code based on the amount of data carried by the two-dimensional code and the total amount of data to be transmitted; A two-dimensional code generation module, used to split the data to be transmitted into N data segments, and generate N two-dimensional code images according to the N data segments in a one-to-one correspondence; wherein N is the number of the two-dimensional code splits; The two-dimensional code display module is used to cyclically display N two-dimensional code images according to a preset display refresh rate.

9. A two-dimensional code reading device, characterized in that: Applied to a two-dimensional code reading device, the device comprises: A two-dimensional code recognition module, used for acquiring a target two-dimensional code image and performing two-dimensional code recognition on the target two-dimensional code image; wherein the target two-dimensional code image is generated according to the two-dimensional code generation method according to any one of claims 1 to 4; A target data segment acquisition module, used for obtaining the target data segment according to the two-dimensional code recognition result of the target two-dimensional code image if the recognition is successful; The target received data acquisition module is used to obtain the target received data according to the target data fragment.

10. A storage medium, characterized in that: The storage medium stores computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to execute the steps of the two-dimensional code generation method as described in any one of claims 1 to 4 and / or the steps of the two-dimensional code reading method as described in any one of claims 5 to 7.