Mobile network apn bearer establishment method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-20
- Publication Date
- 2026-08-11
AI Technical Summary
市场现有的处理方式过于简单化,在建立网络失败后反复过多尝试容易触发网络侧的防火墙保护机制导致整车无网
[0013]本发明的第四方面还提供了一种计算机可读存储介质,其上存储有可执行指令,该指令被处理器执行时使处理器执行上述移动网络APN承载建立方法。
Smart Images

Figure CN122554981A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle communication technology, and in particular to a method for establishing a mobile network APN bearer. Background Technology
[0002] With the continuous improvement of automotive intelligence in China, in-vehicle 4G / 5G networks have become standard equipment. As the foundation of automotive intelligence, the stability of mobile networks is crucial. Current market solutions are overly simplistic; repeatedly attempting to establish a network after a failure can easily trigger network-side firewall protection mechanisms, resulting in the entire vehicle losing network access. Summary of the Invention
[0003] This invention aims to solve at least one of the technical problems existing in the prior art, and proposes a method for establishing a mobile network APN bearer by extending the connection waiting time after failure to prevent the complexity of network problems.
[0004] In a first aspect, embodiments of the present invention provide a method for establishing a mobile network APN bearer, comprising: activating the APN after initialization; starting a timer after activation, and updating the APN state machine state according to the APN state returned by the modem and the timer; in response to the APN state machine state being updated to connection failure, recording the number of failures using a failure counter, and increasing the connection waiting time according to the number of failures; the connection waiting time is the interval between the time of connection failure and the time of the next connection initiation.
[0005] According to an embodiment of the present invention, the APN status includes startup, initialization, activation, connection in progress, connection completed, connection failed, disconnection, and stop.
[0006] According to an embodiment of the present invention, updating the APN state machine state based on the APN state returned by the modem and a timer includes: updating the APN state machine state based on the information reported by the modem in response to receiving information reported by the modem; and updating the APN state machine state based on the modem APN state information actively read by the upper layer application in response to the modem not reporting information within a preset time.
[0007] According to an embodiment of the present invention, increasing the connection waiting time based on the number of failures includes: setting an initial value for the connection waiting time; increasing the connection waiting time by a preset gradient each time the number of failures in the failure counter is increased until the connection waiting time reaches a preset maximum threshold; and resetting the failure counter to zero and the connection waiting time to the initial value in response to a successful APN connection.
[0008] According to an embodiment of the present invention, the processing flow for a modem failing to connect to the network includes: in response to determining that the modem cannot connect to the network, switching to airplane mode; in response to the modem still failing to connect to the network after attempting to switch to airplane mode a preset number of times, and the vehicle moving a distance exceeding a preset distance, restarting the modem.
[0009] According to an embodiment of the present invention, the preset distance is 2 kilometers.
[0010] According to an embodiment of the present invention, the method for obtaining APN status information returned by the modem includes two priority levels. The first priority is that the modem actively reports the APN status information, and the second priority is that the upper layer application actively reads the APN status information of the modem. The first priority status information is preferred for updating the APN state machine.
[0011] A second aspect of the present invention provides a mobile network APN bearer establishment system, which can be used to implement the above-described mobile network APN bearer establishment method, comprising: an activation module for activating the APN after initialization; an update module for starting a timer after activation and updating the APN state machine state according to the APN state returned by the modem and the timer; and a waiting module for recording the number of failures using a failure counter and increasing the connection waiting time according to the number of failures in response to the APN state machine state update to connection failure; wherein the connection waiting time is the interval between the connection failure time and the next connection initiation time.
[0012] A third aspect of the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to perform the above-described mobile network APN bearer establishment method.
[0013] A fourth aspect of the present invention also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-described mobile network APN bearer establishment method.
[0014] The mobile network APN bearer establishment method provided by this invention increases the connection waiting time according to the number of connection failures. Since the waiting time can be increased in a gradient to avoid repeated dialing in a short period of time, it effectively solves the problem of vehicle terminals being blacklisted by the operator's core network firewall due to frequent dialing, thus ensuring the security of vehicle mobile network establishment. Attached Figure Description
[0015] Figure 1 A flowchart illustrating a method for establishing a mobile network APN bearer according to an embodiment of the present invention;
[0016] Figure 2This is a schematic diagram of the APN state machine switching process provided in an embodiment of the present invention;
[0017] Figure 3 A flowchart illustrating a network anomaly recovery algorithm provided in an embodiment of the present invention;
[0018] Figure 4 A structural block diagram of a mobile network APN bearer establishment system provided in an embodiment of the present invention;
[0019] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the technical solutions of the present invention, exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0021] Where there is no conflict, the various embodiments of the present invention and the features thereof may be combined with each other.
[0022] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.
[0023] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Terms such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.
[0024] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having the meaning consistent with their meaning in the context of the relevant art and the invention, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.
[0025] In the technical solution of this invention, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information all comply with relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution follows relevant national laws and regulations (e.g., the "Information Security Technology - Personal Information Security Specification"). For example: appropriate measures are taken for personal information access control; restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; and explicit identity targeting is eliminated when using personal information to avoid precisely locating a specific individual.
[0026] In related technologies, an attempt is made to establish an APN (Access Point Name) connection. The modem's network status is determined. If the status is online and in LTE / NR mode, the dialing interface is called. If the dialing is successful, the APN bearer is established. If it fails, a failure is returned. The dialing is repeated after n seconds.
[0027] The problem with existing technology is that this model is too simplistic and cannot cover the complexity of dialing scenarios. In actual operation, excessive dialing attempts due to latency can easily trigger the protection mechanism of the operator's core network firewall, blacklisting the terminal and causing the vehicle network to become unrecoverable. When the car encounters electronic fences or fake base stations, dialing will inevitably fail. In this case, simply delaying and re-initiating dialing will result in the terminal being blocked and unable to recover for a long time.
[0028] To address at least one of the technical problems existing in the aforementioned related technologies, the present invention provides a method for establishing a mobile network APN bearer by adjusting the connection waiting time based on the number of failures. Figure 1 This is a flowchart illustrating a method for establishing a mobile network APN bearer according to an embodiment of the present invention, as shown below. Figure 1 As shown, this embodiment of the invention provides a method for establishing a mobile network APN bearer, comprising: S1, activating the APN after initialization; after confirming that the APN initialization configuration is complete, initiating an APN activation action to prepare for subsequent bearer establishment. S2, starting a timer after activation; updating the APN state machine state based on the APN state returned by the modem and the timer; the APN state machine state update is determined by the APN state returned by the modem and the timer's timing state, ensuring that the state machine is synchronized with the actual state of the modem, and also enabling timeout fallback processing through the timer. S3, responding to the APN state machine state update indicating connection failure, recording the number of failures using a failure counter, and increasing the connection waiting time based on the number of failures; the connection waiting time is the interval between the connection failure time and the next connection initiation time, unlike the fixed-duration delay retries in the prior art, this step associates the connection waiting time with the number of failures.
[0029] Through the embodiments of the present invention, the dialing algorithm model is optimized. The next action is determined based on the state machine reported by the modem module. After a dialing request fails, the dialing interval is gradually increased according to the number of attempts to prevent the core network firewall mechanism from blacklisting the terminal and causing the network to become unrecoverable.
[0030] Figure 2 This is a schematic diagram of the APN state machine switching process provided in an embodiment of the present invention. The overall framework of the dialing algorithm is as follows: Figure 2 As shown, the core part is the APN state machine switching logic and the method for judging the conditions for state machine switching. First, let's introduce the APN state machine: Startup, Initialization, Activation, Connecting, Connection Completed, Connection Failed, Disconnected, and Stopped. These states cover all states during the APN dialing process. Different actions are performed depending on the APN's state, with the ultimate goal of establishing an APN bearer to complete the mobile network connection. The flowchart for establishing this APN bearer starts with startup. After startup, it first checks whether APN initialization is complete. If not, it performs the initialization of APN configuration. After initialization, it enters the APN activation phase. Upon APN activation, two parallel actions are triggered simultaneously: one is waiting for the Modem's callback information, and the other is starting a timer. Then, it enters the phase of judging whether the APN state has timed out. If the Modem's callback APN state information is received within the timer's timeout range, the APN state machine is switched directly based on this information. The state machine will switch to the corresponding state, such as Connecting, Connection Completed, Connection Failed, or Disconnected, depending on the actual situation. If the timer expires, the system actively updates the APN state machine and then completes the corresponding state switch. After the state machine completes various state transitions, it will re-execute the timer operation, restart the timer and wait for the Modem callback. If it switches to the APN activation state, it will re-enter the APN activation and subsequent waiting callback and timer judgment process.
[0031] Handling the conditions for APN state machine switching is a crucial step. Obtaining modem information is a prerequisite for switching the state machine. Modem status information acquisition is prioritized in two ways: first, the modem actively reports the status; second, the upper-layer application actively reads it. This is because of the lag in information synchronization; active reporting has a higher priority, ensuring the state machine is always synchronized with the modem and preventing erroneous actions due to incorrect states. By setting the modem's active reporting as the first priority and the upper-layer application's active reading as the second priority, this technique prioritizes updating the APN state machine with higher-priority information. Considering the lag in information synchronization, actively reported information is more real-time and accurate, ensuring the state machine obtains the latest modem status, thus guaranteeing the timeliness and accuracy of APN state machine updates.
[0032] Based on the above embodiments, the APN state machine state is updated according to the APN state returned by the modem and the timer, including: in response to receiving information reported by the modem, updating the APN state machine state according to the information reported by the modem; in response to the modem not reporting information within a preset time, updating the APN state machine state according to the modem APN state information actively read by the upper layer application.
[0033] Through the embodiments of the present invention, the APN state machine is updated according to different situations. That is, it is updated accordingly when receiving information reported by the modem, and the upper layer application actively reads and updates the information when it fails to report on time. This ensures that effective state information can be obtained in a timely manner in both cases of normal modem communication and information reporting delay, and prevents information loss.
[0034] Based on the above embodiments, the connection waiting time is increased according to the number of failures, including: setting an initial value for the connection waiting time; increasing the connection waiting time by a preset gradient each time the number of failures in the failure counter increases until the connection waiting time reaches a preset maximum threshold; and resetting the failure counter to zero and the connection waiting time to the initial value in response to a successful APN connection.
[0035] In this embodiment, the initial value of the connection waiting time is the interval between the first failed connection of the APN and the next dialing attempt. This value is set according to the actual usage conditions of the vehicle network and the rules of the operator's core network.
[0036] In this embodiment, the preset gradient represents the increase in connection waiting time, which can be set to a fixed increase or a proportional increase (e.g., an increase of 20% each time). The specific gradient can be flexibly adjusted according to the vehicle-mounted scenario. The core of this rule is that the number of failures is positively correlated with the waiting time; that is, the more failures there are, the longer the interval between the next dial-up call, until a preset maximum threshold is reached. The preset maximum threshold is the upper limit of the connection waiting time. The purpose of setting this threshold is to avoid excessively low network recovery efficiency due to excessively long waiting times. When the waiting time reaches this threshold, subsequent dial-up failures will no longer increase the waiting time, keeping the maximum threshold unchanged. When the APN bearer is successfully established, it indicates that the current network status has returned to normal. At this time, the failure counter is cleared to zero, and the connection waiting time is reset to its initial value, allowing the algorithm to return to the normal dial-up state.
[0037] Through the embodiments of the present invention, a flexible dialing interval mechanism is constructed. The more failed attempts there are, the longer the dialing interval becomes, and the initial rules are restored after a successful connection. This not only avoids triggering the firewall by repeatedly dialing in a short period of time, but also allows the normal dialing attempt rhythm to be quickly restored after the network is restored.
[0038] Figure 3This is a flowchart illustrating a network anomaly recovery algorithm provided in an embodiment of the present invention. The processing flow for a modem failing to connect to the network includes: in response to determining that the modem cannot connect to the network, switching to airplane mode; in response to the modem still failing to connect to the network after attempting to switch to airplane mode a preset number of times, and the vehicle moving a distance exceeding a preset distance, restarting the modem.
[0039] In this embodiment, "Modem cannot register on the network" means the modem cannot find the operator's network signal and cannot complete network registration. This is a common abnormal scenario in vehicular networks, triggered by factors such as the vehicle entering a signal blind spot, electronic fences, or areas with fake base stations. Switching to airplane mode is a lightweight software recovery operation. By shutting down and restarting the modem's network module, it allows the modem to re-search for network signals, which is an effective way to resolve common network registration anomalies and is suitable for network registration anomalies caused by temporary signal fluctuations. Restarting the modem is a hardware-level recovery operation. By restarting the modem hardware module, it resolves network registration problems caused by hardware malfunctions or module freezes. This operation is a last resort for recovering from network registration anomalies and is only triggered if lightweight operations are ineffective and the vehicle's location has changed.
[0040] In this embodiment, after determining that the modem cannot connect to the network, the system first attempts to switch to airplane mode to restore the network. After a certain number of attempts, the system determines the current location of the car. For example, if the car has moved more than 2 kilometers, and the modem still cannot connect to the network, the system restarts the modem.
[0041] Through the embodiments of the present invention, following the progressive network anomaly handling logic of light recovery and heavy recovery, the conventional network access problem is first solved by a simple flight mode switch, and then the modem is restarted based on the vehicle's movement status. Therefore, it can specifically solve the problem of terminal network access failure in vehicle scenarios and adapt to the dynamic working conditions of car driving.
[0042] Based on the above embodiments, the preset distance is 2 kilometers. Setting the preset distance to 2 kilometers has two main considerations: first, the signal coverage characteristics of vehicular networks—the coverage range of network signal blind spots and electronic fences is mostly within 2 kilometers. If a car cannot connect to the network after moving 2 kilometers, it indicates that it has left the original abnormal area but the network has not yet recovered, requiring a hardware restart; second, the speed characteristics of vehicles—the average speed of a car on urban roads and highways allows it to complete a 2-kilometer journey in a short time, avoiding delayed recovery due to excessive distance.
[0043] Through the embodiments of the present invention, a clear and quantifiable threshold is set for judging the vehicle movement distance, avoiding invalid or untimely restarts of the modem due to excessive distance or size, and improving the execution accuracy of the vehicle network anomaly self-recovery algorithm.
[0044] Figure 4 A structural block diagram of a mobile network APN bearer establishment system provided in an embodiment of the present invention is shown below. Figure 4 As shown, the present invention provides a mobile network APN bearer establishment system, which can be used to implement the above-mentioned mobile network APN bearer establishment method, including: an activation module for activating the APN after initialization; an update module for starting a timer after activation and updating the APN state machine state according to the APN state returned by the modem and the timer; and a waiting module for recording the number of failures using a failure counter and increasing the connection waiting time according to the number of failures in response to the APN state machine state update to connection failure; wherein the connection waiting time is the interval between the connection failure time and the next connection initiation time.
[0045] Based on the same inventive concept, embodiments of the present invention also provide an electronic device. Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Figure 5 As shown, an embodiment of the present invention provides an electronic device including: one or more processors 101, a memory 102, and one or more I / O interfaces 103. The memory 102 stores one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement any of the mobile network APN bearer establishment methods described in the above embodiments; the one or more I / O interfaces 103 are connected between the processor and the memory, configured to enable information interaction between the processor and the memory.
[0046] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus).
[0047] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.
[0048] In some embodiments, the one or more processors 101 include a field-programmable gate array.
[0049] This invention also provides a computer-readable medium. The computer-readable medium stores a computer program, which, when executed by a processor, implements the steps of any of the mobile network APN bearer establishment methods described in the above embodiments. The computer-readable storage medium may be volatile or non-volatile.
[0050] This invention also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in the processor of an electronic device, the processor in the electronic device executes the above-described mobile network APN bearer establishment method.
[0051] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).
[0052] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0053] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0054] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the invention.
[0055] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0056] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0057] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0058] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0059] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0060] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.
Claims
1. A method for establishing a mobile network APN bearer, characterized in that, include: Activate the APN after initialization; After activation, a timer is started, and the APN state machine state is updated based on the APN state returned by the modem and the timer. In response to the APN state machine's state update indicating a connection failure, a failure counter is used to record the number of failures, and the connection waiting time is increased based on the number of failures; the connection waiting time is the interval between the moment of connection failure and the moment of the next connection initiation.
2. The method of claim 1, wherein, The APN status includes: Startup, Initialization, Activation, Connecting, Connection Completed, Connection Failed, Disconnected, and Stopped.
3. The method of claim 1, wherein, The step of updating the APN state machine state based on the APN state returned by the modem and the timer includes: In response to receiving information reported by the modem, the APN state machine state is updated according to the information reported by the modem; If no information is reported by the modem within a preset time, the APN state machine state is updated based on the modem APN state information actively read by the upper layer application.
4. The method of claim 1, wherein, The method of increasing the connection waiting time based on the number of failures includes: Set the initial value for the connection wait time; Each time the failure count of the failure counter increases, the connection waiting time is increased by a preset gradient until the connection waiting time reaches a preset maximum threshold. In response to a successful APN connection, the failure counter is cleared and the connection wait time is reset to the initial value.
5. The method of claim 1, wherein, The troubleshooting process for a modem failing to connect to the network includes: If the modem is determined to be unable to connect to the network, switch to airplane mode; If the modem still cannot connect to the network after attempting to switch to flight mode a preset number of times, and the vehicle has moved a distance exceeding a preset distance, then the modem will be restarted.
6. The method of claim 5, wherein, The preset distance is 2 kilometers.
7. The method of claim 1, wherein, The APN status information returned by the modem is obtained in two priority levels. The first priority is that the modem actively reports the APN status information, and the second priority is that the upper layer application actively reads the APN status information of the modem. The first priority status information is used to update the APN state machine.
8. A mobile network APN bearer establishment system, characterized in that, Capable of implementing the method as described in claim 1, comprising: The activation module is used to activate the APN after initialization. The update module is used to start a timer after activation and update the APN state machine state based on the APN state returned by the modem and the timer. The waiting module is used to respond to the APN state machine's state update indicating a connection failure. It records the number of failures using a failure counter and increases the connection waiting time based on the number of failures. The connection waiting time is the interval between the moment of connection failure and the moment of initiating the next connection.
9. An electronic device, comprising: include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 7.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.