WO2014101421A1 - Method and device for achieving instant communication - Google Patents

Method and device for achieving instant communication Download PDF

Info

Publication number
WO2014101421A1
WO2014101421A1 PCT/CN2013/080718 CN2013080718W WO2014101421A1 WO 2014101421 A1 WO2014101421 A1 WO 2014101421A1 CN 2013080718 W CN2013080718 W CN 2013080718W WO 2014101421 A1 WO2014101421 A1 WO 2014101421A1
Authority
WO
WIPO (PCT)
Prior art keywords
binding
server
friend
terminal
user
Prior art date
Application number
PCT/CN2013/080718
Other languages
French (fr)
Chinese (zh)
Inventor
郭瑾
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2014101421A1 publication Critical patent/WO2014101421A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]

Definitions

  • the present invention relates to the field of instant messaging technologies, and in particular, to a method and apparatus for implementing instant messaging.
  • a friend relationship is established between users, and information is transmitted based on the friend relationship.
  • each user can have multiple friends, and each user can send text and pictures to any of his friends.
  • the friend relationship between the user and his friend, and the interaction information between the user and his friend are stored on the server (also referred to as a cloud server), and the user relationship can be downloaded from the server regardless of the terminal on which the user logs in.
  • the interaction information wherein the friend relationship can be presented in the form of a buddy list on the terminal, and the interaction information mainly includes a historical communication record between the user and the buddy, a file and a picture, and the like.
  • the user needs to input the user's account and password when the terminal logs in.
  • the account and password are used as the unique identifier of the user, and the user can download the same friend relationship from the server regardless of which terminal the user logs in.
  • Interactive information In practical applications, depending on the conditions of the user, for example, when the user logs in at the office, he usually only wants to see the working partners in the friend relationship, but after logging in, all the users can only be downloaded from the server. Friends relationship.
  • a method and apparatus for implementing instant communication are provided to solve the existing instant communication
  • the method can only download all the friend relationship issues from the server.
  • a method for implementing instant messaging comprising:
  • the server receives the login request sent by the terminal, where the login request carries the first binding information, the account number of the user, and the password;
  • the server After the server determines that the password is the same as the password corresponding to the pre-stored account, the server obtains the binding code of the binding friend of the user according to the account of the user;
  • the server Determining, by the server, whether the first binding information matches the binding code of the binding friend; if the first binding information matches the binding code of the binding friend, the server is to the terminal Sending a login response, the login response carrying the account of the bound friend.
  • the determining, by the server, whether the first binding information matches the binding code of the bonding friend includes:
  • the server determines whether the first binding information is included in the binding code of the binding friend, and if the first binding information is included in the binding code of the binding friend, the server Determining that the first binding information matches the appointment code.
  • the first binding information includes at least one of the following data items: a device identifier of the terminal, where a mobile number identifier of the user, where the terminal sends the login request, information about a geographical location where the terminal sends the login request;
  • the appointment code includes at least one of the following data items: device identifier, mobile number The identifier, the preset time period information, the preset geographic location range information; the ij, the server determining whether the first binding information is included in the appointment code, including: if the first binding The number of data items in the information is the same as the number of data items in the appointment code, and each data item in the first binding information is a data item corresponding to each of the data items in the appointment code.
  • the server determines that the first binding information is included in the appointment code.
  • the method further includes:
  • the server Determining, by the server, whether the second binding information matches the binding code of the binding friend; if the second binding information matches the binding code of the binding friend, the server is to the terminal Sending an update response, the update response carrying the account of the bound friend.
  • the receiving, by the server, the update request sent by the terminal includes:
  • a fifth possible implementation manner of the first aspect Is a normal password.
  • the terminal sends a login request to the server, where the login request carries the first binding information, the user's account number, and the password;
  • the terminal receives the login response sent by the server, and the login response is sent by the first binding information end after the server determines that the password is the same as the password corresponding to the account that is saved in advance.
  • the login response carries the account of the bound friend.
  • the first binding information includes at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, The information about the geographic location of the terminal when the terminal sends the login request, where the terminal sends the login request; the appointment code includes at least one of the following data items: device identifier, mobile number identifier, preset time period information , preset location range information.
  • the method further includes :
  • the sending, by the terminal, the update request to the server includes:
  • the terminal sends the update request to the server when the terminal condition changes; or the terminal sends the update request to the server after receiving the terminal condition information report request sent by the server,
  • the terminal condition information reporting request is sent by the server to the terminal when refreshing the buddy list of the user.
  • the password of the user is a normal password.
  • an apparatus for implementing instant messaging comprising:
  • a receiving unit configured to receive a login request sent by the terminal, where the login request carries the first binding information, the user account, and a password;
  • An obtaining unit configured to acquire, according to an account of the user, an appointment code of the binding friend of the user, after determining that the password is the same as a password corresponding to the account that is saved in advance;
  • a matching unit configured to determine whether the first binding information matches an appointment code of the binding friend;
  • a sending unit configured to send a login response to the terminal when the first binding information matches the binding code of the binding friend, where the login response carries the account of the binding friend.
  • the matching unit is specifically configured to determine whether the first binding information is included in an agreement code of the binding friend, The first binding information is included in the binding code of the binding friend, and then determining that the first binding information matches the appointment code.
  • the first binding information received by the receiving unit includes at least one of the following data items: The device identifier, the mobile number identifier of the user, the time when the terminal sends the login request, and the location information of the location when the terminal sends the login request;
  • the binding code of the binding friend acquired by the acquiring unit includes at least one of the following data items: a device identifier, a mobile number identifier, a preset time period information, and a preset geographic location range information;
  • the matching unit is specifically configured to: in the first binding information, the number of data items is the same as the number of data items in the appointment code, and each data item in the first binding information is in the agreement code And determining, in the data item corresponding to each of the data items, that the first binding information is included in the agreement code.
  • the receiving unit is further configured to receive an update request sent by the terminal, where the update request carries second binding information;
  • the matching unit is further configured to determine whether the second binding information matches an agreed code of the binding friend
  • the sending unit is further configured to match the second binding information with the binding code of the binding friend And sending an update response to the terminal, where the update response carries the account of the bound friend.
  • the receiving unit is configured to receive, when the terminal condition changes, send the terminal to the server Or receiving the update request returned by the terminal according to the terminal condition information report request sent by the server, where the terminal condition information report request is when the server refreshes the buddy list of the user Sent to the terminal.
  • a sending unit configured to send a login request to the server, where the login request carries the first binding information, the user account, and the password;
  • a receiving unit configured to receive a login response sent by the server, where the login response is that the server sends the first binding to the terminal after determining that the password is the same as a password corresponding to the account that is saved in advance.
  • the login response carries the account of the bound friend.
  • the sending unit is further configured to send an update request to the server, where the update request carries second binding information;
  • the receiving unit is further configured to receive an update response sent by the server, where the update response is sent by the server to the terminal when the second binding information matches the binding code of the binding friend.
  • the update response carries the account of the bound friend.
  • the sending unit is specifically configured to send the update request to the server when a terminal condition changes Or, after receiving the terminal condition information report request sent by the server, sending the update request to the server, where the terminal condition information report request is that the server refreshes the buddy list of the user Said by the terminal.
  • the server receives the login request that is sent by the terminal and carries the first binding information, the user's account number, and the password, and the server determines that the password is the same as the password corresponding to the pre-saved account.
  • the binding code of the binding friend of the user is obtained, and the server determines whether the first binding information matches the binding code of the binding friend, if the first binding information is related to the binding friend. If the agreement code matches, the server sends a login response to the terminal, and the login response carries the account of the bound friend.
  • the user can set the appointment code for some friends, so that the friends become binding friends.
  • the user when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server binds the information.
  • the binding code of the binding friend is matched, the account of the binding friend is delivered to the terminal, so that when the user logs in to the server under different conditions, different account information can be obtained without additional operations, thereby improving the user's Instant messaging experience.
  • FIG. 1 is a flow chart of an embodiment of a method for implementing instant communication according to the present invention
  • FIG. 2 is a flow chart of another embodiment of a method for implementing instant communication according to the present invention.
  • FIG. 3 is a flow chart of another embodiment of a method for implementing instant communication according to the present invention.
  • FIG. 4 is a flow chart of another embodiment of a method for implementing instant communication according to the present invention.
  • FIG. 5 is a flow chart of another embodiment of a method for implementing instant messaging according to the present invention.
  • FIG. 6 is a block diagram of an embodiment of an apparatus for implementing instant communication according to the present invention.
  • FIG. 7 is a structural diagram of a server according to an embodiment of the present invention.
  • FIG. 8 is a block diagram of another embodiment of an apparatus for implementing instant communication according to the present invention.
  • FIG. 9 is a structural diagram of a terminal according to an embodiment of the present invention. detailed description
  • the following embodiments of the present invention provide a method and apparatus for implementing instant messaging.
  • FIG. 1 it is a flowchart of an embodiment of a method for implementing instant communication according to the present invention. This embodiment describes a process for implementing instant communication from a server side:
  • Step 101 The server receives a login request sent by the terminal, where the login request carries the first binding information, the user's account number, and the password.
  • a friend whose appointment code is set in a friend may be referred to as a binding friend.
  • the appointment code may include at least one of the following data items:
  • a device identifier which indicates a device identifier of a terminal that the user is logged in, such as an International Mobile Equipment Identity (IMEI), or a mobile phone serial number, etc., where, by way of example and not limitation, User B is a binding friend of User A.
  • the user B's appointment code includes the device ID of the terminal C.
  • the user A can only download the account from the server to the user B by logging in on the terminal C. Through the account of the user B, the user A can perform information with the user B.
  • mobile number indicates a mobile number to identify the user on the terminal used, e.g., international mobile subscriber identity another 1 J code (international mobile Subscriber identification number, IMSI ), or a mobile station identification number (mobile Subscriber international ISDN / PSTN Number , MSISDN) and the like; wherein, as an example and not by definition, user B is a binding friend of user A, and the subscription code of user B includes the mobile number identifier D, and user A only logs in on the terminal using the mobile number identifier D. It is possible to download the account from User B to User B;
  • IMSI international mobile Subscriber identification number
  • MSISDN mobile station identification number
  • the preset time period information indicates the time range when the user logs in. For example, user B is the binding friend of user A, and the appointment code of user B includes the preset time period information. If the time when user A logs in, the time is Within the set time range, user A may download the account to user B from the server; the preset geographical location information indicates the range of the geographical location where the user logs in; for example, user B is the binding friend of user A.
  • the appointment code of the user B includes the preset geographic location range information. If the geographic location when the user A logs in is within the preset geographical location, the user A may download the account of the user B from the server.
  • the appointment code in the embodiment of the present invention may not limit the specific data items listed above, and may be flexibly set as needed.
  • the method for downloading the account of the common friend is consistent with the prior art. Therefore, the embodiment of the present invention focuses on the download mode of the account that binds the friend. After the binding code is set for the binding friend, the terminal may upload the bonding friend's friend account and the binding friend's appointment code to the server, and the server may save the correspondence between the binding friend's account and the appointment code.
  • the server may pre-define a specific storage area for the binding friend, and save the correspondence in a specific storage area, and the interaction information generated by the subsequent user and the binding friend during the communication process may also be saved to the specific
  • the interaction information also corresponds to the account of the binding friend, that is, in the specific storage area, the account of the user and the account of each binding friend of the user, the binding code of the binding friend, and the binding friend can be saved.
  • the correspondence relationship may be referred to as a binding correspondence relationship.
  • the correspondence between the account of the user and the account of each ordinary friend of the user and the interaction information of the common friend and the user may be saved, and the correspondence may be referred to as a common correspondence.
  • the binding code when the user adds a friend, the binding code is set for the binding friend. Therefore, when the user logs in to the server in different scenarios through different terminals, the current condition information needs to be sent to the user.
  • the server the condition information is referred to as the first binding information in this embodiment.
  • the first binding information may include at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, a moment when the terminal sends the login request, and information about a geographical location where the terminal sends the login request.
  • Step 102 After the server determines that the password is the same as the password corresponding to the pre-stored account, the server obtains the binding code of the bound friend of the user according to the account of the user.
  • the server obtains the pre-stored password corresponding to the account according to the account carried in the login request. If the obtained password is the same as the password carried in the login request, the user logs in successfully, and the server can obtain the account according to the user account.
  • the user's binding code of the binding friend If the user's binding correspondence and the common correspondence are stored in the same storage area of the server, the server may search for the binding correspondence and the common correspondence according to the user's account in the storage area to obtain the binding friend.
  • Step 103 The server determines whether the first binding information matches the binding code of the binding friend.
  • the server may determine whether the first binding information is included in the binding code of the binding friend, if the first binding information is included in the binding. Within the buddy's appointment code, the server determines that the first binding information matches the appointment code.
  • the server determines that the first binding information is included in the appointment code. For example, the binding code of a binding friend includes the device identifier and the preset time period information. If the first binding information only includes the device identifier, or only the time when the login request is sent, the first binding information is included.
  • the data item is different from the number of data items in the appointment code; if the first binding information includes the device identifier and the time when the login request is sent, but the device identifier is inconsistent with the device identifier included in the appointment code, or the login is sent. If the time of the request is not within the preset time range, it means that each data item in the first binding information is not within the data item corresponding to each data item in the appointment code; only when the first binding The information includes the device identifier and the time when the login request is sent, and the device identifier is consistent with the device identifier included in the appointment code, and the time when the login request is sent within a preset time range indicates that the first binding information is tied to the binding information. The appointment code of the friend is matched.
  • Step 104 If the first binding information matches the binding code of the binding friend, the server sends a login response to the terminal, where the login response carries the account of the binding friend.
  • the server when the binding code of a binding friend matches the first binding information, the server sends the binding account to the terminal, and the binding code of the binding friend is bound to the first binding. If the information does not match, the server does not deliver the account of the bound friend to the terminal. Further, in this embodiment, the server sends the binding information of the user to the terminal, and may also send the interaction information between the user and the binding friend, where the interaction information may be included between the user and the binding friend. Text messages, pictures, videos, etc.
  • the user can set the appointment code for some friends, so that the friends become binding friends. Therefore, when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server is bound.
  • the binding friend's account is delivered to the terminal, so that when the user logs in to the server in different scenarios of different terminals, the specific display of the binding friend can be implemented without additional operations. , thus improving the user's instant messaging experience.
  • FIG. 2 it is a flowchart of another embodiment of a method for implementing instant messaging according to the present invention.
  • the embodiment describes a process for implementing instant communication from a terminal side:
  • Step 201 The terminal sends a login request to the server, where the login request carries the first binding information, User's account number and password.
  • a friend whose appointment code is set in a friend may be referred to as a binding friend.
  • the appointment code may include at least one of the following data items: a device identifier, indicating a device identifier of the terminal that the user is logged in; a mobile number identifier, indicating a mobile number identifier used by the user on the terminal; and a preset time period information indicating the user Time range when logging in; Preset location range information, indicating the geographic location where the user is logged in. Need to explain Flexible settings as needed.
  • the binding code when the user adds a friend, the binding code is set for the binding friend. Therefore, when the user logs in to the server in different scenarios through different terminals, the current condition information needs to be sent to the server, and the condition information is in the implementation. In the example, it is called the first binding information.
  • the first binding information may include at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, a time when the terminal sends the login request, and information about a geographical location where the terminal sends the login request.
  • Step 202 The terminal receives a login response sent by the server, where the login response is performed by the server after determining that the password is the same as the password corresponding to the account that is saved in advance. Bind a friend's account.
  • the method for downloading an account of an ordinary friend is consistent with the prior art.
  • the terminal may upload the bonding friend's friend account and the binding friend's appointment code to the server, and the server may save the correspondence between the binding friend's account and the appointment code.
  • the server may pre-define a specific storage area for the binding friend, and save the correspondence in a specific storage area, and the interaction information generated by the subsequent user and the binding friend during the communication process may also be saved to the specific
  • the storage area the interaction information also corresponds to the account of the binding friend, that is, in the specific storage area, the account of the user and the account of each binding friend of the user, the binding code of the binding friend, and And binding the correspondence between the interaction information of the friend and the user, and the correspondence relationship may be referred to as a binding correspondence relationship.
  • the correspondence between the account of the user and the account of each ordinary friend of the user and the interaction information between the common friend and the user is saved.
  • the correspondence may be referred to as a common correspondence.
  • the server obtains the pre-stored password corresponding to the account according to the account carried in the login request. If the obtained password is the same as the password carried in the login request, the user logs in successfully, and the server can obtain the account according to the user account.
  • the user's binding code of the binding friend If the user's binding correspondence and the common correspondence are stored in the same storage area of the server, the server may search for the binding correspondence and the common correspondence according to the user's account in the storage area to obtain the binding friend.
  • the server may determine whether the first binding information is included in the binding code of the binding friend, if the first binding information is included in the binding code of the binding friend. The server determines that the first binding information matches the appointment code.
  • the terminal may receive the account of the binding friend sent by the server. Further, in this embodiment, the terminal may further receive the interaction information between the user and the binding friend, and the interaction information may be included between the user and the binding friend, while receiving the account of the binding friend sent by the server. Send text messages, pictures, videos, etc.
  • FIG. 2 is different from the embodiment shown in FIG. 1 in that FIG. 1 shows the process of instant communication from the server side, and FIG. 2 shows the instant communication from the terminal side. process,
  • FIG. 1 shows the process of instant communication from the server side
  • FIG. 2 shows the instant communication from the terminal side. process
  • the user can set the appointment code for some friends, so that the friends become binding friends. Therefore, when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server is bound.
  • the binding friend's account is delivered to the terminal, so that when the user logs in to the server in different scenarios of different terminals, the specific display of the binding friend can be implemented without additional operations. , thus improving the user's instant messaging experience.
  • Step 301 When the user adds through the terminal When the friend is bound, the terminal acquires the appointment code of the binding friend set by the user.
  • the user When registering an instant messaging service, the user can set the user's account and password, which is the unique identifier of the user logging in to the server. The user can log in to the server through the client on the terminal through the account and password. After logging in to the server, the user can add a friend through the client to establish a friend relationship.
  • a friend whose appointment code is set in a friend may be referred to as a binding friend.
  • a binding friend For example, when user A adds user B as a friend, if user B is directly added as a friend without any setting, it is consistent with the manner of setting a friend in the prior art. At this time, user B may be referred to as a normal friend of user A; If the appointment code is set for user B, user B may be referred to as the binding friend of user A.
  • the appointment code may include at least one of the following data items: a device identifier, a device identifier of the terminal that the user is logged in, such as an IMEI, or a mobile phone serial number, etc., where, by way of example and not limitation, user B is user A. Binding buddy, User B's appointment code includes the device ID of terminal C. At this time, user A can only download from account to user B's account when logging in terminal C. User B's account can be used by user A.
  • the mobile number identifier indicates the mobile number identifier used by the user on the terminal, for example, IMSI, or MSISDN, etc.; wherein, by way of example and not limitation, user B is a binding friend of user A, and user B's appointment code includes The mobile number identifies D. At this time, the user A can only download from the server to the account of the user B when logging in on the terminal using the mobile number identifier D;
  • the preset time period information indicates the time range when the user logs in. For example, user B is the binding friend of user A, and the appointment code of user B includes the preset time period information. If the time when user A logs in, the time is Within the set time range, user A may download the account to user B from the server; the preset geographical location information indicates the range of the geographical location where the user logs in; for example, user B is the binding friend of user A.
  • the appointment code of the user B includes the preset geographic location range information. If the geographic location when the user A logs in is within the preset geographical location, the user A may download the account of the user B from the server.
  • appointment code in the embodiment of the present invention may not limit the specific data items listed above, and may be flexibly set as needed.
  • the embodiment of the present invention since the downloading manner of the account of the ordinary good friend is consistent with the prior art, the embodiment of the present invention focuses on the downloading method of the account bound to the friend. The correspondence between the two is uploaded to the server.
  • the terminal can upload the binding friend's account and the binding friend's appointment code to the server, so that the server can save the correspondence between the binding friend's account and the appointment code.
  • the correspondence between the codes can be
  • the server may pre-define a specific storage area for the binding friend, and save the correspondence in a specific storage area, and the interaction information generated by the subsequent user and the binding friend in the communication process may also be saved to the specific storage area.
  • the interaction information also corresponds to the account of the binding friend, that is, specific
  • the storage area may store a correspondence between the user's account, the account of each binding friend of the user, the binding code of the binding friend, and the interaction information of the binding friend and the user.
  • the correspondence may be referred to as binding.
  • Correspondence relationship For a normal friend of the user, the correspondence between the account of the user and the account of each ordinary friend of the user and the interaction information between the common friend and the user is saved.
  • the correspondence may be referred to as a common correspondence.
  • Step 304 The terminal sends a login request to the server, where the login request carries the first binding information, the user's account number, and the password.
  • the step 304 is not required to be performed immediately, that is, in the foregoing steps 301 to 303, the user logs in to the server through the terminal, and uploads the user account and the binding friend's account and the binding friend to the server.
  • the user can log in to the server again through the terminal when the buddy list is sent by using the corresponding relationship saved on the server.
  • the binding code when the user adds a friend, the binding code is set for the binding friend. Therefore, when the user logs in to the server in different scenarios through different terminals, the current condition information needs to be sent to the server, and the condition information is in the implementation. In the example, it is called the first binding information.
  • the first binding information may include at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, a time when the terminal sends the login request, and information about a geographical location where the terminal sends the login request.
  • Step 305 After the server determines that the password is the same as the password corresponding to the pre-stored account, the server obtains the binding code of the binding friend of the user according to the account of the user.
  • the server obtains the pre-stored password corresponding to the account according to the account carried in the login request. If the obtained password is the same as the password carried in the login request, the user logs in successfully, and the server can obtain the account according to the user account. The user's binding code of the binding friend. If the user's binding correspondence and the common correspondence are stored in the same storage area of the server, the server may search for the binding correspondence and the common correspondence according to the user's account in the storage area to obtain the binding friend.
  • the server may search for the binding correspondence according to the user's account in the specific storage area, to obtain the binding friend's account, the binding friend's appointment code, and the binding.
  • Step 306 The server determines whether the first binding information matches the binding code of the binding friend.
  • the server may determine whether the first binding information is included in the binding code of the binding friend, if the data item in the first binding information The number is the same as the number of data items in the appointment code, and each data item in the first binding information is within the data item corresponding to the data item in the appointment code, the server determines that the first binding information includes Within the appointment code.
  • Step 307 If the first binding information matches the binding code of the binding friend, the server sends a login response to the terminal, where the login response carries the account of the binding friend.
  • the server when the binding code of a binding friend matches the first binding information, the server sends the binding account to the terminal, and the binding code of the binding friend is bound to the first binding. If the information does not match, the server does not deliver the account of the bound friend to the terminal. Further, in this embodiment, the server sends the binding information of the user to the terminal, and may also send the interaction information between the user and the binding friend, where the interaction information may be included between the user and the binding friend. Text messages, pictures, videos, etc.
  • the user can set the appointment code for some friends, so that the friends become binding friends. Therefore, when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server is bound.
  • the binding friend's account is delivered to the terminal, so that when the user logs in to the server in different scenarios of different terminals, the specific display of the binding friend can be implemented without additional operations. , thus improving the user's instant communication body Test.
  • FIG. 4 it is a flowchart of another embodiment of a method for implementing instant communication according to the present invention.
  • This embodiment describes that after the terminal logs in to the server, the server performs the process of refreshing the friend column after the terminal interacts with the server.
  • Methods include:
  • Step 401 The terminal sends an update request to the server, where the update request carries the second binding information.
  • the terminal may change, for example, the scene of the user may change, for example, the terminal carried by the user is transferred to another location,
  • the binding code of the binding friend may not match the binding information of the current condition.
  • the terminal may send an update request carrying the second binding information to the server. In order to request the server to deliver the account of the binding friend whose matching code matches the second binding information.
  • the terminal may send an update request to the server when the terminal condition changes, for example, when the terminal detects that the geographical location of the terminal changes by using the location technology, the terminal sends an update request to the server; or, the server may refresh the user's friend.
  • the terminal sends a terminal condition information report request to the terminal, and after receiving the terminal condition report request, the terminal sends an update request to the server.
  • the second binding information may be consistent with the data item included in the first binding information in the foregoing embodiment, that is, may include at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, The information of the geographic location where the terminal sends the login request at the time when the terminal sends the login request.
  • Step 402 The server determines whether the second binding information matches the binding code of the binding friend of the user.
  • the server may determine whether the second binding information is included in the binding code of the binding friend. If the second binding information is included in the binding code of the binding friend, the server determines the second binding information. Matches the appointment code.
  • the server determines that the second binding information is included in the appointment code.
  • the server determines whether the second binding information matches the binding code of the binding friend of the user
  • the determining manner is consistent with the manner of determining whether the first binding information matches the binding code of the binding friend of the user described in the foregoing embodiment. For details, refer to the description in the foregoing embodiment.
  • Step 403 If the second binding information matches the binding code of the binding friend, the server sends an update response to the terminal, where the update response carries the account of the bound friend.
  • the server when the binding code of a binding friend matches the second binding information, the server sends the binding account to the terminal, and the binding code of the binding friend is bound to the second binding. If the information does not match, the server does not deliver the account of the bound friend to the terminal. Further, in this embodiment, when the server sends the binding account of the friend to the terminal, the server may also send the interaction information of the user and the binding friend. Therefore, the binding information of the terminal is dynamically changed. Therefore, in this embodiment, the terminal can dynamically update the buddy list of the user for the changed binding information.
  • the user can set the appointment code for some friends, so that the friends become binding friends.
  • the current conditions may change every certain time period, so the terminal can retransmit.
  • Binding information so that the server matches the binding information of the binding friend according to the retransmitted binding information, and sends the updated binding friend's account to the terminal according to the matching result, so that the terminal refreshes the user's buddy list.
  • the terminal can update the buddy list in real time according to the change of the condition, thereby improving the instant communication experience of the user.
  • FIG. 5 it is a flowchart of another embodiment of a method for implementing instant messaging according to the present invention.
  • the interaction between the terminal and the server describes the instant communication process when the terminal logs in to the server through different passwords:
  • Step 501 When the user adds a binding friend through the terminal, the terminal acquires the binding code of the binding friend set by the user.
  • the user When registering an instant messaging service, the user can set the user's account and password, the account and password. This is the unique identifier for the user to log in to the server. The user can log in to the server through the client on the terminal through the account and password. After logging in to the server, the user can add a friend through the client to establish a friend relationship.
  • the buddy whose buddy is set in the buddy may be referred to as a binding buddy.
  • the appointment code may include at least one of the following data items: a device identifier, a mobile number identifier, a preset time period information, and a preset geographic location range information. The correspondence between the two is uploaded to the server.
  • the terminal may upload the bonding friend's friend account and the binding friend's appointment code to the server, so that the server can save the correspondence between the binding friend's account and the appointment code. .
  • the correspondence between the codes may be performed by the terminal.
  • the server may pre-define a specific storage area for the binding friend, and save the correspondence in a specific storage area, and the interaction information generated by the subsequent user and the binding friend in the communication process may also be saved to the specific storage area.
  • the interaction information also corresponds to the account of the binding friend, that is, the account of the user can be saved in the specific storage area, the account of each binding friend of the user, the binding code of the binding friend, and the interaction between the binding friend and the user.
  • the correspondence between the information which may be referred to as a binding correspondence.
  • For a normal friend of the user only the correspondence between the account of the user and the account of each ordinary friend of the user and the interaction information between the ordinary friend and the user is saved, and the corresponding relationship may be referred to as a common correspondence.
  • Step 504 The terminal sends a login request to the server, where the login request carries the first binding information, the user's account number, and the password.
  • the binding code when the user adds a friend, the binding code is set for the binding friend. Therefore, when the user logs in to the server in different scenarios through different terminals, the current condition information needs to be sent to the user.
  • the server the condition information is referred to as the first binding information in this embodiment.
  • the first binding information may include at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, a moment when the terminal sends the login request, and information about a geographical location where the terminal sends the login request.
  • Step 505 The server determines the type of the password carried in the login request. If it is a normal password, go to step 506. If it is a super password, go to step 508.
  • the server when a user logs in to the server, they may not want to be bound by the appointment code, that is, they want to get the account of all the bound friends. Therefore, in this embodiment, when the server is registered, the user can set two types of passwords, namely, a normal password and a super password.
  • a normal password When the user logs in through the ordinary password, the server can follow the embodiment shown in FIG. 1 to FIG. 4 to the terminal. The account that is bound to the friend is sent.
  • the server When the user logs in through the super password, the server can directly send the account of all the bound friends to the terminal.
  • Step 506 The server determines whether the first binding information carried in the login request matches the binding code of the binding friend of the user.
  • the server may determine whether the first binding information is included in the binding code of the binding friend, if the data item in the first binding information The number is the same as the number of data items in the appointment code, and each data item in the first binding information is within the data item corresponding to the data item in the appointment code, the server determines that the first binding information includes Within the appointment code.
  • Step 507 If the first binding information matches the binding code of the binding friend, the server sends a login response to the terminal, where the login response carries the account of the binding friend, and the current process ends.
  • the server when the binding code of a binding friend matches the first binding information, the server sends the binding account to the terminal, and the binding code of the binding friend is bound to the first binding. If the information does not match, the server does not deliver the account of the bound friend to the terminal. Further, in this embodiment, when the server sends the binding account of the friend to the terminal, the server may also send the interaction information of the user and the binding friend.
  • Step 508 The server sends the account of all binding friends of the user to the terminal, and ends the current process.
  • the server directly delivers the account of all the binding friends of the user to the terminal.
  • the access time limit may be set for the login of the super password.
  • the access time limit is exceeded, the user may be required to re-enter the super password. If the user does not input the super password again, The buddy list of the buddy that is delivered to the user is refreshed according to the access right of the common password, which is not limited in this embodiment of the present invention.
  • the user can set the appointment code for some friends, so that the friends become binding friends. Therefore, when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server is bound.
  • the binding friend's account is delivered to the terminal, so that when the user logs in to the server in different scenarios of different terminals, the specific display of the binding friend can be implemented without additional operations.
  • the user can obtain all the accounts of the bound friends under different login conditions through the pre-set super password, so that the existing account is delivered in a manner compatible with different instant communication requirements of the user.
  • user A has two types of friends, wherein family friends are friend C and friend D, and work friends are friend C, friend D, and friend E.
  • User A sets the appointment code of the friend B to the geographic location where the family is located, sets the appointment code of the friend E to the geographical location of the work place, and the friend C and the friend D can serve as ordinary friends, and no appointment code is set for the user.
  • the server can send the account of the friend B, the friend C, and the friend D to the user.
  • the server can send the friend C, the friend D, and the friend E to the user in the third.
  • the user logs in to the server on the mobile phone, adds the user F as the binding friend, and sets the appointment code of the user F to be 9: 00 to 18: 00 every day.
  • the server will The account of the user F is sent to the user A.
  • the time period is exceeded, for example, at 19:00, the account of the friend F will not be included in the friend list sent by the server to the user A.
  • the present invention also provides an embodiment of an apparatus, server and terminal for realizing instant messaging.
  • the apparatus may be a server:
  • the apparatus includes a receiving unit 610, an obtaining unit 620, a matching unit 630, and a transmitting unit 640.
  • the receiving unit 610 is configured to receive a login request sent by the terminal, where the login request carries the first binding information, the account and the password of the user;
  • the obtaining unit 620 is configured to obtain, according to the account of the user, an appointment code of the binding friend of the user, after determining that the password is the same as the password corresponding to the account that is saved in advance;
  • the matching unit 630 is configured to determine whether the first binding information matches the binding code of the binding friend.
  • the sending unit 640 is configured to: when the first binding information matches the binding code of the binding friend, send a login response to the terminal, where the login response carries the account of the binding friend.
  • the matching unit 630 is specifically configured to determine whether the first binding information is included in the binding code of the binding friend, if the first binding information is included in the binding friend. Within the appointment code, it is determined that the first binding information matches the appointment code.
  • the first binding information received by the receiving unit 610 includes at least one of the following data.
  • Item the device identifier of the terminal, the mobile number identifier of the user, the information about the geographical location of the terminal when the terminal sends the login request, and the location acquired by the acquiring unit 620
  • the binding code of the binding friend includes at least one of the following data items: a device identifier, a mobile number identifier, a preset time period information, and preset geographic location range information;
  • the number of data items in the first binding information is the same as the number of data items in the appointment code, and each data item in the first binding information is in the agreement code and each of the When the data item corresponds to the data item, it is determined that the first binding information is included in the agreement code.
  • the receiving unit 610 is further configured to receive an update request sent by the terminal, where the update request carries the second binding information, where the matching unit 630 is further configured to determine the second binding. Whether the information is matched with the binding code of the binding friend; the sending unit 640 is further configured to: send an update to the terminal when the second binding information matches the binding code of the binding friend In response, the update response carries the account of the bound friend.
  • the receiving unit 610 may be specifically configured to receive the update request that is sent by the terminal to the server when the terminal condition changes; or receive the terminal to send a request according to the terminal condition information sent by the server. Returning the update request, the terminal condition information report request is sent by the server to the terminal when refreshing the friend list of the user.
  • FIG. 7 is a structural diagram of a server according to an embodiment of the present invention:
  • the server includes: a bus 710, and a network interface 720, a processor 730, and a memory 740 connected by the bus 710.
  • the network interface 720 is configured to receive a login request sent by the terminal, where the login request carries the first binding information, the account and the password of the user;
  • the processor 730 is configured to: after determining that the password is the same as the password corresponding to the pre-stored account, obtain an appointment code of the binding friend of the user according to the account of the user, and determine the first Whether the binding information matches the binding code of the binding friend, if the first binding information is If the binding code of the binding friend matches, the login response is sent to the terminal through the network interface 720, and the login response carries the account of the binding friend.
  • the memory 740 can be used to store a binding relationship between a user's account, a friend's account, and a friend's appointment code.
  • the processor 730 may be specifically configured to determine whether the first binding information is included in an appointment code of the binding friend, where the first binding information is included in the binding When the friend's appointment code is within, the first binding information is determined to match the appointment code.
  • the first binding information includes at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, a time when the terminal sends the login request, and the terminal sends a
  • the appointment code includes at least one of the following data items: a device identifier, a mobile number identifier, a preset time period information, and a preset geographic location range information; correspondingly, the processing
  • the device 730 may be specifically configured to determine whether the first binding information is included in the binding code of the binding friend, the number of data items in the first binding information, and the data item in the appointment code When the number of the data is the same, and each data item in the first binding information is within the data item corresponding to each data item in the appointment code, determining that the first binding information is included in Within the agreement code.
  • the network interface 720 is further configured to receive an update request sent by the terminal, where the update request carries the second binding information, where the processor 730 is further configured to determine the second binding. Whether the information matches the binding code of the binding friend, and when the second binding information matches the binding code of the binding friend, sending an update response to the terminal, where the update response carries the binding Set a friend's account.
  • the network interface 720 may be specifically configured to receive the update request sent by the terminal to the server when the terminal condition changes; or receive the terminal to send a request according to the terminal condition information sent by the server. Returning the update request, the terminal condition information report request is sent by the server to the terminal when refreshing the friend list of the user.
  • the memory 740 can be further divided into a common buddy storage area and bound.
  • the friend storage area as shown in FIG. 7, wherein the normal friend storage area is used to store ordinary friends.
  • the area is saved in the storage area of the storage unit 740, and the embodiment of the present invention is not limited.
  • the instant communication device may be a terminal:
  • the apparatus includes: a transmitting unit 810 and a receiving unit 820.
  • the sending unit 810 is configured to send a login request to the server, where the login request carries the first binding information, the account of the user, and the password;
  • the receiving unit 820 is configured to receive a login response sent by the server, where the login response is that the server determines that the password is the same as a password corresponding to the account that is saved in advance, and when the time is The account is sent by the terminal, and the login response carries the account of the bound friend.
  • the sending unit 810 is further configured to send an update request to the server, where the update request carries the second binding information
  • the receiving unit 820 is further configured to receive the update sent by the server.
  • the update response is sent by the server to the terminal when the second binding information matches the binding code of the binding friend, and the update response carries the account of the binding friend.
  • the sending unit 810 may be specifically configured to: when the terminal condition changes, send the update request to the server; or, after receiving the terminal condition information report request sent by the server, The server sends the update request, and the terminal condition information report request is sent by the server to the terminal when refreshing the friend list of the user.
  • FIG. 9 is a structural diagram of a terminal according to an embodiment of the present invention.
  • the terminal includes: a bus 910, and a terminal interface 920 and a connection through the bus 910 Processor 930.
  • the processor 930 is configured to send a login request to the server by using the terminal interface 920, where the login request carries the first binding information, the user's account, and a password;
  • the terminal interface 920 is configured to receive a login response sent by the server, where the login response is that after the server determines that the password is the same as a password corresponding to the account that is saved in advance, when the matching is performed, The account is sent by the terminal, and the login response carries the account of the bound friend.
  • the processor 930 is further configured to send, by using the terminal interface 920, an update request to the server, where the update request carries second binding information, where the terminal interface 920 is further used. Receiving an update response sent by the server, where the update response is sent by the server to the terminal when the second binding information matches the binding code of the binding friend, and the update response carries the Bind a friend's account.
  • the processor 930 may be specifically configured to send the update request to the server by using the terminal interface 920 when the terminal condition changes; or after receiving the terminal condition information report request sent by the server, And sending, by the terminal interface 920, the update request to the server, where the terminal condition information report request is sent by the server to the terminal when refreshing the buddy list of the user.
  • the server receives the login request that is sent by the terminal and carries the first binding information, the user's account, and the password. After the server determines that the password is the same as the password corresponding to the pre-stored account, the server obtains the password according to the account of the user. The binding code of the binding friend of the user, the server determines whether the first binding information matches the binding code of the binding friend, and if the first binding information matches the binding code of the binding friend, the server sends the binding code to the terminal. Login response, the login response carries the account of the bound friend. In the embodiment of the present invention, the user can set the appointment code for some friends, so that the friends become binding friends.
  • the user when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server binds the information.
  • the binding code of the binding friend is matched, the account of the binding friend is delivered to the terminal, so that the user does not need to perform additional operations when logging in to the server under different conditions. You can get different account information, thus improving the user's instant messaging experience.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • a storage medium may be any available media that can be accessed by a computer.
  • computer readable media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage media or other magnetic storage device, or can be used for carrying or storing in the form of an instruction or data structure.
  • the desired program code and any other medium that can be accessed by the computer may suitably be a computer readable medium.
  • the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable , fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwaves are included in the fixing of the associated media.
  • coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwaves are included in the fixing of the associated media.
  • a disk and a disc include a compact disc (CD), a laser disc, a compact disc, a digital versatile disc (DVD), a floppy disc, and a Blu-ray disc, wherein the disc is usually magnetically copied, and the disc is The laser is used to optically replicate the data. Combinations of the above should also be included within the scope of protection of computer readable media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed are a method and a device for achieving instant communication. The method comprises: a server receiving a login request sent by a terminal, with the login request carrying first binding information, an account number and a password of a user; after determining that the password is the same as a pre-saved password corresponding to the account number, acquiring a conventional code of a bound friend of the user according to the account number of the user; judging whether the first binding information matches the conventional code of the bound friend; and if the first binding information matches the conventional code of the bound friend, sending a login response to the terminal, with the login response carrying an account number of the bound friend. In the embodiments of the present invention, because the server sends the account number of the bound friend to the terminal only when the binding information matches the conventional code of the bound friend, the user can acquire information about different account numbers without an extra operation when logging into the server under different conditions, thereby improving the instant communication experience of the user.

Description

实现即时通信的方法^置 本申请要求于 2012 年 12 月 28 日提交中国专利局、 申请号为 201210586422.2、 发明名称为"实现即时通信的方法及装置 "的中国专利申请的 优先权, 其全部内容通过引用结合在本申请中。 技术领域  Method for realizing instant communication ^ The priority of this application is Chinese patent application filed on December 28, 2012, the Chinese Patent Office, the application number is 201210586422.2, and the invention is entitled "method and device for realizing instant communication", the entire contents thereof This is incorporated herein by reference. Technical field
本发明涉及即时通信技术领域, 特别涉及实现即时通信的方法及装置。  The present invention relates to the field of instant messaging technologies, and in particular, to a method and apparatus for implementing instant messaging.
背景技术 Background technique
随着互联网技术的发展, 即时通信技术得到了广泛的应用。 在使用即时通 信服务时, 用户之间建立好友关系, 并基于该好友关系进行信息传递。 通常每 个用户可以有多个好友, 每个用户可以向其任意一个好友发送文本以及图片等 信息。 通常用户与其好友之间的好友关系, 以及用户与其好友之间的交互信息 存放在服务器(也可称为云端服务器)上, 无论用户在何种终端上登录, 都可 以从服务器上下载好友关系和交互信息, 其中好友关系可以在终端上以好友列 表的形式呈现, 交互信息主要包括用户与好友之间的历史通信记录, 传递的文 件以及图片等。  With the development of Internet technology, instant messaging technology has been widely used. When using the instant messaging service, a friend relationship is established between users, and information is transmitted based on the friend relationship. Usually each user can have multiple friends, and each user can send text and pictures to any of his friends. Usually, the friend relationship between the user and his friend, and the interaction information between the user and his friend are stored on the server (also referred to as a cloud server), and the user relationship can be downloaded from the server regardless of the terminal on which the user logs in. The interaction information, wherein the friend relationship can be presented in the form of a buddy list on the terminal, and the interaction information mainly includes a historical communication record between the user and the buddy, a file and a picture, and the like.
现有技术中, 用户在终端登录时需要输入用户的账号和密码, 该账号和密 码作为用户的唯一标识, 保证用户无论在哪一个终端上登录, 都可以从服务器 上下载到相同的好友关系和交互信息。 但是, 在实际应用中, 根据用户所处条 件的不同, 例如, 用户在办公场所登录时, 通常仅希望看到好友关系中的工作 伙伴, 但是在登录后, 只能从服务器上下载到所有的好友关系。  In the prior art, the user needs to input the user's account and password when the terminal logs in. The account and password are used as the unique identifier of the user, and the user can download the same friend relationship from the server regardless of which terminal the user logs in. Interactive information. However, in practical applications, depending on the conditions of the user, for example, when the user logs in at the office, he usually only wants to see the working partners in the friend relationship, but after logging in, all the users can only be downloaded from the server. Friends relationship.
发明内容 Summary of the invention
本发明实施例中提供了实现即时通信的方法及装置, 以解决现有即时通信 方式只能从服务器上下载到所有的好友关系的问题。 In the embodiment of the present invention, a method and apparatus for implementing instant communication are provided to solve the existing instant communication The method can only download all the friend relationship issues from the server.
为了解决上述技术问题, 本发明实施例公开了如下技术方案:  In order to solve the above technical problem, the embodiment of the present invention discloses the following technical solutions:
第一方面, 提供一种实现即时通信的方法, 所述方法包括:  In a first aspect, a method for implementing instant messaging is provided, the method comprising:
服务器接收终端发送的登录请求, 所述登录请求携带第一绑定信息、 用户 的账号以及密码;  The server receives the login request sent by the terminal, where the login request carries the first binding information, the account number of the user, and the password;
在所述服务器确定所述密码与预先保存的所述账号对应的密码相同后, 所 述服务器根据所述用户的账号, 获取所述用户的绑定好友的约定码;  After the server determines that the password is the same as the password corresponding to the pre-stored account, the server obtains the binding code of the binding friend of the user according to the account of the user;
所述服务器判断所述第一绑定信息是否与所述绑定好友的约定码匹配; 若所述第一绑定信息与所述绑定好友的约定码匹配, 则所述服务器向所述 终端发送登录响应, 所述登录响应携带所述绑定好友的账号。  Determining, by the server, whether the first binding information matches the binding code of the binding friend; if the first binding information matches the binding code of the binding friend, the server is to the terminal Sending a login response, the login response carrying the account of the bound friend.
结合第一方面, 在第一方面的第一种可能的实现方式中, 所述服务器判断 所述第一绑定信息是否与所述绑定好友的约定码匹配, 包括:  With reference to the first aspect, in a first possible implementation manner of the first aspect, the determining, by the server, whether the first binding information matches the binding code of the bonding friend includes:
所述服务器判断所述第一绑定信息是否包含在所述绑定好友的约定码之 内, 若所述第一绑定信息包含在所述绑定好友的约定码之内, 则所述服务器确 定所述第一绑定信息与所述约定码匹配。  The server determines whether the first binding information is included in the binding code of the binding friend, and if the first binding information is included in the binding code of the binding friend, the server Determining that the first binding information matches the appointment code.
结合第一方面的第一种可能的实现方式, 在第一方面的第二种可能的实现 方式中, 所述第一绑定信息包括至少一种以下数据项: 所述终端的设备标识, 所述用户的移动号码标识, 所述终端发送所述登录请求的时刻, 所述终端发送 所述登录请求时所在地理位置的信息; 所述约定码包括至少一种以下数据项: 设备标识, 移动号码标识, 预设的时间段信息, 预设的地理位置范围信息; 贝 ij ,所述服务器判断所述第一绑定信息是否包含在所述约定码之内, 包括: 若所述第一绑定信息中数据项的数目与所述约定码中数据项的数目相同, 且所述第一绑定信息中的每一数据项均在所述约定码中与所述每一数据项对 应的数据项之内, 则所述服务器确定所述第一绑定信息包含在所述约定码之 内。 结合第一方面, 或第一方面的第一种可能的实现方式, 或第一方面的第二 种可能的实现方式, 在第一方面的第三种可能的实现方式中, 所述服务器向所 述终端发送登录响应后, 所述方法还包括: With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the first binding information includes at least one of the following data items: a device identifier of the terminal, where a mobile number identifier of the user, where the terminal sends the login request, information about a geographical location where the terminal sends the login request; the appointment code includes at least one of the following data items: device identifier, mobile number The identifier, the preset time period information, the preset geographic location range information; the ij, the server determining whether the first binding information is included in the appointment code, including: if the first binding The number of data items in the information is the same as the number of data items in the appointment code, and each data item in the first binding information is a data item corresponding to each of the data items in the appointment code. The server determines that the first binding information is included in the appointment code. With reference to the first aspect, or the first possible implementation manner of the first aspect, or the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, After the terminal sends the login response, the method further includes:
所述服务器接收所述终端发送的更新请求, 所述更新请求携带第二绑定信 息;  Receiving, by the server, an update request sent by the terminal, where the update request carries second binding information;
所述服务器判断所述第二绑定信息是否与所述绑定好友的约定码匹配; 若所述第二绑定信息与所述绑定好友的约定码匹配, 则所述服务器向所述 终端发送更新响应, 所述更新响应携带所述绑定好友的账号。  Determining, by the server, whether the second binding information matches the binding code of the binding friend; if the second binding information matches the binding code of the binding friend, the server is to the terminal Sending an update response, the update response carrying the account of the bound friend.
结合第一方面的第三种可能的实现方式, 在第一方面的第四种可能的实现 方式中, 所述服务器接收所述终端发送的更新请求, 包括:  With the third possible implementation of the first aspect, in a fourth possible implementation manner of the foregoing aspect, the receiving, by the server, the update request sent by the terminal includes:
所述服务器接收所述终端在终端条件发生变化时向所述服务器发送的所 述更新请求; 或者,  Receiving, by the server, the update request sent by the terminal to the server when a terminal condition changes; or
所述服务器接收所述终端根据所述服务器发送的终端条件信息上报请求 返回的所述更新请求, 所述终端条件信息上报请求是所述服务器在刷新所述用 户的好友列表时向所述终端发送的。  Receiving, by the server, the update request returned by the terminal according to the terminal condition information report request sent by the server, where the terminal condition information report request is sent by the server to the terminal when refreshing the friend list of the user of.
结合第一方面, 或第一方面的第一种可能的实现方式, 或第一方面的第二 种可能的实现方式, 在第一方面的第五种可能的实现方式中, 所述用户的密码 为普通密码。  With reference to the first aspect, or the first possible implementation manner of the first aspect, or the second possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, Is a normal password.
第二方面, 提供另一种实现即时通信的方法, 所述方法包括:  In a second aspect, another method for implementing instant messaging is provided, the method comprising:
终端向服务器发送登录请求, 所述登录请求中携带第一绑定信息、 用户的 账号以及密码;  The terminal sends a login request to the server, where the login request carries the first binding information, the user's account number, and the password;
所述终端接收所述服务器发送的登录响应, 所述登录响应是所述服务器在 确定所述密码与预先保存的所述账号对应的密码相同后, 当所述第一绑定信息 端发送的, 所述登录响应中携带所述绑定好友的账号。 结合第二方面, 在第一方面的第二种可能的实现方式中, 所述第一绑定信 息包括至少一种以下数据项:所述终端的设备标识,所述用户的移动号码标识, 所述终端发送所述登录请求的时刻, 所述终端发送所述登录请求时所在地理位 置的信息; 所述约定码包括至少一种以下数据项: 设备标识, 移动号码标识, 预设的时间段信息, 预设的地理位置范围信息。 The terminal receives the login response sent by the server, and the login response is sent by the first binding information end after the server determines that the password is the same as the password corresponding to the account that is saved in advance. The login response carries the account of the bound friend. With reference to the second aspect, in a second possible implementation manner of the first aspect, the first binding information includes at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, The information about the geographic location of the terminal when the terminal sends the login request, where the terminal sends the login request; the appointment code includes at least one of the following data items: device identifier, mobile number identifier, preset time period information , preset location range information.
结合第二方面, 或第二方面的第一种可能的实现方式, 在第二方面的第二 种可能的实现方式中, 所述终端接收所述服务器发送的登录响应后, 所述方法 还包括:  With the second aspect, or the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, after the terminal receives the login response sent by the server, the method further includes :
所述终端向所述服务器发送更新请求, 所述更新请求携带第二绑定信息; 接收所述服务器发送的更新响应, 所述更新响应是所述服务器在所述第二 绑定信息与所述绑定好友的约定码匹配时, 向所述终端发送的, 所述更新响应 携带所述绑定好友的账号。  Sending, by the terminal, an update request to the server, where the update request carries second binding information, and receiving an update response sent by the server, where the update response is that the server is in the second binding information and the When the binding code of the binding friend matches, the update response is sent to the terminal, and the update response carries the account of the binding friend.
结合第二方面的第二种可能的实现方式, 在第二方面的第三种可能的实现 方式中, 所述终端向所述服务器发送更新请求, 包括:  With the second possible implementation of the second aspect, in a third possible implementation manner of the second aspect, the sending, by the terminal, the update request to the server includes:
所述终端在终端条件发生变化时向所述服务器发送所述更新请求; 或者, 所述终端在接收到所述服务器发送的终端条件信息上报请求后, 向所述服 务器发送所述更新请求, 所述终端条件信息上报请求是所述服务器在刷新所述 用户的好友列表时向所述终端发送的。  The terminal sends the update request to the server when the terminal condition changes; or the terminal sends the update request to the server after receiving the terminal condition information report request sent by the server, The terminal condition information reporting request is sent by the server to the terminal when refreshing the buddy list of the user.
结合第二方面, 或第二方面的第一种可能的实现方式, 在第二方面的第四 种可能的实现方式中, 所述用户的密码为普通密码。  With reference to the second aspect, or the first possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the password of the user is a normal password.
第三方面, 提供一种实现即时通信的装置, 所述装置包括:  In a third aspect, an apparatus for implementing instant messaging is provided, the apparatus comprising:
接收单元, 用于接收终端发送的登录请求, 所述登录请求携带第一绑定信 息、 用户的账号以及密码;  a receiving unit, configured to receive a login request sent by the terminal, where the login request carries the first binding information, the user account, and a password;
获取单元, 用于在确定所述密码与预先保存的所述账号对应的密码相同 后, 根据所述用户的账号, 获取所述用户的绑定好友的约定码; 匹配单元, 用于判断所述第一绑定信息是否与所述绑定好友的约定码匹 配; An obtaining unit, configured to acquire, according to an account of the user, an appointment code of the binding friend of the user, after determining that the password is the same as a password corresponding to the account that is saved in advance; a matching unit, configured to determine whether the first binding information matches an appointment code of the binding friend;
发送单元, 用于在所述第一绑定信息与所述绑定好友的约定码匹配时, 向 所述终端发送登录响应, 所述登录响应携带所述绑定好友的账号。  And a sending unit, configured to send a login response to the terminal when the first binding information matches the binding code of the binding friend, where the login response carries the account of the binding friend.
结合第三方面, 在第三方面的第一种可能的实现方式中, 所述匹配单元具 体用于判断所述第一绑定信息是否包含在所述绑定好友的约定码之内, 若所述 第一绑定信息包含在所述绑定好友的约定码之内, 则确定所述第一绑定信息与 所述约定码匹配。  With reference to the third aspect, in a first possible implementation manner of the third aspect, the matching unit is specifically configured to determine whether the first binding information is included in an agreement code of the binding friend, The first binding information is included in the binding code of the binding friend, and then determining that the first binding information matches the appointment code.
结合第三方面的第一种可能的实现方式, 在第三方面的第二种可能的实现 方式中, 所述接收单元接收到的第一绑定信息包括至少一种以下数据项: 所述 终端的设备标识, 所述用户的移动号码标识, 所述终端发送所述登录请求的时 刻, 所述终端发送所述登录请求时所在地理位置的信息;  With reference to the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the first binding information received by the receiving unit includes at least one of the following data items: The device identifier, the mobile number identifier of the user, the time when the terminal sends the login request, and the location information of the location when the terminal sends the login request;
所述获取单元获取的所述绑定好友的约定码包括至少一种以下数据项: 设 备标识, 移动号码标识, 预设的时间段信息, 预设的地理位置范围信息; 贝' J , 所述匹配单元具体用于在所述第一绑定信息中数据项的数目与所述约 定码中数据项的数目相同, 且所述第一绑定信息中的每一数据项均在所述约定 码中与所述每一数据项对应的数据项之内时, 确定所述第一绑定信息包含在所 述约定码之内。  The binding code of the binding friend acquired by the acquiring unit includes at least one of the following data items: a device identifier, a mobile number identifier, a preset time period information, and a preset geographic location range information; The matching unit is specifically configured to: in the first binding information, the number of data items is the same as the number of data items in the appointment code, and each data item in the first binding information is in the agreement code And determining, in the data item corresponding to each of the data items, that the first binding information is included in the agreement code.
结合第三方面, 或第三方面的第一种可能的实现方式, 或第三方面的第二 种可能的实现方式, 在第三方面的第三种可能的实现方式中,  With reference to the third aspect, or the first possible implementation manner of the third aspect, or the second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect,
所述接收单元, 还用于接收所述终端发送的更新请求, 所述更新请求携带 第二绑定信息;  The receiving unit is further configured to receive an update request sent by the terminal, where the update request carries second binding information;
所述匹配单元, 还用于判断所述第二绑定信息是否与所述绑定好友的约定 码匹配;  The matching unit is further configured to determine whether the second binding information matches an agreed code of the binding friend;
所述发送单元, 还用于在所述第二绑定信息与所述绑定好友的约定码匹配 时, 向所述终端发送更新响应, 所述更新响应携带所述绑定好友的账号。 结合第三方面的第三种可能的实现方式, 在第三方面的第四种可能的实现 方式中, 所述接收单元, 具体用于接收所述终端在终端条件发生变化时向所述 服务器发送的所述更新请求; 或者, 接收所述终端根据所述服务器发送的终端 条件信息上报请求返回的所述更新请求, 所述终端条件信息上报请求是所述服 务器在刷新所述用户的好友列表时向所述终端发送的。 The sending unit is further configured to match the second binding information with the binding code of the binding friend And sending an update response to the terminal, where the update response carries the account of the bound friend. With reference to the third possible implementation manner of the third aspect, in a fourth possible implementation manner of the third aspect, the receiving unit is configured to receive, when the terminal condition changes, send the terminal to the server Or receiving the update request returned by the terminal according to the terminal condition information report request sent by the server, where the terminal condition information report request is when the server refreshes the buddy list of the user Sent to the terminal.
第四方面, 提供另一种实现即时通信的装置, 所述装置包括:  In a fourth aspect, there is provided another apparatus for implementing instant messaging, the apparatus comprising:
发送单元, 用于向服务器发送登录请求, 所述登录请求中携带第一绑定信 息、 用户的账号以及密码;  a sending unit, configured to send a login request to the server, where the login request carries the first binding information, the user account, and the password;
接收单元, 用于接收所述服务器发送的登录响应, 所述登录响应是所述服 务器在确定所述密码与预先保存的所述账号对应的密码相同后, 当所述第一绑 所述终端发送的, 所述登录响应中携带所述绑定好友的账号。  a receiving unit, configured to receive a login response sent by the server, where the login response is that the server sends the first binding to the terminal after determining that the password is the same as a password corresponding to the account that is saved in advance. The login response carries the account of the bound friend.
结合第四方面, 在第四方面的第一种可能的实现方式中, 所述发送单元, 还用于向所述服务器发送更新请求, 所述更新请求携带第二绑定信息;  With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the sending unit is further configured to send an update request to the server, where the update request carries second binding information;
所述接收单元, 还用于接收所述服务器发送的更新响应, 所述更新响应是 所述服务器在所述第二绑定信息与所述绑定好友的约定码匹配时, 向所述终端 发送的, 所述更新响应携带所述绑定好友的账号。  The receiving unit is further configured to receive an update response sent by the server, where the update response is sent by the server to the terminal when the second binding information matches the binding code of the binding friend. The update response carries the account of the bound friend.
结合第四方面的第一种可能的实现方式, 在第四方面的第二种可能的实现 方式中, 所述发送单元, 具体用于在终端条件发生变化时向所述服务器发送所 述更新请求; 或者, 在接收到所述服务器发送的终端条件信息上报请求后, 向 所述服务器发送所述更新请求, 所述终端条件信息上报请求是所述服务器在刷 新所述用户的好友列表时向所述终端发送的。  With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the sending unit is specifically configured to send the update request to the server when a terminal condition changes Or, after receiving the terminal condition information report request sent by the server, sending the update request to the server, where the terminal condition information report request is that the server refreshes the buddy list of the user Said by the terminal.
本发明实施例中, 服务器接收终端发送的携带第一绑定信息、 用户的账号 以及密码的登录请求, 在服务器确定密码与预先保存的账号对应的密码相同 后, 根据该用户的账号, 获取该用户的绑定好友的约定码, 服务器判断第一绑 定信息是否与所述绑定好友的约定码匹配, 若第一绑定信息与所述绑定好友的 约定码匹配, 则服务器向终端发送登录响应, 该登录响应携带所述绑定好友的 账号 。 由于本发明实施例中用户可以为某些好友设置约定码, 使得这些好友 成为绑定好友, 因此用户在登录服务器时, 通过向服务器上传当前条件下的绑 定信息, 从而使服务器在绑定信息与绑定好友的约定码匹配时, 才下发该绑定 好友的账号至终端, 由此使得用户在不同条件下登录服务器时, 无需额外操作 就可以获取到不同的账号信息, 从而提高用户的即时通信体验。 In the embodiment of the present invention, the server receives the login request that is sent by the terminal and carries the first binding information, the user's account number, and the password, and the server determines that the password is the same as the password corresponding to the pre-saved account. After the user's account is obtained, the binding code of the binding friend of the user is obtained, and the server determines whether the first binding information matches the binding code of the binding friend, if the first binding information is related to the binding friend. If the agreement code matches, the server sends a login response to the terminal, and the login response carries the account of the bound friend. In the embodiment of the present invention, the user can set the appointment code for some friends, so that the friends become binding friends. Therefore, when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server binds the information. When the binding code of the binding friend is matched, the account of the binding friend is delivered to the terminal, so that when the user logs in to the server under different conditions, different account information can be obtained without additional operations, thereby improving the user's Instant messaging experience.
附图说明 DRAWINGS
为了更清楚地说明本发明实施例的技术方案, 下面将对实施例或现有技术 描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图仅仅 是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动 的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings to be used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only the present invention. For some embodiments, other drawings may be obtained from those of ordinary skill in the art without departing from the drawings.
图 1为本发明实现即时通信的方法的一个实施例流程图;  1 is a flow chart of an embodiment of a method for implementing instant communication according to the present invention;
图 2为本发明实现即时通信的方法的另一个实施例流程图;  2 is a flow chart of another embodiment of a method for implementing instant communication according to the present invention;
图 3为本发明实现即时通信的方法的另一个实施例流程图;  3 is a flow chart of another embodiment of a method for implementing instant communication according to the present invention;
图 4为本发明实现即时通信的方法的另一个实施例流程图;  4 is a flow chart of another embodiment of a method for implementing instant communication according to the present invention;
图 5为本发明实现即时通信的方法的另一个实施例流程图;  5 is a flow chart of another embodiment of a method for implementing instant messaging according to the present invention;
图 6为本发明实现即时通信的装置的一个实施例框图;  6 is a block diagram of an embodiment of an apparatus for implementing instant communication according to the present invention;
图 7为本发明实施例提供的服务器的结构图;  FIG. 7 is a structural diagram of a server according to an embodiment of the present invention;
图 8为本发明实现即时通信的装置的另一个实施例框图;  8 is a block diagram of another embodiment of an apparatus for implementing instant communication according to the present invention;
图 9为本发明实施例提供的终端的结构图。 具体实施方式  FIG. 9 is a structural diagram of a terminal according to an embodiment of the present invention. detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明的一部分实施例, 而不 是全部实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造 性劳动前提下获得的所有其他实施例, 都属于本发明保护的范围。 The technical solution in the embodiment of the present invention will be clarified in the following with reference to the accompanying drawings in the embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS It is apparent that the described embodiments are only a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明如下实施例提供了实现即时通信的方法及装置。  The following embodiments of the present invention provide a method and apparatus for implementing instant messaging.
为了使本技术领域的人员更好地理解本发明实施例中的技术方案, 并使本 发明实施例的上述目的、 特征和优点能够更加明显易懂, 下面结合附图对本发 明实施例中技术方案作进一步详细的说明。  The above described objects, features, and advantages of the embodiments of the present invention will become more apparent and understood. Give further details.
参见图 1 , 为本发明实现即时通信的方法的一个实施例流程图, 该实施例 从服务器侧描述了实现即时通信的过程:  Referring to FIG. 1 , it is a flowchart of an embodiment of a method for implementing instant communication according to the present invention. This embodiment describes a process for implementing instant communication from a server side:
步骤 101 : 服务器接收终端发送的登录请求, 该登录请求携带第一绑定信 息、 用户的账号以及密码。  Step 101: The server receives a login request sent by the terminal, where the login request carries the first binding information, the user's account number, and the password.
本发明实施例中, 为了区别于现有技术中好友的概念, 可以将好友中设置 了约定码的好友称为绑定好友。 当用户通过终端建立好友关系时, 例如, 用户 In the embodiment of the present invention, in order to distinguish the concept of a friend in the prior art, a friend whose appointment code is set in a friend may be referred to as a binding friend. When a user establishes a friendship through a terminal, for example, a user
A添加用户 B为好友时,如果直接添加用户 B为好友而不做任何设置, 则与现 有技术中设置好友的方式一致,此时可以称用户 B为用户 A的普通好友;如果 为用户 B设置了约定码, 则用户 B可以称为用户 A的绑定好友。 本实施例中, 约定码可以包括至少一种以下数据项: When user B is added as a friend, if user B is added as a friend without any setting, it is the same as the way to set a friend in the prior art. At this time, user B can be called user A's ordinary friend; if it is user B When the appointment code is set, user B may be referred to as the binding friend of user A. In this embodiment, the appointment code may include at least one of the following data items:
设备标识, 表示用户所登录终端的设备标识, 例如国际移动设备标识 ( International Mobile Equipment Identity, IMEI ) , 或手机串号等; 其中, 作 为示例而非限定, 用户 B是用户 A 的绑定好友, 用户 B的约定码中包括了终 端 C的设备标识, 这时用户 A只有在终端 C上登录才可能从服务器下载到用 户 B的账号, 通过用户 B的账号, 用户 A可以与用户 B进行信息的交互; 移动号码标识, 表示用户在终端上所使用的移动号码标识, 例如, 国际移 动用户识另1 J码 ( International Mobile Subscriber Identification Number, IMSI ) , 或移动台识别号码 ( Mobile Subscriber International ISDN/PSTN Number , MSISDN )等; 其中, 作为示例而非限定, 用户 B是用户 A的绑定好友, 用户 B的约定码中包括了移动号码标识 D, 这时用户 A只有在使用移动号码标识 D 的终端上登录才可能从服务器下载到用户 B的账号; A device identifier, which indicates a device identifier of a terminal that the user is logged in, such as an International Mobile Equipment Identity (IMEI), or a mobile phone serial number, etc., where, by way of example and not limitation, User B is a binding friend of User A. The user B's appointment code includes the device ID of the terminal C. At this time, the user A can only download the account from the server to the user B by logging in on the terminal C. Through the account of the user B, the user A can perform information with the user B. interaction; mobile number, indicates a mobile number to identify the user on the terminal used, e.g., international mobile subscriber identity another 1 J code (international mobile Subscriber identification number, IMSI ), or a mobile station identification number (mobile Subscriber international ISDN / PSTN Number , MSISDN) and the like; wherein, as an example and not by definition, user B is a binding friend of user A, and the subscription code of user B includes the mobile number identifier D, and user A only logs in on the terminal using the mobile number identifier D. It is possible to download the account from User B to User B;
预设的时间段信息, 表示用户登录时的时间范围; 例如, 用户 B是用户 A 的绑定好友,用户 B的约定码包括预设的时间段信息,如果用户 A登录时的时 刻在该预设的时间段范围内, 用户 A才可能从服务器下载到用户 B的账号; 预设的地理位置范围信息, 表示用户登录时所在地理位置的范围; 例如, 用户 B是用户 A的绑定好友, 用户 B的约定码包括预设的地理位置范围信息, 如果用户 A登录时的地理位置在该预设的地理位置范围内, 用户 A才可能从 服务器下载到用户 B的账号。  The preset time period information indicates the time range when the user logs in. For example, user B is the binding friend of user A, and the appointment code of user B includes the preset time period information. If the time when user A logs in, the time is Within the set time range, user A may download the account to user B from the server; the preset geographical location information indicates the range of the geographical location where the user logs in; for example, user B is the binding friend of user A. The appointment code of the user B includes the preset geographic location range information. If the geographic location when the user A logs in is within the preset geographical location, the user A may download the account of the user B from the server.
需要说明的是, 本发明实施例中的约定码可以不限定上述列举的几种具体 的数据项, 可以根据需要进行灵活设置。 本发明实施例中, 由于普通好友的账 号的下载方式与现有技术一致, 因此本发明实施例重点描述绑定好友的账号的 下载方式。 在为绑定好友设置了约定码后, 终端可以将该绑定好友的好友账号 和绑定好友的约定码上传到服务器, 服务器就可以保存该绑定好友的账号与约 定码之间的对应关系, 优选的, 服务器上可以预先为绑定好友划分特定的存储 区域, 并在特定的存储区域中保存该对应关系, 后续用户与其绑定好友在通信 过程中生成的交互信息也可以保存到该特定的存储区域, 该交互信息也与绑定 好友的账号对应, 即在特定存储区域中可以保存用户的账号与该用户的每个绑 定好友的账号、 绑定好友的约定码、 以及绑定好友和用户的交互信息之间的对 应关系, 该对应关系可以称为绑定对应关系。 对于用户的普通好友, 则只需要 保存该用户的账号与该用户的每个普通好友的账号以及普通好友和用户的交 互信息之间的对应关系, 该对应关系可以称为普通对应关系。  It should be noted that the appointment code in the embodiment of the present invention may not limit the specific data items listed above, and may be flexibly set as needed. In the embodiment of the present invention, the method for downloading the account of the common friend is consistent with the prior art. Therefore, the embodiment of the present invention focuses on the download mode of the account that binds the friend. After the binding code is set for the binding friend, the terminal may upload the bonding friend's friend account and the binding friend's appointment code to the server, and the server may save the correspondence between the binding friend's account and the appointment code. Preferably, the server may pre-define a specific storage area for the binding friend, and save the correspondence in a specific storage area, and the interaction information generated by the subsequent user and the binding friend during the communication process may also be saved to the specific The storage area, the interaction information also corresponds to the account of the binding friend, that is, in the specific storage area, the account of the user and the account of each binding friend of the user, the binding code of the binding friend, and the binding friend can be saved. Correspondence relationship with the user's interaction information, the correspondence relationship may be referred to as a binding correspondence relationship. For a normal friend of the user, the correspondence between the account of the user and the account of each ordinary friend of the user and the interaction information of the common friend and the user may be saved, and the correspondence may be referred to as a common correspondence.
由于本发明实施例中用户在添加好友时, 为绑定好友设置了约定码, 因此 用户通过不同终端, 在不同场景登录服务器时, 需要将当前的条件信息发送给 服务器, 该条件信息在本实施例中称为第一绑定信息。 第一绑定信息可以包括 至少一种以下数据项: 终端的设备标识, 用户的移动号码标识, 终端发送所述 登录请求的时刻, 终端发送所述登录请求时所在地理位置的信息。 In the embodiment of the present invention, when the user adds a friend, the binding code is set for the binding friend. Therefore, when the user logs in to the server in different scenarios through different terminals, the current condition information needs to be sent to the user. The server, the condition information is referred to as the first binding information in this embodiment. The first binding information may include at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, a moment when the terminal sends the login request, and information about a geographical location where the terminal sends the login request.
步骤 102: 在服务器确定该密码与预先保存的该账号对应的密码相同后, 服务器根据该用户的账号, 获取该用户的绑定好友的约定码。  Step 102: After the server determines that the password is the same as the password corresponding to the pre-stored account, the server obtains the binding code of the bound friend of the user according to the account of the user.
服务器根据登录请求中携带的账号, 获取预先保存的与该账号对应的密 码, 如果该获取的密码与登录请求中携带的密码相同, 则表示用户登录成功, 此时服务器可以根据该用户的账号获取该用户的绑定好友的约定码。 其中, 如 果用户的绑定对应关系和普通对应关系保存在服务器的同一存储区域内, 则服 务器可以在该存储区域内根据用户的账号查找绑定对应关系和普通对应关系, 以获得绑定好友的账号、绑定好友的约定码、以及绑定好友与用户的交互信息; 如果绑定对应关系保存在特定的存储区域内, 则服务器可以在该特定存储区域 内根据用户的账号查找绑定对应关系, 以获得绑定好友的账号、 绑定好友的约 定码、 以及绑定好友与用户的交互信息。  The server obtains the pre-stored password corresponding to the account according to the account carried in the login request. If the obtained password is the same as the password carried in the login request, the user logs in successfully, and the server can obtain the account according to the user account. The user's binding code of the binding friend. If the user's binding correspondence and the common correspondence are stored in the same storage area of the server, the server may search for the binding correspondence and the common correspondence according to the user's account in the storage area to obtain the binding friend. The account number, the binding code of the binding friend, and the binding information of the binding friend and the user; if the binding correspondence is stored in a specific storage area, the server may search for the binding correspondence according to the user's account in the specific storage area. , to obtain the binding friend's account, bind the friend's appointment code, and bind the interaction information between the friend and the user.
步骤 103: 服务器判断第一绑定信息是否与绑定好友的约定码匹配。  Step 103: The server determines whether the first binding information matches the binding code of the binding friend.
本实施例中, 服务器在获取了用户的绑定好友的约定码后, 可以判断第一 绑定信息是否包含在所述绑定好友的约定码之内, 若第一绑定信息包含在绑定 好友的约定码之内, 则服务器确定第一绑定信息与所述约定码匹配。  In this embodiment, after obtaining the binding code of the binding friend of the user, the server may determine whether the first binding information is included in the binding code of the binding friend, if the first binding information is included in the binding. Within the buddy's appointment code, the server determines that the first binding information matches the appointment code.
具体的, 若第一绑定信息中数据项的数目与约定码中数据项的数目相同, 且第一绑定信息中的每一数据项均在约定码中与该每一数据项对应的数据项 之内, 则服务器确定第一绑定信息包含在约定码之内。 例如, 某个绑定好友的 约定码包括设备标识和预设的时间段信息, 则如果第一绑定信息仅包含设备标 识, 或者仅包含发送登录请求的时刻, 则表示第一绑定信息中的数据项与约定 码中的数据项的数目不相同; 如果第一绑定信息中包含设备标识和发送登录请 求的时刻, 但是设备标识与约定码中包含的设备标识不一致, 或者发送登录请 求的时刻不在预设的时间段范围内, 则表示第一绑定信息中的每一数据项并非 都在约定码中与该每一数据项对应的数据项之内; 只有当第一绑定信息中包含 设备标识和发送登录请求的时刻, 且设备标识与约定码中包含的设备标识一 致, 且发送登录请求的时刻在预设的时间段范围内, 则表示第一绑定信息与该 绑定好友的约定码匹配。 Specifically, if the number of data items in the first binding information is the same as the number of data items in the appointment code, and each data item in the first binding information is in the agreement code and the data corresponding to each data item. Within the item, the server determines that the first binding information is included in the appointment code. For example, the binding code of a binding friend includes the device identifier and the preset time period information. If the first binding information only includes the device identifier, or only the time when the login request is sent, the first binding information is included. The data item is different from the number of data items in the appointment code; if the first binding information includes the device identifier and the time when the login request is sent, but the device identifier is inconsistent with the device identifier included in the appointment code, or the login is sent. If the time of the request is not within the preset time range, it means that each data item in the first binding information is not within the data item corresponding to each data item in the appointment code; only when the first binding The information includes the device identifier and the time when the login request is sent, and the device identifier is consistent with the device identifier included in the appointment code, and the time when the login request is sent within a preset time range indicates that the first binding information is tied to the binding information. The appointment code of the friend is matched.
需要说明的是, 由于普通好友没有设置约定码, 或者也可以理解为, 第一 绑定信息与所有普通好友的约定码匹配, 即用户无论何时登录服务器, 都可以 下载到普通好友的账号, 对此本发明实施例不进行赞述。  It should be noted that, since the normal friend does not set the appointment code, or the first binding information matches the agreement codes of all ordinary friends, that is, the user can download the account to the ordinary friend whenever he logs in to the server. The embodiment of the present invention is not described in detail.
步骤 104: 若第一绑定信息与该绑定好友的约定码匹配, 则服务器向终端 发送登录响应, 该登录响应携带该绑定好友的账号。  Step 104: If the first binding information matches the binding code of the binding friend, the server sends a login response to the terminal, where the login response carries the account of the binding friend.
本实施例中, 当某个绑定好友的约定码与第一绑定信息匹配时, 则服务器 向终端下发该绑定好友的账号, 当某个绑定好友的约定码与第一绑定信息不匹 配时, 则服务器不向终端下发该绑定好友的账号。 进一步, 本实施例中, 服务 器在向终端下发绑定好友的账号的同时, 还可以下发用户与该绑定好友的交互 信息, 该交互信息可以包括在用户与绑定好友之间已发送的文字消息、 图片、 视频等。  In this embodiment, when the binding code of a binding friend matches the first binding information, the server sends the binding account to the terminal, and the binding code of the binding friend is bound to the first binding. If the information does not match, the server does not deliver the account of the bound friend to the terminal. Further, in this embodiment, the server sends the binding information of the user to the terminal, and may also send the interaction information between the user and the binding friend, where the interaction information may be included between the user and the binding friend. Text messages, pictures, videos, etc.
由上述实施例可见, 由于用户可以为某些好友设置约定码, 使得这些好友 成为绑定好友, 因此用户在登录服务器时, 通过向服务器上传当前条件下的绑 定信息, 从而使服务器在绑定信息与绑定好友的约定码匹配时, 才下发该绑定 好友的账号至终端, 由此使得用户在不同终端不同场景登录服务器时, 无需进 行额外操作, 就可以实现绑定好友的特定显示, 因此提高了用户的即时通信体 验。  As shown in the foregoing embodiment, the user can set the appointment code for some friends, so that the friends become binding friends. Therefore, when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server is bound. When the information is matched with the binding code of the binding friend, the binding friend's account is delivered to the terminal, so that when the user logs in to the server in different scenarios of different terminals, the specific display of the binding friend can be implemented without additional operations. , thus improving the user's instant messaging experience.
参见图 2, 为本发明实现即时通信的方法的另一个实施例流程图, 该实施 例从终端侧描述了实现即时通信的过程:  Referring to FIG. 2, it is a flowchart of another embodiment of a method for implementing instant messaging according to the present invention. The embodiment describes a process for implementing instant communication from a terminal side:
步骤 201: 终端向服务器发送登录请求, 该登录请求中携带第一绑定信息、 用户的账号以及密码。 Step 201: The terminal sends a login request to the server, where the login request carries the first binding information, User's account number and password.
本发明实施例中, 为了区别于现有技术中好友的概念, 可以将好友中设置 了约定码的好友称为绑定好友。 其中, 约定码可以包括至少一种以下数据项: 设备标识, 表示用户所登录终端的设备标识; 移动号码标识, 表示用户在终端 上所使用的移动号码标识; 预设的时间段信息, 表示用户登录时的时间范围; 预设的地理位置范围信息, 表示用户登录时所在的地理位置范围。 需要说明的 根据需要进行灵活设置。  In the embodiment of the present invention, in order to distinguish the concept of a friend in the prior art, a friend whose appointment code is set in a friend may be referred to as a binding friend. The appointment code may include at least one of the following data items: a device identifier, indicating a device identifier of the terminal that the user is logged in; a mobile number identifier, indicating a mobile number identifier used by the user on the terminal; and a preset time period information indicating the user Time range when logging in; Preset location range information, indicating the geographic location where the user is logged in. Need to explain Flexible settings as needed.
由于本发明实施例中用户在添加好友时, 为绑定好友设置了约定码, 因此 用户通过不同终端, 在不同场景登录服务器时, 需要将当前的条件信息发送给 服务器, 该条件信息在本实施例中称为第一绑定信息。 第一绑定信息可以包括 至少一种以下数据项: 终端的设备标识, 用户的移动号码标识, 终端发送所述 登录请求的时刻, 终端发送所述登录请求时所在地理位置的信息。  In the embodiment of the present invention, when the user adds a friend, the binding code is set for the binding friend. Therefore, when the user logs in to the server in different scenarios through different terminals, the current condition information needs to be sent to the server, and the condition information is in the implementation. In the example, it is called the first binding information. The first binding information may include at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, a time when the terminal sends the login request, and information about a geographical location where the terminal sends the login request.
步骤 202: 终端接收服务器发送的登录响应, 该登录响应是服务器在确定 所述密码与预先保存的所述账号对应的密码相同后, 当第一绑定信息与才艮据所 登录响应中携带所述绑定好友的账号。  Step 202: The terminal receives a login response sent by the server, where the login response is performed by the server after determining that the password is the same as the password corresponding to the account that is saved in advance. Bind a friend's account.
本发明实施例中, 由于普通好友的账号的下载方式与现有技术一致, 因此 本发明实施例重点描述绑定好友的账号的下载方式。 在为绑定好友设置了约定 码后, 终端可以将该绑定好友的好友账号和绑定好友的约定码上传到服务器, 服务器可以保存该绑定好友的账号与约定码之间的对应关系, 优选的, 服务器 上可以预先为绑定好友划分特定的存储区域, 并在特定的存储区域中保存该对 应关系, 后续用户与其绑定好友在通信过程中生成的交互信息也可以保存到该 特定的存储区域, 该交互信息也与绑定好友的账号对应, 即在特定存储区域中 可以保存用户的账号与该用户的每个绑定好友的账号、 绑定好友的约定码、 以 及绑定好友和用户的交互信息之间的对应关系 , 该对应关系可以称为绑定对应 关系。 对于用户的普通好友, 则只需要保存该用户的账号与该用户的每个普通 好友的账号以及普通好友和用户的交互信息之间的对应关系, 该对应关系可以 称为普通对应关系。 In the embodiment of the present invention, the method for downloading an account of an ordinary friend is consistent with the prior art. After the binding code is set for the binding friend, the terminal may upload the bonding friend's friend account and the binding friend's appointment code to the server, and the server may save the correspondence between the binding friend's account and the appointment code. Preferably, the server may pre-define a specific storage area for the binding friend, and save the correspondence in a specific storage area, and the interaction information generated by the subsequent user and the binding friend during the communication process may also be saved to the specific The storage area, the interaction information also corresponds to the account of the binding friend, that is, in the specific storage area, the account of the user and the account of each binding friend of the user, the binding code of the binding friend, and And binding the correspondence between the interaction information of the friend and the user, and the correspondence relationship may be referred to as a binding correspondence relationship. For a normal friend of the user, the correspondence between the account of the user and the account of each ordinary friend of the user and the interaction information between the common friend and the user is saved. The correspondence may be referred to as a common correspondence.
服务器根据登录请求中携带的账号, 获取预先保存的与该账号对应的密 码, 如果该获取的密码与登录请求中携带的密码相同, 则表示用户登录成功, 此时服务器可以根据该用户的账号获取该用户的绑定好友的约定码。 其中, 如 果用户的绑定对应关系和普通对应关系保存在服务器的同一存储区域内, 则服 务器可以在该存储区域内根据用户的账号查找绑定对应关系和普通对应关系, 以获得绑定好友的账号、绑定好友的约定码、以及绑定好友与用户的交互信息; 如果绑定对应关系保存在特定的存储区域内, 则服务器可以在该特定存储区域 内根据用户的账号查找绑定对应关系, 以获得绑定好友的账号、 绑定好友的约 定码、 以及绑定好友与用户的交互信息。  The server obtains the pre-stored password corresponding to the account according to the account carried in the login request. If the obtained password is the same as the password carried in the login request, the user logs in successfully, and the server can obtain the account according to the user account. The user's binding code of the binding friend. If the user's binding correspondence and the common correspondence are stored in the same storage area of the server, the server may search for the binding correspondence and the common correspondence according to the user's account in the storage area to obtain the binding friend. The account number, the binding code of the binding friend, and the binding information of the binding friend and the user; if the binding correspondence is stored in a specific storage area, the server may search for the binding correspondence according to the user's account in the specific storage area. , to obtain the binding friend's account, bind the friend's appointment code, and bind the interaction information between the friend and the user.
服务器在获取了用户的绑定好友的约定码后, 可以判断第一绑定信息是否 包含在所述绑定好友的约定码之内 , 若第一绑定信息包含在绑定好友的约定码 之内, 则服务器确定第一绑定信息与所述约定码匹配。  After obtaining the binding code of the binding friend of the user, the server may determine whether the first binding information is included in the binding code of the binding friend, if the first binding information is included in the binding code of the binding friend. The server determines that the first binding information matches the appointment code.
需要说明的是, 由于普通好友没有设置约定码, 或者也可以理解为, 第一 绑定信息与所有普通好友的约定码匹配, 即用户无论何时登录服务器, 都可以 下载到普通好友的账号, 对此本发明实施例不进行赞述。  It should be noted that, since the normal friend does not set the appointment code, or the first binding information matches the agreement codes of all ordinary friends, that is, the user can download the account to the ordinary friend whenever he logs in to the server. The embodiment of the present invention is not described in detail.
当某个绑定好友的约定码与第一绑定信息匹配时, 终端可以接收到服务器 下发的该绑定好友的账号。 进一步, 本实施例中, 终端还可以在接收到服务器 下发的绑定好友的账号的同时, 接收用户与该绑定好友的交互信息, 该交互信 息可以包括在用户与绑定好友之间已发送的文字消息、 图片、 视频等。  When the binding code of a binding friend matches the first binding information, the terminal may receive the account of the binding friend sent by the server. Further, in this embodiment, the terminal may further receive the interaction information between the user and the binding friend, and the interaction information may be included between the user and the binding friend, while receiving the account of the binding friend sent by the server. Send text messages, pictures, videos, etc.
需要说明的是, 图 2中示出的实施例与图 1示出的实施例的不同在于, 图 1从服务器侧示出了即时通信的过程,而图 2从终端侧示出了即时通信的过程, 因此本实施例中的相关描述可以参见图 1示出的实施例, 在此不再赘述。 It should be noted that the embodiment shown in FIG. 2 is different from the embodiment shown in FIG. 1 in that FIG. 1 shows the process of instant communication from the server side, and FIG. 2 shows the instant communication from the terminal side. process, For the related description in this embodiment, reference may be made to the embodiment shown in FIG. 1 , and details are not described herein again.
由上述实施例可见, 由于用户可以为某些好友设置约定码, 使得这些好友 成为绑定好友, 因此用户在登录服务器时, 通过向服务器上传当前条件下的绑 定信息, 从而使服务器在绑定信息与绑定好友的约定码匹配时, 才下发该绑定 好友的账号至终端, 由此使得用户在不同终端不同场景登录服务器时, 无需进 行额外操作, 就可以实现绑定好友的特定显示, 因此提高了用户的即时通信体 验。  As shown in the foregoing embodiment, the user can set the appointment code for some friends, so that the friends become binding friends. Therefore, when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server is bound. When the information is matched with the binding code of the binding friend, the binding friend's account is delivered to the terminal, so that when the user logs in to the server in different scenarios of different terminals, the specific display of the binding friend can be implemented without additional operations. , thus improving the user's instant messaging experience.
参见图 3, 为本发明实现即时通信的方法的另一个实施例流程图, 该实施 例通过终端与服务器之间的交互描述了终端登录服务器时的即时通信过程: 步骤 301: 当用户通过终端添加绑定好友时, 终端获取用户设置的绑定好 友的约定码。  3 is a flowchart of another embodiment of a method for implementing instant messaging according to the present invention. The embodiment describes an instant communication process when a terminal logs in to the server by using an interaction between the terminal and the server: Step 301: When the user adds through the terminal When the friend is bound, the terminal acquires the appointment code of the binding friend set by the user.
用户在注册即时通信业务时, 可以设置用户的账号和密码, 该账号和密码 即为该用户登录服务器的唯一标识。 用户通过该账号和密码即可通过终端上的 客户端登录服务器, 在登录到服务器后, 用户可以通过该客户端添加好友, 建 立好友关系。  When registering an instant messaging service, the user can set the user's account and password, which is the unique identifier of the user logging in to the server. The user can log in to the server through the client on the terminal through the account and password. After logging in to the server, the user can add a friend through the client to establish a friend relationship.
本实施例中, 为了区别于现有技术中好友的概念, 可以将好友中设置了约 定码的好友称为绑定好友。 例如, 用户 A添加用户 B为好友时, 如果直接添加 用户 B为好友而不做任何设置, 则与现有技术中设置好友的方式一致, 此时可 以称用户 B为用户 A的普通好友; 如果为用户 B设置了约定码, 则用户 B可 以称为用户 A的绑定好友。本实施例中,约定码可以包括至少一种以下数据项: 设备标识, 表示用户所登录终端的设备标识, 例如 IMEI, 或手机串号等; 其中, 作为示例而非限定, 用户 B是用户 A 的绑定好友, 用户 B的约定码中 包括了终端 C的设备标识, 这时用户 A只有在终端 C上登录才可能从服务器 下载到用户 B的账号, 通过用户 B的账号, 用户 A可以与用户 B进行信息的 交互; 移动号码标识, 表示用户在终端上所使用的移动号码标识, 例如, IMSI, 或 MSISDN等; 其中, 作为示例而非限定, 用户 B是用户 A的绑定好友, 用 户 B的约定码中包括了移动号码标识 D,这时用户 A只有在使用移动号码标识 D的终端上登录才可能从服务器下载到用户 B的账号; In this embodiment, in order to distinguish the concept of a friend in the prior art, a friend whose appointment code is set in a friend may be referred to as a binding friend. For example, when user A adds user B as a friend, if user B is directly added as a friend without any setting, it is consistent with the manner of setting a friend in the prior art. At this time, user B may be referred to as a normal friend of user A; If the appointment code is set for user B, user B may be referred to as the binding friend of user A. In this embodiment, the appointment code may include at least one of the following data items: a device identifier, a device identifier of the terminal that the user is logged in, such as an IMEI, or a mobile phone serial number, etc., where, by way of example and not limitation, user B is user A. Binding buddy, User B's appointment code includes the device ID of terminal C. At this time, user A can only download from account to user B's account when logging in terminal C. User B's account can be used by user A. User B performs information interaction; The mobile number identifier indicates the mobile number identifier used by the user on the terminal, for example, IMSI, or MSISDN, etc.; wherein, by way of example and not limitation, user B is a binding friend of user A, and user B's appointment code includes The mobile number identifies D. At this time, the user A can only download from the server to the account of the user B when logging in on the terminal using the mobile number identifier D;
预设的时间段信息, 表示用户登录时的时间范围; 例如, 用户 B是用户 A 的绑定好友,用户 B的约定码包括预设的时间段信息,如果用户 A登录时的时 刻在该预设的时间段范围内, 用户 A才可能从服务器下载到用户 B的账号; 预设的地理位置范围信息, 表示用户登录时所在地理位置的范围; 例如, 用户 B是用户 A的绑定好友, 用户 B的约定码包括预设的地理位置范围信息, 如果用户 A登录时的地理位置在该预设的地理位置范围内, 用户 A才可能从 服务器下载到用户 B的账号。  The preset time period information indicates the time range when the user logs in. For example, user B is the binding friend of user A, and the appointment code of user B includes the preset time period information. If the time when user A logs in, the time is Within the set time range, user A may download the account to user B from the server; the preset geographical location information indicates the range of the geographical location where the user logs in; for example, user B is the binding friend of user A. The appointment code of the user B includes the preset geographic location range information. If the geographic location when the user A logs in is within the preset geographical location, the user A may download the account of the user B from the server.
需要说明的是, 本发明实施例中的约定码可以不限定上述列举的几种具体 的数据项, 可以根据需要进行灵活设置。 另外, 本发明实施例中, 由于普通好 友的账号的下载方式与现有技术一致, 因此本发明实施例重点描述绑定好友的 账号的下载方式。 间的对应关系上传到服务器。  It should be noted that the appointment code in the embodiment of the present invention may not limit the specific data items listed above, and may be flexibly set as needed. In addition, in the embodiment of the present invention, since the downloading manner of the account of the ordinary good friend is consistent with the prior art, the embodiment of the present invention focuses on the downloading method of the account bound to the friend. The correspondence between the two is uploaded to the server.
在为绑定好友设置了约定码后, 终端可以将该绑定好友的账号和绑定好友 的约定码上传到服务器, 以便服务器可以保存该绑定好友的账号与约定码之间 的对应关系。 码之间的对应关系。  After the binding code is set for the binding friend, the terminal can upload the binding friend's account and the binding friend's appointment code to the server, so that the server can save the correspondence between the binding friend's account and the appointment code. The correspondence between the codes.
服务器上可以预先为绑定好友划分特定的存储区域, 并在特定的存储区域 中保存该对应关系, 后续用户与其绑定好友在通信过程中生成的交互信息也可 以保存到该特定的存储区域, 该交互信息也与绑定好友的账号对应, 即在特定 存储区域中可以保存用户的账号与该用户的每个绑定好友的账号、 绑定好友的 约定码、 以及绑定好友和用户的交互信息之间的对应关系, 该对应关系可以称 为绑定对应关系。 对于用户的普通好友, 则只需要保存该用户的账号与该用户 的每个普通好友的账号以及普通好友和用户的交互信息之间的对应关系, 该对 应关系可以称为普通对应关系。 The server may pre-define a specific storage area for the binding friend, and save the correspondence in a specific storage area, and the interaction information generated by the subsequent user and the binding friend in the communication process may also be saved to the specific storage area. The interaction information also corresponds to the account of the binding friend, that is, specific The storage area may store a correspondence between the user's account, the account of each binding friend of the user, the binding code of the binding friend, and the interaction information of the binding friend and the user. The correspondence may be referred to as binding. Correspondence relationship. For a normal friend of the user, the correspondence between the account of the user and the account of each ordinary friend of the user and the interaction information between the common friend and the user is saved. The correspondence may be referred to as a common correspondence.
步骤 304: 终端向服务器发送登录请求, 该登录请求中携带第一绑定信息、 用户的账号以及密码。  Step 304: The terminal sends a login request to the server, where the login request carries the first binding information, the user's account number, and the password.
需要说明的是, 前述步骤 303执行完后, 不必立即执行步骤 304, 即前述 步骤 301至步骤 303中用户通过终端登录服务器, 向服务器上传了用户的账号 与绑定好友的账号以及绑定好友的约定码之间的对应关系, 并由服务器保存了 该对应关系后, 后续在需要使用服务器上保存的对应关系下发好友列表时, 用 户可以通过终端再次登录该服务器。  It should be noted that, after the foregoing step 303 is performed, the step 304 is not required to be performed immediately, that is, in the foregoing steps 301 to 303, the user logs in to the server through the terminal, and uploads the user account and the binding friend's account and the binding friend to the server. After the correspondence between the codes is agreed, and the corresponding relationship is saved by the server, the user can log in to the server again through the terminal when the buddy list is sent by using the corresponding relationship saved on the server.
由于本发明实施例中用户在添加好友时, 为绑定好友设置了约定码, 因此 用户通过不同终端, 在不同场景登录服务器时, 需要将当前的条件信息发送给 服务器, 该条件信息在本实施例中称为第一绑定信息。 第一绑定信息可以包括 至少一种以下数据项: 终端的设备标识, 用户的移动号码标识, 终端发送所述 登录请求的时刻, 终端发送所述登录请求时所在地理位置的信息。  In the embodiment of the present invention, when the user adds a friend, the binding code is set for the binding friend. Therefore, when the user logs in to the server in different scenarios through different terminals, the current condition information needs to be sent to the server, and the condition information is in the implementation. In the example, it is called the first binding information. The first binding information may include at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, a time when the terminal sends the login request, and information about a geographical location where the terminal sends the login request.
步骤 305: 在服务器确定该密码与预先保存的该账号对应的密码相同后, 服务器根据该用户的账号, 获取该用户的绑定好友的约定码。  Step 305: After the server determines that the password is the same as the password corresponding to the pre-stored account, the server obtains the binding code of the binding friend of the user according to the account of the user.
服务器根据登录请求中携带的账号, 获取预先保存的与该账号对应的密 码, 如果该获取的密码与登录请求中携带的密码相同, 则表示用户登录成功, 此时服务器可以根据该用户的账号获取该用户的绑定好友的约定码。 其中, 如 果用户的绑定对应关系和普通对应关系保存在服务器的同一存储区域内, 则服 务器可以在该存储区域内根据用户的账号查找绑定对应关系和普通对应关系, 以获得绑定好友的账号、绑定好友的约定码、以及绑定好友与用户的交互信息; 如果绑定对应关系保存在特定的存储区域内, 则服务器可以在该特定存储区域 内根据用户的账号查找绑定对应关系, 以获得绑定好友的账号、 绑定好友的约 定码、 以及绑定好友与用户的交互信息。 The server obtains the pre-stored password corresponding to the account according to the account carried in the login request. If the obtained password is the same as the password carried in the login request, the user logs in successfully, and the server can obtain the account according to the user account. The user's binding code of the binding friend. If the user's binding correspondence and the common correspondence are stored in the same storage area of the server, the server may search for the binding correspondence and the common correspondence according to the user's account in the storage area to obtain the binding friend. The account number, the binding code of the binding friend, and the interaction information of the binding friend and the user; If the binding correspondence is saved in a specific storage area, the server may search for the binding correspondence according to the user's account in the specific storage area, to obtain the binding friend's account, the binding friend's appointment code, and the binding. The interaction information between friends and users.
步骤 306: 服务器判断第一绑定信息是否与绑定好友的约定码匹配。  Step 306: The server determines whether the first binding information matches the binding code of the binding friend.
本实施例中, 服务器在获取了用户的绑定好友的约定码后, 可以判断第一 绑定信息是否包含在所述绑定好友的约定码之内, 若第一绑定信息中数据项的 数目与约定码中数据项的数目相同, 且第一绑定信息中的每一数据项均在约定 码中与该每一数据项对应的数据项之内, 则服务器确定第一绑定信息包含在约 定码之内。  In this embodiment, after obtaining the binding code of the binding friend of the user, the server may determine whether the first binding information is included in the binding code of the binding friend, if the data item in the first binding information The number is the same as the number of data items in the appointment code, and each data item in the first binding information is within the data item corresponding to the data item in the appointment code, the server determines that the first binding information includes Within the appointment code.
需要说明的是, 由于普通好友没有设置约定码, 或者也可以理解为, 第一 绑定信息与所有普通好友的约定码匹配, 即用户无论何时登录服务器, 都可以 下载到普通好友的账号, 对此本发明实施例不进行赞述。  It should be noted that, since the normal friend does not set the appointment code, or the first binding information matches the agreement codes of all ordinary friends, that is, the user can download the account to the ordinary friend whenever he logs in to the server. The embodiment of the present invention is not described in detail.
步骤 307: 若第一绑定信息与该绑定好友的约定码匹配, 则服务器向终端 发送登录响应, 该登录响应携带该绑定好友的账号。  Step 307: If the first binding information matches the binding code of the binding friend, the server sends a login response to the terminal, where the login response carries the account of the binding friend.
本实施例中, 当某个绑定好友的约定码与第一绑定信息匹配时, 则服务器 向终端下发该绑定好友的账号, 当某个绑定好友的约定码与第一绑定信息不匹 配时, 则服务器不向终端下发该绑定好友的账号。 进一步, 本实施例中, 服务 器在向终端下发绑定好友的账号的同时, 还可以下发用户与该绑定好友的交互 信息, 该交互信息可以包括在用户与绑定好友之间已发送的文字消息、 图片、 视频等。  In this embodiment, when the binding code of a binding friend matches the first binding information, the server sends the binding account to the terminal, and the binding code of the binding friend is bound to the first binding. If the information does not match, the server does not deliver the account of the bound friend to the terminal. Further, in this embodiment, the server sends the binding information of the user to the terminal, and may also send the interaction information between the user and the binding friend, where the interaction information may be included between the user and the binding friend. Text messages, pictures, videos, etc.
由上述实施例可见, 由于用户可以为某些好友设置约定码, 使得这些好友 成为绑定好友, 因此用户在登录服务器时, 通过向服务器上传当前条件下的绑 定信息, 从而使服务器在绑定信息与绑定好友的约定码匹配时, 才下发该绑定 好友的账号至终端, 由此使得用户在不同终端不同场景登录服务器时, 无需进 行额外操作, 就可以实现绑定好友的特定显示, 因此提高了用户的即时通信体 验。 As shown in the foregoing embodiment, the user can set the appointment code for some friends, so that the friends become binding friends. Therefore, when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server is bound. When the information is matched with the binding code of the binding friend, the binding friend's account is delivered to the terminal, so that when the user logs in to the server in different scenarios of different terminals, the specific display of the binding friend can be implemented without additional operations. , thus improving the user's instant communication body Test.
参见图 4, 为本发明实现即时通信的方法的另一个实施例流程图, 该实施 例通过终端与服务器之间的交互描述了终端登录服务器后, 服务器刷新好友列 后执行, 本实施例中的方法包括:  Referring to FIG. 4, it is a flowchart of another embodiment of a method for implementing instant communication according to the present invention. This embodiment describes that after the terminal logs in to the server, the server performs the process of refreshing the friend column after the terminal interacts with the server. Methods include:
步骤 401: 终端向服务器发送更新请求, 该更新请求中携带第二绑定信息。 当用户通过终端登录服务器, 并接收到服务器首次发送的绑定好友的账号 后, 随着终端条件的变化, 例如, 用户所处场景可能发生变化, 比如用户携带 的终端转移到了另一地点, 因此服务器前一次发送的绑定好友的账号中, 某些 绑定好友的约定码可能与当前条件下的绑定信息不再匹配, 因此终端可以通过 向服务器发送携带第二绑定信息的更新请求, 以便请求服务器下发约定码与第 二绑定信息匹配的绑定好友的账号。  Step 401: The terminal sends an update request to the server, where the update request carries the second binding information. After the user logs in to the server through the terminal and receives the account of the binding friend sent by the server for the first time, the terminal may change, for example, the scene of the user may change, for example, the terminal carried by the user is transferred to another location, The binding code of the binding friend may not match the binding information of the current condition. The terminal may send an update request carrying the second binding information to the server. In order to request the server to deliver the account of the binding friend whose matching code matches the second binding information.
其中, 终端可以在终端条件发生变化时主动向向服务器发送更新请求, 例 如, 终端通过定位技术检测到终端所在的地理位置发生变化时, 向服务器发送 更新请求; 或者, 服务器可以在刷新用户的好友列表时向终端发送终端条件信 息上报请求, 终端接收到该终端条件上报请求后, 向服务器发送更新请求。  The terminal may send an update request to the server when the terminal condition changes, for example, when the terminal detects that the geographical location of the terminal changes by using the location technology, the terminal sends an update request to the server; or, the server may refresh the user's friend. The terminal sends a terminal condition information report request to the terminal, and after receiving the terminal condition report request, the terminal sends an update request to the server.
本实施例中, 该第二绑定信息与前述实施例中的第一绑定信息包含的数据 项可以一致, 即可以包括至少一种以下数据项: 终端的设备标识, 用户的移动 号码标识, 终端发送所述登录请求的时刻, 终端发送所述登录请求时所在地理 位置的信息。  In this embodiment, the second binding information may be consistent with the data item included in the first binding information in the foregoing embodiment, that is, may include at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, The information of the geographic location where the terminal sends the login request at the time when the terminal sends the login request.
步骤 402:服务器判断第二绑定信息是否与用户的绑定好友的约定码匹配。 本实施例中, 服务器可以判断第二绑定信息是否包含在绑定好友的约定码 之内, 若第二绑定信息包含在绑定好友的约定码之内, 则服务器确定第二绑定 信息与约定码匹配。  Step 402: The server determines whether the second binding information matches the binding code of the binding friend of the user. In this embodiment, the server may determine whether the second binding information is included in the binding code of the binding friend. If the second binding information is included in the binding code of the binding friend, the server determines the second binding information. Matches the appointment code.
具体的, 若第二绑定信息中数据项的数目与约定码中数据项的数目相同, 且第二绑定信息中的每一数据项均在约定码中与该每一数据项对应的数据项 之内, 则服务器确定第二绑定信息包含在约定码之内。 Specifically, if the number of data items in the second binding information is the same as the number of data items in the appointment code, And each data item in the second binding information is within the data item corresponding to each data item in the appointment code, and the server determines that the second binding information is included in the appointment code.
服务器在判断第二绑定信息是否与用户的绑定好友的约定码匹配时, 判断 方式与前述实施例中描述的判断第一绑定信息是否与用户的绑定好友的约定 码匹配的方式一致, 在此不再赘述, 相关内容可以参见前述实施例中的描述。  When the server determines whether the second binding information matches the binding code of the binding friend of the user, the determining manner is consistent with the manner of determining whether the first binding information matches the binding code of the binding friend of the user described in the foregoing embodiment. For details, refer to the description in the foregoing embodiment.
步骤 403: 若第二绑定信息与所述绑定好友的约定码匹配, 则服务器向终 端发送更新响应, 更新响应携带所述绑定好友的账号。  Step 403: If the second binding information matches the binding code of the binding friend, the server sends an update response to the terminal, where the update response carries the account of the bound friend.
本实施例中, 当某个绑定好友的约定码与第二绑定信息匹配时, 则服务器 向终端下发该绑定好友的账号, 当某个绑定好友的约定码与第二绑定信息不匹 配时, 则服务器不向终端下发该绑定好友的账号。 进一步, 本实施例中, 服务 器在向终端下发绑定好友的账号的同时, 还可以下发用户与该绑定好友的交互 信息。 由此可知, 由于终端的绑定信息是动态变化的, 因此本实施例中终端可 以针对变化的绑定信息, 动态更新用户的好友列表。  In this embodiment, when the binding code of a binding friend matches the second binding information, the server sends the binding account to the terminal, and the binding code of the binding friend is bound to the second binding. If the information does not match, the server does not deliver the account of the bound friend to the terminal. Further, in this embodiment, when the server sends the binding account of the friend to the terminal, the server may also send the interaction information of the user and the binding friend. Therefore, the binding information of the terminal is dynamically changed. Therefore, in this embodiment, the terminal can dynamically update the buddy list of the user for the changed binding information.
由上述实施例可见, 由于用户可以为某些好友设置约定码, 使得这些好友 成为绑定好友, 当用户在登录服务器后, 每隔一定的时间周期, 当前条件可能 发生变化, 因此终端可以重传绑定信息, 从而使服务器根据重传的绑定信息与 绑定好友的约定码进行匹配, 按照匹配的结果向终端发送更新后的绑定好友的 账号, 以便终端刷新用户的好友列表, 由此使得终端登录服务器后, 终端可以 根据条件的变化实时更新好友列表, 从而提高用户的即时通信体验。  As shown in the above embodiment, the user can set the appointment code for some friends, so that the friends become binding friends. After the user logs in to the server, the current conditions may change every certain time period, so the terminal can retransmit. Binding information, so that the server matches the binding information of the binding friend according to the retransmitted binding information, and sends the updated binding friend's account to the terminal according to the matching result, so that the terminal refreshes the user's buddy list. After the terminal is logged in to the server, the terminal can update the buddy list in real time according to the change of the condition, thereby improving the instant communication experience of the user.
参见图 5 , 为本发明实现即时通信的方法的另一个实施例流程图, 该实施 例从终端与服务器之间的交互描述了终端通过不同密码登录服务器时的即时 通信过程:  Referring to FIG. 5, it is a flowchart of another embodiment of a method for implementing instant messaging according to the present invention. The interaction between the terminal and the server describes the instant communication process when the terminal logs in to the server through different passwords:
步骤 501 : 当用户通过终端添加绑定好友时, 终端获取用户设置的绑定好 友的约定码。  Step 501: When the user adds a binding friend through the terminal, the terminal acquires the binding code of the binding friend set by the user.
用户在注册即时通信业务时, 可以设置用户的账号和密码, 该账号和密码 即为该用户登录服务器的唯一标识。 用户通过该账号和密码即可通过终端上的 客户端登录服务器, 在登录到服务器后, 用户可以通过该客户端添加好友, 建 立好友关系。 When registering an instant messaging service, the user can set the user's account and password, the account and password. This is the unique identifier for the user to log in to the server. The user can log in to the server through the client on the terminal through the account and password. After logging in to the server, the user can add a friend through the client to establish a friend relationship.
本实施例中, 为了区别于现有技术中好友的概念, 可以将好友中设置了约 定码的好友称为绑定好友。 其中, 约定码可以包括至少一种以下数据项: 设备 标识, 移动号码标识, 预设的时间段信息, 预设的地理位置范围信息。 间的对应关系上传到服务器。  In this embodiment, in order to distinguish the concept of the buddy in the prior art, the buddy whose buddy is set in the buddy may be referred to as a binding buddy. The appointment code may include at least one of the following data items: a device identifier, a mobile number identifier, a preset time period information, and a preset geographic location range information. The correspondence between the two is uploaded to the server.
在为绑定好友设置了约定码后, 终端可以将该绑定好友的好友账号和绑定 好友的约定码上传到服务器, 以便服务器可以保存该绑定好友的账号与约定码 之间的对应关系。 码之间的对应关系。  After the binding code is set for the binding friend, the terminal may upload the bonding friend's friend account and the binding friend's appointment code to the server, so that the server can save the correspondence between the binding friend's account and the appointment code. . The correspondence between the codes.
服务器上可以预先为绑定好友划分特定的存储区域, 并在特定的存储区域 中保存该对应关系, 后续用户与其绑定好友在通信过程中生成的交互信息也可 以保存到该特定的存储区域, 该交互信息也与绑定好友的账号对应, 即在特定 存储区域中可以保存用户的账号与该用户的每个绑定好友的账号、 绑定好友的 约定码、 以及绑定好友和用户的交互信息之间的对应关系, 该对应关系可以称 为绑定对应关系。 对于用户的普通好友, 则只需要保存该用户的账号与该用户 的每个普通好友的账号以及普通好友和用户的交互信息之间的对应关系, 该对 应关系可以称为普通对应关系。  The server may pre-define a specific storage area for the binding friend, and save the correspondence in a specific storage area, and the interaction information generated by the subsequent user and the binding friend in the communication process may also be saved to the specific storage area. The interaction information also corresponds to the account of the binding friend, that is, the account of the user can be saved in the specific storage area, the account of each binding friend of the user, the binding code of the binding friend, and the interaction between the binding friend and the user. The correspondence between the information, which may be referred to as a binding correspondence. For a normal friend of the user, only the correspondence between the account of the user and the account of each ordinary friend of the user and the interaction information between the ordinary friend and the user is saved, and the corresponding relationship may be referred to as a common correspondence.
步骤 504: 终端向服务器发送登录请求, 该登录请求中携带第一绑定信息、 用户的账号以及密码。  Step 504: The terminal sends a login request to the server, where the login request carries the first binding information, the user's account number, and the password.
由于本发明实施例中用户在添加好友时, 为绑定好友设置了约定码, 因此 用户通过不同终端, 在不同场景登录服务器时, 需要将当前的条件信息发送给 服务器, 该条件信息在本实施例中称为第一绑定信息。 第一绑定信息可以包括 至少一种以下数据项: 终端的设备标识, 用户的移动号码标识, 终端发送所述 登录请求的时刻, 终端发送所述登录请求时所在地理位置的信息。 In the embodiment of the present invention, when the user adds a friend, the binding code is set for the binding friend. Therefore, when the user logs in to the server in different scenarios through different terminals, the current condition information needs to be sent to the user. The server, the condition information is referred to as the first binding information in this embodiment. The first binding information may include at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, a moment when the terminal sends the login request, and information about a geographical location where the terminal sends the login request.
步骤 505: 服务器判断登录请求中所携带密码的类型, 如果为普通密码, 执行步骤 506; 如果为超级密码, 执行步骤 508。  Step 505: The server determines the type of the password carried in the login request. If it is a normal password, go to step 506. If it is a super password, go to step 508.
在某些情况下, 用户登录服务器时, 可能不希望受到约定码的限制, 即想 要获得全部绑定好友的账号。 因此本实施例中, 用户可以在注册服务器时, 设 置两种密码, 分别为普通密码和超级密码, 当用户通过普通密码登录时, 服务 器可以按照前述图 1至图 4示出的实施例向终端发送绑定好友的账号, 当用户 通过超级密码登录时, 服务器可以直接向终端下发所有绑定好友的账号。  In some cases, when a user logs in to the server, they may not want to be bound by the appointment code, that is, they want to get the account of all the bound friends. Therefore, in this embodiment, when the server is registered, the user can set two types of passwords, namely, a normal password and a super password. When the user logs in through the ordinary password, the server can follow the embodiment shown in FIG. 1 to FIG. 4 to the terminal. The account that is bound to the friend is sent. When the user logs in through the super password, the server can directly send the account of all the bound friends to the terminal.
步骤 506: 服务器判断登录请求中携带的第一绑定信息是否与用户的绑定 好友的约定码匹配。  Step 506: The server determines whether the first binding information carried in the login request matches the binding code of the binding friend of the user.
本实施例中, 服务器在获取了用户的绑定好友的约定码后, 可以判断第一 绑定信息是否包含在所述绑定好友的约定码之内, 若第一绑定信息中数据项的 数目与约定码中数据项的数目相同, 且第一绑定信息中的每一数据项均在约定 码中与该每一数据项对应的数据项之内, 则服务器确定第一绑定信息包含在约 定码之内。  In this embodiment, after obtaining the binding code of the binding friend of the user, the server may determine whether the first binding information is included in the binding code of the binding friend, if the data item in the first binding information The number is the same as the number of data items in the appointment code, and each data item in the first binding information is within the data item corresponding to the data item in the appointment code, the server determines that the first binding information includes Within the appointment code.
步骤 507: 若第一绑定信息与该绑定好友的约定码匹配, 则服务器向终端 发送登录响应, 该登录响应携带该绑定好友的账号, 结束当前流程。  Step 507: If the first binding information matches the binding code of the binding friend, the server sends a login response to the terminal, where the login response carries the account of the binding friend, and the current process ends.
本实施例中, 当某个绑定好友的约定码与第一绑定信息匹配时, 则服务器 向终端下发该绑定好友的账号, 当某个绑定好友的约定码与第一绑定信息不匹 配时, 则服务器不向终端下发该绑定好友的账号。 进一步, 本实施例中, 服务 器在向终端下发绑定好友的账号的同时, 还可以下发用户与该绑定好友的交互 信息。  In this embodiment, when the binding code of a binding friend matches the first binding information, the server sends the binding account to the terminal, and the binding code of the binding friend is bound to the first binding. If the information does not match, the server does not deliver the account of the bound friend to the terminal. Further, in this embodiment, when the server sends the binding account of the friend to the terminal, the server may also send the interaction information of the user and the binding friend.
步骤 508: 服务器向终端发送用户的所有绑定好友的账号, 结束当前流程。 当用户通过超级密码登录服务器时, 服务器直接向终端下发用户的所有绑 定好友的账号。 Step 508: The server sends the account of all binding friends of the user to the terminal, and ends the current process. When the user logs in to the server through the super password, the server directly delivers the account of all the binding friends of the user to the terminal.
本实施例中, 为了保护用户私密信息的安全性, 也可以为超级密码的登录 设定访问时限, 当超过访问时限时, 可以要求用户重新输入超级密码, 如果用 户未再次输入超级密码, 则可以按照普通密码的接入权限刷新向用户下发的绑 定好友的好友列表, 对此本发明实施例不进行限制。  In this embodiment, in order to protect the security of the user's private information, the access time limit may be set for the login of the super password. When the access time limit is exceeded, the user may be required to re-enter the super password. If the user does not input the super password again, The buddy list of the buddy that is delivered to the user is refreshed according to the access right of the common password, which is not limited in this embodiment of the present invention.
由上述实施例可见, 由于用户可以为某些好友设置约定码, 使得这些好友 成为绑定好友, 因此用户在登录服务器时, 通过向服务器上传当前条件下的绑 定信息, 从而使服务器在绑定信息与绑定好友的约定码匹配时, 才下发该绑定 好友的账号至终端, 由此使得用户在不同终端不同场景登录服务器时, 无需进 行额外操作, 就可以实现绑定好友的特定显示; 并且, 用户可以通过预先设置 的超级密码, 在不同的登录条件下获得所有绑定好友的账号, 从而可以兼容现 有的账号下发方式, 满足用户不同的即时通信需求。  As shown in the foregoing embodiment, the user can set the appointment code for some friends, so that the friends become binding friends. Therefore, when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server is bound. When the information is matched with the binding code of the binding friend, the binding friend's account is delivered to the terminal, so that when the user logs in to the server in different scenarios of different terminals, the specific display of the binding friend can be implemented without additional operations. Moreover, the user can obtain all the accounts of the bound friends under different login conditions through the pre-set super password, so that the existing account is delivered in a manner compatible with different instant communication requirements of the user.
下面结合几种实际的应用场景, 描述应用本发明实施例进行即时通信的过 程。  The process of applying the instant messaging of the embodiment of the present invention will be described below in combination with several practical application scenarios.
在第一种应用场景下:  In the first application scenario:
假设用户 A在手机上登录服务器,添加用户 B为绑定好友,并设置该用户 B的约定码为该手机的 IMEI, 当用户 A在公用掌上电脑 (PAD )或其他设备 上再次登录服务器时, 由于该公用 PAD或其他设备的 IMEI与该手机的 IMEI 不一致, 因此服务器不会将该好友 B的账号下发到该公用 PAD或其他设备上。  Suppose user A logs in to the server on the mobile phone, adds user B as the binding friend, and sets the user B's appointment code to the IMEI of the mobile phone. When user A logs in to the server again on the public handheld (PAD) or other device, Since the IMEI of the public PAD or other device is inconsistent with the IMEI of the mobile phone, the server does not deliver the account of the friend B to the public PAD or other device.
在第二种应用场景下:  In the second application scenario:
假设用户 A有两类好友, 其中家庭类好友为好友 好友 C和好友 D, 工 作类好友为好友 C、好友 D和好友 E。用户 A将好友 B的约定码设置为家庭所 在的地理位置,将好友 E的约定码设置为工作地点的地理位置, 而好友 C和好 友 D则可以作为普通好友, 不为其设置约定码。 则当用户 A在家庭内登录服 务器时, 服务器可以向用户下发好友 B、 好友 C和好友 D的账号, 当用户 A 在工作地点登录服务器时,服务器可以向用户下发友 C、好友 D和好友 E的账 在第三种应用场景下: Assume that user A has two types of friends, wherein family friends are friend C and friend D, and work friends are friend C, friend D, and friend E. User A sets the appointment code of the friend B to the geographic location where the family is located, sets the appointment code of the friend E to the geographical location of the work place, and the friend C and the friend D can serve as ordinary friends, and no appointment code is set for the user. Then when user A logs in to the service in the home When the server is used, the server can send the account of the friend B, the friend C, and the friend D to the user. When the user A logs in to the server at the work place, the server can send the friend C, the friend D, and the friend E to the user in the third. Application scenarios:
假设用户 Α在手机上登录服务器, 添加用户 F为绑定好友, 并设置该用户 F的约定码为每天 9: 00至 18: 00, 则当用户 A在该时间段内登录服务器时, 服务器会将用户 F的账号下发给用户 A, 当超过该时间段时, 例如, 在 19: 00 时, 该服务器向该用户 A发送的好友列表中将不会包含该好友 F的账号。  Suppose the user logs in to the server on the mobile phone, adds the user F as the binding friend, and sets the appointment code of the user F to be 9: 00 to 18: 00 every day. When the user A logs in to the server during the time period, the server will The account of the user F is sent to the user A. When the time period is exceeded, for example, at 19:00, the account of the friend F will not be included in the friend list sent by the server to the user A.
与本发明实现即时通信的方法的实施例相对应, 本发明还提供了实现即时 通信的装置、 服务器及终端的实施例。  Corresponding to an embodiment of the method of the present invention for realizing instant communication, the present invention also provides an embodiment of an apparatus, server and terminal for realizing instant messaging.
参见图 6, 为本发明实现即时通信的装置的一个实施例框图, 该装置可以 是一个服务器:  Referring to FIG. 6, which is a block diagram of an embodiment of an apparatus for implementing instant messaging according to the present invention, the apparatus may be a server:
该装置包括:接收单元 610、获取单元 620、 匹配单元 630和发送单元 640。 其中, 接收单元 610, 用于接收终端发送的登录请求, 所述登录请求携带 第一绑定信息、 用户的账号以及密码;  The apparatus includes a receiving unit 610, an obtaining unit 620, a matching unit 630, and a transmitting unit 640. The receiving unit 610 is configured to receive a login request sent by the terminal, where the login request carries the first binding information, the account and the password of the user;
获取单元 620, 用于在确定所述密码与预先保存的所述账号对应的密码相 同后, 根据所述用户的账号, 获取所述用户的绑定好友的约定码;  The obtaining unit 620 is configured to obtain, according to the account of the user, an appointment code of the binding friend of the user, after determining that the password is the same as the password corresponding to the account that is saved in advance;
匹配单元 630, 用于判断所述第一绑定信息是否与所述绑定好友的约定码 匹配;  The matching unit 630 is configured to determine whether the first binding information matches the binding code of the binding friend.
发送单元 640, 用于在所述第一绑定信息与所述绑定好友的约定码匹配, 则向所述终端发送登录响应, 所述登录响应携带所述绑定好友的账号。  The sending unit 640 is configured to: when the first binding information matches the binding code of the binding friend, send a login response to the terminal, where the login response carries the account of the binding friend.
可选的, 所述匹配单元 630可以具体用于判断所述第一绑定信息是否包含 在所述绑定好友的约定码之内, 若所述第一绑定信息包含在所述绑定好友的约 定码之内, 则确定所述第一绑定信息与所述约定码匹配。  Optionally, the matching unit 630 is specifically configured to determine whether the first binding information is included in the binding code of the binding friend, if the first binding information is included in the binding friend. Within the appointment code, it is determined that the first binding information matches the appointment code.
可选的, 所述接收单元 610接收到的第一绑定信息包括至少一种以下数据 项: 所述终端的设备标识, 所述用户的移动号码标识, 所述终端发送所述登录 请求的时刻, 所述终端发送所述登录请求时所在地理位置的信息; 所述获取单 元 620获取的所述绑定好友的约定码包括至少一种以下数据项: 设备标识, 移 动号码标识, 预设的时间段信息, 预设的地理位置范围信息; 则, 所述匹配单 元 630可以具体用于在所述第一绑定信息中数据项的数目与所述约定码中数据 项的数目相同, 且所述第一绑定信息中的每一数据项均在所述约定码中与所述 每一数据项对应的数据项之内时, 确定所述第一绑定信息包含在所述约定码之 内。 Optionally, the first binding information received by the receiving unit 610 includes at least one of the following data. Item: the device identifier of the terminal, the mobile number identifier of the user, the information about the geographical location of the terminal when the terminal sends the login request, and the location acquired by the acquiring unit 620 The binding code of the binding friend includes at least one of the following data items: a device identifier, a mobile number identifier, a preset time period information, and preset geographic location range information; The number of data items in the first binding information is the same as the number of data items in the appointment code, and each data item in the first binding information is in the agreement code and each of the When the data item corresponds to the data item, it is determined that the first binding information is included in the agreement code.
可选的, 所述接收单元 610, 还可以用于接收所述终端发送的更新请求, 所述更新请求携带第二绑定信息; 所述匹配单元 630, 还可以用于判断所述第 二绑定信息是否与所述绑定好友的约定码匹配; 所述发送单元 640, 还可以用 于在所述第二绑定信息与所述绑定好友的约定码匹配时, 向所述终端发送更新 响应, 所述更新响应携带所述绑定好友的账号。  Optionally, the receiving unit 610 is further configured to receive an update request sent by the terminal, where the update request carries the second binding information, where the matching unit 630 is further configured to determine the second binding. Whether the information is matched with the binding code of the binding friend; the sending unit 640 is further configured to: send an update to the terminal when the second binding information matches the binding code of the binding friend In response, the update response carries the account of the bound friend.
其中, 所述接收单元 610, 可以具体用于接收所述终端在终端条件发生变 化时向所述服务器发送的所述更新请求; 或者, 接收所述终端根据所述服务器 发送的终端条件信息上报请求返回的所述更新请求, 所述终端条件信息上报请 求是所述服务器在刷新所述用户的好友列表时向所述终端发送的。  The receiving unit 610 may be specifically configured to receive the update request that is sent by the terminal to the server when the terminal condition changes; or receive the terminal to send a request according to the terminal condition information sent by the server. Returning the update request, the terminal condition information report request is sent by the server to the terminal when refreshing the friend list of the user.
参见图 7, 为本发明实施例提供的服务器的结构图:  FIG. 7 is a structural diagram of a server according to an embodiment of the present invention:
该月良务器包括: 总线 710, 以及通过所述总线 710相连的网络接口 720、 处理器 730和存储器 740。  The server includes: a bus 710, and a network interface 720, a processor 730, and a memory 740 connected by the bus 710.
其中, 所述网络接口 720, 用于接收终端发送的登录请求, 所述登录请求 携带第一绑定信息、 用户的账号以及密码;  The network interface 720 is configured to receive a login request sent by the terminal, where the login request carries the first binding information, the account and the password of the user;
所述处理器 730, 用于在确定所述密码与预先保存的所述账号对应的密码 相同后, 根据所述用户的账号, 获取所述用户的绑定好友的约定码, 判断所述 第一绑定信息是否与所述绑定好友的约定码匹配, 若所述第一绑定信息与所述 绑定好友的约定码匹配, 则通过所述网络接口 720向所述终端发送登录响应, 所述登录响应携带所述绑定好友的账号。 The processor 730 is configured to: after determining that the password is the same as the password corresponding to the pre-stored account, obtain an appointment code of the binding friend of the user according to the account of the user, and determine the first Whether the binding information matches the binding code of the binding friend, if the first binding information is If the binding code of the binding friend matches, the login response is sent to the terminal through the network interface 720, and the login response carries the account of the binding friend.
可选的, 所述存储器 740, 可以用于存储用户的账号、 绑定好友的账号、 以及绑定好友的约定码之间的绑定关系。  Optionally, the memory 740 can be used to store a binding relationship between a user's account, a friend's account, and a friend's appointment code.
可选的, 所述处理器 730, 可以具体用于判断所述第一绑定信息是否包含 在所述绑定好友的约定码之内, 在所述第一绑定信息包含在所述绑定好友的约 定码之内时, 确定所述第一绑定信息与所述约定码匹配。  Optionally, the processor 730 may be specifically configured to determine whether the first binding information is included in an appointment code of the binding friend, where the first binding information is included in the binding When the friend's appointment code is within, the first binding information is determined to match the appointment code.
可选的, 所述第一绑定信息包括至少一种以下数据项: 所述终端的设备标 识, 所述用户的移动号码标识, 所述终端发送所述登录请求的时刻, 所述终端 发送所述登录请求时所在地理位置的信息; 所述约定码包括至少一种以下数据 项: 设备标识, 移动号码标识, 预设的时间段信息, 预设的地理位置范围信息; 相应的, 所述处理器 730, 可以具体用于判断所述第一绑定信息是否包含在所 述绑定好友的约定码之内, 在所述第一绑定信息中数据项的数目与所述约定码 中数据项的数目相同, 且所述第一绑定信息中的每一数据项均在所述约定码中 与所述每一数据项对应的数据项之内时, 确定所述第一绑定信息包含在所述约 定码之内。  Optionally, the first binding information includes at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, a time when the terminal sends the login request, and the terminal sends a The information about the geographical location of the login request; the appointment code includes at least one of the following data items: a device identifier, a mobile number identifier, a preset time period information, and a preset geographic location range information; correspondingly, the processing The device 730 may be specifically configured to determine whether the first binding information is included in the binding code of the binding friend, the number of data items in the first binding information, and the data item in the appointment code When the number of the data is the same, and each data item in the first binding information is within the data item corresponding to each data item in the appointment code, determining that the first binding information is included in Within the agreement code.
可选的, 所述网络接口 720, 还可以用于接收所述终端发送的更新请求, 所述更新请求携带第二绑定信息; 所述处理器 730, 还可以用于判断所述第二 绑定信息是否与所述绑定好友的约定码匹配, 在所述第二绑定信息与所述绑定 好友的约定码匹配时, 向所述终端发送更新响应, 所述更新响应携带所述绑定 好友的账号。 其中, 所述网络接口 720, 可以具体用于接收所述终端在终端条 件发生变化时向所述服务器发送的所述更新请求; 或者, 接收所述终端根据所 述服务器发送的终端条件信息上报请求返回的所述更新请求, 所述终端条件信 息上报请求是所述服务器在刷新所述用户的好友列表时向所述终端发送的。  Optionally, the network interface 720 is further configured to receive an update request sent by the terminal, where the update request carries the second binding information, where the processor 730 is further configured to determine the second binding. Whether the information matches the binding code of the binding friend, and when the second binding information matches the binding code of the binding friend, sending an update response to the terminal, where the update response carries the binding Set a friend's account. The network interface 720 may be specifically configured to receive the update request sent by the terminal to the server when the terminal condition changes; or receive the terminal to send a request according to the terminal condition information sent by the server. Returning the update request, the terminal condition information report request is sent by the server to the terminal when refreshing the friend list of the user.
可选的, 所述存储器 740内可以进一步划分出普通好友存储区域和绑定好 友存储区域, 如图 7中所示, 其中普通好友存储区域用于存储普通好友的普通 Optionally, the memory 740 can be further divided into a common buddy storage area and bound. The friend storage area, as shown in FIG. 7, wherein the normal friend storage area is used to store ordinary friends.
区域, 而是将普通好友的普通对应关系和绑定好友的绑定对应关系均保存到存 储器 740的存储区域内, 对此本发明实施例不进行限制。 The area is saved in the storage area of the storage unit 740, and the embodiment of the present invention is not limited.
参见图 8, 为本发明实现即时通信的装置的另一个实施例框图, 该即时通 信装置可以是一个终端:  Referring to FIG. 8, which is a block diagram of another embodiment of an apparatus for implementing instant messaging according to the present invention, the instant communication device may be a terminal:
该装置包括: 发送单元 810和接收单元 820。  The apparatus includes: a transmitting unit 810 and a receiving unit 820.
其中, 发送单元 810, 用于向服务器发送登录请求, 所述登录请求中携带 第一绑定信息、 用户的账号以及密码;  The sending unit 810 is configured to send a login request to the server, where the login request carries the first binding information, the account of the user, and the password;
接收单元 820, 用于接收所述服务器发送的登录响应, 所述登录响应是所 述服务器在确定所述密码与预先保存的所述账号对应的密码相同后, 当所述第 时, 向所述终端发送的, 所述登录响应中携带所述绑定好友的账号。  The receiving unit 820 is configured to receive a login response sent by the server, where the login response is that the server determines that the password is the same as a password corresponding to the account that is saved in advance, and when the time is The account is sent by the terminal, and the login response carries the account of the bound friend.
可选的, 所述发送单元 810, 还可以用于向所述服务器发送更新请求, 所 述更新请求携带第二绑定信息; 所述接收单元 820, 还可以用于接收所述服务 器发送的更新响应, 所述更新响应是所述服务器在所述第二绑定信息与所述绑 定好友的约定码匹配时, 向所述终端发送的, 所述更新响应携带所述绑定好友 的账号。  Optionally, the sending unit 810 is further configured to send an update request to the server, where the update request carries the second binding information, and the receiving unit 820 is further configured to receive the update sent by the server. In response, the update response is sent by the server to the terminal when the second binding information matches the binding code of the binding friend, and the update response carries the account of the binding friend.
可选的, 所述发送单元 810, 可以具体用于在终端条件发生变化时向所述 服务器发送所述更新请求; 或者, 在接收到所述服务器发送的终端条件信息上 报请求后, 向所述服务器发送所述更新请求, 所述终端条件信息上报请求是所 述服务器在刷新所述用户的好友列表时向所述终端发送的。  Optionally, the sending unit 810 may be specifically configured to: when the terminal condition changes, send the update request to the server; or, after receiving the terminal condition information report request sent by the server, The server sends the update request, and the terminal condition information report request is sent by the server to the terminal when refreshing the friend list of the user.
参见图 9, 为本发明实施例提供的终端的结构图:  FIG. 9 is a structural diagram of a terminal according to an embodiment of the present invention:
该终端包括: 总线 910, 以及通过所述总线 910连接的终端接口 920和处 理器 930。 The terminal includes: a bus 910, and a terminal interface 920 and a connection through the bus 910 Processor 930.
其中, 所述处理器 930, 用于通过终端接口 920向服务器发送登录请求, 所述登录请求中携带第一绑定信息、 用户的账号以及密码;  The processor 930 is configured to send a login request to the server by using the terminal interface 920, where the login request carries the first binding information, the user's account, and a password;
所述终端接口 920, 用于接收所述服务器发送的登录响应, 所述登录响应 是所述服务器在确定所述密码与预先保存的所述账号对应的密码相同后, 当所 匹配时, 向所述终端发送的, 所述登录响应中携带所述绑定好友的账号。  The terminal interface 920 is configured to receive a login response sent by the server, where the login response is that after the server determines that the password is the same as a password corresponding to the account that is saved in advance, when the matching is performed, The account is sent by the terminal, and the login response carries the account of the bound friend.
可选的, 所述处理器 930, 还可以用于通过所述终端接口 920向所述 务 器发送更新请求, 所述更新请求携带第二绑定信息; 所述终端接口 920, 还可 以用于接收所述服务器发送的更新响应, 所述更新响应是所述服务器在所述第 二绑定信息与所述绑定好友的约定码匹配时, 向所述终端发送的, 所述更新响 应携带所述绑定好友的账号。 其中, 所述处理器 930, 可以具体用于在终端条 件发生变化时通过所述终端接口 920向所述服务器发送所述更新请求; 或者, 在接收到所述服务器发送的终端条件信息上报请求后, 通过所述终端接口 920 向所述服务器发送所述更新请求, 所述终端条件信息上报请求是所述服务器在 刷新所述用户的好友列表时向所述终端发送的。  Optionally, the processor 930 is further configured to send, by using the terminal interface 920, an update request to the server, where the update request carries second binding information, where the terminal interface 920 is further used. Receiving an update response sent by the server, where the update response is sent by the server to the terminal when the second binding information matches the binding code of the binding friend, and the update response carries the Bind a friend's account. The processor 930 may be specifically configured to send the update request to the server by using the terminal interface 920 when the terminal condition changes; or after receiving the terminal condition information report request sent by the server, And sending, by the terminal interface 920, the update request to the server, where the terminal condition information report request is sent by the server to the terminal when refreshing the buddy list of the user.
由上述实施例可见, 服务器接收终端发送的携带第一绑定信息、 用户的账 号以及密码的登录请求, 在服务器确定密码与预先保存的账号对应的密码相同 后, 根据该用户的账号, 获取该用户的绑定好友的约定码, 服务器判断第一绑 定信息是否与所述绑定好友的约定码匹配, 若第一绑定信息与所述绑定好友的 约定码匹配, 则服务器向终端发送登录响应, 该登录响应携带所述绑定好友的 账号 。 由于本发明实施例中用户可以为某些好友设置约定码, 使得这些好友 成为绑定好友, 因此用户在登录服务器时, 通过向服务器上传当前条件下的绑 定信息, 从而使服务器在绑定信息与绑定好友的约定码匹配时, 才下发该绑定 好友的账号至终端, 由此使得用户在不同条件下登录服务器时, 无需额外操作 就可以获取到不同的账号信息, 从而提高用户的即时通信体验。 As shown in the foregoing embodiment, the server receives the login request that is sent by the terminal and carries the first binding information, the user's account, and the password. After the server determines that the password is the same as the password corresponding to the pre-stored account, the server obtains the password according to the account of the user. The binding code of the binding friend of the user, the server determines whether the first binding information matches the binding code of the binding friend, and if the first binding information matches the binding code of the binding friend, the server sends the binding code to the terminal. Login response, the login response carries the account of the bound friend. In the embodiment of the present invention, the user can set the appointment code for some friends, so that the friends become binding friends. Therefore, when the user logs in to the server, the user binds the binding information under the current conditions to the server, so that the server binds the information. When the binding code of the binding friend is matched, the account of the binding friend is delivered to the terminal, so that the user does not need to perform additional operations when logging in to the server under different conditions. You can get different account information, thus improving the user's instant messaging experience.
通过以上的实施方式的描述可知, 所属领域的技术人员可以清楚地了解到 本发明可以用硬件实现, 或固件实现, 或它们的组合方式来实现。 当使用软件 实现时, 可以将上述功能存储在计算机可读介质中或作为计算机可读介质上的 一个或多个指令或代码进行传输。 计算机可读介质包括计算机存储介质和通信 介质, 其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何 介质。 存储介质可以是计算机能够存取的任何可用介质。 以此为例但不限于: 计算机可读介质可以包括 RAM、 ROM, EEPROM、 CD-ROM或其他光盘存储、 磁盘存储介质或者其他磁存储设备、 或者能够用于携带或存储具有指令或数据 结构形式的期望的程序代码并能够由计算机存取的任何其他介质。 此外。 任何 连接可以适当的成为计算机可读介质。 例如, 如果软件是使用同轴电缆、 光纤 光缆、 双绞线、 数字用户线(DSL )或者诸如红外线、 无线电和微波之类的无 线技术从网站、 服务器或者其他远程源传输的, 那么同轴电缆、 光纤光缆、 双 绞线、 DSL或者诸如红外线、 无线和微波之类的无线技术包括在所属介质的定 影中。 如本发明所使用的, 盘(Disk )和碟(disc ) 包括压缩光碟(CD ) 、 激 光碟、 光碟、 数字通用光碟(DVD ) 、 软盘和蓝光光碟, 其中盘通常磁性的复 制数据, 而碟则用激光来光学的复制数据。 上面的组合也应当包括在计算机可 读介质的保护范围之内。  It will be apparent to those skilled in the art that the present invention can be implemented in hardware, firmware implementation, or a combination thereof, as will be apparent to those skilled in the art. When implemented in software, the functions described above may be stored in or transmitted as one or more instructions or code on a computer readable medium. Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another. A storage medium may be any available media that can be accessed by a computer. By way of example and not limitation, computer readable media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage media or other magnetic storage device, or can be used for carrying or storing in the form of an instruction or data structure. The desired program code and any other medium that can be accessed by the computer. Also. Any connection may suitably be a computer readable medium. For example, if the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable , fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwaves are included in the fixing of the associated media. As used in the present invention, a disk and a disc include a compact disc (CD), a laser disc, a compact disc, a digital versatile disc (DVD), a floppy disc, and a Blu-ray disc, wherein the disc is usually magnetically copied, and the disc is The laser is used to optically replicate the data. Combinations of the above should also be included within the scope of protection of computer readable media.
需要说明的是, 本说明书中的各个实施例均采用递进的方式描述, 各个实 施例之间相同相似的部分互相参见即可, 每个实施例重点说明的都是与其他实 施例的不同之处。尤其,对于装置实施例而言, 由于其基本相似于方法实施例, 所以描述得比较筒单, 各单元具体功能的执行过程参见方法实施例的部分说明 即可。 以上所描述的装置实施例仅仅是示意性的, 其中作为分离部件说明的单 元可以是或者也可以不是物理上分开的, 作为单元显示的部件可以是或者也可 以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目 的。 本领域普通技术人员在不付出创造性劳动的情况下, 即可以理解并实施。 It is to be noted that the various embodiments in the present specification are described in a progressive manner, and the same similar parts between the various embodiments may be referred to each other, and each embodiment focuses on different embodiments from other embodiments. At the office. In particular, for the device embodiment, since it is basically similar to the method embodiment, it is described as a comparison, and the execution process of each unit specific function can be referred to the description of the method embodiment. The device embodiments described above are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located in one place. , or it can be distributed to multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without any creative effort.
总之, 以上所述仅为本发明技术方案的较佳实施例而已, 并非用于限定本 发明的保护范围。凡在本发明的精神和原则之内, 所作的任何修改、等同替换、 改进等, 均应包含在本发明的保护范围之内。  In summary, the above description is only a preferred embodiment of the technical solution of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Claims

权 利 要 求 书 Claim
1、 一种实现即时通信的方法, 其特征在于, 所述方法包括:  A method for implementing instant messaging, the method comprising:
服务器接收终端发送的登录请求, 所述登录请求携带第一绑定信息、 用户 的账号以及密码;  The server receives the login request sent by the terminal, where the login request carries the first binding information, the account number of the user, and the password;
在所述服务器确定所述密码与预先保存的所述账号对应的密码相同后, 所 述服务器根据所述用户的账号, 获取所述用户的绑定好友的约定码;  After the server determines that the password is the same as the password corresponding to the pre-stored account, the server obtains the binding code of the binding friend of the user according to the account of the user;
所述服务器判断所述第一绑定信息是否与所述绑定好友的约定码匹配; 若所述第一绑定信息与所述绑定好友的约定码匹配, 则所述服务器向所述 终端发送登录响应, 所述登录响应携带所述绑定好友的账号。  Determining, by the server, whether the first binding information matches the binding code of the binding friend; if the first binding information matches the binding code of the binding friend, the server is to the terminal Sending a login response, the login response carrying the account of the bound friend.
2、 如权利要求 1 所述的方法, 其特征在于, 所述服务器判断所述第一绑 定信息是否与所述绑定好友的约定码匹配, 包括:  The method according to claim 1, wherein the server determines whether the first binding information matches the binding code of the binding friend, including:
所述服务器判断所述第一绑定信息是否包含在所述绑定好友的约定码之 内, 若所述第一绑定信息包含在所述绑定好友的约定码之内, 则所述服务器确 定所述第一绑定信息与所述约定码匹配。  The server determines whether the first binding information is included in the binding code of the binding friend, and if the first binding information is included in the binding code of the binding friend, the server Determining that the first binding information matches the appointment code.
3、 如权利要求 2所述的方法, 其特征在于, 所述第一绑定信息包括至少 一种以下数据项: 所述终端的设备标识, 所述用户的移动号码标识, 所述终端 发送所述登录请求的时刻, 所述终端发送所述登录请求时所在地理位置的信 息; 所述约定码包括至少一种以下数据项: 设备标识, 移动号码标识, 预设的 时间段信息, 预设的地理位置范围信息;  The method according to claim 2, wherein the first binding information includes at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, and a terminal sending station. The information about the geographic location of the terminal when the login request is sent; the appointment code includes at least one of the following data items: device identifier, mobile number identifier, preset time period information, preset Geographic location information;
贝 |J ,所述服务器判断所述第一绑定信息是否包含在所述约定码之内, 包括: 若所述第一绑定信息中数据项的数目与所述约定码中数据项的数目相同, 且所述第一绑定信息中的每一数据项均在所述约定码中与所述每一数据项对 应的数据项之内, 则所述服务器确定所述第一绑定信息包含在所述约定码之 内。  If the server determines whether the first binding information is included in the appointment code, the method includes: if the number of data items in the first binding information and the number of data items in the appointment code If the data item in the first binding information is within the data item corresponding to each data item in the agreement code, the server determines that the first binding information includes Within the agreed code.
4、 如权利要求 1至 3任意一项所述的方法, 其特征在于, 所述服务器向 所述终端发送登录响应后, 所述方法还包括: The method according to any one of claims 1 to 3, wherein the server After the terminal sends the login response, the method further includes:
所述服务器接收所述终端发送的更新请求, 所述更新请求携带第二绑定信 息;  Receiving, by the server, an update request sent by the terminal, where the update request carries second binding information;
所述服务器判断所述第二绑定信息是否与所述绑定好友的约定码匹配; 若所述第二绑定信息与所述绑定好友的约定码匹配, 则所述服务器向所述 终端发送更新响应, 所述更新响应携带所述绑定好友的账号。  Determining, by the server, whether the second binding information matches the binding code of the binding friend; if the second binding information matches the binding code of the binding friend, the server is to the terminal Sending an update response, the update response carrying the account of the bound friend.
5、 如权利要求 4所述的方法, 其特征在于, 所述服务器接收所述终端发 送的更新请求, 包括:  The method of claim 4, wherein the receiving, by the server, the update request sent by the terminal comprises:
所述服务器接收所述终端在终端条件发生变化时向所述服务器发送的所 述更新请求; 或者,  Receiving, by the server, the update request sent by the terminal to the server when a terminal condition changes; or
所述服务器接收所述终端根据所述服务器发送的终端条件信息上报请求 返回的所述更新请求, 所述终端条件信息上报请求是所述服务器在刷新所述用 户的好友列表时向所述终端发送的。  Receiving, by the server, the update request returned by the terminal according to the terminal condition information report request sent by the server, where the terminal condition information report request is sent by the server to the terminal when refreshing the friend list of the user of.
6、 如权利要求 1至 5任意一项所述的方法, 其特征在于, 所述用户的密 码为普通密码。  The method according to any one of claims 1 to 5, wherein the password of the user is a normal password.
7、 一种实现即时通信的方法, 其特征在于, 所述方法包括:  7. A method for implementing instant messaging, the method comprising:
终端向服务器发送登录请求, 所述登录请求中携带第一绑定信息、 用户的 账号以及密码;  The terminal sends a login request to the server, where the login request carries the first binding information, the user's account number, and the password;
所述终端接收所述服务器发送的登录响应, 所述登录响应是所述服务器在 确定所述密码与预先保存的所述账号对应的密码相同后, 当所述第一绑定信息 端发送的, 所述登录响应中携带所述绑定好友的账号。  The terminal receives the login response sent by the server, and the login response is sent by the first binding information end after the server determines that the password is the same as the password corresponding to the account that is saved in advance. The login response carries the account of the bound friend.
8、 如权利要求 7所述的方法, 其特征在于, 所述第一绑定信息包括至少 一种以下数据项: 所述终端的设备标识, 所述用户的移动号码标识, 所述终端 发送所述登录请求的时刻, 所述终端发送所述登录请求时所在地理位置的信 息; 所述约定码包括至少一种以下数据项: 设备标识, 移动号码标识, 预设的 时间段信息, 预设的地理位置范围信息。 The method according to claim 7, wherein the first binding information includes at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, and a terminal sending station. At the moment of the login request, the location of the location where the terminal sends the login request The agreement code includes at least one of the following data items: a device identifier, a mobile number identifier, a preset time period information, and a preset geographic location range information.
9、 如权利要求 7或 8所述的方法, 其特征在于, 所述终端接收所述服务 器发送的登录响应后, 所述方法还包括:  The method according to claim 7 or 8, wherein, after the terminal receives the login response sent by the server, the method further includes:
所述终端向所述服务器发送更新请求, 所述更新请求携带第二绑定信息; 接收所述服务器发送的更新响应, 所述更新响应是所述服务器在所述第二 绑定信息与所述绑定好友的约定码匹配时, 向所述终端发送的, 所述更新响应 携带所述绑定好友的账号。  Sending, by the terminal, an update request to the server, where the update request carries second binding information, and receiving an update response sent by the server, where the update response is that the server is in the second binding information and the When the binding code of the binding friend matches, the update response is sent to the terminal, and the update response carries the account of the binding friend.
10、 如权利要求 9所述的方法, 其特征在于, 所述终端向所述服务器发送 更新请求, 包括:  The method of claim 9, wherein the sending, by the terminal, the update request to the server includes:
所述终端在终端条件发生变化时向所述服务器发送所述更新请求; 或者, 所述终端在接收到所述服务器发送的终端条件信息上报请求后, 向所述服 务器发送所述更新请求, 所述终端条件信息上报请求是所述服务器在刷新所述 用户的好友列表时向所述终端发送的。  The terminal sends the update request to the server when the terminal condition changes; or the terminal sends the update request to the server after receiving the terminal condition information report request sent by the server, The terminal condition information reporting request is sent by the server to the terminal when refreshing the buddy list of the user.
11、 如权利要求 7至 10任意一项所述的方法, 其特征在于, 所述用户的 密码为普通密码。  The method according to any one of claims 7 to 10, characterized in that the password of the user is a normal password.
12、 一种实现即时通信的装置, 其特征在于, 所述装置包括:  12. An apparatus for implementing instant messaging, wherein the apparatus comprises:
接收单元, 用于接收终端发送的登录请求, 所述登录请求携带第一绑定信 息、 用户的账号以及密码;  a receiving unit, configured to receive a login request sent by the terminal, where the login request carries the first binding information, the user account, and a password;
获取单元, 用于在确定所述密码与预先保存的所述账号对应的密码相同 后, 根据所述用户的账号, 获取所述用户的绑定好友的约定码;  An obtaining unit, configured to obtain an appointment code of the binding friend of the user according to the account of the user after determining that the password is the same as the password corresponding to the account that is saved in advance;
匹配单元, 用于判断所述第一绑定信息是否与所述绑定好友的约定码匹 配;  a matching unit, configured to determine whether the first binding information matches the binding code of the binding friend;
发送单元, 用于在所述第一绑定信息与所述绑定好友的约定码匹配时, 向 所述终端发送登录响应, 所述登录响应携带所述绑定好友的账号。 And a sending unit, configured to send a login response to the terminal when the first binding information matches the binding code of the binding friend, where the login response carries the account of the binding friend.
13、 如权利要求 12所述的装置, 其特征在于, 所述匹配单元具体用于判 断所述第一绑定信息是否包含在所述绑定好友的约定码之内, 若所述第一绑定 信息包含在所述绑定好友的约定码之内, 则确定所述第一绑定信息与所述约定 码匹配。 The device according to claim 12, wherein the matching unit is specifically configured to determine whether the first binding information is included in an appointment code of the binding friend, if the first binding The determining information is included in the binding code of the binding friend, and then determining that the first binding information matches the appointment code.
14、 如权利要求 13所述的装置, 其特征在于,  14. Apparatus according to claim 13 wherein:
所述接收单元接收到的第一绑定信息包括至少一种以下数据项: 所述终端 的设备标识, 所述用户的移动号码标识, 所述终端发送所述登录请求的时刻, 所述终端发送所述登录请求时所在地理位置的信息;  The first binding information received by the receiving unit includes at least one of the following data items: a device identifier of the terminal, a mobile number identifier of the user, and a time when the terminal sends the login request, where the terminal sends Information about the geographical location of the login request;
所述获取单元获取的所述绑定好友的约定码包括至少一种以下数据项: 设 备标识, 移动号码标识, 预设的时间段信息, 预设的地理位置范围信息; 贝' J , 所述匹配单元具体用于在所述第一绑定信息中数据项的数目与所述约 定码中数据项的数目相同, 且所述第一绑定信息中的每一数据项均在所述约定 码中与所述每一数据项对应的数据项之内时, 确定所述第一绑定信息包含在所 述约定码之内。  The binding code of the binding friend acquired by the acquiring unit includes at least one of the following data items: a device identifier, a mobile number identifier, a preset time period information, and a preset geographic location range information; The matching unit is specifically configured to: in the first binding information, the number of data items is the same as the number of data items in the appointment code, and each data item in the first binding information is in the agreement code And determining, in the data item corresponding to each of the data items, that the first binding information is included in the agreement code.
15、 如权利要求 12至 14任意一项所述的装置, 其特征在于,  15. Apparatus according to any one of claims 12 to 14 wherein:
所述接收单元, 还用于接收所述终端发送的更新请求, 所述更新请求携带 第二绑定信息;  The receiving unit is further configured to receive an update request sent by the terminal, where the update request carries second binding information;
所述匹配单元, 还用于判断所述第二绑定信息是否与所述绑定好友的约定 码匹配;  The matching unit is further configured to determine whether the second binding information matches an agreed code of the binding friend;
所述发送单元, 还用于在所述第二绑定信息与所述绑定好友的约定码匹配 时, 向所述终端发送更新响应, 所述更新响应携带所述绑定好友的账号。  The sending unit is further configured to: when the second binding information matches the binding code of the binding friend, send an update response to the terminal, where the update response carries the account of the binding friend.
16、 如权利要求 15所述的装置, 其特征在于,  16. Apparatus according to claim 15 wherein:
所述接收单元, 具体用于接收所述终端在终端条件发生变化时向所述服务 器发送的所述更新请求; 或者, 接收所述终端根据所述服务器发送的终端条件 信息上报请求返回的所述更新请求, 所述终端条件信息上报请求是所述服务器 在刷新所述用户的好友列表时向所述终端发送的。 The receiving unit is specifically configured to receive the update request that is sent by the terminal to the server when the terminal condition changes; or, the receiving the terminal returns the request according to the terminal condition information report request sent by the server An update request, the terminal condition information reporting request is the server Sent to the terminal when refreshing the buddy list of the user.
17、 一种实现即时通信的装置, 其特征在于, 所述装置包括:  17. An apparatus for implementing instant messaging, wherein the apparatus comprises:
发送单元, 用于向服务器发送登录请求, 所述登录请求中携带第一绑定信 息、 用户的账号以及密码;  a sending unit, configured to send a login request to the server, where the login request carries the first binding information, the user account, and the password;
接收单元, 用于接收所述服务器发送的登录响应, 所述登录响应是所述服 务器在确定所述密码与预先保存的所述账号对应的密码相同后, 当所述第一绑 所述终端发送的, 所述登录响应中携带所述绑定好友的账号。  a receiving unit, configured to receive a login response sent by the server, where the login response is that the server sends the first binding to the terminal after determining that the password is the same as a password corresponding to the account that is saved in advance. The login response carries the account of the bound friend.
18、 如权利要求 17所述的装置, 其特征在于,  18. Apparatus according to claim 17 wherein:
所述发送单元, 还用于向所述服务器发送更新请求, 所述更新请求携带第 二绑定信息;  The sending unit is further configured to send an update request to the server, where the update request carries second binding information;
所述接收单元, 还用于接收所述服务器发送的更新响应, 所述更新响应是 所述服务器在所述第二绑定信息与所述绑定好友的约定码匹配时, 向所述终端 发送的, 所述更新响应携带所述绑定好友的账号。  The receiving unit is further configured to receive an update response sent by the server, where the update response is sent by the server to the terminal when the second binding information matches the binding code of the binding friend. The update response carries the account of the bound friend.
19、 如权利要求 18所述的装置, 其特征在于,  19. Apparatus according to claim 18, wherein:
所述发送单元, 具体用于在终端条件发生变化时向所述服务器发送所述更 新请求; 或者, 在接收到所述服务器发送的终端条件信息上报请求后, 向所述 服务器发送所述更新请求, 所述终端条件信息上报请求是所述服务器在刷新所 述用户的好友列表时向所述终端发送的。  The sending unit is specifically configured to send the update request to the server when the terminal condition changes; or send the update request to the server after receiving the terminal condition information report request sent by the server The terminal condition information reporting request is sent by the server to the terminal when refreshing the buddy list of the user.
PCT/CN2013/080718 2012-12-28 2013-08-02 Method and device for achieving instant communication WO2014101421A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210586422.2A CN103067260B (en) 2012-12-28 2012-12-28 Realize method and the device of instant messaging
CN201210586422.2 2012-12-28

Publications (1)

Publication Number Publication Date
WO2014101421A1 true WO2014101421A1 (en) 2014-07-03

Family

ID=48109728

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/080718 WO2014101421A1 (en) 2012-12-28 2013-08-02 Method and device for achieving instant communication

Country Status (2)

Country Link
CN (1) CN103067260B (en)
WO (1) WO2014101421A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067260B (en) * 2012-12-28 2015-09-09 华为技术有限公司 Realize method and the device of instant messaging
CN103746958B (en) * 2013-11-18 2018-05-29 广州多益网络股份有限公司 A kind of method and device logged in limited time
HK1197632A2 (en) * 2014-08-08 2015-01-30 創萬科技有限公司 An instantaneous communication system
CN105404800B (en) * 2015-10-28 2020-06-16 腾讯科技(深圳)有限公司 Account information authorization method, terminal and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719880A (en) * 2009-11-13 2010-06-02 东南大学 Fusion system for multi-protocol multi-account instant messages and working method thereof
CN102075552A (en) * 2009-11-19 2011-05-25 盛大计算机(上海)有限公司 System and method for synchronizing information between electronic book reader and Internet
WO2012088933A1 (en) * 2010-12-27 2012-07-05 腾讯科技(深圳)有限公司 Method, terminal and server for adding user association relationship
CN102739877A (en) * 2011-03-31 2012-10-17 联想(北京)有限公司 End user information sharing method, calling method, and server
CN103067260A (en) * 2012-12-28 2013-04-24 华为技术有限公司 Method and device for achieving instant communication

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6750881B1 (en) * 1997-02-24 2004-06-15 America Online, Inc. User definable on-line co-user lists
CN1842063A (en) * 2005-03-30 2006-10-04 广州市领华科技有限公司 Instant communication method
CN101778058A (en) * 2010-01-05 2010-07-14 深圳中兴网信科技有限公司 Acquisition method of contact list
KR101651130B1 (en) * 2010-01-25 2016-08-25 엘지전자 주식회사 Mobile terminal and method for controlling the same
CN102347912B (en) * 2010-08-02 2014-11-05 腾讯科技(深圳)有限公司 Method and system for obtaining dynamic update in instant messaging software
CN102752313B (en) * 2012-07-18 2015-07-29 北京开心人信息技术有限公司 The method of the many identity of user and device in a kind of JICQ

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719880A (en) * 2009-11-13 2010-06-02 东南大学 Fusion system for multi-protocol multi-account instant messages and working method thereof
CN102075552A (en) * 2009-11-19 2011-05-25 盛大计算机(上海)有限公司 System and method for synchronizing information between electronic book reader and Internet
WO2012088933A1 (en) * 2010-12-27 2012-07-05 腾讯科技(深圳)有限公司 Method, terminal and server for adding user association relationship
CN102739877A (en) * 2011-03-31 2012-10-17 联想(北京)有限公司 End user information sharing method, calling method, and server
CN103067260A (en) * 2012-12-28 2013-04-24 华为技术有限公司 Method and device for achieving instant communication

Also Published As

Publication number Publication date
CN103067260B (en) 2015-09-09
CN103067260A (en) 2013-04-24

Similar Documents

Publication Publication Date Title
JP6463463B2 (en) Service processing method, apparatus, and server
EP3640849B1 (en) Electronic device and method of registering personal cloud apparatus in user portal server thereof
JP6135963B2 (en) Method, terminal, server, and system for sharing a virtual SIM card among a plurality of terminals
CN110351269B (en) Method for logging in open platform through third-party server
CN108540433B (en) User identity verification method and device
US10334397B2 (en) Interaction tracking and organizing system
CN108337210B (en) Equipment configuration method, device and system
US20140019582A1 (en) Method for processing invitation information and service server, mobile communication terminal and computer-readable recording medium for performing the same
JP2019519174A (en) Method and entity for terminating a subscription
CN102467723A (en) System and method for providing recommendations to a user in a viewing social network
WO2017113359A1 (en) Cloud operation interface sharing method, related device and system
TW201203140A (en) Online service providing system, method, server and mobile device thereof, and computer program product
EP2684337A1 (en) System and method for accesssing a device having an assigned network address
JP6420476B2 (en) Electronic device configuration for wireless communication
KR20130085509A (en) Apparatus and method for athentication for using application
US20210392570A1 (en) Maintaining access to services via sim card
US20150046918A1 (en) Application Distribution Method, Terminal, and Server
CN105722072A (en) Business authorization method, device, system and router
WO2014101421A1 (en) Method and device for achieving instant communication
CN107087293B (en) Access method, terminal and server
US11206699B2 (en) Registering network devices using known host devices
EP2643773A1 (en) Method and arrangement for providing a service
KR101231203B1 (en) System and method for network communicating between a communication device and information device
US11259340B2 (en) Management of a home gateway with mobile connectivity to a wide area network
CN110098933B (en) Automatic identity authentication method and system for mobile phone application

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13868701

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13868701

Country of ref document: EP

Kind code of ref document: A1