Abstract:
Disclosed is a near field communication method, the method comprising: after a receiver receives an information transmission request message sent by a sender, determining when the sender identification carried by the information transmission request message matches the receiver identification, the two parties establishing a link, and according to the information reception condition set by the receiver, determining whether to receive information; at the same time, also disclosed is a near field communication device. Using the technical solution of the invention, information automation transmission can be implemented between mobile phones, thus reducing user operation steps, and enabling a user to conveniently use.

Description:
TECHNICAL FIELD 
       [0001]    The disclosure relates to near field communication, and in particular to a method and device for near field communication. 
       BACKGROUND 
       [0002]    With rapid development of communication technology, User Equipment such as a mobile phone, with convenience and fast communication provided thereof, has become a necessity for daily life. A near field communication function provided by a mobile phone, such as Bluetooth, Wireless Fidelity (WiFi), etc., facilitates data transmission among mobile phones, reducing an inter-subscriber distance. 
         [0003]    In a practical application, data (such as a short message or a file, etc.) may be transferred among subscribers through mobile phones. In this case before a file can be sent, it is required that both a sender subscriber and a receiver subscriber enable a function such as Bluetooth or WiFi, find a mobile phone within a Near Field range using Bluetooth or WiFi, and establish a connection between the sender and the receiver by password confirmation. 
         [0004]    Such search, confirmation, password input, and connection establishment can be excessively complex for a subscriber, and error-prone and inconvenient for someone who uses Bluetooth or WiFi for the first time. 
       SUMMARY 
       [0005]    In view of this, embodiments herein provide a method and device for near field communication, allowing, in near field communication, convenient information transfer by a subscriber, reducing a number of subscriber operations, increasing product usability. 
         [0006]    To this end, a technical solution according to an embodiment herein may be implemented as follows. 
         [0007]    A method for near field communication, includes: 
         [0008]    after a receiver has received an information sending request sent by a sender and has determined that an identifier of the sender included in the information sending request matches an identifier of the receiver, establishing a connection between the receiver and the sender and determining, by the receiver according to an information receiving condition set by the receiver, whether to receive information sent by the sender. 
         [0009]    The identifier of the sender may include a communication number of the sender and a receiver communication number. 
         [0010]    The receiver may determine that the identifier of the sender included in the information sending request matches the identifier of the receiver by determining whether the receiver communication number in the identifier of the sender matches a communication number of the receiver, and determining that the identifier of the sender matches the identifier of the receiver when the receiver communication number in the identifier of the sender matches the communication number of the receiver. 
         [0011]    The receiver may send the sender a response such that the connection between the receiver and the sender may be established. The receiver may determine, according to the information receiving condition set by the receiver, whether to receive the information. 
         [0012]    The identifier of the sender may include a communication number of the sender and a receiver communication number. 
         [0013]    The receiver may determine that the identifier of the sender included in the information sending request matches the identifier of the receiver by 
         [0014]    determining, when it is determined that the receiver communication number in the identifier of the sender matches a communication number of the receiver, whether the communication number of the sender is saved in a list of contacts of the receiver. 
         [0015]    When the communication number of the sender is saved in the list of contacts of the receiver, the receiver may send the sender a response, the connection between the receiver and the sender may be established, and the receiver may receive the information sent by the sender. 
         [0016]    The method may further include: 
         [0017]    searching, by the receiver through near field communication, for a device enabling a near field communication function around the receiver, and forming a list of online devices with a device found. 
         [0018]    The method may further include: 
         [0019]    in the list of online devices, setting an identifier of a device as a communication number of the device; 
         [0020]    when a communication number of the device found is saved in a list of contacts of the receiver, setting an identifier of the device found in the list of online devices as an identifier of the device found in the list of contacts of the receiver. 
         [0021]    According to an embodiment herein, a device for near field communication includes a receiving module and a processing module. 
         [0022]    The receiving module may be configured for: receiving an information sending request sent by a sender. 
         [0023]    The processing module may be configured for: when it is determined that an identifier of the sender included in the information sending request matches an identifier of a receiver, establishing a connection between the receiver and the sender and determining, according to an information receiving condition set by the receiver, whether to receive information sent by the sender. 
         [0024]    The identifier of the sender may include a communication number of the sender and a receiver communication number. 
         [0025]    The processing module may be configured for: determining whether the receiver communication number in the identifier of the sender matches a communication number of the receiver. 
         [0026]    When the receiver communication number in the identifier of the sender matches the communication number of the receiver, the receiver may send a response to establish the connection between the receiver and the sender and to determine, according to the information receiving condition, whether to receive the information sent by the sender. 
         [0027]    The identifier of the sender may include a communication number of the sender and a receiver communication number. 
         [0028]    The processing module may be further configured for: determining, when it is determined that the receiver communication number in the identifier of the sender matches a communication number of the receiver, whether the communication number of the sender is saved in a list of contacts of the receiver. 
         [0029]    When the communication number of the sender is saved in the list of contacts of the receiver, the receiver may send a response to establish the connection between the receiver and the sender and to receive the information sent by the sender. 
         [0030]    The device may further include a search module configured for: 
         [0031]    searching, through near field communication, for a device enabling a near field communication function around the receiver, and forming a list of online devices with a device found. 
         [0032]    In the list of online devices, an identifier of a device may be set as a communication number of the device. 
         [0033]    The search module may be further configured for: when it is found that a communication number of the device found is saved in a list of contacts of the receiver, setting an identifier of the device found in the list of online devices as an identifier of the device found in the list of contacts of the receiver. 
         [0034]    With a method and device for near field communication according to an embodiment herein, after a receiver receives an information sending request sent by a sender and it is determined that an identifier of the sender included in the information sending request matches an identifier of the receiver, the receiver sends a response to the sender; a connection between the sender and the receiver is automatically established; the sender may then send to-be-sent information to the receiver; the receiver may automatically receive and save the information sent by the sender according to an information receiving condition set by the receiver, or receive or turn down the information according to a manual confirmation. Thus, complicated operations, such as device confirmation and password input and matching, by both the sending and receiving sides may be avoided. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0035]      FIG. 1  is a diagram of a structure of a device for near field communication according to an embodiment herein. 
           [0036]      FIG. 2  is a flowchart of implementing a method for near field communication at a sender side according to an embodiment herein. 
           [0037]      FIG. 3  is a flowchart of implementing a method for near field communication at a receiver side according to an embodiment herein. 
       
    
    
     DETAILED DESCRIPTION 
       [0038]    To facilitate describing a technical solution, a sender device (such as a mobile phone) may be referred to as a sender, a receiver device (such as a mobile phone) may be referred to as a receiver. Each of the sender device and the receiver device may be provided with a built-in device for near field communication according to an embodiment herein. 
         [0039]    According to an embodiment herein, a device for near field communication, as shown in  FIG. 1 , may include a receiving module  12  and a processing module  11 . 
         [0040]    The receiving module  12  may be configured for: receiving an information sending request sent by a sender; receiving information to be sent by the sender to a receiver. 
         [0041]    The processing module  11  may be configured for: when it is determined that an identifier of the sender included in the information sending request matches an identifier of the receiver, determining, according to an information receiving condition set by the receiver, whether to receive the information sent by the sender. 
         [0042]    As shown in  FIG. 1 , the device for near field communication according to an embodiment herein may further include a sending module  10 . 
         [0043]    The identifier of the sender may include a communication number of the sender and a receiver communication number. 
         [0044]    The processing module  11  may be further configured for: determining that the identifier of the sender matches the identifier of the receiver when it is determined that the receiver communication number of a potential receiver in the identifier of the sender matches the communication number of the receiver receiving the sending request. When the receiver has set the information receiving condition, the processing module  11  may further be configured for determining whether the identifier of the sender meets the information receiving condition. When the identifier of the sender meets the information receiving condition, the sender may be allowed to send the information to the receiver. 
         [0045]    The sending module  10  may be further configured for: sending the request from a sender side to a receiver side; and sending the information from the sender side to the receiver side. 
         [0046]    The identifier of the sender may include a communication number of the sender and a receiver communication number. That is, when the sender sends the information sending request, source identifier information of the information sending request may be set as a combination of the communication number of the sender and the communication number of the receiver instead of just the communication number of the sender. In this way, after receiving the information sending request, the receiver may confirm, through the receiver communication number in the identifier of the sender, whether the information sending request is sent to the receiver per se. Here, the identifier of the receiver may be the communication number of the receiver. 
         [0047]    For example, when the receiving module  12  receives the information sending request sent by the sender, the processing module  11  first determines, through the sender identifier of the sender, whether the sender has selected to send information to the receiver itself. When it is determined that the sender has selected to send information to the receiver itself, the sending module  10  returns a response to the sender, and the processing module  11  may establish a connection between the receiver and the sender. Upon establishment of the connection, in case that according to the information receiving condition, information is to be received unconditionally, the receiver may automatically receive the information sent by the sender. When identifier information received by the receiving module  12  of the receiver is irrelevant to the receiver, the sending module  10  of the receiver will send no response, and no connection between the two parties will be established. 
         [0048]    Note that a device for near field communication according to an embodiment herein may serve not only as a receiver of an information sending request, but also as a sender to send an information sending request to another device for near field communication. 
         [0049]    The device for near field communication according to an embodiment herein may further include a search module  16 . 
         [0050]    The search module  16  may be configured for: searching, through near field communication, for a device enabling a near field communication function around the receiver, and forming a list of online devices with a device found. 
         [0051]    Here, the search module  16  of the receiver may search, through near field communication such as Bluetooth or WiFi, for a device enabling the near field communication function around the receiver, such that a device for near field communication according to an embodiment herein may communicate with a found device. 
         [0052]    The search module  16  of a device for near field communication according to an embodiment herein may further be configured for: determining whether a list of contacts includes a communication number recorded in the list of online devices; when a communication number recorded in the list of online devices is included in the list of contacts, replacing the communication number recorded in the list of online devices with the name of the holder of the mobile phone; when a communication number recorded in the list of online devices is not included in the list of contacts, a record in the list of online devices is still named in form of a communication number or after the original model of a peripheral device. 
         [0053]    The list of online devices may record the name of a mobile phone, the communication number or the name of the holder of the mobile phone, the type of wireless communication technology, etc. 
         [0054]    In description of the technical solution, the information receiving condition set by the receiver may be that the receiver automatically receives information unconditionally. The receiver may also set the information receiving condition as follows. 
         [0055]    When the processing module  11  has determined that an identifier of a sender included in the information sending request matches the identifier of the receiver, a receiver interface may provide a pop-up prompt box, prompting a subscriber to confirm whether to receive information of the sender. In addition, the receiver may set the information receiving condition as follows: a file sent by a subscriber in the list of contacts of the receiver may be automatically received (the request of the sender may include the identifier of the sender, which may be parsed out and identified by the receiver and sent to the subscriber). 
         [0056]    The information receiving condition may further be set as follows. Information may be automatically received unconditionally. Information sent by a sender in the list of contacts of the receiver may be received automatically receive. Manual confirmation may be required to receive or turn down information sent by a sender who is not in the list of contacts. Manual confirmation by the subscriber may be required to receive any information. Besides, the information receiving condition may also be set as follows. Only information sent by the sender of a size less than or equal to a maximal information capacity of the receiver side may be received. The information receiving condition may also be set as being met when the communication number of the sender is saved in the list of contacts of the receiver and information sent by the sender is of a size less than or equal to the maximal information capacity at the receiver side. The information receiving condition may be set as needed. 
         [0057]    In an embodiment herein, a communication number is only one form of the identifier, which may also in form of a combination of other numerals, letters or symbols associated with the communication number, which are not enumerated herein one by one. 
         [0058]    An embodiment herein may further apply to a scene as follows. 
         [0059]    At a moment  1  both a sender mobile phone A (mobile phone A for short) and a receiver mobile phone B (mobile phone B for short) have enabled Bluetooth or WiFi. A search module  16  of the mobile phone B may find the mobile phone A. The communication number of the mobile phone A may be set as the identifier of the mobile phone A in a list of online devices of the mobile phone B. The sending module  10  of the mobile phone A may send the mobile phone B a request. The receiving module  12  of the mobile phone B may receive the sent request. The processing module  11  of the mobile phone B may determine whether a receiver communication number included in the request matches the number of the mobile phone B. When the receiver communication number included in the request matches the number of the mobile phone B, the sending module  10  of the receiver returns a response to the sender. The processing module  11  of the mobile phone B may establish a connection between the receiver and the sender, and determine whether the communication number of the mobile phone A is saved in a list of contacts of the mobile phone B. When the communication number of the mobile phone A is saved in the list of contacts of the mobile phone B, the sending module  10  of the sender may send information to the receiver, in particular to the receiving module  12  of the receiver. The receiving module  12  may receive the information. 
         [0060]    At a moment  2  the mobile phone A is to send more information (such as a file or a message, etc.) to the mobile phone B. However, at this moment the mobile phone B has disabled Bluetooth or WiFi. That is, at the moment  2  the search module  16  of the mobile phone A cannot find the mobile phone B. However, as at the moment  1  the search module  16  of the mobile phone A has saved the list of online devices, which includes a record of information on the mobile phone B indicated in a bright color. At the moment  2 , as the mobile phone B has disabled Bluetooth or WiFi, the information on the mobile phone B recorded in the list of online devices of the mobile phone A is indicated in grey. At the moment  2  the mobile phone A may save the information to be sent to the mobile phone B. When the processing module  11  of the mobile phone A has detected that the mobile phone B has once again been indicated in a bright color in the list of online devices, the processing module  11  of the mobile phone A may trigger the sending module  10  of the mobile phone A to send the saved information to the mobile phone B. The information on the mobile phone B may refer to the name of the mobile phone B, the communication number or the name of the holder of the mobile phone B and the type of wireless communication technology of the mobile phone B. 
         [0061]    In a practical application, each of the receiving module  12 , the processing module  11 , the sending module  10 , and the search module  16  may be implemented by a Central Processing Unit (CPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like. Each of the CPU, the DSP, the FPGA may be built in the communication device. 
         [0062]    Based on the device for near field communication, an embodiment herein may further provide a method for near field communication, including steps as follows. 
         [0063]    After a receiver has received an information sending request sent by a sender and has determined that an identifier of the sender included in the information sending request matches an identifier of the receiver, the receiver sends a response to the sender, such that a connection between the receiver and the sender is established, and the receiver may determine whether to receive information sent by the sender according to an information receiving condition set by the receiver. 
         [0064]    The identifier of the sender may include a communication number of the sender and a receiver communication number. That is, when the sender sends the information sending request, source identifier information of the information sending request may be set as a combination of the communication number of the sender and the communication number of the receiver instead of just the communication number of the sender. In this way, after receiving the information sending request, the receiver may confirm, through the receiver communication number in the identifier of the sender, whether the information sending request is sent to the receiver per se. Here, the identifier of the receiver may be the communication number of the receiver. 
         [0065]    The receiver receives the information sending request, determines that the identifier of the sender in the information sending request matches the identifier of the receiver when it is determined that the receiver communication number in the identifier of the sender matches the communication number of the receiver. The receiver may send the sender a response. The connection between the receiver and the sender is established. The receiver accepts the information sending request of the sender. The sender sends information. The receiver receives the information sent by the sender when the information receiving condition set by the receiver provides that information is to be received unconditionally. 
         [0066]    Embodiments herein are elaborated below. 
         [0067]      FIG. 2  is a flowchart of implementing a method for near field communication at a sender side. As shown in  FIG. 2 , the method may include steps as follows. 
         [0068]    In step  200 , the sender may search, through Near Field wireless communication, for a mobile phone around the sender to form a list of online devices of the sender. 
         [0069]    Here, the sender the list of online devices may record the name of a mobile phone found by the sender, the communication number and the type of wireless communication technology (Bluetooth or WiFi) thereof, and the like. 
         [0070]    The sender may form the list of online devices in a way as described for a device for near field communication, which is not repeated. 
         [0071]    In step  201 , when the sender is to send information, the sender may select a potential receiver in the list of online devices and send the selected potential receiver an information sending request. The information sending request may be a combination of the communication number of the sender and the communication number of the receiver. 
         [0072]    In step  202 , when the sender receives a response returned by the receiver, the flow goes to step  203 . Otherwise when no response of the receiver is received, the flow goes to step  205 . 
         [0073]    In step  203 , a connection between the receiver and the sender is established, and then it is determined whether the receiver agrees to receive the information. When it is determined that the receiver agrees to receive the information, the flow goes to step  204 . 
         [0074]    When it is determined that the receiver refuses to receive the information, the flow goes to step  205 . 
         [0075]    In step  204 , the sender sends the information, and the receiver receives the information sent by the sender. The flow goes to step  206 . 
         [0076]    In step  205 , the sender sends no information, and the flow goes to step  206 . 
         [0077]    In step  206 , the flow ends. 
         [0078]      FIG. 3  is a flowchart of implementing a method for near field communication at a receiver side. As shown in  FIG. 3 , the method may include steps as follows. 
         [0079]    In step  300 , the receiver may search, through Near Field wireless communication, for a mobile phone around the receiver to form a list of online devices of the receiver. The flow goes to step  301 . 
         [0080]    In step  301 , the receiver may receive an information sending request from a sender and determine whether a receiver communication number in an identifier of the sender matches a communication number of the receiver. 
         [0081]    When the receiver communication number in the identifier of the sender matches the communication number of the receiver, the flow goes to step  302 . 
         [0082]    When the receiver communication number in the identifier of the sender fails to match the communication number of the receiver, the flow goes to step  303 . 
         [0083]    In step  302 , the receiver may send a response. A connection between the receiver and the sender may be established. The receiver may perform subsequent processing according to a set receiving condition. The receiving condition may include that: information is to be received unconditionally; or information sent by a sender is to be received automatically when the sender match a subscriber in a list of contacts of the receiver; or information sent by a sender is received or rejected according to a manual confirmation; or information sent by a sender is received selectively according to a capacity limit. The flow then continues at step  304 . 
         [0084]    In step  303 , the receiver may determine that the identifier of the sender fails to match a local identifier, and thus send no response. The sender may send the request for several times without receiving a response of the receiver, in which case the sender may temporarily save the information to be sent, and prompt that the receiver receives no file. The flow then goes to step  304 . 
         [0085]    In step  304 , the flow may end. 
         [0086]    In description of the technical solution, the receiver may set the receiving condition as follows. Information may be received unconditionally; or information sent by a sender may be received automatically when the sender match a subscriber in a list of contacts of the receiver; or information sent by a sender may be received according to a manual confirmation; or information sent by a sender may be received according to a capacity limit. Information of a size less than or equal to a maximal information capacity set at the receiver side may be received from a sender. 
         [0087]    With a method and device for near field communication provided by an embodiment herein, when information is to be sent, a sender sends an information sending request to a receiving module; the receiving module receives the information sending request sent by the sender; a processing module of the receiver determines whether an identifier of the sender included in the information sending request matches an identifier of the receiver; when the receiver has set a receiving condition, the processing module further determines whether the receiving condition is met; when the identifier of the sender matches that of the receiver and the receiving condition is met, the sender may be allowed to send the information to the receiver. With an embodiment herein, mobile phone information such as a file or data may be automatically transmitted without human operation, thus reducing human workload, facilitating a subscriber. 
         [0088]    What described are merely embodiments herein, and are not intended to limit scope of the disclosure.