The purpose of the present invention is to provide a security authentication device, which can be applied to almost all mobile phone platforms, and can avoid the problem of user equipment matching. The user can use the device as long as the interface is connected, which greatly simplifies the user The operation and use experience.
 At this stage, the connection schemes that can be used to connect mobile phones to external security devices include Bluetooth, data line communication, etc. If the Bluetooth method is used, there will be a process of device matching, which will reduce the user experience. In addition, the high price of using the Bluetooth module will increase the cost of the final product and increase the product price. The main problem of using data cables for communication is that the data ports used by different brands and models of mobile phones on the market are not uniform in terms of physical interface or communication protocol. If you need to use a data cable for communication between the device and the mobile phone, the same device cannot be compatible with all mobile phone brands and models, and due to the difference in physical interfaces, the developed products cannot use the same product specifications, for each different interface type All mobile phones need to develop products that match their interfaces.
 Therefore, the present invention provides a safety authentication device using audio signal communication. For all audio interface communications, the same data protocol can be used, that is, audio signals can be used as data carriers. Products developed using audio communication can use the same physical specifications and communication methods, and the use of audio communication eliminates the problem of user equipment matching. Users can use the device as long as they connect the audio port of the mobile phone, which greatly simplifies User's operation and usage experience.
 The solution of using the audio interface as a communication connection first needs to solve the problem of how to make the analog signal carry the transmitted data. Because digital signals are more suitable for data transmission, data communication can be carried out by using high and low levels to identify binary 0s and 1s. The analog signal cannot pass this way, so a communication protocol suitable for analog signal transmission data needs to be developed.
 In the solution of using analog signals to transmit data, we use an encoding protocol based on the FSK method. One bit of the FSK communication protocol considered requires multiple waves to form and because the frequency of the audio signal is relatively low, Therefore, completely using FSK communication will result in too slow data transmission speed. Therefore, we use the different frequencies of the audio signal to identify the 0 and 1 of the binary data. That is, we use a cycle of analog signal with a frequency of 4K to identify 0, and a cycle of analog signal with a frequency of 8K to identify 1, so that a cycle of sine wave is used. It can identify a bit in the data, which solves the problem of slow speed.
 In addition, through tests on different mobile phones, it is found that the ground wires and MIC wires of different mobile phone audio interfaces may be opposite. Therefore, a method is needed to allow the device to automatically match different models of mobile phones without user intervention. In order to enable the device to recognize different mobile phone audio interfaces, two handshake methods are used to match different mobile phones. First, switch both the MIC and the ground wire to the ground on the mobile phone. The mobile phone sends a set of specific matching data to the device. After receiving the signal, the device connects the MIC wire to the MIC, and sends the response data after connecting the ground wire to the ground: "A", then connect the MIX line to the ground, connect the ground line to the MIC, and send the response data: "B". No matter if the mobile phone receives "A" or "B", the data will be sent back to the device intact. After the device determines whether it is "A" or "B", the MIC line and the ground line are in accordance with "A" or "B". "Corresponding way to connect. The function of tangent is realized by an analog switch.
 The hardware structure, application principle and communication process schematic diagram of the present invention will be described in detail below with reference to the accompanying drawings. figure 1 It is a block diagram of the hardware structure of the safety authentication device involved in the present invention. Such as figure 1 As shown, the security authentication device shown in the present invention includes: an audio interface 103, the audio interface 103 is used to communicate with a portable mobile device 20; a control unit 20, the control unit includes a storage module 102, the storage module 102 has a built-in security authentication information. The safety authentication device transmits the safety authentication information built in the storage module 102 to the portable mobile device 20 through the audio interface 103. The control unit 20 also includes an analog switch module 104 which enables the audio interface 103 to turn on or turn off the communication with the portable mobile device 20.
 The earphone interface automatically detects the communication switch through the analog switch SGM3005. MCU first set IN1&IN2 to "0" through the analog switch enable pin (as shown in the right picture), and NC1&NC2 can be seen (as shown in the left picture) that it is in the "ON" state. Conversely, when the enable pin is "1", NO1&NO2 are in the "ON" state.
 figure 2 It is a schematic diagram of the application of the present invention. The specific working principle is: MCU first passes the analog switch enable pin (IN1&IN2-M_ENA as shown in the figure below) M_ENA is set to “0”, and NC1&NC2 are “ON” and connected to micphone and ground; Communicate with the mobile phone in this state, if successful, keep the state. If it fails, the MCU sets “1” by enabling M_ENA to make NO1&NO2 in the “ON” state, respectively, ground and micphone; then keep communicating with the mobile phone. Through this enable detection to maintain successful communication.
 image 3 It is a schematic diagram of the communication process of the safety authentication device involved in the present invention, such as image 3 As shown in image 3 Describes the communication process from portable mobile equipment to safety authentication equipment and from safety authentication equipment to portable mobile equipment.
 From portable mobile device (mobile phone) to terminal (safety certification device):
 The 301 mobile phone drives the output through the audio module, starting with a sine half wave. A periodic sine wave with a frequency of 7350HZ represents bit'0', and a periodic sine wave with a frequency of 3675HZ represents bit'1'. During communication, the mobile phone program takes the bits of each byte data to be transmitted from low to high, and then modulates it into a sine wave signal of the corresponding frequency and outputs it through the audio channel. The 302 channel signal is transmitted to the terminal through the line, and the 303 is conditioned by the filter and shaping circuit module inside the terminal to obtain a square wave signal with constant frequency and sent to the MCU for processing. 304 The conditioned signal is led to the MCU external interrupt port, which is initially set to a falling edge trigger mode. In this way, the external interrupt monitors the falling edge of the signal in real time. Once the falling edge of the signal arrives, the external interrupt is triggered. The MCU responds to the interrupt service routine. The program starts the timer from 0 to start timing, and changes the trigger edge of the external interrupt to the rising edge trigger. Then exit the interrupt program. When the rising edge of the cycle waveform arrives, the external interrupt will be triggered again, enter the interrupt program and control the timer to stop counting, read this count value to convert the frequency of the current waveform, and then obtain the data bit corresponding value '1' or '0 ', write the corresponding variable byte bit to complete the reception of one bit, and finally change the trigger edge of the external interrupt to the falling edge trigger to monitor the waveform of the next data bit. According to this rule, and supplemented by the relevant communication protocol, a data frame is correctly received.
 From terminal (secure payment device) to portable mobile device (mobile phone):
 It is relatively simple for the 305 terminal to transmit data to the mobile phone. It directly outputs a square wave with a frequency of 7350HZ representing bit'0' through a GPIO, and a periodic square wave with a frequency of 3675HZ represents bit'1'. 306 During communication, the terminal program takes the bits of each byte data to be transmitted from low to high, and then modulates it into a square wave signal of the corresponding frequency and outputs it via IO. The 307 signal is transmitted to the audio interface MIC channel of the mobile phone through the line, and the mobile phone program controls the relevant module to sample the signal and demodulate the information data.
 Such as Figure 4 As shown, the safety authentication device 1 provided by the present invention can be made into the shape of an earphone, and the safety authentication device 1 is provided with a display screen 2 and buttons 3 for the operation of the safety authentication device 1. The security authentication device 1 has a USB port 4 on one side and a headphone jack 5 on one side. It is connected to the mobile phone through the audio interface (headphone port) on the mobile phone, and has a security authentication function while carrying the headset.
 Compared with the prior art, the safety authentication device and authentication method provided by the present invention use the audio signal that generally exists on mobile phones as the transmission interface, and has the greatest degree of compatibility. Third, the safety authentication device and authentication method using audio signal communication provided by the present invention do not require manual control by the user, and the system automatically judges whether the connection is successful, and is convenient and convenient to use. Finally, the safety authentication device and authentication method using audio signal communication provided by the present invention adopt an optimized frequency shift keying communication protocol, so that the time required for communication is shorter.
 The descriptions in this specification are only preferred specific embodiments of the present invention, and the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit the present invention. All technical solutions that can be obtained by those skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention should fall within the scope of the present invention.