Patent Description:
An APN (Access Point Name, access point name) is one of basic configuration parameters of a mobile network data service. Different APNs identify methods for using a data service by a terminal for accessing a network.

In an existing method for establishing a network connection by using an APN, usually an APN is obtained first, and then an APN corresponding to an operator is used to access a network. In an existing APN matching method, usually correspondences between public land mobile networks (Public Land Mobile Network, PLMN for short) of all operators in China or around the world and APNs are usually preset in a terminal. Each operator usually has a plurality of PLMNs, and therefore there may be a situation in which a plurality of PLMNs correspond to a same group of APNs. After a user inserts a universal subscriber identity module (Universal Subscriber Identity Module, USIM for short) into a terminal, the terminal may read an international mobile subscriber identity number (International Mobile Subscriber Identity Number, IMSI for short) from a designated file, read an operator PLMN, namely, a home PLMN, based on first few bits of the IMSI, then find a corresponding APN according to a preset list in the terminal, and select the APN, to ensure that the user uses an accessed network and uses a data service.

However, as the quantity of users increases, if the original PLMN is not enough for accommodation, the operator is likely to add a new PLMN. Because the preset list in the terminal may not be updated accordingly, there may be a situation in which it is difficult to match a corresponding PLMN in a preset APN list, and therefore it may be difficult for the terminal to establish a network connection by using an APN.

<CIT> discloses a mobile terminal, a network server and a method for the mobile terminal to initiate a packet service. The mobile terminal comprises an acquisition module which is used for acquiring an access point name list of a currently accessed network of the mobile terminal, a selection module which is used for selecting an access point name in the access point name list of the currently accessed network, and an accessing module which is used for initiating a packet service request in the currently accessed network according to the selected access point name.

<CIT> discloses a public land mobile network searching method and a public land mobile network searching device.

This application provides an APN matching method, a terminal, and a storage medium, as defined in the appended set of claims, so as to resolve the problem in the existing technology that it is difficult to match an APN when an operator adds a new PLMN and the newly added PLMN is not stored in a list for storing a relationship between an operator PLMN and APN information corresponding to the operator PLMN in the terminal.

It can be understood that the APN matching method provided in this application performs APN matching by using a successfully registered PLMN in the second list when the APN matched by the HPLMN is empty (that is, no corresponding APN is matched). The foregoing method greatly increases a success rate of APN matching when an operator adds a new PLMN and the newly added PLMN is not stored in a list for storing a relationship between an operator PLMN and APN information corresponding to the operator PLMN in the terminal or when the terminal is abnormal, and can simultaneously adapt to the <NUM>, <NUM>, <NUM>, <NUM>, and the like, with high reliability.

To explain the technical solutions of the embodiments of this application more clearly, the following will briefly describe the accompanying drawings that need to be used in the description of the embodiments. Apparently, the accompanying drawings in the following description show only some embodiments of this application, and a person of ordinary skill in the art can still derive other accompanying drawings from these accompanying drawings without creative efforts. The accompanying drawings which are incorporated in and constitute a part of the specification illustrate embodiments consistent with this application and together with the specification serve to explain the principles of this application.

To better understand the technical solutions of this application, the embodiments of this application are described in detail below with reference to the accompanying drawings.

The present invention is disclosed in the independent claims.

The dependent claims define particular embodiments of the invention.

Terms used in the embodiments of this application are merely intended to describe specific embodiments, but are not intended to limit this application. The terms "one", "a", "the", "the foregoing", "this", and "the one" of singular forms used in this specification and the appended claims of this application are also intended to include plural forms, unless otherwise specified in the context clearly.

It should be understood that the term "and/or" used in the text merely describes an association relationship between associated objects, and indicates that three relationships may exist. For example, A and/or B may indicate the following cases: Only A exists, both A and B exist, and only B exists. The character "/" in the text usually indicates an "or" relationship between the associated objects.

For the situation in which no corresponding PLMN can be found in the preset APN list, the existing technology provides the following solutions: Solution <NUM>: Perform APN matching by using an EHPLMN (Equivalent Home Public Land Mobile Network, equivalent home PLMN).

Specifically, the EHPLMN is a local PLMN has the same status (equivalent) as a PLMN currently selected by a terminal, and the EHPLMN is stored in a universal subscriber identity module (Universal Subscriber Identity Module, USIM for short) card. For example, the HPLMN corresponding to China Mobile is <NUM> and the EHPLMN may include <NUM>, <NUM>, or the like.

As shown in <FIG>, after the network attach (Attach), when a user needs to access the network, the user needs to first perform PDP (Packet Data Protocol) context activation. If no corresponding APN can be matched by using an HPLMN, an EHPLMN in a USIM card is read, and APN matching is performed by using the EHPLMN.

For Solution <NUM>, if no corresponding APN is matched by using the HPLMN, the USIM card needs to have an EHPLMN, and the matching by using the EHPLMN needs to be accurate; otherwise, an error may occur in the APN matching. However, there are a plurality of operators in the world, and therefore it is difficult to avoid the situation in which EHPLMNs are not written into cards of a specific quantity of operators or EHPLMNs of a specific quantity of cards are inaccurate.

Solution <NUM>: Use an APN allocated by a network during a network register procedure (Attach) by using the <NUM> (<NUM>rd Generation, <NUM>th Generation mobile communication technology).

Specifically, as shown in <FIG>, during a <NUM> register procedure (Attach), if the terminal does not report an APN, a network may allocate an APN carried in an attach accept request by default. If the terminal fails to match the APN by using the HPLMN, the terminal may perform PDP context activation by using the APN that is carried by default and that is allocated by the <NUM> network. For Solution <NUM>, in using the APN allocated by the network during attach to the <NUM> network, there are some disadvantages as follows:.

In view of the above, an embodiment of this application provides an APN matching method, and a core concept of the method is to perform APN matching by using a successfully registered PLMN when the APN matched by the HPLMN is empty (that is, no corresponding APN is matched). The foregoing method greatly increases a success probability of APN matching when an operator adds a new PLMN and the newly added PLMN is not stored in a list for storing a relationship between an operator PLMN and APN information corresponding to the operator PLMN in the terminal or when the terminal is abnormal, and can simultaneously adapt to the <NUM>, <NUM>, <NUM>, <NUM>, and the like, with high reliability.

The following further describes, with reference to the accompanying drawings, the APN matching method provided in the embodiment of this application.

<FIG> is a block flowchart of an APN matching method according to an embodiment of this application.

The APN matching method is applied to a terminal and includes:.

The following further describes in detail the APN matching method provided in the embodiment of this application.

For step S11: Obtain a home public land mobile network HPLMN:
Specifically, the terminal may be a wireless terminal. The wireless terminal may be a device for providing voice and/or data connectivity only to a user, a handheld device having a wireless connection function, or another processing device connected to a wireless modem. The wireless terminal may communicate with one or more core networks through a RAN (Radio Access Network, radio access network). The wireless terminal may be a mobile terminal, such as a mobile phone (or referred to as a "cellular" phone), and a computer having a mobile terminal, for example, a portable, pocket-sized, handheld, computer-built, or vehicle-mounted mobile apparatus, which exchange voice and/or data with the radio access network, for example, a device such as a PCS (Personal Communication Service, personal communication service) phone, a cordless phone, a session initiation protocol (SIP) phone, a WLL (Wireless Local Loop, wireless local loop) station, or a PDA (Personal Digital Assistant, personal digital assistant). The wireless terminal may also be referred to as a system, a subscriber unit (Subscriber Unit), a subscriber station (Subscriber Station), a mobile station (Mobile Station), a mobile console (Mobile Console), a remote station (Remote Station), an access point (Access Point), a remote terminal (Remote Terminal), an access terminal (Access Terminal), a user terminal (User Terminal), a user agent (User Agent), or user equipment.

The home public land mobile network HPLMN is a home public land mobile network PLMN of a terminal user. That is, a mobile country code MCC and a mobile network code MNC included in an IMSI in a USIM card of the terminal are consistent with an MCC and an MNC on the HPLMN, and there is only one home PLMN for a user.

The process of obtaining a home public land mobile network HPLMN includes:
When a USIM card is inserted into a terminal, an AP (application processor, application processor) of the terminal initiates an HPLMN obtaining request to a modem (Modem), the modem and the USIM card perform communication interaction. The modem reads an IMSI from an IMSI file of the USIM card, parses the IMSI to obtain a home public land mobile network HPLMN, and returns the home public land mobile network HPLMN to the AP (application processor, application processor), where the HPLMN is first five bits of the IMSI.

A list for storing a relationship between an operator PLMN and APN information corresponding to the operator PLMN, that is, the first list, is preset in the terminal. The first list is preset in the terminal before the terminal leaves a factory. The first list includes relationships between a plurality of operator PLMNs and APNs corresponding to the plurality of operator PLMNs. When a new operator PLMN appears, the new operator PLMN may not match a corresponding APN because the first list is preset in the terminal before leaving the factory.

For step S12: The terminal performs a PLMN network attach, and after the attach is successful, performs APN matching in a first list by using the HPLMN, where the first list stores a correspondence between at least one PLMN and an APN.

Specifically, when the terminal is turned on or needs to be reconnected after being disconnected from the network, the terminal needs to perform a PLMN network attach again. The PLMN is a network established and operated by a government or an operator approved by the government for the purpose of providing land mobile communication services to the public. The network needs to be interconnected with a PSTN (Public Switched Phone Network, public switched phone network), to form a whole regional or national scale communication network. The PLMN includes an MCC (Mobile Country Code, mobile country code) and an MNC (Mobile Network Code, mobile network code). For example, the PLMN of China Mobile (China Mobile) is <NUM>, where the MCC is <NUM> and the MNC is <NUM>.

The process of a network attach by a terminal is roughly as follows: The terminal selects at least one PLMN, and then through an access network device and a core network device corresponding to the selected PLMN, uses one of the selected at least one PLMN for performing a network attach.

The specific process of a network attach by the terminal includes the following steps:.

More specifically, a backbone network of an operator is divided into three layers: a core layer, a convergence layer, and an access layer. A network from the access layer to the terminal is an access network. The access network may be a GPRS (General Packet Radio Service, general packet radio service), GSM (Global System for Mobile Communication, global system for mobile communication), or <NUM> network, or the like. The core layer is to implement an optimized transmission function between backbone networks. A core network is a network that provides terminal connection, terminal management, and service bearing at the core layer, namely, the PLMN. The core network provides an interface between a bearing network and an external network.

The access network device may be an eNB (evolved NodeB, evolved NodeB), an RNC (Radio Network Controller, radio network controller), or a BSC (Base Station Controller, base station controller). The core network device may be an MME (Mobility Management Entity, mobility management entity), an SGSN (Serving GPRS Support Node, serving GPRS support node), or an MSC (Mobile Switching Center, mobile switching center).

More specifically, using a PS (Packet Switch, packet switch) domain of a mobile communication system as an example, in <NUM>, the access network device is an RNC, and the core network device is an SGSN; in <NUM> (<NUM>th Generation, <NUM>th generation mobile communication technology), the access network device is an eNB, and the core network device is an MME; and in <NUM> (<NUM>nd Generation, <NUM>nd generation mobile communication technology), the access network device is a BSC, and the core network device is an SGSN. Using a CS (Circuit Switch, circuit switch) domain of a mobile communication system as an example, in <NUM>/<NUM>, the access network device is an RNC (<NUM>)/BSC (<NUM>), and the core network device is an MSC.

After the PLMN attach is successful, the performing APN matching in the first list by using the HPLMN specifically includes: performing identifier matching in the first list by using the HPLMN; and if a field that is the same as an identifier of the HPLMN is matched, obtaining an APN corresponding to the field that is the same as the identifier of the HPLMN, to complete the APN matching.

The first list may be stored in a database of the terminal, or may be stored in a configuration file.

Further, after the terminal performs the PLMN network attach and the attach is successful, the APN matching method further includes:
determining whether the terminal is currently in a roaming state; if the terminal is not in the roaming state, further determining whether a currently registered PLMN is stored in a second list, and if the currently registered PLMN is not stored in the second list, storing the currently registered PLMN in the second list, or if the currently registered PLMN is already stored in the second list, skipping an operation of storing the currently registered PLMN in the second list; or if the terminal is in the roaming state, skipping an operation of storing the currently registered PLMN in the second list. The currently registered PLMN is obtained by the terminal from the attach accept information returned by the access network device.

It should be noted that in one or more embodiments of this application, the second list is used for storing PLMNs that are currently registered successfully and/or historically registered successfully and belong to the same operator as the HPLMN (that is, non-roaming), and therefore the foregoing registered PLMN may be a currently registered successfully and non-roaming PLMN or may be a historically registered successfully and non-roaming PLMN.

Further, the determining whether the terminal is currently in a roaming state specifically includes: determining whether the HPLMN and the currently registered PLMN belong to the same operator; and if not, determining that the terminal is currently in the roaming state, or if yes, determining that the terminal is currently not in roaming state.

For example, China Mobile (China Mobile) has three PLMNs: <NUM>, <NUM>, and <NUM>. When the HPLMN is <NUM> and the PLMN of the attached network is <NUM>, although the HPLMN is different from the PLMN of the attached network, the two networks both belong to the same operator, namely, China Mobile (China Mobile), and therefore the terminal is not in the roaming state.

For step S13: The terminal performs APN matching in the first list by using a PLMN in a second list if no APN corresponding to the HPLMN is matched in the first list, where the PLMN in the second list is a registered PLMN:
Specifically, the terminal traverses the second list, and ends traversing when an APN is matched, or when no APN is matched, selects a next PLMN in the second list for performing matching, until an APN is matched or no APN is matched by using all the PLMNs in the second list.

The terminal may traverse the second list in a temporal order in which the PLMNs are stored in the second list or based on values of the PLMNs, or the like. This is not limited in this embodiment of this application. Preferably, traversing may be performed in ascending order of the values of the PLMNs in the second list (in a case that the PLMNs are values). Usually, the earlier a PLMN of the operators is established, the smaller the value of the PLMN is. Still using China Mobile (China Mobile) as an example, China Mobile (China Mobile) has three PLMNs: <NUM>, <NUM>, and <NUM>, and the order of network construction of the three PLMNs is <NUM>, <NUM>, and <NUM>. Therefore, the PLMNs in the second list are traversed in a chronological order of network construction of the PLMNs. An earlier order in which the PLMN is constructed indicates a greater probability at which an APN corresponding to the PLMN is stored in the first list in the terminal. Therefore, the speed at which the APN is successfully matched may be increased by traversing the PLMNs in the second list in the chronological order of network construction.

Optionally, in some other embodiments of this application, the APN matching in the first list may alternatively be performed by using an equivalent home public land mobile network EHPLMN before or after the terminal performs APN matching in the first list by using the PLMN in the second list.

Optionally, the performing, by a terminal, APN matching in the first list by using an equivalent home public land mobile network EHPLMN before performing APN matching in the first list by using the PLMN in the second list may specifically include: if no APN corresponding to the HPLMN is matched in the first list, before performing APN matching in the first list by using the PLMN in the second list, first performing, by the terminal, APN matching in the first list by using the equivalent home public land mobile network EHPLMN; and if no APN corresponding to the EHPLMN is matched in the first list by using the EHPLMN, performing APN matching in the first list by using the PLMN in the second list.

Optionally, the performing, by a terminal, APN matching in the first list by using an equivalent home public land mobile network EHPLMN before performing the APN matching in the first list by using the PLMN in the second list may further include: first performing APN matching in the first list by using the equivalent home public land mobile network EHPLMN; if no APN corresponding to the EHPLMN is matched in the first list by using the equivalent home public land mobile network EHPLMN, performing APN matching in the first list by using the HPLMN; and if no APN corresponding to the HPLMN is matched in the first list, performing APN matching in the first list by using the PLMN in the second list.

Optionally, the performing, by a terminal, APN matching in the first list by using an equivalent home public land mobile network EHPLMN before performing APN matching in the first list by using the PLMN in the second list may specifically include: performing, by the terminal, APN matching in the first list by using the PLMN in the second list, and if no corresponding APN is matched, performing APN matching in the first list by using the equivalent home public land mobile network EHPLMN.

It can be understood that by performing APN matching in the first list by using the equivalent home public land mobile network EHPLMN before or after the terminal performs APN matching in the first list by using the PLMN in the second list, the success rate of the APN matching can be further increased, so that when the first list preset in the terminal does not include corresponding information of a newly added operator PLMN and an APN, an APN of the operator is obtained by searching PLMNs that have been successfully registered and the known EHPLMN, and a network connection is established by using the APN, thereby greatly avoiding the situation in which the terminal cannot use an APN to establish a network connection caused by expansion of the PLMNs of the operator.

Further, after the APN is matched, the terminal initiates a PDP context activation request to a network side, and the PDP context activation request carries information such as the matched APN or the quality of service. When the terminal receives information returned by the network side for accepting the PDP context activation request, the PDP context activation process is completed.

<FIG> are an interactive flowchart of an APN matching method according to an embodiment of this application. As shown in <FIG>, a terminal includes an AP (Application Processor, application processor) and a modem (Modem). The application processor interacts with a network end by using the modem, and the interaction process includes:.

For example, assuming that the HPLMN in the USIM card of the terminal is <NUM>, a correspondence between a PLMN1 (<NUM>) and an APN1 and a correspondence between a PLMN2 (<NUM>) and an APN2 are preset in the first list of the terminal, where <NUM>, <NUM>, and <NUM> are EPLMNs (Equivalent Public Land Mobile Networks, equivalent PLMNs), if the PLMN list includes the PLMN1 and the PLMN2, the PDP context activation request sent by the terminal to the network side may include the PLMN1 or the PLMN2.

It can be understood that the APN matching method provided in the embodiment of this application performs APN matching by using a successfully registered PLMN in the second list when the APN matched by the HPLMN is empty (that is, no corresponding APN is matched). The foregoing method greatly increases a success rate of APN matching when an operator adds a new PLMN and the newly added PLMN is not stored in a list for storing a relationship between an operator PLMN and APN information corresponding to the operator PLMN in the terminal or when the terminal is abnormal, and can simultaneously adapt to the <NUM>, <NUM>, <NUM>, <NUM>, and the like, with high reliability.

<FIG> is a structural block diagram of a terminal according to an embodiment of this application. The embodiment of this application further provides a terminal <NUM>, including:.

Optionally, the first matching module <NUM> includes:.

The obtaining module <NUM> is specifically configured to perform the following steps: reading an IMSI from a USIM card, and parsing the IMSI to obtain an HPLMN.

Optionally, the second matching module <NUM> includes:.

Optionally, the terminal <NUM> further includes:
a third matching module, configured to perform APN matching in the first list by using an equivalent home public land mobile network EHPLMN if no corresponding APN is matched in the first list by the terminal by using the registered PLMN in the second list.

Optionally, the second matching module <NUM> is specifically configured to perform the following step: performing matching in the first list in ascending order of values of PLMNs in the second list, and ending the matching when a corresponding APN is matched.

An embodiment of this application further provides a storage medium, where the storage medium includes a stored program, and the program, when run, controls a device in which the storage medium is located to perform the APN matching method according to any one of the embodiments. To avoid repetition, details are not described herein. Alternatively, the computer program, when run by a processor, implements functions of the modules/units in the terminal in the embodiment. To avoid repetition, details are not described herein.

Referring to <FIG>, an embodiment of this application provides a terminal <NUM>. The terminal <NUM> of the embodiment includes a processor <NUM>, a memory <NUM>, and a program <NUM> that is stored in the memory <NUM> and that can be run on the processor <NUM>. The program <NUM>, when run by the processor <NUM>, implements the APN matching method of the embodiment. To avoid repetition, details are not described herein.

The terminal <NUM> may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The terminal <NUM> may include, but not limited to, the processor <NUM>, the memory <NUM>, and the like. A person skilled in the art can understood that <FIG> is merely an example of the terminal <NUM> and does not constitute a limitation to the terminal <NUM>, and may include more or fewer components than those illustrated, or a combination of specific components, or different components. For example, an electronic device may further include an input/output device, a network access device, a bus, or the like.

The processor <NUM> may be a central processing unit (Central Processing Unit, CPU), or may be another general-purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field-programmable gate array (Field-Programmable Gate Array, FPGA) or another programmable logic device, a discrete gate, a transistor logic device, a discrete hardware component, or the like. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor or the like.

The memory <NUM> may be an internal storage unit of the terminal <NUM> such as a hard disk or an internal memory of the terminal <NUM>. The memory <NUM> may alternatively be an external storage device of the terminal <NUM>, such as a pluggable hard disk, a smart media card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), or the like provided on the terminal <NUM>. Alternatively, the memory <NUM> may include both an internal storage unit of the terminal <NUM> and an external storage device. The memory <NUM> is configured to store a computer program and other programs and data required by the electronic device. The memory <NUM> may also be configured to temporarily store data that has been outputted or that is to be outputted.

It can be clearly understood by a person skilled in the art that for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, reference may be made to a corresponding process in the foregoing method embodiments, and details are not described herein again.

The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a hardware and software functional unit.

Claim 1:
An Access Point Name, APN, matching method, comprising:
obtaining (S11) a home public land mobile network, HPLMN, which comprises reading an International Mobile Subscriber Identification Number, IMSI, from a Universal Subscriber Identity Module, USIM, card, and parsing the IMSI to obtain the HPLMN; and
performing (S12) a PLMN network attach, and after the attach is successful, performing APN matching in a first list by using the HPLMN, wherein the first list stores a correspondence between at least one PLMN and an APN;
characterized in that the method further comprises:
performing (S13) APN matching in the first list by using a PLMN in a second list if no APN corresponding to the HPLMN is matched in the first list, wherein the PLMN in the second list is a registered PLMN.