CN116709476A - Method and device for waking up and keeping alive device, electronic device and storage medium - Google Patents

Method and device for waking up and keeping alive device, electronic device and storage medium Download PDF

Info

Publication number
CN116709476A
CN116709476A CN202211176673.3A CN202211176673A CN116709476A CN 116709476 A CN116709476 A CN 116709476A CN 202211176673 A CN202211176673 A CN 202211176673A CN 116709476 A CN116709476 A CN 116709476A
Authority
CN
China
Prior art keywords
unicast
target
equipment
dormant state
wake
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211176673.3A
Other languages
Chinese (zh)
Inventor
李海波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211176673.3A priority Critical patent/CN116709476A/en
Publication of CN116709476A publication Critical patent/CN116709476A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0229Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal where the received signal is a wanted signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0261Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
    • H04W52/0274Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof
    • H04W52/028Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof switching on or off only a part of the equipment circuit blocks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application relates to the technical field of near field communication, and discloses a method for waking up equipment, a method for keeping alive equipment, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: responding to a wake-up instruction of target equipment in a dormant state, and sending a wake-up unicast message to the target equipment; if a unicast response message returned by the target equipment is received, the target equipment is determined to be awakened successfully, so that when the terminal equipment is in a dormant state, the PC end can awaken the terminal equipment through the awakening unicast message, the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved.

Description

Method and device for waking up and keeping alive device, electronic device and storage medium
Technical Field
The present application relates to the field of near field communication technologies, and in particular, to a method for waking up a device, a method, an apparatus for keeping a device alive, an electronic device, and a storage medium.
Background
At present, the PC end and android equipment (such as a mobile phone, a PAD, an intelligent screen and the like) can interact through a broadcast packet in a wifi local area network to perform self-discovery ad hoc network so as to realize corresponding service.
However, when the android device is in the dormant state, the PC end and the android device cannot interact to perform self-discovery ad hoc network, so that corresponding service cannot be realized.
Disclosure of Invention
The application provides a method for waking up equipment, a method for keeping the equipment alive, a device, electronic equipment and a storage medium, and aims to realize self-discovery ad hoc network by interaction between a PC (personal computer) end and the terminal equipment when the terminal equipment is in a dormant state, and maintain an online state between the PC and the terminal equipment so as to realize corresponding service and improve user experience.
In a first aspect, the present application provides a method for waking up a device, where the method is applied to a PC side, and the method includes:
responding to a wake-up instruction of target equipment in a dormant state, and sending a wake-up unicast message to the target equipment;
and if the unicast response message returned by the target equipment is received, determining that the target equipment is awakened successfully.
According to the method for waking up the equipment, the wake-up unicast message is sent to the target equipment in the dormant state by responding to the wake-up instruction of the target equipment; if a unicast response message returned by the target equipment is received, the target equipment is determined to be awakened successfully, so that when the terminal equipment is in a dormant state, the PC end can awaken the terminal equipment through the awakening unicast message, the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved.
In one possible implementation, the method further includes:
and performing self-discovery ad hoc network with the target equipment.
In another possible implementation manner, the step of determining that the target device is awakened successfully if the unicast response message returned by the target device is received includes:
in another possible implementation manner, the step of sending a wake-up unicast message to the target device in the sleep state in response to a wake-up instruction to the target device further includes:
and if the unicast response message returned by the target equipment is received within the preset time, determining that the target equipment is awakened successfully.
In another possible implementation, the method further includes:
and displaying that the target equipment is on line in a nearby equipment list of the PC side.
In another possible implementation, the method further includes:
when the target device is detected to be switched from a non-dormant state to a dormant state, sending a confirmation unicast message to the target device;
and if the unicast response message returned by the target equipment is received, performing keep-alive online processing on the target equipment.
In another possible implementation manner, the step of sending an acknowledgement unicast message to the target device when the target device is detected to switch from the non-sleep state to the sleep state includes:
And when the target equipment is detected to be switched from the non-dormant state to the dormant state, sending a confirmation unicast message to the target equipment in the heartbeat online detection process of the target equipment.
In another possible implementation manner, the step of performing keep-alive online processing on the target device if the unicast response message returned by the target device is received includes:
and if the unicast response message returned by the target equipment is received within the preset time, determining that the target equipment has heartbeat, and carrying out keep-alive online processing on the target equipment.
In another possible implementation manner, the step of sending the acknowledgement unicast message to the target device when the target device is detected to switch from the non-sleep state to the sleep state further includes:
if the unicast response message returned by the target equipment is not received within the preset time, determining that the target equipment does not have heartbeat, and performing the time-out offline processing on the target equipment.
In another possible implementation manner, the step of sending a wake-up unicast message to the target device in the sleep state in response to a wake-up instruction to the target device further includes:
And setting a wake-up unicast type field and a confirm unicast type field in a self-discovery ad hoc protocol field of the target device, wherein the wake-up unicast type field is used for waking up the dormant target device, the confirm unicast type field is used for keeping the dormant target device alive, and the target device and the PC terminal are in the same local area network.
In a second aspect, the present application provides a method for a keep-alive device, where the method is applied to a PC side, and the method includes:
when detecting that the target equipment is switched from a non-dormant state to a dormant state, sending a confirmation unicast message to the target equipment;
and if the unicast response message returned by the target equipment is received, performing keep-alive online processing on the target equipment.
According to the method for keeping the active equipment, when the target equipment is detected to be switched from the non-dormant state to the dormant state, a confirmation unicast message is sent to the target equipment; and if the unicast response message returned by the target equipment is received, performing keep-alive online processing on the target equipment. Therefore, when the terminal equipment is switched from the non-dormant state to the dormant state, the PC end can keep the terminal equipment alive through confirming the unicast message, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved.
In one possible implementation, the step of sending an acknowledgment unicast message to the target device when the target device is detected to switch from the non-dormant state to the dormant state includes:
and when the target equipment is detected to be switched from the non-dormant state to the dormant state, sending a confirmation unicast message to the target equipment in the heartbeat online detection process of the target equipment.
In another possible implementation manner, the step of performing keep-alive online processing on the target device if the unicast response message returned by the target device is received includes:
and if the unicast response message returned by the target equipment is received within the preset time, determining that the target equipment has heartbeat, and carrying out keep-alive online processing on the target equipment.
In another possible implementation manner, the step of sending the acknowledgement unicast message to the target device when the target device is detected to switch from the non-sleep state to the sleep state further includes:
if the unicast response message returned by the target equipment is not received within the preset time, determining that the target equipment does not have heartbeat, and performing the time-out offline processing on the target equipment.
In a third aspect, the present application provides a method for waking up a device, the method being applied to a terminal device, the method comprising:
receiving a wake-up unicast message sent by a PC end in response to a wake-up instruction of the terminal equipment in a dormant state;
and returning a unicast response message to the PC side according to the awakening unicast message so as to ensure that the PC side determines that the terminal equipment is awakened successfully.
The method for waking up the equipment provided by the application is characterized in that a wake-up unicast message sent by a PC end in response to a wake-up instruction of the terminal equipment in a dormant state is received; the unicast response message is returned to the PC terminal according to the awakening unicast message, so that the PC terminal determines that the terminal equipment is awakened successfully, and therefore, when the terminal equipment is in a dormant state, the PC terminal can awaken the terminal equipment through the awakening unicast message, so that self-discovery ad hoc network can be interactively performed between the PC terminal and the terminal equipment, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved
In one possible implementation, the method further includes:
and performing self-discovery ad hoc network with the PC terminal.
In another possible implementation, the method further includes:
receiving a confirmation unicast message sent by the PC side when the terminal equipment is switched from a non-dormant state to a dormant state;
and returning a unicast response message to the PC side according to the unicast confirmation message so as to enable the PC side to conduct keep-alive on-line processing on the terminal equipment.
In a fourth aspect, the present application provides a method of a keep-alive device, the method being applied to a terminal device, the method comprising:
receiving a confirmation unicast message sent by the PC side when the terminal equipment is switched from a non-dormant state to a dormant state;
and returning a unicast response message to the PC side according to the unicast confirmation message so as to enable the PC side to conduct keep-alive on-line processing on the terminal equipment.
According to the method for keeping the equipment alive, the method for keeping the equipment alive provided by the application, the confirmation unicast message sent by the PC end is received when the terminal equipment is switched from the non-dormant state to the dormant state; and returning a unicast response message to the PC side according to the unicast confirmation message so as to enable the PC side to conduct keep-alive on-line processing on the terminal equipment. Therefore, when the terminal equipment is switched from the non-dormant state to the dormant state, the PC end can keep the terminal equipment alive through confirming the unicast message, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved.
In a fifth aspect, the present application provides an apparatus for waking up a device, comprising:
the wake-up unicast sending module is used for responding to a wake-up instruction of the target equipment in the dormant state and sending a wake-up unicast message to the target equipment;
and the receiving module is used for determining that the target equipment is awakened successfully if the unicast response message returned by the target equipment is received.
In a sixth aspect, the present application provides an apparatus for a keep-alive device, comprising:
the device comprises a confirmation unicast sending module, a confirmation unicast sending module and a confirmation unicast sending module, wherein the confirmation unicast sending module is used for sending a confirmation unicast message to target equipment when detecting that the target equipment is switched from a non-dormant state to a dormant state;
and the processing module is used for carrying out keep-alive online processing on the target equipment if the unicast response message returned by the target equipment is received.
In a seventh aspect, the present application provides an apparatus for waking up a device, comprising:
the wake-up unicast receiving module is used for receiving a wake-up unicast message sent by the PC end in response to a wake-up instruction of the terminal equipment in a dormant state;
and the response module is used for returning a unicast response message to the PC side according to the awakening unicast message so as to ensure that the PC side determines that the terminal equipment is awakened successfully.
In an eighth aspect, the present application provides an apparatus for a keep-alive device, comprising:
the confirmation unicast receiving module is used for receiving a confirmation unicast message sent by the PC side when the terminal equipment is switched from a non-dormant state to a dormant state;
and the response module is used for returning a unicast response message to the PC side according to the confirmation unicast message so as to enable the PC side to carry out keep-alive online processing on the terminal equipment.
In a ninth aspect, the present application provides an electronic device, including: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by the electronic device, cause the electronic device to perform a method of waking up a device or a method of preserving a device as in any of the possible implementations described above.
In a tenth aspect, the present application provides a computer readable storage medium having stored therein a computer program which, when executed by a processor, causes the processor to perform a method of waking up a device or a method of keeping a device as in any one of the possible implementations described above.
In an eleventh aspect, the present application provides a chip, the chip including a processor and a data interface, the processor reading instructions stored on a memory through the data interface, and executing a method for waking up a device or a method for keeping a device according to any one of the possible implementations.
As one possible implementation, the chip may further include a memory, where the memory stores instructions, and the processor is configured to execute the instructions stored on the memory, where the instructions, when executed, are configured to perform a method of waking up the device or a method of keeping the device alive as in any one of the possible implementations described above.
Drawings
FIG. 1a is a schematic scene diagram of a prior art PC and android device self-discovery ad hoc network;
FIG. 1b is a schematic scene diagram of a prior art PC and android device for heartbeat detection;
fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 3 is a block diagram of a software architecture of an electronic device according to an embodiment of the present application;
FIG. 4 is a schematic scene diagram of a method for waking up a device according to an embodiment of the present application;
FIG. 5 is a schematic scene diagram of a method of preserving a device provided by an embodiment of the application;
FIG. 6 is an interaction diagram of a method for waking up a device according to one embodiment of the present application;
FIG. 7 is a schematic scene diagram of an extended call interface provided by an embodiment of the present application;
FIG. 8 is an interaction diagram of a method of a keep-alive device provided in one embodiment of the application;
FIG. 9 is an interaction diagram of a method for waking up a device according to another embodiment of the present application;
FIG. 10 is an interaction diagram of a method of a keep-alive device according to another embodiment of the application;
FIG. 11 is a schematic diagram of a functional module of an apparatus for waking up a device according to the present application;
FIG. 12 is a schematic diagram of functional modules of an apparatus for a keep-alive device according to the present application;
FIG. 13 is a schematic diagram of a functional module of another device for waking up a device according to the present application;
fig. 14 is a schematic functional block diagram of another apparatus for a keep-alive device according to the present application.
Detailed Description
The terms first, second, third and the like in the description and in the claims and in the drawings are used for distinguishing between different objects and not for limiting the specified order.
In embodiments of the application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
For clarity and conciseness in the following description of the embodiments, a brief description of an implementation scheme of a method for waking up a device is first given:
at present, the PC end and android equipment (such as a mobile phone, a PAD, an intelligent screen and the like) can interact through a broadcast packet in a wifi local area network to perform self-discovery ad hoc network so as to realize corresponding service.
In one scenario of the prior art, as shown in fig. 1a, fig. 1a is a schematic scenario diagram of a prior art self-discovery ad hoc network of PCs and android devices.
When the android device sleeps, due to short-distance power consumption control, wifi has a periodic sleep condition when no data is transmitted, and when wifi sleeps, the dormant android device cannot receive self-discovery ad hoc network broadcast packets of other terminals in the local area network. In this scenario, the PC cannot interact with the near-field android device through a broadcast packet in the local area network, so as to perform self-discovery ad hoc network.
As shown in fig. 1a, the PC, non-hibernating device a and hibernating device B are located on the same local area network. After the discovery connection module (MagicLink) of the PC sends out a local area network broadcast (shape broadcast), the discovery connection module of the non-sleep device a can normally receive the broadcast and respond, and after receiving the response, the discovery connection module of the PC notifies the device management module of the PC to go to the non-sleep device a. And the sleep device B cannot receive the broadcast and cannot respond, and the PC cannot discover the sleep device B. In this scenario, if the PC is to perform super connection, super notification, super incoming call, super mouse and other super services with the device B in the dormant state, the dormant device B cannot receive the broadcast of the PC, cannot respond, and cannot find the dormant device B, so that the user experience is affected. Therefore, the PC needs to wake up the sleep device from the sleep state before performing the corresponding super terminal service.
In another scenario of the prior art, as shown in fig. 1b, fig. 1b is a schematic diagram of a heartbeat detection scenario performed by a PC and an android device in the prior art.
In the process of carrying out heartbeat detection on the online equipment (detecting whether the opposite terminal equipment has heartbeat packets in a specified time) by the discovery connection module (MagicLink) of the PC, if a certain equipment is changed from a non-dormant state to a dormant state, the equipment cannot receive wifi broadcast packets of the PC in the local area network and cannot respond to the PC. The PC may drop the dormant device if it does not receive a heartbeat response from the device for a period of time (e.g., 30 s).
As shown in fig. 1b, after a PC is connected to a non-hibernating device a, the PC periodically starts heartbeat online detection, and after a discovery connection module (MagicLink) of the PC sends out a local area network broadcast (map broadcast), it detects whether the device a is in a keep-alive state (i.e., keeps online state), and the non-hibernating device a can receive the local area network broadcast sent by the PC and respond in time, so that the PC can keep the non-hibernating device a online. If the non-dormant device A is in the dormant state, the dormant device A is disconnected when the PC detects the device A online, and the dormant device cannot respond to the PC because the dormant device cannot receive the broadcast of the PC local area network, so that the heartbeat detection of the PC is overtime.
In this scenario, if a super service such as super connection, super notification, super incoming call, super mouse is to be performed between the PC and the device a in the sleep state, the sleep device a cannot respond because the PC cannot receive the broadcast of the PC, so that the heartbeat detection of the PC is overtime, and the device a cannot be put into operation, thereby affecting the user experience. Therefore, the PC needs to keep-alive sleep equipment to do corresponding super terminal service.
Based on the problems in the technical scheme, the application provides a method for waking up equipment, a method, a device for keeping the equipment alive, electronic equipment and a storage medium, when terminal equipment is in a dormant state, the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, and the online state between the PC and the terminal equipment is kept, so that corresponding service is realized, and user experience is improved.
The method for waking up the device and the method for keeping the device alive can be applied to electronic devices such as mobile phones, tablet computers, desktop computers, laptops, notebook computers, ultra-mobile personal computer (UMPC), handheld computers, netbooks, personal digital assistants (Personal Digital Assistant, PDA), wearable electronic devices, intelligent watches and the like which are in the same local area network with the PC. The structure of the electronic device, to which the method for waking up the device and the method for keeping the device alive are applied, may be as shown in fig. 2.
As shown in fig. 2, fig. 2 is a diagram illustrating an example of the composition of an electronic device according to the present application, the electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (universal serial bus, USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a camera 293, a display 294, and the like.
The sensor module 280 may include, among other things, a pressure sensor 280A, a gyroscope sensor 280B, a barometric sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, and the like.
It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 200. In other embodiments, the electronic device 200 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 210 may include one or more processing units such as, for example: the processor 210 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 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. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 200, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may hold instructions or data that the processor 210 has just used or recycled. If the processor 210 needs to reuse the instruction or data, it may be called directly from the memory. Repeated accesses are avoided and the latency of the processor 210 is reduced, thereby improving the efficiency of the system.
In some embodiments, processor 210 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the connection relationship between the modules illustrated in this embodiment is only illustrative, and does not limit the structure of the electronic device 200. In other embodiments of the present application, the electronic device 200 may also employ different interfacing manners, or a combination of interfacing manners, as in the above embodiments.
The charge management module 240 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 240 may receive a charging input of a wired charger through the USB interface 230. In some wireless charging embodiments, the charge management module 240 may receive wireless charging input through a wireless charging coil of the electronic device 200. The charging management module 240 may also power the electronic device 200 through the power management module 241 while charging the battery 242.
The power management module 241 is used for connecting the battery 242, and the charge management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and/or the charge management module 240 and provides power to the processor 210, the internal memory 221, the display 294, the camera 293, the wireless communication module 260, and the like. The power management module 241 may also be configured to monitor battery capacity, battery cycle times, battery health (leakage, impedance), and other parameters. In other embodiments, the power management module 241 may also be disposed in the processor 210. In other embodiments, the power management module 241 and the charge management module 240 may be disposed in the same device.
The wireless communication function of the electronic device 200 can be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 200 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 250 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied on the electronic device 200. The mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 250 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 250 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 250 may be disposed in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 may be provided in the same device as at least some of the modules of the processor 210.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 270A, receiver 270B, etc.), or displays images or video through display screen 294. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 250 or other functional module, independent of the processor 210.
The wireless communication module 260 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied on the electronic device 200. The wireless communication module 260 may be one or more devices that integrate at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 210. The wireless communication module 260 may also receive a signal to be transmitted from the processor 210, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 250 of electronic device 200 are coupled, and antenna 2 and wireless communication module 260 are coupled, such that electronic device 200 may communicate with a network and other devices via wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 200 implements display functions through a GPU, a display screen 294, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or change display information.
The display 294 is used to display images, videos, and the like. The display 294 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (flex), a mini, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 200 may include 1 or N display screens 294, N being a positive integer greater than 1.
A series of graphical user interfaces (graphical user interface, GUIs), which are all home screens of the electronic device 200, may be displayed on the display 294 of the electronic device 200. In general, the size of the display 294 of the electronic device 200 is fixed and only limited controls can be displayed in the display 294 of the electronic device 200. A control is a GUI element that is a software component contained within an application program that controls all data processed by the application program and interactive operations on that data, and a user can interact with the control by direct manipulation (direct manipulation) to read or edit information about the application program. In general, controls may include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and the like. For example, in an embodiment of the present application, the display 294 may display virtual keys (one-key arrangement, start arrangement, scene arrangement).
The electronic device 200 may implement a photographing function through an ISP, a camera 293, a video codec, a GPU, a display 294, an application processor, and the like.
The ISP is used to process the data fed back by the camera 293. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 293.
The camera 293 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 200 may include 1 or N cameras 293, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 200 is selecting a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 200 may support one or more video codecs. In this way, the electronic device 200 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent cognition of the electronic device 200 may be implemented by the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 220 may be used to connect an external memory card, such as a MicroSD card, to enable expansion of the memory capabilities of the electronic device 200. The external memory card communicates with the processor 210 through an external memory interface 220 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
Internal memory 221 may be used to store computer executable program code that includes instructions. The processor 210 executes various functional applications of the electronic device 200 and data processing by executing instructions stored in the internal memory 221. For example, in the present embodiment, the processor 210 may perform scene orchestration by executing instructions stored in the internal memory 221. The internal memory 221 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 200 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 221 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 210 performs various functional applications of the electronic device 200 and data processing by executing instructions stored in the internal memory 221 and/or instructions stored in a memory provided in the processor.
The electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an ear-headphone interface 270D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 270 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 270 may also be used to encode and decode audio signals. In some embodiments, the audio module 270 may be disposed in the processor 210, or some functional modules of the audio module 270 may be disposed in the processor 210.
Speaker 270A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 200 may listen to music, or to hands-free conversations, through the speaker 270A.
A receiver 270B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 200 is answering a telephone call or voice message, voice may be received by placing receiver 270B close to the human ear.
Microphone 270C, also referred to as a "microphone" or "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 270C through the mouth, inputting a sound signal to the microphone 270C. The electronic device 200 may be provided with at least one microphone 270C. In other embodiments, the electronic device 200 may be provided with two microphones 270C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 200 may also be provided with three, four, or more microphones 270C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording, etc.
The earphone interface 270D is for connecting a wired earphone. Earphone interface 270D may be USB interface 230 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
In some embodiments, the electronic device 200 may further include one or more of a key 290, a motor 291, an indicator 292, and a SIM card interface 295 (or eSIM card), to which embodiments of the present application are not limited in any way.
In addition, an operating system is run on the components. Such as the hong Monte System, the iOS operating system, the Android open source operating system, the Windows operating system, and the like. An operating application may be installed on the operating system.
Fig. 3 is a software structural block diagram of an electronic device according to an embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments of the present application, the software architecture of the electronic device includes at least three layers, from top to bottom, an application layer, an application framework layer, and a hardware abstraction layer.
The application layer may include a series of application packages. These application packages may include applications for cameras, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, video, wake-up device programs, keep-alive device programs, etc.
In the embodiment of the application, the application program layer comprises a plurality of APPs (application program) with User Interfaces (UI), such as a short message, a memo or other APPs capable of using a system View control.
In some embodiments of the application, the APP may include a View control and a confirmation dialog box. The control can be used for displaying the content to be displayed on a UI interface of the electronic device. The confirmation dialog box can be used for displaying the object to be accessed by the user and the related information thereof on the interface so that the user can operate according to the self requirement. In this embodiment, the confirmation dialog may be presented in a state of a Focus Window (Focus Window), where a certain visual difference may exist between a background color of the Focus Window and a color of the background Window, so as to distinguish the two windows.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. As shown in FIG. 3, the application framework layers may include a Window Manager (Window Manager), a content provider, a View System (View System), a phone Manager (Telephony Manager), a resource Manager, a notification Manager (Notification Manager), a Package Manager (Package Manager), and so on. For example, in some embodiments of the application, the application framework layer may also include an input Manager (InputManager), an Activity Manager (Activity Manager).
Wherein the input manager is used to handle input events (key operations, touch events, etc.) of the system.
The application manager is used for managing the life cycle of the application program and providing a common navigation rollback function to process the corresponding terminal application service.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is for providing communication functions of the electronic device. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
The hardware abstraction layer is an interface layer between the operating system kernel and the hardware circuitry of the electronic device 200, which aims to abstract the hardware. In some embodiments of the present application, the hardware abstraction layer includes a network communication module, a device connection module (MagicLink), and a device management module. The network communication module may be used to detect whether the electronic device 200 is in a networked state. The networking state of the present application means that the electronic device 200 can communicate with other electronic devices through the mobile communication module 250 or the wireless communication module 260, and the communication can occur on a closed local area network or can communicate through the internet. The scheme of the application relates to near field communication between the electronic equipment 200 and a PC end in a local area network.
And the discovery connection module (MagicLink) is used for interacting with the PC end through a broadcast packet in the local area network to perform self-discovery ad hoc network.
And the device management module is used for managing the online and offline of the electronic device 200.
For easy understanding, the following embodiments of the present application will take the electronic device 200 having the structure shown in fig. 2 and fig. 3 as an example, and the method for waking up the device and the method for keeping the device provided by the embodiments of the present application will be specifically described with reference to the drawings and application scenarios.
Technical terms related to the embodiment of the application:
and (3) shape: constrained Application Protocol, constraint application protocol, is a proprietary Web transport protocol used to constrain networks and nodes.
Ad hoc network: an ad hoc network is a network combining mobile communication and a computer network, the information exchange of the network adopts a packet switching mechanism in the computer network, a user terminal is a portable terminal which can move, and each user terminal in the ad hoc network has two functions of a router and a host. As a host, the terminal needs to run various user-oriented applications such as an editor, a browser, etc.; as a router, the terminal needs to run a corresponding routing protocol, and completes the forwarding and routing maintenance work of the data packet according to the routing policy and the routing table, so that the node is required to realize a proper routing protocol. The goal of the ad hoc network routing protocol is to be fast, accurate and efficient, requiring that the routing information be found accurately available in as short a time as possible, and being able to adapt to rapid changes in network topology, while reducing the extra delay introduced and maintaining the control information of the route, reducing the overhead of the routing protocol, so as to meet the limitations in terms of computing power, storage space, power supply, etc. of the mobile terminal.
Self-discovery ad hoc network: the method is characterized in that the method is extended from the concept of the ad hoc network, namely, equipment accessed to the same WIFI local area network automatically transmits a map broadcast, after receiving the broadcast with other equipment in the local area network, the equipment can be found with broadcast transmitting end equipment, and the mutually found equipment forms network nodes and is uniformly managed in a group management module.
The execution main body of the method in this embodiment may be an electronic device, or may be a device or a system carried on the electronic device, where the device or the system may implement a wake-up function and/or a keep-alive function for a hibernation device, and may be installed on the electronic device in the form of application software. The electronic device may be a PC terminal, a terminal device, etc., and in the corresponding method embodiment, the PC terminal and the terminal device are respectively used as examples, and the terminal device may be a mobile phone, a PAD, an intelligent screen, etc.
The scheme of the application relates to near field communication of a PC end and other electronic equipment in a local area network, and the PC end performs wake-up operation or keep-alive operation on the other electronic equipment in a dormant state. The other electronic devices may be electronic devices with structures shown in fig. 2 and fig. 3, specifically may be a mobile phone, a PAD, an intelligent screen, etc., and the operating systems thereof may be a hong mo system, an iOS operating system, an Android open source operating system, a Windows operating system, etc., which is exemplified by an Android device.
The embodiment of the application considers that:
in one scenario, when the android device sleeps, due to short-range power consumption control, wifi has a periodic sleep condition when no data is transmitted, and when wifi sleeps, the dormant android device cannot receive self-discovery ad hoc network broadcast packets of other terminals in the local area network. In this scenario, the PC cannot interact with the near-field android device through a broadcast packet in the local area network, so as to perform self-discovery ad hoc network.
In another scenario, during the heartbeat detection (whether the target device has a heartbeat packet in a specified time) of the online device at the MagicLink (device connection module) timing of the PC, if a device changes from a non-sleep state to a sleep state, the device cannot receive a wifi broadcast packet of the PC in the local area network, and cannot respond to the PC. The PC may drop the dormant device if it does not receive a heartbeat response from the device for a period of time (e.g., 30 s).
Both of these points directly affect the user experience.
For the two above scenarios, the embodiment of the present application proposes a solution:
when the terminal equipment is in a dormant state, the PC end can wake up the terminal equipment through a wake-up unicast message, the PC end and the terminal equipment can interact to perform self-discovery ad hoc network, and an online state between the PC and the terminal equipment is maintained, so that corresponding service is realized, and user experience is improved.
In addition, when the terminal equipment is switched from the non-dormant state to the dormant state, the PC end can keep the terminal equipment alive through confirming the unicast message, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is further realized, and user experience is improved.
The following describes two scenarios of self-discovery ad hoc network by interaction of the PC end and the Android device through a broadcast packet in the local area network:
the PC side and the Android device are both provided with a device management module and a discovery connection module.
First scenario:
as shown in FIG. 4, the PC and the dormancy device B are located in the same LAN, and perform wifi self-discovery ad hoc network for supporting super terminal services such as super connection, super notification, super power-on, super mouse and the like. For example, when the PC in the non-sleep state needs to perform services with the mobile phone, the tablet, and the smart screen in the sleep state, the PC needs to wake up these devices from the sleep state before performing corresponding super terminal services.
The embodiment of the application considers that: when the equipment is dormant, although wifi has regular dormancy and cannot receive the self-discovery ad hoc network broadcast packet of other terminals in the local area network, the directional unicast packet can be received, the characteristic can be utilized to expand the shape protocol field of the self-discovery ad hoc network message of the local area network terminal, and an internal calling interface is added at the PC end to realize the self-discovery ad hoc network function.
Specifically, a MagicLink (device connection module) of the PC extends and defines a coapType field in a coap protocol field of the terminal self-discovery ad hoc network message, and the coap message is classified into broadcast, wake-up unicast and other types.
In one possible implementation manner, a wifi near field wake-up interface may be provided to a device management module of the PC through a MagicLink of the PC, and the device management module of the PC may invoke the wifi near field wake-up interface provided by the MagicLink and send a coap wake-up unicast to the IP of the hibernation device B. While MagicLink starts a 2 second timer. The PC receives the response of the discovery connection module of the dormant device B within 2 seconds, the magicLink of the PC informs the device management module of the PC that the device B wakes up successfully and performs self-discovery ad hoc network with the device B; otherwise, the MagicLink of the PC notifies the device management module device B of the PC of the wake-up failure.
After the wake-up is successful, the device B is displayed on the nearby device list of the PC to be on line, and meanwhile, the discovery connection module of the device B informs the device management module of the device B that the new device PC is on line.
Therefore, when the terminal equipment is in a dormant state, the PC side can wake up the terminal equipment through the wake-up unicast message, so that the PC side and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved.
The second scenario:
as shown in fig. 5, after the PC is on line with the non-sleep device a, the PC may periodically start heartbeat on-line detection to detect whether the device a is in a keep-alive state (i.e., keeps on-line state), a discovery connection module of the non-sleep device a may receive a local area network cap broadcast sent by a MagicLink (discovery connection module) of the PC and respond in time, and after the MagicLink of the PC receives the response, notify a device management module of the PC that a new device is on line, and the PC may keep the non-sleep device a on-line state all the time. If the non-dormant device A is changed into the dormant state, in such a scenario, if the PC needs to perform super connection, super notification, super call, super mouse and other super services with the device A in the dormant state, the PC needs to keep alive the dormant device.
The MagicLink of the PC expands the coapType field of the self-discovery ad hoc network message of the terminal, and adds the message type of 'confirmation unicast' and an interface for sending unicast confirmation, which are used in the heartbeat online detection process after the equipment is online.
In one possible implementation manner, after the device a changes from the non-sleep state to the sleep state, the MagicLink (discovery connection module) of the PC performs a pre-offline detection mechanism within 8 seconds in the on-line detection process of the heartbeat, that is, sends a packet of acknowledgement unicast data (a cap unicast acknowledgement message) to the discovery connection module of the device a first, and listens for whether the device a has a response within 8 seconds.
If the unicast response returned by the discovery connection module of the device A is received within 8 seconds, the magicLink of the PC considers that the device A has a heartbeat and keeps on-line. Otherwise, the MagicLink of the PC considers that the device a has no heartbeat, and notifies the device management module of the PC to take it off line over time.
Therefore, when the terminal equipment is switched from the non-dormant state to the dormant state, the PC end can keep the terminal equipment alive through confirming the unicast message, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved.
Based on the description of the above two scenarios, the following describes the scheme of the present embodiment in detail:
fig. 6 is a flowchart of a method for waking up a device according to an embodiment of the present application, where, as shown in fig. 6, the method for waking up a device according to an embodiment of the present application is applied to a PC side, and the method includes:
step S601, a wake-up unicast message is sent to a target device in a dormant state in response to a wake-up instruction of the target device;
the execution main body of the method in this embodiment may be an electronic device, or may be a device or a system carried on the electronic device and used for waking up the device, where the device or the system of the waking up device may implement a wake-up function for a sleep device, and may be installed on the electronic device in the form of application software. The electronic device may be a PC or the like, and the PC terminal is used as an example in this embodiment.
The scheme of the application relates to near field communication of a PC end and other electronic equipment in a local area network, and the PC end wakes up other electronic equipment in a dormant state. The other electronic devices may be electronic devices with structures shown in fig. 2 and fig. 3, specifically may be a mobile phone, a PAD, an intelligent screen, etc., and the operating systems thereof may be a hong mo system, an iOS operating system, an Android open source operating system, a Windows operating system, etc., which is exemplified by an Android device.
In this embodiment, the PC side sends a wake-up unicast message to the target device in the sleep state in response to a wake-up instruction to the target device.
The target device may be an Android device as described above.
Specifically, as a possible implementation manner, the PC side and the target device are located in the same local area network, and the PC side and the target device perform wifi self-discovery ad hoc network.
If the PC needs to perform a service of a preset application with the target device, such as super connection, super notification, super incoming call, super mouse, etc., for example, when the PC needs to perform a service with a mobile phone, a tablet, and a smart screen, the target device needs to be kept in an online state.
The triggering mode of the super terminal service can be triggered by a service operation instruction of a user on a PC (personal computer) for a preset application.
After detecting a service operation instruction of a user on the PC for a preset application, the PC detects whether the target equipment is in a dormant state, and when detecting that the target equipment is in the dormant state, the PC needs to wake up the equipment from the dormant state before corresponding super terminal service can be performed.
Therefore, when the PC detects that the target equipment is in a dormant state and receives a service operation instruction of a preset application, the PC triggers a wake-up instruction of the target equipment.
And the PC responds to the wake-up instruction of the target equipment in the dormant state and sends a wake-up unicast message to the target equipment.
The embodiment of the application considers that: when the equipment is dormant, although wifi has regular dormancy and cannot receive the self-discovery ad hoc network broadcast packet of other terminals in the local area network, the directional unicast packet can be received, the characteristic can be utilized to expand the shape protocol field of the self-discovery ad hoc network message of the local area network terminal, and an internal calling interface is added at the PC end to realize the self-discovery ad hoc network function.
Specifically, the MagicLink of the PC expands the shape field of the terminal self-discovery ad hoc network message, and expands and defines the shape field in the shape protocol field of the terminal self-discovery ad hoc network message, so as to divide the shape message into types such as broadcast, wake-up unicast and the like.
In one possible implementation manner, a wifi near field wake-up interface may be provided to the device management module through a MagicLink (discovery connection module) of the PC, as shown in fig. 7, where the device management module of the PC may call the wifi near field wake-up interface provided by the MagicLink, and send a shape wake-up unicast to the discovery connection module of the sleep device B.
Step S602, if a unicast response message returned by the target device is received, it is determined that the wake-up of the target device is successful.
After receiving the wake-up unicast message sent by the PC side, the target device returns a unicast response message to the PC if there are no other abnormal conditions (such as network abnormality).
And the PC receives the unicast response message returned by the target equipment, and then the target equipment is determined to be awakened successfully.
In one possible implementation manner, if the PC receives the unicast response message returned by the target device within a preset time, it is determined that the wake-up of the target device is successful.
In one possible implementation manner, as described above, the wifi near field wake-up interface may be provided to the device management module through the MagicLink (discovery connection module) of the PC, as shown in fig. 4 and fig. 7 (a), where the device management module of the PC may call the wifi near field wake-up interface provided by the MagicLink of the PC, and send the shape wake-up unicast to the discovery connection module of the sleep device B. The discovery connection module of the sleep device B receives a shape wake-up unicast sent by a wifi near field wake-up interface provided by a MagicLink of the PC and called by the device management module of the PC.
Meanwhile, the MagicLink of the PC starts a 2-second timer (the time can be set according to the requirement), as shown in fig. 4, if the MagicLink of the PC receives any type of coat message response of the discovery connection module of the sleep device B within 2 seconds, the MagicLink of the PC notifies the device management module device B of the PC that the wake-up is successful, otherwise, the MagicLink of the PC notifies the device management module device B of the PC that the wake-up is failed.
After the device B is awakened successfully by the PC, the device B can be automatically found and self-organized with the device B to carry out super terminal services such as super connection, super notification, super power-on, super mouse and the like.
According to the scheme, the PC side responds to the wake-up instruction of the target equipment in the dormant state and sends the wake-up unicast message to the target equipment; if a unicast response message returned by the target equipment is received, the target equipment is determined to be awakened successfully, and therefore, when the terminal equipment is in a dormant state, the PC end can awaken the terminal equipment through the awakening unicast message, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is kept, corresponding services are realized, the problem that the PC and other android equipment (mobile phone, PAD, intelligent screen and the like) in the dormant state cannot self-discover ad hoc network and the online state between the PC and the equipment is kept is solved, and the services such as super connection, super notification, super incoming call, super mouse and the like can be better supported, and the user experience is improved.
Further, as shown in fig. 6, as a possible implementation manner, the method may further include:
and step S603, performing self-discovery ad hoc network with the target equipment.
After the PC wakes up the target equipment successfully, the target equipment can be automatically found and self-organized with the target equipment, and super terminal services such as super connection, super notification, super power-on, super mouse and the like can be performed.
Further, in one possible implementation manner, the step S601, before sending the wake-up unicast message to the target device in the sleep state in response to the wake-up instruction to the target device, further includes:
step S600, when detecting that the target device is in a sleep state and receiving a service operation instruction for a preset application, triggering a wake-up instruction for the target device.
Specifically, as a possible implementation manner, the PC side and the target device are located in the same local area network, and the PC side and the target device perform wifi self-discovery ad hoc network.
If the PC needs to perform a service of a preset application with the target device, such as super connection, super notification, super incoming call, super mouse, etc., for example, when the PC needs to perform a service with a mobile phone, a tablet, and a smart screen, the target device needs to be kept in an online state.
The triggering mode of the super terminal service can be triggered by a service operation instruction of a user on a PC (personal computer) for a preset application.
After detecting a service operation instruction of a user on the PC for a preset application, the PC detects whether the target equipment is in a dormant state, and when detecting that the target equipment is in the dormant state, the PC needs to wake up the equipment from the dormant state before corresponding super terminal service can be performed.
Therefore, when the PC detects that the target equipment is in a dormant state and receives a service operation instruction of a preset application, the PC triggers a wake-up instruction of the target equipment.
Further, as a possible implementation manner, the method further includes:
step S604, displaying that the target device is on-line in the nearby device list of the PC side.
Specifically, after the PC wakes up the target device successfully, the target device is displayed on-line in a nearby device list of the PC.
Further, as a possible implementation manner, the method further includes:
step S605, when detecting that the target device is switched from a non-dormant state to a dormant state, sending a confirmation unicast message to the target device;
In one possible implementation manner, when the target device is detected to be switched from the non-dormant state to the dormant state, a pre-offline detection mechanism is started in the heartbeat online detection process of the target device; and sending a confirmation unicast message to the target equipment according to the pre-offline detection mechanism.
Specifically, as previously described, embodiments of the present application contemplate: when the equipment is dormant, although wifi has regular dormancy and cannot receive the self-discovery ad hoc network broadcast packet of other terminals in the local area network, the directional unicast packet can be received, the characteristic can be utilized to expand the shape protocol field of the self-discovery ad hoc network message of the local area network terminal, and an internal calling interface is added at the PC end to realize the self-discovery ad hoc network function.
Specifically, the MagicLink of the PC extends the shape field of the terminal self-discovery ad hoc network message, extends and defines the shape field in the shape protocol field of the terminal self-discovery ad hoc network message, and adds an interface for "confirming unicast" message type and sending unicast confirmation, as shown in fig. 7 (b), which is used in the heartbeat online detection process after the device is online.
As shown in fig. 7 (b), in one possible implementation manner, when the target device is detected to switch from the non-dormant state to the dormant state, a wifi near field unicast acknowledgement interface may be provided through a MagicLink (discovery connection module) of a PC, and the MagicLink of the PC may call the unicast acknowledgement interface and send a cap acknowledgement unicast message to the discovery connection module of the target device.
Step S606, if a unicast response message returned by the target device is received, keep-alive online processing is performed on the target device.
After receiving the confirmed unicast message sent by the PC end, the target device returns a unicast response message to the PC if other abnormal conditions (such as network abnormality and the like) exist.
And the PC receives the unicast response message returned by the target equipment and carries out keep-alive online processing on the target equipment.
In one possible implementation manner, if the PC receives the unicast response message returned by the target device within a preset time, it is determined that the target device has a heartbeat, and keep-alive online processing is performed on the target device.
In one possible implementation, as shown in fig. 5, after the device a changes from the non-sleep state to the sleep state, the MagicLink of the PC performs a pre-offline detection mechanism within 8 seconds (the time can be set according to the needs) in the heartbeat online detection process, that is, sends a packet of acknowledgement unicast data (a shape unicast acknowledgement message) to the discovery connection module of the device a first, and monitors whether the device a responds within 8 seconds.
If the unicast response returned by the discovery connection module of the device A is received within 8 seconds, the magicLink of the PC considers that the device A has a heartbeat and keeps on-line. Otherwise, the MagicLink of the PC considers that the device a has no heartbeat, and notifies the device management module of the PC to take it off line over time.
Therefore, when the terminal equipment is switched from the non-dormant state to the dormant state, the PC end can keep the terminal equipment alive through confirming the unicast message, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved.
Further, as a possible implementation manner, after the step of sending the acknowledgement unicast message to the target device when the target device is detected to switch from the non-sleep state to the sleep state, the method further includes:
step S607, if the unicast response message returned by the target device is not received within the preset time, determining that the target device has no heartbeat, and performing the offline processing on the target device.
In one possible implementation, as shown in fig. 5, after the device a changes from the non-sleep state to the sleep state, the MagicLink of the PC performs a pre-offline detection mechanism within 8 seconds (the time can be set according to the requirement) in the heartbeat online detection process, that is, sends a packet of acknowledgement unicast data (a shape unicast acknowledgement message) to the device a first, and listens for whether the device a responds within 8 seconds.
If the unicast response returned by the discovery connection module of the device A is received within 8 seconds, the magicLink of the PC considers that the device A has a heartbeat and keeps on-line. Otherwise, the MagicLink of the PC considers that the device a has no heartbeat, and notifies the device management module of the PC to take it off line over time.
Further, as a possible implementation manner, the step S601, before sending the wake-up unicast message to the target device in the sleep state in response to the wake-up instruction to the target device, further includes:
step S6001 sets a wake-up unicast type field and a confirm unicast type field in a self-discovery ad hoc protocol field of the target device, where the wake-up unicast type field is used to wake up the dormant target device, and the confirm unicast type field is used to keep alive the dormant target device.
Specifically, the embodiment of the application considers that: when equipment in the same local area network with the PC end is dormant, although wifi has regular dormancy and cannot receive self-discovery ad hoc network broadcast packets of other terminals in the local area network, the directional unicast packets can be received, the characteristic can be utilized to expand the cap protocol field of the self-discovery ad hoc network message of the local area network terminal, and an internal calling interface is added at the PC end to realize the self-discovery ad hoc network function.
In a possible implementation manner, the MagicLink of the PC expands the coapType field of the terminal self-discovery ad hoc network message, expands and defines the coapType field in the coapType field of the terminal self-discovery ad hoc network message, and divides the coapType message into broadcast, wake-up unicast and other types, meanwhile, the MagicLink of the PC provides a wifi near field wake-up interface to a device management module of the PC, and the device management module of the PC invokes the wifi near field wake-up interface provided by the MagicLink to send the coapType wake-up unicast to the IP of the dormant device B.
Meanwhile, the MagicLink of the PC expands the coapType field of the self-discovery ad hoc network message of the terminal, and adds the message type of 'confirmation unicast' and an interface for sending unicast confirmation, which are used in the heartbeat online detection process after the equipment is on line.
Thus, wake-up unicast and confirm unicast type fields are added in the self-discovery ad hoc protocol field of the target device, so as to wake up the dormant target device and keep-alive the dormant target device respectively. For example, a wake-up unicast type field with a shape of 4 is newly added in the shape message, and an acknowledge unicast type field with a shape of 3 is newly added in the shape message.
When the terminal equipment is in a dormant state, the PC end can wake up the terminal equipment through wake-up unicast messages and the wake-up interface, the PC end and the terminal equipment can interact to perform self-discovery ad hoc network, and an online state between the PC and the terminal equipment is maintained, so that corresponding service is realized, and user experience is improved.
In addition, when the terminal equipment is switched from the non-dormant state to the dormant state, the PC end can keep the terminal equipment alive by confirming unicast messages and combining unicast confirmation interfaces, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is kept, corresponding service is realized, and user experience is improved.
Fig. 8 is a flowchart of a method for a keep-alive device according to an embodiment of the present application, where, as shown in fig. 8, the method for a keep-alive device according to an embodiment of the present application is applied to a PC side, and the method includes:
step S1001, when detecting that a target device switches from a non-sleep state to a sleep state, sending an acknowledgement unicast message to the target device;
the main execution body of the method in this embodiment may be an electronic device, or may be a device or a system carried on the electronic device, where the device or the system may at least implement a keep-alive function for a dormant device, and may be installed on the electronic device in the form of application software. The electronic device may be a terminal device such as a PC or a server, and in this embodiment, the PC is used as an example.
The scheme of the application relates to near field communication of a PC end and other electronic equipment in a local area network, and the PC end is used for carrying out keep-alive operation on the other electronic equipment in a dormant state. The other electronic devices may be electronic devices with structures shown in fig. 2 and fig. 3, specifically may be a mobile phone, a PAD, an intelligent screen, etc., and the operating systems thereof may be a hong mo system, an iOS operating system, an Android open source operating system, a Windows operating system, etc., which is exemplified by an Android device.
In one possible implementation manner, when the target device is detected to be switched from the non-dormant state to the dormant state, a pre-offline detection mechanism is started in the heartbeat online detection process of the target device; and sending a confirmation unicast message to the target equipment according to the pre-offline detection mechanism.
Specifically, the embodiment of the application considers that: when the equipment is dormant, although wifi has regular dormancy and cannot receive the self-discovery ad hoc network broadcast packet of other terminals in the local area network, the directional unicast packet can be received, the characteristic can be utilized to expand the shape protocol field of the self-discovery ad hoc network message of the local area network terminal, and an internal calling interface is added at the PC end to realize the self-discovery ad hoc network function.
Specifically, the MagicLink of the PC extends the shape field of the terminal self-discovery ad hoc network message, extends and defines the shape field in the shape protocol field of the terminal self-discovery ad hoc network message, and adds an interface for "confirming unicast" message type and sending unicast confirmation, as shown in fig. 7 (b), which is used in the heartbeat online detection process after the device is online.
As shown in fig. 7 (b), in one possible implementation manner, when the target device is detected to switch from the non-dormant state to the dormant state, a wifi near field unicast acknowledgement interface may be provided through a MagicLink (discovery connection module) of a PC, and the MagicLink of the PC may call the unicast acknowledgement interface and send a cap acknowledgement unicast message to the discovery connection module of the target device.
Step S1002, if a unicast response message returned by the target device is received, keep-alive online processing is performed on the target device.
After receiving the confirmed unicast message sent by the PC end, the target device returns a unicast response message to the PC if other abnormal conditions (such as network abnormality and the like) exist.
And the PC receives the unicast response message returned by the target equipment and carries out keep-alive online processing on the target equipment.
In one possible implementation manner, if the PC receives the unicast response message returned by the target device within a preset time, it is determined that the target device has a heartbeat, and keep-alive online processing is performed on the target device.
In one possible implementation, as shown in fig. 5, after the PC and the device a are located in the same lan and the PC is on-line with the non-sleep device a, the PC may periodically start heartbeat on-line detection, detect whether the device a is in a keep-alive state (i.e. keeps on-line state), and the non-sleep device a can receive the lan cap broadcast sent by the PC and respond in time, so that the PC can keep the non-sleep device a on-line all the time. If the non-dormant device A is changed into the dormant state, in such a scenario, if the PC needs to perform super connection, super notification, super call, super mouse and other super services with the device A in the dormant state, the PC needs to keep alive the dormant device.
In one possible implementation, as shown in fig. 5, after the device a changes from the non-dormant state to the dormant state, the MagicLink of the PC performs a pre-offline detection mechanism within 8 seconds (the time can be set according to the needs) in the heartbeat online detection process, that is, sends a packet of acknowledgement unicast data (a cap unicast acknowledgement message) to the discovery connection module of the device a, and monitors whether the device a responds within 8 seconds.
If the unicast response returned by the discovery connection module of the device A is received within 8 seconds, the magicLink of the PC considers that the device A has a heartbeat and keeps on-line. Otherwise, the MagicLink of the PC considers that the device a has no heartbeat, and notifies the device management module of the PC to take it off line over time.
Therefore, when the terminal equipment is switched from the non-dormant state to the dormant state, the PC end can keep the terminal equipment alive through confirming the unicast message, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved.
Further, as a possible implementation manner, the step S1001 further includes, after detecting that the target device switches from the non-sleep state to the sleep state, sending an acknowledgment unicast message to the target device:
Step S1003, if the unicast response message returned by the target device is not received within the preset time, determining that the target device has no heartbeat, and performing the timeout offline processing on the target device.
In one possible implementation, as shown in fig. 5, after the device a changes from the non-sleep state to the sleep state, the MagicLink of the PC performs a pre-offline detection mechanism within 8 seconds (the time can be set according to the requirement) in the heartbeat online detection process, that is, sends a packet of acknowledgement unicast data (a shape unicast acknowledgement message) to the device a first, and listens for whether the device a responds within 8 seconds.
If the unicast response returned by the discovery connection module of the device A is received within 8 seconds, the magicLink of the PC considers that the device A has a heartbeat and keeps on-line. Otherwise, the MagicLink of the PC considers that the device a has no heartbeat, and notifies the device management module of the PC to take it off line over time.
Fig. 9 is a flowchart of a method for waking up a device according to another embodiment of the present application, as shown in fig. 9, where the method for waking up a device according to an embodiment of the present application is applied to a terminal device, and the method includes:
step 1101, receiving a wake-up unicast message sent by a PC end in response to a wake-up instruction to the terminal device in a sleep state;
Step S1102, returning a unicast response message to the PC according to the wake-up unicast message, so that the PC determines that the terminal device is successfully woken up.
The main execution body of the method in this embodiment is a terminal device, which may be an electronic device, or a device or a system carried on the electronic device for waking up the device, where the device or the system of the waking up device may implement a wake-up function for a sleep device, and may be installed on the electronic device in the form of application software. The electronic device may be the electronic device with the structure shown in fig. 2 and fig. 3, specifically may be a mobile phone, a PAD, an intelligent screen, etc., and the operating system may be a hong mo system, an iOS operating system, an Android open source operating system, a Windows operating system, etc., which is exemplified by an Android device in this embodiment.
The scheme of the application relates to near field communication between terminal equipment and a PC end in a local area network, and the terminal equipment in a dormant state is waken up through the PC end.
In this embodiment, the terminal device is a target device.
In this embodiment, the PC side sends a wake-up unicast message to the target device in the sleep state in response to a wake-up instruction to the target device, and the target device receives the wake-up unicast message sent by the PC side in response to the wake-up instruction to the terminal device in the sleep state.
Specifically, as a possible implementation manner, the PC side and the target device are located in the same local area network, and the PC side and the target device perform wifi self-discovery ad hoc network.
If the PC needs to perform a service of a preset application with the target device, such as super connection, super notification, super incoming call, super mouse, etc., for example, when the PC needs to perform a service with a mobile phone, a tablet, and a smart screen, the target device needs to be kept in an online state.
The triggering mode of the super terminal service can be triggered by a service operation instruction of a user on a PC (personal computer) for a preset application.
After detecting a service operation instruction of a user on the PC for a preset application, the PC detects whether the target equipment is in a dormant state, and when detecting that the target equipment is in the dormant state, the PC needs to wake up the equipment from the dormant state before corresponding super terminal service can be performed.
Therefore, when the PC detects that the target equipment is in a dormant state and receives a service operation instruction of a preset application, the PC triggers a wake-up instruction of the target equipment.
And the PC responds to the wake-up instruction of the target equipment in the dormant state and sends a wake-up unicast message to the target equipment.
The embodiment of the application considers that: when the equipment is dormant, although wifi has regular dormancy and cannot receive the self-discovery ad hoc network broadcast packet of other terminals in the local area network, the directional unicast packet can be received, the characteristic can be utilized to expand the shape protocol field of the self-discovery ad hoc network message of the local area network terminal, and an internal calling interface is added at the PC end to realize the self-discovery ad hoc network function.
Specifically, the MagicLink of the PC expands the shape field of the terminal self-discovery ad hoc network message, and expands and defines the shape field in the shape protocol field of the terminal self-discovery ad hoc network message, so as to divide the shape message into types such as broadcast, wake-up unicast and the like.
In one possible implementation manner, a wifi near field wake-up interface may be provided to a device management module of a PC through a MagicLink (discovery connection module) of the PC, as shown in fig. 7, where the device management module of the PC may call the wifi near field wake-up interface provided by the MagicLink, and send a coap wake-up unicast to an IP of the dormant device B.
After receiving the wake-up unicast message sent by the PC side, the target device returns a unicast response message to the PC if there are no other abnormal conditions (such as network abnormality).
And the PC receives the unicast response message returned by the target equipment, and then the target equipment is determined to be awakened successfully.
In one possible implementation manner, if the PC receives the unicast response message returned by the target device within a preset time, it is determined that the wake-up of the target device is successful.
In one possible implementation manner, as described above, the wifi near field wake-up interface may be provided to the device management module through the MagicLink (discovery connection module) of the PC, as shown in fig. 4 and fig. 7 (a), where the device management module of the PC may call the wifi near field wake-up interface provided by the MagicLink, and send the shape wake-up unicast to the discovery connection module of the sleep device B. The discovery connection module of the sleep device B receives a shape wake-up unicast sent by a wifi near field wake-up interface provided by a MagicLink of the PC and called by the device management module of the PC.
Meanwhile, the MagicLink of the PC starts a 2-second timer (the time can be set according to the requirement), as shown in fig. 4, if the PC receives any type of the shape message response of the discovery connection module of the sleep device B within 2 seconds, the MagicLink of the PC notifies the device management module device B of the PC that the wake-up is successful, otherwise, the MagicLink of the PC notifies the device management module device B of the PC that the wake-up is failed.
After the device B is awakened successfully by the PC, the device B can be automatically found and self-organized with the device B to carry out super terminal services such as super connection, super notification, super power-on, super mouse and the like.
According to the scheme, the terminal equipment receives the wake-up unicast message sent by the PC end in response to the wake-up instruction of the terminal equipment in the dormant state; according to the awakening unicast message, a unicast response message is returned to the PC end, so that the PC end determines that the terminal equipment is awakened successfully, when the terminal equipment is in a dormant state, the PC end can awaken the terminal equipment through the awakening unicast message, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, the problem that the self-discovery ad hoc network cannot be found between the PC and other android equipment (mobile phone, PAD, intelligent screen and the like) in the dormant state and the online state between the PC and the equipment is maintained is solved, the service such as super connection, super notification, super incoming call, super mouse and the like can be better supported, and the user experience is improved.
Further, as a possible implementation manner, the method further includes:
and step S1103, performing self-discovery ad hoc network with the PC terminal.
After the PC wakes up the terminal equipment successfully, the terminal equipment can be automatically found to be self-networking with the terminal equipment, and super terminal services such as super connection, super notification, super power-on, super mouse and the like can be performed.
Further, as a possible implementation manner, the method further includes:
step S1104, receiving a unicast acknowledgement message sent by the PC side when the terminal device switches from a non-sleep state to a sleep state;
step S1105, returning a unicast response message to the PC according to the confirmation unicast message, so that the PC performs keep-alive online processing on the terminal device.
In one possible implementation manner, when detecting that a target device is switched from a non-dormant state to a dormant state, the PC starts a pre-offline detection mechanism in an online heartbeat detection process of the target device; and sending a confirmation unicast message to the target equipment according to the pre-offline detection mechanism.
Specifically, as previously described, embodiments of the present application contemplate: when the equipment is dormant, although wifi has regular dormancy and cannot receive the self-discovery ad hoc network broadcast packet of other terminals in the local area network, the directional unicast packet can be received, the characteristic can be utilized to expand the shape protocol field of the self-discovery ad hoc network message of the local area network terminal, and an internal calling interface is added at the PC end to realize the self-discovery ad hoc network function.
Specifically, the MagicLink of the PC extends the shape field of the terminal self-discovery ad hoc network message, extends and defines the shape field in the shape protocol field of the terminal self-discovery ad hoc network message, and adds an interface for "confirming unicast" message type and sending unicast confirmation, as shown in fig. 7 (b), which is used in the heartbeat online detection process after the device is online.
As shown in fig. 7 (b), in one possible implementation manner, when the target device is detected to switch from the non-dormant state to the dormant state, a wifi near field unicast acknowledgement interface may be provided through a MagicLink (discovery connection module) of a PC, and the MagicLink of the PC may call the unicast acknowledgement interface and send a cap acknowledgement unicast message to the discovery connection module of the target device.
And the target equipment receives the confirmation unicast message sent by the PC side when the terminal equipment is switched from the non-dormant state to the dormant state.
After receiving the confirmed unicast message sent by the PC end, the target device returns a unicast response message to the PC if other abnormal conditions (such as network abnormality and the like) exist.
And the PC receives the unicast response message returned by the target equipment and carries out keep-alive online processing on the target equipment.
In one possible implementation manner, if the PC receives the unicast response message returned by the target device within a preset time, it is determined that the target device has a heartbeat, and keep-alive online processing is performed on the target device.
In one possible implementation, as shown in fig. 5, after the device a changes from the non-sleep state to the sleep state, the MagicLink of the PC performs a pre-offline detection mechanism within 8 seconds (the time can be set according to the needs) in the heartbeat online detection process, that is, sends a packet of acknowledgement unicast data (a shape unicast acknowledgement message) to the discovery connection module of the device a first, and monitors whether the device a responds within 8 seconds.
If the unicast response returned by the discovery connection module of the device A is received within 8 seconds, the magicLink of the PC considers that the device A has a heartbeat and keeps on-line. Otherwise, the MagicLink of the PC considers that the device a has no heartbeat, and notifies the device management module of the PC to take it off line over time.
Therefore, when the terminal equipment is switched from the non-dormant state to the dormant state, the PC end can keep the terminal equipment alive through confirming the unicast message, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved.
Fig. 10 is a flowchart of a method for a keep-alive device according to another embodiment of the present application, and as shown in fig. 10, an embodiment of the present application provides a method for a keep-alive device applied to a terminal device, where the method includes:
step S1201, receiving a confirmation unicast message sent by the PC end when the terminal equipment is switched from a non-dormant state to a dormant state;
step S1202, returning a unicast response message to the PC according to the confirmation unicast message, so that the PC performs keep-alive online processing on the terminal device.
The main execution body of the method in this embodiment is a terminal device, which may be an electronic device, or a device or a system carried on the electronic device for waking up the device, where the device or the system of the waking up device may implement a wake-up function for a sleep device, and may be installed on the electronic device in the form of application software. The electronic device may be the electronic device with the structure shown in fig. 2 and fig. 3, specifically may be a mobile phone, a PAD, an intelligent screen, etc., and the operating system may be a hong mo system, an iOS operating system, an Android open source operating system, a Windows operating system, etc., which is exemplified by an Android device in this embodiment.
The scheme of the application relates to near field communication between terminal equipment and a PC end in a local area network, and the PC end is used for carrying out keep-alive operation on the terminal equipment in a dormant state.
In this embodiment, the terminal device is a target device.
In this embodiment, when detecting that a target device is switched from a non-sleep state to a sleep state, a PC starts a pre-offline detection mechanism in an online heartbeat detection process of the target device; and sending a confirmation unicast message to the target equipment according to the pre-offline detection mechanism.
Specifically, the embodiment of the application considers that: when the equipment is dormant, although wifi has regular dormancy and cannot receive the self-discovery ad hoc network broadcast packet of other terminals in the local area network, the directional unicast packet can be received, the characteristic can be utilized to expand the shape protocol field of the self-discovery ad hoc network message of the local area network terminal, and an internal calling interface is added at the PC end to realize the self-discovery ad hoc network function.
Specifically, the MagicLink of the PC extends the shape field of the terminal self-discovery ad hoc network message, extends and defines the shape field in the shape protocol field of the terminal self-discovery ad hoc network message, and adds an interface for "confirming unicast" message type and sending unicast confirmation, as shown in fig. 7 (b), which is used in the heartbeat online detection process after the device is online.
As shown in fig. 7 (b), in one possible implementation manner, when the target device is detected to switch from the non-dormant state to the dormant state, a wifi near field unicast acknowledgement interface may be provided through a MagicLink (discovery connection module) of a PC, and the MagicLink of the PC may call the unicast acknowledgement interface and send a cap acknowledgement unicast message to the discovery connection module of the target device.
And the target equipment receives the confirmation unicast message sent by the PC side.
After receiving the confirmed unicast message sent by the PC end, the target device returns a unicast response message to the PC if other abnormal conditions (such as network abnormality and the like) exist.
And if the PC receives the unicast response message returned by the target equipment, performing keep-alive online processing on the target equipment.
In one possible implementation manner, if the PC receives the unicast response message returned by the target device within a preset time, it is determined that the target device has a heartbeat, and keep-alive online processing is performed on the target device.
In one possible implementation, as shown in fig. 5, after the PC and the device a are located in the same lan and the PC is on-line with the non-sleep device a, the PC may periodically start heartbeat on-line detection, detect whether the device a is in a keep-alive state (i.e. keeps on-line state), and the non-sleep device a can receive the lan cap broadcast sent by the PC and respond in time, so that the PC can keep the non-sleep device a on-line all the time. If the non-dormant device A is changed into the dormant state, in such a scenario, if the PC needs to perform super connection, super notification, super call, super mouse and other super services with the device A in the dormant state, the PC needs to keep alive the dormant device.
In one possible implementation, as shown in fig. 5, after the device a changes from the non-sleep state to the sleep state, the MagicLink of the PC performs a pre-offline detection mechanism within 8 seconds (the time can be set according to the needs) in the heartbeat online detection process, that is, sends a packet of acknowledgement unicast data (a shape unicast acknowledgement message) to the discovery connection module of the device a first, and monitors whether the device a responds within 8 seconds.
If the unicast response returned by the discovery connection module of the device A is received within 8 seconds, the magicLink of the PC considers that the device A has a heartbeat and keeps on-line. Otherwise, the MagicLink of the PC considers that the device a has no heartbeat, and notifies the device management module of the PC to take it off line over time.
Therefore, when the terminal equipment is switched from the non-dormant state to the dormant state, the PC end can keep the terminal equipment alive through confirming the unicast message, so that the PC end and the terminal equipment can interactively perform self-discovery ad hoc network, the online state between the PC and the terminal equipment is maintained, corresponding service is realized, and user experience is improved.
Fig. 11 is a functional block diagram of an apparatus for waking up a device according to an embodiment of the present application, as shown in fig. 11, an apparatus 1300 for waking up a device according to an embodiment of the present application includes:
A wake-up unicast sending module 1301, configured to send a wake-up unicast message to a target device in a sleep state in response to a wake-up instruction to the target device;
and the receiving module 1302 is configured to determine that the wake-up of the target device is successful if the unicast response message returned by the target device is received.
The principle of waking up the device is implemented in this embodiment, please refer to the above embodiments, and the description thereof is omitted herein.
Fig. 12 is a schematic functional block diagram of an apparatus for a keep-alive device according to an embodiment of the present application, as shown in fig. 12, an apparatus 1400 for a keep-alive device according to an embodiment of the present application includes:
a confirmation unicast sending module 1401, configured to send a confirmation unicast message to a target device when detecting that the target device is switched from a non-sleep state to a sleep state;
and a processing module 1402, configured to perform keep-alive online processing on the target device if the unicast response message returned by the target device is received.
The principle of the keep-alive device is implemented in this embodiment, please refer to the above embodiments, and the description thereof is omitted here.
Fig. 13 is a functional block diagram of an apparatus for waking up a device according to another embodiment of the present application, as shown in fig. 13, an apparatus 1500 for waking up a device according to an embodiment of the present application includes:
A wake-up unicast receiving module 1501, configured to receive a wake-up unicast message sent by a PC end in response to a wake-up instruction of the terminal device in a sleep state;
a response module 1502, configured to return a unicast response message to the PC according to the wake-up unicast message, so that the PC determines that the terminal device is wake-up successfully.
The principle of waking up the device is implemented in this embodiment, please refer to the above embodiments, and the description thereof is omitted herein.
Fig. 14 is a schematic functional block diagram of an apparatus for a keep-alive device according to another embodiment of the present application, as shown in fig. 14, an apparatus 1600 for a keep-alive device according to an embodiment of the present application includes:
a confirmation unicast receiving module 1601, configured to receive a confirmation unicast message sent by the PC side when the terminal device switches from a non-dormant state to a dormant state;
and a response module 1602, configured to return a unicast response message to the PC according to the confirmation unicast message, so that the PC performs keep-alive online processing on the terminal device.
The principle of the keep-alive device is implemented in this embodiment, please refer to the above embodiments, and the description thereof is omitted here.
It should be understood that the electronic device herein is embodied in the form of functional modules. The term "module" herein may be implemented in software and/or hardware, and is not specifically limited thereto. For example, a "module" may be a software program, a hardware circuit, or a combination of both that implements the functionality described above. The hardware circuitry may include application specific integrated circuits (application specific integrated circuit, ASICs), electronic circuits, processors (e.g., shared, proprietary, or group processors, etc.) and memory for executing one or more software or firmware programs, merged logic circuits, and/or other suitable components that support the described functions.
The present application also provides an electronic device including: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by the electronic device, cause the electronic device to perform the method of waking the device as in any of the possible implementations described above, or the method of preserving the device as in any of the possible implementations described above.
The application also provides a computer readable storage medium having stored therein a computer program which, when executed by a processor, causes the processor to perform a method of waking up a device as claimed in any one of the possible implementations, or a method of preserving a device as claimed in any one of the possible implementations.
The application also provides a chip comprising a processor and a data interface, the processor reading instructions stored on a memory through the data interface, performing the method of waking up a device, or the method of keeping a device alive, as in any one of the possible implementations described above.
Optionally, the chip may further include a memory, where the memory stores instructions, and the processor is configured to execute the instructions stored on the memory, where the instructions, when executed, are configured to perform a method of waking up the device, or a method of keeping the device alive, as in any one of the possible implementations described above.
The memory may be read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (random access memory, RAM) or other types of dynamic storage devices that can store information and instructions, electrically erasable programmable read-only memory (electrica llyerasable programmable read-only memory, EEPROM), compact disc read-only memory (compact disc read-only memory) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media, or any other magnetic storage device that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, etc.
In the embodiment of the application, "and/or" describes the association relation of the association objects, which means that three relations can exist, for example, a and/or B, and can mean that a exists alone, a exists together with B, and B exists alone. Wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of the following" and the like means any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
Those of ordinary skill in the art will appreciate that the various elements and algorithm steps described in the embodiments disclosed herein can be implemented as a combination of electronic hardware, computer software, and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In several embodiments provided by the present application, any of the functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely exemplary embodiments of the present application, and any person skilled in the art may easily conceive of changes or substitutions within the technical scope of the present application, which should be covered by the present application. The protection scope of the present application shall be subject to the protection scope of the claims.

Claims (24)

1. A method for waking up a device, wherein the method is applied to a PC side, the method comprising:
responding to a wake-up instruction of target equipment in a dormant state, and sending a wake-up unicast message to the target equipment;
and if the unicast response message returned by the target equipment is received, determining that the target equipment is awakened successfully.
2. The method according to claim 1, wherein the method further comprises:
and performing self-discovery ad hoc network with the target equipment.
3. The method of claim 1, wherein the step of determining that the wake-up of the target device was successful if a unicast response message returned by the target device is received comprises:
and if the unicast response message returned by the target equipment is received within the preset time, determining that the target equipment is awakened successfully.
4. The method of claim 1, wherein the step of sending a wake-up unicast message to the target device in the sleep state in response to a wake-up instruction to the target device further comprises, prior to:
triggering a wake-up instruction of target equipment when detecting that the target equipment is in a dormant state and receiving a business operation instruction of a preset application.
5. The method according to claim 1, wherein the method further comprises:
and displaying that the target equipment is on line in a nearby equipment list of the PC side.
6. The method according to claim 1, wherein the method further comprises:
when the target device is detected to be switched from a non-dormant state to a dormant state, sending a confirmation unicast message to the target device;
and if the unicast response message returned by the target equipment is received, performing keep-alive online processing on the target equipment.
7. The method of claim 6, wherein the step of sending an acknowledge unicast message to the target device upon detecting that the target device has switched from a non-dormant state to a dormant state comprises:
and when the target equipment is detected to be switched from the non-dormant state to the dormant state, sending a confirmation unicast message to the target equipment in the heartbeat online detection process of the target equipment.
8. The method of claim 6, wherein the step of keep-alive online processing the target device if the unicast response message returned by the target device is received comprises:
and if the unicast response message returned by the target equipment is received within the preset time, determining that the target equipment has heartbeat, and carrying out keep-alive online processing on the target equipment.
9. The method of claim 8, wherein upon detecting that the target device switches from a non-dormant state to a dormant state, the step of sending an acknowledgment unicast message to the target device further comprises:
if the unicast response message returned by the target equipment is not received within the preset time, determining that the target equipment does not have heartbeat, and performing the time-out offline processing on the target equipment.
10. The method of claim 6, wherein the step of sending a wake-up unicast message to the target device in the sleep state in response to a wake-up instruction to the target device further comprises, prior to:
and setting a wake-up unicast type field and a confirm unicast type field in a self-discovery ad hoc protocol field of the target device, wherein the wake-up unicast type field is used for waking up the dormant target device, the confirm unicast type field is used for keeping the dormant target device alive, and the target device and the PC terminal are in the same local area network.
11. A method of preserving a living device, wherein the method is applied to a PC side, the method comprising:
when detecting that the target equipment is switched from a non-dormant state to a dormant state, sending a confirmation unicast message to the target equipment;
and if the unicast response message returned by the target equipment is received, performing keep-alive online processing on the target equipment.
12. The method of claim 11, wherein the step of sending an acknowledge unicast message to the target device upon detecting that the target device has switched from a non-dormant state to a dormant state comprises:
and when the target equipment is detected to be switched from the non-dormant state to the dormant state, sending a confirmation unicast message to the target equipment in the heartbeat online detection process of the target equipment.
13. The method of claim 11, wherein the step of performing keep-alive online processing on the target device if the unicast response message returned by the target device is received comprises:
and if the unicast response message returned by the target equipment is received within the preset time, determining that the target equipment has heartbeat, and carrying out keep-alive online processing on the target equipment.
14. The method of claim 13, wherein upon detecting that the target device switches from the non-dormant state to the dormant state, the step of sending an acknowledgment unicast message to the target device further comprises:
if the unicast response message returned by the target equipment is not received within the preset time, determining that the target equipment does not have heartbeat, and performing the time-out offline processing on the target equipment.
15. A method of waking up a device, the method being applied to a terminal device, the method comprising:
receiving a wake-up unicast message sent by a PC end in response to a wake-up instruction of the terminal equipment in a dormant state;
and returning a unicast response message to the PC side according to the awakening unicast message so as to ensure that the PC side determines that the terminal equipment is awakened successfully.
16. The method of claim 15, wherein the method further comprises:
and performing self-discovery ad hoc network with the PC terminal.
17. The method of claim 15, wherein the method further comprises:
receiving a confirmation unicast message sent by the PC side when the terminal equipment is switched from a non-dormant state to a dormant state;
And returning a unicast response message to the PC side according to the unicast confirmation message so as to enable the PC side to conduct keep-alive on-line processing on the terminal equipment.
18. A method of a keep-alive device, the method being applied to a terminal device, the method comprising:
receiving a confirmation unicast message sent by the PC side when the terminal equipment is switched from a non-dormant state to a dormant state;
and returning a unicast response message to the PC side according to the unicast confirmation message so as to enable the PC side to conduct keep-alive on-line processing on the terminal equipment.
19. An apparatus for waking up a device, comprising:
the wake-up unicast sending module is used for responding to a wake-up instruction of the target equipment in the dormant state and sending a wake-up unicast message to the target equipment;
and the receiving module is used for determining that the target equipment is awakened successfully if the unicast response message returned by the target equipment is received.
20. An apparatus for preserving a living device, comprising:
the device comprises a confirmation unicast sending module, a confirmation unicast sending module and a confirmation unicast sending module, wherein the confirmation unicast sending module is used for sending a confirmation unicast message to target equipment when detecting that the target equipment is switched from a non-dormant state to a dormant state;
And the processing module is used for carrying out keep-alive online processing on the target equipment if the unicast response message returned by the target equipment is received.
21. An apparatus for waking up a device, comprising:
the wake-up unicast receiving module is used for receiving a wake-up unicast message sent by the PC end in response to a wake-up instruction of the terminal equipment in a dormant state;
and the response module is used for returning a unicast response message to the PC side according to the awakening unicast message so as to ensure that the PC side determines that the terminal equipment is awakened successfully.
22. An apparatus for preserving a living device, comprising:
the confirmation unicast receiving module is used for receiving a confirmation unicast message sent by the PC side when the terminal equipment is switched from a non-dormant state to a dormant state;
and the response module is used for returning a unicast response message to the PC side according to the confirmation unicast message so as to enable the PC side to carry out keep-alive online processing on the terminal equipment.
23. An electronic device, comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions, which when executed by the electronic device, cause the electronic device to perform the method of waking the device of any of claims 1-10 or 15-17, or the method of the keep-alive device of any of claims 11-14 or 18.
24. A computer readable storage medium, having stored therein a computer program which, when executed by a processor, causes the processor to perform a method of waking a device as claimed in any one of claims 1 to 10 or 15-17, or a method of a keep-alive device as claimed in any one of claims 11 to 14 or 18.
CN202211176673.3A 2022-09-26 2022-09-26 Method and device for waking up and keeping alive device, electronic device and storage medium Pending CN116709476A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211176673.3A CN116709476A (en) 2022-09-26 2022-09-26 Method and device for waking up and keeping alive device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211176673.3A CN116709476A (en) 2022-09-26 2022-09-26 Method and device for waking up and keeping alive device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN116709476A true CN116709476A (en) 2023-09-05

Family

ID=87829972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211176673.3A Pending CN116709476A (en) 2022-09-26 2022-09-26 Method and device for waking up and keeping alive device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN116709476A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101257665A (en) * 2007-02-28 2008-09-03 株式会社日立制作所 Terminal control device and method
CN103888838A (en) * 2012-12-19 2014-06-25 联想(北京)有限公司 Data processing method and device, and electronic equipment
CN109788534A (en) * 2017-11-15 2019-05-21 珠海市魅族科技有限公司 Communication means and communication device, access point apparatus and site apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101257665A (en) * 2007-02-28 2008-09-03 株式会社日立制作所 Terminal control device and method
CN103888838A (en) * 2012-12-19 2014-06-25 联想(北京)有限公司 Data processing method and device, and electronic equipment
CN109788534A (en) * 2017-11-15 2019-05-21 珠海市魅族科技有限公司 Communication means and communication device, access point apparatus and site apparatus

Similar Documents

Publication Publication Date Title
US11683850B2 (en) Bluetooth reconnection method and related apparatus
US20220394454A1 (en) Data Processing Method, BLUETOOTH Module, Electronic Device, and Readable Storage Medium
CN111405681B (en) Wi-Fi Aware link establishment method, wi-Fi Aware link establishment system, electronic equipment and storage medium
US20220346010A1 (en) Data Sending/Receiving Method, Electronic Device, and Computer-Readable Storage Medium
WO2021052410A1 (en) Application management method and apparatus
US11843712B2 (en) Address book-based device discovery method, audio and video communication method, and electronic device
JP7459438B2 (en) Method for reducing power consumption of mobile terminals and mobile terminals
US20230351048A1 (en) Application Permission Management Method and Apparatus, and Electronic Device
AU2018456082B2 (en) Stylus detection method, system, and related device
US20220124607A1 (en) Method for Accessing Network by Smart Home Device and Related Device
US20220094748A1 (en) Connection establishment method and terminal device
WO2020155013A1 (en) Emergency calling method and user terminal
CN116709476A (en) Method and device for waking up and keeping alive device, electronic device and storage medium
CN116662024B (en) Inter-process communication monitoring method and device, electronic equipment and storage medium
WO2024012443A1 (en) Method and system for controlling power consumption of device, and electronic device
WO2024099212A1 (en) Spatial position determination method and system, and device therefor
WO2022268009A1 (en) Screen sharing method and related device
WO2023226881A1 (en) Device registration method and system, and device
CN117289807A (en) Communication method, communication system and mouse
WO2020029213A1 (en) Method for answering or rejecting call during srvcc handover
CN117098253A (en) Networking method and device
CN114258044A (en) Standby method, system and terminal equipment
CN116056190A (en) Method for managing terminal device, electronic device and computer readable storage medium
CN116367123A (en) Wi-Fi P2P-based data transmission method and electronic equipment
CN118033541A (en) Spatial position determining method, system and equipment thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination