A QR code generation system for mobile payment on highways

By calculating the clarity, completeness, and printing index of the QR code generation system, setting thresholds to judge and regenerate QR codes or locate faults, the quality problem of QR codes in highway mobile payment was solved, improving user experience and the reliability of the payment process, and preventing financial losses.

CN119721105BActive Publication Date: 2025-10-31GUANGZHOU SUIHUA EXPRESSWAY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411888060.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-10-31
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

The existing mobile payment QR code generation system for highways cannot detect damaged or blurry QR codes, resulting in poor printing quality, which can easily lead to poor user experience and charging errors, affecting users' willingness to obtain invoices and the reliability of the payment process.

Method used

The system, composed of a QR code generation module, a data acquisition module, a data analysis module, and a fault detection module, calculates the clarity, completeness, and printing index of the QR code, sets thresholds for judgment, and regenerates the QR code or locates the fault when the quality is unqualified. It also constructs a fault model for printer fault detection and calculates the QR code error indication value to determine the amount error.

Benefits of technology

This system effectively controls the source of QR code generation, avoids negative user experiences, improves printing quality and payment reliability, prevents financial losses, and maintains the fairness, transparency, safety, and orderliness of highway toll collection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721105B_ABST
    Figure CN119721105B_ABST
Patent Text Reader

Abstract

This invention discloses a QR code generation system for mobile payment on highways, relating to the field of QR code generation. By analyzing QR codes before and after printing, this invention can effectively prevent quality problems in the generation and printing stages. Analyzing the QR code generation process allows for the determination of whether problems have occurred. It solves the problems of existing technologies, such as the difficulty in accurately identifying and handling damaged or blurred QR codes, leading to substandard QR codes entering the usage stage; the inability to effectively monitor the quality of printed QR codes and locate printer malfunctions, resulting in difficulty in quickly repairing quality issues and causing traffic congestion; and the inability to analyze QR code generation, leading to numerous user payment errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of QR code generation, and in particular to a QR code generation system for use in highway mobile payment. Background Technology

[0002] With the widespread adoption of mobile payment in the highway toll collection sector, electronic invoices have become the mainstream trend. However, obtaining traditional electronic invoices often relies on complex mini-program operations. For example, drivers need to enter a specific mini-program after payment and go through multiple steps such as registration, login, order search, and filling in invoice information. The operation process is lengthy and prone to errors, consuming a lot of time and energy, reducing users' enthusiasm for obtaining invoices, and even affecting the overall satisfaction with highway toll collection services.

[0003] QR codes, as an effective carrier for information storage and transmission, possess many characteristics suitable for mobile payments on highways. However, existing QR code generation systems used for mobile payments on highways still have the following shortcomings:

[0004] It cannot identify damaged or blurry QR codes and generate a new one to replace the original; it cannot analyze printed QR codes, which can lead to poor user experience when the printed QR codes are of low quality; and it cannot analyze the QR code generation process when users report incorrect amounts, which can easily result in a large number of incorrect charges and losses for users. Summary of the Invention

[0005] In view of this, the present invention provides a QR code generation system for mobile payment on highways to solve the problems mentioned in the background art.

[0006] The objective of this invention can be achieved through the following technical solution: a QR code generation system for mobile payment on highways, characterized in that it comprises:

[0007] QR code generation module: Used to generate a link address pointing to the invoice download page for this payment record and convert it into a QR code;

[0008] Data acquisition module: Collects images before QR code printing, images after printing, and historical fault information of the printer; the historical fault information specifically includes voltage, current, temperature, network latency, decibels, and power consumption data within a set time interval before the printer malfunctions; sends the images before and after QR code printing to the data analysis module, and sends the historical fault information of the printer to the fault detection module.

[0009] Data analysis module: Analyzes the QR code image before printing and the QR code image after printing to obtain the QR code update index and QR code printing index, which are then sent to the QR code update module and the printing analysis module, respectively.

[0010] QR code update module: It has a built-in QR code update index threshold. When the QR code update index is lower than the QR code update index threshold, a new QR code is generated and the QR code update frequency is calculated and sent to the QR code update monitoring module.

[0011] QR code update monitoring module: It presets a QR code update frequency threshold. When the QR code update frequency exceeds the preset QR code update frequency threshold, it sends a fault detection command to the fault detection module.

[0012] Printing analysis module: Built-in QR code printing index threshold. When the QR code printing index is lower than the QR code printing index threshold, a fault detection command is sent to the fault detection module.

[0013] Fault detection module: Analyzes historical fault information of the printer, builds fault models, and realizes fault detection of the printer;

[0014] QR code detection module: When a car owner reports an error in the amount, it calculates the error indication value of the QR code to determine whether the QR code was generated incorrectly.

[0015] Furthermore, the process of generating a QR code is as follows:

[0016] A communication protocol is selected, choosing either HTTP or HTTPS, to establish a connection channel between the highway toll system and various payment platforms, including WeChat Pay, Alipay, and UnionPay. The connection channel employs a multi-channel redundancy mechanism, with a backup interface in addition to the main data interface. This allows for seamless switching to the backup channel in case of network failure or payment platform maintenance interruption. The highway toll system initiates requests to the payment platforms through the established connection channel. These requests include the transaction order number and key vehicle identification information, such as license plate number, lane number, transaction time interval, entrance / exit names, and toll amount.

[0017] After receiving the request, the payment platform sends the request content back to the highway toll system. During this process, in order to cope with the impact of network fluctuations, an intelligent reconnection and task continuation mechanism is established. The system has a built-in network monitoring thread that detects fluctuations based on heartbeat packets and response timeout thresholds. Once a network anomaly or interruption is detected, the intelligent reconnection logic is immediately activated. The system has a preset reconnection interval and a maximum number of reconnections, and reconnects to the payment platform according to the preset reconnection interval and maximum number of reconnections.

[0018] After receiving the request, the highway toll collection system verifies the completeness and accuracy of the request according to the verification rules. The verification methods include hash value comparison and data format verification. After the verification is completed, the request is stored in the local database.

[0019] Obtain a pre-set template with a uniform format from the highway toll system, fill the request content into the template according to the order and format requirements, and thus obtain a unique and complete link address pointing to the invoice download of the payment record;

[0020] A QR code encoding standard is selected. The complete link address is encoded and converted according to the QR code encoding standard. An error correction level is set, including L, M, Q, and H. The Reed-Solomon error correction algorithm is selected to analyze the encoded complete link address to generate an error correction code. The encoded complete link address and the error correction code are stored in the QR code image according to the encoding standard and error correction level, thereby generating a QR code that points to the invoice download page for this payment record.

[0021] Furthermore, the specific steps for calculating the QR code update index are as follows:

[0022] S1: Calculate the clarity index of the QR code:

[0023] S1-1: Convert the acquired QR code image to grayscale, obtaining the grayscale values ​​of each region of the QR code. Grayscale values ​​below 128 are considered black, and grayscale values ​​above 128 are considered white. Based on the black and white colors, divide the acquired grayscale values ​​into two sets: the grayscale values ​​of the white regions are designated as the high-grayscale set, and the grayscale values ​​of the black regions are designated as the low-grayscale set. Preset a minimum grayscale value for the high-grayscale set, and count the number of grayscale values ​​in the high-grayscale set that are lower than the minimum grayscale value; these are recorded as unqualified high-grayscale values. The grayscale high-value defect rate is calculated by dividing the number of defective items by the total number of items in the grayscale high-value set. For the grayscale low-value set, a maximum grayscale value is preset, and the number of grayscale values ​​greater than the maximum value is counted as the number of defective items. This number is then divided by the total number of items in the grayscale low-value set to obtain the grayscale low-value set defect rate. The average of the grayscale low-value set defect rate and the grayscale high-value set defect rate is taken as the grayscale defect rate BJG.

[0024] S1-2: Obtain the image contrast (DB) and high-frequency energy percentage (GPB);

[0025] S1-3: Normalize the obtained grayscale failure rate (BJG) and image contrast (DB) and then input them into the formula: Thus, the grayscale index HDZ is obtained, where a1 and a2 are the weighting factors corresponding to the grayscale failure rate BJG and the image contrast DB, respectively, and Lg represents the logarithmic function with base 10.

[0026] S1-4: Preset the weighting factors corresponding to the grayscale index HDZ and the high-frequency energy ratio GPB. Multiply the calculated grayscale index HDZ and the high-frequency energy ratio GPB by the corresponding preset weighting factors and then add them together. The result is used as the clarity index QXD of the QR code image.

[0027] S2: Calculate the integrity index WZD of the QR code;

[0028] S3: Preset the weighting factors corresponding to the clarity index QXD and the integrity index WZD. After normalizing the clarity index QXD and the integrity index WZD, multiply them by the preset weighting factors and then add them together. The final result is used as the QR code update index.

[0029] Furthermore, the specific steps for calculating the QR code integrity index WZD are as follows:

[0030] The edge detection algorithm is used to locate the edge region of the QR code, calculate the number of broken regions in the edge region and the length of each broken region, preset an invalid value for the broken length, and extract data with broken region lengths higher than the invalid value for analysis.

[0031] Preset intervals for fracture length, set corresponding weighted influence factors for each interval of fracture length, match the fracture length intervals corresponding to each fracture length to obtain the weighted influence factors for each fracture area, multiply the length of each fracture area by the corresponding weighted influence factor, and sum the results to obtain the fracture length influence value P1.

[0032] Calculate the total number P2 of fracture regions whose fracture length exceeds the invalid fracture length value, and extract the maximum value P3 among the lengths of each fracture region;

[0033] After normalizing the obtained fracture length influence value P1, the total number of fracture regions with fracture lengths exceeding the invalid fracture length value P2, and the maximum value of each fracture region length P3, and then substituting them into the formula: Obtain the edge rating index Where u1, u2, and u3 are the weighted influence factors corresponding to P1, P2, and P3, respectively. , and These are the standard values ​​of P1, P2, and P3 extracted from a preset database, respectively, and Lg represents the logarithmic function with base 10.

[0034] The QR code image is converted to grayscale, the data area of ​​the QR code image is located, and the proportion Z2 of pixels with grayscale values ​​lower than 128 is calculated to account for the total number of pixels.

[0035] Obtain the encoding standard used by the current QR code, extract the standard proportion range of pixels with a pixel value lower than 128 in the current encoding standard, and extract the median value Z1 of the standard proportion range;

[0036] Substitute the obtained Z1 and Z2 into the formula: This yields the coding evaluation index BMP, where e is the natural base;

[0037] After normalizing the obtained edge evaluation index (BYP) and encoding evaluation index (BMP), they are then entered into the formula: Obtain completeness index , where r1 and r2 are the weighted influence factors corresponding to the edge judgment index BYP and the coding judgment index BMP, respectively.

[0038] Furthermore, the specific steps for calculating the QR code printing index DY are as follows:

[0039] The QR code is located using an image recognition algorithm. The number of complete modules is counted, the current QR code encoding standard is obtained, and the theoretical number of modules for the current QR code is obtained from the current QR code encoding standard. The proportion of complete modules is obtained by dividing the number of complete modules by the theoretical number of modules for the current QR code. A threshold for the proportion of complete modules is preset. The difference between the proportion of complete modules and the threshold is obtained. The range of the proportion difference for each group of complete modules is preset, and the proportion score corresponding to each range of the proportion difference for each group is set. The proportion score ZB corresponding to the proportion difference of complete modules is obtained by matching the range of the proportion difference of complete modules. The higher the proportion score ZB, the larger the proportion of complete modules and the better the image printing quality.

[0040] The QR code is divided into a functional graphic area and a data encoding area. Image processing software is used to locate the shaded areas of the functional graphic area and the data encoding area, respectively. The sum of the shaded areas of the functional graphic area and the data encoding area is calculated to obtain the functional shadow area and the encoding shadow area. The area of ​​the functional graphic area and the area of ​​the data encoding area of ​​the printed QR code are obtained. The functional shadow area and the encoding shadow area are divided by the area of ​​the functional graphic area and the area of ​​the data encoding area, respectively, to obtain the shadow rate of the functional area and the shadow rate of the encoding area. The weighting factors corresponding to the shadow rate of the functional area and the shadow rate of the encoding area are preset. The shadow rate of the functional area and the shadow rate of the encoding area are multiplied by the corresponding weighting factors and then added together. The result is used as the comprehensive shadow index YY of the printed QR code.

[0041] After normalizing the percentage score ZB and the comprehensive shading index YY, we input them into the formula: This yields the QR code printing index DY, where and These are the weighted influencing factors corresponding to the percentage score ZB and the comprehensive shadow index YY, respectively.

[0042] Furthermore, the specific steps for constructing a fault model and performing fault detection on the printer are as follows:

[0043] The relevant data within a set time interval prior to the printer's historical malfunctions are averaged. Principal component analysis (PCA) is used to extract x feature data types most relevant to each historical malfunction (x>3). The extracted feature data types for each historical malfunction are deduplicated to obtain a feature dataset related to the malfunction. Let p represent the number of feature datasets. The feature datasets corresponding to each historical malfunction are then represented in vector form. , where i represents the historical fault number. This represents the data value corresponding to the p-th feature data;

[0044] First, the staff determines the number of cluster categories, k, which is determined by the number of fault types at the current toll station. A farthest-first algorithm is used to initially select k cluster centers, each corresponding to a fault type. The Euclidean distance metric is used to determine the distance between the vector corresponding to each historical fault and each cluster center. The Euclidean distance calculation formula is as follows: , The data value corresponding to the u-th feature data in vector form representing historical faults. Given the data value corresponding to the u-th feature data of the cluster center, select the cluster center with the smallest Euclidean distance as the cluster corresponding to each historical fault. After classification, calculate the mean of each feature data in each cluster to form a new cluster center. Iterate continuously. Set an iteration stop threshold. When it is detected that the Euclidean distance between all cluster centers and the corresponding next cluster center is less than the set iteration stop threshold, stop the iteration to obtain the vectors corresponding to k cluster centers.

[0045] When a fault detection command is received, the system acquires the data corresponding to the feature dataset within a set time interval prior to receiving the command, processes the data using the mean formula, and represents it as a vector. The system calculates the Euclidean distance between the current vector and the vectors corresponding to each cluster center, and presets the fault thresholds for each cluster center. If the Euclidean distance between the current vector and the vector corresponding to a certain cluster center is less than the fault threshold corresponding to that cluster center, the system triggers an alarm for the fault type corresponding to that cluster center.

[0046] Furthermore, calculate the QR code error indication value. The specific steps are as follows:

[0047] If a car owner has a question about the payment amount after scanning the QR code, the QR code will be checked. After receiving the QR code check request, the highway toll collector will input the vehicle type, entrance and exit of the target vehicle into the highway toll system to obtain the amount due for the target vehicle and compare it with the amount displayed on the QR code. If the amount is inconsistent, the highway toll collector will confirm it a second time before checking the QR code.

[0048] Using decoding software, locate the binary data of the QR code's stored amount portion and obtain the length G1 of the binary data of the stored amount portion; convert the amount receivable into binary to obtain the length G2 of the binary data corresponding to the amount receivable; perform subtraction on G1 and G2 and take the absolute value, the result as the length error G3; divide G3 by G2 to obtain the length error rate CD.

[0049] For the binary data of the accounts receivable amount and the binary data of the amount stored in the QR code, starting from the first non-zero data on the left, alignment is performed, and the parts with different numbers in the same position are marked. The number of marked points is counted and recorded as the digit error number SW.

[0050] Obtain the number and area of ​​the data blocks corresponding to the QR code data area, denoted as S1 and S2 respectively. Obtain the number and area of ​​the error correction blocks corresponding to the QR code data area, denoted as J1 and J2 respectively. Use the formula: Obtain the average ratio of data blocks and error correction blocks, extract the standard ratio of data blocks and error correction blocks from the current QR code error correction specification, subtract the standard ratio of data blocks and error correction blocks from the average ratio of data blocks and error correction blocks, and take the absolute value of the result as the ratio difference ZC.

[0051] After normalizing the obtained length error rate CD, digit error number SW, and percentage difference ZC, they are substituted into the formula: This yields the QR code error indication value. Where a1, a2, and a3 are the percentage difference ZC, the place value error, and the number of digits, respectively. The weighted influence factor corresponding to the length error rate CD;

[0052] Preset QR code error indication threshold, set QR code error indication value Compare with the preset QR code error indication value threshold; if the QR code error indication value... If the value is lower than the preset QR code error indication threshold, it is determined that the QR code generation has failed, and the QR code error indication value is adjusted accordingly. The code is sent to the backend developers' email address, who then monitor the entire QR code generation process.

[0053] Compared with the prior art, the beneficial effects of the present invention are:

[0054] This invention calculates the clarity and integrity of the QR code before printing and sets different weights to obtain the update index of the QR code. By setting a threshold for comparison, it can control the source of QR code generation and avoid the bad experience caused by substandard QR code.

[0055] This invention analyzes the printed QR code to obtain its printing index, thereby intelligently judging the quality of the printed QR code. When the printed QR code is of substandard quality, fault detection is triggered to quickly and accurately locate the source of the fault, thus providing direction for printer repair and improving traffic efficiency.

[0056] This invention analyzes the QR code generation process to obtain QR code error indication values, thereby avoiding payment disputes, financial losses, and user trust crises caused by incorrect QR code amounts. It effectively safeguards the financial security of drivers and passengers and the financial stability of operators, maintains a fair, transparent, safe, and orderly highway tolling ecosystem, and enhances the reliability and credibility of the payment process. Attached Figure Description

[0057] Further details, features, and advantages of this application are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0058] Figure 1 This is a schematic diagram of the principle of the present invention. Detailed Implementation

[0059] Several embodiments of this application will now be described in more detail with reference to the accompanying drawings to enable those skilled in the art to implement this application. This application may be embodied in many different forms and for various purposes and should not be limited to the embodiments set forth herein. These embodiments are provided to make this application thorough and complete, and to fully convey the scope of this application to those skilled in the art. The embodiments described do not limit this application.

[0060] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It will be further understood that terms such as those defined in commonly used dictionaries shall be interpreted as having a meaning consistent with their meaning in the relevant field and / or the context of this specification, and shall not be interpreted in an idealized or overly formal sense unless expressly defined herein.

[0061] Please see Figure 1As shown, a QR code generation system for mobile payment on highways includes: a QR code generation module, a data acquisition module, a data analysis module, a QR code update module, a QR code update monitoring module, a print analysis module, a fault detection module, and a QR code detection module.

[0062] QR code generation module: Used to generate a link address pointing to the invoice download page for this payment record and convert it into a QR code;

[0063] A communication protocol is selected, choosing either HTTP or HTTPS, to establish a connection channel between the highway toll system and various payment platforms, including WeChat Pay, Alipay, and UnionPay. The connection channel employs a multi-channel redundancy mechanism, with a backup interface in addition to the main data interface. This allows for seamless switching to the backup channel in case of network failure or payment platform maintenance interruption. The highway toll system initiates requests to the payment platforms through the established connection channel. These requests include the transaction order number and key vehicle identification information, such as license plate number, lane number, transaction time interval, entrance / exit names, and toll amount.

[0064] After receiving the request, the payment platform sends the request content back to the highway toll system. During this process, in order to cope with the impact of network fluctuations, an intelligent reconnection and task continuation mechanism is established. The system has a built-in network monitoring thread that detects fluctuations based on heartbeat packets and response timeout thresholds. Once a network anomaly or interruption is detected, the intelligent reconnection logic is immediately activated. The system has a preset reconnection interval and a maximum number of reconnections, and reconnects to the payment platform according to the preset reconnection interval and maximum number of reconnections.

[0065] After receiving the request, the highway toll collection system verifies the completeness and accuracy of the request according to the verification rules. The verification methods include hash value comparison and data format verification. After the verification is completed, the request is stored in the local database.

[0066] Obtain a pre-set template with a uniform format from the highway toll system, fill the request content into the template according to the order and format requirements, and thus obtain a unique and complete link address pointing to the invoice download of the payment record;

[0067] A QR code encoding standard is selected. The complete link address is encoded and converted according to the QR code encoding standard. An error correction level is set, including L, M, Q, and H. The Reed-Solomon error correction algorithm is selected to analyze the complete link address after encoding conversion, thereby generating an error correction code. The complete link address after encoding conversion and the error correction code are stored in the QR code image according to the encoding standard and error correction level, thereby generating a QR code pointing to the invoice download page of this payment record.

[0068] Data acquisition module: Collects images before and after QR code printing, as well as printer historical fault information; the historical fault information specifically includes voltage, current, temperature, network latency, decibels, and power consumption data within a set time interval before the printer malfunctions; sends the images before and after QR code printing to the data analysis module, and sends the printer historical fault information to the fault detection module.

[0069] Data Analysis Module: This module analyzes the QR code image before and after printing to obtain the QR code update index and the QR code printing index. The QR code update index is then sent to the QR code update module, and the QR code printing index is sent to the fault detection module.

[0070] S1: Calculate the clarity index of the QR code:

[0071] S1-1: Convert the acquired QR code image to grayscale, obtaining the grayscale values ​​of each region of the QR code. Grayscale values ​​below 128 are considered black, and grayscale values ​​above 128 are considered white. Based on the black and white colors, divide the acquired grayscale values ​​into two sets: the grayscale values ​​of the white regions are designated as the high-grayscale set, and the grayscale values ​​of the black regions are designated as the low-grayscale set. Preset a minimum grayscale value for the high-grayscale set, and count the number of grayscale values ​​in the high-grayscale set that are lower than the minimum grayscale value; these are recorded as unqualified high-grayscale values. The grayscale high-value defect rate is calculated by dividing the number of defective items by the total number of items in the grayscale high-value set. For the grayscale low-value set, a maximum grayscale value is preset, and the number of grayscale values ​​greater than the maximum value is counted as the number of defective items. This number is then divided by the total number of items in the grayscale low-value set to obtain the grayscale low-value set defect rate. The average of the grayscale low-value set defect rate and the grayscale high-value set defect rate is taken as the grayscale defect rate BJG.

[0072] The failure rate visually presents the degree of grayscale abnormality, establishing a quantitative benchmark for image quality assessment, helping to quickly identify quality defects, ensuring clear black and white contrast and clear module boundaries, and improving the accuracy and efficiency of scanning and decoding;

[0073] S1-2: Obtain the image contrast (DB) and high-frequency energy percentage (GPB);

[0074] S1-3: Normalize the obtained grayscale failure rate (BJG) and image contrast (DB) and then input them into the formula: Thus, the grayscale index HDZ is obtained, where a1 and a2 are the weighting factors corresponding to the grayscale failure rate BJG and the image contrast DB, respectively, and Lg represents the logarithmic function with base 10.

[0075] S1-4: Preset the weighting factors corresponding to the grayscale index HDZ and the high-frequency energy ratio GPB. Multiply the calculated grayscale index HDZ and the high-frequency energy ratio GPB by the corresponding preset weighting factors and then add them together. The result is used as the clarity index QXD of the QR code image.

[0076] By comprehensively considering the impact of two factors on QR code clarity—HDZ (grayscale value index) and GPB (high frequency energy ratio)—and setting different weighting factors for the two indicators, the results can better reflect the clarity of the QR code.

[0077] S2: Calculate the integrity index WZD of the QR code;

[0078] The edge detection algorithm is used to locate the edge region of the QR code, calculate the number of broken regions in the edge region and the length of each broken region, preset an invalid value for the broken length, and extract data with broken region lengths higher than the invalid value for analysis.

[0079] Preset intervals for fracture length, set corresponding weighted influence factors for each interval of fracture length, match the fracture length intervals corresponding to each fracture length to obtain the weighted influence factors for each fracture area, multiply the length of each fracture area by the corresponding weighted influence factor, and sum the results to obtain the fracture length influence value P1.

[0080] Different lengths of break regions may have different effects on QR codes; setting different intervals and weights can more precisely account for the differences in the impact caused by changes in break length.

[0081] Calculate the total number P2 of fracture regions whose fracture length exceeds the invalid fracture length value, and extract the maximum value P3 among the lengths of each fracture region;

[0082] After normalizing the obtained fracture length influence value P1, the total number of fracture regions with fracture lengths exceeding the invalid fracture length value P2, and the maximum value of each fracture region length P3, and then substituting them into the formula: Obtain the edge rating index Where u1, u2, and u3 are the weighted influence factors corresponding to P1, P2, and P3, respectively. , and These are the standard values ​​of P1, P2, and P3 extracted from a preset database, respectively, and Lg represents the logarithmic function with base 10.

[0083] By further calculating the impact value of fracture length, the total number of fracture regions, and the maximum value of fracture region length, and after normalization, the edge evaluation index is derived according to a specific formula. This enables a comprehensive and objective evaluation of the QR code edge condition from multiple dimensions, providing a comprehensive and objective basis for judging the overall quality of the QR code and whether it can be accurately scanned and recognized. This helps to ensure the reliability and effectiveness of QR code use in practical application scenarios.

[0084] The QR code image is converted to grayscale, the data area of ​​the QR code image is located, and the proportion Z2 of pixels with grayscale values ​​lower than 128 is calculated to account for the total number of pixels.

[0085] Obtain the encoding standard used by the current QR code, extract the standard proportion range of pixels with a pixel value lower than 128 in the current encoding standard, and extract the median value Z1 of the standard proportion range;

[0086] Substitute the obtained Z1 and Z2 into the formula: This yields the coding evaluation index BMP, where e is the natural base;

[0087] After normalizing the obtained edge evaluation index (BYP) and encoding evaluation index (BMP), they are then entered into the formula: Obtain completeness index Where r1 and r2 are the weighted influence factors corresponding to the edge judgment index BYP and the coding judgment index BMP, respectively;

[0088] S3: Preset the weighting factors corresponding to the clarity index QXD and the integrity index WZD. After normalizing the clarity index QXD and the integrity index WZD, multiply them by the preset weighting factors and then add them together. The final result is used as the QR code update index.

[0089] The QR code is located using an image recognition algorithm. The number of complete modules is counted, the current QR code encoding standard is obtained, and the theoretical number of modules for the current QR code is obtained from the current QR code encoding standard. The proportion of complete modules is obtained by dividing the number of complete modules by the theoretical number of modules for the current QR code. A threshold for the proportion of complete modules is preset. The difference between the proportion of complete modules and the threshold is obtained. The range of the proportion difference for each group of complete modules is preset, and the proportion score corresponding to each range of the proportion difference for each group is set. The proportion score ZB corresponding to the proportion difference of complete modules is obtained by matching the range of the proportion difference of complete modules. The higher the proportion score ZB, the larger the proportion of complete modules and the better the image printing quality.

[0090] The QR code is divided into a functional graphic area and a data encoding area. Image processing software is used to locate the shaded areas of the functional graphic area and the data encoding area, respectively. The sum of the shaded areas of the functional graphic area and the data encoding area is calculated to obtain the functional shadow area and the encoding shadow area. The area of ​​the functional graphic area and the area of ​​the data encoding area of ​​the printed QR code are obtained. The functional shadow area and the encoding shadow area are divided by the area of ​​the functional graphic area and the area of ​​the data encoding area, respectively, to obtain the shadow rate of the functional area and the shadow rate of the encoding area. The weighting factors corresponding to the shadow rate of the functional area and the shadow rate of the encoding area are preset. The shadow rate of the functional area and the shadow rate of the encoding area are multiplied by the corresponding weighting factors and then added together. The result is used as the comprehensive shadow index YY of the printed QR code.

[0091] After normalizing the percentage score ZB and the comprehensive shading index YY, we input them into the formula: This yields the QR code printing index DY, where and These are the weighted influencing factors corresponding to the percentage score ZB and the comprehensive shadow index YY, respectively.

[0092] By dividing the QR code into a functional graphic area and a data encoding area, the shadow situation of these two key areas can be focused on separately. The functional graphic area is crucial for the positioning and scanning initiation of the QR code, while the data encoding area is directly related to the storage and retrieval of information. Analyzing the shadow parts of these two areas separately avoids the problem of area specificity that may be overlooked in the overall evaluation.

[0093] QR code update module: It has a built-in QR code update index threshold. When the QR code update index is lower than the QR code update index threshold, a new QR code is generated and the QR code update frequency is calculated.

[0094] QR code update monitoring module: It presets a QR code update frequency threshold. When the QR code update frequency exceeds the preset QR code update frequency threshold, it sends a fault detection command to the fault detection module.

[0095] Printing analysis module: Built-in QR code printing index threshold. When the QR code printing index is lower than the QR code printing index threshold, a fault detection command is sent to the fault detection module.

[0096] Fault detection module: Analyzes historical fault information of the printer, builds fault models, and realizes fault detection of the printer;

[0097] The relevant data within a set time interval prior to the printer's historical malfunctions are averaged. Principal component analysis (PCA) is used to extract x feature data types most relevant to each historical malfunction (x>3). The extracted feature data types for each historical malfunction are deduplicated to obtain a feature dataset related to the malfunction. Let p represent the number of feature datasets. The feature datasets corresponding to each historical malfunction are then represented in vector form. , where i represents the historical fault number. This represents the data value corresponding to the p-th feature data;

[0098] First, the staff determines the number of cluster categories, k, which is determined by the number of fault types at the current toll station. A farthest-first algorithm is used to initially select k cluster centers, each corresponding to a fault type. The Euclidean distance metric is used to determine the distance between the vector corresponding to each historical fault and each cluster center. The Euclidean distance calculation formula is as follows: , The data value corresponding to the u-th feature data in vector form representing historical faults. Given the data value corresponding to the u-th feature data of the cluster center, select the cluster center with the smallest Euclidean distance as the cluster corresponding to each historical fault. After classification, calculate the mean of each feature data in each cluster to form a new cluster center. Iterate continuously. Set an iteration stop threshold. When it is detected that the Euclidean distance between all cluster centers and the corresponding next cluster center is less than the set iteration stop threshold, stop the iteration to obtain the vectors corresponding to k cluster centers.

[0099] Setting an iteration stop threshold and stopping the iteration when the corresponding conditions are met can reasonably control the pace and extent of iteration, avoid infinite iteration and waste of computing resources, and ensure that the vectors corresponding to the k cluster centers are optimized and meet the requirements. This provides a reliable basis for subsequent fault diagnosis, prediction and corresponding management decisions based on the clustering results, and helps improve the efficiency and level of toll station fault response.

[0100] When a fault detection command is received, the data corresponding to the feature dataset within the set time interval before the fault detection command is received is obtained. The data is processed using the mean formula and represented as a vector. The Euclidean distance between the current vector and the vectors corresponding to each cluster center is calculated. Each cluster center corresponds to a fault threshold for each group. If the Euclidean distance between the current vector and the vector corresponding to a certain cluster center is less than the fault threshold corresponding to that cluster center, the fault type alarm corresponding to that cluster center is triggered.

[0101] QR code detection module: used to calculate the error indication value of the QR code and determine whether the QR code was generated incorrectly when the car owner reports an error in the amount;

[0102] If a car owner has a question about the payment amount after scanning the QR code, the QR code will be checked. After receiving the QR code check request, the highway toll collector will input the vehicle type, entrance and exit of the target vehicle into the highway toll system to obtain the amount due for the target vehicle and compare it with the amount displayed on the QR code. If the amount is inconsistent, the highway toll collector will confirm it a second time before checking the QR code.

[0103] Using decoding software, locate the binary data of the QR code's stored amount portion and obtain the length G1 of the binary data of the stored amount portion; convert the amount receivable into binary to obtain the length G2 of the binary data corresponding to the amount receivable; perform subtraction on G1 and G2 and take the absolute value, the result as the length error G3; divide G3 by G2 to obtain the length error rate CD.

[0104] By comparing the length of the amount stored in the QR code with the length of the binary data of the amount receivable, the length error and error rate can be calculated, which can accurately quantify the error of the amount data in the length dimension.

[0105] For the binary data of the accounts receivable amount and the binary data of the amount stored in the QR code, starting from the first non-zero data on the left, alignment is performed, and the parts with different numbers in the same position are marked. The number of marked points is counted and recorded as the digit error number SW.

[0106] Obtain the number and area of ​​the data blocks corresponding to the QR code data area, denoted as S1 and S2 respectively. Obtain the number and area of ​​the error correction blocks corresponding to the QR code data area, denoted as J1 and J2 respectively. Use the formula: Obtain the average ratio of data blocks and error correction blocks, extract the standard ratio of data blocks and error correction blocks from the current QR code error correction specification, subtract the standard ratio of data blocks and error correction blocks from the average ratio of data blocks and error correction blocks, and take the absolute value of the result as the ratio difference ZC.

[0107] Considering the number and area of ​​data blocks and error correction blocks in the QR code data area, calculate their average proportion and compare it with the standard proportion to obtain the proportion difference. Evaluate the accuracy of the QR code from the perspective of data structure. This can reflect whether the QR code conforms to the specifications in the overall data structure.

[0108] After normalizing the obtained length error rate CD, digit error number SW, and percentage difference ZC, they are substituted into the formula: This yields the QR code error indication value. Where a1, a2, and a3 are the percentage difference ZC, the place value error, and the number of digits, respectively. The weighted influence factor corresponding to the length error rate CD;

[0109] Preset QR code error indication threshold, set QR code error indication value Compare with the preset QR code error indication value threshold; if the QR code error indication value... If the value is lower than the preset QR code error indication threshold, it is determined that the QR code generation has failed, and the QR code error indication value is adjusted accordingly. The code is sent to the backend developers' email address, who then monitor the entire QR code generation process.

[0110] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to any specific implementation. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A QR code generation system for mobile payment on highways, characterized in that, include: QR code generation module: Used to generate a link address pointing to the invoice download page for this payment record and convert it into a QR code; Data acquisition module: Collects images before and after QR code printing, as well as historical printer fault information; sends the images before and after QR code printing to the data analysis module, and sends the historical printer fault information to the fault detection module; Data analysis module: Analyzes the QR code image before printing and the QR code image after printing to obtain the QR code update index and QR code printing index, which are then sent to the QR code update module and the printing analysis module, respectively. QR code update module: It has a built-in QR code update index threshold. When the QR code update index is lower than the QR code update index threshold, a new QR code is generated and the QR code update frequency is calculated and sent to the QR code update monitoring module. QR code update monitoring module: It presets a QR code update frequency threshold. When the QR code update frequency exceeds the preset QR code update frequency threshold, it sends a fault detection command to the fault detection module. Printing analysis module: Built-in QR code printing index threshold. When the QR code printing index is lower than the QR code printing index threshold, a fault detection command is sent to the fault detection module. Fault detection module: Analyzes historical fault information of the printer, builds fault models, and realizes fault detection of the printer; QR code detection module: Used when car owners report errors in the amount, it calculates the error indicator value of the QR code to determine whether the QR code was generated incorrectly. The specific process is as follows: Using decoding software, locate the binary data of the QR code's stored amount portion and obtain the length G1 of the binary data of the stored amount portion; convert the amount receivable into binary to obtain the length G2 of the binary data corresponding to the amount receivable; perform subtraction on G1 and G2 and take the absolute value, the result as the length error G3; divide G3 by G2 to obtain the length error rate CD. For the binary data of the accounts receivable amount and the binary data of the amount stored in the QR code, starting from the first non-zero data on the left, alignment is performed, and the parts with different numbers in the same position are marked. The number of marked points is counted and recorded as the digit error number SW. Obtain the number and area of ​​the data blocks corresponding to the QR code data area, denoted as S1 and S2 respectively. Obtain the number and area of ​​the error correction blocks corresponding to the QR code data area, denoted as J1 and J2 respectively. Use the formula: Obtain the average ratio of data blocks and error correction blocks, extract the standard ratio of data blocks and error correction blocks from the current QR code error correction specification, subtract the standard ratio of data blocks and error correction blocks from the average ratio of data blocks and error correction blocks, and take the absolute value of the result as the ratio difference ZC. The error indication value of the QR code is calculated based on the length error rate CD, the number of digit errors SW, and the percentage difference ZC.

2. The QR code generation system for mobile payment on highways according to claim 1, characterized in that, The process of generating a QR code is as follows: A communication protocol is selected, and a connection channel is constructed between the highway toll collection system and various payment platforms. The establishment of the connection channel adopts a multi-channel redundancy mechanism. In addition to the main data interface, a backup interface is also set up. When the main channel is interrupted due to network failure or payment platform maintenance, it seamlessly switches to the backup channel. The highway toll collection system initiates a request to the payment platform through the constructed connection channel. The request content includes: transaction order number and key identification information of vehicle passage. Key identification information includes license plate number, lane number, transaction time interval, entrance and exit gate names, and toll amount. After receiving the request, the payment platform sends the request content back to the highway toll system. During this process, an intelligent reconnection and task continuation mechanism is established. The system has a built-in network monitoring thread that detects fluctuations based on heartbeat packets and response timeout thresholds. Once a network anomaly or interruption is detected, the intelligent reconnection logic is immediately activated. After receiving the request, the highway toll collection system verifies the completeness and accuracy of the request according to the verification rules. After the verification is completed, the request is stored in the local database. Obtain a pre-set template with a uniform format from the highway toll system, fill the request content into the template according to the order and format requirements, and thus obtain a unique and complete link address pointing to the download of the invoice for that payment record; Select a QR code encoding standard, encode the complete link address according to the QR code encoding standard, set the error correction level, select an error correction algorithm to analyze the complete link address after encoding conversion, thereby generating an error correction code. Store the complete link address after encoding conversion and the error correction code in the QR code graphic according to the encoding standard and error correction level, thereby generating a QR code pointing to the invoice download page of this payment record.

3. The QR code generation system for highway mobile payment according to claim 1, characterized in that, The specific steps for calculating the QR code update index are as follows: S1: Calculate the clarity index of the QR code: S1-1: Convert the acquired QR code image to grayscale, obtaining the grayscale values ​​of each region of the QR code. Grayscale values ​​below 128 are considered black, and grayscale values ​​above 128 are considered white. Based on the black and white colors, divide the acquired grayscale values ​​into two sets: the grayscale values ​​of the white regions are designated as the high-grayscale set, and the grayscale values ​​of the black regions are designated as the low-grayscale set. Preset a minimum grayscale value for the high-grayscale set, and count the number of grayscale values ​​in the high-grayscale set that are lower than the minimum grayscale value; these are recorded as unqualified high-grayscale values. The grayscale high-value defect rate is calculated by dividing the number of defective items by the total number of items in the grayscale high-value set. For the grayscale low-value set, a maximum grayscale value is preset, and the number of grayscale values ​​greater than the maximum value is counted as the number of defective items. This number is then divided by the total number of items in the grayscale low-value set to obtain the grayscale low-value set defect rate. The average of the grayscale low-value set defect rate and the grayscale high-value set defect rate is taken as the grayscale defect rate BJG. S1-2: Obtain the image contrast (DB) and high-frequency energy percentage (GPB); S1-3: Normalize the obtained grayscale failure rate (BJG) and image contrast (DB) and then input them into the formula: Thus, the grayscale index HDZ is obtained, where a1 and a2 are the weighting factors corresponding to the grayscale failure rate BJG and the image contrast DB, respectively, and Lg represents the logarithmic function with base 10. S1-4: Preset the weighting factors corresponding to the grayscale index HDZ and the high-frequency energy ratio GPB. Multiply the calculated grayscale index HDZ and the high-frequency energy ratio GPB by the corresponding preset weighting factors and then add them together. The result is used as the clarity index QXD of the QR code image. S2: Calculate the integrity index WZD of the QR code; S3: Preset the weighting factors corresponding to the clarity index QXD and the integrity index WZD. After normalizing the clarity index QXD and the integrity index WZD, multiply them by the preset weighting factors and then add them together. The final result is used as the QR code update index.

4. A QR code generation system for mobile payment on highways according to claim 3, characterized in that, The specific steps for calculating the QR code integrity index (WZD) are as follows: The edge detection algorithm is used to locate the edge region of the QR code, calculate the number of broken regions in the edge region and the length of each broken region, preset an invalid value for the broken length, and extract data with broken region lengths higher than the invalid value for analysis. Preset intervals for fracture length, set corresponding weighted influence factors for each interval of fracture length, match the fracture length intervals corresponding to each fracture length to obtain the weighted influence factors for each fracture area, multiply the length of each fracture area by the corresponding weighted influence factor, and sum the results to obtain the fracture length influence value P1. Calculate the total number P2 of fracture regions whose fracture length exceeds the invalid fracture length value, and extract the maximum value P3 among the lengths of each fracture region; After normalizing the obtained fracture length influence value P1, the total number of fracture regions with fracture lengths exceeding the invalid fracture length value P2, and the maximum value of each fracture region length P3, and then substituting them into the formula: Obtain the edge rating index Where u1, u2, and u3 are the weighted influence factors corresponding to P1, P2, and P3, respectively. , and These are the standard values ​​of P1, P2, and P3 extracted from a preset database, respectively, and Lg represents the logarithmic function with base 10. The QR code image is converted to grayscale, the data area of ​​the QR code image is located, and the proportion Z2 of pixels with grayscale values ​​lower than 128 is calculated to account for the total number of pixels. Obtain the encoding standard used by the current QR code, extract the standard proportion range of pixels with a pixel value lower than 128 in the current encoding standard, and extract the median value Z1 of the standard proportion range; Substitute the obtained Z1 and Z2 into the formula: This yields the coding evaluation index BMP, where e is the natural base; After normalizing the obtained edge evaluation index (BYP) and encoding evaluation index (BMP), they are then entered into the formula: Obtain completeness index , where r1 and r2 are the weighted influence factors corresponding to the edge judgment index BYP and the coding judgment index BMP, respectively.

5. A QR code generation system for mobile payment on highways according to claim 1, characterized in that, The specific steps for calculating the QR code printing index DY are as follows: The QR code is located using an image recognition algorithm. The number of complete modules is counted, the current QR code encoding standard is obtained, and the theoretical number of modules for the current QR code is obtained from the current QR code encoding standard. The proportion of complete modules is obtained by dividing the number of complete modules by the theoretical number of modules for the current QR code. A threshold for the proportion of complete modules is preset. The difference between the proportion of complete modules and the threshold is obtained by subtracting the threshold from the proportion of complete modules. The range of the proportion difference for each group of complete modules is preset, and the proportion score corresponding to each group of the proportion difference range is set. The proportion score ZB corresponding to the proportion difference is obtained by matching the proportion difference range of complete modules. The QR code is divided into a functional graphic area and a data encoding area. Image processing software is used to locate the shaded areas of the functional graphic area and the data encoding area, respectively. The sum of the shaded areas of the functional graphic area and the data encoding area is calculated to obtain the functional shadow area and the encoding shadow area. The area of ​​the functional graphic area and the area of ​​the data encoding area of ​​the printed QR code are obtained. The functional shadow area and the encoding shadow area are divided by the area of ​​the functional graphic area and the area of ​​the data encoding area, respectively, to obtain the shadow rate of the functional area and the shadow rate of the encoding area. The weighting factors corresponding to the shadow rate of the functional area and the shadow rate of the encoding area are preset. The shadow rate of the functional area and the shadow rate of the encoding area are multiplied by the corresponding weighting factors and then added together. The result is used as the comprehensive shadow index YY of the printed QR code. After normalizing the percentage score ZB and the comprehensive shading index YY, we input them into the formula: This yields the QR code printing index DY, where and These are the weighted influencing factors corresponding to the percentage score ZB and the comprehensive shadow index YY, respectively.

6. A QR code generation system for mobile payment on highways according to claim 1, characterized in that, The specific steps for constructing a fault model and performing fault detection on the printer are as follows: The relevant data within a set time interval prior to the printer's historical malfunctions are averaged. For each historical malfunction, x feature data types most relevant to that malfunction are extracted (x>3). The extracted feature data types corresponding to each historical malfunction are deduplicated to obtain a feature dataset related to the malfunction. Let p represent the number of feature datasets. Represent the feature datasets corresponding to each historical malfunction in vector form. , where i represents the historical fault number. This represents the data value corresponding to the p-th feature data; First, the staff determines the number of cluster categories k, which is determined by the number of fault types at the current toll station. The farthest point first algorithm is used to initially select k cluster centers, each cluster center corresponding to a fault type. The Euclidean distance method is used to determine the distance between the vector corresponding to each historical fault and each cluster center point. The cluster center with the smallest Euclidean distance is selected as the cluster corresponding to each historical fault. After classification, the mean of each feature data in each cluster is calculated to form a new cluster center. This process is continuously iterated. Set an iteration stopping threshold. When the Euclidean distance between all cluster centers and the corresponding next cluster center is less than the set iteration stopping threshold, the iteration stops, thus obtaining the vectors corresponding to the k cluster centers. When a fault detection command is received, the system acquires the data corresponding to the feature dataset within a set time interval prior to receiving the command, processes the data using the mean formula, and represents it as a vector. The system calculates the Euclidean distance between the current vector and the vectors corresponding to each cluster center, and presets the fault thresholds for each cluster center. If the Euclidean distance between the current vector and the vector corresponding to a certain cluster center is less than the fault threshold corresponding to that cluster center, the system triggers an alarm for the fault type corresponding to that cluster center.

Citation Information

Patent Citations

  • Two-dimension code printing quality online assessment method

    CN105160339A

  • Image forming device

    JP2007206904A