A network cable insertion detection method
By introducing pull-up resistors and Ethernet switch ICs between the network card chip and the processor, the problem of inaccurate judgment of network cables and routers in the prior art is solved, and a low-cost and easy-to-use network cable insertion detection method is realized, reducing equipment power consumption and improving battery life.
Patent Information
- Application Number
- CN202410555931.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-05-07
AI Technical Summary
When detecting the plug-in status of the network cable, it is impossible to accurately determine whether the network cable is in communication with the router, resulting in increased power consumption and increased cost.
By introducing a pull-up resistor between the network card chip and the processor, and connecting it with the processor using the Ethernet switch IC, it is determined whether an interrupt signal is generated when the network cable is inserted, so as to confirm whether the network cable is connected to the router.
A low-cost and easy-to-use network cable insertion detection method is realized, avoiding the increase in the cost of customized network ports and the loss of power consumption when the network cable is not connected but the device is turned on, reducing the power consumption of the equipment and improving battery life.
Smart Images

Figure CN118282898B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of communication equipment, and in particular to a network cable insertion detection method. Background Art
[0002] With the development of Internet communication technology, network communication technology has been widely used in products such as handheld mobile terminals (PDAs) and embedded industrial control boards. These devices are usually small in size and battery-powered, and have strict requirements on standby current and power consumption. Since the power consumption of the Ethernet network card is greatly different when it is turned on or not, it is necessary to control the opening and closing of the Ethernet network card according to whether a network cable is inserted into the network port to reduce power consumption. The commonly used method is to add additional pins or other switch devices to the network port through a customized RJ45 network port socket. When the network cable is inserted, the contact state of the switch device is changed to determine whether the network cable is inserted into the network port.
[0003] The invention patent "A method, device and terminal for detecting network port insertion" with publication number CN106294057A discloses a method for detecting network port insertion: two pins PinA and PinB are added to the general network port, and two springs are added to the inner side wall of the network port. The springs are defined as spring A and spring B, and spring A and spring B are connected to PinA and PinB respectively. When the network cable is inserted into the network port, spring A and spring B will be squeezed to contact. When the network cable is pulled out, spring A will recover, and spring A and spring B will be disconnected. In this way, the on-off state of PinA and PinB will change before and after the network cable is inserted, so as to determine whether the network cable is inserted into the network port. This method of automatically detecting the connection status of the Ethernet network interface requires a new mold because the designed network port is different from the common network ports on the market, which incurs mold opening fees and increases product costs. In addition, the network port can only determine whether the network cable is physically inserted but cannot confirm whether the network cable is connected to the router. If the network cable is only inserted into the device but not connected to the router, the device will think that the network cable is connected and turn on chips such as the network card, resulting in increased power consumption. Summary of the invention
[0004] In order to solve the defects in the prior art, the present invention provides a network cable insertion detection method.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0006] The present invention discloses a network cable insertion detection method, comprising a network card chip and a processor, wherein the processor is connected to the network card chip and the network cable, a pull-up resistor is connected along the way between the network cable and the processor, and one end of the pull-up resistor is connected to a power supply;
[0007] When the network cable connected to the router is inserted, the level on the path between the Ethernet switch and the processor will be pulled low, thereby generating an interrupt signal. The processor confirms the insertion of the network cable through the interrupt signal, switches the Ethernet switch path to the network transformer, turns on the network card at the same time, and the device is connected to the router through the network cable; when the network cable not connected to the router is inserted, the level on the path between the Ethernet switch and the processor is always in a high state, the above-mentioned interrupt signal will not be generated on the path, and the processor confirms that the network cable not connected to the router is inserted.
[0008] As a preferred technical solution of the present invention, it also includes an Ethernet switch IC, and the processor is connected to the Ethernet switch IC through a control line.
[0009] As a preferred technical solution of the present invention, the detection device is a handheld device.
[0010] A network cable insertion detection system comprises a network card chip and a processor. The processor is connected to the network card chip and the network cable. A pull-up resistor is connected along the way between the network cable and the processor. One end of the pull-up resistor is connected to a power supply. The processor determines whether an interrupt signal is generated between an Ethernet switch and the processor to determine whether a network cable is inserted.
[0011] As a preferred technical solution of the present invention, the detection system is integrated on a handheld device for use.
[0012] A device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements a network cable insertion detection method as described above when executing the computer program.
[0013] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, a network cable insertion detection method as described in any one of claims 1 to 4 is implemented.
[0014] The beneficial effects of the present invention are:
[0015] The present invention proposes an easy-to-use, low-cost device for detecting network cable insertion, which aims to avoid the cost increase caused by customizing the network port, and at the same time avoid the power consumption loss caused by the network cable being inserted into the network port socket but not connected to a router and other devices, thereby reducing the power consumption of the device and improving the battery life of the device. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0017] Figure 1It is a schematic diagram of the overall structure of the present invention.
[0018] Figure 2 This is the processor pin diagram. DETAILED DESCRIPTION
[0019] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0020] Example: Figure 1 As shown, it includes a network card chip and a processor. The processor is connected to the network card chip and a network cable. A pull-up resistor is connected along the way between the network cable and the processor. One end of the pull-up resistor is connected to a power supply. It also includes an Ethernet switch IC. The processor is connected to the Ethernet switch IC through a control line. The model used by the processor is: UMS9620.
[0021] There is a pull-up resistor on the path connecting the Ethernet switch chip and the processor, and the pull-up resistor is connected to the power supply, so that the path connecting the Ethernet switch and the processor is in a high level state when the network cable is not inserted; the network port establishes a connection with the network card chip through the network transformer; the Ethernet switch chip switches the path connected to the network cable or the processor; the network card chip realizes data transmission and communication between the router and the processor; the processor determines whether the network cable is inserted by confirming the level state of the path connected to the Ethernet switch chip.
[0022] The present invention uses a processor to confirm the insertion state of a network cable, and controls the switching of an Ethernet switch, and simultaneously turns on a network card chip to achieve Ethernet connection. A pull-up resistor is provided on the path connecting the Ethernet switch chip and the processor, and the pull-up resistor is connected to a power supply. When the network cable is not connected, the level of the path is always in a pulled-up state, and the processor confirms that no network cable is inserted; when the network cable connected to the router is inserted, the level on the path between the Ethernet switch and the processor will be pulled down, thereby generating an interrupt signal, and the processor confirms the insertion of the network cable through the interrupt signal, switches the Ethernet switch path to the network transformer, and turns on the network card at the same time, so that the device is connected to the router through the network cable; when the network cable not connected to the router is inserted, the level on the path between the Ethernet switch and the processor is always in a pulled-up state, and the above-mentioned interrupt signal will not be generated on the path, and the processor confirms that no network cable connected to the router is inserted.
[0023] In one embodiment of the present invention, a computer device is provided, the computer device includes a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used to implement the operation of a network cable insertion detection method.
[0024] In one embodiment of the present invention, a network cable insertion detection method can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data.
[0025] The computer storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0026] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0027] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products of the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0028] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0029] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0030] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A network cable insertion detection method, characterized in that: It includes a network card chip and a processor. The processor is connected to the network card chip and a network cable. A pull-up resistor is connected along the way between the network cable and the processor, and one end of the pull-up resistor is connected to a power supply. It also includes an Ethernet switch, a network port, and a network transformer connected to the network card chip. The network card chip, the processor, the Ethernet switch, and the network port are installed in the handheld device. The handheld device is connected to the router / optical modem via a network cable through the network port. Part of the line of the network port is connected to the Ethernet switch, and another part of the line of the network port is connected to the network transformer. The Ethernet switch switches on two paths, the first path is connected to the pull-up resistor and the processor, and the other path is connected to the network transformer. The processor is also provided with a control line connected to the Ethernet switch; When the network cable connected to the router is inserted, the level on the path between the Ethernet switch and the processor will be pulled low, thereby generating an interrupt signal. The processor confirms the insertion of the network cable through the interrupt signal, switches the Ethernet switch path to the network transformer, turns on the network card at the same time, and the handheld device is connected to the router through the network cable; when the network cable not connected to the router is inserted, the level on the path between the Ethernet switch and the processor is always in a high state, the above-mentioned interrupt signal will not be generated on the path, and the processor confirms that the network cable not connected to the router is inserted.
2. A network cable insertion detection method according to claim 1, characterized in that: The processor model is: UMS9620.
Citation Information
Patent Citations
Method, device and terminal for detecting network port insertion
CN106294057A
Network cable plugging state detection structure
CN219201887U