Mobile network connection method and electronic device
By modifying the underlying IP type to be consistent with the mobile network after the electronic device receives a rejection message, the access failure problem caused by inconsistent IP types is solved, and the mobile network access success rate and user experience are improved.
Patent Information
- Application Number
- CN202311103560.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-29
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2043-08-29
Smart Images

Figure HDA0004421506670000011 
Figure HDA0004421506670000021 
Figure HDA0004421506670000031
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a mobile network connection method and electronic device. Background Art
[0002] When using electronic devices, they often access the mobile network provided by the operator to meet the user's Internet access needs, such as using the 5G mobile network to play videos. When requesting access to the mobile network provided by the operator, the electronic device needs to send a data service activation request carrying the Internet Protocol (IP) type to the operator's network equipment (such as a base station). The IP type indicates the network protocol type configured for the electronic device, such as Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6).
[0003] However, when the IP type carried by the electronic device when requesting to access the mobile network is inconsistent with the IP type supported by the operator, that is, the IP type of the mobile network, the electronic device will not be able to access the mobile network, resulting in failure of the electronic device to access the Internet. Summary of the Invention
[0004] In view of this, the present application provides a mobile network connection method and electronic device, which can reduce the probability of failure of the electronic device to access the Internet.
[0005] In a first aspect, the present application provides a mobile network connection method. The method is applied to an electronic device, the electronic device being located within the coverage of a first mobile network, where the IP type of the first mobile network is a first type. The electronic device may send a first PDN connection request to a network device, the first PDN connection request may include information that the IP type is a second type, and the first mobile network is provided by the network device.
[0006] The electronic device receives a first rejection message sent by the network device, the first rejection message including information about a reason value for request rejection. The first type is IPv4, and accordingly, the reason for request rejection includes at least one of: the network only supports IPv6 and the service is not subscribed; or the first type is IPv6, and accordingly, the reason for request rejection includes at least one of: the network only supports IPv4 and the service is not subscribed.
[0007] Based on the first rejection message, the electronic device sends a second PDN connection request to the network device, wherein the second PDN connection request includes information that the IP type is a first type, and the first type is different from the second type.
[0008] The electronic device receives a request acceptance message sent by the network device, where the request acceptance message includes information on a reason value indicating that the request is accepted.
[0009] In the present application, when an electronic device needs to access a first mobile network, it can send a PDN connection request, i.e., a first PDN connection request, to a network device to activate a data service. The first PDN connection request carries the IP type of the underlying configuration of the electronic device, which is the second type and is different from the IP type of the first network. Afterwards, when the electronic device receives the first rejection message sent by the network device, it indicates that the PDN connection has failed, i.e., the data service activation has failed. The reason for the failure is that the network only supports IPv4 type, the network only supports IPv6 type, the service is not subscribed, etc., indicating that the electronic device may be caused by the inconsistency between the IP type of the underlying configuration of the electronic device and the IP type of the first mobile network requested for access. The electronic device can continue to send a PDN connection request, i.e., a second PDN connection request, using the underlying configuration IP type that is consistent with the IP type of the first mobile network, thereby specifically solving the problem of data service activation failure, improving the success rate of mobile network access, thereby ensuring the Internet access function of the electronic device and improving the user experience.
[0010] In a possible implementation of the first aspect, the first type of information, i.e., the first type, is of IPv4 type, and the second type of information, i.e., the second type, is of IPv6 type; or, the first type is of IPv6 type, and the second type is of IPv4 type.
[0011] In a possible implementation of the first aspect, the information of the reason value for accepting the request (that is, the reason value for accepting the request) may be 0, wherein the reason value for receiving the request is 0 indicating that the PDN connection is successful. Based on this, the electronic device determines whether the PDN connection is successful through a response message corresponding to the second PDN connection request. When the reason value included in the response message is 0, indicating that the PDN connection is successful, the response message can be considered as a request reception message, the electronic device successfully activates the data service, and can use the first mobile network to access the Internet.
[0012] In a possible implementation of the first aspect, the process of the electronic device sending the second PDN connection request to the network device based on the first rejection message may include:
[0013] In the case where the reason value for request rejection contained in the above-mentioned first rejection message is one of 33, 50 or 51, it indicates that the PDN connection failed, that is, the failure to activate the data service may be caused by the inconsistency between the IP type carried by the PDN connection request and the IP type of the first mobile network. The electronic device can send a second PDN connection request to the network device, and the IP type carried by the second PDN connection request is consistent with the IP type of the first mobile network. Among them, the reason value for request rejection is 33, which indicates that the reason for request rejection is that the service is not subscribed, the reason value for request rejection is 50, which indicates that the reason for request rejection is that the network only supports IPv4 type, and the reason value for request rejection is 51, which indicates that the reason for request rejection is that the network only supports IPv6 type.
[0014] In this application, when the reason for the failure of data service activation is related to the inconsistency of IP types, the electronic device uses the IP type of the first mobile network to re-request access to the first mobile network, so as to increase the probability of successful mobile network access and achieve targeted solution to the problem.
[0015] In a possible implementation of the first aspect, an electronic device receives a first operation input by a user. Subsequently, in response to the first operation, the electronic device sends a first PDN connection request to a network device. A status bar on a display interface of the electronic device does not include a first icon, thereby enabling a mobile network function. The first icon is not displayed in the status bar of the electronic device until the electronic device successfully connects to the first mobile network.
[0016] After the electronic device receives the request acceptance message sent by the network device, that is, after the electronic device successfully accesses the first mobile network, the status bar of the display interface of the electronic device includes a first icon to intuitively inform the user that the electronic device has successfully accessed the mobile network and can use the mobile network to access the Internet.
[0017] The first icon may include a first mobile network icon, and the first mobile network icon is used to prompt that the network used by the electronic device is a mobile network.
[0018] Optionally, before or after the electronic device successfully connects to the first mobile network, the electronic device may display a mobile network type icon and a signal quality icon. The mobile network type icon is used to indicate the type of network coverage of the electronic device. For example, if the mobile network type icon is a 5G network icon, it indicates that the mobile phone is within the coverage of the 5G network. The signal quality icon indicates the signal quality of the network where the mobile phone is located.
[0019] In a possible implementation of the first aspect, after receiving the first rejection message, the electronic device may first repeat, that is, resend the first PDN connection request to the network device to perform self-healing. After the self-healing is completed, the electronic device may send a second PDN connection request to the network device. Based on this, after the data service activation fails, if the electronic device has self-healing business logic, it can first perform the self-healing action. After the self-healing is completed, the IP type of the underlying configuration consistent with the IP type of the first mobile network, that is, the modified IP type of the underlying configuration, is used for the PDN connection, thereby reducing the modification of the business logic.
[0020] In a possible implementation of the first aspect, the process of the electronic device sending the first PDN connection request to the network device may include:
[0021] The electronic device searches for the first APN parameter based on the information of the target SIM card in the electronic device; wherein the first APN parameter includes information that the first APN name and the IP type are of the first type; the target SIM card is the SIM card used by the electronic device to request access to the first mobile network, and the first APN parameter represents the APN parameter configured by the upper layer of the electronic device.
[0022] The electronic device determines whether the electronic device has underlying configured APN parameters that include the first APN name. If so, that is, the second APN parameter exists, the electronic device can send a first PDN connection request to the network device based on the information that the IP type in the second APN parameter is the second type, that is, the underlying configured IP type, to activate the data service.
[0023] In a possible implementation of the first aspect, after the data service activation fails, in order to avoid the electronic device's failure to access the Internet due to the inconsistency between the underlying configured IP type and the IP type of the first mobile network requested to access, the electronic device can modify the information that the IP type in the second APN parameter is the second type to information that the IP type is the first type, that is, change the underlying configured IP type from the second type to the first type to be consistent with the IP type of the first mobile network.
[0024] In a possible implementation of the first aspect, the electronic device may add a first flag bit, which is used to indicate whether the IP type of the bottom layer configuration is consistent with the IP type of the upper layer configuration. The electronic device determines that the IP type in the second APN parameter is inconsistent with the IP type in the first APN parameter, indicating that the IP type of the bottom layer configuration is inconsistent with the IP type of the upper layer configuration, and the electronic device sets the first flag bit as the first identifier. Accordingly, after the data service activation fails, the electronic device determines that the first flag bit is the first identifier, and the electronic device modifies the information that the IP type in the second APN parameter is the second type to the information that the IP type is the first type, thereby modifying the IP type of the bottom layer configuration, so that the electronic device can use the modified IP type to activate the data service, thereby improving the success rate of data service activation.
[0025] Optionally, the first identifier may be true, and the second identifier may be false.
[0026] In a possible implementation of the first aspect, after the IP type of the underlying configuration is modified, the electronic device can set the first flag position to a second identifier, where the second identifier indicates that the IP type in the first APN parameter is the same as the IP type in the second APN parameter, so as to avoid the electronic device making unnecessary modifications to the IP type of the underlying configuration.
[0027] In a possible implementation of the first aspect, when the above-mentioned electronic device is in the location where the number corresponding to the target SIM card belongs, the above-mentioned IP type may be a local IP type. Accordingly, the above-mentioned first PDN connection request includes information that the local IP type is the second type, and the second PDN connection request includes information that the local IP type is the first type.
[0028] When the above-mentioned electronic device is not in the location where the number corresponding to the target SIM card belongs, the above-mentioned IP type may be a roaming IP type. Accordingly, the above-mentioned first PDN connection request includes information that the roaming IP type is the second type, and the second PDN connection request includes information that the roaming IP type is the first type.
[0029] In a second aspect, the present application provides a chip, comprising a communication interface and at least one processor:
[0030] The communication interface is used to input and / or output signaling or data;
[0031] The at least one processor is configured to execute a computer program to implement the mobile network connection method as described in any one of the first aspects above.
[0032] In a possible implementation manner of the second aspect, the chip may be referred to as an application processor, AP processor, AP chip, processor, etc.
[0033] In a possible implementation of the second aspect, the chip may use a baseband processor to send a PDN connection request (such as the first PDN connection request and the second PDN connection request) to the network device, and use the baseband processor to receive a response message (such as the first rejection message and the request acceptance message) corresponding to the PDN connection request sent by the network device.
[0034] In a third aspect, the present application provides an electronic device, comprising a display screen, a memory, and one or more processors; the display screen, the memory, and the processor are coupled; the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, wherein the computer program code comprises computer instructions; when the processor executes the computer instructions, the electronic device executes the mobile network connection method as described in any one of the first aspects above.
[0035] The electronic device further comprises a mobile communication module, which is coupled to the processor and is used to enable the electronic device to access a mobile network.
[0036] In a fourth aspect, the present application provides a computer-readable storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the mobile network connection method as described in any one of the first aspects above.
[0037] In a fifth aspect, the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the mobile network connection method as described in any one of the first aspects above.
[0038] It can be understood that the beneficial effects that can be achieved by the chip described in the second aspect, the electronic device described in the third aspect, the computer storage medium described in the fourth aspect, and the computer program product described in the fifth aspect provided above can refer to the beneficial effects in the first aspect and any possible implementation thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1A Schematic diagram 1 of an interface displaying APN parameters provided in an embodiment of the present application;
[0040] Figure 1B Schematic diagram 2 of an interface displaying APN parameters provided in an embodiment of the present application;
[0041] Figure 1C Schematic diagram of an interface displaying APN parameters provided in an embodiment of the present application Figure 3 ;
[0042] Figure 1D Schematic diagram of an interface displaying APN parameters provided in an embodiment of the present application Figure 4 ;
[0043] Figure 1E Schematic diagram of an interface displaying APN parameters provided in an embodiment of the present application Figure 5 ;
[0044] Figure 1F Schematic diagram of an interface displaying APN parameters provided in an embodiment of the present application Figure 6 ;
[0045] Figure 2A Schematic diagram 7 of an interface displaying APN parameters provided in an embodiment of the present application;
[0046] Figure 2B Schematic diagram of an interface displaying APN parameters provided in an embodiment of the present application Figure 8 ;
[0047] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0049] Figure 5 Schematic diagram 1 of a flow chart of a mobile network connection method provided in an embodiment of the present application;
[0050] Figure 6 Schematic diagram 1 of an interface for activating a scene provided in an embodiment of the present application;
[0051] Figure 7A A second schematic diagram of an activation scene interface provided in an embodiment of the present application;
[0052] Figure 7B An example of an activation scene interface provided in this application embodiment Figure 3 ;
[0053] Figure 7C An example of an activation scene interface provided in this application embodiment Figure 4 ;
[0054] Figure 7D An example of an activation scene interface provided in this application embodiment Figure 5 ;
[0055] Figure 7E An example of an activation scene interface provided in this application embodiment Figure 6 ;
[0056] Figure 7FSchematic diagram 7 of an activation scene interface provided in an embodiment of the present application;
[0057] Figure 7G An example of an activation scene interface provided in this application embodiment Figure 8 ;
[0058] Figure 8 Schematic diagram 2 of a flow chart of a mobile network connection method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described in the present application as "exemplary" or "for example" should not be interpreted as being more preferred or advantageous than other embodiments or design. To be precise, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In the embodiments of the present application, "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, the meaning of "multiple" is two or more.
[0060] To facilitate understanding of the embodiments of the present application, some terms involved in the embodiments of the present application are explained below.
[0061] Access point name (APN): It is a parameter that needs to be configured when an electronic device accesses a mobile network. It determines the access method used by the electronic device to access the mobile network.
[0062] IPv4: It is a version of the Internet Protocol. IPv4 uses a 32-bit address to identify devices on the network. IPv4 addresses are binary numbers represented as decimals.
[0063] IPv6: Compared to IPv4, IPv6 provides a larger address space and uses 128-bit addresses to identify devices on the network. IPv6 addresses are binary numbers expressed in hexadecimal notation. In addition, IPv6 offers new features compared to IPv4, such as authentication and data encryption.
[0064] The above introduces some terms involved in this application, and the following will begin to introduce the solution of this application.
[0065] With the development of IPv6 technology, more and more operators (that is, mobile networks provided by operators) have begun to support IPv6 types, and some operators may only support IPv6 types. In the process of using electronic devices (such as mobile phones), mobile phones often access the mobile network provided by the operator corresponding to the SIM card in the mobile phone to achieve Internet access. In order to achieve access to the mobile network, the mobile phone can send a data service activation request (or network connection request) to the network equipment (such as a base station) of the operator corresponding to the SIM card. The network connection request includes the IP type configured for the mobile phone. After the network device receives the network connection request, it responds to the network connection request. If the IP type configured for the mobile phone is different from the IP type of the mobile network requested to be accessed, the mobile phone is denied access to the mobile network, resulting in failure of the mobile phone to access the mobile network and inability to access the Internet, affecting the user experience.
[0066] For example, the operator only supports IPv6 type, that is, the IP type of the mobile network is IPv6 type, while the IP type configured for the mobile phone is IPv4 type. The two are different, resulting in the mobile phone being unable to access the mobile network, and thus the mobile phone being unable to access the Internet.
[0067] In some embodiments, the IP type configured in the mobile phone is related to the mobile phone's APN configuration, and the APN parameters may include the IP type. The APN parameters (e.g., IP type) carried by the mobile phone when requesting access to a mobile network are generally the APN parameters configured in the mobile phone's underlying configuration, and are not dependent on the APN parameters configured in the mobile phone's upper layer. In other words, the APN parameters configured in the mobile phone's upper layer will not take effect. The APN parameters configured in the mobile phone's underlying configuration may differ from the APN parameters configured in the mobile phone's upper layer, while the APN parameters configured in the mobile phone's upper layer are generally the same as the APN parameters of the mobile network requested for access. Therefore, the APN parameters configured in the mobile phone's underlying configuration may differ from the APN parameters of the mobile network requested for access. As a result, when the mobile phone requests access to a mobile network based on the APN parameters configured in the mobile phone's underlying configuration, access to the mobile network may fail due to the inconsistency in the APN parameters (e.g., IP type). For example, if the IP type configured in the mobile phone's underlying configuration is IPv4, while the IP type of the mobile network is IPv6 (i.e., the mobile network only supports IPv6 and not IPv4), the inconsistency between the two IP types may prevent the mobile phone from successfully accessing the mobile network.
[0068] Among them, the APN parameters configured at the bottom layer of the mobile phone represent the IP type in the configuration file corresponding to the chip in the mobile phone (such as the system-on-a-chip (SoC) chip). The APN parameters configured at the bottom layer of the mobile phone belong to the hardware layer.
[0069] The APN parameters configured in the upper layer of the mobile phone can be determined by the mobile phone (such as the phone management module in the application framework layer of the mobile phone) based on the information of the SIM card used to request access to the mobile network. Specifically, the information of the SIM card can be public land mobile network (PLMN) information. The mobile phone pre-stores APN parameters provided by one or more operators, and each APN parameter provided by the operator has corresponding PLMN information. The mobile phone reads the PLMN information carried by the SIM card in the mobile phone, and then the mobile phone can search for the APN parameters corresponding to the PLMN information carried by the SIM card to obtain the APN parameters configured in the upper layer of the mobile phone.
[0070] It is understandable that due to reasons such as chip update lags, the APN parameters configured at the bottom layer of the phone may be inconsistent with the APN parameters configured at the upper layer of the phone.
[0071] Optionally, the user can view the APN parameters configured on the mobile phone through the mobile phone. Figure 1A In response to the click operation of the setting application 10, the mobile phone displays the following Figure 1BThe setting interface 11 shown in FIG. 1 may include a mobile network option 12. Afterwards, the user may click on the mobile network option 12. In response to the click operation on the mobile network option 12, the mobile phone may display the following information: Figure 1C The mobile network interface 13 shown in FIG. 1 may include a mobile data option 14. Afterwards, in response to the user clicking on the mobile data option 14, the mobile phone may display the following Figure 1D The mobile data interface 15 is shown and may include an access point name option 16 .
[0072] Afterwards, in response to the user clicking the access point name option 16, the mobile phone may display the following Figure 1E The APN interface 17 shown in FIG. 1 may include an access point detailed information control 18. Afterwards, the mobile phone may display the following information in response to the user clicking the access point detailed information control 18: Figure 1F The access point modification interface 19 shown includes APN parameters (ie, APN parameters configured by the upper layer of the mobile phone), such as the APN parameters that may include APN protocol and APN roaming protocol parameters.
[0073] Among them, the APN protocol refers to the APN local protocol type, that is, the local IP type. The local IP type refers to the IP type used when accessing the mobile network in the area where the number corresponding to the SIM card (that is, the SIM card used to request access to the mobile network) belongs.
[0074] An APN roaming agreement refers to the APN roaming agreement type, also known as the roaming IP type. The roaming IP type refers to the IP type used when accessing a mobile network in a non-number-attributed area, that is, in an area other than the area where the number corresponding to the SIM card belongs.
[0075] It should be noted that the above-described method of entering the interface including the APN parameters configured by the upper layer of the mobile phone through the settings application is only an example. The interface including the APN parameters configured by the upper layer of the mobile phone can also be entered through other methods. For example, the interface of the APN configuration parameters can be entered through the pull-down notification bar of the mobile phone. Specifically, the user can long press Figure 2A In response to the click operation of the mobile network control 21, the mobile phone can display the following information: Figure 2B The mobile data interface 22 shown. Among them, the interface of the APN parameters including the upper layer configuration of the mobile phone can be entered through the mobile data interface 22. Figure 1D-1F The corresponding description is not repeated here.
[0076] It should be understood that the above Figure 2AThe mobile data control 21 is shown in a selected state, and the mobile network function of the mobile phone is enabled, that is, the mobile phone is connected to the mobile network. When the mobile data control 21 is unselected, the mobile network function of the mobile phone is disabled, that is, the mobile phone is not using the mobile network to access the Internet and is not connected to the mobile network. For example, when the mobile data icon 21 is unselected, the color of the mobile data control 21 appears gray. When the mobile data control 21 is selected, the color of the mobile data control 21 appears blue.
[0077] Therefore, in response to the above problems, the present application provides a mobile network connection method. The electronic device is in a scenario where it requests access to a mobile network. For example, the electronic device receives an operation input by a user to trigger the electronic device to turn on the mobile network function. The electronic device determines that the IP type configured in the upper layer of the electronic device (or called IP type 1) is inconsistent with the IP type configured in the bottom layer of the electronic device (or called IP type 2). Afterwards, the electronic device updates the network flag to true, and activates the data service based on the IP type configured in the bottom layer of the electronic device to request access to the mobile network (or called the first mobile network). After the data service activation fails, it indicates that the access to the mobile network has failed. The electronic device determines that the activation failure reason value belongs to the preset failure reason value, indicating that the failure of this data service activation may be due to the inconsistency between the IP type configured in the bottom layer of the electronic device and the IP type of the mobile network requested to access, that is, the IP type carried when requesting access to the mobile network is inconsistent with the IP type of the mobile network. The electronic device can query the network flag.
[0078] After determining that the network flag is true, it indicates that the IP type of the current bottom-level configuration of the electronic device is inconsistent with the IP type of the upper-level configuration. The electronic device can modify the IP type of the bottom-level configuration of the electronic device to the IP type of the upper-level configuration of the electronic device, so that the IP type of the modified bottom-level configuration of the electronic device is consistent with the IP type of the upper-level configuration of the electronic device, that is, consistent with the IP type of the mobile network requested for access. Afterwards, the electronic device can activate the data service based on the modified IP type of the bottom-level configuration of the electronic device. Since the IP type of the modified bottom-level configuration of the electronic device is consistent with the IP type of the mobile network, it can avoid the failure of the electronic device to activate the data service due to the inconsistency between the IP type carried when requesting access to the mobile network and the IP type of the mobile network, that is, the inability to successfully access the mobile network, thereby improving the success rate of mobile network access, thereby ensuring the Internet access function of the electronic device and improving the user experience.
[0079] For example, the electronic device in the embodiments of the present application can be a mobile phone, a tablet computer, a wearable device (such as a smart watch), a personal digital assistant (PDA), a router, a laptop computer, a vehicle-mounted device, an Internet of Things device, etc., which has a SIM card, that is, a device that can access a mobile network. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.
[0080] Figure 3 A schematic structural diagram of the electronic device 100 is shown.
[0081] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0082] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0083] The processor 110 may include one or more processing units, for example, an application processor (AP), a modem processor (or a modem, a baseband processor), a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0084] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0085] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0086] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0087] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0088] The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110 , the internal memory 121 , the external memory, the display 194 , the camera 193 , and the wireless communication module 160 .
[0089] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0090] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0091] The mobile communication module 150 can provide solutions for wireless communications (or mobile networks) such as 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0092] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0093] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0094] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0095] The electronic device 100 implements the display function through the GPU, the display screen 194 , and the application processor, etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
[0096] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0097] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0098] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0099] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0100] Among them, the above-mentioned sensor module 180 may include one or more of a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor 180G, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor and a bone conduction sensor.
[0101] The buttons 190 include a power button, a volume button, etc. The motor 191 can generate a vibration prompt.
[0102] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0103] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0104] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0105] Figure 4 FIG. 1 is a structural block diagram of an electronic device 100 according to an embodiment of the present invention.
[0106] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers: from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, the hardware abstraction layer (HAL), and the kernel layer.
[0107] The application layer can include a series of application packages.
[0108] like Figure 4 As shown, the application package may include applications such as camera, settings, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0109] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0110] like Figure 4As shown, the application framework layer may include a window manager, a content provider, a view system, a phone management module, a resource manager, a notification manager, and the like.
[0111] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0112] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0113] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0114] The telephony management module (telephony) is used to provide communication functions for the electronic device 100. For example, the mobile network access status. In this application, a new network flag is added to the telephony management module. This network flag is used to indicate whether the IP type configured at the bottom layer of the electronic device is consistent with the IP type configured at the upper layer of the electronic device. The telephony management module (also known as the telephony manager or telephony management service) can update the specific value of the network flag.
[0115] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0116] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0117] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0118] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0119] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0120] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0121] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0122] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0123] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0124] A 2D graphics engine is a drawing engine for 2D drawings.
[0125] The hardware abstraction layer is the interface layer between the operating system kernel and the hardware circuit. Figure 4 As shown, the hardware abstraction layer may include a radio layer interface (RIL).
[0126] ril can be used to determine the APN parameters of the electronic device's bottom layer configuration. Optionally, ril can also determine whether the APN parameters of the electronic device's bottom layer configuration are consistent with the APN parameters of the electronic device's upper layer configuration.
[0127] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0128] The software system to which the aforementioned software layer belongs can be a software system located on an AP chip, that is, the program code running on the AP chip. The AP chip can be connected to a modem via a bus, enabling communication between the AP chip and the modem. For example, the RIL can send the APN parameters configured in the underlying electronic device to the modem, so that the modem can activate data services using the APN parameters configured in the underlying electronic device. A modem can also be described as a modem processor, or as a baseband processor, baseband chip, or modem chip.
[0129] An embodiment of the present application provides a mobile network connection method. The electronic device is provided with a network flag, which is used to indicate whether the IP type of the bottom layer configuration of the electronic device is consistent with the IP type of the upper layer configuration of the electronic device. When the electronic device determines that the IP type of the bottom layer configuration of the electronic device is inconsistent with the IP type of the upper layer configuration of the electronic device, the electronic device can update the network flag to true, so that after determining that the activation failure reason value is a preset reason value, it indicates that the reason for the failure of the electronic device to activate is due to the inconsistency between the IP type of the bottom layer configuration of the electronic device and the IP type of the mobile network. The electronic device can modify the IP type of the bottom layer configuration of the electronic device to the IP type of the upper layer configuration of the electronic device, so that the modified IP type of the bottom layer configuration of the electronic device is consistent with the IP type of the mobile network, so that the electronic device can successfully activate the data service and access the Internet through the mobile network.
[0130] The following will take the above-mentioned electronic device as a mobile phone as an example to specifically introduce a mobile network connection method provided by the embodiment of the present application. Figure 5 As shown, the method includes S501-S513.
[0131] S501: The mobile phone receives a first operation input by a user.
[0132] Optionally, the first operation may be an operation for triggering the mobile phone to enable a mobile network function.
[0133] S502: In response to the first operation, the mobile phone displays a first mobile network icon on the status bar.
[0134] The first mobile network icon is used to indicate that the network used by the mobile phone is a mobile network. Figure 6 The first mobile network icon 30 is shown. Figure 6It may also include a mobile network type icon 40 and a signal quality icon 41. The mobile network type icon 40 is used to indicate the type of network coverage of the mobile phone. For example, if the mobile network type icon is a 5G network icon, it means that the mobile phone is within the 5G network coverage. The signal quality icon 41 indicates the signal quality of the network where the mobile phone is located.
[0135] Optionally, when the mobile network function is not turned on, the status bar of the mobile phone does not include the above Figure 6 The mobile network icon 30 shown may include the above Figure 6 The mobile network type icon 40 and the signal quality icon 41 are shown. It can be seen that no matter whether the mobile network function is turned on or not, the status bar of the mobile phone can display the mobile network type icon 40 and the signal quality icon 41.
[0136] In some embodiments, the first operation may be a user turning on a mobile network switch (or mobile data switch). When the user turns on the mobile data switch, the mobile phone responds to the turning on operation of the mobile data switch and switches the mobile network switch from an off state (e.g., Figure 7A The mobile data switch 31 is in the off state as shown) and is switched to the on state (as shown Figure 7B The mobile data switch 32 shown is in the on state), turning on the mobile network function, triggering the mobile phone to activate the data service to request access to the mobile network (such as 4G, 5G and other types of mobile networks). After the mobile network function is turned on, the mobile phone can also display the following on the status bar: Figure 7B The first mobile network icon 33 is shown to inform the user that the mobile network function of the mobile phone has been turned on. Among them, data service refers to the establishment of a data connection between the mobile phone and the mobile network to transmit data (such as browsing web pages, downloading files, etc.) through the mobile network to achieve Internet access.
[0137] Alternatively, the first operation may be a user selecting a mobile network control (or mobile data control, such as a mobile data control) in an unselected state on a pull-down notification bar displayed on a mobile phone. Figure 7C In response to the user's click operation on the mobile data control 34, the mobile phone switches the mobile data control 34 to the selected state (such as the selected state). Figure 7D The mobile network control 35 in the selected state is shown in the status bar. Figure 7D A first mobile network icon 36 is shown.
[0138] Among them, on the display interface (such as the pull-down notification bar), the mobile data control can be presented as a second mobile network icon, that is, the mobile data control can be presented in the form of an icon.
[0139] Alternatively, the first operation may be a user triggering the power button of the mobile phone. In response to the user triggering the power button, the mobile phone turns on and turns on the mobile network function. For example, the mobile phone is in a power-off state. In response to the user triggering the power button, the mobile phone turns on and turns on the mobile network function. Figure 7E The triggering operation of the power button 36 is shown to start the machine and display the power-on animation. The power-on animation may include at least one frame of the power-on screen, such as Figure 7F The picture shown is one of the at least one boot screen frames. Figure 7G As shown, the mobile phone can display a desktop and a status bar, and the status bar can include a first mobile network icon 37, indicating that the mobile network function of the mobile phone has been turned on.
[0140] It should be understood that if the mobile network function of the mobile phone is turned on before the phone is turned off, the mobile network function will be automatically turned on after the phone is turned on. If the mobile network function of the mobile phone is turned off, the user will need to re-enable the mobile network after turning the phone on.
[0141] It should be noted that the above-mentioned user operation of turning on the mobile data switch, clicking the mobile data control on the pull-down notification bar, and triggering the power button of the mobile phone are only a few example operations of the first operation. The first operation can also be other operations that can trigger the mobile phone to turn on the mobile network function. This application does not limit the first operation.
[0142] S503: The mobile phone sets the network flag to false.
[0143] Optionally, the mobile phone setting the network flag to false may be considered as an initialization process.
[0144] S504: The mobile phone obtains APN parameter 1. The APN parameter 1 is determined based on information of the target SIM card in the mobile phone, and the APN parameter 1 includes IP type 1.
[0145] The target SIM card is a SIM card used to access a mobile network.
[0146] Exemplarily, the information of the target SIM card may be the PLMN information carried by the target SIM card. The mobile phone searches for the APN parameters corresponding to the PLMN information carried by the target SIM card and obtains APN parameter 1 (or the first APN parameter). APN parameter 1 refers to the APN parameter configured by the upper layer of the mobile phone. The APN parameter 1 may also include APN name 1 (or the first APN name). In addition, the APN parameter 1 may also include other parameters, such as mobile country code (MCC) and mobile network code (MNC), MMS port, authentication type, MMS agent, MVNO type and other parameters. This application does not limit the parameters included in APN parameter 1.
[0147] Optionally, before executing the above S503, the mobile phone may query the network flag bit. If the above network flag bit is false, there is no need to execute the above S503.
[0148] In some embodiments, the IP type 1 may be a local IP type 1 or a roaming IP type 1. If the mobile phone is currently located in the same region as the number corresponding to the target SIM card (i.e., the location of the number), the IP type 1 may include a local IP type 1. If the mobile phone is currently located in a different region than the number corresponding to the target SIM card (i.e., a region outside the number's location, such as a foreign country), the IP type 1 may include a roaming IP type 1.
[0149] In addition, if there is no roaming IP type 1 in the mobile phone and the mobile phone is not in the place where the number belongs, the local IP type 1 can be used as the roaming IP type 1.
[0150] S505: The mobile phone determines whether the target configuration file exists, wherein the target configuration file includes APN parameter 2, and APN parameter 2 includes IP type 2.
[0151] The APN parameter 2 (or the second APN parameter) indicates the APN parameter configured at the bottom layer of the mobile phone, and is the APN parameter carried by the mobile phone when requesting access to the mobile network.
[0152] In this embodiment of the present application, the mobile phone can determine whether the target configuration file exists, that is, whether the APN parameters configured in the underlying configuration of the mobile phone exist. If the target configuration file does not exist, it indicates that the APN parameters configured in the underlying configuration of the mobile phone do not exist, and the mobile phone can execute S506. If the target configuration file exists, it indicates that the APN parameters configured in the underlying configuration of the mobile phone exist, and the mobile phone can execute S508.
[0153] In some embodiments, the APN parameter 2 may further include an APN name 2, and the target configuration file refers to a configuration file corresponding to the APN name 1, that is, a configuration file including the same APN name 2 as the APN name 1. Accordingly, the implementation process of S505 may include: the mobile phone may determine whether the mobile phone stores a configuration file including the same APN name 2 as the APN name 1. If a configuration file including the same APN name 2 as the APN name 1 exists, it indicates that the APN name 2 in the configuration file is the same as the APN name 1, and the mobile phone may use the configuration file as the target configuration file. Accordingly, the mobile phone may determine that the target configuration file exists.
[0154] If there is no configuration file including the same APN name 2 as APN name 1, it indicates that the APN name 2 and APN name 1 in each configuration file stored in the mobile phone are different. Accordingly, the mobile phone can determine that the target configuration file does not exist.
[0155] S506: The mobile phone creates a target configuration file based on the above APN parameter 1.
[0156] Among them, the APN parameter in the target configuration file created by the mobile phone is APN parameter 1, that is, the APN parameter configured at the bottom layer of the mobile phone is consistent with the APN parameter configured at the upper layer of the mobile phone.
[0157] S507: The mobile phone sends a data service activation request to the network device based on the created target configuration file.
[0158] In an embodiment of the present application, the mobile phone can use the APN parameters in the created target configuration file (here APN parameter 1) to activate the data service (packet service, PS), such as sending a data service activation request to the base station. The data service activation request carries IP type 1 to attempt to access the mobile network and obtain the corresponding activation result.
[0159] Optionally, the activation result indicates whether the data service was successfully activated, that is, whether mobile network access was successful. If the activation result indicates successful activation, it indicates that mobile network access was successful, the mobile phone has been assigned an IP address and other parameters, and the mobile phone can access the Internet via the mobile network. If the activation result indicates failed activation, it indicates that mobile network access failed, the mobile phone is unable to access the Internet via the mobile network, and the mobile phone can perform self-healing actions.
[0160] It should be understood that, generally speaking, since the APN parameters in the target configuration file created above are consistent with the APN parameters of the mobile network corresponding to the target SIM card (ie, the mobile network requested to access), the mobile phone can successfully access the mobile network.
[0161] In some embodiments, if the mobile phone determines that the mobile phone is currently in the region to which the number corresponding to the target SIM card belongs, the IP type carried in the data service activation request is local IP type 1. Alternatively, if the mobile phone determines that the mobile phone is currently not in the region to which the number corresponding to the target SIM card belongs, such as if the mobile phone is located abroad, the IP type carried in the data service activation request is roaming IP type 1.
[0162] In an embodiment of the present application, if the target configuration file does not exist for the mobile phone, it indicates that the APN parameters configured at the bottom layer of the mobile phone do not exist, but the APN parameters configured at the bottom layer of the mobile phone still need to be used to request access to the mobile network. Therefore, the mobile phone can use the APN parameters configured at the upper layer of the mobile phone as the APN parameters configured at the bottom layer of the mobile phone, so that the mobile phone can send a data service activation request carrying the APN parameters configured at the bottom layer of the mobile phone (such as the IP type) to the network equipment of the operator (such as a base station) to request access to the mobile network provided by the operator. Since the IP type carried by the data service activation request is actually the IP type configured at the upper layer of the mobile phone, the IP type carried by the data service activation request is the same as the IP type of the mobile network requested for access, which can avoid the situation where the mobile network cannot be accessed due to the IP type carried by the mobile phone when requesting the mobile network being different from the IP type of the mobile network.
[0163] The above describes the process of activating data services by the mobile phone after S505 when it is determined that the mobile phone does not have the target configuration file. The following will continue to describe the process of activating data services by the mobile phone after S505 when it is determined that the mobile phone does have the target configuration file.
[0164] S508: The mobile phone updates the network flag to true. Wherein, IP type 2 is different from IP type 1.
[0165] S509: The mobile phone sends a data service activation request to the network device based on the target configuration file.
[0166] The data service activation request is also known as a packet data network (PDN) connection request. A PDN is a network within a mobile network that supports data service transmission. When a phone's mobile network function is enabled, it requests a PDN connection to transmit data over the mobile network, activating the data service.
[0167] Optionally, the above S509 can be replaced with the description that the mobile phone sends a PDN connection request carrying information that the IP type is the second type to the network device, where the information that the IP type is the second type refers to the IP type configured in the underlying layer.
[0168] S510: After activation fails, the mobile phone repeatedly sends a data service activation request to the network device.
[0169] Optionally, the mobile phone repeatedly sending the data service activation request to the network device can be considered as the mobile phone performing a self-healing action. That is, after the activation fails, the mobile phone can perform a self-healing action to re-request access to the mobile network.
[0170] S511: After activation fails, the mobile phone modifies the IP type 2 in the target configuration file to IP type 1 to obtain a modified target configuration file, wherein the activation failure reason value is a preset failure reason value.
[0171] In this embodiment of the present application, after the mobile phone finds the target configuration file, it indicates that the APN parameters configured in the mobile phone's underlying configuration exist. The mobile phone then determines whether IP type 2 is consistent with IP type 1. If IP type 2 is consistent with IP type 1, the mobile phone can send a data service activation request carrying IP type 2 to the operator's network equipment without modifying the network flag.
[0172] In the case where IP type 2 is inconsistent with IP type 1, it indicates that the IP type of the mobile network requested to access is different from the IP type of the mobile network. The mobile phone needs to modify IP type 2 to avoid being unable to access the Internet due to the inconsistency between the IP type and the IP type of the mobile network requested to access. Because the mobile phone is not allowed to modify the target configuration file before obtaining the activation result, that is, from the time the mobile network function is turned on to the time the mobile phone obtains the activation result, the mobile phone is not allowed to modify the target configuration file. Therefore, even if the mobile phone has determined that the IP type of the mobile network requested to access is different from the IP type of the mobile network, the mobile phone cannot modify the IP type (or IP type 2) in the target configuration file. Instead, it needs to wait until the activation result is obtained before modifying the IP type in the target configuration file.
[0173] Taking into account that the IP type of the mobile network requested to access is different from the IP type of the mobile network does not necessarily lead to the failure of the mobile phone to access the mobile network. Therefore, after the mobile phone obtains the activation result indicating activation failure, the mobile phone determines that the activation failure reason value belongs to the preset failure reason value, indicating that the failure to access the mobile network is due to inconsistent IP types. The mobile phone can update IP type 2 in the target configuration file to IP type 1 to make the IP type in the target configuration file consistent with the IP type of the mobile network requested to access.
[0174] Specifically, after the activation fails, that is, after receiving the first rejection message, which is a response message corresponding to the data service activation request, the mobile phone can determine whether the activation failure reason value (or the reason value for the request being rejected) of this activation failure belongs to the preset failure reason value. In the case where the activation failure reason value belongs to the preset failure reason value, it indicates that the data service activation failed due to the inconsistency between the IP type of the mobile phone's underlying configuration and the IP type of the mobile network. The mobile phone can modify the IP type 2 in the target configuration file to the IP type of the mobile network, that is, to IP type 1. For example, if IP type 2 is IPv4 and IP type 1 is IPv6, IP type 2 is modified to IPv6.
[0175] When the above-mentioned activation failure reason value does not belong to the preset failure reason value, it indicates that the data service activation failure is not caused by the inconsistency between the IP type of the underlying configuration of the mobile phone and the IP type of the mobile network (or simply stated as IP type inconsistency), but is caused by other reasons. The mobile phone does not need to modify the IP type in the target configuration file to IP type 1. The mobile phone can perform corresponding self-healing actions based on the activation failure reason value, or directly perform self-healing actions to avoid unnecessary IP type modifications.
[0176] Exemplarily, the self-healing action is to immediately reactivate the data service, or to activate the data service after a certain period of time, or the self-healing action may be to poll other APN parameters of the mobile phone (such as APN parameters corresponding to other SIM cards) to reactivate the data service using other APN parameters.
[0177] Optionally, the preset failure cause value indicates that the reason for the data service activation failure is due to inconsistent IP types. Exemplarily, the preset failure cause value may include at least one of the network only supports IPv4 type, the network only supports IPv6 type, and service unsubscribed.
[0178] For example, if the network only supports IPv4, the type may be #50ONLY_IPv4_ALLOWED; if the network only supports IPv6, the type may be #51ONLY_IPv6_ALLOWED; if the service is not subscribed, the type may be #33SERVICE_OPTION_NOT_SUBSCRIBED.
[0179] Optionally, the activation result may include the activation failure reason value. For example, if IP Type 2 is IPv4, but the mobile network's IP type is only IPv6, and the mobile phone activates the data service, the data service activation fails. The activation failure reason value is #51ONLY_Ipv6_ALLOWED, indicating that the data service activation failed because the mobile network only supports IPv6 and not IPv4.
[0180] In some embodiments, the aforementioned IP Type 2 refers to Local IP Type 2 or Roaming IP Type 2. Accordingly, when the mobile phone determines that the mobile phone is currently in the region to which the number corresponding to the target SIM card belongs, the mobile phone's determination of whether IP Type 2 is the same as IP Type 1 refers to the mobile phone's determination of whether Local IP Type 2 is the same as Local IP Type 1. Similarly, when the mobile phone determines that the mobile phone is not currently in the region to which the number corresponding to the target SIM card belongs, the mobile phone's determination of whether IP Type 2 is the same as IP Type 1 refers to the mobile phone's determination of whether Roaming IP Type 2 is the same as Roaming IP Type 1.
[0181] In addition, if there is no roaming IP type 2 in the mobile phone and the mobile phone is not in the place where the number belongs, the mobile phone can use the local IP type 2 as the roaming IP type 2.
[0182] In some embodiments, S511 can be performed after S510, meaning the phone can modify the IP type in the target configuration file after the self-healing action is completed. Since the phone typically performs a self-healing action after a data service activation failure, the phone can modify the IP type in the target configuration file after the self-healing action is completed. This eliminates the need to modify the existing service logic. Instead, the phone can simply add the service logic for modifying the IP protocol after the self-healing action is completed, simplifying the program code.
[0183] Optionally, after the self-healing action is completed, that is, after a new activation result is obtained, that is, before executing the above S511, the mobile phone determines that the new activation result indicates successful activation, indicating that the mobile phone has successfully connected to the mobile network. The mobile phone can update the network flag to false, and there is no need to modify the IP type in the target configuration file. If the mobile phone determines that the new activation result indicates a failed activation, indicating that the mobile phone cannot yet access the mobile network, the mobile phone can continue to execute S511 to enable the mobile phone to successfully connect to the mobile network.
[0184] In other embodiments, there is no specific order in which S510 and S511 are performed. The mobile phone may modify the IP type in the target configuration file during the self-healing process, or may modify the IP type in the target configuration file before performing the self-healing process.
[0185] In addition, the above step S510 is also optional. After the data service activation fails, the mobile phone may not perform the self-healing action, but may directly perform S511.
[0186] In some embodiments, the mobile phone determines that the activation failure reason value is not a preset failure reason value, indicating that the failure of this data service activation is not due to inconsistent IP types. The mobile phone can update the network flag to false, and there is no need to modify the IP type of the mobile phone's underlying configuration, avoiding unnecessary IP type modifications.
[0187] In some embodiments, before modifying IP type 2 in the target configuration file, the mobile phone can obtain a network flag. If the network flag is true, indicating that the IP type configured in the bottom layer of the mobile phone is inconsistent with the IP type configured in the upper layer of the mobile phone, the mobile phone modifies IP type 2 in the target configuration file to IP type 1. If the network flag is false, the mobile phone does not need to modify IP type 2 to IP type 1.
[0188] It should be understood that updating the network flag bit (or the first flag bit) to true can be replaced by updating the network flag bit to identifier 2 (or the first identifier), and setting the network flag bit to false can be replaced by updating the network flag bit to identifier 1 (or the second identifier). In other words, false is merely an example identifier of identifier 1, and true is merely another example identifier of identifier 2. Identifiers 1 and 2 can also be other identifiers, as long as they are different, such as identifier 1 being 0 and identifier 2 being 1.
[0189] In addition, the parameters carried by the above-mentioned data service activation request (such as IP type) are only an example. This application does not limit the parameters carried by the data service activation request, that is, the parameters included in the data service activation request can be set according to actual conditions.
[0190] S512: The mobile phone updates the network flag to false.
[0191] In the embodiment of the present application, after the IP type in the target configuration file is successfully modified, it indicates that the IP type in the target configuration file is consistent with the IP type of the mobile network, and the mobile phone can update the network flag to false.
[0192] In addition, generally speaking, the IP type in the target configuration file can be modified successfully, but it is still possible that the mobile phone fails to modify the IP type in the target configuration file. In the case of a modification failure, it indicates that the IP type may not be able to be modified, and the mobile phone can also update the network flag to false. Afterwards, the mobile phone can activate the data service based on the target configuration file. Alternatively, in the case of a modification failure, the mobile phone can directly end the process, that is, no longer activate the data service, to avoid unnecessary data service activation, until a long time has passed or the first operation is received again, and then reactivate the data service. Alternatively, in the case of a modification failure, the mobile phone can restore the IP type in the target configuration file so that when the next data service activation is performed, the IP type in the initial target configuration file is used to avoid the impact of the modification of the IP type in the target configuration file on the mobile network access.
[0193] For example, if the IP type in the target configuration file of a mobile phone is IPv4, IP type 1 is IPv6, and the IP type in the modified target configuration file is IPv6, restoring the IP type in the target configuration file means restoring the IP type in the modified target configuration file from IPv6 to IPv4.
[0194] S513. The mobile phone sends a data service activation request to the network device based on the modified target configuration file.
[0195] In some embodiments, the mobile phone activates the data service based on the modified target configuration file, such as sending a data service activation request carrying a modified IP type 2 (i.e., IP type 1), that is, sending a PDN connection request carrying information that the IP type is the first type, and the information that the IP type is the first type refers to the IP type of the underlying configuration, where the first type is the IP type of the mobile network requested to access. If the activation fails, it indicates that the failure of mobile network access may not be caused by inconsistent IP types. The mobile phone can modify the IP type 1 in the modified target configuration file to IP type 2 to restore the IP type of the underlying configuration of the mobile phone, thereby avoiding failure to access the mobile network due to modification of the IP type of the underlying configuration of the mobile phone.
[0196] For example, the IP type in the target configuration file is IPv4, and IP type 1 is IPv6. The mobile phone sends a data service activation request with the IPv4 type. After the activation fails, the mobile phone receives the activation failure reason value #33SERVICE_OPTION_NOT_SUBSCRIBED. This reason value #33SERVICE_OPTION_NOT_SUBSCRIBED may be due to an inconsistent IP type or other reasons. The mobile phone can first modify the IP type in the target configuration file to IPv6 to ensure that the IP type of the phone's underlying configuration is consistent with the IP type of the mobile network, and then obtain the modified target configuration file.
[0197] Afterwards, the phone can continue to use the modified target configuration file to activate data services. If data service activation fails, it indicates that the reason value #33SERVICE_OPTION_NOT_SUBSCRIBED is not due to an inconsistent IP type, but due to other reasons. In other words, the phone's failure to access the network is not related to the inconsistent IP type. Therefore, the phone can change the IP type in the modified target configuration file to IPv4. This will prevent the phone from being unable to access the network during the next data service activation due to the change in the phone's underlying IP type configuration, thereby ensuring the phone's mobile network access success rate.
[0198] In other embodiments, the mobile phone activates the data service based on the modified target configuration file. If the activation fails, it indicates that the mobile network access failure may be due to other reasons (such as poor signal strength), and the mobile phone can perform self-healing actions.
[0199] Among them, optionally, after the self-healing action is completed, if the mobile phone still does not access the mobile network, it indicates that the mobile network access failure may not be caused by inconsistent IP types. The mobile phone can modify the IP type 1 in the modified target configuration file to IP type 2 to restore the IP type of the underlying configuration of the mobile phone.
[0200] In some embodiments, when the IP type in the target configuration file is inconsistent with IP type 1, that is, when the IP type required by the operator is inconsistent with the IP type configured in the bottom layer of the mobile phone, the mobile phone may not modify the IP type in the above-mentioned target configuration file, but directly activate the data service based on the IP type configured in the upper layer of the mobile phone, that is, directly send a data service activation request carrying IP type 1. Since the IP type configured in the upper layer of the mobile phone is consistent with the IP type required by the operator and the IP type of the mobile network, it can be avoided that the mobile phone cannot successfully access the mobile network due to inconsistent IP types. And by not modifying the IP type in the target configuration file, when the IP type of the mobile network requested to be accessed is consistent with the IP type in the target configuration file, the IP type in the target configuration file can be used by default to activate the data service, thereby meeting the user's Internet access needs. When the IP type of the mobile network requested to be accessed is inconsistent with the IP type in the target configuration file, directly using the IP type configured in the upper layer of the mobile phone to activate the data service can also meet the user's Internet access needs.
[0201] In some embodiments, the pseudo code corresponding to the above S503-S513 may include:
[0202] flag=false / / Network flag is set to false
[0203] ifprofile IP type! =telephony IP type then
[0204] do flag = true / / If the IP type configured at the bottom layer of the phone (i.e., the IP type 2 profile IP mentioned above) is not equal to the IP type configured at the top layer of the phone (i.e., the IP type telephony IP mentioned above), update the network flag to true
[0205] ifsetup data call is fail then
[0206] do change profile IP type as telephony IP type / / If data service activation fails, change IP type 2 to IP type 1
[0207] ifchange profile return result then
[0208] do flag = false / / If IP type 2 is modified successfully, return the modification result and then update the network flag to false setup data call again / / Reactivate data service
[0209] In some embodiments, the above-mentioned network flag bit can be added to the phone management module in the mobile phone. The phone management module can set the specific value of the network flag bit according to the specific situation, so that the relevant devices or modules in the mobile phone can use the specific value of the network flag bit to modify the IP type of the mobile phone's bottom layer configuration, so as to use the modified IP type of the mobile phone's bottom layer configuration to activate data services, thereby improving the success rate of data service activation and realizing the Internet access function of the mobile phone. Figure 4 The structure shown in FIG. 1 introduces the process of activating data services, which is a possible implementation process of the above S501-S513. The process may include the following steps: Figure 8 S1-S21 shown.
[0210] S1. The settings application in the mobile phone receives the user's operation of turning on the mobile data switch.
[0211] S2. The setting application displays the first mobile network icon on the status bar in response to the above-mentioned opening operation.
[0212] Optionally, the turning on of the mobile data switch is used to trigger turning on the mobile network function.
[0213] The above S1-S2 introduces a scenario of opening the mobile network function of the mobile phone, that is, an activation scenario of the mobile network, which is a possible implementation process of the above S501-S502. The following continues to introduce the process of the phone management module in the mobile phone activating a data service according to the APN parameters in the target configuration file. Among them, the process may include the above Figure 8 S3-S11 shown.
[0214] S3. The phone management module in the mobile phone sets the network flag to false and sends a data service activation instruction to the ril in the mobile phone. The data service activation instruction includes APN parameter 1, which includes IP type 1 and APN name 1.
[0215] Among them, the above-mentioned APN parameter 1 can be configured by the phone management module in the application framework layer according to the information of the target SIM card. For example, the phone management module can find the APN parameter corresponding to the PLMN information of the target SIM card and use it as the APN parameter 1.
[0216] For example, the phone management module can detect the mobile network status of the mobile phone. Upon detecting that the mobile network status of the mobile phone switches from a no-service state to a network service state (such as a 4G network state, a 5G network state, or other mobile network states), the phone management module in the mobile phone can determine that the mobile network function of the mobile phone is enabled. Thereafter, the phone management module can initialize the network flag to false.
[0217] In some embodiments, the phone management service can register to monitor the mobile network status. After the mobile network status changes, the phone management service can receive the latest mobile network status broadcast message, so that the mobile network status of the mobile phone can be determined based on the broadcast message.
[0218] S4. In response to the data service activation instruction, ril determines whether the mobile phone has a target configuration file corresponding to APN name 1. The target configuration file includes APN parameter 2, and APN parameter 2 includes IP type 2.
[0219] The target configuration file may be a Profile file, which may be stored on a mobile phone.
[0220] In the embodiment of the present application, the RIL in the mobile phone can determine whether the mobile phone has a target configuration file. If the target configuration file does not exist, the mobile phone can execute S5, and if the target configuration file exists, the mobile phone can execute S8.
[0221] Among them, the above-mentioned APN parameter 2 can also include APN name 2. The target configuration file corresponding to the above-mentioned APN name 1 represents a configuration file including the same APN name 2 as APN name 1, that is, the APN name 2 of the target configuration file is the same as APN name 1.
[0222] S5. ril creates a target configuration file based on the above APN parameter 1.
[0223] The target configuration file is a configuration file in the hardware layer of the mobile phone, and the APN parameters included therein are APN parameters configured in the bottom layer of the mobile phone.
[0224] In the implementation of this application, ril creates a target configuration file corresponding to the hardware layer based on APN parameter 1, that is, the APN parameter corresponding to the framework layer. Correspondingly, the APN parameters in the target configuration file, that is, the APN parameters configured at the bottom layer of the mobile phone are actually the APN parameters configured at the upper layer of the mobile phone.
[0225] S6. ril sends the created target configuration file to the modem.
[0226] S7. The modem sends a data service activation request to the network device based on the created target configuration file. The data service activation request is used to access the mobile network corresponding to the network device, and the data service activation request includes IP type 1.
[0227] In this embodiment of the present application, after the target configuration file is created, the modem can use the created target configuration file to activate the data service and attempt to access the mobile network. After the data service activation is complete, the modem can obtain a corresponding activation result, which indicates whether the data service activation is successful. The modem can then send the activation result to the RIL. The RIL then sends the activation result to the phone management module.
[0228] Afterwards, when the activation result indicates that the activation is successful, it means that the mobile phone has successfully connected to the mobile network, and the phone management module can access the Internet normally, such as receiving or sending data packets.
[0229] In the case where the activation result indicates that the activation failed, it means that the mobile phone failed to access the mobile network, and the phone management module can perform a self-healing action.
[0230] In some embodiments, the data service activation instruction may be set_up_data_call.
[0231] In some embodiments, the above-mentioned data service activation process may include: the modem sends a network connection request (or data service activation request) to the operator's network equipment (such as a base station) to request access to the mobile network provided by the operator. The network connection request may include the APN parameters of the underlying configuration of the mobile phone (i.e., the APN parameters in the target configuration file, such as the IP type). The network device can use the APN parameters in the target configuration file to determine whether to allow the mobile phone to access the mobile network. For example, when the APN parameters are consistent with the APN parameters of the mobile network, the network device can allow the mobile phone to access the mobile network and return an activation result indicating successful activation. When the APN parameters are inconsistent with the APN parameters of the mobile network, such as inconsistent IP types, the network device denies the mobile phone access to the mobile network and returns an activation result indicating a failed activation.
[0232] S8. ril sends message 1 to the telephone management module, where message 1 indicates that IP type 2 is different from IP type 1.
[0233] S9. The telephone management module responds to message 1 and updates the network flag to true.
[0234] In an embodiment of the present application, ril can first search whether there is a target configuration file corresponding to APN name 1. If the target configuration file exists, it indicates that the mobile phone needs to use the APN parameters in the target configuration file to request access to the mobile network, and ril can compare whether the IP type (i.e., IP type 2) in the APN parameters in the target configuration file is the same as IP type 1. If IP type 2 is inconsistent with IP type 1, it indicates that the mobile phone may fail to access the mobile network due to the inconsistency between IP type 2 and IP type 1, that is, the IP type of the mobile phone's underlying configuration is inconsistent with the IP type of the mobile network. Therefore, it is necessary to modify the IP type configured in the mobile phone, that is, to modify the IP type in the target configuration file. The ril in the mobile phone can send message 1 to the phone management module. Afterwards, after receiving message 1, the phone management module responds to message 1 and modifies the network flag to true to indicate that IP type 2 is inconsistent with IP type 1.
[0235] In addition, if IP type 2 and IP type 1 are consistent, the mobile phone does not need to modify IP type 2. Therefore, ril does not need to send message 1 to the phone management module, and ril can execute S10.
[0236] S10. ril sends the target configuration file to the modem.
[0237] S11. The modem sends a data service activation request to the network device based on the target configuration file, wherein the data service activation request includes IP type 2.
[0238] The data service activation request is used to trigger activation of the data service, ie, access to the mobile network.
[0239] S3-S11 above introduces the process of activating a data service on a mobile phone, which is a possible implementation process of S503-S509 above. After activating a data service, an activation failure may occur. In this case, the phone management module in the mobile phone can modify the IP type of the mobile phone's underlying configuration to use the modified IP type of the mobile phone's underlying configuration to activate a data service and achieve self-healing of the mobile network access failure. Figure 8 The steps S12-S21 shown here illustrate this situation. In addition, the steps S12-S21 may be a possible implementation process of the above-mentioned steps S510-S513.
[0240] S12: After activation fails, the modem sends an activation failure result to the RIL, wherein the activation failure result includes an activation failure reason value.
[0241] S13. ril sends the activation failure result to the telephone management module.
[0242] S14. In response to the activation failure result, the telephone management module repeatedly sends a data service activation request to the network device via the modem.
[0243] Among them, the self-healing action is used to trigger the mobile phone to reconnect to the network.
[0244] In an embodiment of the present application, after determining that the IP type in the target configuration file is inconsistent with the IP type configured in the upper layer of the mobile phone, although the IP type inconsistency has been determined, since the IP type in the target configuration file cannot be modified at this time, the ril sends the above-mentioned target configuration file to the modem so that the modem can continue to use the APN parameters (including IP type 2) in the target configuration file to activate data services to request access to the mobile network.
[0245] The modem receives an activation result indicating successful activation (or activation success result), indicating that the mobile phone has successfully connected to the mobile network. The modem can send the activation success result to the phone management module through RIL, so that the phone management module knows that the mobile phone has successfully connected to the mobile network and can access the Internet normally.
[0246] The modem receives an activation result indicating an activation failure (or activation failure result), indicating that the mobile phone has failed to connect to the mobile network. The modem may send the activation failure result to the phone management module via the RIL, so that the phone management module is informed that the mobile phone cannot connect to the mobile network. The phone management module may then, in response to the activation failure result, repeatedly attempt to connect to the mobile network, i.e., perform a self-healing action, to request access to the mobile network.
[0247] In some embodiments, if there is no restriction on the modification timing of the target configuration file, the mobile phone can directly modify the IP type 2 in the target configuration file to IP type 1 after determining that the IP type in the target configuration file is inconsistent with the IP type configured in the upper layer of the mobile phone, without having to complete a data service activation before modifying the IP type in the target configuration file, thereby reducing the probability of data service activation failure.
[0248] Of course, if there are no restrictions on the timing of modifying the target configuration file, the mobile phone can still modify IP type 2 in the target configuration file to IP type 1 after completing a data service activation, that is, after obtaining an activation failure reason value that falls within the preset failure reason value, to avoid unnecessary IP type changes. Furthermore, if the mobile phone successfully connects to the mobile network after completing a data service activation, or if the activation fails but the activation failure reason value does not fall within the preset failure reason value, the mobile phone does not need to modify the IP type in the target configuration file, thus avoiding unnecessary IP type changes and preventing the next data service activation failure caused by the target configuration file modification.
[0249] Exemplarily, the activation result may be presented in the form of a message or an instruction. For example, the activation failure result is actually an activation failure instruction, and specifically, the activation failure instruction may be set_up_data_fail.
[0250] It should be noted that the phone generates a corresponding log whenever it sends a network connection request or receives an activation result. For example, at the timestamp of 15:06:59.683991, the phone generates a network connection log corresponding to the network connection request. The name of the network connection log may be "PDN connectivity request Msg." The network connection log may include the following content:
[0251] pdn_connectivity_req
[0252] pdn_type=2(0x2)(IPv6) / / IP type is IPv6
[0253] The network connection log indicates that the IP type carried in the network connection request sent by the phone is IPv6. The PDN refers to a packet data network, which supports data service transmission within a mobile network. When the mobile network function is enabled on a phone, the phone requests a PDN connection to transmit data over the mobile network, activating data services.
[0254] Afterwards, the mobile phone generates an activation result log at the timestamp of 15:06:59.683991, indicating that the mobile phone has obtained the activation result, that is, the response message corresponding to the network connection request. The name of the activation result log may be "PDNconnectivityrejectMsg", indicating that the activation result corresponding to the activation result log indicates activation failure, that is, PDN connection failure. In other words, the mobile phone received a response message sent by the network device indicating the PDN connection failure. The activation result log indicating activation failure may include the following content:
[0255] pdn_connectivity_rej
[0256] esm_cause=33(0x21){Request service option not subscribed} / / The activation failure reason value is 33.
[0257] Optionally, the activation failure reason value may also be 50 or 51.
[0258] In addition, if the data service is activated successfully, the mobile phone obtains the corresponding activation result log indicating successful activation. The name of the activation result log may be "PDN connectivity accept Msg", indicating that the PDN connection is successful, that is, the mobile phone receives the response message of the successful PDN connection sent by the network device, that is, receives the request acceptance message. Optionally, the activation result log indicating successful activation includes similar content to the activation result log indicating failed activation. For example, the activation result log indicating successful activation may include: pdn_connectivity_acc esm_cause = 0, where the cause value is 0, indicating that there is no error or abnormality and the PDN connection is successful. That is, the request acceptance message may include information about the cause value of the request being accepted, and the cause value of the request being accepted, that is, the accepted cause value may be 0. It should be understood that the esm in the above log may refer to EPS session management (EPS session management), and esm_cause represents the cause code of ESM, which can be used to diagnose PDN connection problems and error causes.
[0259] It should be understood that the contents included in the logs described above, such as the IP type included in the network connection log and the activation failure reason value included in the activation result log, are only examples, and this application does not limit the contents included in the logs.
[0260] S15. The telephone management module obtains the latest value of the network flag. The activation failure reason value is a preset failure reason value.
[0261] In some embodiments, after the mobile phone performs the self-healing action, if the mobile phone successfully connects to the mobile network, the modem can send the activation success result to the phone management module through ril. The phone management module does not need to use ril to modify the IP type in the target configuration file based on the network flag. Therefore, the mobile phone does not need to execute S14-S20, and the phone management module can directly modify the network flag to false.
[0262] If the mobile phone still fails to access the mobile network, the modem can send the activation failure result to the phone management module through ril. The phone management module continues to modify the IP type in the target configuration file based on the network flag using ril. That is, the mobile phone continues to execute S14-S20.
[0263] S16: The telephone management module sends an IP type update command to ril, wherein the latest value of the network flag is true.
[0264] S17. ril responds to the IP type update command and changes the IP type 2 in the target configuration file to IP type 1.
[0265] S18. ril sends a modification success message to the telephone management module.
[0266] In an embodiment of the present application, after successfully modifying IP type 2 in the target configuration file to IP type 1, ril can send a modification success message to the telephone management module so that the telephone management module can be informed that IP type 2 in the target configuration file has been modified successfully.
[0267] In addition, if ril fails to modify the IP type 2 in the target configuration file, ril sends a modification failure message to the phone management module to inform the phone management module that the IP type in the target configuration file cannot be modified at this time. The phone management module can continue to modify the network flag to false and end the data service activation. It should be understood that generally speaking, ril can successfully modify the IP type 2 in the target configuration file to IP type 1.
[0268] S19. In response to the modification success message, the telephone management module modifies the network flag to false and sends a data activation instruction to ril.
[0269] S20. ril sends the modified target configuration file to the modem, wherein the modified target configuration file includes IP type 1.
[0270] S21. The modem sends a data service activation request to the network device based on the modified target configuration file, wherein the data service activation request includes IP type 1.
[0271] In some embodiments, after the modem activates the data service based on the modified target configuration file, it obtains an activation failure result, indicating that even if the IP type of the mobile phone's underlying configuration is modified to the IP type of the mobile network, it still cannot successfully access the mobile network. The modem sends the activation failure result to the phone management module, and the phone management module can directly end the process, that is, no longer activate the data service until a long time has passed, or the first operation is received again, and then the data service is reactivated.
[0272] Optionally, after the activation of the data service using the modified target configuration file fails, the phone management module can trigger ril to restore the IP type in the target configuration file.
[0273] In addition, after the data service activation fails using the modified target configuration file, the phone management module can still perform a self-healing action. After the self-healing action is completed, if the mobile network is still not connected, the data service activation will not be performed.
[0274] In some embodiments, the present application provides a computer-readable storage medium including computer instructions. When the computer instructions are executed on a Bluetooth device, the electronic device executes the mobile network connection method described above.
[0275] In some embodiments, the present application provides a computer program product. When the computer program product is run on a Bluetooth device, the electronic device executes the mobile network connection method described above.
[0276] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0277] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0278] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0279] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0280] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0281] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A mobile network connection method, characterized in that: Applied to an electronic device, the electronic device is located within the coverage of a first mobile network, and the IP type of the first mobile network is a first type; The method comprises: The electronic device obtains, based on information of a target subscriber identity module (SIM) card in the electronic device, a first access point name (APN) parameter configured by a phone management module in an application framework layer of the electronic device; wherein the first APN parameter includes information that the IP type is a first type; and the target SIM card is a SIM card used by the electronic device to request access to the first mobile network; When the IP type in the first APN parameter and the IP type in the second APN parameter determined by the wireless interface layer in the hardware abstraction layer of the electronic device are different, the electronic device sets the first flag position to a first identifier; when the IP type in the first APN parameter and the IP type in the second APN parameter determined by the wireless interface layer in the hardware abstraction layer of the electronic device are the same, the electronic device sets the first flag position to a second identifier; The electronic device sends a first group packet network PDN connection request to the network device based on the second APN parameter; wherein the second APN parameter includes information that the IP type is the second type, and the first PDN connection request includes information that the IP type is the second type; The electronic device receives a first rejection message sent by the network device; wherein the first rejection message includes information about a reason value for request rejection; When the information of the reason value for the request being rejected includes that the network only supports the IPv4 type or that the network only supports the IPv6 type, and the electronic device determines that the first flag bit is the first identifier, the electronic device modifies the information that the IP type in the second APN parameter is the second type to information that the IP type is the first type, and sets the first flag bit to the second identifier; when the information of the reason value for the request being rejected includes that the network only supports the IPv4 type or that the network only supports the IPv6 type, and the electronic device determines that the first flag bit is the second identifier, the electronic device does not perform the operation of modifying the information that the IP type in the second APN parameter is the second type to information that the IP type is the first type; When the information of the reason value for the request being rejected includes service unsubscribed, and the electronic device determines that the first flag bit is the first identifier, the electronic device modifies the information that the IP type in the second APN parameter is the second type to information that the IP type is the first type, and sets the first flag bit to the second identifier; when the information of the reason value for the request being rejected includes service unsubscribed, and the electronic device determines that the first flag bit is the second identifier, the electronic device does not perform the operation of modifying the information that the IP type in the second APN parameter is the second type to information that the IP type is the first type; Based on the current second APN parameter, the electronic device sends a second PDN connection request to the network device; In the event that access to the first mobile network based on the second PDN connection request fails, when the IP type in the second APN parameter is information of the first type, the electronic device modifies the information that the IP type in the second APN parameter is the first type to information that the IP type is the second type, and sets the first flag position to the second identifier.
2. The method according to claim 1, characterized in that The information of the reason value for the request being rejected includes that the network only supports IPv4 type, the network only supports IPv6 type or the service is not subscribed, which means that the reason value for the request being rejected is 33, 50 or 51; among which, the reason value for the request being rejected is 33, which means that the reason for the request being rejected is that the service is not subscribed; the reason value for the request being rejected is 50, which means that the reason for the request being rejected is that the network only supports IPv4 type; the reason value for the request being rejected is 51, which means that the reason for the request being rejected is that the network only supports IPv6 type.
3. The method according to claim 1 or 2, characterized in that The electronic device sending a first group packet network (PDN) connection request to a network device based on the second APN parameter, including: In response to the first operation, the electronic device sends a first PDN connection request to the network device based on the second APN parameter, and the status bar of the display interface of the electronic device does not include a first icon; The method further comprises: In a case where the electronic device receives a request acceptance message sent by a network device, the status bar of the display interface of the electronic device includes the first icon.
4. The method according to claim 1 or 2, characterized in that Before the electronic device sends the second PDN connection request to the network device, the method further includes: Based on the first rejection message, the electronic device repeatedly sends the first PDN connection request to the network device.
5. The method according to claim 1 or 2, characterized in that The second APN parameter also includes the first APN name; the first APN parameter also includes the first APN name.
6. The method according to claim 1 or 2, characterized in that The electronic device is located in a location where the number corresponding to the target SIM card in the electronic device belongs, and the IP type is a local IP type; The electronic device is not located in the location where the number corresponding to the target SIM card belongs, and the IP type is a roaming IP type.
7. The method according to claim 3, characterized in that The request acceptance message includes a request acceptance reason value of 0; wherein, the request acceptance reason value of 0 indicates that the PDN connection is successful.
8. An electronic device, characterized in that: The electronic device includes a display screen, a SIM card interface, a memory, and one or more processors; the display screen, the SIM card interface, the memory, and the processor are coupled; the SIM card interface is used to connect a SIM card, the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, wherein the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device performs the method according to any one of claims 1 to 7.
9. A chip, characterized in that: The chip includes a communication interface and at least one processor: The communication interface is used to input and / or output signaling or data; The at least one processor is configured to execute a computer program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for processing unsuccessful pdn establishment request procedures
CN105723798A