Disclosure of Invention
The embodiment of the invention provides a network reconnection method and a network reconnection device, which are used for improving the network reconnection speed.
A first aspect of an embodiment of the present invention provides a network reconnection method, where the method includes:
when the system is awakened from the STR dormant state, monitoring a notification message of the system;
and if the first notification message for rewriting the configuration file in the system is monitored, executing network back connection operation.
Optionally, when the system wakes up from the STR sleep state, the monitoring a notification message of the system includes:
when a system is awakened from an STR dormant state, judging the type of the STR dormant state;
and if the system is awakened from the first STR sleep state, monitoring a notification message about the configuration file in the system, wherein in the first STR sleep state, the USB equipment used for mounting the network is in the mounting state.
Optionally, the method further includes:
and if the system is awakened from the second STR sleep state, monitoring a notification message about the configuration file and the USB equipment in the system, wherein in the second STR sleep state, the USB equipment used for mounting the network is in an unloading state.
Optionally, if the first notification message indicating that the configuration file in the system is rewritten is monitored, the executing the network reconnection operation further includes:
and if a first notification message for rewriting the configuration file in the system and a second notification message for successfully loading the USB equipment for mounting the network in the system are monitored, executing network back connection operation.
Optionally, the system comprises a linux system.
A second aspect of the embodiments of the present invention provides a network reconnection apparatus, including:
the monitoring module is used for monitoring the notification message of the system when the system is awakened from the STR dormant state;
and the first execution module is used for executing network back connection operation when the monitoring module monitors that the first notification message for rewriting the configuration file in the system.
Optionally, the monitoring module includes:
the judging submodule is used for judging the type of the STR dormant state when the system is awakened from the STR dormant state;
the first monitoring submodule is used for monitoring a notification message about a configuration file in the system when the system is judged to be awakened from a first STR sleep state, wherein in the first STR sleep state, the system is used for mounting a USB device of a network in a mounting state.
Optionally, the monitoring module further includes:
and a second monitoring submodule, configured to monitor a notification message about a configuration file and a USB device in the system when the determining submodule determines that the system is awakened from a second STR sleep state, where in the second STR sleep state, the USB device used for mounting a network in the system is in an uninstalled state.
Optionally, the first execution module includes:
and the first execution submodule is used for executing network back connection operation when monitoring a first notification message for rewriting the configuration file in the system and a second notification message for successfully loading the USB equipment for mounting the network in the system.
Optionally, the system comprises a linux system.
Based on the above aspects, the embodiment of the invention has the following beneficial effects:
according to the embodiment of the invention, when the system is awakened from the STR dormant state, the notification message of the system is monitored, and when the first notification message of the rewriting of the configuration file in the system is monitored, the network back connection operation is executed. When the system wakes up from the STR dormant state, the configuration file of the system is changed, and the first notification message is sent out earlier than the notification message which is sent out by the middleware and used for triggering network loop connection, so that the network loop connection speed of the system can be improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "comprises" and "comprising," and any variations thereof, in the description and claims of this invention, are intended to cover non-exclusive inclusions, e.g., a process or an apparatus that comprises a list of steps is not necessarily limited to those structures or steps expressly listed but may include other steps or structures not expressly listed or inherent to such process or apparatus.
Embodiments of the present invention provide a network backhaul method, which may be performed by a network backhaul apparatus disposed in a terminal device using a Kilby system. Fig. 1 is a flowchart of a network backhaul method provided in an embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
step 101, when the system wakes up from the STR sleep state, monitoring a notification message of the system.
And 102, if monitoring a first notification message for rewriting the configuration file in the system, executing network back connection operation.
The system related to the embodiment includes a linux system, but is not limited to the linux system.
Taking the linux system as an example, in this example, the linux system includes two types of STR sleep states, which are a first STR sleep state and a second STR sleep state, respectively, in the first STR sleep state, the system is in a standby state and starts a network wakeup function (WOW), a USB device used for mounting a network in the system is in a mounted state, and in the second STR sleep state, the system is in a standby state, and the USB device used for mounting the network in the system is in an uninstalled state. When the system enters into the STR dormant state, the system sends a standby message, and the standby state of the system is set to be the first STR dormant state or the second STR dormant state through the standby message.
The notification messages that need to be monitored in the present embodiment include notification messages about configuration files and notification messages about USB devices in the system. In one possible implementation, the network backhaul apparatus may perform a network backhaul operation according to an existing network backhaul procedure upon monitoring a first notification message for notifying that a configuration file in the system is overwritten. Specifically, when the system wakes up from the STR sleep state, the configuration file in the etc directory in the system is overwritten, and a first notification message is sent. At this time, based on an inotify mechanism, monitoring and obtaining a first notification message, and performing network loop connection by calling a function for realizing network loop connection in the system after obtaining the first notification message. In another possible implementation manner, the network reconnection device may perform the network reconnection operation when the first notification message is monitored and it is determined that the USB device for mounting the network in the system has been successfully driven or is in the mounting state. For example, when monitoring the first notification message, the network reconnection device may detect whether the USB device used for mounting the network in the system has been successfully driven or is in the mounted state by sending heartbeat information, and if so, further perform the network reconnection operation, and if not, perform the network reconnection operation after the USB device is successfully driven. This approach is applicable to any one of the possible scenarios.
In this embodiment, when the system wakes up from the STR hibernation state, the notification message of the system is monitored, and when the first notification message that the configuration file in the system is rewritten is monitored, the network loopback operation is executed. When the system wakes up from the STR dormant state, the configuration file of the system is changed, and the first notification message is sent out earlier than the notification message which is sent out by the middleware and used for triggering network loop connection, so that the network loop connection speed of the system can be improved.
Fig. 2 is a flowchart of a network connection method according to an embodiment of the present invention, as shown in fig. 2, based on the embodiment of fig. 1, the embodiment includes the following steps:
step 201, when the system wakes up from the STR sleeping state, determining the type of the STR sleeping state.
Step 202, if it is determined that the system is awakened from the first STR sleep state, monitoring a notification message about the configuration file in the system, and executing a network connection operation when monitoring the first notification message about the rewriting of the configuration file in the system.
Step 203, if it is determined that the system is awakened from the second STR sleep state, monitoring notification messages about configuration files and USB devices in the system, and executing a network loopback operation when monitoring a first notification message about rewriting of the configuration files in the system and a second notification message about successful loading of the USB devices for mounting the network in the system.
Still taking linux system as an example, when the system enters STR dormant state, the system sends out a standby message, and sets the standby state to be the first STR dormant state or the second STR dormant state.
When the system is awakened, whether the system is awakened from the first STR sleep state or the second STR sleep state is judged. When the system is awakened from the second STR sleep state, the USB device with the network hung in the system is in an uninstalled state, and when the system is awakened from the second STR sleep state, the configuration file in the etc directory in the system is rewritten and a first notification message is sent out. When the system is awakened from the first STR sleep state, since the USB device with the network mounted in the system is in the mounted state, the function may be directly called to execute the network loopback operation when the first notification message is monitored.
In this embodiment, when the system wakes up from the STR hibernation state, the notification message of the system is monitored, and when the first notification message that the configuration file in the system is rewritten is monitored, the network loopback operation is executed. When the system wakes up from the STR dormant state, the configuration file of the system is changed, and the first notification message is sent out earlier than the notification message which is sent out by the middleware and used for triggering network loop connection, so that the network loop connection speed of the system can be improved.
Fig. 3 is a schematic structural diagram of a network backhaul apparatus according to an embodiment of the present invention, and as shown in fig. 3, the network backhaul apparatus 10 includes:
the monitoring module 11 is configured to monitor a notification message of the system when the system wakes up from the STR sleep state;
a first executing module 12, configured to execute a network loopback operation when the monitoring module monitors a first notification message for rewriting a configuration file in the system.
Optionally, the system comprises a linux system.
The network backhaul apparatus provided in the embodiment of the present invention can be used to execute the method in the embodiment of fig. 1, and the execution manner and the beneficial effects are similar, and are not described herein again.
Fig. 4 is a schematic structural diagram of another network backhaul apparatus according to an embodiment of the present invention, and as shown in fig. 4, on the basis of the embodiment of fig. 3, in the network backhaul apparatus 10, the monitoring module 11 includes:
the judging submodule 111 is configured to judge a type of the STR dormant state when the system wakes up from the STR dormant state;
a first monitoring sub-module 112, configured to monitor a notification message about a configuration file in the system when it is determined that the system is awakened from the first STR sleep state, where in the first STR sleep state, the USB device of the system for mounting the network is in the mount state.
Optionally, the monitoring module 11 further includes:
a second monitoring submodule 113, configured to monitor a notification message about a configuration file and a USB device in the system when the determining submodule determines that the system is woken up from a second STR sleep state, where in the second STR sleep state, a USB device used for mounting a network in the system is in an uninstalled state.
Optionally, the first execution module 12 includes:
the first execution submodule 121 is configured to execute a network loopback operation when monitoring a first notification message for rewriting a configuration file in the system and a second notification message for successfully loading a USB device for mounting a network in the system.
In this embodiment, when the system wakes up from the STR hibernation state, the notification message of the system is monitored, and when the first notification message that the configuration file in the system is rewritten is monitored, the network loopback operation is executed. When the system wakes up from the STR dormant state, the configuration file of the system is changed, and the first notification message is sent out earlier than the notification message which is sent out by the middleware and used for triggering network loop connection, so that the network loop connection speed of the system can be improved.
An embodiment of the present invention further provides a terminal device, including: a processor;
a memory for storing the processor-executable instructions;
when the processor executes the executable instructions, the following technical scheme can be realized:
when the system is awakened from the STR dormant state, monitoring a notification message of the system;
and if the first notification message for rewriting the configuration file in the system is monitored, executing network back connection operation.
Specifically, fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present invention, and as shown in fig. 5, the terminal device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the terminal device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the terminal device 800. Examples of such data include instructions for any application or method operating on terminal device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of terminal device 800. Power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for terminal device 800.
The multimedia component 808 comprises a screen providing an output interface between the terminal device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive an external audio signal when the terminal device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
Sensor component 814 includes one or more sensors for providing various aspects of state assessment for terminal device 800. For example, sensor assembly 814 may detect an open/closed status of terminal device 800, the relative positioning of components, such as a display and keypad of terminal device 800, sensor assembly 814 may also detect a change in the position of terminal device 800 or a component of terminal device 800, the presence or absence of user contact with terminal device 800, orientation or acceleration/deceleration of terminal device 800, and a change in the temperature of terminal device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. Sensor assembly 814 may also include a camera assembly, which may employ, for example, a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
Communication component 816 is configured to facilitate communications between terminal device 800 and other devices in a wired or wireless manner. The terminal device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the terminal device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
An embodiment of the present invention further provides a computer-readable storage medium, which includes instructions, and when the instructions are run on the computer, the computer can implement the following technical solutions:
when the system is awakened from the STR dormant state, monitoring a notification message of the system;
and if the first notification message for rewriting the configuration file in the system is monitored, executing network back connection operation.
In this embodiment, when the system wakes up from the STR hibernation state, the notification message of the system is monitored, and when the first notification message that the configuration file in the system is rewritten is monitored, the network loopback operation is executed. When the system wakes up from the STR dormant state, the configuration file of the system is changed, and the first notification message is sent out earlier than the notification message which is sent out by the middleware and used for triggering network loop connection, so that the network loop connection speed of the system can be improved.
Finally, it should be noted that, as one of ordinary skill in the art will appreciate, all or part of the processes of the methods of the embodiments described above may be implemented by hardware related to instructions of a computer program, where the computer program may be stored in a computer-readable storage medium, and when executed, the computer program may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
Each functional unit in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer readable storage medium. The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.