Internet access optimization method based on router and electronic equipment

The router monitors TCP flow data and adjusts the Internet configuration parameters, which solves the problem of users' Internet lag when surfing the Internet on wireless networks, and improves processing efficiency and user experience.

CN119629643APending Publication Date: 2025-03-14HONOR DEVICE CO LTD

Patent Information

Application Number
CN202311156599.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-07
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Users often encounter problems of lag when surfing the Internet using wireless networks, and it is difficult to identify the causes and solutions in time, resulting in poor user experience.

Method used

The router monitors the TCP flow data between the terminal and the network server, determines whether there is an abnormality in the channel, and adjusts the Internet configuration parameters in the abnormal situation to restore the normal channel and improves the efficiency of network lag processing.

Benefits of technology

It realizes timely detection and resolution of network lags, improving users' Internet access experience and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629643A_ABST
    Figure CN119629643A_ABST
Patent Text Reader

Abstract

The invention provides an internet access optimization method based on a router, and the method comprises the steps: enabling the router to obtain TCP flow data between a terminal and a network server in the process of building communication connection between the terminal and the network server, then determining whether an access between the terminal and the router is abnormal or not based on the TCP flow data, and if yes, carrying out the network access optimization. The condition of network connection can be detected in time; according to the embodiment of the invention, when the access with the terminal is abnormal, the network access configuration parameters are adjusted to enable the access to return to normal, so that the situation of the access abnormality can be handled in time, the network access lagging solving efficiency is improved, and the network access experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a router-based Internet access optimization method and electronic device. Background Art

[0002] When users use wireless networks to access the Internet, they may sometimes encounter Internet lags, such as web pages that cannot be loaded or video playback that is stuck. The root cause of Internet lags is an abnormality in the network data flow path, that is, an abnormality in the path between the terminal and the network server, or an abnormality in the path between the network server and the terminal. In the scenario of accessing the Internet through a wireless network, the terminal and the network server are connected by a router, that is, Internet lags may be caused by an abnormality in the path between the terminal and the router, or by an abnormality in the path between the router and the network server.

[0003] When the path between the terminal and the router is abnormal, the user can try to solve the Internet jam by restarting the router, reconnecting to the wireless network, or waiting for the network to recover. However, for the user, the user cannot know the reason for the Internet jam in time, and the above-mentioned methods for solving the Internet jam are inefficient, resulting in a poor Internet experience for the user. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a router-based Internet access optimization method and electronic device, in which the efficiency of Internet access jam processing is improved and the user's Internet access experience is enhanced.

[0005] In the first aspect, the present application provides a router-based Internet access optimization method, in which the router obtains TCP stream data between the terminal and the network server during the process of establishing a communication connection between the terminal and the network server, and then determines whether there is an abnormality in the path between the terminal based on the TCP stream data, so as to promptly detect Internet access jams; when there is an abnormality in the path between the terminal, the Internet access configuration parameters are adjusted to restore the path to normal, so that the path abnormality can be handled in a timely manner, the efficiency of resolving Internet access jams is improved, and the user's Internet access experience is improved.

[0006] According to the first aspect, in response to the device online reminder information, collecting the TCP stream data between the terminal and the network server includes: in response to the terminal going online, collecting the three-way handshake data between the terminal and the network server; the three-way handshake data includes the data of the first message segment, the data of the second message segment, and the data of the third message segment. In the embodiment of the present application, the collection of the TCP stream data between the terminal and the network server can be achieved by collecting the three-way handshake data, without the need to collect the messages in the data transmission process, which can simplify the collection process of the TCP stream data and improve the data collection efficiency.

[0007] According to the first aspect, or any implementation of the first aspect above, based on TCP stream data, determining whether there is an abnormality in the path between the terminal and the router includes: determining the LAN side delay based on the three-way handshake data; wherein the LAN side delay is the difference between the time when the second message segment is collected and the time when the third message segment is collected; when the LAN side delay is greater than a preset delay threshold, determining that there is an abnormality in the path between the router and the terminal. In the embodiment of the present application, the length of the LAN side delay can effectively reflect the data transmission speed between the terminal and the router, and therefore, the length of the LAN side delay can effectively determine whether there is an abnormality in the path between the router and the terminal.

[0008] According to the first aspect, or any implementation of the first aspect above, determining whether there is an abnormality in the path between the terminal and the TCP stream data includes: determining that there is an abnormality in the path between the terminal when there is retransmission between the first message segment and the second message segment, and the router does not receive the third message segment. In the embodiment of the present application, the retransmission of the first message segment and the second message segment and the failure of the router to receive the third message segment indicate that the downlink path from the router to the terminal cannot perform normal data transmission, thereby effectively determining that there is an abnormality in the path between the router and the terminal.

[0009] According to the first aspect, or any implementation of the first aspect above, determining whether there is an abnormality in the path between the terminal and the TCP stream data includes: determining that there is an abnormality in the path between the terminal and the TCP stream data when the number of times the second message segment is received is greater than the number of times the first message segment is received, and the third message segment is not received. In the embodiment of the present application, the number of times the second message segment is received is greater than the number of times the first message segment is received, and the third message segment is not received, indicating that the uplink path from the terminal to the router cannot perform normal data transmission, and thus it can be effectively determined that there is an abnormality in the path between the router and the terminal.

[0010] According to the first aspect, or any implementation of the first aspect above, determining whether there is an abnormality in the path between the terminal and the router based on the TCP stream data includes: determining whether there is an abnormality in the path between the terminal and the router based on the TCP stream data at preset intervals. In the embodiment of the present application, the path between the router and the terminal is regularly detected to determine whether the user is in a state of Internet access lag, so as to optimize the Internet access in a timely manner, thereby improving the user's Internet access experience.

[0011] According to the first aspect, or any implementation of the first aspect above, in the case of an abnormality in the path between the terminal, adjusting the Internet access configuration parameters includes: in the case of an abnormality in the path between the terminal, determining the actual power range in which the current signal transmission power is located; based on a preset adjustment relationship, increasing the current signal transmission power; wherein the preset adjustment relationship is used to indicate the correspondence between the actual power range and the step increase ratio. In the embodiment of the present application, the router automatically increases the current signal transmission power, prompting the connection path between the router and the terminal to return to normal, which can improve the efficiency of path abnormality processing and optimize the user's Internet access experience.

[0012] According to the first aspect, or any implementation of the first aspect above, when there is an abnormality in the path between the terminal, adjusting the Internet access configuration parameters includes: when there is an abnormality in the path between the terminal, controlling the angle and / or direction of the antenna to adjust. In the embodiment of the present application, the router automatically controls the angle and / or direction of the antenna to adjust so as to restore the connection path between the router and the terminal to normal, which can improve the efficiency of path abnormality processing and optimize the user's Internet access experience.

[0013] According to the first aspect, or any implementation of the first aspect above, in the case where there is an abnormality in the path between the terminal, adjusting the Internet access configuration parameters includes: in the case where there is an abnormality in the path between the terminal, determining the target channel in the current working frequency band; the target channel is used to indicate the channel with the least interference in the current working frequency band; switching the current working channel to the target channel. In the embodiment of the present application, the router switches the current working channel to the channel with the least interference to restore the connection path between the router and the terminal to normal, which can improve the efficiency of path abnormality processing and optimize the user's Internet access experience.

[0014] According to the first aspect, or any implementation method of the first aspect above, the three-way handshake data includes one or more of the sequence number, confirmation number, synchronization flag, confirmation flag, time and number of each message segment, so that the router can determine whether each message segment is transmitted normally through the detailed information of each message segment, and then determine whether the connection path between the terminal and the three-way handshake data is abnormal.

[0015] According to the first aspect, or any implementation of the first aspect above, in response to the terminal going online, it includes: a user management module in the router generates a device online reminder message, and sends the device online reminder message to a kernel module in the router; the kernel module determines that the terminal is online in response to the received device online reminder message, wherein online is used to indicate that the terminal is connected to the router. In the embodiment of the present application, after the terminal goes online, it will establish a communication connection with the network server, so the user management module initiates a device online reminder to the kernel module, so that the kernel module is ready to monitor TCP stream data, and then determines whether the connection path between the terminal and the kernel module is abnormal.

[0016] In a second aspect, an embodiment of the present application provides an electronic device, characterized in that the electronic device includes: one or more processors; a memory; and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by one or more processors, the electronic device executes any one of the implementation methods of the first aspect or the above first aspect.

[0017] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.

[0018] In a third aspect, an embodiment of the present application provides a computer storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes according to the first aspect, or any one of the implementation methods of the first aspect above.

[0019] The third aspect and any implementation of the third aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation of the third aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0021] Figure 2 A schematic diagram of the structure of a router provided in an embodiment of the present application;

[0022] Figure 3 A schematic block diagram of the software structure of a router provided in an embodiment of the present application;

[0023] Figure 4A schematic diagram of a flow chart of a method for optimizing Internet access based on a router provided in an embodiment of the present application;

[0024] Figure 5 An example diagram of a TCP message header format provided in an embodiment of the present application;

[0025] Figure 6 An example diagram of establishing a TCP connection provided in an embodiment of the present application;

[0026] Figure 7 A flowchart of another router-based Internet access optimization method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0028] The term "and / or" in this article is merely a description of 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.

[0029] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.

[0030] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0031] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0032] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1As shown, the application scenario includes a router 100; terminals such as a computer 101 and a mobile phone 102; an optical modem 103; and a network server 104. Among them, the network server 104 refers to a computer that stores network service software and website constituent files, which is connected to the Internet and supports data interaction with other devices connected to the Internet; the optical modem 103 is an optical network terminal (Optical Network Terminal), also known as an optical fiber user access device. The operator provides broadband (optical fiber) access to users, and the optical modem 103 is connected to the optical fiber, performs photoelectric conversion, realizes connection with the Internet, and then communicates with the network server 104; the router 100 (Router) is connected to the optical modem 103 through a network cable, converts the wired signal into a wireless signal, and connects to the user's terminal through a wireless signal, such as connecting to a computer 101, a mobile phone 102 and other devices. The router 100 serves as a connection transfer station between the terminal and the Internet, and forwards data between the terminal and the Internet. For example, the router 100 can receive data sent by the network server 104 in the Internet and forward it to the terminal, that is, the terminal downloads the data. The router 100 can also receive data sent by the terminal and forward it to the network server 104 in the Internet, that is, the terminal uploads data. The router 100 can analyze the destination addresses of data packets sent from various types of networks, and then forward each data packet to the destination address along the best route according to the selected routing algorithm. Figure 1 The types of terminals and the number of terminals shown are only examples and are not limited in this application.

[0033] exist Figure 1 In the scenario shown, when users use a wireless network to access the Internet, they sometimes encounter Internet jams, such as web pages that cannot be loaded, video playback jams, and the like. The root cause of Internet jams is the abnormality of the network data flow path, that is, the path between the terminal and the network server is abnormal, or the path between the network server and the terminal is abnormal. In the scenario of accessing the Internet through a wireless network, the terminal and the network server are connected by a router as a link, that is, the Internet jam may be due to the abnormal path between the terminal and the router, or it may be due to the abnormal path between the router and the network server. When the path between the terminal and the router is abnormal, the user can try to solve the Internet jam by restarting the router, reconnecting to the wireless network, or waiting for the network to recover. However, for users, users cannot promptly learn the cause of the Internet jam, and the above-mentioned method for solving the Internet jam is inefficient, resulting in a poor user experience.

[0034] To this end, an embodiment of the present application provides a router-based Internet access optimization method, in which the router determines whether there is an abnormality in the wireless connection path between the terminal by monitoring the TCP (Transmission Control Protocol) three-way handshake data between the user terminal and the network server, and automatically adjusts the Internet access configuration parameters of the router and / or notifies the user to adjust the Internet access configuration parameters of the router when there is an abnormality in the connection path with the terminal, so as to promptly resolve Internet access freezes caused by abnormal paths between the terminal and the router, improve the efficiency of Internet access exception handling, and thus enhance the user's Internet access experience.

[0035] Before describing the technical solution of the embodiment of the present application, the router of the embodiment of the present application is first described in conjunction with the accompanying drawings. It should be understood that: Figure 2 The electronic device 200 shown is only one example of a router, and the electronic device 200 may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different configuration of components. Figure 2 The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits. In the embodiment of the present application, the electronic device 200 can be a device with a routing function, such as a router, a gateway, etc.

[0036] Figure 2 A schematic diagram of the structure of a router provided in an embodiment of the present application. Figure 2 As shown, the electronic device 200 includes a memory 201 , a processor 202 , a switch 203 , an interface 204 (physical interface), a power module 205 , a wireless communication module 206 and an antenna 207 .

[0037] Among them, the memory 201 can adopt non-volatile memory, random access memory, flash memory and read-only memory. The random access memory will discard its information when the router is started or the power supply is off. The read-only memory stores the startup software of the router. The startup software is the first software run by the router and is responsible for the router to enter the normal working state. The router saves the complete operating system in the random storage memory as a backup so that it can be used as a backup when the operating system cannot be used. The electronic device 200 has a dynamic host configuration protocol server (Dynamic Host Configuration Protocol, DHCP server). The random access memory can be used as a storage device for the IP address (Internet Protocol Address, Internet Protocol address) pool. When the terminal requests the electronic device 200 to allocate an IP address, the DHCP server of the electronic device 200 selects an IP address from the IP address pool and allocates it to the terminal. In addition, the random access memory can also store various parameters such as the MAC address of the terminal, the IP address assigned to the terminal by the electronic device 200, the binding relationship between the MAC address (Media Access Control Address, also known as the physical address) of the terminal and the IP address. In addition, the random access memory can also store image resource data (location, interface parameters, appearance, etc. of the virtual interface (virtual LAN interface of the LAN interface) corresponding to the physical interface (such as the LAN interface) of the electronic device 200, and the mapping relationship between the physical interface and the virtual interface. The read-only memory is usually set on one or more chips and soldered on the motherboard of the router.

[0038] The main purpose of the flash memory is to store the operating system of the electronic device 200 and maintain the normal operation of the router. If the router is equipped with a flash memory, it is mainly used to boot the default position of the router operating system. As long as the capacity of the flash memory is sufficient, multiple operating system images can be saved to provide multiple boot options, wherein the operating system of the electronic device 200 can adopt the Linux operating system. The main function of the non-volatile memory is to save the configuration data (startup configuration) read in when the operating system starts. The random access memory is mainly used as a storage area for the operating system table and buffer. The operating system can meet all conventional storage needs through the random access memory, so that the router can quickly access this information, wherein the storage speed of the random access memory is better than the three types mentioned above. It is understandable that the parameters such as the IP pool of the router, the parameters of the terminal, the image resource data, and the binding relationship between the MAC address and the IP address of the terminal can also be stored in the non-volatile memory or other types of memory, and the embodiments of the present application are not limited here.

[0039] The processor 202 is mainly responsible for the configuration management of the router and the forwarding of data packets. It has strong parallel processing capabilities and can support the parsing, storage and forwarding of network protocol messages. The processor 202 may include one or more processing units. For example, the processor 202 may include an application processor (application processor, AP), a modem processor, a graphics processor (Graphics processing unit, GPU), an image signal processor (Image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (Digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. The controller can be the nerve center and command center of the electronic device 200. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0040] A memory may also be provided in the processor 202 for storing instructions and parameters related to the electronic device 200 and parameters related to the terminal. In some embodiments, the memory in the processor 202 is a cache memory. The memory may store instructions or data that the processor 202 has just used or cyclically used. If the processor 202 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, and the waiting time of the processor 202 is reduced, thereby improving the efficiency of the electronic device 200. The processing unit in the processor 202 may convert the data packet of the electronic device 200 into a bit stream and send it to the switch 203. The processing unit may be referred to as a MAC processing unit, including a hardware part, namely the GMAC hardware, and a software part, namely the GMAC software.

[0041] The switch 203 parses the bit stream from the MAC processing unit to obtain the MAC address of the terminal. The electronic device 200 searches for the terminal corresponding to the MAC address, sends the corresponding data (such as IP address and video stream) to the corresponding physical interface, and sends it to the terminal through the physical interface.

[0042] Interface 204 (physical interface) includes but is not limited to a local area network interface (LAN interface), a wide area network interface (WAN interface) and a router configuration interface. The router configuration interface may include a console port and an auxiliary port. The processor 202 is connected to the terminal through the switch 203 and the interface 204. The number of local area network interfaces, wide area network interfaces and router configuration interfaces is not limited to one. The types of local area network interfaces (LAN interfaces) include standard network interfaces such as Ethernet, Fast Ethernet, Gigabit Ethernet, and 10 Gigabit Ethernet M. In each network, interfaces of different media standards can be supported, such as RJ45 interfaces, optical fiber interfaces, thick coaxial cable interfaces, etc. The electronic device 200 can be connected to the terminal through the RJ45 interface to realize data communication with the terminal. The wide area network interface includes a synchronous serial interface and an asynchronous serial interface. The electronic device 200 is connected to the wide area network through the WAN interface to realize a cross-regional wide area network data communication network. The console port Console is usually used to connect the interface to the terminal using a dedicated connection line when performing basic configuration on the electronic device 200. The console port is usually used to connect the interface to the terminal using a dedicated cable when performing basic configuration on the electronic device 200. As a console port, it enables users or administrators to communicate with the electronic device 200 using a network access device to complete the configuration of the router. This port provides an EIA / TIA-232 asynchronous serial interface for configuration on the electronic device 200. As an auxiliary port, an EIA / TIA-232 asynchronous serial interface is also provided. The difference is that it is often used to connect a modem to achieve remote management of the router.

[0043] The power module 205 may include a power source, a power management component, etc. The power management component is used to manage the charging of the power source and the supply of power to other modules.

[0044] The electronic device 200 also has a wireless communication module 206. This allows the wireless router to implement Figure 1 The wireless communication between the smart phone, wireless speaker, portable computer and tablet computer shown in the figure. The wireless communication module can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), near field communication (NFC), infrared (IR) and other wireless communication solutions applied on the terminal. The wireless communication module can be one or more devices integrating at least one communication processing module.

[0045] The wireless communication module 206 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 technology (NFC), infrared technology (IR), etc. applied to the electronic device 200. The wireless communication module 206 can be one or more devices integrating at least one communication processing module. The wireless communication module 206 can be one or more devices integrating at least one communication processing module. The wireless communication module 206 receives electromagnetic waves via the antenna 207, modulates the electromagnetic wave signal and filters it, and sends the processed signal to the processor 202. The wireless communication module 206 can also receive the signal to be sent from the processor 202, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 207. The wireless communication module 206 can support 2.4G or 5G network signal rates.

[0046] Antenna 207 is used to transmit and receive electromagnetic wave signals. The wireless communication function of electronic device 200 can be implemented by antenna 207, wireless communication module 260, modulation and demodulation processor and baseband processor. Each antenna in electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 207 can be reused as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0047] In some embodiments, the electronic device 200 also includes a display screen, buttons, indicators, etc.

[0048] The electronic device 200 implements the display function through a GPU, a display screen, and an application processor. The GPU is a microprocessor for image processing, which is connected to the display screen and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 202 may include one or more GPUs, which execute program instructions to generate or change display information. The display screen is used to display images, videos, etc. The display screen includes a display panel. The display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc.

[0049] The key includes a power key, etc. The key may be a mechanical key or a touch key. The electronic device 200 may receive key input and generate key signal input related to user settings and function control of the electronic device 200.

[0050] The indicator may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, such as power on, connecting an optical modem, etc.

[0051] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0052] The software system of the electronic device 200 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the layered architecture as an example to illustrate the software structure of the electronic device 200. Figure 3 A schematic block diagram of the software structure of a router provided in an embodiment of the present application.

[0053] like Figure 3 As shown, the layered architecture of the electronic device 200 divides the software into several layers: operating system kernel layer, driver layer and application layer. Each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. It can be understood that Figure 3The operating system kernel layer, driver layer, and application layer shown do not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may include more or fewer layers than shown in the figure, and each layer may include more or fewer components, or combine some components, or split some components, or arrange the components differently.

[0054] The application layer includes user management modules, network applications, and dynamic host configuration protocol (DHCP) modules. Each module of the application layer can delegate the kernel module of the operating system kernel layer to work by calling the Socket library (a basic library for network programming that provides functions for establishing network connections, sending and receiving data).

[0055] Among them, the user management module is used to detect whether the terminal is online, and generate terminal online notification information when the terminal is online, and pass the information to the operating system kernel layer through Netlink. Netlink is a special socket. Netlink is a special inter-process communication (IPC) used to realize communication between user processes and kernel processes. It is also the most commonly used interface for network applications to communicate with the kernel.

[0056] The operating system kernel layer may include a file system, a memory management unit, a process scheduling unit, and a process communication unit. Among them, the file system is used to define the data block information of all files in the operating system of the electronic device 200, and establish a file index based on this, and provide support for file query and modification for the memory management unit, the process scheduling unit, and the process communication unit. The memory management unit can provide the process scheduling unit with the address space required for operation, and manage the data information involved in the operation of the process scheduling unit. The process scheduling unit is responsible for processing the application request of the upper-layer application program in the router. The process communication unit is responsible for providing communication support for the operation of the process scheduling unit.

[0057] In an embodiment of the present application, the operating system kernel layer may include a kernel module, and the kernel module includes a kernel protocol stack, a memory data management module and a timing monitoring and reporting module.

[0058] Among them, the kernel protocol stack includes two parts. The upper part includes TCP and UDP protocols responsible for sending and receiving data. They will accept the entrustment of the application layer to perform the operation of sending and receiving data. The lower part uses the IP protocol to control the sending and receiving operation of network packets. When uploading data on the Internet, the data will be divided into pieces of network packets, and the operation of sending network packets to the other party is the responsibility of IP. IP also includes ICMP protocol and ARP protocol. ICMP is used to inform the errors and various control information generated during the transmission of network packets. ARP is used to query the corresponding Ethernet MAC address according to the IP address. In the embodiment of the present application, the kernel protocol stack is used to set a monitoring point for collecting three-way handshake data between the terminal and the network server.

[0059] The memory data management module is used to receive and store the three-way handshake data between the terminal and the network server collected by the kernel protocol stack at each monitoring point.

[0060] The timing monitoring and reporting module is used to poll the three-way handshake data in the memory data management module according to the set period, and determine whether there is an abnormality in the path between the terminal and the router according to the three-way handshake data. If there is an abnormality in the path between the terminal and the router, the abnormal information is reported to the routing connection module of the driver layer.

[0061] The driver layer includes a variety of drivers, such as a network card driver, which is responsible for controlling the network card hardware. The driver layer is used to encapsulate all hardware in the operating system of the electronic device 200, and open an interface to the file system of the operating system kernel layer, forming files in the file system for upper layer calls, such as the processor 202 or other hardware of the electronic device 200.

[0062] In an embodiment of the present application, the driver layer also includes a routing connection module, which is used to receive abnormal information from the timing monitoring and reporting module, and adjust the Internet access configuration parameters of the router in response to the abnormal information to restore the path between the terminal and the router to normal.

[0063] Figure 4 The following is a flow chart of a method for optimizing Internet access based on a router provided in an embodiment of the present application. Figure 4 As shown, the Internet access optimization method is applied to a router, wherein the router includes a user management module, a kernel module and a routing connection module. The Internet access optimization method includes: steps S41 to S44.

[0064] Step S41: The user management module sends device online reminder information to the kernel module.

[0065] The device online reminder information is used to indicate that the terminal is connected to the router.

[0066] In one embodiment, the user's terminal connects to the router and starts surfing the Internet, that is, after the terminal connects to the router, a communication connection is established with the network server through the router. The user management module of the router senses the terminal connection and generates a device online reminder message. The user management module sends the device online reminder message to the kernel module, and the device online reminder message is used to remind the kernel module that the terminal is connected to the router, so that the kernel module monitors the process of establishing a communication connection between the terminal and the network server to obtain TCP flow data between the terminal and the network server.

[0067] Step S42: The kernel module collects TCP stream data between the terminal and the network server in response to the device online reminder information.

[0068] The TCP stream data includes the message data exchanged during at least one data transmission process between the terminal and the network server, that is, the process in which the terminal and the network server establish a TCP connection through a three-way handshake, transmit data after the TCP connection, and release the TCP connection after the data transmission ends.

[0069] TCP is a connection-oriented protocol, which transmits TCP segments based on transport connections. The establishment and release of TCP transport connections are essential processes in every connection-oriented communication. It should be noted that if a terminal wants to achieve data transmission with a network server, it must first establish a TCP connection with the network server through a three-way handshake, and data transmission can only be performed after the TCP connection is established. Therefore, in the embodiment of the present application, when the kernel module collects the TCP stream data between the terminal and the network server, the three-way handshake data between the terminal and the network server is mainly collected.

[0070] Figure 5 The following is an example of a TCP message header format provided in an embodiment of the present application. Figure 5 As shown, in the process of establishing a TCP connection between the terminal and the network server, the fixed header of the TCP message exchanged between the two includes the source port, destination port, sequence number, confirmation number, confirmation flag ACK, data offset, window, synchronization flag SYN, push flag PSH, checksum and urgent pointer.

[0071] The source port occupies 16 bits (bit 0 to bit 15) and is used to write the source port number, which is used to identify the application process that sends the TCP segment. The destination port occupies 16 bits (bit 16 to bit 31) and is used to write the destination port number, which is used to identify the application process that receives the TCP segment.

[0072] The sequence number seq occupies 32 bits and has a value range of [0, 2^32-1]. After the sequence number increases to the last one, the next sequence number returns to 0.

[0073] The confirmation number synack occupies 32 bits and has a value range of [0, 2^32-1]. After the confirmation number increases to the last one, the next confirmation number returns to 0. The confirmation number is used to indicate the sequence number of the first byte of the data payload of the next TCP segment expected to be received from the other party. It is also a confirmation of all the data received before. If the confirmation number = n, it means that all the data up to sequence number n-1 have been received correctly, and the data with sequence number n is expected to be received.

[0074] The confirmation flag ACK, the confirmation number field is valid only when the value is 1; the confirmation number field is invalid when the value is 0. The TCP protocol stipulates that after the connection between the terminal and the network server is established, all transmitted TCP segments must set ACK to 1.

[0075] The data offset occupies 4 bits and is measured in 4 bytes. It is used to indicate how far the start of the data payload part of the TCP segment is from the start of the TCP segment.

[0076] Window, occupies 16 bits, in bytes, and is used to indicate the receiving window of the party sending this message segment.

[0077] The synchronization flag SYN is used to synchronize the sequence number when the TCP connection is established.

[0078] The termination flag FIN is used to release the TCP connection.

[0079] The reset flag RST is used to reset the TCP connection.

[0080] Push flag PSH: When the receiving TCP receives a segment with this flag set to 1, it will submit it to the application process as soon as possible, without having to wait until the receive buffer is full before delivering it upward.

[0081] The checksum, which takes up 16 bits, is used to check the header and data payload of the TCP segment. When calculating the checksum, a 12-byte pseudo header is added to the front of the TCP segment.

[0082] The urgent pointer occupies 16 bits and is used in bytes to indicate the length of the urgent data.

[0083] In the embodiment of the present application, the kernel module responds to the device online reminder information and collects the TCP messages exchanged in the three-way handshake between the terminal and the network server.

[0084] Figure 6 This is an example diagram of establishing a TCP connection provided by an embodiment of the present application. Figure 6As shown, the two communicating parties that establish a TCP connection are the terminal (also called a TCP client) and the network server (also called a TCP server). The process of establishing a TCP connection can be likened to a "handshake". The terminal and the network server need to handshake three times to establish a TCP connection, that is, three TCP segments need to be exchanged between the terminal and the network server.

[0085] like Figure 6 As shown in the figure, during the first handshake process, the terminal sends the first segment to the network server via the router. The first segment is a TCP connection request segment. The synchronization bit SYN in the header of the first segment is set to 1, indicating that this is a TCP connection request segment. The sequence number field seq is set to an initial value x as the initial sequence number selected by the terminal.

[0086] After receiving the first message segment, if the network server agrees to establish a connection, it returns the second message segment to the terminal through the router (the second handshake process) and enters the synchronous received state. The second message segment is a TCP connection request confirmation message segment. In the second message segment, the synchronization bit SYN and the confirmation bit ACK in the header are both set to 1, indicating that this is a TCP connection request. The sequence number field seq is set to an initial value y, which is the initial sequence number selected by the TCP server process. The value of the confirmation number field synack is set to x+1, which is a confirmation of the initial sequence number seq selected by the TCP client process.

[0087] After the terminal receives the second segment forwarded by the router, it also sends the third segment to the network server via the router (the third handshake process) and enters the connection established state. The third segment is a common TCP confirmation segment. In the third segment, the confirmation bit ACK in the header is set to 1, indicating that this is a common TCP confirmation segment; the sequence number field seq is set to x+1, because the sequence number of the first TCP segment sent by the TCP client process is x and does not carry data, so the sequence number of the second segment is x+1; the confirmation number field synack is set to y+1, which is a confirmation of the initial sequence number selected by the TCP server process.

[0088] After the network server receives the third message segment of the terminal forwarded by the router, it can confirm that the data transmission from the server to the client is normal, and thus enters the connection established state. In this case, both the terminal and the network server enter the connection established state, and reliable data transmission can be performed based on the established TCP connection.

[0089] By the aforementioned Figure 1 As can be seen from the scenario shown, in the embodiment of the present application, the router is used to implement data forwarding between the terminal and the network server. Figure 6In the three-way handshake process shown, the first message and the third message sent by the terminal are sent to the network server via the router, and the second message sent by the network server is sent to the terminal via the router. It can be understood that after the TCP connection is established, the router also forwards the data when the terminal and the network server perform data transmission.

[0090] In the embodiment of the present application, when the kernel module collects the TCP stream data between the terminal and the network server, it can mainly collect the three-way handshake data between the terminal and the network server. The kernel module can collect multiple TCP stream data between the terminal and the network server, and each TCP stream data includes but is not limited to the sequence number seq, confirmation number synack, synchronization flag SYN, confirmation flag ACK, time, number of times and other information of each message during the three-way handshake process. Among them, time refers to the time when the message is monitored, and the number of times refers to the number of times each type of message (types include: first message segment, second message segment, third message segment) is monitored.

[0091] Step S43: The kernel module determines whether there is an abnormality in the path between the router and the terminal based on the TCP stream data.

[0092] In one example, the kernel module determines the LAN side delay based on the TCP stream data, and when the LAN side delay is greater than a preset delay threshold, determines that there is an abnormality in the path between the router and the terminal.

[0093] Among them, the LAN side delay (Round-Trip Time, RTT) indicates the difference between the time when the kernel module monitors (receives or collects) the second message segment and the time when the third message segment is monitored. That is, in this example, the kernel module receives the second message segment sent by the network server and forwards the second message segment to the terminal, and then the kernel module receives the third message segment returned by the terminal to the network server. The duration of this process is determined as the LAN side delay. When the LAN side delay is greater than the preset delay threshold, it means that the data transmission speed between the terminal and the router is slow, and there is an abnormality in the path between the router and the terminal.

[0094] It can be understood that the preset delay threshold can be set according to actual application conditions, for example, it can be set to 30ms. The preset delay threshold is not specifically limited in the embodiment of the present application.

[0095] In another example, the kernel module determines the LAN side delay in a plurality of consecutive TCP data streams, and determines that there is an abnormality in the path between the router and the terminal when the LAN side delay in a preset number of TCP data streams is greater than a preset delay threshold. In this example, by determining the LAN side delay in a plurality of consecutive TCP data streams, the accuracy of determining the abnormality of the path between the terminal and the network server is further improved, avoiding misjudgment.

[0096] In yet another example, when the first message segment and the second message segment are retransmitted and the third message segment is not received, it is determined that there is an abnormality in the path between the router and the terminal.

[0097] In this example, the terminal sends a first message segment to the router, the router forwards the first message segment to the network server, the network server returns a second message segment to the router based on the first message segment, and the router forwards the second message segment to the terminal. However, due to an abnormality in the downlink path from the router to the terminal, the terminal does not receive the second message segment, and will not return a third message segment based on the second message segment. In this case, the terminal will resend the first message segment because it does not receive the second message segment due to a timeout; the network server will also resend the second message segment because it does not receive the third message segment due to a timeout. Therefore, based on the TCP stream data, the kernel module determines that there is an abnormality in the path between the router and the terminal when it determines that the first message segment and the second message segment are retransmitted and the third message segment is not received.

[0098] It is understandable that whether a message is retransmitted can be determined based on the number of monitored messages. For example, in a TCP data stream, if the first message segment is monitored twice, it means that the first message segment is retransmitted.

[0099] In yet another example, when the number of times the second message segment is received is greater than the number of times the first message segment is received and the third message segment is not received, it is determined that there is an abnormality in the path between the router and the terminal.

[0100] In this example, the terminal sends a first message segment to the router, the router forwards the first message segment to the network server, the network server returns a second message segment to the router based on the first message segment, the router forwards the second message segment to the terminal, and the terminal returns a third message segment to the router based on the second message segment. However, due to an abnormality in the uplink path from the terminal to the router, the router does not receive the third message segment, and is even more unable to forward the third message segment to the network server. In this case, the network server will resend the second message segment because it does not receive the third message segment due to timeout, so that the number of times the kernel module receives the second message segment is greater than the number of times the first message segment is received. Therefore, based on the TCP stream data, the kernel module determines that there is an abnormality in the path between the router and the terminal when it determines that the number of times the second message segment is received is greater than the number of times the first message segment is received, and the third message segment is not received.

[0101] In another example, when the third message segment is received multiple times, and the number of times the third message segment is received is greater than the number of times the first message segment is received, and greater than the number of times the second message segment is received, it is determined that there is an abnormality in the path between the router and the terminal. In this example, the disorder of the three-way handshake sequence will cause the terminal to send the third message segment multiple times. Therefore, when the third message segment is received multiple times, and the number of times the third message segment is received is greater than the number of times the first message segment is received, and greater than the number of times the second message segment is received, it is determined that there is an abnormality in the path between the router and the terminal.

[0102] Step S44: When there is an abnormality in the path between the terminal and the router, the kernel module sends an abnormality reminder message to the routing connection module.

[0103] The abnormality reminder information is used to indicate that the channel between the terminal and the router is abnormal.

[0104] Step S45: The routing connection module adjusts the Internet access configuration parameters of the router in response to the abnormal reminder information, so that the path between the terminal and the router returns to normal.

[0105] The Internet access configuration parameters include at least one of signal transmission power, working channel and antenna angle.

[0106] In one example, the routing connection module adjusts the Internet access configuration parameters of the router in response to abnormal reminder information, including: when there is an abnormality in the path between the terminal and the router, determining the actual power range of the current signal transmission power, and increasing the current signal transmission power based on a preset adjustment relationship; wherein the preset adjustment relationship is used to indicate the correspondence between the actual power range and the step increase ratio.

[0107] The following table is an example table of the correspondence between an actual power range and a step-up ratio provided in an embodiment of the present application. For example, when the actual power range of the current signal transmission power belongs to the range A to B, the current signal transmission power is increased by 10% according to the step-up ratio corresponding to the actual power range to serve as the new signal transmission power of the router.

[0108] It can be understood that the correspondence between the actual power range and the step-up ratio in the table is only for illustrative purposes and is not specifically limited in the embodiments of the present application.

[0109] Actual power range (mW) Step Up Ratio A~B 10% B~C 5% C~D 2%

[0110] In another example, the routing connection module adjusts the Internet access configuration parameters of the router in response to the abnormal reminder information, including: when there is an abnormality in the path between the terminal and the router, determining the channel with the least interference in the current working frequency band, and switching the current working channel to the channel with the least interference.

[0111] In this example, the router has two working frequency bands: 2.4G and 5G, and each working frequency band has multiple working channels. The router detects the channel with the least interference and then switches the current working channel to the channel with the least interference.

[0112] In another example, the step of adjusting the Internet access configuration parameters of the router by the routing connection module in response to the abnormal reminder information includes: when there is an abnormality in the path between the terminal and the router, controlling the angle and / or direction of the antenna for adjustment.

[0113] It should be noted that the router generally has 4 to 6 external antennas. By adjusting the rotation angle and direction of the antenna, the distribution of the wireless wave can be changed, which promotes the restoration of the channel between the terminal and the router to normal. In the embodiment of the present application, the adjustment range of the angle and / or direction of the antenna is not specifically limited. For example, the angle of each antenna can be controlled to be different, and the direction of each antenna can be controlled to be different.

[0114] In some embodiments, the antenna of the router can be adjusted in the following two ways. One is that the routing connection module can send a message notification to the terminal (such as a mobile phone) through the relevant routing software to inform the user to manually adjust the antenna. The other is to place a mechanical antenna inside the router software, and the routing connection module automatically adjusts the antenna by issuing commands.

[0115] It can be understood that when there is an abnormality in the path between the terminal and the router, the routing connection module can adjust the Internet access configuration parameters of the router through the adjustment method in one of the above examples, or can adjust the Internet access configuration parameters of the router by combining the adjustment methods in multiple examples, which is not specifically limited in this embodiment.

[0116] In a router-based Internet access optimization method provided in an embodiment of the present application, a user management module sends a device online reminder message to a kernel module. The kernel module responds to the device online reminder message, collects TCP stream data between the terminal and the network server, and determines whether there is an abnormality in the path between the router and the terminal based on the TCP stream data, and promptly determines whether the terminal has Internet access jams. In the event that there is an abnormality in the path between the terminal and the router, the routing connection module adjusts the Internet access configuration parameters of the router to restore the path between the terminal and the router to normal, and can promptly handle Internet jams, thereby improving the efficiency of resolving Internet jams and thereby improving the user's Internet access experience.

[0117] Figure 7 A flowchart of another method for optimizing Internet access based on a router provided in an embodiment of the present application is shown below. Figure 7As shown, the router includes a user management module, a kernel module and a routing connection module, wherein the kernel module includes a kernel protocol stack, a memory data management module and a timing monitoring and reporting module. Figure 7 As shown, the Internet access optimization method includes steps S701 to S710.

[0118] Step S701: The scheduled monitoring reporting module starts a scheduled monitoring operation in response to the router being powered on.

[0119] In one embodiment, after the timing monitoring module starts the timing monitoring operation, the memory data management module performs a TCP data flow information polling once per preset period. The preset period can be set according to the actual application, for example, set to 10s, which is not specifically limited in the embodiment of the present application.

[0120] Step S702: The user management module sends device online reminder information to the memory data management module.

[0121] Among them, the device online reminder information is used to indicate that the terminal has been connected to the router.

[0122] In one embodiment, the user's terminal connects to the router and starts surfing the Internet. The user management module of the router senses the terminal connection and generates a device online reminder message. The user management module sends the device online reminder message to the memory data management module, and the device online reminder message is used to remind the memory data management module that the terminal has connected to the router.

[0123] In one embodiment, the user management module transmits the information to the memory data management module via Netlink. Netlink is a special socket, a special inter-process communication (IPC) used to implement communication between user processes and kernel processes, and is also the most commonly used interface for network applications to communicate with the kernel.

[0124] Step S703: The memory data management module records the device information of the terminal.

[0125] In one implementation, the memory data management module may add device information of the terminal, or update the device information of the terminal.

[0126] In the embodiment of the present application, after the terminal is connected to the router, before data transmission with the network server is performed, it is necessary to perform a three-way handshake with the network server through the router to achieve a TCP connection with the network server.

[0127] Step S704: The kernel protocol stack collects TCP stream data between the terminal and the network server.

[0128] The TCP stream data includes the message data exchanged during at least one data transmission process between the terminal and the network server, that is, the process in which the terminal and the network server establish a TCP connection through a three-way handshake, transmit data after the TCP connection, and release the TCP connection after the data transmission ends.

[0129] TCP is a connection-oriented protocol, which transmits TCP segments based on transport connections. The establishment and release of TCP transport connections are essential processes in every connection-oriented communication. It should be noted that if a terminal wants to realize data transmission with a network server, it must first establish a TCP connection with the network server through a three-way handshake, and data transmission can only be performed after the TCP connection is established. Therefore, in an embodiment of the present application, when the kernel module collects TCP stream data between the terminal and the network server, it can mainly collect the three-way handshake data between the terminal and the network server, that is, mainly collect the first message sent by the terminal to the network server, the second message returned by the network server based on the first message, and the third message returned by the terminal to the network server based on the second message.

[0130] In the embodiment of the present application, monitoring points are set at different positions of the kernel protocol stack to collect the three-way handshake data between the terminal and the network server. For example, monitoring points can be set at FORWARD (where the message from the terminal is forwarded), PREROUTING (before the data packet enters the router), POSTROUTING (before it is sent to the network card), etc.

[0131] In the embodiment of the present application, when the monitoring point in the kernel protocol stack collects the TCP flow data between the terminal and the network server, it can mainly collect the three-way handshake data between the terminal and the network server. The kernel module can collect multiple TCP flow data between the terminal and the network server, and each TCP flow data includes but is not limited to the sequence number seq, confirmation number synack, synchronization flag SYN, confirmation flag ACK, time, number of times and other information of each message during the three-way handshake process. Among them, time refers to the time when the message is monitored, and the number of times refers to the number of times each type of message (types include: first message segment, second message segment, third message segment) is monitored.

[0132] Step S705: The kernel protocol stack sends the collected TCP stream data to the memory data management module.

[0133] It should be noted that the monitoring point in the kernel protocol stack sends TCP stream data in real time. For example, when the monitoring point in the kernel protocol stack collects the first message segment sent by the terminal to the network server, it will immediately send the first message segment to the memory data management module.

[0134] Step S706: The memory data management module receives and stores the collected TCP stream data.

[0135] In one embodiment, the memory data management module receives the first message segment and updates the information corresponding to the first message segment, such as sequence number seq, confirmation number synack, synchronization flag SYN, confirmation flag ACK, time, number of times and other information.

[0136] In another embodiment, the memory data management module receives the second message segment and updates the information corresponding to the second message segment, such as sequence number seq, confirmation number synack, synchronization flag SYN, confirmation flag ACK, time, number of times and other information.

[0137] In another embodiment, the memory data management module receives the third message segment and updates the information corresponding to the third message segment, such as sequence number seq, confirmation number synack, synchronization flag SYN, confirmation flag ACK, time, number of times and other information.

[0138] Step S707: The timing monitoring and reporting module polls the memory data management module to obtain TCP data flow information from the memory data management module.

[0139] Step S708: The timing monitoring and reporting module determines whether there is any abnormality in the path between the router and the terminal based on the acquired TCP data flow information.

[0140] Among them, the step in which the scheduled monitoring and reporting module determines whether there is an abnormality in the path between the router and the terminal based on the acquired TCP data flow information can be referred to the detailed description of the kernel module determining whether there is an abnormality in the path between the router and the terminal based on the TCP flow data in the aforementioned embodiment, which will not be repeated here.

[0141] Step S709: When the timing monitoring and reporting module determines that there is an abnormality in the path between the router and the terminal, the timing monitoring and reporting module sends an abnormality reminder message to the routing connection module.

[0142] The abnormality reminder information is used to indicate that the channel between the terminal and the router is abnormal.

[0143] Step S710: The routing connection module adjusts the Internet access configuration parameters of the router in response to the abnormal reminder information, so that the path between the terminal and the router returns to normal.

[0144] The Internet access configuration parameters include at least one of signal transmission power, working channel and antenna angle.

[0145] In this embodiment, the step of adjusting the Internet access configuration parameters of the router by the routing connection module in response to the abnormal reminder information can be referred to the detailed description of adjusting the Internet access configuration parameters of the router in the above embodiment, which will not be repeated here.

[0146] In a method for optimizing Internet access based on a router provided in an embodiment of the present application, a user management module sends a device online reminder message to a memory data management module, and the memory data management module responds to the device online reminder message, receives and stores the TCP stream data between the terminal and the network server collected by the kernel protocol stack; the timed monitoring and reporting module starts the timed monitoring operation, polls the memory data management module once every predetermined time, obtains the TCP stream data of the terminal and the network server, and determines whether there is an abnormality in the path between the router and the terminal based on the TCP stream data, so as to timely determine whether the terminal has Internet access jams. In the case of an abnormality in the path between the terminal and the router, the routing connection module adjusts the Internet access configuration parameters of the router so that the path between the terminal and the router returns to normal, and can promptly handle Internet jams, improve Internet jam resolution efficiency, and thus improve the user's Internet experience.

[0147] The steps performed by the electronic device 200 in the above-mentioned method for optimizing Internet access based on a router provided in the embodiment of the present application may also be performed by a chip system included in the electronic device 200, wherein the chip system may include a processor and a Bluetooth chip. The chip system may be coupled to a memory so that when the chip system is running, the computer program stored in the memory is called to implement the steps performed by the above-mentioned electronic device 200. The processor in the chip system may be an application processor or a processor other than an application processor.

[0148] This embodiment further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment.

[0149] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the method in the above-mentioned embodiment.

[0150] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above-mentioned method embodiments.

[0151] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.

[0152] Through the description of the above implementation methods, technical personnel in the relevant field can 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.

[0153] In the several embodiments provided in the present 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 only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, 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.

[0154] The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be a physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present application may be integrated in a processing unit, or each unit may exist physically separately, or two or more units may be integrated in one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0155] Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above contents is within the scope of the present application. 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 such an 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, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read only memory, ROM), random access memory (random access memory, RAM), disk or optical disk and other media that can store program code. The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0156] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in a hardware manner, or can be implemented by a processor executing a software instruction. The software instruction can be composed of corresponding software modules, and the software module can be stored in a random access memory (Random Access Memory, RAM), a flash memory, a read-only memory (Read Only Memory, ROM), an erasable programmable read-only memory (Erasable Programmable ROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), a register, a hard disk, a mobile hard disk, a read-only compact disk (CD-ROM) or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (application specific integrated circuit, ASIC). In addition, the ASIC can be located in a router. Of course, the processor and the storage medium can also be present in a router as discrete components.

[0157] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0158] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for optimizing Internet access based on a router, characterized in that: Applied to a router, the method comprises: In the process of establishing a communication connection between the terminal and the network server, obtaining TCP stream data between the terminal and the network server; Based on the TCP stream data, determining whether there is an abnormality in the path between the terminal and the TCP stream data; When there is an abnormality in the path between the terminal, the Internet access configuration parameters are adjusted to restore the path to normal.

2. The method according to claim 1, characterized in that The step of acquiring TCP stream data between the terminal and the network server during the process of establishing a communication connection between the terminal and the network server includes: In response to the terminal going online, three-way handshake data between the terminal and the network server is collected; the three-way handshake data includes data of the first message segment, data of the second message segment, and data of the third message segment.

3. The method according to claim 2, characterized in that The determining, based on the TCP stream data, whether there is an abnormality in the path between the terminal and the TCP stream data comprises: Based on the three-way handshake data, determining the LAN side delay; wherein the LAN side delay is the difference between the time when the second message segment is collected and the time when the third message segment is collected; When the delay on the local area network side is greater than a preset delay threshold, it is determined that an abnormality exists in the path between the terminal and the local area network.

4. The method according to claim 2, characterized in that: The determining, based on the TCP stream data, whether there is an abnormality in the path between the terminal and the TCP stream data comprises: When the first message segment and the second message segment are retransmitted and the third message segment is not received, it is determined that an abnormality exists in the path between the terminal and the third message segment.

5. The method according to claim 2, characterized in that: The determining, based on the TCP stream data, whether there is an abnormality in the path between the terminal and the TCP stream data comprises: When the number of times the second message segment is received is greater than the number of times the first message segment is received, and the third message segment is not received, it is determined that an abnormality exists in the path between the terminal and the third message segment.

6. The method according to claim 2, characterized in that The determining, based on the TCP stream data, whether there is an abnormality in the path between the terminal and the TCP stream data comprises: At preset time intervals, based on the TCP stream data, it is determined whether there is an abnormality in the path between the terminal and the TCP stream data.

7. The method according to claim 3, characterized in that When there is an abnormality in the path between the terminal and the network, adjusting the Internet access configuration parameters includes: In the case where there is an abnormality in the path between the terminal, determining an actual power range in which the current signal transmission power is located; Based on a preset adjustment relationship, the current signal transmission power is increased; wherein the preset adjustment relationship is used to indicate the corresponding relationship between the actual power range and the step increase ratio.

8. The method according to claim 3, characterized in that When there is an abnormality in the path between the terminal and the network, adjusting the Internet access configuration parameters includes: When there is an abnormality in the path to the terminal, the angle and / or direction of the antenna is controlled and adjusted.

9. The method according to claim 3, characterized in that: When there is an abnormality in the path between the terminal and the network, adjusting the Internet access configuration parameters includes: In the case where there is an abnormality in the path between the terminal and the target channel, determining a target channel in the current working frequency band; the target channel is used to indicate a channel with the least interference in the current working frequency band; Switch the current working channel to the target channel.

10. The method according to claim 2, characterized in that The three-way handshake data includes one or more of the sequence number, confirmation number, synchronization flag, confirmation flag, time and number of times of each message segment.

11. The method according to claim 2, characterized in that The step of responding to the terminal going online comprises: The user management module generates device online reminder information and sends the device online reminder information to the kernel module; The kernel module determines that the terminal is online in response to the received device online reminder information.

12. An electronic device, characterized in that: The electronic device comprises: one or more processors; Memory; And a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the one or more processors, the electronic device executes the Internet access optimization method as described in any one of claims 1-11.

13. A computer storage medium, characterized in that: It includes computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the Internet access optimization method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Transmission control protocol (TCP) connection processing method and system and synchronization (SYN) agent equipment

    CN101771695A

  • Network diagnosis method and electronic equipment

    CN116708148A

  • Network diagnosis method and electronic equipment

    CN116708149A

  • Network diagnosis method and electronic equipment

    CN116708150A

  • Method and device for preventing network attack, and storage medium

    WO2016197498A1

Cited By

  • Data transmission method and device based on FTTR-B, medium and equipment

    CN119892723A