CN112584547B - Method, device, storage medium and terminal equipment for establishing data connection - Google Patents

Method, device, storage medium and terminal equipment for establishing data connection Download PDF

Info

Publication number
CN112584547B
CN112584547B CN202011413562.0A CN202011413562A CN112584547B CN 112584547 B CN112584547 B CN 112584547B CN 202011413562 A CN202011413562 A CN 202011413562A CN 112584547 B CN112584547 B CN 112584547B
Authority
CN
China
Prior art keywords
parameter
apn
data connection
target
apn parameter
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.)
Active
Application number
CN202011413562.0A
Other languages
Chinese (zh)
Other versions
CN112584547A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202011413562.0A priority Critical patent/CN112584547B/en
Publication of CN112584547A publication Critical patent/CN112584547A/en
Application granted granted Critical
Publication of CN112584547B publication Critical patent/CN112584547B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/19Connection re-establishment

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The disclosure provides a method, a device, a storage medium and terminal equipment for establishing data connection, and relates to the technical field of terminals, wherein the method comprises the following steps: acquiring a current access point name APN parameter corresponding to the terminal equipment; establishing data connection with network equipment according to the current APN parameter; under the condition of abnormal data connection established according to the current APN parameter, acquiring a target APN parameter; and reestablishing data connection with the network equipment according to the target APN parameter. In this way, the problem that the data service of the terminal equipment is unavailable can be solved by modifying the APN parameter of the terminal equipment, so that the user experience can be improved.

Description

Method, device, storage medium and terminal equipment for establishing data connection
Technical Field
The disclosure relates to the technical field of terminals, and in particular, to a method, a device, a storage medium and terminal equipment for establishing data connection.
Background
With the development of mobile communication technology, the specific gravity of data services in mobile communication services is increasing. The terminal equipment can establish data connection with the mobile communication network through preconfigured APN (Access Point Name ) parameters, thereby realizing uploading or downloading of files, running of real-time communication software and the like, expanding the service range of the mobile communication network and providing a foundation for the function expansion of the terminal equipment.
In the practical application process, after the mobile communication network is upgraded, the terminal equipment also needs to update the APN parameter through the upgrading system, and establish data connection with the mobile communication network through the new APN parameter, however, the problem that the mobile communication network and the terminal equipment are out of sync after being upgraded may occur, so that the terminal equipment cannot establish data connection with the mobile communication network, and therefore the data service of the terminal equipment is unavailable, and the user experience is seriously affected.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a method, an apparatus, a storage medium, and a terminal device for establishing a data connection.
According to a first aspect of embodiments of the present disclosure, a method for establishing a data connection is provided, which is applied to a terminal device, and includes obtaining a current APN name APN parameter corresponding to the terminal device; establishing data connection with network equipment according to the current APN parameter; under the condition of abnormal data connection established according to the current APN parameter, acquiring a target APN parameter; and reestablishing data connection with the network equipment according to the target APN parameter.
Optionally, the data connection anomaly includes: failure of data connection establishment; or after the data connection is established successfully, the data path of the terminal equipment cannot transmit data.
Optionally, the obtaining the target APN parameter includes: acquiring an effective APN parameter which is pre-stored in a target storage area of the terminal equipment, taking the effective APN parameter as the target APN parameter, wherein the target storage area is a storage area which is not updated by the terminal equipment when a system is upgraded, and the effective APN parameter comprises an APN parameter used by the terminal equipment for establishing normal data connection with the network equipment for the last time; or, obtaining a pre-stored historical APN parameter, and updating the current APN parameter according to the historical APN parameter to obtain the target APN parameter.
Optionally, the updating the current APN parameter according to the historical APN parameter to obtain the target APN parameter includes: determining a first parameter to be adjusted from the current APN parameters according to a preset parameter adjustment sequence; determining a first target historical parameter corresponding to the first parameter to be adjusted from the historical APN parameter; and updating the first parameter to be adjusted through the first target history parameter to obtain the target APN parameter.
Optionally, the method further comprises: under the condition that the data connection established with the network equipment is abnormal again according to the target APN parameter, the connection establishment step is executed circularly until the data connection established according to the target APN parameter is normal; the connection establishment step includes: determining a second parameter to be adjusted from the current APN parameters according to the preset parameter adjustment sequence, wherein the second parameter to be adjusted is the next parameter to be adjusted of the first parameter to be adjusted; determining a second target historical parameter corresponding to the second parameter to be adjusted from the historical APN parameter; updating the second parameter to be adjusted through the second target history parameter to obtain a new target APN parameter, and establishing data connection with the network equipment according to the new target APN parameter; and under the condition that the data connection established according to the new target APN parameter is abnormal, taking the updated second parameter to be adjusted as a new first parameter to be adjusted.
Optionally, the method further comprises: and under the condition that the data connection established according to the current APN parameter is normal, taking the current APN parameter as a new effective APN parameter.
According to a second aspect of embodiments of the present disclosure, there is provided an apparatus for establishing a data connection, applied to a terminal device, including a current parameter obtaining module configured to obtain a current APN parameter corresponding to the terminal device; a first data connection establishing module configured to establish a data connection with a network device according to the current APN parameter; the target parameter acquisition module is configured to acquire target APN parameters under the condition that the data connection established according to the current APN parameters is abnormal; and a second data connection establishment module configured to re-establish a data connection with the network device according to the target APN parameter.
Optionally, the data connection anomaly includes: failure of data connection establishment; or after the data connection is established successfully, the data path of the terminal equipment cannot transmit data.
Optionally, the target parameter obtaining module includes: an effective parameter obtaining sub-module configured to obtain an effective APN parameter pre-stored in a target storage area of the terminal device, where the target storage area is a storage area that the terminal device will not update when upgrading a system, and the effective APN parameter includes an APN parameter used by the terminal device to establish a normal data connection with the network device for the last time; or the history parameter obtaining sub-module is configured to obtain a pre-stored history APN parameter, and update the current APN parameter according to the history APN parameter to obtain the target APN parameter.
Optionally, the history parameter obtaining sub-module is configured to: determining a first parameter to be adjusted from the current APN parameters according to a preset parameter adjustment sequence; determining a first target historical parameter corresponding to the first parameter to be adjusted from the historical APN parameter; and updating the first parameter to be adjusted through the first target history parameter to obtain the target APN parameter.
Optionally, the apparatus further comprises: a third data connection establishment module configured to, in the event of abnormality in the data connection re-established with the network device according to the target APN parameter, perform a connection establishment step in a loop until the data connection established according to the target APN parameter is normal; the connection establishment step includes: determining a second parameter to be adjusted from the current APN parameters according to the preset parameter adjustment sequence, wherein the second parameter to be adjusted is the next parameter to be adjusted of the first parameter to be adjusted; determining a second target historical parameter corresponding to the second parameter to be adjusted from the historical APN parameter; updating the second parameter to be adjusted through the second target history parameter to obtain a new target APN parameter, and establishing data connection with the network equipment according to the new target APN parameter; and under the condition that the data connection established according to the new target APN parameter is abnormal, taking the updated second parameter to be adjusted as a new first parameter to be adjusted.
Optionally, the apparatus further comprises: and the effective parameter updating module is configured to take the current APN parameter as a new effective APN parameter under the condition that the data connection established according to the current APN parameter is normal.
According to a third aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the method of establishing a data connection provided by the first aspect of the present disclosure.
According to a fourth aspect of embodiments of the present disclosure, there is provided a terminal device, including: a memory having a computer program stored thereon; a processor for executing the computer program in the memory to implement the steps of the method for establishing a data connection provided by the first aspect of the present disclosure.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects: acquiring a current APN name APN parameter corresponding to the terminal equipment; establishing data connection with network equipment according to the current APN parameter; under the condition of abnormal data connection established according to the current APN parameter, acquiring a target APN parameter; and reestablishing data connection according to the target APN parameters. That is, after the terminal device establishes the data connection with the network device, the target APN parameter can be obtained again, and the data connection is established with the network device again through the target APN parameter, so that the problem that the data service of the terminal device is unavailable can be solved by modifying the APN parameter of the terminal device, and the user experience can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of establishing a data connection according to an exemplary embodiment;
FIG. 2 is a flow chart illustrating a second method of establishing a data connection according to an exemplary embodiment;
FIG. 3 is a flowchart illustrating a third method of establishing a data connection, according to an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating an apparatus for establishing a data connection, according to an example embodiment;
fig. 5 is a schematic diagram showing the structure of a second apparatus for establishing a data connection according to an exemplary embodiment;
fig. 6 is a schematic structural view showing a third apparatus for establishing a data connection according to an exemplary embodiment;
fig. 7 is a block diagram of a terminal device, according to an example embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
First, an application scenario of the present disclosure will be described. An APN is a parameter that must be configured when a terminal device accesses the network, and is used in the GPRS (General Packet Radio Service ) backbone to identify an external PDN (Packet data network, packet data network, so-called Internet) to be used. The APN includes an APN network identity, which is an identity that a user can connect to an external network through a GGSN/PGW (Gateway GPRS Support Node, GPRS Gateway support node/PDN Gateway), which is assigned by the network operator to an ISP (Internet Service Provider ) or company, in correspondence with its fixed Internet domain name, is an optional component of the APN.
In addition, the APN determines which access mode the terminal device accesses the network. Currently, a configuration file is built in the terminal equipment, the configuration file configures APN information of each operator of each country, the terminal equipment matches APN information in the configuration file according to the searched operator information, and APN parameters are configured according to the matched APN information, so that network communication of the terminal equipment is realized.
If the operator needs to change the APN configuration information during system upgrading, the terminal equipment also needs to synchronously upgrade the system, and update the APN parameter of the terminal equipment according to the APN configuration information after the upgrade of the operator, otherwise, the terminal equipment may not be able to access the operator network. However, when the operator upgrades the system, an abnormal situation may occur, so that the terminal device cannot establish data connection with the network device of the operator according to the updated APN parameter, so that the data service of the terminal device is unavailable, and the user experience is affected.
In order to solve the above problems, the present disclosure provides a method, an apparatus, a storage medium, and a terminal device for establishing a data connection, where after the terminal device establishes a data connection with a network device according to a current APN parameter, the terminal device may reacquire a target APN parameter, and establish a data connection with the network device again through the target APN parameter, so that the problem that a data service of the terminal device is unavailable can be solved by modifying the APN parameter of the terminal device, thereby improving user experience.
The present disclosure is described below in connection with specific embodiments.
Fig. 1 is a flowchart illustrating a method for establishing a data connection according to an exemplary embodiment, and as shown in fig. 1, the method is applied to a terminal device, and includes:
S101, acquiring a current APN parameter corresponding to the terminal equipment.
The current APN parameter may be an APN parameter configured in an operating system currently used by the terminal device, where the APN parameter is provided by an operator and includes configuration information of an internal network of the operator, and the APN parameter may include Carrier (name), MCC (Mobile Country Code ), MNC (Mobile Network Code, mobile network number), APN, proxy (address of Proxy), port (Port number of Proxy), msc (Multimedia Messaging Service Center, multimedia information service center), msproxy (address of multimedia message Proxy), msport (Port number of multimedia message Proxy), protocol (APN Protocol), user, password, authtype (identity authentication type), etc., which are just illustrative, and the present disclosure is not limited thereto.
In this step, after the user opens the mobile network mode in the terminal device, or when an application installed in the terminal device needs to use a data service, the terminal device may obtain, according to a currently used SIM (Subscriber Identity Module ) card, an MCC value and an MNC value corresponding to the terminal device, and obtain, according to the MCC value and the MNC value, a current APN parameter corresponding to the MCC value and the MNC value from an APN database preconfigured by the terminal device.
The APN database may include APN parameters corresponding to all operators worldwide. Because of the large number of global operators, an APN parameter of a part of operators may be absent in an APN database preconfigured in the terminal device, or an APN parameter may be updated by a part of operators during system upgrade, in this case, the terminal device needs to update the APN parameter in the terminal device according to the missing APN parameter of the operator or the APN parameter updated by the operator system upgrade, so that the APN parameter in the terminal device and the APN parameter of the operator remain synchronous. After the operating system of the terminal equipment is upgraded, the current APN parameter corresponding to the terminal equipment is the new APN parameter of the terminal equipment after the operating system is upgraded.
S102, establishing data connection with the network equipment according to the current APN parameter.
In this step, after the current APN parameter is obtained, the terminal device may send a connection request instruction to the network device according to the current APN parameter, and the network device may return a connection result to the terminal device according to the connection request instruction, if the connection result is successful, it indicates that the data connection between the terminal device and the network device is successful, and if the connection result is failed, it indicates that the data connection between the terminal device and the network device is failed.
Further, after the data connection between the terminal device and the network device is established successfully, it needs to be further determined whether the data path of the terminal device can transmit data, that is, whether the communication between the terminal device and the network device is normal, for example, the terminal device may ping a preset website, if the terminal device can receive the data packet returned by ping, it indicates that the data path of the terminal device can transmit data, and if the terminal device cannot receive the data packet returned by ping, it indicates that the data path of the terminal device cannot transmit data.
S103, under the condition that the data connection established according to the current APN parameter is abnormal, acquiring a target APN parameter.
The abnormal data connection may include a failure of establishing the data connection, or after the successful establishment of the data connection, the data path of the terminal device cannot transmit data.
In this step, when it is determined that the terminal device fails to establish a data connection according to the current APN parameter, or the data path of the terminal device cannot transmit data, a target APN parameter stored in the terminal device in advance may be obtained, where the target APN parameter may be an APN parameter used when the terminal device establishes a normal data connection with the network device at any time. For example, when the terminal device establishes a data connection with the network device, if the data connection between the terminal device and the network device is normal, the APN parameter used for the current establishment of the data connection may be stored in the terminal device as the target APN parameter. And under the condition that the data connection established by the terminal equipment according to the current APN parameter is abnormal, acquiring the stored target APN parameter.
S104, establishing data connection with the network equipment again according to the target APN parameter.
In this step, after the target APN parameter is obtained, the data connection with the network device may be re-established according to the target APN parameter by referring to the manner of establishing the data connection with the network device according to the current APN parameter in step S102, which is not described herein.
By adopting the method, after the terminal equipment establishes data connection with the network equipment according to the current APN parameter, the target APN parameter can be acquired, and the data connection is established with the network equipment again through the target APN parameter, so that under the condition that the data connection is established with the terminal equipment due to the error of the current APN parameter, the data connection can be established again according to the target APN parameter, the problem that the data service of the terminal equipment is unavailable is solved, and the user experience is improved.
Fig. 2 is a flow chart illustrating a second method of establishing a data connection, as shown in fig. 2, according to an exemplary embodiment, the method comprising:
s201, acquiring a current APN parameter corresponding to the terminal equipment.
The current APN parameter may be an APN parameter configured in an operating system currently used by the terminal device, and the APN parameter may include Carrier, MCC, MNC, APN, proxy, port, mmsc, mmsproxy, mmsport, protocol, user, password, authtype, etc., which is only an example, and the disclosure is not limited thereto.
It should be noted that, the current APN parameter may be an APN parameter used by the terminal device for first establishing a data connection after upgrading the operating system.
S202, establishing data connection with the network equipment according to the current APN parameter.
Step 203, when the data connection established according to the current APN parameter is abnormal, step 204 and step 206 are executed, or step 205 to step 205 are executed, and when the data connection established according to the current APN parameter is normal, step 207 is executed.
The abnormal data connection may include a failure of establishing the data connection, or after the successful establishment of the data connection, the data path of the terminal device cannot transmit data.
In this step, after the terminal device sends a connection instruction to the network device according to the current APN parameter, the connection result returned by the network device may be monitored by the data link management unit in the terminal device. And if the connection result is connection success, the data connection between the terminal equipment and the network equipment is successfully established, and if the connection result is connection failure, the data connection between the terminal equipment and the network equipment is failed.
It should be noted that, in the case that the data connection of the terminal device is successfully established, the data service of the terminal device may not be available due to the problems of an APN parameter error, an operator network abnormality, and the like, and the user may not be able to normally access the internet. Therefore, after the data connection between the terminal device and the network device is successfully established, it is further required to determine whether the data path of the terminal device is capable of transmitting data, that is, whether the communication between the terminal device and the network device is normal.
S204, obtaining an effective APN parameter pre-stored in a target storage area of the terminal equipment, and taking the effective APN parameter as the target APN parameter.
The target storage area may be a storage area that the terminal device will not update when upgrading the system, and the valid APN parameter may include an APN parameter used by the terminal device to establish a normal data connection with the network device last time.
In this step, under the condition that the data connection established according to the current APN parameter is abnormal, the terminal device may acquire the valid APN parameter according to a preset path, because the terminal device may establish data connection with the network device according to the valid APN parameter before the data connection is established, considering that operations such as network upgrade of an operator may be forward compatible under general circumstances, that is, the updated APN parameter may also be compatible with an old APN parameter before the upgrade, therefore, under the condition that the data connection is established according to the current APN parameter by the terminal device is abnormal, the valid APN parameter may be acquired, and an attempt is made to reestablish the data connection according to the valid APN parameter.
S205, acquiring a pre-stored historical APN parameter, and updating the current APN parameter according to the historical APN parameter to obtain the target APN parameter.
The historical APN parameters may include all APN parameters used by an operator and all APN parameters set by the terminal device. The historical APN parameter may be updated in real time during the use of the terminal, for example, after the terminal device updates the current APN parameter by an operating system upgrade, the current APN parameter may be added to the historical APN parameter.
In this step, after the historical APN parameter is obtained, the current APN parameter may be adjusted by the parameter adjustment unit of the terminal device according to the historical APN parameter to obtain the target APN parameter. Because the APN parameter includes a plurality of parameters, in a possible implementation manner, a first parameter to be adjusted may be determined from the current APN parameter according to a preset parameter adjustment sequence, a first target historical parameter corresponding to the first parameter to be adjusted may be determined from the historical APN parameter, and the first parameter to be adjusted may be updated through the first target historical parameter to obtain the target APN parameter.
The preset parameter adjustment sequence may be determined according to the number of errors occurring in each parameter in a preset time period, and the APN parameters are arranged according to the sequence of the number of errors from more to less, where the preset time period may be 1 month or 1 year, which is not limited in the disclosure. For example, if the number of errors in the APN parameter is the largest, the protocols may be arranged at the first bit of the preset parameter adjustment sequence, and if the number of errors in the APN parameter is the smallest, the protocols may be arranged at the last bit of the preset parameter adjustment sequence. The above manner of determining the preset parameter adjustment sequence is merely illustrative, and the preset parameter adjustment sequence may be determined by other manners, which is not limited in this disclosure.
For example, after the terminal device obtains the historical APN parameter, the preset parameter adjustment sequence may be obtained, a parameter to be adjusted arranged in a first position in the preset parameter adjustment sequence is determined from the current APN parameter and is used as the first parameter to be adjusted, and then a first target historical parameter corresponding to the first parameter to be adjusted may be determined from the historical APN parameter and the first parameter to be adjusted is updated to the first target historical parameter. For example, if the first Protocol is arranged in the preset parameter adjustment sequence, the terminal device may determine that the Protocol is the first parameter to be adjusted from the current APN parameter, take the Protocol in the historical APN parameter as the first target historical parameter, and then replace the Protocol in the current APN parameter with the Protocol in the historical APN parameter to obtain the target APN parameter.
In addition, the first parameter to be adjusted may be adjusted according to a preset value of the first parameter to be adjusted, for example, the preset value of the Protocol in the APN parameter may be IPV4, IPV6 or IPV4V6, and in the case that the value of the Protocol in the current APN parameter is IPV4, the value of the Protocol may be modified to be IPV6 or IPV4V6.
S206, establishing data connection with the network equipment again according to the target APN parameter.
In this step, after determining the target APN parameter, the data connection may be established with the network device again by the data connection management unit of the terminal device according to the target APN parameter.
It should be noted that, because the APN parameter includes a plurality of APN parameters, after the terminal device fails to establish a data connection with the network device according to the current APN parameter, an error parameter in the current APN parameter cannot be determined, so after the first parameter to be adjusted is updated through the first target history parameter, the data connection established with the network device according to the target APN parameter may be abnormal after the target APN parameter is obtained.
In one possible implementation, in the case of an abnormal data connection re-established with the network device according to the target APN parameter, the connection establishment step may be performed in a loop until the data connection established according to the target APN parameter is normal. The connection establishment step comprises the following steps:
determining a second parameter to be adjusted from the current APN parameter according to the preset parameter adjustment sequence, wherein the second parameter to be adjusted is the next parameter to be adjusted of the first parameter to be adjusted, determining a second target historical parameter corresponding to the second parameter to be adjusted from the historical APN parameter, updating the second parameter to be adjusted through the second target historical parameter to obtain a new target APN parameter, establishing data connection with the network equipment according to the new target APN parameter, and taking the updated second parameter to be adjusted as the new first parameter to be adjusted under the condition that the data connection established according to the new target APN parameter is abnormal.
For example, when the first parameter to be adjusted is updated by the first target history parameter to obtain the target APN parameter, and the data connection established with the network device is abnormal according to the target APN parameter, the parameter to be adjusted arranged at the second position in the preset parameter adjustment sequence may be determined from the current APN parameter to be used as the second parameter to be adjusted, and then, a second target history parameter corresponding to the second parameter to be adjusted may be determined from the history APN parameter, and the second parameter to be adjusted is updated to be the second target history parameter. For example, if the Proxy is arranged in the second order in the preset parameter adjustment sequence, the terminal device may determine that the Proxy is the second parameter to be adjusted from the current APN parameter, take the Proxy in the history APN parameter as the second target history parameter, then replace the Proxy in the current APN parameter with the Proxy in the history APN parameter to obtain the target APN parameter, and finally, the terminal device may reestablish the data connection with the network device according to the target APN parameter. If the data connection re-established by the terminal equipment is still abnormal, the new target APN parameter can be continuously acquired according to the mode, and the data connection is re-established with the network equipment according to the new target APN parameter.
S207, taking the current APN parameter as a new effective APN parameter.
In this step, when the terminal device establishes a normal data connection with the network device according to the current APN parameter, the valid APN parameter may be obtained, the current APN parameter and the valid APN parameter are compared, and when the current APN parameter is different from the valid APN parameter, the current APN parameter is stored in the terminal device as a new valid APN parameter.
After the terminal equipment establishes data connection with the network equipment according to the current APN parameter, the method can acquire the effective APN parameter or the historical APN parameter, and establishes data connection with the network equipment again according to the effective APN parameter or the historical APN parameter.
In the embodiment shown in fig. 2, when the terminal device establishes a data connection with the network device according to the current APN parameter, the terminal device establishes a data connection with the network device again according to the valid APN parameter or the historical APN parameter. Fig. 3 is a flow chart illustrating a third method of establishing a data connection, as shown in fig. 3, according to an exemplary embodiment, the method comprising:
S301, acquiring a current APN parameter corresponding to the terminal equipment.
The current APN parameter may be an APN parameter configured in an operating system currently used by the terminal device, and the APN parameter may include Carrier, MCC, MNC, APN, proxy, port, mmsc, mmsproxy, mmsport, protocol, user, password, authtype, etc., which is only an example, and the disclosure is not limited thereto.
It should be noted that, the current APN parameter may be an APN parameter used by the terminal device for first establishing a data connection after upgrading the operating system.
S302, establishing data connection with the network equipment according to the current APN parameter.
Step 303, when the data connection established according to the current APN parameter is abnormal, steps S304 to S309 are executed, and when the data connection established according to the current APN parameter is normal, step S310 is executed.
S304, obtaining the effective APN parameter pre-stored in the target storage area of the terminal equipment, and taking the effective APN parameter as the target APN parameter.
The target storage area may be a storage area that the terminal device will not update when upgrading the system, and the valid APN parameter may include an APN parameter used by the terminal device to establish a normal data connection with the network device last time.
S305, establishing data connection with the network equipment again according to the target APN parameter.
S306, under the condition of establishing data connection abnormality with the network equipment again according to the target APN parameter, taking the target APN parameter as a new current APN parameter, and acquiring a prestored historical APN parameter.
S307, updating the new current APN parameter according to the historical APN parameter to obtain a new target APN parameter.
S308, establishing data connection with the network equipment again according to the new target APN parameter.
S309, when the data connection is established with the network equipment according to the new target APN parameter, the new APN parameter is used as a new effective APN parameter.
S310, taking the current APN parameter as a new effective APN parameter.
It should be noted that, the specific implementation manner of step S301 to step S310 may refer to the specific implementation manner of the embodiment shown in fig. 1 and fig. 2, which is not described herein again.
By adopting the method, after the terminal equipment establishes data connection with the network equipment according to the current APN parameter, the effective APN parameter can be acquired firstly, the data connection is established with the network equipment again according to the effective APN parameter, under the condition that the data connection is established with the network equipment again according to the effective APN parameter, the historical APN parameter is acquired again, the effective APN parameter is updated according to the historical APN parameter, and the data connection is established with the network equipment again according to the updated effective APN parameter, so that under the condition that the data connection is established with the terminal equipment abnormally due to the current APN parameter error, the data connection can be established again according to the effective APN parameter and the historical APN parameter, the problem that the data service of the terminal equipment is unavailable is solved, so that user experience is improved.
Fig. 4 is a schematic structural diagram of an apparatus for establishing a data connection, which is applied to a terminal device, according to an exemplary embodiment, and includes:
a current parameter obtaining module 401, configured to obtain a current APN parameter corresponding to the terminal device;
a first data connection establishment module 402 configured to establish a data connection with a network device according to the current APN parameter;
a target parameter obtaining module 403 configured to obtain a target APN parameter in case of abnormal data connection established according to the current APN parameter;
a second data connection establishment module 404 is configured to re-establish a data connection with the network device according to the target APN parameter.
Optionally, the data connection anomaly includes:
failure of data connection establishment; or alternatively, the process may be performed,
after the data connection is established successfully, the data path of the terminal equipment cannot transmit data.
Optionally, the target parameter obtaining module 403 includes:
an effective parameter obtaining sub-module configured to obtain an effective APN parameter pre-stored in a target storage area of the terminal device, where the target storage area is a storage area that the terminal device will not update when upgrading a system, and the effective APN parameter includes an APN parameter used by the terminal device to establish a normal data connection with the network device for the last time; or alternatively, the process may be performed,
The history parameter obtaining sub-module is configured to obtain a pre-stored history APN parameter, and update the current APN parameter according to the history APN parameter to obtain the target APN parameter.
Optionally, the history parameter obtaining sub-module is configured to:
determining a first parameter to be adjusted from the current APN parameter according to a preset parameter adjustment sequence;
determining a first target historical parameter corresponding to the first parameter to be adjusted from the historical APN parameter;
and updating the first parameter to be adjusted through the first target history parameter to obtain the target APN parameter.
Optionally, fig. 5 is a schematic structural diagram of a second apparatus for establishing a data connection according to an exemplary embodiment, and as shown in fig. 5, the apparatus further includes:
a third data connection establishment module 405 configured to, in the event of an abnormal data connection re-established with the network device according to the target APN parameter, perform a connection establishment step in a loop until the data connection established according to the target APN parameter is normal;
the connection establishment step includes:
determining a second parameter to be adjusted from the current APN parameter according to the preset parameter adjustment sequence, wherein the second parameter to be adjusted is the next parameter to be adjusted of the first parameter to be adjusted;
Determining a second target historical parameter corresponding to the second parameter to be adjusted from the historical APN parameter;
updating the second parameter to be adjusted through the second target history parameter to obtain a new target APN parameter, and establishing data connection with the network equipment according to the new target APN parameter;
and under the condition that the data connection established according to the new target APN parameter is abnormal, taking the updated second parameter to be adjusted as a new first parameter to be adjusted.
Optionally, fig. 6 is a schematic structural diagram of a third apparatus for establishing a data connection according to an exemplary embodiment, and as shown in fig. 6, the apparatus further includes:
the valid parameter updating module 406 is configured to take the current APN parameter as a new valid APN parameter in case that the data connection established according to the current APN parameter is normal.
Through the device, after the terminal equipment establishes data connection with the network equipment according to the current APN parameter, the target APN parameter can be acquired, and the data connection is established with the network equipment again through the target APN parameter, so that under the condition that the data connection is established with the terminal equipment abnormally due to the error of the current APN parameter, the data connection can be established again according to the target APN parameter, the problem that the data service of the terminal equipment is unavailable is solved, and the user experience is improved.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
The present disclosure also provides a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the method of establishing a data connection provided by the present disclosure.
Fig. 7 is a block diagram illustrating a terminal device 700 according to an exemplary embodiment. For example, the terminal device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, or the like.
Referring to fig. 7, a terminal device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the terminal device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to perform all or part of the steps of the methods of establishing a data connection described above. Further, the processing component 702 can include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operation at the terminal device 700. Examples of such data include instructions for any application or method operating on the terminal device 700, contact data, phonebook data, messages, pictures, video, and the like. The memory 704 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power component 706 provides power to the various components of the terminal device 700. Power component 706 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for terminal device 700.
The multimedia component 708 comprises a screen between the terminal device 700 and the user providing an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front-facing camera and/or a rear-facing camera. The front camera and/or the rear camera may receive external multimedia data when the terminal device 700 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio signals when the terminal device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 704 or transmitted via the communication component 716. In some embodiments, the audio component 710 further includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 714 includes one or more sensors for providing status assessment of various aspects for the terminal device 700. For example, the sensor assembly 714 may detect an on/off state of the terminal device 700, a relative positioning of the components, such as a display and keypad of the terminal device 700, a change in position of the terminal device 700 or a component of the terminal device 700, the presence or absence of a user's contact with the terminal device 700, an orientation or acceleration/deceleration of the terminal device 700, and a change in temperature of the terminal device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate communication between the terminal device 700 and other devices, either wired or wireless. The terminal device 700 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 716 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the terminal device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for performing the above-described methods of establishing a data connection.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as a memory 704 including instructions executable by the processor 720 of the terminal device 700 to perform the above-described method of establishing a data connection. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In another exemplary embodiment, a computer program product is also provided, comprising a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-described method of establishing a data connection when executed by the programmable apparatus.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for establishing a data connection, applied to a terminal device, comprising:
Acquiring a current access point name APN parameter corresponding to the terminal equipment;
establishing data connection with network equipment according to the current APN parameter;
under the condition of abnormal data connection established according to the current APN parameter, acquiring a target APN parameter;
re-establishing data connection with the network equipment according to the target APN parameter;
the obtaining the target APN parameter includes:
acquiring a pre-stored historical APN parameter, and updating the current APN parameter according to the historical APN parameter to obtain the target APN parameter;
the updating the current APN parameter according to the historical APN parameter to obtain the target APN parameter comprises the following steps:
determining a first parameter to be adjusted from the current APN parameters according to a preset parameter adjustment sequence;
determining a first target historical parameter corresponding to the first parameter to be adjusted from the historical APN parameter;
and updating the first parameter to be adjusted through the first target history parameter to obtain the target APN parameter.
2. The method of claim 1, wherein the data connection anomaly comprises:
failure of data connection establishment; or alternatively, the process may be performed,
after the data connection is established successfully, the data path of the terminal equipment cannot transmit data.
3. The method according to claim 1, wherein the method further comprises:
under the condition that the data connection established with the network equipment is abnormal again according to the target APN parameter, the connection establishment step is executed circularly until the data connection established according to the target APN parameter is normal;
the connection establishment step includes:
determining a second parameter to be adjusted from the current APN parameters according to the preset parameter adjustment sequence, wherein the second parameter to be adjusted is the next parameter to be adjusted of the first parameter to be adjusted;
determining a second target historical parameter corresponding to the second parameter to be adjusted from the historical APN parameter;
updating the second parameter to be adjusted through the second target history parameter to obtain a new target APN parameter, and establishing data connection with the network equipment according to the new target APN parameter;
and under the condition that the data connection established according to the new target APN parameter is abnormal, taking the updated second parameter to be adjusted as a new first parameter to be adjusted.
4. A method according to claim 3, characterized in that the method further comprises:
and under the condition that the data connection established according to the current APN parameter is normal, taking the current APN parameter as a new effective APN parameter.
5. An apparatus for establishing a data connection, applied to a terminal device, comprising:
the current parameter acquisition module is configured to acquire a current APN parameter corresponding to the terminal equipment;
a first data connection establishing module configured to establish a data connection with a network device according to the current APN parameter;
the target parameter acquisition module is configured to acquire target APN parameters under the condition that the data connection established according to the current APN parameters is abnormal;
a second data connection establishment module configured to reestablish a data connection with the network device according to the target APN parameter;
the target parameter acquisition module comprises:
a history parameter obtaining sub-module configured to obtain a pre-stored history APN parameter, and update the current APN parameter according to the history APN parameter to obtain the target APN parameter;
the history parameter acquisition sub-module is configured to:
determining a first parameter to be adjusted from the current APN parameters according to a preset parameter adjustment sequence, wherein the preset parameter adjustment sequence is determined according to the number of times that each parameter has errors in a preset time period;
determining a first target historical parameter corresponding to the first parameter to be adjusted from the historical APN parameter;
And updating the first parameter to be adjusted through the first target history parameter to obtain the target APN parameter.
6. The apparatus of claim 5, wherein the data connection anomaly comprises:
failure of data connection establishment; or alternatively, the process may be performed,
after the data connection is established successfully, the data path of the terminal equipment cannot transmit data.
7. The apparatus of claim 5, wherein the apparatus further comprises:
a third data connection establishment module configured to, in the event of abnormality in the data connection re-established with the network device according to the target APN parameter, perform a connection establishment step in a loop until the data connection established according to the target APN parameter is normal;
the connection establishment step includes:
determining a second parameter to be adjusted from the current APN parameters according to the preset parameter adjustment sequence, wherein the second parameter to be adjusted is the next parameter to be adjusted of the first parameter to be adjusted;
determining a second target historical parameter corresponding to the second parameter to be adjusted from the historical APN parameter;
updating the second parameter to be adjusted through the second target history parameter to obtain a new target APN parameter, and establishing data connection with the network equipment according to the new target APN parameter;
And under the condition that the data connection established according to the new target APN parameter is abnormal, taking the updated second parameter to be adjusted as a new first parameter to be adjusted.
8. The apparatus of claim 7, wherein the apparatus further comprises:
and the effective parameter updating module is configured to take the current APN parameter as a new effective APN parameter under the condition that the data connection established according to the current APN parameter is normal.
9. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the steps of the method of any of claims 1 to 4.
10. A terminal device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of claims 1 to 4.
CN202011413562.0A 2020-12-04 2020-12-04 Method, device, storage medium and terminal equipment for establishing data connection Active CN112584547B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011413562.0A CN112584547B (en) 2020-12-04 2020-12-04 Method, device, storage medium and terminal equipment for establishing data connection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011413562.0A CN112584547B (en) 2020-12-04 2020-12-04 Method, device, storage medium and terminal equipment for establishing data connection

Publications (2)

Publication Number Publication Date
CN112584547A CN112584547A (en) 2021-03-30
CN112584547B true CN112584547B (en) 2023-04-25

Family

ID=75128299

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011413562.0A Active CN112584547B (en) 2020-12-04 2020-12-04 Method, device, storage medium and terminal equipment for establishing data connection

Country Status (1)

Country Link
CN (1) CN112584547B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115150805A (en) * 2021-03-31 2022-10-04 北京小米移动软件有限公司 Network communication optimization method and device, electronic equipment and storage medium
CN113382458B (en) * 2021-06-28 2023-08-11 西安广和通无线通信有限公司 Equipment network-resident dialing method, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105338596A (en) * 2015-11-17 2016-02-17 小米科技有限责任公司 Data service establishing method and device
CN106658673A (en) * 2015-10-29 2017-05-10 中兴通讯股份有限公司 APN selection method and device
CN107333255A (en) * 2017-06-28 2017-11-07 深圳市沃特沃德股份有限公司 Network parameter matching process and its device and system
CN107484239A (en) * 2017-08-22 2017-12-15 奇酷互联网络科技(深圳)有限公司 Network registry abnormality eliminating method, device and user terminal
CN111836356A (en) * 2019-04-23 2020-10-27 北京小米移动软件有限公司 Method, device, storage medium and mobile terminal for requesting data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080293407A1 (en) * 2007-05-24 2008-11-27 Jean-Philippe Cormier Wireless Device and Method for Determining Which APN to Use

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106658673A (en) * 2015-10-29 2017-05-10 中兴通讯股份有限公司 APN selection method and device
CN105338596A (en) * 2015-11-17 2016-02-17 小米科技有限责任公司 Data service establishing method and device
CN107333255A (en) * 2017-06-28 2017-11-07 深圳市沃特沃德股份有限公司 Network parameter matching process and its device and system
CN107484239A (en) * 2017-08-22 2017-12-15 奇酷互联网络科技(深圳)有限公司 Network registry abnormality eliminating method, device and user terminal
CN111836356A (en) * 2019-04-23 2020-10-27 北京小米移动软件有限公司 Method, device, storage medium and mobile terminal for requesting data

Also Published As

Publication number Publication date
CN112584547A (en) 2021-03-30

Similar Documents

Publication Publication Date Title
EP3171620B1 (en) Method and apparatus for establishing connection to data service
TWI393464B (en) Apparatus and methods for network identification of open market wireless devices
CN112637436B (en) IMS registration method and device, communication equipment and storage medium
CN109005096B (en) Application interaction method and device
CN104320774B (en) Upgrading method, device and equipment
CN112584547B (en) Method, device, storage medium and terminal equipment for establishing data connection
US11109201B2 (en) Device and method for provisioning services to mobile communication device
CN107454660B (en) Network residing method and device after authentication failure
CN106535166B (en) Data service processing method and device
CN107666660B (en) Interphone configuration method and device
CN106714255B (en) Voice call processing method, device and terminal
CN111294230B (en) Parameter acquisition method and device
CN113259927B (en) Terminal capability updating method, device and storage medium
CN108696914B (en) Method and device for scanning intelligent equipment and storage medium
CN116760867B (en) Digital car key creation method, device, storage medium and system
CN108207019B (en) Method and device for registering network
CN114374672B (en) Method, device, electronic equipment and storage medium for initiating telephone service
CN113821244B (en) Offline package updating method, device, system, electronic equipment and storage medium
CN115134231B (en) Communication method, device and device for communication
CN115150805A (en) Network communication optimization method and device, electronic equipment and storage medium
CN115915194A (en) APN updating method and device, terminal equipment, server and storage medium
US20230209324A1 (en) Communication method and apparatus, and storage medium
CN107992333B (en) Theme acquisition method and device
CN116506974A (en) Network establishment method, device, electronic equipment and medium for access point double online
CN116684990A (en) Voice call method, device and storage medium

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