An NFC card reading compensation method, device, equipment and medium

By receiving and parsing card data packets in the NFC card reader system, performing data verification and status judgment, and automatically converting and compensating for data format conversion, the problems of insufficient reading reliability and fault tolerance are solved, and production efficiency is improved.

CN122120741APending Publication Date: 2026-05-29CHONGQING POLYCOMP INT

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING POLYCOMP INT
Filing Date
2026-03-13
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing NFC card reading systems suffer from reliability issues, poor fault tolerance, and a lack of data compensation mechanisms in industrial automated production lines, leading to production process interruptions and inefficiencies.

Method used

The system receives and parses the card data packets from the NFC component, performs data verification, and uses the 5G private network to read the controller status flag to determine the reading status. If the reading fails, it performs format conversion and writes compensation data to achieve automated data compensation.

Benefits of technology

It improves the success rate of NFC card reading, reduces production interruptions caused by recognition failures, increases processing efficiency, does not occupy PLC resources, and is easy to integrate and upgrade.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122120741A_ABST
    Figure CN122120741A_ABST
Patent Text Reader

Abstract

The application discloses an NFC card reading compensation method and device, equipment and medium, apply to compensation system, relate to computer technology field, including: receiving the card data package that NFC component obtains through continuous scanning of a preset induction area, and analyzing the card data package to obtain target NFC data; the target NFC data is verified, if it is passed, the state flag bit of the target controller connected is read through the preset 5G private network, and whether the target controller is reading data is judged through the state flag bit; if yes, the original NFC data in the target controller is read, and whether the target controller reads data fails is determined based on the original NFC data; if it fails, the target NFC data is format converted to obtain compensation data, and the compensation data is written into the target controller to complete data compensation. Therefore, the NFC card reading success rate can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an NFC card reader compensation method, apparatus, device, and medium. Background Technology

[0002] In modern industrial automated production lines, NFC (Near Field Communication) technology is widely used in product traceability, identification, and data transmission. However, current NFC card reading systems often have some problems, such as read reliability issues: due to factors such as electromagnetic interference, NFC tag angle misalignment, and tag damage in industrial environments, the read success rate of a single NFC module cannot reach 100%, and read failures or incomplete data frequently occur; poor system fault tolerance: once an NFC read fails, it often leads to the interruption of the entire production process or the loss of product information, affecting production efficiency and product traceability; and a lack of data compensation mechanisms: there are no automated error detection and data compensation mechanisms, requiring manual intervention to handle abnormal situations. Summary of the Invention

[0003] In view of this, the purpose of this invention is to provide an NFC card reader compensation method, apparatus, device, and medium, which can effectively improve the NFC card reader success rate and reduce production interruptions caused by recognition failures through a compensation mechanism, thereby effectively improving processing efficiency. The specific solution is as follows: Firstly, this application discloses an NFC card reader compensation method, applied to a compensation system, comprising: The system receives card data packets acquired by the NFC component through continuous scanning of a preset sensing area, and parses the card data packets according to the component type corresponding to the NFC component to obtain the target NFC data. The target NFC data is verified by a preset data verification rule. If the target NFC data passes the verification, the status flag of the connected target controller is read through a preset 5G private network, and the status flag is used to determine whether the target controller is reading data. If the target controller is reading data, then read the original NFC data in the target controller, and determine whether the target controller has failed to read data based on the original NFC data; If the target controller fails to read data, the target NFC data is format-converted to obtain compensation data, and the compensation data is written to the target controller to complete the data compensation.

[0004] Optionally, before the receiving NFC component continuously scans the card data packet acquired by the NFC component through a preset sensing area and parses the card data packet according to the component type corresponding to the NFC component to obtain the target NFC data, the method further includes: If a power-on command is received, a TCP connection is established with the target controller via a preset 5G private network, and a preset serial port connection is established with the NFC component for initialization. Accordingly, the receiving NFC component acquires card data packets by continuously scanning a preset sensing area, and parses the card data packets according to the component type corresponding to the NFC component to obtain target NFC data, including: The system receives card data packets acquired by the NFC component through continuous scanning of a preset sensing area via a preset serial port, and selects the corresponding target parsing protocol based on the component type of the NFC component to parse the card data packets through the target parsing protocol to obtain the target NFC data.

[0005] Optionally, verifying the target NFC data using preset data verification rules includes: The target NFC data is length-checked to determine whether the data length of the target NFC data is greater than a preset data length. The target NFC data is then format-verified to determine whether it is a purely digital format. And, perform flag bit verification on the target NFC data to determine whether the target flag bit in the target NFC data is a valid value; And, perform duplicate data verification on the target NFC data to determine whether the target NFC data is a duplicate of the previously read historical NFC data; If the data length of the target NFC data is not greater than the preset data length, the target NFC data is in pure digital format, the target flag bit is a valid value, and the target NFC data does not repeat the historical NFC data, then the target NFC data is determined to have passed verification; otherwise, the target NFC data is determined to have failed verification.

[0006] Optionally, the step of reading the status flag of the connected target controller through a preset 5G private network and determining whether the target controller is reading data through the status flag includes: The status flag bit of the connected target controller is read through the preset 5G private network, and it is determined whether the status flag bit value corresponding to the status flag bit is the preset flag bit value. If the status flag value is inconsistent with the preset flag value, it is determined that the target controller is reading data. If the status flag value is consistent with the preset flag value, it is determined that the target controller has not read data.

[0007] Optionally, the step of reading the raw NFC data in the target controller and determining whether the target controller failed to read data based on the raw NFC data includes: Read the raw NFC data in the target controller and determine the target bit data in the raw NFC data that corresponds to the preset target bit; If the target bit data is consistent with the preset target bit data, then it is determined that the target controller failed to read the data.

[0008] Optionally, the process of converting the target NFC data into a format to obtain compensation data includes: According to a preset mapping rule, the target NFC data is mapped from the current byte format to the target byte format corresponding to the target controller to obtain compensation data; the preset mapping rule is to map the target NFC data from the first byte to the last byte to the end of the target NFC data in sequence until the target NFC data meets the target byte format.

[0009] Optionally, after converting the target NFC data to obtain compensation data, the method further includes: If the data compensation is successful, the target counter in the compensation system is updated, and the operation log of this data compensation is recorded. Then, the process jumps to the step where the receiving NFC component obtains the card data packet by continuously scanning the preset sensing area, and parses the card data packet according to the component type corresponding to the NFC component to obtain the target NFC data, so as to perform the next data compensation. The target counter is a counter used to record the number of successful data compensations.

[0010] Secondly, this application discloses an NFC card reader compensation device, applied to a compensation system, comprising: The data parsing module is used to receive the card data packet obtained by the NFC component through continuous scanning of the preset sensing area, and to parse the card data packet according to the component type corresponding to the NFC component to obtain the target NFC data. The reading and judgment module is used to verify the target NFC data according to the preset data verification rules. If the target NFC data passes the verification, the status flag bit of the connected target controller is read through the preset 5G private network, and the status flag bit is used to determine whether the target controller is reading data. The read failure judgment module is used to read the original NFC data in the target controller if the target controller is reading data, and determine whether the target controller has failed to read data based on the original NFC data; The data compensation module is used to convert the format of the target NFC data to obtain compensation data if the target controller fails to read the data, and then write the compensation data to the target controller to complete the data compensation.

[0011] Thirdly, this application discloses an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the NFC card reader compensation method as described above.

[0012] Fourthly, this application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned NFC card reader compensation method.

[0013] In this application, a card data packet acquired by an NFC component through continuous scanning of a preset sensing area can be received, and the card data packet can be parsed according to the component type corresponding to the NFC component to obtain target NFC data. The target NFC data is verified through a preset data verification rule. If the target NFC data passes verification, the status flag bit of the connected target controller is read through a preset 5G private network, and the status flag bit is used to determine whether the target controller is reading data. If the target controller is reading data, the original NFC data in the target controller is read, and the original NFC data is used to determine whether the target controller has failed to read data. If the target controller fails to read data, the target NFC data is format-converted to obtain compensation data, and the compensation data is written to the target controller to complete the data compensation.

[0014] Therefore, the method of this application can receive card data packets acquired by the NFC component through continuous scanning of a preset sensing area, parse the card data packets to obtain the target NFC data, verify the target NFC data, and if the verification is successful, read the status flag bit of the connected target controller through a preset 5G private network to determine whether the target controller is reading data; if so, read the original NFC data in the target controller and determine whether the target controller has failed to read data based on the original NFC data; if it fails, convert the target NFC data to obtain compensation data, and write the compensation data to the target controller to complete the data compensation. In this way, the NFC card reading success rate can be effectively improved through the compensation mechanism, reducing production interruptions caused by recognition failures. Furthermore, the compensation system is deployed independently through a 5G private network, without modifying the original PLC program, without occupying PLC resources, is easy to integrate and upgrade, and can be used immediately after installation, effectively improving processing efficiency. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0016] Figure 1 This is a flowchart of an NFC card reader compensation method disclosed in this application; Figure 2 This is a schematic diagram of the processing flow of an NFC card reader compensation method disclosed in this application; Figure 3 This is a schematic diagram of the processing flow of an NFC card reader compensation method disclosed in this application; Figure 4 This is a schematic diagram of the architecture of an NFC card reader compensation method disclosed in this application; Figure 5 This is a schematic diagram of the structure of an NFC card reader compensation device disclosed in this application; Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] Current NFC card reading systems often have some problems, such as reading reliability issues, poor system fault tolerance, and lack of data compensation mechanisms, which in turn affect production efficiency.

[0019] To overcome the aforementioned technical problems, this application discloses an NFC card reading compensation method, device, equipment, and medium. Through the compensation mechanism, the success rate of NFC card reading can be effectively improved, production interruptions caused by recognition failures can be reduced, and thus processing efficiency can be effectively improved.

[0020] See Figure 1 As shown, this embodiment of the invention discloses an NFC card reader compensation method, applied to a compensation system, comprising: Step S11: Receive the card data packet obtained by the NFC component through continuous scanning of the preset sensing area, and parse the card data packet according to the component type corresponding to the NFC component to obtain the target NFC data.

[0021] In this embodiment, as Figure 2 As shown, before acquiring data, a communication connection needs to be established with the NFC component (i.e., the NFC module) and the target controller. Specifically, upon receiving a power-on command, a TCP connection is established with the target controller via a preset 5G private network, and a preset serial port connection with the NFC component is initialized. When the compensation control host starts, a TCP (Transmission Control Protocol) connection is established with the PLC (Programmable Logic Controller), i.e., the target controller, via the 5G network, and an RS485 serial port connection with the NFC module is initialized.

[0022] Furthermore, such as Figure 2As shown, after the compensation system corresponding to the compensation control host starts, it needs to receive the card data packets acquired by the NFC component through continuous scanning of the preset sensing area, and parse the card data packets according to the component type of the NFC component to obtain the target NFC data. Specifically, it needs to receive the card data packets acquired by the NFC component through continuous scanning of the preset sensing area via a preset serial port, and select the corresponding target parsing protocol based on the component type of the NFC component to parse the card data packets and obtain the target NFC data. It should be noted that the NFC component will continuously scan the preset sensing area, and when it detects an NFC tag, it will automatically read the card data and send it to the compensation control host via RS485. For the compensation control system, it needs to receive the card data packets acquired by the NFC component through continuous scanning of the preset sensing area via a preset serial port, and select the corresponding target parsing protocol based on the component type of the NFC component to parse the card data packets and obtain the target NFC data. Specifically, when the compensation control host receives the data returned by the NFC module, it needs to select the corresponding parsing protocol according to the configured module type of the NFC module to parse the card data packets and extract the valid NFC chip data. It should be noted that NFC modules come in different types, such as large antenna or small antenna.

[0023] Step S12: Verify the target NFC data according to the preset data verification rules. If the target NFC data passes the verification, read the status flag bit of the connected target controller through the preset 5G private network, and determine whether the target controller is reading data through the status flag bit.

[0024] In this embodiment, as Figure 2As shown, after obtaining the target NFC data, it needs to be verified. Several verifications are required, specifically: First, the target NFC data needs to be length-checked to determine if its length exceeds a preset data length. This length check verifies whether the target NFC data is longer than the preset length, i.e., whether it exceeds 16 bytes. Second, the target NFC data needs to be format-checked to determine if it is a purely digital format. Third, the target NFC data needs to be flag-checked to determine if the target flag bits are valid values. This flag-check checks whether bits 16 and 17 are valid values ​​(non-zero values). Fourth, the target NFC data needs to be duplicated to determine if it is the same as previously read historical NFC data, thus avoiding duplicate processing.

[0025] It should be noted that if the target NFC data length is no greater than the preset data length, the target NFC data is in pure digital format, the target flag bit is a valid value, and the target NFC data does not repeat historical NFC data, then the target NFC data is deemed to have passed verification; otherwise, the target NFC data is deemed to have failed verification. In other words, if the target NFC data fails any of the above verifications, it indicates that the current target NFC data is unqualified.

[0026] Furthermore, such as Figure 2As shown, it is necessary to determine the current system status of the receiving system corresponding to the target controller. Specifically, it is necessary to read the status flag bit of the connected target controller through a preset 5G private network and determine whether the status flag bit value is the preset flag bit value. If the status flag bit value is inconsistent with the preset flag bit value, it is determined that the target controller is reading data; if the status flag bit value is consistent with the preset flag bit value, it is determined that the target controller is not reading data. It should be noted that it is necessary to read the PLC's status flag bit through the 5G network. In this embodiment, the status flag bit is DB17.8.0. If the data corresponding to this flag bit is 1, it indicates that the status flag bit value is inconsistent with the preset flag bit value 0, so it can be determined that the target controller is reading data. If the data corresponding to this flag bit is 0, it indicates that the status flag bit value is consistent with the preset flag bit value 0, so it can be determined that the target controller is reading data. In this way, through multiple verification mechanisms, namely length verification, format verification, key bit verification, and deduplication verification, the correctness of data can be ensured, avoiding product traceability issues caused by erroneous data. Furthermore, the compensation system is deployed independently through a 5G private network without modifying the original PLC program, without occupying PLC resources, and is easy to integrate and upgrade, enabling it to be used immediately after installation.

[0027] Step S13: If the target controller is reading data, read the original NFC data in the target controller and determine whether the target controller has failed to read data based on the original NFC data.

[0028] In this embodiment, as Figure 2 As shown, if the target controller is reading data, there is a possibility of reading failure. In this case, card reading compensation is required. Therefore, it is necessary to determine whether the target controller has failed to read data. Specifically, it is necessary to read the original NFC data in the target controller and determine the target bit data corresponding to the preset target bit in the original NFC data. If the target bit data matches the preset target bit data, it is determined that the target controller has failed to read data. It should be noted that when the receiving system in the target controller is reading data, it needs to read the original NFC data DB206.704 in the target controller and then check whether the target bit data in the original NFC data, that is, the 16th and 17th bits, is 0. If it is 0, it is determined that the target controller has failed to read data.

[0029] Step S14: If the target controller fails to read data, the target NFC data is format-converted to obtain compensation data, and the compensation data is written to the target controller to complete the data compensation.

[0030] In this embodiment, as Figure 2As shown, if the target controller fails to read data, NFC card reading compensation is required. Specifically, the target NFC data needs to be mapped from its current byte format to the target byte format corresponding to the target controller according to a preset mapping rule to obtain compensation data. This compensation data is then written to the target controller to complete the data compensation. It should be noted that the preset mapping rule for format conversion maps the target NFC data sequentially from the first byte to the last byte until the target NFC data meets the target byte format. It should also be noted that in this embodiment, the preset mapping rule corresponds to a specific mapping algorithm, namely the ReverseConvertData algorithm.

[0031] For example Figure 3 Taking the specific case shown as an example, the 17 bytes of data from the NFC module are reassembled into the 36-byte format required by the PLC. The specific mapping relationship is as follows: original data [0] is mapped to target

[18] , original data [1] is mapped to target

[17] , original data [2] is mapped to target

[16] , original data [3] is mapped to target

[23] , original data [4] is mapped to target

[22] , original data [5] is mapped to target

[21] , original data [6] is mapped to target

[20] , and original data [7] is mapped to target

[21] .

[27] , original data [8] is mapped to target

[26] , original data [9] is mapped to target

[25] , original data

[10] is mapped to target

[24] , original data

[11] is mapped to target

[31] , original data

[12] is mapped to target

[30] , original data

[13] is mapped to target

[29] , original data

[14] is mapped to target

[28] , original data

[15] is mapped to target

[35] , original data

[16] is mapped to target

[34] . After mapping, the converted compensation data is obtained.

[0032] Furthermore, after completing this data compensation, if successful, the target counter in the compensation system is updated, and the operation log for this data compensation is recorded. Then, the system jumps to the step of receiving the card data packet acquired by the NFC component through continuous scanning of the preset sensing area, and parsing the card data packet according to the corresponding component type of the NFC component to obtain the target NFC data, in order to perform the next data compensation. The target counter is used to record the number of successful data compensations. In this way, fully automated compensation can be achieved without manual intervention. The system automatically detects, judges, and compensates, reducing maintenance costs and effectively improving production efficiency.

[0033] Therefore, in this embodiment, the system can receive card data packets acquired by the NFC component through continuous scanning of a preset sensing area, parse the card data packets to obtain the target NFC data, verify the target NFC data, and if the verification is successful, read the status flag bit of the connected target controller through a preset 5G private network to determine whether the target controller is reading data; if so, read the original NFC data in the target controller and determine whether the target controller has failed to read data based on the original NFC data; if it fails, convert the target NFC data to obtain compensation data, and write the compensation data to the target controller to complete the data compensation. In this way, the compensation mechanism can effectively improve the NFC card reading success rate, reduce production interruptions caused by recognition failures, and the compensation system can be deployed independently through a 5G private network without modifying the original PLC program, without occupying PLC resources, and is easy to integrate and upgrade, achieving plug-and-play functionality and effectively improving processing efficiency.

[0034] As a preferred embodiment, such as Figure 4The diagram illustrates the architecture of the NFC card reader compensation method of this application, comprising three parts: an NFC card reader module component, a 5G communication module, and a compensation control host. The NFC card reader module component includes at least one NFC card reader module, supporting standard protocols such as ISO15693 and Mifare S50. It can be configured as a large antenna module or a small antenna module to adapt to different reading distance requirements and communicates with the compensation host via an RS485 interface. The 5G communication module employs customized 5G private network communication technology, providing low-latency, high-reliability data transmission. It establishes a connection with the PLC system via the TCP / IP protocol, a mainstream PLC communication protocol. The compensation control host includes the following functional units: a serial communication management unit (managing RS485 communication with the NFC module and receiving NFC read data), a PLC communication unit (establishing a TCP connection with the PLC via a 5G network and reading / writing PLC data blocks), a data detection unit (monitoring the NFC data status flag bit in the PLC in real time (DB17.8.0) and detecting original system read failure events), a data verification unit (verifying the format of received NFC data (length check, number format check), a data conversion unit (converting the raw data returned by the NFC module into the data format required by the PLC), a compensation decision unit (determining whether data compensation is needed to avoid duplicate writing), a data writing unit (writing the verified compensation data to the designated data block in the PLC (DB14.704), and a status monitoring unit (displaying the system operating status, number of successful reads, and number of successful compensations in real time). It should be noted that one PLC can control multiple production lines, supporting up to eight production lines. This allows for simultaneous management of NFC compensation across multiple production lines, centralized monitoring and management, and effectively improves production efficiency. Furthermore, by utilizing the low latency characteristics of 5G private networks, the compensation response time is within 100ms, which can meet the requirements of high-speed production lines.

[0035] See Figure 5 As shown, this embodiment of the invention discloses an NFC card reader compensation method, applied to a compensation system, comprising: The data parsing module 11 is used to receive the card data packet obtained by the NFC component through continuous scanning of the preset sensing area, and to parse the card data packet according to the component type corresponding to the NFC component to obtain the target NFC data. The reading and judgment module 12 is used to verify the target NFC data according to the preset data verification rules. If the target NFC data passes the verification, the status flag bit of the connected target controller is read through the preset 5G private network, and the status flag bit is used to determine whether the target controller is reading data. The read failure judgment module 13 is used to read the original NFC data in the target controller if the target controller is reading data, and determine whether the target controller has failed to read data based on the original NFC data; The data compensation module 14 is used to convert the format of the target NFC data to obtain compensation data if the target controller fails to read the data, and write the compensation data to the target controller to complete the data compensation.

[0036] Therefore, in this embodiment, the system can receive card data packets acquired by the NFC component through continuous scanning of a preset sensing area, parse the card data packets to obtain the target NFC data, verify the target NFC data, and if the verification is successful, read the status flag bit of the connected target controller through a preset 5G private network to determine whether the target controller is reading data; if so, read the original NFC data in the target controller and determine whether the target controller has failed to read data based on the original NFC data; if it fails, convert the target NFC data to obtain compensation data, and write the compensation data to the target controller to complete the data compensation. In this way, the compensation mechanism can effectively improve the NFC card reading success rate, reduce production interruptions caused by recognition failures, and the compensation system can be deployed independently through a 5G private network without modifying the original PLC program, without occupying PLC resources, and is easy to integrate and upgrade, achieving plug-and-play functionality and effectively improving processing efficiency.

[0037] In some embodiments, the NFC card reader compensation device may further include: The connection establishment unit is used to establish a TCP connection with the target controller through a preset 5G private network and to connect to the preset serial port of the NFC component when a power-on command is received.

[0038] In some embodiments, the data parsing module 11 may specifically include: The data packet parsing unit is used to receive card data packets obtained by the NFC component through continuous scanning of a preset sensing area via a preset serial port, and select the corresponding target parsing protocol based on the component type corresponding to the NFC component, so as to parse the card data packets through the target parsing protocol to obtain target NFC data.

[0039] In some embodiments, the reading determination module 12 may specifically include: A length verification unit is used to perform length verification on the target NFC data to determine whether the data length of the target NFC data is greater than a preset data length. A format verification unit is used to perform format verification on the target NFC data to determine whether the target NFC data is in a pure digital format. A flag bit verification unit is used to perform flag bit verification on the target NFC data to determine whether the target flag bit in the target NFC data is a valid value. A duplicate data verification unit is used to perform duplicate data verification on the target NFC data to determine whether the target NFC data is duplicated with the previously read historical NFC data. The verification confirmation unit is configured to determine that the target NFC data passes verification if the data length of the target NFC data is not greater than the preset data length, the target NFC data is in pure digital format, the target flag bit is a valid value, and the target NFC data does not repeat the historical NFC data; otherwise, it determines that the target NFC data fails verification.

[0040] In some embodiments, the reading determination module 12 may specifically include: The status flag bit determination unit is used to read the status flag bit of the connected target controller through a preset 5G private network, and determine whether the status flag bit value corresponding to the status flag bit is a preset flag bit value. The first state determination unit is used to determine that the target controller is reading data if the state flag value is inconsistent with the preset flag value. The second state determination unit is used to determine that the target controller has not read data if the state flag value is consistent with the preset flag value.

[0041] In some embodiments, the read failure determination module 13 may specifically include: The raw data reading unit is used to read the raw NFC data in the target controller and determine the target bit data in the raw NFC data that corresponds to the preset target bit; The read failure judgment unit is used to determine that the target controller has failed to read data if the target bit data is consistent with the preset target bit data.

[0042] In some embodiments, the data compensation module 14 may specifically include: The data compensation unit is used to map the target NFC data from the current byte format to the target byte format corresponding to the target controller according to a preset mapping rule, so as to obtain compensation data; the preset mapping rule is to map the target NFC data from the first byte to the last byte to the end of the target NFC data in sequence until the target NFC data meets the target byte format.

[0043] In some embodiments, the NFC card reader compensation device may further include: The data compensation loop unit is used to update the target counter in the compensation system and record the operation log of this data compensation if the current data compensation is successful. Then, it jumps to the step where the receiving NFC component obtains the card data packet by continuously scanning the preset sensing area and parses the card data packet according to the component type corresponding to the NFC component to obtain the target NFC data, so as to perform the next data compensation. The target counter is a counter used to record the number of successful data compensations.

[0044] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0045] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the NFC card reader compensation method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0046] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0047] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0048] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the NFC card reading compensation method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.

[0049] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed NFC card reader compensation method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0050] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0051] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0052] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0053] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0054] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An NFC card reader compensation method, characterized in that, Applied to compensation systems, including: The system receives card data packets acquired by the NFC component through continuous scanning of a preset sensing area, and parses the card data packets according to the component type corresponding to the NFC component to obtain the target NFC data. The target NFC data is verified by a preset data verification rule. If the target NFC data passes the verification, the status flag of the connected target controller is read through a preset 5G private network, and the status flag is used to determine whether the target controller is reading data. If the target controller is reading data, then read the original NFC data in the target controller, and determine whether the target controller has failed to read data based on the original NFC data; If the target controller fails to read data, the target NFC data is format-converted to obtain compensation data, and the compensation data is written to the target controller to complete the data compensation.

2. The NFC card reader compensation method according to claim 1, characterized in that, Before the receiving NFC component continuously scans the card data packet acquired by the NFC component through a preset sensing area, and parses the card data packet according to the component type corresponding to the NFC component to obtain the target NFC data, the method further includes: If a power-on command is received, a TCP connection is established with the target controller via a preset 5G private network, and a preset serial port connection is established with the NFC component for initialization. Accordingly, the receiving NFC component acquires card data packets by continuously scanning a preset sensing area, and parses the card data packets according to the component type corresponding to the NFC component to obtain target NFC data, including: The system receives card data packets acquired by the NFC component through continuous scanning of a preset sensing area via a preset serial port, and selects the corresponding target parsing protocol based on the component type of the NFC component to parse the card data packets through the target parsing protocol to obtain the target NFC data.

3. The NFC card reader compensation method according to claim 1, characterized in that, The verification of the target NFC data using preset data verification rules includes: The target NFC data is length-checked to determine whether the data length of the target NFC data is greater than a preset data length. The target NFC data is then format-verified to determine whether it is a purely digital format. And, perform flag bit verification on the target NFC data to determine whether the target flag bit in the target NFC data is a valid value; And, perform duplicate data verification on the target NFC data to determine whether the target NFC data is a duplicate of the previously read historical NFC data; If the data length of the target NFC data is not greater than the preset data length, the target NFC data is in pure digital format, the target flag bit is a valid value, and the target NFC data does not repeat the historical NFC data, then the target NFC data is determined to have passed verification; otherwise, the target NFC data is determined to have failed verification.

4. The NFC card reader compensation method according to claim 1, characterized in that, The step of reading the status flag of the connected target controller through a preset 5G private network and determining whether the target controller is reading data based on the status flag includes: The status flag bit of the connected target controller is read through the preset 5G private network, and it is determined whether the status flag bit value corresponding to the status flag bit is the preset flag bit value. If the status flag value is inconsistent with the preset flag value, it is determined that the target controller is reading data. If the status flag value is consistent with the preset flag value, it is determined that the target controller has not read data.

5. The NFC card reader compensation method according to claim 1, characterized in that, The step of reading the raw NFC data from the target controller and determining whether the target controller failed to read data based on the raw NFC data includes: Read the raw NFC data in the target controller and determine the target bit data in the raw NFC data that corresponds to the preset target bit; If the target bit data is consistent with the preset target bit data, then it is determined that the target controller failed to read the data.

6. The NFC card reader compensation method according to claim 1, characterized in that, The process of converting the target NFC data to obtain compensation data includes: According to a preset mapping rule, the target NFC data is mapped from the current byte format to the target byte format corresponding to the target controller to obtain compensation data; the preset mapping rule is to map the target NFC data from the first byte to the last byte to the end of the target NFC data in sequence until the target NFC data meets the target byte format.

7. The NFC card reader compensation method according to any one of claims 1 to 6, characterized in that, After converting the target NFC data to obtain compensation data, the method further includes: If the data compensation is successful, the target counter in the compensation system is updated, and the operation log of this data compensation is recorded. Then, the process jumps to the step where the receiving NFC component obtains the card data packet by continuously scanning the preset sensing area, and parses the card data packet according to the component type corresponding to the NFC component to obtain the target NFC data, so as to perform the next data compensation. The target counter is a counter used to record the number of successful data compensations.

8. An NFC card reader compensation device, characterized in that, Applied to compensation systems, including: The data parsing module is used to receive the card data packet obtained by the NFC component through continuous scanning of the preset sensing area, and to parse the card data packet according to the component type corresponding to the NFC component to obtain the target NFC data. The reading and judgment module is used to verify the target NFC data according to the preset data verification rules. If the target NFC data passes the verification, the status flag bit of the connected target controller is read through the preset 5G private network, and the status flag bit is used to determine whether the target controller is reading data. The read failure judgment module is used to read the original NFC data in the target controller if the target controller is reading data, and determine whether the target controller has failed to read data based on the original NFC data; The data compensation module is used to convert the format of the target NFC data to obtain compensation data if the target controller fails to read the data, and then write the compensation data to the target controller to complete the data compensation.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the NFC card reader compensation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the NFC card reader compensation method as described in any one of claims 1 to 7.