Payment two-dimensional code safe transaction method
Technical Field
The invention relates to a two-dimensional code printing technology, in particular to a payment two-dimensional code printing system.
Background
The two-dimensional code is a bar code which records data symbol information by black and white figures distributed on a two-dimensional plane according to a certain rule by using a certain specific geometric figure, can transmit required information after being scanned by equipment, and is expanded on the basis of a one-dimensional bar code technology and has readability. The two-dimensional code has the characteristics of high capacity, high reliability, strong error correction capability, high confidentiality and the like. At present, the method is widely applied to the aspects of mobile phone electronic certificates, check anti-counterfeiting, invoice anti-counterfeiting and the like.
With the rapid development of the internet of things technology and the mobile communication technology, the two-dimensional code payment is taken as the main force of mobile payment, the payment field is widely popularized by means of fashionable and convenient customer experience, the increase of the number of users is very rapid, and the two-dimensional code payment is rapidly integrated into the society and daily life of people.
Various two-dimensional code application technologies based on two-dimensional code payment, two-dimensional code electronic certificates and two-dimensional code encrypted invoices enable business and life experiences to become more active. Many people are gradually accustomed to code-scanning payments when shopping or consuming small amounts. The intelligent mobile phone scans the two-dimension code provided by the merchant, and transfers money from the payment account or the WeChat account of the intelligent mobile phone to the account of the merchant, so that money payment is completed.
In the two-dimensional code payment, after the two-dimensional code of paying is printed out through the printer to the trade company, set up in goods shelves or cashier's office, when the customer need pay, through the payment two-dimensional code that the mobile device scanning printed out to carry out currency payment. This provides a ride for criminals while providing transaction convenience for merchants and customers. According to reports, many criminals replace payment two-dimensional code information printed by merchants with the payment two-dimensional code information of the criminals, so that cases that users pay money are stolen.
In order to find that the payment two-dimensional code information is replaced by criminals in time, in the prior art, when the payment two-dimensional code is printed, a specific characteristic image such as a merchant photo is arranged in the middle of the two-dimensional code, and whether the payment two-dimensional code information is replaced or not is judged by observing whether the characteristic image exists or not. However, the payment two-dimensional code images are public, criminals can insert the characteristic images into the counterfeit payment two-dimensional code images after photographing the characteristic images, and the counterfeit payment two-dimensional code images are printed to replace the payment two-dimensional code images of merchants, so that the merchants are difficult to find the safety problems of the payment two-dimensional codes in time.
In the prior art, 201410623487.9, 201410839169.6, 201220014626.4, 201520283696.3 and other patents disclose anti-counterfeiting two-dimensional code printing devices, but these devices are not used for printing payment two-dimensional codes, and the printed two-dimensional codes cannot solve the above problems.
In order to solve the above problems, a payment two-dimensional code printing system is previously applied, and a feature image with an area ratio larger than a fault tolerance rate is set in a payment two-dimensional code, so that a printed payment two-dimensional code image is difficult to replace, and the payment security of the two-dimensional code is improved; however, when the identification of the printed payment two-dimensional code fails, it cannot be determined whether the two-dimensional code is replaced or whether the two-dimensional code is another reason.
Disclosure of Invention
The invention provides a payment two-dimensional code generation system and a transaction method as further improvement, and whether a payment two-dimensional code is replaced or not can be judged when the payment two-dimensional code identification fails.
As an aspect of the present invention, there is provided a payment two-dimensional code printing system including: an input section for inputting payment information; the two-dimensional code transcoding part is used for converting the payment information into an original two-dimensional code pattern at a fixed fault-tolerant rate; a characteristic pattern input section for inputting a characteristic pattern; a characteristic pattern embedding part which enlarges or reduces the characteristic pattern according to the fixed fault-tolerant rate to enable the area ratio of the characteristic pattern embedded into the original two-dimensional code pattern to be slightly larger than the fixed fault-tolerant rate and form a middle two-dimensional code pattern; the two-dimensional code pattern correction part corrects partial points of the characteristic pattern in the middle two-dimensional code image according to the original two-dimensional code image, so that the area occupation ratio of different areas of code elements in the formed payment two-dimensional code pattern and the original two-dimensional code image is smaller than the fixed fault-tolerant rate by a specific threshold value; and the printing part is used for printing the generated payment two-dimensional code pattern to generate the payment two-dimensional code on the printing medium.
As another aspect of the present invention, there is provided a secure transaction method for a payment two-dimensional code printed by the payment two-dimensional code printing system, including: the method comprises the following steps: (1) storing the fixed fault tolerance; (2) scanning the payment two-dimensional code to obtain a payment two-dimensional code image; (3) identifying the payment two-dimensional code image, and entering the step (4) if the payment two-dimensional code image cannot be identified; if the payment two-dimensional code image can be identified, identifying and entering the step (5); (4) acquiring a format information area image of the payment two-dimensional code image; (4.1) identifying the payment two-dimensional code image format information area image, and acquiring payment two-dimensional code image format information; (4.2) judging whether the error correction level in the payment two-dimensional code image format information is equal to the fixed fault-tolerant rate, if so, giving two-dimensional code identification failure information, and ending the identification process; if the fault-tolerant rate is not equal to the fixed fault-tolerant rate, a prompt that the payment two-dimensional code is unsafe is given, and the identification process is ended; (5) acquiring the payment two-dimension code information; (6) judging whether the set fault tolerance rate is equal to the fixed fault tolerance rate or not according to the error correction level information of the payment two-dimensional code, and entering the step (7) if the set fault tolerance rate is not equal to the fixed fault tolerance rate; if the fault tolerance rate is equal to the fixed fault tolerance rate, entering the step (8); (7) giving a prompt that the payment two-dimensional code is unsafe, and ending the identification process; (8) determining that the payment two-dimension code information is safe two-dimension code payment information; (9) and carrying out payment according to the payment two-dimensional code information.
Drawings
Fig. 1 is a schematic diagram of a process of generating a payment two-dimensional code of a payment two-dimensional code printing system according to an embodiment of the present invention.
Fig. 2 is a flow chart illustrating the recognition of a printed payment two-dimensional code of the payment two-dimensional code printing system of the present invention.
Detailed Description
In order to more clearly illustrate the technical solutions of the present invention, the present invention will be briefly described below by using embodiments, and it is obvious that the following description is only one embodiment of the present invention, and for those skilled in the art, other technical solutions can be obtained according to the embodiments without inventive labor, and also fall within the disclosure of the present invention.
The payment two-dimensional code printing system comprises an input part, a two-dimensional code transcoding part, a characteristic pattern input part, a characteristic pattern embedding part, a two-dimensional code pattern correcting part and a printing part.
The input part is used for inputting payment information of the payment two-dimensional code, and the payment information can be a payment website of a payment platform. The payment information can be input through a wireless network, a wired network or a storage medium, and can also be input through a man-machine interaction device such as a keyboard, a touch screen and the like.
And a two-dimensional code transcoding part for converting the payment information into an original two-dimensional code pattern as shown in fig. 1 (a) at a fixed fault tolerance rate. The payment information may be assembled into the original two-dimensional code image using conventional two-dimensional code encoding rules, such as QR, Data Matrix, PDF417, and the like. The fixed fault tolerance may be, for example, 7%, 15%, or higher. In the following embodiments, a fixed fault tolerance of 15% is taken as an example. The original two-dimensional code image can be black and white, and a color two-dimensional code with mixed dark color and light color can also be adopted.
The characteristic pattern input part is used for inputting characteristic patterns, and the characteristic images can be merchant marks, trademarks, figures, symbols, landscapes and the like. The characteristic pattern is used for being placed in the two-dimensional code image, so that a merchant can find the printed two-dimensional code in time when the printed two-dimensional code is replaced by a lawless person. The feature image may be black and white or color, where it may be binarized and then set using the same color as the original two-dimensional code image.
And a feature image embedding unit which enlarges or reduces the feature pattern according to the fixed fault tolerance of the two-dimensional code transcoding unit, so that the area occupation ratio of the feature pattern embedded in the original two-dimensional code pattern is larger than the fixed fault tolerance, for example, the area occupation ratio of the feature pattern can be higher than the fixed fault tolerance by 2-5%. For example, the feature image of the feature pattern input unit may occupy 10% of the area of the original two-dimensional code pattern, and the feature image may be enlarged by 70%, so that the enlarged feature image occupies 17% of the area of the original two-dimensional code pattern, and is 2% higher than the fixed fault-tolerance rate of 15%. The enlarged or reduced feature image is embedded into the original two-dimensional code pattern to form an intermediate two-dimensional code pattern as shown in fig. 1 (b), where the embedding location may be the center or other data area of the payment two-dimensional code.
The two-dimensional code pattern correction section corrects a part of points of the feature pattern in the middle two-dimensional code image according to the original two-dimensional code image, for example, as shown in fig. 1 (c), and corrects a part of symbols in the face feature pattern of fig. 1 (b) so that the part of symbols is the same as the symbols at the positions of the part of symbols in the original two-dimensional code image, so that the area of the different regions of the formed pay two-dimensional code pattern and the symbols in the original two-dimensional code image is smaller than the fixed fault tolerance by a specific threshold, which may be set to, for example, 2% to 4%. For example, the formed payment two-dimensional code image can be identified by modifying the characteristic part code element to make the area ratio of different areas of the code element in the formed payment two-dimensional code pattern and the original two-dimensional code image be 12 percent, which is less than the fixed fault tolerance rate of 15 percent.
A printing part including a printing cartridge, the cartridge being a black cartridge or a color cartridge. The printing section is configured to print the generated payment two-dimensional code pattern to generate a payment two-dimensional code on a printing medium, for example, printing paper. After the payment two-dimensional code is printed out, the payment two-dimensional code is arranged on a goods shelf or a cash register, and when a customer needs to pay, the payment two-dimensional code printed out through scanning of the mobile equipment is scanned, so that money payment is carried out.
The secure identification method of the payment two-dimensional code of the embodiment of the invention, as shown in figure 2, comprises the following steps: (1) storing the fixed fault tolerance; (2) scanning the payment two-dimensional code to obtain a payment two-dimensional code image; (3) identifying the payment two-dimensional code image, and entering the step (4) if the payment two-dimensional code image cannot be identified; if the payment two-dimensional code image can be identified, identifying and entering the step (5); (4) acquiring a Format Information (Format Information) area image of the payment two-dimensional code image; (4.1) identifying the payment two-dimensional code image format information area image, and acquiring payment two-dimensional code image format information; (4.2) judging whether an Error Correction Level (Error Correction Level) in the payment two-dimensional code image format information is equal to the fixed fault-tolerant rate, if so, giving two-dimensional code identification failure information, and ending the identification process; if the fault-tolerant rate is not equal to the fixed fault-tolerant rate, a prompt that the payment two-dimensional code is unsafe is given, and the identification process is ended; (5) acquiring the payment two-dimension code information; (6) judging whether the set fault tolerance rate is equal to the fixed fault tolerance rate or not according to the error correction level information of the payment two-dimensional code, and entering the step (7) if the set fault tolerance rate is not equal to the fixed fault tolerance rate; if the fault tolerance rate is equal to the fixed fault tolerance rate, entering the step (8); (7) giving a prompt that the payment two-dimensional code is unsafe, and ending the identification process; (8) and determining that the payment two-dimension code information is safe two-dimension code payment information.
When the payment two-dimensional code printed by the payment two-dimensional code printing system is transacted, if the two-dimensional code image cannot be identified, the format information area in the two-dimensional code image is further acquired, and the error correction level of the format information area is judged, so that whether the payment two-dimensional code cannot be identified is determined.
Although the present invention has been described in detail with reference to the above embodiments, it should be understood by those skilled in the art that: modifications and equivalents may be made to the embodiments of the invention without departing from the spirit and scope of the invention, which is to be covered by the claims.