0 Introduction
With the advancement of the replacement of the second-generation ID card, the fields in China that need to use the second-generation ID card are becoming more and more extensive. Since the second-generation ID card is a radio frequency smart card, the identity information can be read through the second-generation ID card reader, which provides conditions for improving work efficiency and the accuracy of input information. However, there are still great obstacles to the promotion and use of the second-generation ID card reader in industries such as banking, telecommunications, and postal services. This is because the business terminals in these industries generally use terminals with non-Windows operating systems, but the second-generation ID card reader manufacturers only provide SDK development kits under the Windows system, making it impossible for users to perform secondary development in these industries. Even if it is a Windows system, some industries do not want to change their software systems because of the use of the second-generation ID card reader. Based on this situation, we designed and developed the second-generation ID card intelligent collector, which can effectively solve this problem. The second-generation ID card intelligent collector is an automatic entry tool for the second-generation resident ID card information used in the fields of banking, telecommunications, postal services, etc. in conjunction with the second-generation resident ID card reader. The second-generation ID card intelligent collector can realize the automatic entry of the second-generation resident ID card information without changing the application equipment and software in the banking, telecommunications, postal and other industries, eliminate manual entry errors, reduce workload and improve efficiency.
1. Design analysis
1.1 Hardware design
The intelligent collector is connected to the serial port of the second-generation ID card reader through the RS232 serial port cable, and is connected to the PS/2 interface of the PC or terminal through the keyboard PS/2 interface cable, so that the standard keyboard is effectively isolated from the intelligent collector. Users can also use the standard keyboard while using the intelligent collector to achieve time-sharing multiplexing of the intelligent collector and the standard keyboard. The second-generation ID card reader is an ID card information reading device based on radio frequency card technology, which can quickly and accurately read the identity ciphertext information in the second-generation ID card. This intelligent collector can independently complete the verification and communication with the second-generation ID card reader, and can also read and save the information of the corresponding ID card sent by the reader, and then perform calculations and encoding through the internal high-speed MCU, convert the received RS232 signal into a standard PS/2 keyboard signal, and directly input the computer to display the corresponding information.
The system logic block diagram of the intelligent collector is shown in Figure 1.
Figure 1 System logic block diagram of intelligent collector
The hardware structure schematic diagram is shown in Figure 2
Figure 2. Schematic diagram of the hardware structure of the intelligent collector
The main control MCU of the intelligent data collector is STC89C516RD+[1]. This single-chip microcomputer is a new generation of super anti-interference, high-speed, and low-power MCU launched by Hongjing Technology Co., Ltd. Its instruction code is fully compatible with the traditional 8051 single-chip microcomputer. Its crystal oscillator is 11.0592MHz, the serial interface level conversion chip is ADM202, and the analog switch CD4066 realizes time-sharing multiplexing of the dedicated keyboard and the standard keyboard. The power supply is directly from the PS/2 port of the host, and the buzzer and indicator light are controlled by the CPU.
1.2 Software DesignThe software workflow of the intelligent collector is shown in Figure 3:
Figure 3 Program working principle diagram |
The system sends a command request to the second-generation ID card reader through the RS-232 communication interface to read the document information; after verification, it is saved in the intelligent collector; then it waits for the hot key defined by the system to be pressed. Once the hot key is pressed, the intelligent collector will take out the corresponding information; after processing, it is sent to the PS/2 keyboard interface of the PC and the corresponding information is displayed where the cursor flashes.
This system includes system initialization (such as register initialization, serial port initialization, port initialization, etc.), data acquisition, GBK encoding conversion, keyboard event processing, data transmission and other modules. The software is used to control the cyclic execution of the program to achieve the purpose of real-time detection and sending of information.
In terms of data communication, the USART universal synchronous asynchronous receiver and transmitter built into the microcontroller is used, which adopts asynchronous working mode and 8-bit data format. Therefore, the relevant registers need to be initialized when the program starts. At the same time, the transmission baud rate must be synchronized with the ID card reader.
Since the CPU uses a 11.0592MHz crystal oscillator and adopts high-speed communication mode, the formula can be obtained according to Reference 2:
To calculate the baud rate = 2SMOD.Fosc/64, set the baud rate to 9600, Fosc should be equal to FDH.
MOVLW FDH
MOVWF SPBRG ; Set the baud rate to 9600
The communication also adopts the polling method [3]. The intelligent collector continuously sends card polling commands (command format: AA AA AA 96 69 00 03 20 01 22) to the ID card reader through the connection port. When the response information received is (AA AA AA 96 69 00 08 00 00 9F 00 00 00 00 97), it means that the reader has detected a valid two-band ID card, and then performs relevant data collection and processing. Use the MOV INDEX, W statement to obtain the received ID card data, and use the MOV SDA, C statement to send the command data.
The error handling part corrects the main process and the button polling part respectively. To prevent the program from entering an infinite loop, a power-off function is added to restart the intelligent collector for error correction.
The system adopts a structured programming scheme, which has good modularity, portability and modifiability; the system manages and schedules other modules through the main control process, and its main program flow is shown in Figure 4:
Figure 4 Main program flow chart
2 Key Technology Analysis
2.1 Chinese Character Encoding Conversion
In order to process Chinese character information, the state promulgated the national standard GB2312 in 1981, "Chinese Character Encoding Character Set for Information Exchange". It collected a total of 6763 Chinese characters and determined that each Chinese character should be encoded with two bytes. Both the area code and the international code are specified by the national standard GB2312. Considering that GB2312 supports too few Chinese characters, the Chinese character extension specification GBK1.0 in 1995 included 21,886 symbols, which are divided into the Chinese character area and the graphic symbol area. The Chinese character area includes 21,003 characters. GB18030 in 2000 is the official national standard that replaced GBK1.0. It is a further expansion of GBK and GB2312 encoding [4].
Since the Chinese character information stored in the second-generation ID card is encoded in GB13000, considering that this intelligent collector is used in addition to connecting to terminal equipment such as banks, telecommunications, and postal services, it also needs to be connected to other PCs. For connecting to PCs, after testing, operating systems above Windows 98 support GB1300, and the Chinese character encoding in the reader can be directly displayed. However, many current terminal devices mainly use GB2312 fonts, GBK fonts, and GB18030 fonts. This requires that the Chinese character encoding in the reader be appropriately processed according to the different fonts supported by the terminal and then displayed on different types of terminal devices. In view of this, we considered the compatibility of Chinese character encoding and the convenience of user operation in the design, chose to use GBK Chinese character library in the intelligent collector, and established the encoding dictionary corresponding to GB1300 and GBK. If the terminal device only supports GB2312 character library, after reading the Chinese character encoding in the reader, the GB1300 encoding is converted into the corresponding area code by looking up the dictionary. For uncommon characters that cannot be found, they are automatically ignored; if the terminal device supports GBK or GB18030, the GBK encoding is output and displayed directly. Practice has proved that this solution is not only compatible with most of the current terminal devices, but also can be seamlessly connected to various applications on the PC.
2.2 Time-sharing multiplexing of dedicated keyboard and standard keyboard
Since this program is to realize the time-sharing multiplexing of the collector's dedicated keyboard and the host's standard keyboard, the relevant plugs and sockets are connected according to the user manual. According to the program, the level of the corresponding pin is detected to determine which data signal is allowed to be output, so as to achieve the purpose of time-sharing multiplexing by selecting different input address lines and different input devices.
2.3 ID card data frame format analysis
The Ministry of Public Security has strictly stipulated the information storage format of the second-generation ID card as shown in Table 1:
Table 1: Second-generation ID card data format
Field Name |
Name |
gender |
nationality |
Date of birth |
Home address |
ID number |
issuing authority |
Validity |
Additional information |
Photo information |
Length (bytes) |
30 |
2 |
4 |
16 |
70 |
36 |
30 |
32 |
36 |
1024 |
Starting address |
0000H |
001FH |
0021H |
0025H |
0035H |
007BH |
009FH |
00BDH |
00DDH |
0101H |
When the smart collector finds that the identity information already exists in the second-generation ID card reader through polling, it sends the AA AA AA 96 69 00 03 30 01 32 command to the connection port, and can read the corresponding data information according to the format given above. Among them: the current code of the gender field is 1-male, 2-female, 9-other; pay attention to the recognition of '-' in the home address field; the additional information field indicates the address change information, if there is no change, the field is empty; for photo information, the smart collector is only responsible for transmitting the encoded information to the terminal or PC according to a specific character stream, and then using the SDK provided by the Ministry of Public Security to decrypt and display the image; currently, image display can only be realized on the Windows platform.
3. Conclusion
This intelligent data collection device supports plug-and-play and adopts a special keyboard design. It does not need to switch input methods. When used in industries such as banking, telecommunications, and postal services, it does not need to make any changes to the software and hardware of the original system. It can automatically enter the second-generation resident ID card information; it is convenient and fast to use. The actual application in the front desk business service system of some branches of Chengdu Construction Bank shows that this design eliminates manual entry errors, reduces workload, and improves work efficiency.
References
[1] STC Enhanced 8051 MCU Chinese Guide (RC/RD+ Series) http://www.MCU-Memory.com;
[2] Wu Qingsheng, Qiu Hai, Principle and Application of Shrapnel Machine, University of Electronic Science and Technology Press, 1998, P82;
[3] Xu Lenian, Liu Kun, Liu Minghui, Design and Application of Intelligent Collector Based on M-BUS, Industrial and Mining Automation, 2006.4, P268
[4] He Jiangshui, Gao Youxing, Display support of Chinese characters in VxWorks, Microcomputer Information, 2005, 5: 142-144
Previous article:Design of intelligent temperature controller based on AT89C52
Next article:The Principle of SA8281 SPWM Wave Generator and Its Application in Frequency Converter
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Me and Arteli] DIY an AT32 board, full of favorability
- Microcontroller selection
- Made a tool to use serial port IAP to realize batch online upgrade program
- MSP430 watchdog usage notes && how to use the watchdog monitoring program to run away in low power mode
- EEWORLD University ---- Automotive/Industrial Millimeter Wave Radar Sensors
- When designing an isolation system using a linear optocoupler, the isolation strength is required to reach 1800 volts. What should be considered during the design?
- First day of work in 2021
- TL335x-EVM development board processor, FLASH, RAM, FRAM
- PCB circuit board heat dissipation tips
- Exposed! Another unfinished semiconductor project: defrauding state-owned land and refusing to return it! Using the name of chips to engage in real estate?