CN111278000A - Method, device, terminal and storage medium for binding mobile phone number - Google Patents

Method, device, terminal and storage medium for binding mobile phone number Download PDF

Info

Publication number
CN111278000A
CN111278000A CN202010090706.7A CN202010090706A CN111278000A CN 111278000 A CN111278000 A CN 111278000A CN 202010090706 A CN202010090706 A CN 202010090706A CN 111278000 A CN111278000 A CN 111278000A
Authority
CN
China
Prior art keywords
sim
mobile phone
phone number
terminal
binding
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202010090706.7A
Other languages
Chinese (zh)
Other versions
CN111278000B (en
Inventor
朱忠磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010090706.7A priority Critical patent/CN111278000B/en
Publication of CN111278000A publication Critical patent/CN111278000A/en
Application granted granted Critical
Publication of CN111278000B publication Critical patent/CN111278000B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/183Processing at user equipment or user record carrier
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/20Transfer of user or subscriber data
    • H04W8/205Transfer to or from user equipment or user record carrier

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a method, a device, a terminal and a storage medium for binding a mobile phone number, and belongs to the field of mobile terminals. The method comprises the following steps: determining a first SIM from at least two SIMs in the terminal, wherein the first SIM has short message transceiving capacity; generating a binding request according to the user account and a first mobile phone number corresponding to the first SIM, wherein the binding request is used for requesting to bind the user account and the first mobile phone number; a binding request is sent to the server. The invention determines the first SIM with short message transceiving capacity through the terminal, and generates the binding request according to the user account and the mobile phone number corresponding to the first SIM, thereby ensuring the success rate of the binding process and saving time.

Description

用于绑定手机号码的方法、装置、终端及存储介质Method, device, terminal and storage medium for binding mobile phone number

本申请是申请号为201710444089.4、申请日为2017年06月13日、发明名称为“用于绑定手机号码的方法、装置、终端及存储介质”的发明专利的分案申请。This application is a divisional application for an invention patent with an application number of 201710444089.4, an application date of June 13, 2017, and an invention title of "Method, Device, Terminal and Storage Medium for Binding Mobile Phone Numbers".

技术领域technical field

本发明实施例涉及终端领域,特别涉及一种用于绑定手机号码的方法、装置、终端及存储介质。Embodiments of the present invention relate to the field of terminals, and in particular, to a method, device, terminal and storage medium for binding a mobile phone number.

背景技术Background technique

在终端中,很多应用程序都需要为用户帐号绑定一个手机号码,通过该手机号码实现验证码接收功能、短信息(Short Message,SMS)推送功能、远程控制功能等附加功能。In the terminal, many applications need to bind a mobile phone number to the user account, and additional functions such as verification code reception function, short message (Short Message, SMS) push function, and remote control function can be realized through the mobile phone number.

相关技术中,为用户帐号绑定手机号码的流程通常为:应用程序显示注册用户界面,该注册用户界面上提供有手机号码输入框、获取验证码按钮、验证码输入框和提交按钮;用户在手机号码输入框中输入手机号码,并且点击验证码获取按钮;应用程序将手机号码发送至服务器,服务器向该手机号码发送一个携带有验证码的短信息;用户在查看短信息后,将验证码输入验证码输入框,并且点击提交按钮;应用程序将用户帐号、手机号码和验证码发送给服务器,服务器在验证手机号码和验证码匹配时,将用户帐号和手机号码之间建立绑定关系。In the related art, the process of binding a mobile phone number to a user account is usually as follows: the application program displays a registration user interface, and the registration user interface is provided with a mobile phone number input box, a button for obtaining verification code, an input box for verification code and a submit button; Enter the mobile phone number in the mobile phone number input box, and click the verification code acquisition button; the application sends the mobile phone number to the server, and the server sends a short message with the verification code to the mobile phone number; after the user checks the short message, the verification code Enter the verification code input box, and click the submit button; the application sends the user account, mobile phone number and verification code to the server, and the server establishes a binding relationship between the user account and the mobile phone number when verifying that the mobile phone number matches the verification code.

由于终端上可能设置有多张用户身份识别模块(Subscriber Identity Module,SIM),一些SIM为不具有短信息收发能力的SIM,比如仅支持数据网络的SIM卡或者短期内有效的虚拟SIM,用户有可能会将这些不具有短信息收发能力的SIM对应的手机号码填入至手机号码输入框导致绑定失败,从而需要重新开始另一次绑定过程,从而浪费了时间和较多的无用操作。Since there may be multiple Subscriber Identity Modules (SIMs) installed on the terminal, some SIMs are SIMs that do not have the ability to send and receive short messages, such as SIM cards that only support data networks or virtual SIMs that are valid in a short period of time. The mobile phone numbers corresponding to these SIMs that do not have the ability to send and receive short messages may be filled into the mobile phone number input box, causing the binding to fail, so that another binding process needs to be restarted, which wastes time and many useless operations.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供了一种用于绑定手机号码的方法、装置、终端及存储介质,能够解决用户在绑定过程输入不具有短信息收发能力的SIM时,导致绑定失败而重新另一次绑定,从而浪费了时间和较多无用操作的问题。所述技术方案如下:Embodiments of the present invention provide a method, a device, a terminal and a storage medium for binding a mobile phone number, which can solve the problem that when a user inputs a SIM that does not have the ability to send and receive short messages during the binding process, the binding fails and the user needs to retry another time. Binding, which wastes time and more useless operations. The technical solution is as follows:

第一方面,本申请实施例提供了一种用于绑定手机号码的方法,所述方法包括:In a first aspect, an embodiment of the present application provides a method for binding a mobile phone number, the method comprising:

从终端内的至少两个用户身份识别模块SIM中确定出第一SIM,所述第一SIM具有短信息收发能力;Determine a first SIM from at least two subscriber identity modules SIM in the terminal, where the first SIM has the ability to send and receive short messages;

根据用户帐号和所述第一SIM对应的第一手机号码生成绑定请求,所述绑定请求用于请求将所述用户帐号和所述第一手机号码进行绑定;Generate a binding request according to the user account and the first mobile phone number corresponding to the first SIM, where the binding request is used to request to bind the user account and the first mobile phone number;

向服务器发送所述绑定请求。The binding request is sent to the server.

在一个可选的实施例中,所述从终端内的至少两个用户身份识别模块SIM中确定出第一SIM,包括:In an optional embodiment, the determining of the first SIM from at least two subscriber identity modules SIM in the terminal includes:

通过所述终端的操作系统提供的广播消息确定初级候选SIM,所述初级候选SIM是处于有效状态的SIM;Determine a primary candidate SIM through a broadcast message provided by the operating system of the terminal, where the primary candidate SIM is a SIM in a valid state;

通过所述操作系统提供的函数接口从所述初级候选SIM中确定出二级候选SIM,所述二级候选SIM是处于有效状态且不属于虚拟卡的SIM;Determine secondary candidate SIMs from the primary candidate SIMs through a function interface provided by the operating system, where the secondary candidate SIMs are SIMs that are in a valid state and do not belong to a virtual card;

根据所述二级候选SIM确定所述第一SIM。The first SIM is determined from the secondary candidate SIMs.

在一个可选的实施例中,所述根据所述二级候选SIM确定所述第一SIM,包括:In an optional embodiment, the determining the first SIM according to the secondary candidate SIM includes:

当所述二级候选SIM为至少两个时,获取每个所述二级候选SIM在历史时间段内的来电通话时长;When there are at least two secondary candidate SIMs, obtain the call duration of each secondary candidate SIM in a historical time period;

将具有最大来电通话时长的所述二级候选SIM确定为所述第一SIM。The secondary candidate SIM with the largest incoming call duration is determined as the first SIM.

在一个可选的实施例中,所述根据所述二级候选SIM确定为所述第一SIM,包括:In an optional embodiment, the determining according to the secondary candidate SIM as the first SIM includes:

当所述二级候选SIM为至少两个时,获取每个所述二级候选SIM在历史时间段内的服务短信接收次数;When the number of secondary candidate SIMs is at least two, acquiring the number of service short messages received by each secondary candidate SIM within a historical time period;

将具有最大服务短信接收次数的所述二级候选SIM确定为所述第一SIM。The secondary candidate SIM with the maximum number of times of receiving the service short message is determined as the first SIM.

在一个可选的实施例中,所述根据所述二级候选SIM确定为所述第一SIM,包括:In an optional embodiment, the determining according to the secondary candidate SIM as the first SIM includes:

当所述二级候选SIM为至少两个时,通过号码服务器获取每个所述二级候选SIM的注册时间;When there are at least two secondary candidate SIMs, obtain the registration time of each secondary candidate SIM through the number server;

将具有最早注册时间的所述二级候选SIM确定为所述第一SIM。The secondary candidate SIM with the earliest registration time is determined as the first SIM.

在一个可选的实施例中,所述向服务器发送所述绑定请求之后,还包括:In an optional embodiment, after the sending the binding request to the server, the method further includes:

当所述第一SIM失效时,根据所述用户帐号和所述第一手机号码生成解绑请求,所述解绑请求用于请求将所述用户帐号与所述第一手机号码解除绑定;When the first SIM is invalid, generating an unbinding request according to the user account and the first mobile phone number, where the unbinding request is used to request to unbind the user account and the first mobile phone number;

向所述服务器发送所述解绑请求。Send the unbinding request to the server.

在一个可选的实施例中,所述向服务器发送所述绑定请求之后,还包括:In an optional embodiment, after the sending the binding request to the server, the method further includes:

当所述第一SIM失效时,确定第二SIM,所述第二SIM具有短信息收发能力;When the first SIM fails, determine the second SIM, and the second SIM has the ability to send and receive short messages;

根据所述用户帐号和所述第二SIM对应的第二手机号码生成更新请求,所述更新请求用于请求将所述绑定关系中的所述第一手机号码更新为所述第二手机号码;An update request is generated according to the user account and the second mobile phone number corresponding to the second SIM, where the update request is used to request to update the first mobile phone number in the binding relationship to the second mobile phone number ;

向所述服务器发送所述更新请求。The update request is sent to the server.

第二方面,本申请实施例提供了一种用于绑定手机号码的装置,所述装置包括:In a second aspect, an embodiment of the present application provides an apparatus for binding a mobile phone number, the apparatus comprising:

确定模块,用于从终端内的至少两个用户身份识别模块SIM中确定出第一SIM,所述第一SIM具有短信息收发能力;a determining module, configured to determine a first SIM from at least two subscriber identity identification modules SIM in the terminal, where the first SIM has the ability to send and receive short messages;

生成模块,用于根据用户帐号和所述第一SIM对应的第一手机号码生成绑定请求,所述绑定请求用于请求将所述用户帐号和所述第一手机号码进行绑定;a generating module, configured to generate a binding request according to the user account and the first mobile phone number corresponding to the first SIM, where the binding request is used to request to bind the user account and the first mobile phone number;

发送模块,用于向服务器发送所述绑定请求。A sending module, configured to send the binding request to the server.

在一个可选的实施例中,所述确定模块,用于通过所述终端的操作系统提供的广播消息确定初级候选SIM,所述初级候选SIM是处于有效状态的SIM;通过所述操作系统提供的函数接口从所述初级候选SIM中确定出二级候选SIM,所述二级候选SIM是处于有效状态且不属于虚拟卡的SIM;根据所述二级候选SIM确定所述第一SIM。In an optional embodiment, the determining module is configured to determine a primary candidate SIM through a broadcast message provided by an operating system of the terminal, where the primary candidate SIM is a SIM in a valid state; The function interface of , determines secondary candidate SIMs from the primary candidate SIMs, and the secondary candidate SIMs are SIMs that are in a valid state and do not belong to a virtual card; the first SIM is determined according to the secondary candidate SIMs.

在一个可选的实施例中,所述确定模块,用于当所述二级候选SIM为至少两个时,获取每个所述二级候选SIM在历史时间段内的来电通话时长;将具有最大来电通话时长的所述二级候选SIM确定为所述第一SIM。In an optional embodiment, the determining module is configured to, when there are at least two secondary candidate SIMs, acquire the call duration of each secondary candidate SIM within a historical time period; The secondary candidate SIM with the maximum incoming call duration is determined as the first SIM.

在一个可选的实施例中,所述确定模块,用于当所述二级候选SIM为至少两个时,获取每个所述二级候选SIM在历史时间段内的服务短信接收次数;将具有最大服务短信接收次数的所述二级候选SIM确定为所述第一SIM。In an optional embodiment, the determining module is configured to acquire, when there are at least two secondary candidate SIMs, the number of times of receiving service short messages for each secondary candidate SIM within a historical time period; The secondary candidate SIM with the maximum number of times of receiving service short messages is determined as the first SIM.

在一个可选的实施例中,所述确定模块,用于当所述二级候选SIM为至少两个时,通过号码服务器获取每个所述二级候选SIM的注册时间;将具有最早注册时间的所述二级候选SIM确定为所述第一SIM。In an optional embodiment, the determining module is configured to obtain the registration time of each of the secondary candidate SIMs through a number server when there are at least two secondary candidate SIMs; The secondary candidate SIM of is determined to be the first SIM.

在一个可选的实施例中,所述生成模块,用于当所述第一SIM失效时,根据所述用户帐号和所述第一手机号码生成解绑请求,所述解绑请求用于请求将所述用户帐号与所述第一手机号码解除绑定;所述发送模块,还用于向所述服务器发送所述解绑请求。In an optional embodiment, the generating module is configured to generate an unbinding request according to the user account and the first mobile phone number when the first SIM is invalid, where the unbinding request is used to request Unbinding the user account from the first mobile phone number; the sending module is further configured to send the unbinding request to the server.

在一个可选的实施例中,所述确定模块,还用于当所述第一SIM失效时,确定第二SIM,所述第二SIM具有短信息收发能力;所述生成模块,还用于根据所述用户帐号和所述第二SIM对应的第二手机号码生成更新请求,所述更新请求用于请求将所述绑定关系中的所述第一手机号码更新为所述第二手机号码;所述发送模块,用于向所述服务器发送所述更新请求。In an optional embodiment, the determining module is further configured to determine a second SIM when the first SIM fails, and the second SIM has the ability to send and receive short messages; the generating module is further configured to An update request is generated according to the user account and the second mobile phone number corresponding to the second SIM, where the update request is used to request to update the first mobile phone number in the binding relationship to the second mobile phone number ; the sending module is configured to send the update request to the server.

第三方面,本申请实施例提供了一种终端,所述终端包括:处理器和存储器,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如上第一方面或第一方面的任意一种可能的实现方式所提供的用于绑定手机号码的方法。In a third aspect, an embodiment of the present application provides a terminal, the terminal includes: a processor and a memory, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to achieve the above The method for binding a mobile phone number provided by the first aspect or any possible implementation manner of the first aspect.

第四方面,本申请实施例提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如上第一方面或第一方面的任意一种可能的实现方式所提供的用于绑定手机号码的方法In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by the processor to implement the first aspect or the first aspect above. A method for binding a mobile phone number provided by any possible implementation manner of one aspect

本发明实施例提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solutions provided in the embodiments of the present invention are:

通过终端确定出具有短信息收发能力的第一SIM,根据用户帐号和第一SIM对应的手机号码来生成绑定请求,所以保证了绑定过程的成功率且节省了时间,另外,由于用户不需要手动输入第一SIM对应的手机号码以及在绑定失败时重新绑定,还能够减少用户的无用操作,从而提高了终端与用户之间的人机交互效率。The first SIM with the ability to send and receive short messages is determined by the terminal, and a binding request is generated according to the user account and the mobile phone number corresponding to the first SIM, so the success rate of the binding process is guaranteed and time is saved. It is necessary to manually input the mobile phone number corresponding to the first SIM and re-bind when the binding fails, which can also reduce the useless operation of the user, thereby improving the human-computer interaction efficiency between the terminal and the user.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.

图1是本发明的一个示例性实施例示出的用于绑定手机号码的系统的结构示意图;1 is a schematic structural diagram of a system for binding a mobile phone number according to an exemplary embodiment of the present invention;

图2是本发明一个示例性实施例提供的用于绑定手机号码的方法的流程图;2 is a flowchart of a method for binding a mobile phone number provided by an exemplary embodiment of the present invention;

图3是本发明另一个示例性实施例提供的用于绑定手机号码的方法的流程图;3 is a flowchart of a method for binding a mobile phone number provided by another exemplary embodiment of the present invention;

图4是本发明一个示例性实施例提供的用于绑定手机号码的方法在具体实施时的界面示意图;4 is a schematic interface diagram of a method for binding a mobile phone number provided by an exemplary embodiment of the present invention during specific implementation;

图5是本发明另一个示例性实施例提供的用于绑定手机号码的方法的子步骤流程图;5 is a sub-step flowchart of a method for binding a mobile phone number provided by another exemplary embodiment of the present invention;

图6是本发明另一个示例性实施例提供的用于绑定手机号码的方法的子步骤流程图;6 is a sub-step flowchart of a method for binding a mobile phone number provided by another exemplary embodiment of the present invention;

图7是本发明另一个示例性实施例提供的用于绑定手机号码的方法的子步骤流程图;7 is a sub-step flowchart of a method for binding a mobile phone number provided by another exemplary embodiment of the present invention;

图8是本发明另一个示例性实施例提供的用于绑定手机号码的装置的框图;8 is a block diagram of an apparatus for binding a mobile phone number provided by another exemplary embodiment of the present invention;

图9是本发明一个示例性实施例提供的终端的框图。FIG. 9 is a block diagram of a terminal provided by an exemplary embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

图1是本发明的一个示例性实施例示出的用于绑定手机号码的系统的结构示意图。该用于绑定手机号码的系统可以是具有通过短信息为终端提供服务的系统,服务包括验证码发送、信息推送和远程控制中的至少一种。该用于绑定手机号码的系统包括:终端120和服务器140。FIG. 1 is a schematic structural diagram of a system for binding a mobile phone number according to an exemplary embodiment of the present invention. The system for binding a mobile phone number may be a system that provides services for terminals through short messages, and the services include at least one of verification code sending, information push and remote control. The system for binding a mobile phone number includes: a terminal 120 and a server 140 .

终端120可以是手机、平板电脑、可穿戴电子设备、电子书阅读器、MP3(MovingPicture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器和膝上型便携计算机等终端。The terminal 120 may be a mobile phone, a tablet computer, a wearable electronic device, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, moving picture expert compression standard audio layer 3) player, an MP4 (Moving Picture Experts Group Audio Layer IV, Motion picture experts compress standard audio layer 4) Terminals such as players and laptops.

可选地,终端120中运行有预定应用程序,该预定应用程序是通过用户帐号为用户提供服务的程序,比如预定应用程序是即时通信程序、系统安全程序、查找手机程序等。在预定应用程序中以用户帐号区分不同的用户,每个用户帐号需要绑定各自对应的手机号码,以便服务器140通过绑定的手机号码向终端120提供服务。可选地,每个用户帐号可以绑定至少一个手机号码。Optionally, the terminal 120 runs a predetermined application program, the predetermined application program is a program that provides services to the user through the user account, for example, the predetermined application program is an instant messaging program, a system security program, a mobile phone search program, and the like. Different users are distinguished by user accounts in the predetermined application, and each user account needs to be bound with its corresponding mobile phone number, so that the server 140 provides services to the terminal 120 through the bound mobile phone number. Optionally, each user account can be bound with at least one mobile phone number.

可选地,终端120通过有线网络或无线网络与服务器140相连以及通信。一方面,服务器140和终端120之间可以通过短信通道进行通信,短信通道是通过终端120上手机号码的短信息服务进行数据收发的通道,通常由移动通信网络中的电路交换域(CircuitSwitching Domain,CS)实现;另一方面,服务器140和终端120之间可以通过数据通道进行通信,数据通道是移动通信网络中的分组交换域(Packet Switching Domain,PS)或无线保真(Wireless Fidelity,WiFi)网络实现的通道。Optionally, the terminal 120 is connected and communicated with the server 140 through a wired network or a wireless network. On the one hand, the server 140 and the terminal 120 can communicate through a short message channel, and the short message channel is a channel for sending and receiving data through the short message service of the mobile phone number on the terminal 120. On the other hand, the server 140 and the terminal 120 can communicate through a data channel, and the data channel is a packet switching domain (Packet Switching Domain, PS) or a wireless fidelity (Wireless Fidelity, WiFi) in the mobile communication network. The network implements the channel.

服务器140是预定应用程序的后台服务器,服务器140可以是一台服务器、多台服务器组成的服务器集群或云计算中心。服务器140具有直接发送短信息和/或接收短信息的功能,或者服务器140具有通过移动运营商提供的短信平台来发送和/或接收短信息的功能。服务器140通过短信息为终端120提供如下功能中的至少一种:通过短信息发送验证码的功能、通过短信息进行信息推送的功能、通过短信息进行远程控制的功能。The server 140 is a background server of a predetermined application program, and the server 140 may be a server, a server cluster composed of multiple servers, or a cloud computing center. The server 140 has the function of directly sending and/or receiving short messages, or the server 140 has the function of sending and/or receiving short messages through the short message platform provided by the mobile operator. The server 140 provides the terminal 120 with at least one of the following functions through the short message: a function of sending a verification code through a short message, a function of pushing information through a short message, and a function of remote control through a short message.

图2是本发明的一个示例性实施例示出的用于绑定手机号码的方法的流程图。本实施例以该方法应用于图1所示的终端120来举例说明。该方法包括:FIG. 2 is a flowchart of a method for binding a mobile phone number according to an exemplary embodiment of the present invention. This embodiment is illustrated by taking the method applied to the terminal 120 shown in FIG. 1 as an example. The method includes:

步骤201,从终端内的至少两个SIM中确定出第一SIM,第一SIM具有短信息收发能力;Step 201, determining a first SIM from at least two SIMs in the terminal, and the first SIM has the ability to send and receive short messages;

目前的终端通常都支持安装两张硬件形态的SIM,还支持安装以软件形态实现的一张或多张SIM,软件形态实现的SIM可以认为是虚拟卡类型的SIM,也称为虚拟SIM。同时,终端中运行有操作系统,终端通过操作系统自动从至少两个SIM中确定出第一SIM,第一SIM具有短信息收发能力。The current terminal usually supports the installation of two SIMs in hardware form, and also supports the installation of one or more SIMs implemented in software form. SIMs implemented in software form can be considered as virtual card type SIMs, also called virtual SIMs. At the same time, the terminal runs an operating system, and the terminal automatically determines the first SIM from the at least two SIMs through the operating system, and the first SIM has the ability to send and receive short messages.

步骤202,根据用户帐号和第一SIM对应的第一手机号码生成绑定请求,绑定请求用于请求将用户帐号和第一手机号码进行绑定;Step 202, generating a binding request according to the user account and the first mobile phone number corresponding to the first SIM, and the binding request is used to request to bind the user account and the first mobile phone number;

终端中运行有预定应用程序,该预定应用程序通过用户帐号为用户提供服务。该用户帐号需要绑定至少一个手机号码。A predetermined application program runs in the terminal, and the predetermined application program provides services for the user through the user account. The user account needs to be bound with at least one mobile phone number.

可选地,该绑定请求中包括用户帐号和第一手机号码。该绑定请求用于请求服务器将用户帐号和第一手机号码进行绑定。Optionally, the binding request includes the user account and the first mobile phone number. The binding request is used to request the server to bind the user account and the first mobile phone number.

步骤203,向服务器发送绑定请求。Step 203, sending a binding request to the server.

可选地,终端通过数据通道向服务器发送绑定请求。Optionally, the terminal sends a binding request to the server through the data channel.

在本实施例提供的方法中,通过终端自动确定出具有短信息收发能力的第一SIM,根据用户帐号和第一SIM对应的手机号码来生成绑定请求,所以保证了绑定过程的成功率且节省了时间,另外,由于用户不需要手动输入第一SIM对应的手机号码以及在绑定失败时重新绑定,还能够减少用户的无用操作,从而提高了终端与用户之间的人机交互效率。In the method provided in this embodiment, the terminal automatically determines the first SIM capable of sending and receiving short messages, and generates a binding request according to the user account and the mobile phone number corresponding to the first SIM, so the success rate of the binding process is guaranteed. And saves time, in addition, because the user does not need to manually input the mobile phone number corresponding to the first SIM and re-bind when the binding fails, it can also reduce the useless operation of the user, thereby improving the human-computer interaction between the terminal and the user. efficiency.

由于终端内的SIM为无效状态时,不具有短信息收发能力;和/或,SIM的类型为虚拟卡时,不具有短信息收发能力,所以终端需要确定出处于有效状态且不为虚拟卡的SIM作为第一SIM,具体参考如下实施例。Since the SIM in the terminal is in an invalid state, it does not have the ability to send and receive short messages; and/or, when the SIM type is a virtual card, it does not have the ability to send and receive short messages, so the terminal needs to determine that it is in a valid state and is not a virtual card. The SIM is used as the first SIM, and the following embodiments are specifically referred to.

图3是本发明的另一个示例性实施例示出的用于绑定手机号码的方法的流程图。本实施例以该方法应用于图1所示的终端120和服务器140来举例说明。该方法包括:FIG. 3 is a flowchart of a method for binding a mobile phone number according to another exemplary embodiment of the present invention. This embodiment is illustrated by taking the method applied to the terminal 120 and the server 140 shown in FIG. 1 as an example. The method includes:

步骤301,终端向服务器发送登录请求,该登录请求中携带有用户帐号和密码;Step 301, the terminal sends a login request to the server, and the login request carries the user account and password;

终端中运行有预定应用程序,该预定应用程序通过用户帐号为用户提供服务。该用户帐号需要绑定至少一个手机号码。A predetermined application program runs in the terminal, and the predetermined application program provides services for the user through the user account. The user account needs to be bound with at least one mobile phone number.

预定应用程序在需要和服务器通信时,使用预先注册的用户帐号和密码生成登录请求,向服务器发送登录请求。When the predetermined application needs to communicate with the server, it generates a login request by using the pre-registered user account and password, and sends the login request to the server.

示意性的,以终端中的预定应用程序是查找手机程序为例,参考图4所示,用户在查找手机程序的登录界面中的输入框41中输入用户帐号zhangsan@xxx.com和密码,然后点击“登录”按钮42后,终端向服务器发送登录请求。Illustratively, taking the predetermined application program in the terminal as an example of finding a mobile phone program, with reference to FIG. 4 , the user enters the user account zhangsan@xxx.com and the password in the input box 41 in the login interface for finding the mobile phone program, and then After clicking the "Login" button 42, the terminal sends a login request to the server.

对应地,服务器接收终端发送的登录请求。Correspondingly, the server receives the login request sent by the terminal.

步骤302,服务器对用户帐号和密码进行验证,并在验证成功后允许本次登录。Step 302, the server verifies the user account and password, and allows this login after the verification is successful.

服务器中存储有用户帐号和正确密码。服务器根据用户帐号查询出正确密码,然后检测接收到的密码是否与正确密码相同,若接收到的密码与正确密码相同,则验证成功并允许本次登录;若接收到的密码与正确密码不相同,则验证失败且不允许本次登录。The user account and correct password are stored in the server. The server queries the correct password according to the user account, and then detects whether the received password is the same as the correct password. If the received password is the same as the correct password, the verification is successful and the login is allowed; if the received password is different from the correct password , the authentication fails and the login is not allowed.

步骤303,终端接收绑定触发操作;Step 303, the terminal receives the binding trigger operation;

用户需要在预定应用程序中为用户帐号绑定手机号码时,在终端上进行绑定触发操作。终端中的预定应用程序接收该绑定触发操作,根据该绑定触发操作所产生的信号开启绑定流程。可选地,绑定触发操作是点击预定应用程序上的虚拟按钮,该虚拟按钮是与绑定过程有关的按钮。When the user needs to bind the mobile phone number to the user account in the predetermined application, the binding trigger operation is performed on the terminal. The predetermined application program in the terminal receives the binding trigger operation, and starts the binding process according to the signal generated by the binding trigger operation. Optionally, the binding triggering operation is clicking a virtual button on a predetermined application, where the virtual button is a button related to the binding process.

结合参考图4所示,终端从登录界面跳转到开通查找手机界面,如果用户希望开通查找设备功能,则在开通查找手机界面点击“开通查找手机”按钮43。该开通过程也可以认为是将用户帐号与手机号码进行绑定的绑定过程。Referring to FIG. 4 , the terminal jumps from the login interface to the mobile phone search interface. If the user wishes to activate the device search function, click the “Activate mobile search” button 43 on the mobile phone search interface. The activation process can also be regarded as a binding process for binding the user account and the mobile phone number.

步骤304,终端通过操作系统提供的广播消息确定初级候选SIM,初级候选SIM是处于有效状态的SIM;Step 304, the terminal determines the primary candidate SIM through the broadcast message provided by the operating system, and the primary candidate SIM is the SIM in a valid state;

终端中的预定应用程序自行通过操作系统确定具有短信息收发能力的第一SIM。The predetermined application program in the terminal automatically determines the first SIM with the ability to send and receive short messages through the operating system.

以操作系统为Android系统为例,Android系统中提供有广播(Broadcast)机制。操作系统会定期通过广播消息向各个应用程序广播一些系统事件,比如:手机开机时向各个应用程序发送一条广播消息、电池的电量发生变化时向各个应用程序发送一条广播消息、时间或时区发生改变时也会向各个应用程序发送一条广播消息、SIM卡插入或拔出或状态变化时也会向各个应用程序发送一条广播消息。Taking the operating system as an Android system as an example, a broadcast (Broadcast) mechanism is provided in the Android system. The operating system periodically broadcasts some system events to various applications through broadcast messages, such as: a broadcast message is sent to each application when the phone is turned on, a broadcast message is sent to each application when the battery level changes, and the time or time zone changes. A broadcast message is also sent to each application when the SIM card is inserted or removed, or a broadcast message is also sent to each application when the state changes.

可选地,终端中的预定应用程序监听操作系统发送的与SIM有关的广播信息,该广播信息中携带有至少一个SIM的状态。其中,SIM的状态采用不同的取值表示,示意性的:Optionally, a predetermined application program in the terminal monitors broadcast information related to the SIM sent by the operating system, and the broadcast information carries the status of at least one SIM. Among them, the status of the SIM is represented by different values, schematically:

状态值=0:No SIM card is available in the device(在终端中不存在可用的SIM卡);Status value=0: No SIM card is available in the device;

状态值=1:Locked:requires the use’s SIM PIN to unlock(锁定:需要用户的SIM PIN码来解锁);Status value = 1: Locked: requires the use's SIM PIN to unlock (locked: requires the user's SIM PIN to unlock);

状态值=2:Locked:requires the use’s SIM PUK to unlock(锁定:需要用户的SIM PUK码来解锁);Status value = 2: Locked: requires the use's SIM PUK to unlock (locked: requires the user's SIM PUK code to unlock);

状态值=3:Locked:requires a network PIN to unlock(锁定:需要网络PIN来解锁)Status value = 3: Locked: requires a network PIN to unlock

状态值=4:Ready(准备完毕);Status value = 4: Ready (ready);

状态值=5:SIM Card is NOT READY(SIM卡未准备完毕);Status value = 5: SIM Card is NOT READY (SIM card is not ready);

状态值=6:SIM Card Error,permanently disabled(SIM卡错误,长期禁用)Status value = 6: SIM Card Error, permanently disabled

终端将状态值=4的SIM确定为初级候选SIM,也即状态值=4的SIM是当前处于有效状态的SIM。如果终端中存在多个SIM,则分别确定每个SIM的状态,进而确定每个SIM是否属于初级候选SIM。The terminal determines the SIM with the status value=4 as the primary candidate SIM, that is, the SIM with the status value=4 is the SIM that is currently in the active state. If there are multiple SIMs in the terminal, the status of each SIM is determined respectively, and then it is determined whether each SIM belongs to the primary candidate SIM.

步骤305,终端通过操作系统提供的函数接口从初级候选SIM中确定出二级候选SIM,二级候选SIM是处于有效状态且不属于虚拟卡的SIM;Step 305, the terminal determines the secondary candidate SIM from the primary candidate SIM through the function interface provided by the operating system, and the secondary candidate SIM is a SIM that is in a valid state and does not belong to the virtual card;

虚拟卡也称虚拟SIM卡,虚拟卡仅能用于数据收发,但无法收发短信和拨打电话。虚拟卡可以通过软件虚拟来实现,操作系统提供有用于查询虚拟卡信息的函数接口。A virtual card is also called a virtual SIM card. The virtual card can only be used to send and receive data, but cannot send and receive text messages and make calls. The virtual card can be implemented by software virtualization, and the operating system provides a function interface for querying virtual card information.

终端中的预定应用程序通过调用操作系统的第一函数接口和第二函数接口获取虚拟卡的标识,第一函数接口用于向预定应用程序反馈是否存在虚拟卡,第二函数接口用于在存在虚拟卡时,向预定应用程序反馈虚拟卡的标识。The predetermined application program in the terminal obtains the identifier of the virtual card by calling the first function interface and the second function interface of the operating system, the first function interface is used to feed back to the predetermined application program whether there is a virtual card, and the second function interface is used for the existence of the virtual card. When creating a virtual card, the identifier of the virtual card is fed back to the predetermined application.

以操作系统为Android系统为例,操作系统中的ColorOSTelephoneManager提供有isColorHasSoftSimCard接口和ColorGetSoftSimCardSlotld接口。其中,isColorHasSoftSimCard接口被调用后,会向预定应用程序反馈终端中是否存在虚拟卡;当存在虚拟卡时,预定应用程序可以调用ColorGetSoftSimCardSlotld接口,从而获得虚拟卡的标识。Taking the Android system as the operating system as an example, ColorOSTelephoneManager in the operating system provides isColorHasSoftSimCard interface and ColorGetSoftSimCardSlotld interface. Among them, after the isColorHasSoftSimCard interface is called, it will feed back to the predetermined application whether there is a virtual card in the terminal; when there is a virtual card, the predetermined application can call the ColorGetSoftSimCardSlotld interface to obtain the identifier of the virtual card.

可选地,预定应用程序在获取虚拟卡的标识后,从初级候选SIM中排除属于虚拟卡的SIM,得到二级候选SIM。Optionally, after acquiring the identifier of the virtual card, the predetermined application excludes the SIMs belonging to the virtual card from the primary candidate SIMs to obtain the secondary candidate SIMs.

比如,初级候选SIM包括SIM A和SIM B,虚拟卡的标识为SIM B,则终端确定SIM A为二级候选SIM。For example, if the primary candidate SIMs include SIM A and SIM B, and the identifier of the virtual card is SIM B, the terminal determines that SIM A is the secondary candidate SIM.

步骤306,终端根据二级候选SIM确定第一SIM,第一SIM具有短信息收发能力;Step 306, the terminal determines the first SIM according to the secondary candidate SIM, and the first SIM has the ability to send and receive short messages;

当二级候选SIM为一个时,终端直接将二级候选SIM确定为第一SIM。When there is one secondary candidate SIM, the terminal directly determines the secondary candidate SIM as the first SIM.

当二级候选SIM为两个以上时,终端将两个以上的二级候选SIM均确定为第一SIM,或者,终端从两个以上的二级候选SIM中选择出一个SIM,确定为第一SIM。本实施例对第一SIM的个数不加以限定,下文中以第一SIM为一个来举例说明。When there are more than two secondary candidate SIMs, the terminal determines both the two or more secondary candidate SIMs as the first SIM, or the terminal selects one SIM from the two or more secondary candidate SIMs and determines it as the first SIM SIM. This embodiment does not limit the number of the first SIMs, and hereinafter, the first SIM is used as an example for illustration.

步骤307,终端根据用户帐号和第一SIM对应的第一手机号码生成绑定请求,绑定请求用于请求将用户帐号和第一手机号码进行绑定;Step 307, the terminal generates a binding request according to the user account and the first mobile phone number corresponding to the first SIM, and the binding request is used to request to bind the user account and the first mobile phone number;

可选地,该绑定请求中包括用户帐号和第一手机号码。该绑定请求用于请求服务器将用户帐号和第一手机号码进行绑定。Optionally, the binding request includes the user account and the first mobile phone number. The binding request is used to request the server to bind the user account and the first mobile phone number.

可选地,该绑定请求中包括用户帐号、终端标识和第一手机号码。该绑定请求用于请求服务器将用户帐号、终端标识和第一手机号码进行绑定。比如,终端将用户帐号、终端标识和第一手机号码依次排序,并在每两个信息之间添加逗号,得到绑定请求=(用户帐号,终端标识,第一手机号码)。Optionally, the binding request includes the user account, the terminal identifier and the first mobile phone number. The binding request is used to request the server to bind the user account, the terminal identifier and the first mobile phone number. For example, the terminal sorts the user account, the terminal ID and the first mobile phone number in sequence, and adds a comma between each two pieces of information to obtain a binding request=(user account, terminal ID, first mobile phone number).

其中,用户帐号是预先在服务器中注册且用于标识用户身份的帐号。在终端为手机时,终端标识可以是IMEI(International Mobile Equipment Identity,国际移动设备身份码)。第一手机号码是终端中具有短信息收发能力的手机号码。The user account is an account that is pre-registered in the server and used to identify the user. When the terminal is a mobile phone, the terminal identification may be IMEI (International Mobile Equipment Identity, International Mobile Equipment Identity). The first mobile phone number is a mobile phone number in the terminal capable of sending and receiving short messages.

步骤308,终端向服务器发送绑定请求;Step 308, the terminal sends a binding request to the server;

终端可以通过数据网络向服务器发送绑定请求。The terminal can send a binding request to the server through the data network.

对应地,服务器接收终端发送的绑定请求。Correspondingly, the server receives the binding request sent by the terminal.

步骤309,服务器根据绑定请求,建立用户帐号和第一手机号码之间的绑定关系;Step 309, the server establishes a binding relationship between the user account and the first mobile phone number according to the binding request;

服务器在接收到绑定请求后,从绑定请求中解析出用户帐号和第一手机号码,并且建立用户帐号和第一手机号码两者之间的绑定关系。After receiving the binding request, the server parses the user account and the first mobile phone number from the binding request, and establishes a binding relationship between the user account and the first mobile phone number.

可选地,当绑定请求中还携带有终端标识时,服务器从绑定请求中解析出用户帐号、终端标识和第一手机号码,建立用户帐号、终端标识和第一手机号码三者之间的绑定关系。Optionally, when the binding request also carries the terminal identification, the server parses out the user account, the terminal identification and the first mobile phone number from the binding request, and establishes a relationship between the user account, the terminal identification and the first mobile phone number. binding relationship.

在一个可选的实施例中,终端中的预定应用程序是查收手机程序,服务器为终端开通查找手机功能时,会同时建立用户帐号、终端标识和第一手机号码之间的绑定关系。表一示意性的示出了该绑定关系。In an optional embodiment, the predetermined application program in the terminal is a mobile phone search program, and when the server activates the mobile phone search function for the terminal, a binding relationship between the user account, the terminal identification and the first mobile phone number will be established at the same time. Table 1 schematically shows the binding relationship.

表一Table I

Figure BDA0002383611770000101
Figure BDA0002383611770000101

Figure BDA0002383611770000111
Figure BDA0002383611770000111

可选地,用户帐号包括中文字符、英文字符和数字中的至少一种。每个用户帐号用于绑定至少一个手机号码。Optionally, the user account includes at least one of Chinese characters, English characters and numbers. Each user account is used to bind at least one mobile phone number.

在建立用户帐号和第一手机号码之间的绑定关系后,服务器通过向该第一手机号码发送短信息的方式,提供验证码验证功能、信息推送功能和远程控制功能中的至少一种服务。After establishing the binding relationship between the user account and the first mobile phone number, the server provides at least one of the verification code verification function, the information push function and the remote control function by sending a short message to the first mobile phone number .

步骤310,当第一SIM失效时,终端获取第二SIM,第二SIM具有短信息收发能力;Step 310, when the first SIM is invalid, the terminal obtains the second SIM, and the second SIM has the ability to send and receive short messages;

由于第一SIM可能会因为欠费停机、被锁定或从终端中拔出等原因,进入失效状态。此时第一SIM不再具有短信息收发能力,终端中的预定应用程序通过操作系统发送的广播消息,能够确定出第一SIM处于失效状态。也即,第一SIM的状态值不等于4。Because the first SIM may be shut down due to arrears, locked or pulled out of the terminal, etc., it may enter an invalid state. At this time, the first SIM no longer has the ability to send and receive short messages, and the predetermined application in the terminal can determine that the first SIM is in an invalid state through a broadcast message sent by the operating system. That is, the state value of the first SIM is not equal to 4.

终端重新获取第二SIM,获取第二SIM的过程如步骤304至步骤306所述。The terminal acquires the second SIM again, and the process of acquiring the second SIM is as described in steps 304 to 306 .

若终端未能获取到第二SIM,则进入步骤311;若终端成功获取第二SIM,则进入步骤314。If the terminal fails to acquire the second SIM, the process proceeds to step 311 ; if the terminal successfully acquires the second SIM, the process proceeds to step 314 .

步骤311,终端根据用户帐号和第一手机号码生成解绑请求,解绑请求用于请求将用户帐号与第一手机号码解除绑定;Step 311, the terminal generates an unbinding request according to the user account and the first mobile phone number, and the unbinding request is used to request to unbind the user account and the first mobile phone number;

终端生成解绑请求,该解绑请求用于请求将用户帐号和第一手机号码两者之间解除绑定。The terminal generates an unbinding request, where the unbinding request is used to request to unbind the user account and the first mobile phone number.

可选地,终端生成的解绑请求还携带有终端标识,该解绑请求用于请求将用户帐号、终端标识和第一手机号码三者之间解除绑定。比如,终端将用户帐号、终端标识和第一手机号码依次排序,并在每两个信息之间添加逗号,得到解绑请求=(用户帐号,终端标识,第一手机号码)。Optionally, the unbinding request generated by the terminal further carries the terminal identification, and the unbinding request is used to request to unbind the user account, the terminal identification and the first mobile phone number. For example, the terminal sorts the user account, the terminal identifier and the first mobile phone number in sequence, and adds a comma between each two pieces of information to obtain an unbinding request=(user account, terminal identifier, first mobile phone number).

步骤312,终端向服务器发送解绑请求;Step 312, the terminal sends an unbinding request to the server;

终端可以通过数据网络向服务器发送绑定请求。The terminal can send a binding request to the server through the data network.

对应地,服务器接收终端发送的绑定请求。Correspondingly, the server receives the binding request sent by the terminal.

步骤313,服务器根据解绑请求,将用户帐号和第一手机号码解除绑定;Step 313, the server unbinds the user account and the first mobile phone number according to the unbinding request;

服务器删除用户帐号和第一手机号码之间的绑定关系。The server deletes the binding relationship between the user account and the first mobile phone number.

可选地,当解绑请求还携带有终端标识时,服务器将用户帐号、终端标识和第一手机号码三者之间解除绑定。Optionally, when the unbinding request also carries the terminal identifier, the server unbinds the user account, the terminal identifier and the first mobile phone number.

步骤314,终端根据用户帐号和第二SIM对应的第二手机号码生成更新请求,更新请求用于请求将绑定关系中的第一手机号码更新为第二手机号码;Step 314, the terminal generates an update request according to the user account and the second mobile phone number corresponding to the second SIM, and the update request is used to request that the first mobile phone number in the binding relationship be updated to the second mobile phone number;

终端在确定出第二SIM后,获取第二SIM对应的第二手机号码。After determining the second SIM, the terminal acquires the second mobile phone number corresponding to the second SIM.

可选地,终端根据用户帐号、终端标识和第二SIM对应的第二手机号码生成更新请求,更新请求用于请求将绑定关系中的第一手机号码更新为第二手机号码。比如,终端将用户帐号、终端标识和第二手机号码依次排序,并在每两个信息之间添加逗号,得到更新请求=(用户帐号,终端标识,第二手机号码)。Optionally, the terminal generates an update request according to the user account, the terminal identifier and the second mobile phone number corresponding to the second SIM, where the update request is used to request to update the first mobile phone number in the binding relationship to the second mobile phone number. For example, the terminal sorts the user account, the terminal identification and the second mobile phone number in sequence, and adds a comma between each two pieces of information to obtain an update request=(user account, terminal identification, second mobile phone number).

步骤315,终端向服务器发送更新请求;Step 315, the terminal sends an update request to the server;

终端可以通过数据网络向服务器发送更新请求。The terminal can send an update request to the server through the data network.

对应地,服务器接收终端发送的更新请求。Correspondingly, the server receives the update request sent by the terminal.

步骤316,服务器根据更新请求,将绑定关系中的第一手机号码更新为第二手机号码。Step 316, the server updates the first mobile phone number in the binding relationship to the second mobile phone number according to the update request.

服务器从更新请求中解析出用户帐号和第二手机号码,查询出与该用户帐号对应的绑定关系,将绑定关系中已有的第一手机号码更新为第二手机号码。The server parses the user account and the second mobile phone number from the update request, queries the binding relationship corresponding to the user account, and updates the existing first mobile phone number in the binding relationship to the second mobile phone number.

需要说明的一点是,步骤311至步骤313可以单独执行,也即当第一SIM失效时终端直接生成解绑请求,不依赖于是否获取到第二SIM;另外,若终端没有获取到第二SIM后,可以每隔预定时间间隔执行一次步骤310,直至获取到第二SIM为止。It should be noted that steps 311 to 313 can be performed independently, that is, when the first SIM becomes invalid, the terminal directly generates an unbinding request, independent of whether the second SIM is obtained; in addition, if the terminal does not obtain the second SIM Afterwards, step 310 may be performed every predetermined time interval until the second SIM is acquired.

综上所述,在本实施例提供的方法中,通过终端自动确定出具有短信息收发能力的第一SIM,根据用户帐号和第一SIM对应的手机号码来生成绑定请求,所以保证了绑定过程的成功率且节省了时间,另外,由于用户不需要手动输入第一SIM对应的手机号码以及在绑定失败时重新绑定,还能够减少用户的无用操作,从而提高了终端与用户之间的人机交互效率。To sum up, in the method provided in this embodiment, the terminal automatically determines the first SIM with the ability to send and receive short messages, and generates a binding request according to the user account and the mobile phone number corresponding to the first SIM, so the binding is guaranteed. In addition, because the user does not need to manually input the mobile phone number corresponding to the first SIM and re-bind when the binding fails, it can also reduce the useless operation of the user, thereby improving the relationship between the terminal and the user. human-computer interaction efficiency.

在本实施例提供的方法中,终端通过操作系统提供的广播消息和函数接口,来自行确定出当前具有短信息收发能力的第一SIM。其中,终端通过操作系统提供的第一函数接口和第二函数接口来确定出虚拟卡,进而准确确定出当前处于有效状态且不为虚拟卡的第一SIM,使得虚拟卡不会被错误判定为第一SIM,从而减少无效的绑定操作。In the method provided in this embodiment, the terminal automatically determines the first SIM currently capable of sending and receiving short messages through broadcast messages and function interfaces provided by the operating system. The terminal determines the virtual card through the first function interface and the second function interface provided by the operating system, and then accurately determines the first SIM that is currently in a valid state and is not a virtual card, so that the virtual card will not be erroneously determined as a virtual card. the first SIM, thereby reducing invalid binding operations.

在本实施例提供的方法中,当第一SIM失效时,终端自动向服务器解绑请求,使得服务器能够及时解除用户帐号与第一手机号码之间的绑定关系,避免了第一SIM失效后,服务器仍然向第一手机号码发送短信息来提供服务,导致服务无法正常提供,或者,若第一SIM已安装至其他手机,则服务器将短信息发送至其他手机会导致用户信息泄露的问题。同时,也无需用户手动进行解除绑定,提高了终端与用户之间的人机交互效率。In the method provided in this embodiment, when the first SIM becomes invalid, the terminal automatically unbinds a request to the server, so that the server can release the binding relationship between the user account and the first mobile phone number in time, and avoids the need for the first SIM to become invalid after the first SIM becomes invalid. , the server still sends a short message to the first mobile phone number to provide services, resulting in failure to provide services normally, or, if the first SIM has been installed on other mobile phones, the server sends short messages to other mobile phones, which may lead to user information leakage. At the same time, the user does not need to manually unbind, which improves the human-computer interaction efficiency between the terminal and the user.

在本实施例提供的方法中,当第一SIM失效且终端获取到第二SIM时,终端向服务器更新请求,使得服务器能够及时将绑定关系中的第一手机号码更新为第二手机号码,能够达到服务器及时向第二手机号码发送短信息来提供服务,无需用户手动将第一手机号码更新为第二手机号码,提高了终端与用户之间的人机交互效率。In the method provided in this embodiment, when the first SIM is invalid and the terminal obtains the second SIM, the terminal sends an update request to the server, so that the server can update the first mobile phone number in the binding relationship to the second mobile phone number in time, It can achieve that the server sends a short message to the second mobile phone number in time to provide services, and the user does not need to manually update the first mobile phone number to the second mobile phone number, which improves the human-computer interaction efficiency between the terminal and the user.

在可选的实施例中,上述终端自动发送解绑请求和/或自动发送更新请求的功能,需要获取用户的预授权。也即,在用户预先授权终端自动发送解绑请求和/或更新请求时,终端才执行自动发送解绑请求和/或更新请求的步骤。In an optional embodiment, the function of the terminal automatically sending the unbinding request and/or the function of automatically sending the update request needs to obtain the pre-authorization of the user. That is, when the user pre-authorizes the terminal to automatically send the unbinding request and/or the update request, the terminal performs the step of automatically sending the unbinding request and/or the update request.

可选地,对于步骤306中终端如何从两个以上的二级候选SIM中选择出一个SIM,确定为第一SIM。本发明实施例还提供了至少三种不同的实现方式:第一,终端根据每个SIM在历史时间段的来电通话时长来确定;第二,终端根据每个SIM在历史时间段的服务短信接收次数来确定;第三,终端根据具有最早注册时间来确定。Optionally, for how the terminal selects one SIM from two or more secondary candidate SIMs in step 306, it is determined as the first SIM. The embodiment of the present invention also provides at least three different implementation manners: first, the terminal determines according to the call duration of each SIM in the historical time period; second, the terminal receives the service short message according to the service short message of each SIM in the historical time period The number of times is determined; thirdly, the terminal is determined according to the earliest registration time.

针对第一种实现方式:由于在一些使用场景中,用户在终端中同时使用SIM1和SIM2,其中SIM1的使用时间较早,SIM2的资费更优。由于用户的亲友大部分都存储有SIM1对应的手机号码,用户通常使用SIM1接收亲友的来电;由于SIM2的资费更低,所以用户使用SIM2向亲友拨打电话(去电)。为此,在基于图3的可选实施例中,步骤306可替代实现成为步骤3061和步骤3062,如图5所示:For the first implementation manner: because in some usage scenarios, the user uses SIM1 and SIM2 in the terminal at the same time, where SIM1 is used earlier and SIM2 has better tariffs. Since most of the user's relatives and friends store the mobile phone numbers corresponding to SIM1, users usually use SIM1 to receive calls from relatives and friends; because SIM2 has lower tariffs, users use SIM2 to make calls (outgoing calls) to relatives and friends. To this end, in an alternative embodiment based on FIG. 3 , step 306 can be alternatively implemented as step 3061 and step 3062, as shown in FIG. 5 :

在步骤3061中,当二级候选SIM为至少两个时,获取每个二级候选SIM在历史时间段内的来电通话时长;In step 3061, when there are at least two secondary candidate SIMs, obtain the call duration of each secondary candidate SIM in the historical time period;

可选地,历史时间段是SIM从安装至终端的第一时刻与当前时刻之间的时间段,或,历史时间段是最近x月,或,历史时间段是最近y天,或,历史时间段是最近z小时。Optionally, the historical time period is the time period between the first moment when the SIM is installed to the terminal and the current moment, or, the historical time period is the last x months, or, the historical time period is the last y days, or, the historical time The segment is the last z hours.

示意性的,终端的操作系统的数据库中记录有每个二级候选SIM的历史通话记录信息。每条历史通话记录信息包括:对方电话号码、类型(来电/去电)、通话时间和通话时长。终端中的预定应用程序从数据库中读取每个二级候选SIM的历史通话记录信息,将每条历史通话记录信息中类型为来电的通话时长进行叠加,得到每个二级候选SIM在历史时间段的来电通话时长。Illustratively, the historical call record information of each secondary candidate SIM is recorded in the database of the operating system of the terminal. Each historical call record information includes: the other party's phone number, type (incoming/outgoing call), call time and call duration. The predetermined application in the terminal reads the historical call record information of each secondary candidate SIM from the database, and superimposes the call duration of the type of incoming call in each historical call record information to obtain the historical time of each secondary candidate SIM. Incoming call duration of the segment.

也即对于每张二级候选SIM,终端仅统计类型为来电的通话时长,而不统计类型为去电的通话时长。That is, for each secondary candidate SIM, the terminal only counts the call duration of the incoming call, but does not count the call duration of the outgoing call.

在步骤3062中,将具有最大通话时长的二级候选SIM确定为第一SIM。In step 3062, the secondary candidate SIM with the maximum call duration is determined as the first SIM.

终端中的预定应用程序对每个二级候选SIM的来电通话时长进行排序,将具有最大通话时长的二级候选SIM确定为第一SIM。The predetermined application program in the terminal sorts the call duration of each secondary candidate SIM, and determines the secondary candidate SIM with the largest call duration as the first SIM.

在本实施例提供的方法中,终端中来电通话时长更多的SIM是用户使用更久的SIM,用户长时间使用这张SIM的概率非常高,所以,终端选择具有最大来电通话时长的SIM,能够选择出用户长时间使用的SIM作为第一SIM,从而保证服务器向第一SIM对应的第一手机号码发送短信息来提供服务时的长期可用性。In the method provided by this embodiment, the SIM with more incoming call duration in the terminal is the SIM that the user has used for a longer time, and the probability of the user using this SIM for a long time is very high. Therefore, the terminal selects the SIM with the longest incoming call duration. The SIM that the user has used for a long time can be selected as the first SIM, thereby ensuring long-term availability when the server sends a short message to the first mobile phone number corresponding to the first SIM to provide services.

针对第二种实现方式:由于在一些使用场景中,用户在终端中同时使用SIM1和SIM2,用户习惯性地使用SIM1进行注册和绑定等事宜,而使用SIM2进行通话或数据访问。为此,在基于图3的可选实施例中,步骤306可替代实现成为步骤3063和步骤3064,如图6所示:For the second implementation manner: because in some usage scenarios, the user uses SIM1 and SIM2 in the terminal at the same time, the user habitually uses SIM1 for registration and binding, and uses SIM2 for calls or data access. To this end, in an alternative embodiment based on FIG. 3 , step 306 may be alternatively implemented as step 3063 and step 3064, as shown in FIG. 6 :

在步骤3063中,当二级候选SIM为至少两个时,获取每个二级候选SIM在历史时间段内的服务短信接收次数;In step 3063, when there are at least two secondary candidate SIMs, obtain the number of service short messages received by each secondary candidate SIM in the historical time period;

可选地,历史时间段是SIM从安装至终端的第一时刻与当前时刻之间的时间段,或,历史时间段是最近x月,或,历史时间段是最近y天,或,历史时间段是最近z小时。Optionally, the historical time period is the time period between the first moment when the SIM is installed to the terminal and the current moment, or, the historical time period is the last x months, or, the historical time period is the last y days, or, the historical time The segment is the last z hours.

示意性的,终端的操作系统的数据库中记录有每个二级候选SIM的短信息收发记录。每条短信息收发记录包括:对方电话号码、发送/接收时间和短信内容。终端中的预定应用程序从数据库中读取每个二级候选SIM的短信息收发记录,从短信息收发记录中选择出发送方是服务号码的服务信息,服务号码是通过短信息提供服务的服务器所对应的号码。服务短信包括但不限于:银行通知短信、快递通知短信、水电缴费通知短信、验证码短信、优惠通知短信中的至少一种。然后,终端中的预定应用程序统计出每张二级候选SIM的服务短信接收次数。Illustratively, the database of the operating system of the terminal records the short message sending and receiving records of each secondary candidate SIM. Each short message sending and receiving record includes: the other party's phone number, sending/receiving time and text message content. The predetermined application program in the terminal reads the short message sending and receiving records of each secondary candidate SIM from the database, and selects the service information whose sender is the service number from the short message sending and receiving records, and the service number is the server that provides services through short messages the corresponding number. Service SMS includes but is not limited to: at least one of bank notification SMS, express notification SMS, utility bill payment notification SMS, verification code SMS, and discount notification SMS. Then, the predetermined application in the terminal counts the number of service short messages received for each secondary candidate SIM.

在步骤3064中,将具有最大服务短信接收次数的二级候选SIM确定为第一SIM。In step 3064, the secondary candidate SIM with the maximum number of times of receiving the service short message is determined as the first SIM.

终端中的预定应用程序对每个二级候选SIM的服务短信接收次数进行排序,将具有最大服务短信接收次数的二级候选SIM确定为第一SIM。The predetermined application program in the terminal sorts the number of service short messages received by each secondary candidate SIM, and determines the secondary candidate SIM with the largest number of service short messages received as the first SIM.

在本实施例提供的方法中,终端中服务短信接收次数更多的SIM是用户更习惯用于注册和/或绑定时所使用的SIM,所以,终端选择具有最大服务短信接收次数的SIM,能够选择出符合用户使用习惯的SIM作为第一SIM,从而保证服务器向第一SIM对应的第一手机号码发送短信息时,更加符合用户的习惯,提高用户对服务短信的阅读可能性。In the method provided in this embodiment, the SIM with more number of service short messages received in the terminal is the SIM that the user is more accustomed to using for registration and/or binding. Therefore, the terminal selects the SIM with the maximum number of service short messages received, The SIM that conforms to the user's usage habits can be selected as the first SIM, thereby ensuring that when the server sends a short message to the first mobile phone number corresponding to the first SIM, it is more in line with the user's habits and improves the user's possibility of reading service short messages.

针对第三种实现方式:由于在一些使用场景中,用户会在终端中使用临时SIM,临时SIM是有效时间为几小时、几天或几个月的短期有效的SIM,该临时SIM虽然具有短信息收发能力,但并不适合与用户帐号进行绑定。为此,在基于图3的可选实施例中,步骤306可替代实现成为步骤3065和步骤3066,如图7所示:For the third implementation mode: in some usage scenarios, the user will use a temporary SIM in the terminal, and the temporary SIM is a short-term valid SIM with a valid time of several hours, days or months. Although the temporary SIM has a short-term validity The ability to send and receive information, but it is not suitable for binding with user accounts. To this end, in an alternative embodiment based on FIG. 3 , step 306 may alternatively be implemented as steps 3065 and 3066, as shown in FIG. 7 :

在步骤3065中,当二级候选SIM为至少两个时,通过号码服务器获取每个二级候选SIM的注册时间;In step 3065, when there are at least two secondary candidate SIMs, obtain the registration time of each secondary candidate SIM through the number server;

号码服务器是用于存储SIM属性信息的服务器。终端通过向号码服务器发送查询请求,能够查询出每个二级候选SIM的属性信息。其中,属性信息包括但不限于:归属地、注册时间、运营商名称中的至少一种。The number server is a server for storing SIM attribute information. The terminal can query the attribute information of each secondary candidate SIM by sending a query request to the number server. The attribute information includes, but is not limited to, at least one of attribution, registration time, and operator name.

在步骤3066中,将具有最早注册时间的二级候选SIM确定为第一SIM;In step 3066, the secondary candidate SIM with the earliest registration time is determined as the first SIM;

终端中的预定应用程序对每个二级候选SIM的注册时间进行排序,将具有最早注册时间的二级候选SIM确定为第一SIM。The predetermined application program in the terminal sorts the registration time of each secondary candidate SIM, and determines the secondary candidate SIM with the earliest registration time as the first SIM.

在本实施例提供的方法中,由于终端中的临时SIM的注册时间通常都晚于非临时SIM的注册时间,终端选择具有最早注册时间的SIM,能够选择出终端中的非临时SIM,从而保证服务器向第一SIM对应的第一手机号码发送短信息来提供服务时的长期可用性。In the method provided in this embodiment, since the registration time of the temporary SIM in the terminal is usually later than the registration time of the non-temporary SIM, the terminal selects the SIM with the earliest registration time, and the non-temporary SIM in the terminal can be selected, thereby ensuring that The server sends a short message to the first mobile phone number corresponding to the first SIM to provide long-term availability of the service.

参见图8,本发明实施例提供了一种用于绑定手机号码的装置,该装置可以通过软件、硬件或者两者的结合实现成为终端的全部或一部分。该装置包括:Referring to FIG. 8 , an embodiment of the present invention provides an apparatus for binding a mobile phone number, and the apparatus can be implemented as all or a part of a terminal through software, hardware, or a combination of the two. The device includes:

确定模块820,用于从终端内的至少两个用户身份识别模块SIM中确定出第一SIM,所述第一SIM具有短信息收发能力;a determining module 820, configured to determine a first SIM from at least two subscriber identity identification modules SIM in the terminal, where the first SIM has the ability to send and receive short messages;

生成模块840,用于根据用户帐号和所述第一SIM对应的第一手机号码生成绑定请求,所述绑定请求用于请求将所述用户帐号和所述第一手机号码进行绑定;A generating module 840, configured to generate a binding request according to the user account and the first mobile phone number corresponding to the first SIM, where the binding request is used to request to bind the user account and the first mobile phone number;

发送模块860,用于向服务器发送所述绑定请求。The sending module 860 is configured to send the binding request to the server.

综上所述,在本实施例提供的装置中,通过终端自动确定出具有短信息收发能力的第一SIM,根据用户帐号和第一SIM对应的手机号码来生成绑定请求,所以保证了绑定过程的成功率且节省了时间,另外,由于用户不需要手动输入第一SIM对应的手机号码以及在绑定失败时重新绑定,还能够减少用户的无用操作,从而提高了终端与用户之间的人机交互效率。To sum up, in the device provided in this embodiment, the terminal automatically determines the first SIM capable of sending and receiving short messages, and generates a binding request according to the user account and the mobile phone number corresponding to the first SIM, so the binding is guaranteed. In addition, because the user does not need to manually input the mobile phone number corresponding to the first SIM and re-bind when the binding fails, it can also reduce the useless operation of the user, thereby improving the relationship between the terminal and the user. human-computer interaction efficiency.

在一个可选的实施例中,所述确定模块820,用于通过所述终端的操作系统提供的广播消息确定初级候选SIM,所述初级候选SIM是处于有效状态的SIM;通过所述操作系统提供的函数接口从所述初级候选SIM中确定出二级候选SIM,所述二级候选SIM是处于有效状态且不属于虚拟卡的SIM;根据所述二级候选SIM确定所述第一SIM。In an optional embodiment, the determining module 820 is configured to determine a primary candidate SIM through a broadcast message provided by an operating system of the terminal, where the primary candidate SIM is an active SIM; through the operating system The provided function interface determines secondary candidate SIMs from the primary candidate SIMs, and the secondary candidate SIMs are SIMs that are in a valid state and do not belong to the virtual card; the first SIM is determined according to the secondary candidate SIMs.

在一个可选的实施例中,所述确定模块820,用于当所述二级候选SIM为至少两个时,获取每个所述二级候选SIM在历史时间段内的来电通话时长;将具有最大来电通话时长的所述二级候选SIM确定为所述第一SIM。In an optional embodiment, the determining module 820 is configured to, when there are at least two secondary candidate SIMs, obtain the call duration of each secondary candidate SIM within a historical time period; The secondary candidate SIM with the largest incoming call duration is determined as the first SIM.

在一个可选的实施例中,所述确定模块820,用于当所述二级候选SIM为至少两个时,获取每个所述二级候选SIM在历史时间段内的服务短信接收次数;将具有最大服务短信接收次数的所述二级候选SIM确定为所述第一SIM。In an optional embodiment, the determining module 820 is configured to acquire, when there are at least two secondary candidate SIMs, the number of service short messages received by each secondary candidate SIM within a historical time period; The secondary candidate SIM with the maximum number of times of receiving the service short message is determined as the first SIM.

在一个可选的实施例中,所述确定模块820,用于当所述二级候选SIM为至少两个时,通过号码服务器获取每个所述二级候选SIM的注册时间;将具有最早注册时间的所述二级候选SIM确定为所述第一SIM。In an optional embodiment, the determining module 820 is configured to obtain the registration time of each of the secondary candidate SIMs through a number server when there are at least two secondary candidate SIMs; The secondary candidate SIM of time is determined to be the first SIM.

在一个可选的实施例中,所述生成模块840,用于当所述第一SIM失效时,根据所述用户帐号和所述第一手机号码生成解绑请求,所述解绑请求用于请求将所述用户帐号与所述第一手机号码解除绑定;所述发送模块860,还用于向所述服务器发送所述解绑请求。In an optional embodiment, the generating module 840 is configured to generate an unbinding request according to the user account and the first mobile phone number when the first SIM is invalid, where the unbinding request is used for requesting to unbind the user account from the first mobile phone number; the sending module 860 is further configured to send the unbinding request to the server.

在一个可选的实施例中,所述确定模块,还用于当所述第一SIM失效时,获取第二SIM,所述第二SIM具有短信息收发能力;所述生成模块,还用于根据所述用户帐号和所述第二SIM对应的第二手机号码生成更新请求,所述更新请求用于请求将所述绑定关系中的所述第一手机号码更新为所述第二手机号码;所述发送模块,用于向所述服务器发送所述更新请求。In an optional embodiment, the determining module is further configured to acquire a second SIM when the first SIM is invalid, and the second SIM has the ability to send and receive short messages; the generating module is further configured to An update request is generated according to the user account and the second mobile phone number corresponding to the second SIM, where the update request is used to request to update the first mobile phone number in the binding relationship to the second mobile phone number ; the sending module is configured to send the update request to the server.

需要说明的是:上述实施例提供的用于绑定手机号码的装置在绑定手机号码时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的用于绑定手机号码的装置与用于绑定手机号码的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the device for binding a mobile phone number provided in the above embodiment is bound to a mobile phone number, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated by Different functional modules are completed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus for binding a mobile phone number provided in the above embodiment and the method embodiment for binding a mobile phone number belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

图9示出了本发明一个示例性实施例所涉及的终端的结构示意图。该终端包括:该终端包括:处理器911、接收器912、发射器913、存储器914和总线915。FIG. 9 shows a schematic structural diagram of a terminal involved in an exemplary embodiment of the present invention. The terminal includes: the terminal includes: a processor 911 , a receiver 912 , a transmitter 913 , a memory 914 and a bus 915 .

处理器911包括一个或者一个以上处理核心,存储器914通过总线915与处理器911相连,存储器914用于存储至少一条指令,处理器911执行存储器914中的指令时实现图2、图3、图5、图6和图7中任一方法实施例中终端侧的用于绑定手机号码的方法的步骤。The processor 911 includes one or more processing cores, and the memory 914 is connected to the processor 911 through the bus 915. The memory 914 is used to store at least one instruction. , the steps of the method for binding a mobile phone number on the terminal side in any of the method embodiments in FIG. 6 and FIG. 7 .

接收器912和发射器913可以实现为一个通信组件,该通信组件可以是一块通信芯片,用于对信息进行调制和/或解调,并通过无线信号接收或发送该信息。The receiver 912 and the transmitter 913 may be implemented as a communication component, which may be a communication chip for modulating and/or demodulating information, and receiving or transmitting the information through wireless signals.

此外,存储器914可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随时存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。Additionally, memory 914 may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as static anytime access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Except programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

上述结构示意仅为对终端的示意性说明,终端可以包括更多或更少的部件,比如终端可以不包括接收器,或者,终端还包括传感器、显示屏、电源等其它部件,本实施例不再赘述。The above structural illustration is only a schematic illustration of the terminal, and the terminal may include more or less components. For example, the terminal may not include a receiver, or the terminal may also include other components such as a sensor, a display screen, and a power supply. This embodiment does not Repeat.

本发明实施例还提供一种计算机可读介质,其上存储有至少一条指令,该指令被处理器911执行时实现图2、图3、图5、图6和图7中任一方法实施例中终端侧的用于绑定手机号码的方法的步骤。An embodiment of the present invention further provides a computer-readable medium, on which at least one instruction is stored, and when the instruction is executed by the processor 911, implements any one of the method embodiments in FIG. 2 , FIG. 3 , FIG. 5 , FIG. 6 , and FIG. 7 . The steps of the method for binding a mobile phone number on the terminal side.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.

本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.

以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection of the present invention. within the range.

Claims (13)

1. A method for binding a mobile phone number, wherein the method is applied to a terminal, and the terminal runs a predetermined application program, and the method comprises the following steps:
when a binding triggering operation is received, determining a first Subscriber Identity Module (SIM) from at least two SIM in a terminal, wherein the first SIM has a short message sending and receiving capacity, the first SIM is an SIM which is in an effective state and does not belong to a virtual card, and the binding triggering operation is used for triggering the binding of a mobile phone number for a user account in the preset application program;
generating a binding request according to a user account and a first mobile phone number corresponding to the first SIM, wherein the binding request is used for requesting to bind the user account and the first mobile phone number;
and sending the binding request to a server.
2. The method of claim 1, wherein determining the first SIM from among at least two SIM devices in the terminal comprises:
determining a primary candidate SIM by a broadcast message provided by an operating system of the terminal, the primary candidate SIM being a SIM in a valid state;
determining a secondary candidate SIM from the primary candidate SIMs through a function interface provided by the operating system, wherein the secondary candidate SIM is an SIM which is in an effective state and does not belong to a virtual card;
determining the first SIM according to the secondary candidate SIMs.
3. The method of claim 2, wherein determining the first SIM from the secondary candidate SIMs comprises:
when the number of the secondary candidate SIMs is at least two, acquiring the call duration of each secondary candidate SIM in a historical time period;
and determining the secondary candidate SIM with the maximum incoming call duration as the first SIM.
4. The method of claim 2, wherein the determining the first SIM from the secondary candidate SIMs comprises:
when the number of the secondary candidate SIMs is at least two, acquiring the service short message receiving times of each secondary candidate SIM in a historical time period;
and determining the secondary candidate SIM with the maximum service short message receiving times as the first SIM.
5. The method of claim 2, wherein the determining the first SIM from the secondary candidate SIMs comprises:
when the number of the secondary candidate SIMs is at least two, acquiring the registration time of each secondary candidate SIM through a number server;
determining the secondary candidate SIM with the earliest registration time as the first SIM.
6. The method according to any of claims 1 to 5, wherein after sending the binding request to the server, further comprising:
when the first SIM is invalid, generating a unbinding request according to the user account and the first mobile phone number, wherein the unbinding request is used for requesting to unbind the user account from the first mobile phone number;
sending the unbind request to the server.
7. The method according to any of claims 1 to 5, wherein after sending the binding request to the server, further comprising:
when the first SIM is invalid, determining a second SIM, wherein the second SIM has the capacity of sending and receiving short messages;
generating an updating request according to the user account and a second mobile phone number corresponding to the second SIM, wherein the updating request is used for requesting to update the first mobile phone number in the binding relationship to the second mobile phone number;
sending the update request to the server.
8. An apparatus for binding a mobile phone number, the apparatus being applied to a terminal, the terminal running a predetermined application program, the apparatus comprising:
the determining module is used for determining a first SIM from at least two SIM in the terminal when a binding triggering operation is received, wherein the first SIM has short message sending and receiving capacity, the first SIM is an SIM which is in an effective state and does not belong to a virtual card, and the binding triggering operation is used for triggering the binding of a mobile phone number for a user account in the preset application program;
the generation module is used for generating a binding request according to a user account and a first mobile phone number corresponding to the first SIM, wherein the binding request is used for requesting to bind the user account and the first mobile phone number;
and the sending module is used for sending the binding request to a server.
9. The apparatus of claim 8, wherein the determining module is configured to determine a primary candidate SIM by a broadcast message provided by an operating system of the terminal, the primary candidate SIM being a SIM in a valid state; determining a secondary candidate SIM from the primary candidate SIMs through a function interface provided by the operating system, wherein the secondary candidate SIM is an SIM which is in an effective state and does not belong to a virtual card; determining the first SIM according to the secondary candidate SIMs.
10. The apparatus according to claim 8 or 9,
the generation module is used for generating a unbinding request according to the user account and the first mobile phone number when the first SIM is invalid, wherein the unbinding request is used for requesting to unbind the user account and the first mobile phone number;
the sending module is further configured to send the unbinding request to the server.
11. The apparatus according to claim 8 or 9,
the determining module is further configured to acquire a second SIM when the first SIM is invalid, where the second SIM has a short message transceiving capability;
the generating module is further configured to generate an update request according to the user account and a second mobile phone number corresponding to the second SIM, where the update request is used to request that the first mobile phone number in the binding relationship is updated to the second mobile phone number;
the sending module is configured to send the update request to the server.
12. A terminal, characterized in that the terminal comprises: a processor and a memory, the memory having stored therein at least one instruction, the at least one instruction being loaded and executed by the processor to implement the method for binding a mobile phone number according to any one of claims 1 to 7.
13. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor, to implement the method for binding a mobile phone number according to any one of claims 1 to 7.
CN202010090706.7A 2017-06-13 2017-06-13 Method, device, terminal and storage medium for binding mobile phone number Expired - Fee Related CN111278000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010090706.7A CN111278000B (en) 2017-06-13 2017-06-13 Method, device, terminal and storage medium for binding mobile phone number

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710444089.4A CN107277799B (en) 2017-06-13 2017-06-13 Method, device, terminal and storage medium for binding mobile phone number
CN202010090706.7A CN111278000B (en) 2017-06-13 2017-06-13 Method, device, terminal and storage medium for binding mobile phone number

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201710444089.4A Division CN107277799B (en) 2017-06-13 2017-06-13 Method, device, terminal and storage medium for binding mobile phone number

Publications (2)

Publication Number Publication Date
CN111278000A true CN111278000A (en) 2020-06-12
CN111278000B CN111278000B (en) 2022-10-28

Family

ID=60067634

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202010090706.7A Expired - Fee Related CN111278000B (en) 2017-06-13 2017-06-13 Method, device, terminal and storage medium for binding mobile phone number
CN201710444089.4A Expired - Fee Related CN107277799B (en) 2017-06-13 2017-06-13 Method, device, terminal and storage medium for binding mobile phone number

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201710444089.4A Expired - Fee Related CN107277799B (en) 2017-06-13 2017-06-13 Method, device, terminal and storage medium for binding mobile phone number

Country Status (1)

Country Link
CN (2) CN111278000B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109788469B (en) * 2017-11-15 2022-09-09 展讯通信(上海)有限公司 Number binding method and terminal equipment
CN108183911A (en) * 2018-01-03 2018-06-19 上海传英信息技术有限公司 A kind of method, device and mobile terminal of batch replacement binding cell-phone number
CN110391913B (en) * 2019-08-05 2022-08-23 斑马网络技术有限公司 Vehicle binding method and device
CN111148089B (en) * 2019-12-26 2022-02-22 北京华弘集成电路设计有限责任公司 Unbinding method and device
CN111884812B (en) * 2020-07-24 2022-07-29 四川阵风科技有限公司 Binding method and system of hardware equipment

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104320756A (en) * 2014-11-18 2015-01-28 广东欧珀移动通信有限公司 Account information changing method and device
CN104348802A (en) * 2013-07-31 2015-02-11 北京金山云网络技术有限公司 Quick registration method, device, and system, cell phone, and register server
CN104506491A (en) * 2014-11-28 2015-04-08 小米科技有限责任公司 Personal data account management method and device
WO2015060950A1 (en) * 2013-10-25 2015-04-30 Alibaba Group Holding Limited Method and system for authenticating service
CN104796385A (en) * 2014-01-20 2015-07-22 腾讯科技(深圳)有限公司 Terminal binding method, device and system
CN104883259A (en) * 2015-06-11 2015-09-02 郑存粮 Method for automatic registration by using mobile phone number as network application account number
CN104954322A (en) * 2014-03-25 2015-09-30 腾讯科技(深圳)有限公司 Account binding method, device and system
CN104954383A (en) * 2015-06-24 2015-09-30 深圳市兰丁科技有限公司 Application program login method and system
CN105472596A (en) * 2015-11-23 2016-04-06 小米科技有限责任公司 Binding method of communication number, apparatus and terminal thereof
CN105610771A (en) * 2015-09-11 2016-05-25 北京金山安全软件有限公司 Account associating method and account associating device
WO2016107400A1 (en) * 2014-12-30 2016-07-07 珠海奔图电子有限公司 Method and system for binding user account number to image formation device by mobile terminal
CN106332050A (en) * 2016-08-18 2017-01-11 中国联合网络通信集团有限公司 Method and device for automatic card selection based on mobile terminal tasks
CN106453263A (en) * 2016-09-19 2017-02-22 惠州Tcl移动通信有限公司 Method and system of binding cellphone number with APP
CN106535161A (en) * 2016-12-13 2017-03-22 珠海格力电器股份有限公司 Method and device for intelligent dialing of intelligent terminal and intelligent terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW508933B (en) * 2001-04-23 2002-11-01 Inventec Appliances Corp Method for automatically switching SIM card of mobile phone and device therefor
CN104683971A (en) * 2015-03-03 2015-06-03 魅族科技(中国)有限公司 Communication method and terminal
CN105813233B (en) * 2016-04-19 2019-05-21 深圳优克云联科技有限公司 A kind of communication strategy configuration method and device
CN106100687B (en) * 2016-05-31 2019-11-12 宇龙计算机通信科技(深圳)有限公司 A terminal communication method and system

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104348802A (en) * 2013-07-31 2015-02-11 北京金山云网络技术有限公司 Quick registration method, device, and system, cell phone, and register server
WO2015060950A1 (en) * 2013-10-25 2015-04-30 Alibaba Group Holding Limited Method and system for authenticating service
CN104796385A (en) * 2014-01-20 2015-07-22 腾讯科技(深圳)有限公司 Terminal binding method, device and system
CN104954322A (en) * 2014-03-25 2015-09-30 腾讯科技(深圳)有限公司 Account binding method, device and system
CN104320756A (en) * 2014-11-18 2015-01-28 广东欧珀移动通信有限公司 Account information changing method and device
CN104506491A (en) * 2014-11-28 2015-04-08 小米科技有限责任公司 Personal data account management method and device
WO2016107400A1 (en) * 2014-12-30 2016-07-07 珠海奔图电子有限公司 Method and system for binding user account number to image formation device by mobile terminal
CN104883259A (en) * 2015-06-11 2015-09-02 郑存粮 Method for automatic registration by using mobile phone number as network application account number
CN104954383A (en) * 2015-06-24 2015-09-30 深圳市兰丁科技有限公司 Application program login method and system
CN105610771A (en) * 2015-09-11 2016-05-25 北京金山安全软件有限公司 Account associating method and account associating device
CN105472596A (en) * 2015-11-23 2016-04-06 小米科技有限责任公司 Binding method of communication number, apparatus and terminal thereof
CN106332050A (en) * 2016-08-18 2017-01-11 中国联合网络通信集团有限公司 Method and device for automatic card selection based on mobile terminal tasks
CN106453263A (en) * 2016-09-19 2017-02-22 惠州Tcl移动通信有限公司 Method and system of binding cellphone number with APP
CN106535161A (en) * 2016-12-13 2017-03-22 珠海格力电器股份有限公司 Method and device for intelligent dialing of intelligent terminal and intelligent terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘百川: "基于Android的手机防盗与隐私控制系统的设计与实现", 《中国优秀硕士学位论文辑》 *

Also Published As

Publication number Publication date
CN107277799B (en) 2020-04-07
CN111278000B (en) 2022-10-28
CN107277799A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
CN111278000B (en) Method, device, terminal and storage medium for binding mobile phone number
EP1483935B1 (en) Activating an identity module for a communication system
KR101802264B1 (en) Method for sharing virtual sim card by multiple terminals, terminals, server, and system
US9462457B2 (en) Subscription transfer method, apparatus, and system
US8863240B2 (en) Method and system for smart card migration
US20190090124A1 (en) Method and apparatus for realizing a plurality of terminals sharing user identity identification card, and storage medium
CN107241336B (en) Identity verification method and device
US11553328B2 (en) Methods, devices, and computer programs for provisioning or controlling operator profiles in terminals
CN103067478A (en) Method, device and system for transmitting contact person information
CN108933789B (en) Method for preventing personal information leakage and third-party application server
CN107548054B (en) Master-slave equipment switching method of eSIM card, slave equipment and eSIM card management server
CN111787521A (en) Terminal application permission acquisition method, terminal device and USIM
US20230336970A1 (en) Electronic device performing verification using embedded sim and operating method therefor
CN112866984B (en) Synchronization method, cloud platform and terminal of call records
TWI357748B (en) System and method for correlating messages within
WO2011091669A1 (en) Method and data card for shielding short message receiving function
EP3079329B1 (en) Terminal application registration method, device and system
CN104079694A (en) Method and device of implementing address book based on network
CN114828000B (en) A login method, device and computer-readable storage medium
CN107040904B (en) Method and device for controlling menu item display withdrawal of short message
CN101668253B (en) Identification method of mobile terminal contact person, system and mobile terminal
KR101308628B1 (en) Server and method for transferring mms contents during call from soip device
CN110493735B (en) Short message processing method and device
CN114691734A (en) Cache control method and device, computer readable medium and electronic device
CN103179209A (en) Telecommunication-network-based address book implement method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20221028

CF01 Termination of patent right due to non-payment of annual fee