A smart card reader, communication equipment and system
By using a multi-module collaborative design for the smart card reader, the problems of portability and insufficient intelligent diagnosis in traditional SIM card debugging equipment are solved, achieving wireless operation, real-time display, and efficient fault diagnosis, thus meeting the debugging needs of IoT devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- SHANGHAI TUGE DATA TECH CO LTD
- Filing Date
- 2025-06-10
- Publication Date
- 2026-06-30
AI Technical Summary
Traditional SIM card debugging equipment relies on wired interfaces, which limits portability and lacks real-time display and intelligent diagnostics, failing to meet the wireless, intelligent, and efficient needs of the Internet of Things era.
Design a smart card reader device, comprising a main control module, a smart card module, an LED module, a Bluetooth module, a display module, and a power supply module, to realize wireless communication, real-time display, and embedded monitoring. Through MCU oscillation circuit, OLED display, lithium battery charging, and automatic power supply switching, it supports dual-line display, Bluetooth remote transmission, and LED fault feedback.
It improves the portability and operational efficiency of debugging equipment, realizes intelligent real-time data feedback and fault diagnosis, shortens the debugging cycle, and adapts to the wireless and intelligent needs of IoT devices.
Smart Images

Figure CN224436895U_ABST
Abstract
Description
Technical Field
[0001] This utility model relates to the field of communications, specifically to a smart card reader, communication equipment, and system. Background Technology
[0002] Traditional SIM card debugging equipment suffers from numerous technical drawbacks: In terms of connectivity, it relies on traditional wired interfaces, such as USB, which not only limits portability and fails to meet remote debugging needs but also lacks operational flexibility due to the absence of an interactive interface. Regarding data interaction and display, an external computer is required to view communication data during debugging, complicating the process, resulting in poor real-time performance and difficulty in quickly responding to data feedback. In fault diagnosis, the equipment lacks embedded algorithms and hardware-level automatic monitoring capabilities, failing to identify SIM card insertion / removal status, poor contact, or missing files in real time, relying entirely on manual troubleshooting, leading to low efficiency and a high risk of errors. Furthermore, most existing technologies are single-function designs; some devices only support Bluetooth communication without local real-time display, or only have a display screen but cannot implement APDU (Application Protocol Data Unit) command interaction. There is a lack of innovative solutions that integrate multiple modules such as Bluetooth communication, real-time data display, intelligent diagnostics, and dual power supply modes, making it difficult to meet the comprehensive demands of the Internet of Things era for wireless, intelligent, portable, and efficient debugging equipment.
[0003] Furthermore, current technology lacks intelligent diagnostics and embedded algorithms for real-time monitoring of SIM card status, making troubleshooting reliant on manual methods. Early designs were not adapted to the wireless and intelligent requirements of the Internet of Things and mobile scenarios.
[0004] To address the aforementioned issues, existing technologies urgently need improvement. Utility Model Content
[0005] In view of the above-mentioned deficiencies of the prior art, the first aspect of this utility model provides a smart card reading method, comprising: a main control module, a smart card module, an LED module, a Bluetooth module, a display module, and a power supply module; wherein the main control module is communicatively connected to the smart card module, the Bluetooth module, and the display module respectively, the LED module is physically connected to the main control module, and the power supply module is physically connected to the main control module, the smart card module, the LED module, the Bluetooth module, and the display module;
[0006] The main control module includes an MCU (Microcontroller Unit) oscillation circuit and a main control module circuit. The MCU oscillation circuit is used to provide the main control clock signal, and the main control module circuit is used for communication control.
[0007] The smart card module includes a card slot circuit for physically connecting the SIM card and providing IO (Input / Output) signals, CLK (Clock) signals, and RST (Reset) signals.
[0008] The LED module includes an indicator circuit that uses a three-state indicator to show whether the LED is constantly lit, flashing, or off based on high and low level signals, thus providing feedback on the current status of the SIM card.
[0009] The Bluetooth module includes a Bluetooth module circuit for wireless communication between the main control module and external terminal devices.
[0010] The display module includes an OLED display module circuit for displaying SIM card commands and response data;
[0011] The power module includes a lithium battery charging circuit, a power conversion circuit, and a step-down circuit; wherein, the lithium battery charging circuit charges and protects the lithium battery, the power conversion circuit automatically switches between USB power supply and lithium battery power supply, and the step-down circuit provides a stable voltage source for the entire system.
[0012] In the smart card reader as described above, optionally, the MCU oscillation circuit includes a clock circuit, the clock circuit comprising:
[0013] The Low Speed External (LSE) unit is connected to the PC14 and PC15 pins of the main control chip to provide a clock source for the Real Time Clock (RTC).
[0014] The High Speed External (HSE) unit connects to an external crystal oscillator via the OSCIN (clock input) and OSCOUT (clock output) pins to generate a high-frequency system clock signal.
[0015] The oscillation stabilization circuit consists of capacitors connected in parallel on both sides of the crystal oscillator, used to assist the crystal oscillator in starting up and maintaining the stability of the oscillation frequency.
[0016] In the smart card reader as described above, optionally, the main control module circuit uses an STM32F103C8T6 chip as the main control chip. In the main control chip: pin 1 is a power supply pin, connected to the power output from the power module; pin 2 is connected to an external LED, controlled by high and low levels; pins 3, 4, 5, and 6 are crystal oscillator pins, connected to corresponding external crystal oscillators; pin 7 is a reset pin, triggering a system reset when a low level is detected; pins 12 and 13 are connected to the receiver and transmitter of the Bluetooth module, respectively; pins 21 and 22 are connected to the display module as clock and data lines, respectively; pins 47 and 44 are both grounded, configuring the chip to boot from the user's flash memory; pin 38 controls the power switch of the smart card module, turning on the MOSFET Q1 when a high level is output; pin 30 is connected to the I / O pin of the smart card module to achieve data interaction; pin 29 is connected to the CLK pin of the smart card module to provide a clock signal; pin 28 is connected to the RST pin of the smart card module to provide a reset signal; pin 27... The DET (detection) pin of the smart card module detects the SIM card insertion status.
[0017] In the smart card reader as described above, optionally, the lithium battery charging circuit of the power module uses a TP4056 charging management chip. In the charging management chip: pin 4 is connected to the 5V power input of the USB; pin 8 serves as the enable control terminal; pins 6 and 7 control the charging status indicator lights respectively, with a green light when fully charged and a red light when not fully charged; pin 2 adjusts the charging current; pin 1 is connected to the thermistor R15 to detect the temperature; the positive and negative terminals of the battery are directly connected to the positive and negative terminals of the lithium battery; pin 5 outputs the charging current to the lithium battery; resistor R16 sets the charging current value; resistors R13 and R14, together with the thermistor R15, form a temperature protection circuit; resistors R11 and R12 provide circuit protection functions.
[0018] In the smart card reader as described above, optionally, the power conversion circuit of the power module is connected to a 5V power supply via a USB interface, and the positive and negative terminals of Bal are connected to the positive and negative terminals of the lithium battery; in the power module: two diodes IN5819 and MOSFET CJ2301 constitute a switching control circuit, which realizes the following functions: when a USB power input is detected, it automatically switches to USB power supply mode; when there is no USB power input, it automatically enables lithium battery power supply; the output terminal Vout of the power conversion circuit is connected to the input terminal of the step-down circuit.
[0019] In the smart card reader as described above, optionally, the step-down circuit of the power module uses XC6206P332MR as the step-down chip. In the step-down chip: pin 3 is connected to Vout of the power conversion circuit as the voltage input terminal; pin 2 outputs the stepped-down VCC voltage to power the system function modules; and the SW2 power switch controls whether the step-down circuit supplies power to other modules.
[0020] In the smart card reader as described above, optionally, the OLED display circuit of the display module uses an SSD1306 chip. In the OLED display circuit: pins 18 and 19 are used as clock and data lines respectively, connected to the corresponding pins of the main control chip via an I2C interface; pin 26 IREF is connected to an external resistor R3 to set the reference value of the segment drive current and control the output current of each pixel segment of the OLED; pin 15 distinguishes the data type of transmission; pin 13 CS# is used as a chip select signal to control the chip response state; pin 14 RES# is fixed at a high level to maintain a non-reset state; pins 10 and 11 are configured as a high / low level combination to determine the chip operating mode.
[0021] In the smart card reader as described above, optionally, the Bluetooth module uses an HC-05 chip. In the Bluetooth module chip: pin 1 and pin 2 are respectively connected to the UART receiver and transmitter of the main control module; pin 31 is connected to an external status indicator LED, and the Bluetooth connection status is fed back by the change of the LED's on / off state.
[0022] To achieve the above objectives, a second aspect of the present invention provides a communication device, which optionally includes a smart card reader as described in any of the preceding first aspects.
[0023] To achieve the above objectives, a third aspect of this utility model provides an intelligent communication system, comprising:
[0024] Terminal equipment; and
[0025] The smart card reader as described in any of the first aspects above is communicatively connected to the terminal device.
[0026] In summary, the smart card reader, communication device, and system provided by this utility model solve the problems of traditional devices relying on wired connections, lacking real-time display, and lacking intelligent diagnosis by detecting SIM card status, transmitting data to the user terminal in real time, diagnosing abnormality types, and providing fault information feedback. It has the advantages of improving the portability of debugging equipment, realizing real-time data feedback, enhancing the level of intelligent fault diagnosis, and optimizing operational efficiency.
[0027] Specifically, this utility model achieves significant beneficial effects through multi-module collaborative innovation: the dual-line display screen directly and synchronously displays APDU commands and response data, and with Bluetooth remote transmission, it realizes dual real-time monitoring of "local + remote", shortening the debugging cycle; through embedded monitoring combined with LED and screen feedback, it automatically identifies the abnormal status of the SIM card and quickly locates the fault type, reducing manual intervention and improving the efficiency of troubleshooting; the linkage between LED and screen reduces the risk of misoperation; and it provides an integrated tool for various types of users, promoting the transformation of debugging towards wireless intelligence.
[0028] The following will further explain the concept, specific structure and technical effects of this utility model in conjunction with the accompanying drawings, so as to fully understand the purpose, features and effects of this utility model. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the module structure of a smart card reader provided by this utility model;
[0030] Figure 2 yes Figure 1 MCU oscillation circuit diagram of the main control module of the smart card reader;
[0031] Figure 3 yes Figure 1 The lithium battery charging circuit diagram of the power module of the smart card reader;
[0032] Figure 4 yes Figure 1 Power conversion circuit diagram of the power module of the smart card reader;
[0033] Figure 5 yes Figure 1 A step-down circuit diagram of the power module for a smart card reader;
[0034] Figure 6 yes Figure 1 OLED circuit diagram of the display module of a smart card reader;
[0035] Figure 7 yes Figure 1 Overall circuit diagram of the main control module of the smart card reader;
[0036] Figure 8 yes Figure 1 Circuit diagram of the Bluetooth module in a smart card reader. Detailed Implementation
[0037] To make the technical means, inventive features, objectives, and effects of this utility model readily understandable, the present utility model is further described below in conjunction with specific illustrations. However, this utility model is not limited to the embodiments described below.
[0038] It should be noted that the structures, proportions, sizes, etc., shown in the accompanying drawings of this specification are only used to complement the content disclosed in the specification for those skilled in the art to understand and read, and are not intended to limit the conditions under which this utility model can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportional relationships, or adjustments to the size, without affecting the effects and purposes that this utility model can produce, should still fall within the scope of the technical content disclosed in this utility model.
[0039] Terms such as “comprising” and “including” indicate that, in addition to the components that are directly and explicitly stated in the specification and claims, the technical solution of this utility model does not exclude the presence of other components that are not directly or explicitly stated.
[0040] It should also be noted that the terms "upper," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this disclosure.
[0041] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0042] Traditional SIM card debugging equipment uses wired interfaces, limiting device mobility and hindering remote debugging. The lack of a user interface leads to redundant command interaction paths, data visualization relies on external computer terminals causing response delays, and the absence of physical layer status monitoring results in delayed anomaly identification. Furthermore, the lack of embedded anomaly diagnostic algorithms prevents real-time analysis of electrical characteristics changes during SIM card insertion, making it difficult to distinguish between transient contact issues and permanent hardware failures, resulting in insufficient fault classification accuracy. The communication protocol stack lacks an APDU command pass-through mechanism, necessitating frequent switching between hardware interfaces and host computer software during debugging, significantly reducing operational consistency.
[0043] For example, in on-site debugging scenarios for IoT devices, technicians need to carry traditional card readers with USB interfaces to test SIM cards. When the device is deployed in a confined space or at a high altitude, physical cable connections limit the device's placement angle, obstructing the view during SIM card insertion and removal. During debugging, a continuous connection to a laptop is required to capture ATR (AnswerToReset) response data, posing a risk of device dragging during mobile inspections. When SIM card contacts oxidize, causing intermittent communication interruptions, the device can only return hexadecimal error codes via serial port, failing to automatically trigger a reset and retry process, forcing technicians to repeatedly perform insertion and removal operations and manually parse log files. When reading the EF_ICCID file fails, the lack of a file system integrity verification mechanism makes it difficult to distinguish between poor contact and file corruption, leading to frequent instances of incorrectly replacing valid SIM cards.
[0044] If the above issues are not addressed, wired connections will limit the deployment capabilities of devices in mobile scenarios, increasing the time cost and safety risks of on-site operations. Delays in data visualization will widen the time gap between anomaly responses and operational commands, reducing the efficiency of problem localization during debugging. The lack of physical layer status monitoring will prolong fault classification time, and incorrect diagnosis may lead to unnecessary hardware replacements. The lack of automated anomaly handling mechanisms will continue to rely on manual experience-based judgment, significantly reducing overall operational efficiency in batch device debugging scenarios and making it difficult to meet the real-time requirements of IoT device maintenance.
[0045] In response, this utility model provides a smart card reader, such as... Figure 1 As shown, the device may specifically include a main control module, a smart card module, an LED module, a Bluetooth module, a display module, and a power supply module. The main control module is communicatively connected to the smart card module, the Bluetooth module, and the display module, respectively. The LED module is physically connected to the main control module. The power supply module is physically connected to the main control module, the smart card module, the LED module, the Bluetooth module, and the display module. This device can implement the smart card reading method as described in any of the foregoing embodiments.
[0046] like Figures 1 to 8 As shown:
[0047] The main control module may include an MCU oscillation circuit and a main control module circuit. The MCU oscillation circuit provides the main control clock signal, and the main control module circuit is used for communication control. Optionally, the main control module communicates with the display module via I2C and with the smart card module and Bluetooth module via UART, respectively.
[0048] The MCU oscillation circuit may include a clock circuit, which may further include:
[0049] The low-speed external clock (LSE) unit is connected to the PC14 and PC15 pins of the main control chip to provide a clock source for the real-time clock (RTC).
[0050] The high-speed external clock HSE unit connects to an external crystal oscillator via the OSCIN and OSCOUT pins to generate a high-frequency system clock signal;
[0051] The oscillation stabilization circuit consists of capacitors connected in parallel on both sides of the crystal oscillator, used to assist the crystal oscillator in starting up and maintaining the stability of the oscillation frequency.
[0052] like Figure 2 and Figure 7 As shown, the main control module uses crystal oscillators and capacitors to construct the HSE and LSE clock circuits. PC14 and PC15 of the main control chip serve as pins of the LSE oscillator to provide a clock source for the RTC. OSCIN and OSCOUT are configured as pins for connecting the HSE crystal oscillator, which provides a high-frequency clock signal. Capacitors C10, C11, C12, and C13 assist the crystal oscillator in starting up and stabilizing its oscillation frequency. In this embodiment, the main control module circuit uses the STM32F103C8T6 chip as the main control chip. In the main control chip: pin 1 is the power supply pin, connected to the power converted from the power supply module; pin 2 is connected to an external LED, controlled by outputting high and low levels; pins 3, 4, 5, and 6 are crystal oscillator pins, connected to corresponding external crystal oscillators; pin 7 is the reset pin, triggering a system reset operation when a low level is detected; pins 12 and 13 are connected to the Bluetooth module, with pin 12 used for sending data and pin 13 used for receiving data; pins 21 and 22 are connected to the display module. Pin 22 is the data line, and pin 21 is the clock line; pins 47 and 44 are both grounded and used to configure the chip's boot mode to boot from user flash memory; pin 38 is used to control the power switch of the smart card module, turning on MOSFET Q1 when the output is high to power the smart card module; pin 30 is connected to the I / O pin of the smart card module as a data interaction pin; pin 29 is connected to the CLK pin of the smart card module to provide it with a clock signal; pin 28 is connected to the RST pin of the smart card module to provide it with a reset signal; pin 27 is connected to the DET pin of the smart card module to detect whether a SIM card is inserted into the smart card module.
[0053] The smart card module may include a card slot circuit for physical contact connection of the SIM card and provides IO, CLK, and RST signals. Optionally, the smart card module communicates with the main control module via UART.
[0054] The LED module may include an indicator circuit that uses a three-state indicator to show whether the LED is constantly lit, flashing, or off, based on high or low level signals, to provide feedback on the current status of the SIM card.
[0055] Optionally, the LED module is physically connected to the main control module via GPIO. The indicator circuit of the LED module uses a three-state indicator based on the high and low level signals output by the GPIO to indicate whether the LED is constantly lit, flashing, or off, thus providing feedback on the status of the SIM card.
[0056] The Bluetooth module may include Bluetooth module circuitry for wireless communication between the main control module and external terminal devices. Optionally, the Bluetooth module may communicate with the main control module via UART.
[0057] like Figure 8 As shown, the Bluetooth module is HC-05. In the Bluetooth module, pins 1 and 2 are connected to pins 13 and 12 of the main control module, respectively. Pin 12 of the Bluetooth module is connected to the power supply. Pin 31 is connected to an external LED. The state of the LED is controlled to indicate whether a Bluetooth connection has been established.
[0058] The display module may include an OLED display module circuit for displaying SIM card commands and response data. Optionally, the display module communicates with the main control module via I2C.
[0059] like Figure 6 As shown, the OLED display module circuit uses the SSD1306 as the display module chip. In the display module chip: pins 19 and 18 are the data pin and clock pin, respectively, and are connected to pins 21 and 22 of the main control chip via the I2C interface. During configuration, pin 11 is connected to a high level and pin 10 is connected to a low level. In the display module chip: pin 26 is the IREF pin, i.e., the segment output current reference pin. The current reference value of the segment drive circuit is set by an external resistor, thereby controlling the current output of each segment SEG of the OLED screen. The external resistor R3 keeps the IREF current at a preset level. Pin 15 is used to distinguish whether the transmitted data is display data or a command. Pin 13 is the chip select pin, used to select whether the display module chip responds to the operation of the external main control device. Pin 14 is the reset pin RES#. Connecting RES# to a high level, i.e., connecting it to VCC, keeps the chip's reset pin at a high level and in a non-reset state. Pin 20 is the data pin, which can be used for data transmission in I2C mode and is connected to pin 21 of the main control module.
[0060] The power module may include a lithium battery charging circuit, a power conversion circuit, and a step-down circuit. The lithium battery charging circuit charges and protects the lithium battery, while the power conversion circuit automatically switches between USB power and lithium battery power. The step-down circuit provides a stable voltage source for the entire system. Optionally, the step-down circuit reduces the 5V or lithium battery voltage to 3.3V for system power supply.
[0061] like Figure 3As shown, the lithium battery charging circuit of the power module uses the TP4056 charging management chip. Within this chip: pin 4 is connected to the 5V USB voltage, serving as the power supply pin; pin 8 serves as the enable pin; pins 6 and 7 control the indicator light's on / off state; a green light illuminates when fully charged, and a red light illuminates when not fully charged; pin 2 controls the charging current; pin 1 detects the temperature of thermistor R15; the positive and negative terminals of the Bal pin are connected to the positive and negative terminals of the lithium battery, respectively; pin 5 charges the lithium battery; resistors R11 and R12 are used for circuit protection; resistor R16 sets the charging current, its resistance determining the current magnitude; resistors R13 and R14, along with thermistor R15, work together to prevent overheating; capacitors C14 and C15 are used for filtering.
[0062] like Figure 4 As shown, the power conversion circuit of the power module is connected to a 5V power supply via a USB interface. The positive and negative terminals of Bal are connected to the positive and negative terminals of the lithium battery. Two diodes IN5819 and a MOSFET CJ2301 work together for switch control: when a USB power input is detected, the card reader automatically switches to the USB power supply mode; if no USB power is detected, the lithium battery is used as the power source, and the Vout of the power conversion circuit is connected to the step-down circuit.
[0063] like Figure 5 As shown, the power module uses XC6206P332MR as a step-down chip. The Vout of the step-down circuit of the power module is connected to the Vout of the power conversion circuit. SW2 is used as a power switch to control whether the power module supplies power to other modules. In the step-down chip: pin 3 is the input terminal of the step-down power supply, pin 2 is the output terminal VCC of the step-down power supply, which is used to supply power to other functional modules. Capacitors C17 and C18 are used for filtering.
[0064] The device described in this application can specifically achieve the following smart card reading steps:
[0065] After the smart card reader is powered on, it first checks if an external power source is connected. If so, it uses the external power source to charge the lithium battery; otherwise, it uses the internal power source. Specifically, when the smart card reader detects the power button being pressed, it immediately checks if an external power source is connected via USB. If an external power source is available, it prioritizes using it while simultaneously charging the device's built-in lithium battery. If no external USB power source is available, the device relies on the lithium battery for power. Once the power supply is stable, the main control module starts up. After startup, the main control module sequentially establishes communication connections with the Bluetooth module, display module, and smart card module.
[0066] Step S1: Detect the SIM card insertion action and read the SIM card information to identify abnormal states.
[0067] In this embodiment, SIM card information includes, but is not limited to, key files such as IMSI (International Mobile Subscriber Identity), ICCID (Integrated Circuit Card Identifier), and KI (Authentication Key Identifier). Abnormal states in this step include missing files.
[0068] Step S1.1: When the detection pin level changes from high to low, it is determined that the SIM card has been inserted; otherwise, when the detection pin remains at a low level, first check the cumulative number of abnormalities in the current smart card module slot: if the cumulative number of abnormalities is less than 3, activate the SIM card through a cold reset operation.
[0069] If the SIM card is successfully activated, an ATR response is returned; otherwise, a retry process is initiated, with a maximum of three retries. If the cumulative number of abnormalities is greater than or equal to three, a permanent fault is determined, and the card fault handling process is initiated.
[0070] In this embodiment, the ATR data returned by the SIM card is parsed and its compliance with the protocol specifications is checked; if it does not comply, a retry process is initiated.
[0071] It's important to note that when a SIM card is inserted into the device, the card reader sends a reset command to the SIM card to elicit a response. The SIM card's ATR contains information about the card itself, such as card type, speed, and voltage. The ATR is a series of bytes, each containing different information about the card, used to support the SIM card's device initialization and communication.
[0072] In this embodiment, the protocol specification check of ATR data includes at least one of the following: protocol version matching verification, data field length compliance verification, and checksum correctness verification. In the protocol version matching verification, the bytes indicating the protocol type in the ATR data are compared with a preset standard protocol list; if no match is found, the protocol is determined to be incompatible. In the data field length compliance verification, the total length of the ATR data and the segment length of each information field are verified according to the protocol specification; an anomaly is triggered when a field is too long or missing. The checksum correctness verification calculates the checksum or XOR value of the received data and compares it with the checksum carried at the end of the ATR data; if they do not match, the data integrity is determined to be compromised.
[0073] Specifically, after SIM card activation, ATR data is first received and parsed layer by layer. During the protocol version matching verification phase, the protocol identifier byte of the ATR data is extracted and compared with the stored standard protocol parameter table. If the protocol identifier is not found in the standard parameter table, a protocol mismatch flag is immediately generated. Next, data field length compliance verification is performed. The ATR data is split according to the field structure defined in the protocol specification, and each field is checked for exceeding limits in terms of historical byte length, interface byte count, and subsequent extended fields. Finally, the checksum verification module calculates the checksum of the received data and verifies its consistency with the checksum at the end of the ATR data.
[0074] Step S1.2: If no ATR response data is received after the cold reset operation, it is determined that no SIM card is inserted or the SIM card physical layer is abnormal.
[0075] Optionally, if any of the above checks detects an anomaly, the system will mark the current anomaly as a protocol layer error rather than a physical layer fault and trigger a retry procedure. During the retry procedure, the voltage parameters for the cold reset operation are adjusted to 3.3V ± 0.2V, and the clock frequency is set to an adjustable mode ranging from 1MHz to 5MHz. If compliant ATR data cannot be obtained after three retries, the system will reset the accumulated anomaly count to zero to avoid falsely triggering a permanent fault determination.
[0076] Step S1.3: If a critical file is found to be missing or has poor contact, the APDU will return an error status code, indicating a file layer or communication anomaly. The APDU is the "language" of smart card communication, achieving efficient and reliable data interaction through standardized instructions (command APDU) and responses (response APDU).
[0077] In this step, the file information of the SIM card is read one by one and checked for any missing files. If any files are missing, a retry process is initiated; otherwise, the cumulative error count for the SIM card is reset to zero, at which point the SIM card is considered a normal card. The process of reading file information one by one can be implemented using sequential traversal or priority detection of critical files. For example, it can be implemented by verifying the file directory hierarchy layer by layer, or by prioritizing the existence of critical files such as EF_ICCID and EF_IMSI. The number of retry attempts can be configured to three, or the threshold range can be adjusted according to the actual scenario, for example, set to between two and five attempts. Error messages can be displayed in ways including but not limited to scrolling text, fixed error codes, or icon symbols. LED status can distinguish error types through different colors or flashing frequencies. The Bluetooth transmission protocol can use the standard HID specification or a custom data frame format to ensure compatibility with external terminal devices. The operation to reset the cumulative error count can be automatically triggered after each successful retry, or executed when a reset command is sent from an external terminal.
[0078] Specifically, during the file information reading phase, by checking the file integrity item by item, specific file missing issues can be accurately identified, avoiding the omission of detailed anomalies due to global detection. When a file missing is detected, a preset retry process is initiated. For example, after the first failure, wait 200 milliseconds before attempting to read again. If all three attempts fail, it is determined to be a persistent failure.
[0079] If the retries fail three times, the corresponding error message will be displayed on the display module and the LED indicator will show the corresponding status.
[0080] If an external user terminal device connects via Bluetooth, the error message is sent synchronously to the external terminal device; at the same time, the cumulative number of errors for this SIM card is reset to zero.
[0081] Step S2: Establish a communication connection with the external user terminal, forward the abnormal status to the user terminal, obtain the APDU command sent by the user terminal to perform SIM card operation, and then send the SIM card response data back to the user terminal and / or card reader for display.
[0082] Optionally, in step S2, the display module adopts a two-line real-time refresh mode: the first line displays the original text of the APDU command sent to the SIM card, and the second line displays the response data returned by the SIM card; when there is no card or the card is abnormal, the specific error information is displayed; if the length of the response data exceeds the display limit, the key fields are scrolled to display.
[0083] The dual-line real-time refresh mode can be configured to refresh the top and bottom lines independently. The first line displays the original APDU command, while the second line dynamically updates the response data. In abnormal states, error messages are converted into readable text using a predefined character encoding format; for example, error code SW1SW2 is converted to "ERR:0x6A82". When the response data length exceeds the single-line display capacity, the scrolling display mechanism truncates fields containing the status code and checksum at fixed time intervals, for example, prioritizing the extraction of the first 4 bytes and the last 2 bytes. The original APDU command is displayed in hexadecimal format. The response data undergoes parsing before display to separate the status code and data body; for example, "9000" is displayed separately at the end of the line as a success indicator.
[0084] Specifically, during the APDU command transmission phase, the first line is refreshed in real time and the currently executed command content is locked, preserving a complete operation record. The second line dynamically switches the display mode based on the SIM card response status: if the response data is normal, the complete data body and status code are parsed and displayed in byte segments; if no card or card abnormality is detected, the second line immediately overwrites the original content and outputs an error type code and descriptive text. When the response data exceeds the display line width, the key fields are scrolled and the truncated data segments are displayed cyclically at a preset scrolling rate, for example, switching the display window every 500 milliseconds. The display module's exception handling priority is higher than regular data display. When an exception is triggered, the original data stream is interrupted and an error message is forcibly output until the exception status is resolved and the normal refresh mode is restored. This solution, through the hierarchical division of the physical display area and dynamic refresh logic, achieves the visual separation of data flow and rapid feedback of exception status, solving the problem of key information loss caused by long data truncation.
[0085] Step S3: Diagnose the type of abnormality after SIM card operation based on the SIM card's response data, and control the reader's LED indicator and display module to output the corresponding fault feedback information.
[0086] Optionally, in step S3, the SIM card's abnormality type includes at least one of the following: no SIM card inserted, SIM card malfunction, and SIM card normal.
[0087] When no SIM card is inserted or the SIM card physical layer is abnormal, the LED indicator remains constantly lit.
[0088] When a SIM card malfunction is detected, the LED indicator light will flash.
[0089] When the SIM card is in normal condition, the LED indicator light will be off.
[0090] In this step, the anomaly types are refined into three categories: no card insertion, physical layer anomaly, and logic layer anomaly, each corresponding to a unique visual signal. When no card insertion or a physical layer anomaly is detected, the LED remains constantly lit to prompt the user to check the card slot contact or card integrity. For example, the LED enters a constant-on state after the detection pin remains at a low level and the cold reset operation fails three times. When an APDU returns an error status code or a file is missing, the LED switches to a flashing state to distinguish non-physical faults; the flashing frequency can be twice per second. The LED is off only when the cumulative anomaly count of the SIM card is cleared and the response data is normal. The mapping relationship between the anomaly type and the LED state is achieved through the pin output level of the main control module. For example, the LED remains lit when pin 2 outputs a high level, and the LED flashes when pin 2 periodically outputs high and low levels. Through the cumulative anomaly count judgment mechanism in step S1.1 of the pre-processing information, the LED state can be associated with permanent faults. For example, when the number of anomalies exceeds three, a constant-on state is triggered, thereby avoiding confusion with temporary faults.
[0091] Specifically, when a SIM card is inserted, if the detection pin level does not change or the cold reset operation fails, it is determined that no card is inserted or there is a physical layer abnormality. In this case, the main control module controls the LED to remain constantly lit. When a file is missing or the APDU returns an error status code, the main control module controls the LED to flash at a preset frequency, for example, starting the flashing mode after three failed file reads in step S1.3. When the SIM card responds with normal data and the accumulated number of abnormalities is cleared, the LED turns off to eliminate misjudgment interference. The binding of the abnormality type and the LED state is implemented through the firmware algorithm of the main control module. For example, when a physical layer abnormality is detected, the constant-on control function is called, and when a logic layer abnormality is detected, the flashing control function is called. Through the three-state differentiation mechanism, users can quickly determine the fault level. For example, in the constant-on state, the card slot contact is checked first, and in the flashing state, the APDU instruction or file integrity is checked, without relying on the detailed error information of the display module. This scheme deeply integrates hardware indications and software diagnostic results. For example, the abnormality count in step S1.1 is linked with the LED state in step S3, making the fault feedback information direct and operable.
[0092] To achieve the above objectives, the present invention also provides a terminal communication device, including a smart card reader as described in any of the foregoing embodiments.
[0093] The processor and memory of a communication device can be configured separately or integrated together, for example, integrated on a system-on-chip (SOC) of the terminal device. The memory can be volatile or non-volatile, or it can include both volatile and non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0094] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this utility model, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this utility model.
[0095] To achieve the above objectives, this utility model also provides an intelligent communication system, comprising:
[0096] The terminal device and the smart card reader as described in any of the foregoing embodiments are communicatively connected to the terminal device.
[0097] The preferred embodiments of this utility model have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of this utility model without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of this utility model through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A smart card reader, characterized in that, include: The system comprises a main control module, a smart card module, an LED module, a Bluetooth module, a display module, and a power supply module; wherein the main control module is communicatively connected to the smart card module, the Bluetooth module, and the display module, and the LED module is physically connected to the main control module; the power supply module is physically connected to the main control module, the smart card module, the LED module, the Bluetooth module, and the display module. The main control module includes an MCU oscillation circuit and a main control module circuit. The MCU oscillation circuit is used to provide the main control clock signal, and the main control module circuit is used for communication control. The smart card module includes a card slot circuit for physically connecting the SIM card and providing IO, CLK, and RST signals; The LED module includes an indicator circuit that uses a three-state indicator to show whether the LED is constantly lit, flashing, or off based on high and low level signals, thus providing feedback on the current status of the SIM card. The Bluetooth module includes a Bluetooth module circuit for wireless communication between the main control module and external terminal devices. The display module includes an OLED display module circuit for displaying SIM card commands and response data; The power module includes a lithium battery charging circuit, a power conversion circuit, and a step-down circuit; wherein, the lithium battery charging circuit charges and protects the lithium battery, the power conversion circuit automatically switches between USB power supply and lithium battery power supply, and the step-down circuit provides a stable voltage source for the entire system.
2. The smart card reader as described in claim 1, characterized in that, The MCU oscillation circuit includes a clock circuit, which comprises: The low-speed external clock (LSE) unit is connected to the PC14 and PC15 pins of the main control chip to provide a clock source for the real-time clock (RTC). The high-speed external clock HSE unit connects to an external crystal oscillator via the OSCIN and OSCOUT pins to generate a high-frequency system clock signal; The oscillation stabilization circuit consists of capacitors connected in parallel on both sides of the crystal oscillator, used to assist the crystal oscillator in starting up and maintaining the stability of the oscillation frequency.
3. The smart card reader as described in claim 1, characterized in that, The main control module circuit uses the STM32F103C8T6 chip as the main control chip. Within the main control chip: pin 1 is the power supply pin, connected to the power converted from the power module; pin 2 connects to an external LED, controlling its on / off state by outputting high and low levels; pins 3, 4, 5, and 6 serve as crystal oscillator pins, connected to the corresponding external crystal oscillator; pin 7 is the reset pin, triggering a system reset when a low level is detected; pins 12 and 13 connect to the receiver and transmitter of the Bluetooth module, respectively; pins 21 and 22 serve as the clock and data lines, respectively, connecting to the display module; pins 47 and 44 are both grounded, configuring the chip to boot from the user's flash memory; pin 38 controls the power switch of the smart card module, turning on MOSFET Q1 when the output is high; pin 30 connects to the I / O pin of the smart card module for data interaction; pin 29 connects to the CLK pin of the smart card module to provide a clock signal; pin 28 connects to the RST pin of the smart card module to provide a reset signal; and pin 27 connects to the DET pin of the smart card module to detect the SIM card insertion status.
4. The smart card reader as described in claim 1, characterized in that, The lithium battery charging circuit of the power module uses a TP4056 charging management chip. In this chip: pin 4 connects to the 5V power input of the USB port; pin 8 serves as the enable control terminal; pins 6 and 7 control the charging status indicator lights, which illuminate green when fully charged and red when not fully charged; pin 2 adjusts the charging current; pin 1 connects to a thermistor R15 to detect temperature; the positive and negative terminals of the battery (Bal) are directly connected to the positive and negative terminals of the lithium battery; pin 5 outputs the charging current to the lithium battery; resistor R16 sets the charging current value; resistors R13 and R14, along with the thermistor R15, form a temperature protection circuit; and resistors R11 and R12 provide circuit protection functions.
5. The smart card reader as described in claim 1, characterized in that, The power conversion circuit of the power module is connected to a 5V power supply via a USB interface, and the positive and negative terminals of Bal are connected to the positive and negative terminals of the lithium battery. In the power module, two diodes IN5819 and a MOSFET CJ2301 constitute a switching control circuit, which realizes the following functions: when a USB power input is detected, it automatically switches to USB power supply mode; when there is no USB power input, it automatically enables lithium battery power supply. The output terminal Vout of the power conversion circuit is connected to the input terminal of the step-down circuit.
6. The smart card reader as described in claim 1, characterized in that, The power module's step-down circuit uses the XC6206P332MR as the step-down chip. In the step-down chip: pin 3 is connected to the Vout of the power conversion circuit as the voltage input terminal; pin 2 outputs the stepped-down VCC voltage to power the system function modules; the SW2 power switch controls whether the step-down circuit supplies power to the main control module, smart card module, LED module, Bluetooth module, and display module.
7. The smart card reader as described in claim 1, characterized in that, The OLED display circuit of the display module uses an SSD1306 chip. In the OLED display circuit: pins 18 and 19 are used as clock and data lines respectively, connected to the corresponding pins of the main control chip via an I2C interface; pin 26 IREF is connected to an external resistor R3 to set the reference value of the segment drive current, controlling the output current of each pixel segment of the OLED; pin 15 distinguishes the data type of transmission; pin 13 CS# is used as a chip select signal to control the chip's response state; pin 14 RES# is fixed at a high level to maintain a non-reset state; pins 10 and 11 are configured as high / low level combinations to determine the chip's operating mode.
8. The smart card reader as described in claim 1, characterized in that, The Bluetooth module uses an HC-05 chip. In the Bluetooth module chip: pin 1 and pin 2 are respectively connected to the UART receiver and transmitter of the main control module; pin 31 is connected to an external status indicator LED, and the Bluetooth connection status is fed back by the change of the LED on and off.
9. A communication device, characterized in that, Includes the smart card reader as described in any one of claims 1 to 8.
10. An intelligent communication system, characterized in that, include: Terminal equipment; as well as The smart card reader as described in any one of claims 1 to 8 is communicatively connected to the terminal device.