1. Technical Field
The embodiments of the present disclosure relate to detection systems and methods, and more particularly to an electronic device and method for detecting a network connection between the electronic device and a network.
2. Description of Related Art
A network connection between an electronic device and a network is usually detected by a constant frequency predefined by a user of the electronic device. However, the constant frequency can not be adjusted automatically to meet different needs of different time periods. For example, an idle time period when there are no data communicated between the electronic device and the network, needs a less frequency to avoid power loss of the electronic device, and a busy time period when there are data communicated between the electronic device and the network needs a higher frequency to guarantee the data communication is fast and accurate.
The present disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
In general, the word “module,” as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language. In one embodiment, the program language may be Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, flash memory, and hard disk drives.
In one embodiment, the storage device 12 (non-transitory storage device) may be an internal storage system, such as a random access memory (RAM) for the temporary storage of information, and/or a read only memory (ROM) for the permanent storage of information. In some embodiments, the storage device 12 may be an external storage system, such as an external hard disk, a storage card, or a data storage medium.
The at least one processor 14 may include a processor unit, a microprocessor, an application-specific integrated circuit, and a field programmable gate array, for example.
In one embodiment, the network connection detection system 10 includes a plurality of function modules which include computerized codes or instructions that can be stored in the storage device 12 and executed by the at least one processor 14 to provide a method for detecting a network connection between the electronic device 1 and the network 2.
In one embodiment, the network connection detection system 10 may include a recording module 100, a processing module 102, a determination module 104, and a detection module 106. In the embodiment, the recording module 100 may include a first determination sub-module 1001, a recording sub-module 1002, and an update sub-module 1003. The processing module 102 may include an obtainment sub-module 1021, a querying sub-module 1022, a second determination sub-module 1023, a first processing sub-module 1024, a second processing sub-module 1025, and a computing sub-module 1026. The modules may comprise computerized codes in the form of one or more programs that are stored in the storage device 12 and executed by the at least one processor 14 to provide functions for implementing the modules. The functions of the function modules are illustrated in
In block S200, the recording module 100 records busy time periods and idle time periods of the network connection between the electronic device 1 and the network 2 in real time. In the embodiment, the busy time periods may be time periods when the electronic device 1 communicates with the network 2 (e.g., data being transferred from/to the electronic device 1 using the network 2), and the idle time periods may be time periods when the electronic device 1 does not communicate with the network 2 (e.g., data not being transferred from/to the electronic device 1 using the network 1). In one embodiment, the data being transferred has to be over a certain byte size before being determined as an idle time period.
In block 5202, the processing module 102 adjusts a detection frequency of a current time period for detecting the network connection between the electronic device 1 and the network 2 according to the busy time periods and the idle time periods, and computes a network detection time according to the adjusted detection frequency of the current time period. In the embodiment, the network detection time may be computed as 1:10, 2:20, 3:20, . . . , 12:00, for example.
In block 5204, the determination module 104 determines whether a current time is same as the network detection time.
In block 5206, when the current time is same as the network detection time, the detection module 106 detects the network connection between the electronic device 1 and the network 2, and builds a new network connection between the electronic device and the network if the network connection between the electronic device 1 and the network 2 is disconnected. Otherwise, when the current time does not arrive the network detection time, the detection module 106 keeps waiting for the network detection time. In the embodiment, the network connection may be detected using a ping detection command or a ACK detection command.
In block S2000, the first determination sub-module 1001 determines whether the network connection between the electronic device 1 and the network 2 is busy or idle.
In block S2001, if the network connection between the electronic device 1 and the network 2 is busy, the recording sub-module 1002 records the busy time periods of the network connection.
In block S2002, if the connection between the electronic device 1 and the network 2 is idle, the recording sub-module 1002 records the idle time periods of the network connection.
In block S2003, the update sub-module 1003 updates the busy time periods and the idle time periods into a datasheet stored in the storage device 12 in real time.
In block S2020, the obtainment sub-module 1021 obtains the datasheet from the storage device 12 in real time.
In block S2021, the querying sub-module 1022 queries the updated busy time period and the idle time period from the datasheet.
In block S2022, a second sub-determination module 1023 determines whether the current time period is within the busy time periods or is within the idle time periods.
In block S2023, the first processing sub-module 1024 adds the detection frequency of the current time period if the current time period is within the busy time periods.
In block S2024, the second processing sub-module 1025 reduces the detection frequency of the current time period if the current time period is within the idle time periods.
In block S2025, the computing sub-module 1026 computes all of the network detection time of the current time period according to the adjusted detection frequency of the current time period, and enters the step 204.
Although certain disclosed embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
101115898 | May 2012 | TW | national |