Abstract:
An operating method for a card reader, comprising: powering on a card reader, and setting an operating mode according to the type of a device connected thereto; judging the operating mode, waiting to receive audio data if the operating mode is an audio mode, converting the received audio data into a digital signal, forming a data packet by the digital signal, parsing the data packet to obtain a parsing result, judging an instruction type according to the parsing result, executing a corresponding operation according to the instruction type, converting the obtained operation result into an audio data packet, and sending the audio data packet to the device connected thereto; and waiting to receive USB data if the operating mode is a USB mode, judging an instruction type of the received USB data, executing a corresponding operation according to the instruction type, and returning the operation result to the device connected thereto. According to the present invention, a card reader conducts data communication with a device through an audio module or a USB module, thereby not depending on the USB module in the existing card reader to conduct data communication any longer, having relatively good compatibility, and improving the user experience.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention relates to a working method of a card reader, which belongs to field of communication. 
       PRIOR ART 
       [0002]    At present, communication facilities, such as smart phones and tablets, are becoming more and more popular. However, most of the communication facilities do not have a main interface, or specifications of USB interfaces of the communication facilities are not unified, thus, data communication between a card reader and a communication device is limited. 
       SUMMARY OF THE INVENTION 
       [0003]    The object of the invention is to provide a working method of a card reader, in which data communication does not still rely on a USB module in the card reader, and the method makes the data communication more compatible and more convenient for users. 
         [0004]    Therefore, according to one aspect of the present invention, there provides a working method of a card reader, which includes: 
         [0005]    Step S 1 , powering on and initializing a card reader, and setting a work mode according to a type of a device which connects to the card reader; 
         [0006]    Step S 2 , determining the work mode, waiting for receiving audio data in the case that the work mode is an audio mode, and executing Step S 3  when the audio data is received; waiting for receiving USB data in the case that the work mode is a USB mode, and executing Step S 5  when the USB data is received; 
         [0007]    Step S 3 , transferring the audio data to digital signals, composing the digital signals to obtain a data package, parsing the data package to obtain a parsing result, determining a type of an instruction according to the parsing result, if the instruction is an operating-card instruction, sending the operating-card instruction to a card, waiting for receiving an operation result returned by the card, and executing Step S 4 ; if the instruction is the other instruction, executing a corresponding operation to obtain an operation result, and executing Step S 4 ; 
         [0008]    Step S 4 , transferring the operation result to an audio data package, sending the audio data package to the connected device, returning to Step S 2 ; and 
         [0009]    Step S 5 , determining a type of the received USB data, if the received USB data is an operating-card instruction, sending the operating-card instruction to a card, waiting for receiving an operation result returned by the card, sending the operation result to a device which connects to the card reader, and returning to Step S 2 ; if the received USB data is the other instruction, executing corresponding operation, and returning an operation result to the device which connects to the card reader, and returning to Step S 2 . 
         [0010]    Preferably, in Step S 1 , setting the work mode according to a type of the device which connects to the card reader, specifically includes: 
         [0011]    determining whether there exists a device which connects to the card reader via a USB module, if yes, setting the work mode as a USB mode; otherwise, setting the work mode as an audio mode; or, 
         [0012]    Step a 1 , determining whether there exists a device which connects to the card reader via an audio module, if yes, setting the work mode as the audio mode; otherwise, executing Step a 2 ; 
         [0013]    Step a 2 , determining whether there exists a device which connects to the card reader via a USB module, if yes, setting the work mode as the USB mode; otherwise, returning to Step a 1 ; or 
         [0014]    Step b 1 , determining whether there exists a device which connects to the card reader via a USB module, if yes, setting the work mode as the USB mode; otherwise, executing Step b 2 ; 
         [0015]    Step b 2 , determining whether there exists a device which connects to the card reader via an audio module, if yes, setting the work mode as the audio mode; otherwise, returning to Step b 1 . 
         [0016]    Preferably, in Step S 5 , returning to Step S 2  further includes: 
         [0017]    Step F 1 , determining whether the card reader connects to a power supply via the USB module, if yes, executing Step F 2 ; otherwise, returning to Step S 2 ; and 
         [0018]    Step F 2 , determining whether quantity of electric charge of a battery reaches a rated value, if yes, prompting over-charging of the battery, and returning to Step S 2 ; otherwise, returning to Step S 2 . 
         [0019]    Preferably, in Step S 2 , waiting for receiving the audio data specifically includes: determining whether the audio data is received via the audio mode in a preset duration, if yes, executing Step S 3 ; otherwise, returning to Step S 2 . 
         [0020]    Preferably, waiting for receiving the USB data specifically includes: determining whether the USB data is received via the USB module in a preset duration, if yes, executing Step S 5 ; otherwise, determining whether the audio data is received via the audio module in the preset duration. 
         [0021]    Preferably, in Step S 1 , initializing the card reader further includes: resetting a USB data transmission flag. 
         [0022]    Preferably, after the work mode is set according to the device which connects to the card reader, the step further includes: turning on a corresponding data communication interrupt according to the work mode, in which the data communication interrupt includes: a USB data communication interrupt and an audio data communication interrupt; when the data communication interrupt is happened, executing Step S 2 . 
         [0023]    Preferably, in Step S 2 , before waiting for receiving the audio data, the step further includes: turning off the USB data communication interrupt. 
         [0024]    Preferably, in Step S 4 , before Step S 2  is returned, the step further includes: turning on the USB data communication interrupt. 
         [0025]    Preferably, before waiting for receiving the USB data, the step further includes: turning off the audio data communication interrupt, determining whether the USB data transmission flag is set, if yes, executing Step S 5 ; otherwise, enabling a USB module connection, performing a USB data enumeration; determining whether the USB data enumeration is finished, setting the USB data transmission flag, and executing Step S 5  in the case that the USB data enumeration is finished; waiting for the data communication interrupt and returning to Step S 2  in the case that the USB data enumeration is not finished. 
         [0026]    Preferably, in Step S 5 , before Step S 2  is returned to, the step further includes: turning on the audio data communication interrupt. 
         [0027]    Preferably, in Step S 5 , turning on the audio data communication interrupt specifically includes: determining whether there exists a device which connects to the card reader via an audio module, if yes, turning on the audio data communication interrupt; otherwise, returning to Step S 2 . 
         [0028]    Preferably, in Step S 5 , after the audio data communication interrupt is turned on, the step further includes: determining whether there exists a device which connects to the card reader via the USB module, if yes, returning to Step S 2 ; otherwise, turning off the USB data communication interrupt, resetting the USB data transmission flag, the card reader setting the work mode according to the type of the device which connects to the card reader, and executing Step S 2 . 
         [0029]    Preferably, in Step S 2 , in the case that the work mode is the audio mode, the step further includes: initializing the audio module. 
         [0030]    Preferably, initializing the audio module specifically includes: turning on a low-power-dissipation timer interrupt, determining whether the audio data is received, if yes, receiving the audio data, resetting a low-power-dissipation timer flag, turning off the low-power-dissipation timer interrupt, sending the audio data to the card reader, and turning on the low-power-dissipation timer interrupt; otherwise, setting the low-power-dissipation timer flag; and 
         [0031]    starting to time when the low-power-dissipation timer interrupt is turned on, entering a low-power-dissipation timer interruption per preset duration, in which, entering the low-power-dissipation timer interruption specifically includes: determining whether the low-power-dissipation timer flag is set, if yes, entering a low-power-dissipation mode; otherwise, exiting from the low-power-dissipation timer interrupt. 
         [0032]    Preferably, in Step S 3 , transferring the audio data to the digital signals specifically includes: 
         [0033]    performing, by the card reader, a filtering process on the audio data to obtain a first processed data, performing a blocking process on the first processed data to obtain alternating component from the first processed data; obtaining a second processed data from the alternating component, transferring the second processed data so as to obtain transferred data, and performing the filtering process on the transferred data to obtain the digital signals. 
         [0034]    Preferably, in Step S 3 , after the digital signals is composed to the data package, and before the data package is parsed, the step further includes: determining whether the data package is legitimate, if yes, parsing the data package; otherwise, waiting for receiving the audio data, and when the audio data is received, returning to Step S 3 . 
         [0035]    Preferably, determining whether the data package is legitimate specifically includes: 
         [0036]    c 1 , obtaining data of four bytes starting from the first byte of the data package, making the data of four bytes as a frame header, determining whether the frame header is a first preset value, if yes, executing c 2 ; otherwise, the data package is illegitimate; 
         [0037]    c 2 , obtaining data at the seventh byte from the data package, making the data as a parameter flag, and determining whether the parameter flag is legitimate, if yes, executing c 3 ; otherwise, the data package is illegitimate; 
         [0038]    c 3 , obtaining data of two bytes starting from the eighth byte of the data package, making the data of two bytes as data-length-value, and executing c 4 ; 
         [0039]    c 4 , obtaining data whose length equals the data-length-value starting from the tenth byte, making the data as a data field, obtaining data of one byte behind the data field, making the data of one byte as a check word, and executing c 5 ; and 
         [0040]    c 5 , calculating the data field via a preset algorithm to obtain a result, comparing the result with the check word, if the result is same as the check word, the data package is legitimate; if the result is not same as the check word, the data package is illegitimate. 
         [0041]    Preferably, determining whether the parameter flag is legitimate in c 2  specifically includes: determining whether the parameter flag is a second preset value or a third preset value, if yes, the parameter flag is legitimate; otherwise, the parameter flag is illegitimate. 
         [0042]    Preferably, when the data package is legitimate, the step further includes: determining the parameter flag, parsing the data package in the case that the parameter flag is the second preset value; waiting for receiving data of a preset length in the case that the parameter flag is the third preset value, and adding the data into the data package, and parsing the current data package. 
         [0043]    Preferably, in Step S 4 , transferring the operation result to the audio data package specifically includes: 
         [0044]    compressing an amplitude voltage of the digital signals of the operation result, transferring the digital signals of the operation result to an analog signal which is similar to a sine wave by a process of charging and discharging slowly, and transferring the analog signal to an audio data package. 
         [0045]    Preferably, in Step S 1 , initializing further includes: setting a card-slot-state flag as a no-card flag; setting the card-slot-state flag as a card-in flag in the case that a card-in-slot pin is a high level; setting the card-slot-state flag as the no-card flag in the case that the card-in-slot pin is a low level. 
         [0046]    Preferably, in Step S 3 , the other instructions includes: an instruction for inquiring card-slot-state, a powering-on instruction, and a powering-off instruction. 
         [0047]    Preferably, in Step S 3 , determining a type of the instruction according to the parsing result, inquiring a state of the card slot according to the card-slot-state flag in the case that the instruction is the instruction for inquiring card-slot-state, setting card-slot-state data, making the card-slot-state data as the operation result, and executing Step S 4 . 
         [0048]    Preferably, in the case that the instruction is the powering-on instruction, determining whether there exists a card in the card slot according to the card-slot-state flag, if yes, powering on the card slot, reading a card-slot-powered-on response, making the card-slot-powered-on response as the operation result, and executing Step S 4 ; otherwise, generating a no-card-in-slot response, making the no-card-in-slot response as the operation result, and executing Step S 4 . 
         [0049]    Preferably, in the case that the instruction is the powering-off instruction, powering off the card slot, reading a card-slot-powered-off response, making the response as the operation result, and executing Step S 4 . 
         [0050]    Preferably, in Step S 5 , the other instruction includes: the instruction for inquiring card-slot-state, the powering-on instruction, and the powering-off instruction. 
         [0051]    Preferably, in Step S 5 , determining the type of instruction according to the parsing result, in the case that the instruction is the instruction for inquiring card-slot-state, inquiring the state of the card slot according to the card-slot-state flag, setting the card-slot-state data, sending the card-slot-state data to a device which connects to the card reader, and returning to Step S 2 . 
         [0052]    Preferably, in the case that the instruction is the powering-on instruction, determining whether there exists a card in the card slot according to the card-slot-state flag, if yes, powering on the card slot, reading a card-slot-powered-on response, sending the card-slot-powered-on response to the device which connects to the card reader, and returning to Step S 2 ; otherwise, generating a no-card-in-slot response, and sending the response to the device which connects to the card reader, and returning to Step S 2 . 
         [0053]    Preferably, in the case that the instruction is the powering-off instruction, powering off the card slot, reading a card-slot-powered-off response, sending the response to the device which connects to the card reader, and returning to Step S 2 . 
         [0054]    According to the other aspect of the present invention, there provides a method of a card reader, which includes: 
         [0055]    Step W 1 , powering on a card reader, and initializing the card reader; 
         [0056]    Step W 2 , waiting for receiving data; 
         [0057]    Step W 3 , setting a work mode as a USB mode, and executing Step W 4  when USB data is received via a USB channel; setting the work mode as an audio mode, and executing Step W 5  when audio data is received via an audio channel; 
         [0058]    Step W 4 , determining an type of the received USB data, if the received USB data is an operating-card instruction, sending the operating-card instruction to the card, waiting for receiving an operation result returned by the card, and executing Step W 6 ; if the received USB data is another instruction, executing corresponding operation to obtain an operation result, and executing Step W 6 ; 
         [0059]    Step W 5 , transferring the audio data to digital signals, composing the digital signals to a data package, parsing the data package to obtain a parsing result, and determining a type of the instruction according to the parsing result, if the instruction is the operating-card instruction, sending the operating-card instruction to the card, waiting for an operation result returned by the card, and executing Step W 6 ; if the instruction is another instruction, executing a corresponding operation to obtain an operation result, and executing Step W 6 ; and 
         [0060]    Step W 6 , determining a work mode, sending the operation result to a device which connects to the card reader, and returning to Step W 2  in the case that the work mode is a USB mode; transferring the operation result to an audio data package, sending the audio data package to the device which connects to the card reader, and returning to Step W 2  in the case that the work mode is an audio mode. 
         [0061]    Preferably, in Step W 6 , before Step W 2  is returned to, the step further includes: 
         [0062]    Step G 1 , determining whether the USB module is connected to a power supply, if yes, executing Step G 2 ; otherwise, returning to Step W 2 ; 
         [0063]    Step G 2 , determining whether quantity of electric charge of the battery reaches a rated value, if yes, executing Step G 3 ; otherwise, returning to Step W 2 ; and 
         [0064]    Step G 3 , prompting over-charging of the battery, returning to Step W 2 . 
         [0065]    Preferably, in Step W 3 , after the USB data is received via a USB channel, and before the work mode is set as the USB mode, the step further includes: turning off an audio data communication interrupt. 
         [0066]    Preferably, in Step W 6 , in the case that the work mode is the USB mode, after the operation result is sent to the device connected to the card reader via a USB channel, and before Step W 2  is returned to, the step further includes: turning on the audio data communication interrupt. 
         [0067]    Preferably, in Step W 3 , after the audio data is received via an audio channel, and before the work mode is set as the audio mode, the step further includes: turning off a USB data communication interrupt. 
         [0068]    Preferably, in Step W 6 , in the case that the woke mode is an audio mode, after the operation result is sent to the device connected to the card reader via the audio channel, and before Step W 2  is returned to, the step further includes: turning on the USB data communication interrupt. 
         [0069]    Preferably, Step W 2  specifically includes: determining whether there exists a device which connects to the card reader via the USB module, if yes, waiting for receiving USB data, and executing Step W 3 ; otherwise, determining whether audio data is received in a preset duration, executing Step W 3  in the case that the audio data is received in the preset duration; entering a low-power-dissipation mode in the case that the audio data is not received in the preset duration. 
         [0070]    Preferably, in Step W 3 , setting the work mode as the audio mode, and executing Step W 5  when the audio data is received via the audio channel specifically includes: determining whether the work mode is a low-power-dissipation mode when the audio data is received via the audio channel, if yes, exiting from the low-power-dissipation mode, and executing Step W 5 ; otherwise, executing Step W 5 . 
         [0071]    Preferably, in Step W 5 , transferring the audio data to digital signals specifically includes: 
         [0072]    performing, by the card reader, a filtering process on the audio data to obtain a first processed data, performing a blocking process on the first processed data to obtain alternating component from the first processed data; obtaining a second processed data from the alternating component, transferring the second processed data so as to obtain transferred data, and performing the filtering process on the transferred data to obtain the digital signals. 
         [0073]    Preferably, in Step W 5 , after composing the digital signals to a data package, and before parsing the data package, the step further includes: determining whether the data package is legitimate. 
         [0074]    Preferably, determining whether the data package is legitimate specifically includes: 
         [0075]    L 1 , obtaining data of four bytes starting from the first byte of the data package, making the data of four bytes as a frame header, determining whether the frame header is a first preset value, if yes, executing L 2 ; otherwise, the data package is illegitimate; 
         [0076]    L 2 , obtaining data at the seventh byte from the data package, making the data as a parameter flag, and determining whether the parameter flag is legitimate, if yes, executing L 3 ; otherwise, the data package is illegitimate; 
         [0077]    L 3 , obtaining data of two bytes starting from the eighth byte of the data package, making the data of two bytes as a data-length-value, and executing L 4 ; 
         [0078]    L 4 , obtaining data whose length equals the data-length-value starting from the tenth byte, making the data as a data field, obtaining data of one byte behind the data field, making the data of one byte as a check word, and executing L 5 ; and 
         [0079]    L 5 , calculating the data field via a preset algorithm to obtain a result, comparing the result with the check word, if the result is same as the check word, the data package is legitimate; if the result is not same as the check word, the data package is illegitimate. 
         [0080]    Preferably, determining whether the parameter is legitimate specifically includes: the parameter flag is legitimate in the case that the parameter flag is the second preset value or the third preset value; the parameter flag is not legitimate in the case that the parameter is other values. 
         [0081]    Preferably, when the data package is legitimate, the step further includes: determining the parameter, parsing the data package in the case that the parameter flag is the second preset value; waiting for receiving data of a preset length, putting the data into the data package, and then parsing the data package in the case that the parameter flag is the third preset value. 
         [0082]    Preferably, in Step W 6 , transferring the operation result to an audio data package specifically includes: 
         [0083]    compressing an amplitude voltage of the digital signals of the operation result, transferring the digital signals of the operation result to an analog signal which is similar to a sine wave through the process of charging or discharging slowly, and transferring the analog signal to an audio data package. 
         [0084]    Preferably, in Step W 1 , initializing further includes: setting a card-slot-state flag as a no-card flag; setting the card-slot-state flag as a card-in flag in the case that a card-in-slot pin is a high level; setting the card-slot-state flag as the no-card flag in the case that the card-in-slot pin is a low level. 
         [0085]    Preferably, in Step W 4 , the other instructions include: an instruction for inquiring card-slot-state, a powering-on instruction, and a powering-off instruction. 
         [0086]    Preferably, in Step W 4 , determining a type of the received USB data, inquiring a state of the card slot according to the card-slot-state flag in the case that the instruction is the instruction for inquiring card-slot-state, setting card-slot-state data, making the card-slot-state data as the operation result, and executing Step W 6 . 
         [0087]    Preferably, in the case that the instruction is the powering-on instruction, determining whether there exists a card in the card slot according to the card-slot-state flag, if yes, powering on the card slot, reading a card-slot-powered-on response, making the card-slot-powered-on response as the operation result, and executing Step W 6 ; otherwise, generating a no-card-in-slot response, making the no-card-in-slot response as the operation result, and executing Step W 6 . 
         [0088]    Preferably, in the case that the instruction is the powering-off instruction, powering off the card slot, reading a card-slot-powered-off response, making the response as the operation result, and executing Step W 6 . 
         [0089]    Preferably, in Step W 5 , the other instructions include: the instruction for inquiring card-slot-state, the powering-on instruction, and the powering-off instruction. 
         [0090]    Preferably, determining the type of instruction according to the parsing result, in the case that the instruction is the instruction for inquiring card-slot-state, inquiring the state of the card slot according to the card-slot-state flag, setting the card-slot-state data, making the card-slot-state data as an operation result, and executing Step W 6 . 
         [0091]    Preferably, in the case that the instruction is the powering-on instruction, determining whether there exists a card in the card slot according to the card-slot-state flag, if yes, powering on the card slot, reading a card-slot-powered-on response, making the card-slot-powered-on response as an operation result, and executing Step W 6 ; otherwise, generating a no-card-in-slot response, and making the no-card-in-slot response as an operation result, and executing Step W 6 . 
         [0092]    Preferably, in the case that the instruction is the powering-off instruction, powering off the card slot, reading a card-slot-powered-off response, making the response as an operation result, and executing Step W 6 . 
         [0093]    As one advantage of the present invention, a card reader communicates with a device via an audio module or a USB module, instead of relying on a USB module in a card reader in prior art, in this way, the card reader is more compatible and convenient for a user. 
     
    
     
       BRIEF DESCRIPTION OF THE ACCOMPANYING DRAWINGS 
         [0094]      FIG. 1  is a flow diagram of a working method of a card reader according to Embodiment 1 of the present invention; 
           [0095]      FIG. 2  is a flow diagram of a method for processing an inserting-card-in interrupt according to Embodiment 1 of the present invention; 
           [0096]      FIG. 3  is a flow diagram of a method for processing a pulling-card-out interrupt according to Embodiment 1 of the present invention; 
           [0097]      FIG. 4  is a flow diagram of a working method for initializing an audio module according to Embodiment 1 of the present invention; 
           [0098]      FIG. 5  is a flow diagram of a working method of a low-power-dissipation timer interrupt according to Embodiment 1 of the present invention; 
           [0099]      FIG. 6  is a flow diagram of a working method of a card reader according to Embodiment 2 of the present invention; 
           [0100]      FIG. 7  is a flow diagram of a working method of a card reader according to Embodiment 3 of the present invention; 
           [0101]      FIG. 8  is a flow diagram of a method for processing audio data according to Embodiment 4 of the present invention; 
           [0102]      FIG. 9  is a flow diagram of a method for determining whether a data package is legitimate according to Step  407  in Embodiment 4 of the present invention; and 
           [0103]      FIG. 10  is a flow diagram of a method for processing USB data according to Embodiment 5 of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0104]    The technical solution in the Embodiments of the present invention is further described more clearly and completely with the drawings in the Embodiments of the present invention. Apparently, Embodiments described are just a few Embodiments of the present invention. On the basis of Embodiments of the invention, all other related Embodiments made by those skilled in the art without inventive work belong to the scope of the invention. 
       Embodiment 1 
       [0105]    The present Embodiment 1 provides a working method of a card reader, as shown in  FIG. 1 , the method specifically includes following steps. 
         [0106]    Step  101 , a card reader is powered on and initialized; 
         [0107]    in the present Embodiment 1, that the card reader is initialized specifically includes: a USB-channel-connect flag is reset, a card-in-slot pin is initialized as a low electric level, a card-slot-state is initialized as no-card flag. After the card reader is initialized, the method further includes: an interrupt is turned on, in which, the interrupt includes inserting-card-in interrupt and pulling-out-card interrupt. 
         [0108]    When the card-in-slot pin of the card reader is high electric level, the inserting-card-in interrupt is entered, as shown in  FIG. 2 , which specifically includes: 
         [0109]    Step a 1 , the interrupt is turned off, an inserting-card-in interrupt flag is cleared, a card-slot-state flag is set as a card-in flag; 
         [0110]    preferably, the card-in flag is 0x00; 
         [0111]    Step a 2 , determine whether the USB-channel-connect flag is set, if yes, execute Step a 3 ; otherwise, execute Step a 4 ; 
         [0112]    in Embodiment 1, the USB-channel-connect flag is used for identifying whether the card reader connects to a USB device via a USB module; in the case that the card reader connects to the USB device via a USB module, the USB-channel-connect flag is set by the card reader, the USB module supplies power for the card reader, and the battery is charged by the USB module; 
         [0113]    in the case that the USB module of the card reader does not connect to the USB device, the USB-channel-connect flag is reset by the card reader, the USB module stops supplying power for the card reader; 
         [0114]    Step a 3 , an inserting-card-in response is written into an INT endpoint, and Step a 4  is executed; 
         [0115]    in Embodiment 1, the inserting-card-in response is 5003; 
         [0116]    Step a 4 , determine whether a suspend flag is set, if yes, execute Step a 5 ; otherwise, execute Step a 6 ; 
         [0117]    Step a 5 , the suspend flag is reset, MCU is waken up, and Step a 6  is executed; 
         [0118]    Step a 6 , the interrupt is turned on, and exit from the inserting-card-in interrupt. 
         [0119]    In the case that the card-in-slot pin of the card reader is a lower electric level, the pulling-card-out interrupt is entered, as shown in  FIG. 3 , entering the pulling-card-out interrupt specifically includes: 
         [0120]    Step b 1 , the interrupt is turned off, the pulling-card-out interrupt is cleared, the card-slot-state flag is set as no-card flag; 
         [0121]    preferably, the no-card flag is 0X02; 
         [0122]    Step b 2 , determine whether the USB-channel-connect flag is set, if yes, execute Step b 3 ; otherwise, execute Step b 4 ; 
         [0123]    Step b 3 , a pulling-card-out response is written into the INT endpoint, and Step b 4  is executed; 
         [0124]    in Embodiment 1, the pulling-card-out response is  5002 ; 
         [0125]    Step b 4 , the suspend flag is set, MCU is suspended, the interruption is turned on, the pulling-card-out interrupt is exited from. 
         [0126]    Step  102 , a work mode is set according to an IO pin-level state; 
         [0127]    in present Embodiment 1, the work mode is set according to the IO pin-level state, the work mode is an audio mode in the case that the IO pin-level is low electric level; the work mode is set as a USB mode in the case that the IO pin-level is high electric level; 
         [0128]    when the card reader connects to the USB device via a USB module, the IO pin-level is high electric level; when the card reader does not connect to the USB device via a USB module, the IO pin-level is low electric level. 
         [0129]    When the IO pin-level is low electric level, the battery supplies power for the audio module; when the IO pin-level is high electric level, the battery stops supplying power for the audio module. 
         [0130]    Step  103 , the work mode is determined, Step  104  is executed in the case that the work mode is an audio mode; Step  108  is executed in the case that the work mode is a USB mode. 
         [0131]    Step  104 , the audio module is initialized, an audio timer is turned on, and Step  105  is executed; 
         [0132]    in the present Embodiment 1, when the audio module is initialized, an audio-timing flag bit is cleared. 
         [0133]    When the audio module is initialized, as shown in  FIG. 4 , the process further includes: 
         [0134]    Step K 1 , a low-power-dissipation timer interrupt is turned on, audio data waits for being received; 
         [0135]    preferably, the low-power-dissipation timer interrupt is entered every 10 seconds. 
         [0136]    Step K 2 , determine whether the audio data is received, if yes, Step K 3  is executed; otherwise, Step K 4  is executed; 
         [0137]    Step K 3 , the audio data is received via the audio module, a low-power-dissipation timer flag is reset, the low-power-dissipation timer interrupt is turned off, the audio data is sent to the card reader, the low-power-dissipation timer interrupt is turned on, the present process is ended; and 
         [0138]    Step K 4 , the low-power-dissipation timer flag is set, the present process is ended; in the present Embodiment 1, a low-power-dissipation timer interrupt is entered when the duration reaches 10 seconds, the low-power-dissipation timer flag is set. 
         [0139]    When the low-power-dissipation timer interrupt is entered, as shown in  FIG. 5 , the following steps are executed: 
         [0140]    Step M 1 , the low-power-dissipation timer interrupt is entered; 
         [0141]    Step M 2 , determine whether the low-power-dissipation timer flag is set, if yes, execute Step M 3 ; otherwise, exit from the low-power-dissipation timer interrupt; and 
         [0142]    Step M 3 , a low-power-dissipation mode is entered; 
         [0143]    in the present Embodiment 1, when the audio data is received by the audio module, the low-power-dissipation mode is exited from. 
         [0144]    Step  104  further includes: determine whether the working voltage is lower than the preset value, if yes, prompt that the working voltage is low, and stop supplying power for the card reader after a preset duration; otherwise, execute Step  105 ; 
         [0145]    that the working voltage is low can be prompted by displaying on a screen and/or changing the color of a indicator light and/or buzzing and/or broadcasting; preferably, the preset duration is 30 seconds. 
         [0146]    Step  105 , determine whether an audio-timing flag bit is set, if yes, return to Step  103 ; otherwise, execute Step  106 ; 
         [0147]    in the present Embodiment 1, the audio-timing flag bit is applied for identifying whether data is received by the card reader via the audio module in a preset duration. If the data is not received when the audio-timing flag bit reaches the preset duration, the audio-timing flag bit is set by the card reader. 
         [0148]    Step  106 , determine whether the audio data is received via the audio module, if yes, execute Step  107 ; otherwise, return to Step  105 . 
         [0149]    Step  107 , the audio-timing flag bit is cleared, the audio timer is turned off, the received audio data is processed correspondingly to obtain a processed result, and the processed result is returned to the audio device. 
         [0150]    In present Embodiment 1, more details about the received audio data is processed by the card reader see Embodiment 4. 
         [0151]    Step  108 , the USB module is initialized, a USB timer is turned on; 
         [0152]    in the present Embodiment 1, initializing the USB module further includes: a USB timing flag bit is cleared. 
         [0153]    Step  109 , determine whether the USB timing flag bit is set, if yes, execute Step  104 ; otherwise, execute Step  110 ; 
         [0154]    in the present Embodiment 1, the USB timing flag bit is applied for identifying whether USB data is received by the card reader via the USB module in the preset duration. 
         [0155]    Step  110 , determine whether the USB data is received via the USB module, if yes, execute Step  111 ; otherwise, return to Step  109 . 
         [0156]    Step  111 , the USB timing flag bit is cleared, a USB timer is turned off, the received USB data is processed correspondingly to obtain a processed result, the processed result is returned to the USB device. 
         [0157]    In the present Embodiment 1, more details about processing the USB data, which can be seen in Embodiment 5, are omitted herein. 
       Embodiment 2 
       [0158]    Embodiment 2 of the present invention provides a working method of a card reader, as shown in  FIG. 6 , the method includes following steps. 
         [0159]    Step  201 , the card reader is powered on and initialized; 
         [0160]    the operation of Step  201  is as same as that of Step  101 , besides, Step  201  further includes: a USB data transmission flag is reset. 
         [0161]    In the case that a card-in-slot pin is high electric level, an inserting-card-in interrupt is executed, specific operation is as same as that from Step a 1  to Step a 6  in Embodiment 1, more details will not given herein. 
         [0162]    In the case that the card-in-slot pin is low electric level, pulling-card-out interrupt is executed, specific operation is as same as that from Step b 1  to Step b 4  in Embodiment 1, more details will not given herein. 
         [0163]    Step  202 , determine whether there exists an audio device which connects to the card reader via an audio module, if yes, execute Step  203 ; otherwise, execute Step  204 . 
         [0164]    Step  203 , the work mode is set as the audio mode, an audio data communication interrupt is turned on, Step  206  is executed. 
         [0165]    Step  204 , determine whether there exists a USB device which connects to the card reader via a USB module, if yes, execute Step  205 ; otherwise, execute Step  202 . 
         [0166]    Step  205 , the work mode is set as the USB mode, a USB data communication interrupt is turned on, and Step  206  is executed. 
         [0167]    In the present Embodiment 2, the steps from Step  202  to Step  205  may be replaced with: 
         [0168]    Step  202 ′, determine whether there exists a USB device which connects to the card reader via a USB module, if yes, execute Step  203 ′; otherwise, execute Step  204 ′; 
         [0169]    Step  203 ′, the work mode is set as the USB mode, the USB data communication interrupt is turned on, Step  206  is executed; 
         [0170]    Step  204 ′, determine whether there exists an audio device which connects to the card reader via an audio module, if yes, execute Step  205 ′; otherwise, execute Step  202 ′; and 
         [0171]    Step  205 ′, the work mode is set as the audio mode, the audio data communication interrupt is turned on, Step  206  is executed. 
         [0172]    Step  206 , wait for an interrupt, determine the work mode when the interrupt is happened, execute Step  207  in the case that the work mode is the audio mode; execute Step  211  in the case that the work mode is the USB mode. 
         [0173]    Step  207 , the USB data communication interrupt is turned off, audio data waits for being received, and Step  208  is executed. 
         [0174]    Step  208 , when the audio data is received, the audio data is processed correspondingly to obtain a processed result, the processed result is returned to the audio device, the USB data communication interrupt is turned on; 
         [0175]    in the present Embodiment 2, more details about processing the received audio data by the card reader see Embodiment 4. 
         [0176]    Step  209 , determine whether there exists an audio device which connects to the card reader via an audio module, if yes, return to Step  206 ; otherwise, execute Step  210 . 
         [0177]    Step  210 , the audio data communication interrupt is turned off, and Step  202  is returned to. 
         [0178]    Step  211 , the audio data communication interrupt is turned off, whether the USB data transmission flag is set is determined, if yes, Step  216  is executed; otherwise, Step  212  is executed; 
         [0179]    in the present Embodiment 2, when the USB device is pulled out, the USB data transmission flag is reset. 
         [0180]    Step  212 , a USB module connection is enabled, and Step  213  is executed. 
         [0181]    Step  213 , a USB enumeration is executed. 
         [0182]    Step  214 , determine whether the USB enumeration is finished, if yes, execute Step  215 ; otherwise, return to Step  206 . 
         [0183]    Step  215 , the USB data transmission flag is set, and Step  216  is executed. 
         [0184]    Step  216 , wait for receiving USB data sent by the USB device, when the USB data is received via the USB module, the USB data is processed correspondingly to obtain a processed result, the processed result is returned to the USB device, and Step  217  is executed; 
         [0185]    in the present Embodiment 2, more details about the process of processing the USB data by the card reader see Embodiment 5. 
         [0186]    Step  217 , determine whether there exists an audio device which connects to the card reader via an audio module, if yes, execute Step  218 ; otherwise, return to Step  206 . 
         [0187]    Step  218 , the audio data communication interrupt is turned on, and Step  206  is executed. 
       Embodiment 3 
       [0188]    The present Embodiment 3 provides a working method of a card reader, as shown in  FIG. 7 , the working method includes following steps. 
         [0189]    Step  301 , the card reader is powered on and initialized; 
         [0190]    in the present Embodiment 3, initializing the card reader specifically includes: a USB-channel-connect flag is reset, a card-in-slot pin is initialized as a low electric level, a card-slot-state flag is initialized as a no-card flag. After the card reader is initialized, the step further includes: an interrupt is turned on, in which, the interrupt includes an inserting-card-in interrupt and a pulling-card-out interrupt. 
         [0191]    When the card-in-slot pin of the card reader is a high electric level, the inserting-card-in interrupt is entered, the specific operation is as same as that from Step a 1  to Step a 6  in Embodiment 1, more details will not be given herein. 
         [0192]    When the card-in-slot pin of the card reader is a low electric level, the pulling-card-out interruption is entered, specific operation is as same as that from Step b 1  to Step b 4  in Embodiment 1, more details will not be given herein. 
         [0193]    Step  302 , determine whether there exists an audio device which connects to the card reader via an audio module, if yes, execute Step  303 ; otherwise, execute Step  304 . 
         [0194]    Step  303 , the work mode is set as an audio mode, an audio data communication interrupt is turned on, and Step  306  is executed. 
         [0195]    Step  304 , determine whether there exists a USB device which connects to the card reader via a USB module, if yes, execute Step  305 ; otherwise, return to Step  302 . 
         [0196]    Step  305 , the work mode is set as a USB mode, a USB data communication interrupt is turned on, Step  306  is executed. 
         [0197]    In the present Embodiment 3, steps from Step  302  to Step  305  may be replaced with: 
         [0198]    Step  302 ′, determine whether there exists a USB device which connects to the card reader via the USB module, if yes, execute Step  303 ′; otherwise, execute Step  304 ′; 
         [0199]    Step  303 ′, the work mode is set as the USB mode, the USB data communication interrupt is turned on, and Step  306  is executed; 
         [0200]    Step  304 ′, determine whether there exists an audio device which connects to the card reader via the audio module, if yes, execute Step  305 ′; otherwise, return to Step  302 ′; and 
         [0201]    Step  305 ′, the work mode is set as the audio mode, the audio data communication interrupt is turned on, and Step  306  is executed. 
         [0202]    Step  306 , wait for an interrupt, when the interrupt is happened, determine the work mode, execute Step  307  in the case that the work mode is the audio mode; execute Step  312  in the case that the work mode is the USB mode. 
         [0203]    Step  307 , the USB data communication interrupt is turned off, the audio data waits for being received, and Step  308  is executed. 
         [0204]    Step  308 , when the audio data is received, the audio data is processed correspondingly to obtain a processed result, the processed result is returned to the audio device, and the USB data communication interrupt is turned on; 
         [0205]    in the present Embodiment 3, specific details about the process of processing the received audio data by the card reader, which can be seen in Embodiment 4, are omitted herein. 
         [0206]    Step  309 , determine whether the card reader connects to a power supply via a USB module, if yes, execute Step  310 ; otherwise, return to Step  306 ; 
         [0207]    in the present Embodiment 3, determining whether the card reader connects a power supply via a USB module specifically includes: the card reader determines whether an JO pin is a high electric level and whether there is no communication signal, if yes, the card reader connects to the power supply via the USB module; otherwise, the card reader does not connects to the power supply via the USB module. 
         [0208]    Step  310 , determine whether quantity of electric charge of the battery reaches a rated value, if yes, execute Step  311 ; otherwise, execute Step  306 . 
         [0209]    Step  311 , prompt over-charging of the battery, and return to Step  306 . 
         [0210]    Step  312 , the audio data communication interrupt is turned off, whether the USB data transmission flag is set is determined, if yes, Step  317  is executed; otherwise, Step  313  is executed. 
         [0211]    Step  313 , a USB module connection is enabled. 
         [0212]    Step  314 , a USB enumeration is executed. 
         [0213]    Step  315 , determine whether the USB enumeration is finished, if yes, execute Step  316 ; otherwise, return to Step  306 . 
         [0214]    Step  316 , the USB data transmission flag is set, and Step  317  is executed. 
         [0215]    Step  317 , wait for receiving the USB data sent by the USB device, when the USB data is received via the USB module, the USB data is processed correspondingly to obtain a processed result, the processed result is returned to the USB device, the audio data communication interrupt is turned on; 
         [0216]    in the present Embodiment 3, specific details about the process of processing the USB data by the card reader see Embodiment 5. 
         [0217]    Step  318 , determine whether there exists a USB device which connects to the card reader via the USB module, if yes, return to Step  306 ; otherwise, execute Step  319 . 
         [0218]    Step  319 , the USB data communication interrupt is turned off, the USB data transmission flag is reset, and Step  302  is returned to. 
       Embodiment 4 
       [0219]    The present Embodiment 4 provides a method for processing audio data, as shown in  FIG. 8 , the method specifically includes following steps. 
         [0220]    Step  401 , a card reader waits for receiving audio data. 
         [0221]    Step  402 , when the audio data is received, perform a filtering process on the audio data to obtain a first processed data. 
         [0222]    Specifically, the card reader filters noises from the audio data to obtain clear audio data which is made as the first processed data. 
         [0223]    Step  403 , perform a blocking process on the first processed data to obtain alternating component from the first processed data. 
         [0224]    Step  404 , a second processed data is obtained from the alternating component; specifically, the card reader obtains data whose frequency is higher than a cut-off frequency from the alternating component, and the data is made as the second processed data. 
         [0225]    Step  405 , the second processed data is transferred to digital signals. 
         [0226]    Step  406 , perform the filtering process on the digital signals to obtain processed digital signals. 
         [0227]    Step  407 , the processed digital signals compose a data package, whether the data package is legitimate is determined, if yes, Step  408  is executed; otherwise, Step  401  is executed. 
         [0228]    In the present Embodiment 4, as shown in  FIG. 9 , determining whether the data package is legitimate includes: 
         [0229]    c 1 , starting from the first byte of the data package, data of four bytes is obtained, the data of four bytes is made as a frame header, whether the frame header is a first preset value is determined, if yes, c 2  is executed; otherwise, Step  401  is returned to; 
         [0230]    preferably, the first preset value is 0X0ff055aa; 
         [0231]    c 2 , data at a seventh byte is obtained from the data package and made as a parameter flag, whether the parameter flag is legitimate is determined, if yes, c 3  is executed; otherwise, Step  401  is returned to; 
         [0232]    determining whether the parameter is legitimate specifically includes: if the parameter flag is a second preset value or a third preset value, the parameter flag is legitimate; otherwise, the parameter flag is illegitimate; preferably, the second preset value is 0X01; the third preset value is 0X02; 
         [0233]    c 3 , starting from the eighth byte, data of two bytes is obtained from the data package, the data of two bytes is made as data-length-value, and c 4  is executed; 
         [0234]    c 4 , starting from the tenth byte, data whose length equals the data-length-value is obtained and made as a data field, data of one byte behind the data field is made as a check word, c 5  is executed; 
         [0235]    c 5 , the data field is calculated via a preset algorithm to obtain a calculated result, the calculated result is compared with the check word, if the calculated result is as same as the check word, c 6  is executed; if the calculated result is not as same as the check word, Step  401  is returned to; and 
         [0236]    c 6 , the parameter flag is determined, Step  408  is executed in the case that the parameter flag is the second preset value; wait for receiving data of a preset length in the case that the parameter flag is the third preset value, the data of a preset length is added into the data package, Step  408  is executed. 
         [0237]    Preferably, the preset length is ten bytes. 
         [0238]    Step  408 , the data package is parsed, a type of instruction is determined according to a parsing result, Step  409  is executed in the case that the instruction is an instruction for inquiring card-slot-state; Step  413  is executed in the case that the instruction is a powering-on instruction; Step  421  is executed in the case that the instruction is a powering-off instruction; Step  425  is executed in the case that the instruction is an operating-card instruction; execute corresponding operation in the case that the instruction is other instruction, and return to Step  401 ; 
         [0239]    in the present Embodiment 4, determine a type of the instruction according to a first byte of the parsing result; 
         [0240]    if the first byte is 0X65, the instruction is an instruction for inquiring card-slot-state; 
         [0241]    if the first byte is 0X62, the instruction is a powering-on instruction; 
         [0242]    if the first byte is 0X63, the instruction is a powering-off instruction; and 
         [0243]    if the first byte is 0X6f, the instruction is an operating-card instruction. 
         [0244]    Step  409 , a state of the card slot is inquired according to the card-slot-state flag, and card-slot-state data is set; 
         [0245]    in the present Embodiment 4, if the card-slot-state flag is a card-in flag, there is a card is the card slot, and a preset byte of the card-slot-state data is set as 0X00; 
         [0246]    if the card-slot-state flag is a no-card flag, there is no card in the card slot, and the preset byte of the card-slot-state is set as 0X02; 
         [0247]    preferably, the preset byte of the card-slot-state data is the eighth byte of the card-slot-state data. 
         [0248]    Step  410 , an amplitude voltage of the digital signals of the card-slot-state data is processed to obtain a processed card-slot-state data. 
         [0249]    Step  411 , the processed card-slot-state data is transferred to a card-slot-state audio data package; 
         [0250]    specifically, the processed card-slot-state data is transferred to analog signals which are similar as a sine wave through a process of charging or discharging slowly, then, the analog signals are transferred to the card-slot-state audio data package. 
         [0251]    Step  412 , the card-slot-state audio data package is sent to the audio device via an audio module, and Step  401  is returned. 
         [0252]    Step  413 , determine whether there is a card in the card slot according to the card-slot-state flag, if yes, execute Step  414 ; otherwise, execute Step  418 ; 
         [0253]    in the present Embodiment 4, if the card-slot-state flag is the card-in flag, there is a card in the card slot; if the card-slot-state flag is the no-card flag, there is no card in the card slot. 
         [0254]    Step  414 , the card slot is powered on, a card-slot-powered-on response is read; for example, a read card-slot-powered-on response is 800c00000000120000003bf095000081b1fe9a1f0729; 
         [0255]    Step  415 , an amplitude voltage of digital signals of the card-slot-powered-on response is processed to obtain a processed card-slot-powered-on response. 
         [0256]    Step  416 , the processed card-slot-powered-on response is transferred to the card-slot-powered-on response audio data package. 
         [0257]    Specifically, the processed card-slot-powered-on response is transfer to analog signals which are similar to a sine wave through a process of charging and discharging slowly, and the analog signals is transferred into the card-slot-powered-on response audio data package. 
         [0258]    Step  417 , the card-slot-powered-on response audio data package is sent to the audio device via the audio module, and Step  401  is returned to. 
         [0259]    Step  418 , a no-card-in-slot response is generated, an amplitude voltage of digital signals of no-card-in-slot response is processed to obtain a processed no-card-in-slot response. 
         [0260]    Step  419 , the processed no-card-in-slot response is transferred to no-card-in-slot response audio data package; 
         [0261]    specifically, the processed no-card-in-slot response is transferred to an analog signals which are similar to a sine wave through a process of charging and discharging slowly, and the analog signals are transferred to the no-card-in-slot response audio data package. 
         [0262]    Step  420 , the no-card-in-slot response audio data package is sent to the audio device via the audio module, and Step  401  is returned. 
         [0263]    Step  421 , the card slot is powered off, a card-slot-powered-off response is read; 
         [0264]    in the present Embodiment 4, the card slot is powered off by the card reader, the card-slot-powered-off response is read, the first byte of the card-slot-powered-off response is 0X81; for instance, 81000000000004010000. 
         [0265]    Step  422 , an amplitude voltage of digital signals of the card-slot-powered-off response is processed to obtain a processed card-slot-powered-off response. 
         [0266]    Step  423 , the processed card-slot-powered-off response is transferred to a card-slot-powered-off response audio data package; 
         [0267]    specifically, the processed card-slot-powered-off response is transferred to analog signals which are similar to the sine wave through a process of charging and discharging slowly, the analog signals are transferred to the card-slot-powered-off response audio data package. 
         [0268]    Step  424 , the card-slot-powered-off response audio data package is sent to the audio device via the audio module, and Step  401  is returned to. 
         [0269]    Step  425 , the operating-card instruction is sent to the card, an operating-card response returned by the card waits for being received; 
         [0270]    in the present Embodiment 4, after the operating-card instruction is received by the card, the card executes a corresponding operation according to the instruction, and returns a corresponding operating-card response to the card reader. 
         [0271]    Step  427 , the processed operating-card response is transferred into an operating-card response audio data package; 
         [0272]    specifically, the processed operating-card response is transferred to analog signals which similar to the sine wave through the process of charging and discharging slowly, and the analog signals are transferred to the operating-card response audio data package. 
         [0273]    Step  428 , the operating-card response audio data package is sent to the audio device via the audio module, and Step  401  is returned to. 
       Embodiment 5 
       [0274]    The present Embodiment 5 provides a method for processing USB data, as shown in  FIG. 10 , the method specifically includes the following steps. 
         [0275]    Step  501 , the card reader waits for receiving USB data. 
         [0276]    Step  502 , determine a type of the received USB data, execute Step  503  in the case that the received USB data is an instruction for inquiring card-slot-state; execute Step  505  in the case that the received USB data is a powering-on instruction; execute Step  509  in the case that the received USB data is a powering-off instruction; execute Step  511  in the case that the received USB data is an operating-card instruction; execute a corresponding operation in the case that the received USB data is other instruction, and then return to Step  501 ; 
         [0277]    in the present Embodiment 5, the card reader determines the type of the instruction according to a first byte of the USB data; 
         [0278]    specifically, the received USB data is the instruction for inquiring card-slot-state in the case that the first byte is 0X65; 
         [0279]    the received USB data is the powering-on instruction in the case that the first byte is 0X62; 
         [0280]    the received USB data is the powering-off instruction in the case that the first byte is 0X63; and 
         [0281]    the received USB data is the operating-card instruction in the case that the first byte is 0X6f. 
         [0282]    Step  503 , the state of the card slot is inquired according to the card-slot-state flag, and the card-slot-state data is set; 
         [0283]    in the present Embodiment 5, if the card-slot-state flag is a card-in flag, there is a card in the card slot, a preset byte of the card-slot-state data is set as 0X00; 
         [0284]    if the card-slot-state flag is a no-card flag, there is no card in the card slot, the preset byte of the card-slot-state is set as 0X02; 
         [0285]    preferably, the preset byte of the card-slot-state data is the eighth byte of the card-slot-state data. 
         [0286]    Step  504 , the card-slot-state data is sent to the USB device via the USB module, and Step  501  is returned to. 
         [0287]    Step  505 , determine whether there exists a card in the card slot according to the card-slot-state flag, if yes, execute Step  507 ; otherwise, execute Step  506 ; 
         [0288]    in the present Embodiment 5, if the card-slot-state flag is a card-in flag, there is a card in the card slot; if the card-slot-state flag is a no-card flag, there is no card in the card slot. 
         [0289]    Step  506 , a no-card-in-slot response is sent to the USB device via the USB module, Step  501  is returned to. 
         [0290]    Step  507 , the card slot is powered on, a card-slot-powered-on response is read; for instance, the read card-slot-powered-on response is 800c00000000215000003bf095000081b1fe9a1f0729. 
         [0291]    Step  508 , the card-slot-powered-on response is sent to the USB device via the USB module, Step  501  is returned to. 
         [0292]    Step  509 , the card slot is powered on, a card-slot-powered-off response is read; in the present Embodiment 5, the card slot is powered off by the card reader, the card-slot-powered-off response is read, the first byte of the card-slot-powered-off response is 0X81; for instance, 81000000000004010000. 
         [0293]    Step  510 , the card-slot-powered-off response is sent to the USB device via the USB module, Step  501  is returned to. 
         [0294]    Step  511 , the operating-card instruction is sent to the card. 
         [0295]    Step  512 , wait for receiving an operating-card response returned by the card. 
         [0296]    In the present Embodiment 5, after the operating-card instruction is received, execute corresponding operation according to the operating-card instruction, and return a corresponding operating-card response to the card reader. For instance, 8005000000001800000000eA1f010. 
         [0297]    Step  513 , when the operating-card response is received, the operating-card response is sent to the USB device via the USB module, and Step  501  is returned to. 
       Embodiment 6 
       [0298]    The present Embodiment 6 provides a working method of a card reader, which includes following steps. 
         [0299]    Step  601 , the card reader is powered on and initialized; 
         [0300]    an operational approach of Step  601  is as same as that of Step  101 . 
         [0301]    Step  602 , wait for receiving data. 
         [0302]    Specifically, determine whether there exists a device which connects to the card reader via a USB module, if yes, wait for receiving USB data, and execute Step  603 ; otherwise, determine whether audio data is received in a preset duration, execute Step  603  in the case that the audio data is received in the preset duration; enter a low-power-dissipation mode in the case that the audio data is not received in the preset duration. 
         [0303]    Step  603 , when the USB data is received via a USB channel, an audio data communication interrupt is turned off, a work mode is set as a USB mode, and Step  604  is executed; when the audio data is received via an audio channel, a USB data communication interrupt is turned off, the work mode is set as an audio mode, and Step  605  is executed. 
         [0304]    Specifically, when the audio data is received via the audio channel, determine whether the work mode is the low-power dissipation mode, if yes, exit from the low-power dissipation mode, and execute Step  605 ; otherwise, execute Step  605 . 
         [0305]    Step  604 , determine a type of the received USB data, the operating-card instruction is sent to the card in the case that the USB data is an operating-card instruction, an operation result returned by the card waits for being received, Step  606  is executed; a corresponding operation is executed to obtain an operation result, and Step  606  is executed. 
         [0306]    Step  605 , the audio data is transferred to digital signals, the digital signals compose a data package, the data package is parsed to obtain a parsing result, a type of the instruction is determined according to the parsing result, if the instruction is an operating-card instruction, the operating-card instruction is sent to the card, an operation result returned by the card waits for being received, and Step  606  is executed; if the instruction is other instruction, a corresponding operation is executed to obtain an operation result, and Step  606  is executed; 
         [0307]    the operational approach of Step  605  is as same as that of Embodiment 4, no more details will be given herein. 
         [0308]    Step  606 , determine the work mode, in the case that the work mode is the USB mode, the operation result is sent to the device which connects to the card reader, an audio data communication interrupt is turned on, and Step  607  is executed; in the case that the work mode is the audio mode, the operation result is transferred to an audio data package, the audio data package is sent to the device which connects to the card reader, a USB data communication interrupt is turned on, and Step  607  is executed; 
         [0309]    the operational approach of Step  606  is as same as that of Embodiment 5, more details will not be given herein. 
         [0310]    Step  607 , determine whether the USB module connects a power supply, if yes, execute Step  608 ; otherwise, return to Step  602 . 
         [0311]    Step  608 , determine whether the quantity of electric charge of the battery reaches a rated value, if yes, execute Step  609 ; otherwise, return to Step  602 . 
         [0312]    Step  609 , prompt over-charging of the battery, and return to Step  602 . 
         [0313]    While the preferred Embodiments of the present invention have been shown and described herein, it will be obvious for those skilled in the art that such Embodiments are provided by way of examples only. Any changes and substitutions will be covered by the scope of protection of the present invention. It is intended that the appended claims define the scope of protection of the present invention.