Network wake-up-based device wake-up method and system, device and medium
By obtaining and storing the MAC address when the device is powered on for the first time, and reading and using these addresses when the device is powered on again, the problem of the network wake-up function failure after the device is completely powered off, and the effective network wake-up of the device is achieved.
Patent Information
- Application Number
- CN202411455451.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-07
AI Technical Summary
In the prior art, after the device is completely powered off, the network wake-up function fails and the network wake-up packet cannot be received.
When the device powers on for the first time, it obtains the device's MAC address and stores it in the flash memory. When the device powers on again, it reads the MAC address stored in the flash memory to complete the network wake-up.
By leveraging the nonvolatile nature of flash memory, we ensure that the MAC address is not lost after the device is completely powered off, and the device's wake-up function is realized and the user experience is improved.
Smart Images

Figure CN119396475A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a device wake-up method, system, device, and medium based on network wake-up. Background Art
[0002] With the advancement of technology, the network wake-up function has become an indispensable function of electronic devices. The network wake-up technology (Wake-on-LAN, WoL) allows sending specific signals to electronic devices that are in a shutdown state (usually refers to sleep, standby or soft shutdown state rather than completely power off) through a local area network (LAN) based on MAC addresses and broadcast IP addresses to remotely wake up the electronic device. For example, send instructions to smart devices such as TVs and computers to wake up the corresponding electronic devices and put the electronic devices into operation.
[0003] In the related art, the circuit interface of Ethernet is composed of CPU, MAC (Media Access Control) controller and physical layer interface (PHY). Usually, the above three parts do not all have independent chips. The current mainstream solutions all use MAC integrated inside the CPU and PHY using independent chips. In this method, the MAC address needs to be configured through PHY in the BIOS (Basic Input Output System) stage. When the electronic device experiences a complete power outage, the PHY will lose the corresponding configuration. After the electronic device is powered on again, it will not be able to receive the network wake-up packet, which makes the network wake-up function invalid. Summary of the invention
[0004] In view of this, the present invention provides a device wake-up method, system, device, and medium based on network wake-up to solve the technical problem in the related art that the network wake-up function fails after the device is completely powered off.
[0005] In a first aspect, the present invention provides a device wake-up method based on network wake-up, the method comprising: in response to the first power-on of the device, obtaining the MAC address of the device, and storing the MAC address in a flash memory to form a first MAC address; in response to the device being powered on again, reading the first MAC address stored in the flash memory; and completing the network wake-up based on the read first MAC address.
[0006] In combination with the first aspect, in a possible implementation of the first aspect, in response to the first power-on of the device, obtaining a MAC address of the device, and storing the MAC address in a flash memory to form a first MAC address, including: in response to the first power-on of the device, receiving the MAC address of the device sent by the CPU through the communication serial port, and storing the MAC address in the flash memory to form the first MAC address.
[0007] In combination with the first aspect, in a possible implementation of the first aspect, network wake-up is completed based on the read first MAC address, including: sending the read first MAC address; receiving a wake-up signal corresponding to the first MAC address, and performing network wake-up on the device based on the wake-up signal.
[0008] In combination with the first aspect, in a possible implementation of the first aspect, in response to the device being powered on again, reading the first MAC address stored in the flash memory, also includes: in response to the device being powered on again, obtaining the second MAC address of the device, and reading the first MAC address stored in the flash memory; comparing the second MAC address with the first MAC address; in response to the second MAC address being different from the first MAC address, updating the first MAC address with the second MAC address, and using the updated first MAC address as the read first MAC address.
[0009] In a second aspect, the present invention provides a device wake-up system based on network wake-up, the system comprising: a single-chip microcomputer, a CPU and a PHY chip, wherein the single-chip microcomputer is connected to the CPU and the PHY chip through a communication serial port respectively; the single-chip microcomputer is used to execute the device wake-up method based on network wake-up of the above-mentioned first aspect or any corresponding embodiment thereof.
[0010] In combination with the second aspect, in a possible implementation of the second aspect, the single-chip microcomputer includes a flash memory for storage, and the single-chip microcomputer is also used to receive a MAC address sent by the CPU through the communication serial port in response to the first power-on of the device, and store the MAC address in the flash memory to form a first MAC address.
[0011] In combination with the second aspect, in a possible implementation of the second aspect, the PHY chip is used to obtain a network wake-up data packet sent by a local area network, and based on the enable signal and the wake-up data packet sent by the single-chip computer, generates and sends a wake-up signal corresponding to the enable signal to the single-chip computer; the single-chip computer is also used to send a first MAC address to the PHY chip through the communication serial port, and receive and use the wake-up signal corresponding to the first MAC address sent by the PHY chip to perform network wake-up on the device.
[0012] In combination with the second aspect, in a possible implementation of the second aspect, the single-chip microcomputer is also used to obtain a second MAC address of the device from the CPU in response to the device being powered on again, and read the first MAC address stored in the flash memory; compare the second MAC address with the first MAC address; and in response to the second MAC address being different from the first MAC address, update the first MAC address with the second MAC address.
[0013] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the device wake-up method based on network wake-up of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0014] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the device wake-up method based on network wake-up according to the first aspect or any corresponding embodiment thereof.
[0015] The technical solution of the present invention has the following advantages: The present invention provides a device wake-up method, system, device, and medium based on network wake-up. The method obtains the MAC address of the device when the device is powered on for the first time, and saves the MAC address in a flash memory, so that when the device is powered on again, the MAC address stored in the flash memory is read to complete network wake-up. In this process, the MAC address obtained when the device is powered on for the first time is used to utilize the non-volatility of the flash memory so that the obtained MAC address is not lost after the device is completely powered off, and after the device is powered on again, the MAC address stored in the flash memory is read to complete the configuration and acquisition of the device wake-up signal, thereby completing the network wake-up function of the device and further improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 is a flow chart of a device wake-up method based on network wake-up provided according to an embodiment of the present invention; Figure 2 is a structural block diagram of a device wake-up system based on network wake-up provided according to an embodiment of the present invention; Figure 3 is a structural block diagram of another device wake-up system based on network wake-up provided according to an embodiment of the present invention; Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0019] According to an embodiment of the present invention, an XX method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0020] This embodiment provides a device wake-up method based on network wake-up, such as Figure 1 As shown, the method comprises the following steps: S101. In response to the first power-on of a device, obtain a MAC address of the device, and store the MAC address in a flash memory to form a first MAC address.
[0021] Specifically, after the device is powered on for the first time, the BIOS reads the MAC address of the device from the Ethernet control register of the CPU or the EEPROM (Electrically Erasable Programmable read only memory) that specifically stores the MAC address, and sends it to the single-chip microcomputer through the communication serial port, so that the single-chip microcomputer obtains the MAC address of the device and stores the MAC address in the free FLASH (flash memory) inside the single-chip microcomputer to form the first MAC address. The first MAC address refers to the MAC address stored in the internal FLASH of the single-chip microcomputer 202 S102: In response to the device being powered on again, read the first MAC address stored in the flash memory.
[0022] Specifically, in response to the device being powered on again, reading the first MAC address stored in the flash memory means that when the device is powered on again after being completely powered off, the single chip microcomputer reads the MAC address stored in the FLASH.
[0023] S103: Complete network wake-up based on the read first MAC address.
[0024] Specifically, based on the first MAC address read, completing network wake-up means that the microcontroller sends the stored MAC address to the PHY chip, the PHY chip uses the MAC address to configure the enable signal, and receives the WOL wake-up packet sent by the local area network, thereby using the enable signal and the WOL wake-up packet to generate a wake-up signal, and send it to the microcontroller. After receiving the wake-up signal, the microcontroller executes the power-on process, thereby completing the network wake-up.
[0025] The present invention provides a device wake-up method, system, device, and medium based on network wake-up. The method obtains the MAC address of the device when the device is powered on for the first time, and saves the MAC address in a flash memory, so that when the device is powered on again, the MAC address stored in the flash memory is read to complete network wake-up. In this process, the MAC address obtained when the device is powered on for the first time is used to make use of the non-volatility of the flash memory so that the obtained MAC address is not lost after the device is completely powered off, and after the device is powered on again, the MAC address stored in the flash memory is read to complete the configuration and acquisition of the device wake-up signal, thereby completing the network wake-up function of the device and further improving the user experience.
[0026] In an optional implementation, in response to the first power-on of the device, obtaining a first MAC address of the device and storing the first MAC address in a flash memory includes: In response to the first power-on of the device, a first MAC address of the device sent by the CPU through the communication serial port is received, and the first MAC address is stored in the flash memory.
[0027] Specifically, in the mainstream solution, that is, the MAC is integrated inside the CPU and the PHY uses an independent chip, the MAC address will be burned into the CPU's internal efuse or the CPU's external EEPROM, and configured to the MAC controller during the boot process. BIOS is a boot program that is solidified in the SPI-FLASH connected to the CPU and is actively run by the CPU when the computer is turned on. Therefore, it can directly obtain the MAC address of the computer device. BIOS obtains the MAC address information by reading the CPU's MAC controller register or the EEPROM that stores the MAC address, and sends the MAC address to the microcontroller through the serial port protocol.
[0028] Specifically, in response to the first power-on of the device, receiving the first MAC address of the device sent by the CPU through the communication serial port, and storing the first MAC address in the flash memory means that after the microcontroller receives the MAC address sent by the BIOS, the MAC address is stored in the internal free FLASH. The FLASH inside the microcontroller is a storage medium that is not lost when power is off, so it only needs to be started once after changing the device MAC address, and the MAC address information can be permanently stored in the FLASH inside the microcontroller, thereby providing a data basis for subsequent execution of WOL.
[0029] In an optional implementation, completing network wake-up based on the read first MAC address includes: Send the read first MAC address; receive a wake-up signal corresponding to the first MAC address, and perform network wake-up on the device based on the wake-up signal.
[0030] Specifically, sending the first MAC address read means that after the device is powered on again, the microcontroller automatically starts running. While the microcontroller runs the initialization program, it uses the simulated SMI (Serial Management Interface) interface to establish a connection with the PHY chip, thereby writing the MAC address into a specific register of the PHY chip and enabling the WOL function of the PHY chip.
[0031] Specifically, the wake-up signal corresponding to the first MAC address refers to a wake-up signal generated by the PHY chip after receiving a network wake-up packet sent by the local area network in combination with an enable signal. The wake-up signal is used to initiate a wake-up signal to the microcontroller.
[0032] Specifically, network wake-up of a device based on a wake-up signal means that the microcontroller executes a power-on process after receiving the wake-up signal, thereby completing the network wake-up function.
[0033] In an optional implementation, in response to the device being powered on again, reading the first MAC address stored in the flash memory further includes: In response to the device being powered on again, a second MAC address of the device is obtained, and the first MAC address stored in the flash memory is read; the second MAC address is compared with the first MAC address; in response to the second MAC address being different from the first MAC address, the first MAC address is updated with the second MAC address, and the updated first MAC address is used as the read first MAC address.
[0034] Specifically, in response to the device being powered on again, obtaining the second MAC address of the device means that for the single-chip microcomputer, the MAC address sent by the BIOS will be received every time the device is powered on. The second MAC address refers to the MAC address of the device sent by the BIOS to the single-chip microcomputer 202. Specifically, comparing the second MAC address with the first MAC address means that after receiving the second MAC address sent by the device, the microcontroller reads the first MAC address stored in the internal FLASH and compares whether the second MAC address is the same as the stored first MAC address.
[0035] Specifically, in response to the second MAC address being different from the first MAC address, updating the first MAC address with the second MAC address means that when the second MAC address is different from the first MAC address, it means that the device has been written with a new MAC address, and the old MAC address needs to be overwritten with the new MAC address, that is, the MAC address at the corresponding storage location is replaced with the second MAC address and used as the new first MAC address. It should be understood that if the second MAC address is the same as the first MAC address, it means that the MAC address of the device has not changed, and it will not be updated, and the original MAC address will be retained without additional processing.
[0036] This embodiment provides a device wake-up system based on network wake-up, such as Figure 2 , Figure 3 The system shown includes: a single-chip microcomputer 202, a CPU 201 and a PHY chip 203, wherein the single-chip microcomputer 202 is connected to the CPU 201 and the PHY chip 203 through a communication serial port respectively; the single-chip microcomputer 201 is used to execute the method shown in the above embodiment. The specific process can be found in the relevant description of steps S101 to S103 in the above embodiment, which will not be repeated here.
[0037] In an optional embodiment, the single-chip microcomputer includes a flash memory for storage, and the single-chip microcomputer is also used to receive a first MAC address sent by the CPU through the communication serial port in response to the first power-on of the device, and store the first MAC address in the flash memory.
[0038] Specifically, Figure 2 As shown, BIOS obtains MAC address information by reading the MAC controller register of CPU201 or the EEPROM storing the MAC address, and sends the MAC address to the single-chip microcomputer 202 through the serial port protocol. After receiving the MAC address, the single-chip microcomputer 202 stores it in the internal free FLASH. The specific process can be referred to the relevant description in the above embodiment, which will not be repeated here.
[0039] In an optional embodiment, the PHY chip is used to obtain a network wake-up data packet sent by a local area network, and based on an enable signal sent by the single-chip microcomputer and the network wake-up data packet, generates and sends a wake-up signal corresponding to the enable signal to the single-chip microcomputer; the single-chip microcomputer is also used to send a first MAC address to the PHY chip through a communication serial port, receive and use the wake-up signal corresponding to the first MAC address sent by the PHY chip to perform network wake-up on the device.
[0040] Specifically, Figure 3 As shown, when the device is powered on again, the single-chip microcomputer 202 reads the first MAC address stored in the internal FLASH, and sends the MAC address to the PHY chip 203 through the simulated SMI interface, so that the MAC address is written into the specific register of the PHY chip. The specific register of the PHY chip enables the WOL function of the PHY chip after receiving the MAC address. After the PHY chip receives the network wake-up packet, a wake-up signal is generated to initiate a wake-up signal to the single-chip microcomputer. After receiving the wake-up signal, the single-chip microcomputer 202 executes the power-on process to complete the WOL function of the device. The specific process can be referred to the relevant description in the above embodiment, which will not be repeated here.
[0041] In an optional embodiment, the single-chip microcomputer is also used to obtain a second MAC address of the device from the CPU in response to the device being powered on again, and read the first MAC address stored in the flash memory; compare the second MAC address with the first MAC address; and in response to the second MAC address being different from the first MAC address, update the first MAC address with the second MAC address.
[0042] Specifically, Figure 2 As shown, each time the device is powered on, the single-chip microcomputer 202 will receive the MAC address information sent by the BIOS. At this time, the single-chip microcomputer should read the MAC address stored in the internal FLASH for comparison to determine whether the MAC address has changed. If the MAC address is different, it means that the device has been written with a new MAC address, and the old MAC address needs to be overwritten with the new MAC address, that is, the MAC address is updated; if the MAC address is the same, it means that the MAC address of the device has not changed, and no additional processing is required, that is, the MAC address is stored. It should be understood that when the device is powered on for the first time, when the single-chip microcomputer 202 receives the MAC address sent by the BIOS, the corresponding MAC address has not yet been stored in the FLSAH of the single-chip microcomputer. At this time, there is no corresponding MAC address for comparison. At this time, the MAC address sent by the BIOS is stored in the idle FLASH inside the single-chip microcomputer 202. The specific process can be referred to the relevant description in the above embodiment, which will not be repeated here.
[0043] The embodiment of the present invention also provides a computer device, see Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4As shown, the computer device includes: one or more processors 301, memory 302, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 301 is taken as an example.
[0044] The processor 301 may be a central processing unit, a network processor or a combination thereof. The processor 301 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0045] The memory 302 stores instructions executable by at least one processor 301, so that the at least one processor 301 executes the method shown in the above embodiment.
[0046] The memory 302 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 302 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 302 may optionally include a memory remotely arranged relative to the processor 301, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0047] The memory 302 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 302 may also include a combination of the above types of memory. The computer device also includes a communication interface 303, which is used for the computer device to communicate with other devices or communication networks.
[0048] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0049] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A device wake-up method based on network wake-up, characterized in that: The method comprises: In response to the device being powered on for the first time, obtaining a MAC address of the device, and storing the MAC address in a flash memory to form a first MAC address; In response to powering on the device again, reading the first MAC address stored in the flash memory; Based on the read first MAC address, network wake-up is completed.
2. The method according to claim 1, characterized in that: The method of acquiring a MAC address of the device in response to the first power-on of the device and storing the MAC address in a flash memory to form a first MAC address includes: In response to the first power-on of the device, a MAC address of the device sent by the CPU through the communication serial port is received, and the MAC address is stored in the flash memory to form a first MAC address.
3. The method according to claim 1, characterized in that The completing network wake-up based on the read first MAC address includes: Sending the read first MAC address; A wake-up signal corresponding to the first MAC address is received, and network wake-up of the device is performed based on the wake-up signal.
4. The method according to claim 1, characterized in that: In response to the device being powered on again, reading the first MAC address stored in the flash memory further includes: In response to the device being powered on again, obtaining a second MAC address of the device, and reading the first MAC address stored in the flash memory; comparing the second MAC address with the first MAC address; In response to the second MAC address being different from the first MAC address, the first MAC address is updated with the second MAC address, and the updated first MAC address is used as the read first MAC address.
5. A device wake-up system based on network wake-up, characterized in that: The system comprises: a single chip microcomputer, a CPU and a PHY chip, wherein the single chip microcomputer is connected to the CPU and the PHY chip respectively through a communication serial port; The single chip microcomputer is used to execute the method as claimed in any one of claims 1 to 4.
6. The system according to claim 5, characterized in that The single-chip microcomputer includes a flash memory for storage. The single-chip microcomputer is also used to receive a MAC address sent by the CPU through the communication serial port in response to the first power-on of the device, and store the MAC address in the flash memory to form a first MAC address.
7. The system according to claim 6, characterized in that The PHY chip is used to obtain a network wake-up data packet sent by the local area network, and based on the enable signal sent by the single-chip microcomputer and the wake-up data packet, generate and send a wake-up signal corresponding to the enable signal to the single-chip microcomputer; The single chip microcomputer is further used to send the first MAC address to the PHY chip through the communication serial port, and receive and use the wake-up signal corresponding to the first MAC address sent by the PHY chip to perform network wake-up on the device.
8. The system according to claim 6, characterized in that The single chip microcomputer is also used for obtaining a second MAC address of the device from the CPU in response to the device being powered on again, and reading the first MAC address stored in the flash memory; and comparing the second MAC address with the first MAC address; In response to the second MAC address being different from the first MAC address, the first MAC address is updated with the second MAC address.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the device wake-up method based on network wake-up according to any one of claims 1 to 4 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the device wake-up method based on network wake-up according to any one of claims 1 to 4.