Remote wake-up control method and device, electronic equipment and storage medium
By generating control messages through the extended protocol, the remote wake-up problem of the inability to independently control the composite USB device interface in the prior art is solved, and flexible control of each interface and reduced power consumption of the host device are achieved.
Patent Information
- Application Number
- CN202510517653.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-09-02
AI Technical Summary
The existing USB protocol cannot independently control the remote wake-up capability of the composite USB device interface, and cannot meet the precise control of the composite USB slave device.
Through the extended protocol generation control message, the USB wakes up or disables the host device from the target interface of the device, thereby achieving flexible control of each interface.
It realizes independent remote wake-up control of each interface of the composite USB device, reducing the power consumption of the host device.
Smart Images

Figure CN120583128A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a remote wake-up control method, device, electronic device, and storage medium. Background Art
[0002] Currently, host devices and USB slave devices (such as wireless communication modules) primarily communicate data and exchange commands over USB. The host device (also referred to as the host) controls the module's sleep and wakeup via the SUSPEND (suspend) and RESUME (resume a suspended process) signals specified in the USB protocol. When both the host device's USB and the wireless communication module's USB are in the SUSPEND state, if the wireless communication module has data to report to the host, the USB slave device must initiate a remote wakeup to wake the host, as per the USB specification.
[0003] The USB2.0 protocol specifies methods for enabling and disabling USB remote wakeup from a device: the host turns on remote wakeup from the USB device through SET_FEATURE(DEVICE_REMOTE_WAKEUP) and turns off remote wakeup from the USB device through CLEAR_FEATURE(DEVICE_REMOTE_WAKEUP).
[0004] Traditional USB devices are single-function devices, such as USB cameras, USB mass storage devices, USB mice and keyboards. However, with the development of wireless communication technology, USB composite devices are becoming increasingly popular. Current standard protocols cannot enable or disable the remote wakeup capability of a single interface on a composite USB slave device. For example, if the same USB slave device can simultaneously contain CDC-DATA (Communications Device Class - Data), mass storage devices, HID (Human Interface Device), AUDIO (Audio Device), and vendor-specific devices, the current USB 2.0 protocol is no longer able to provide more precise remote wakeup control. Summary of the Invention
[0005] The present application provides a remote wake-up control method, apparatus, electronic device and storage medium to solve the technical problem of how to independently control the remote wake-up of a composite USB device interface.
[0006] In a first aspect, the present application provides a remote wake-up control method, applied to a host device, the method comprising:
[0007] Obtaining a remote wake-up requirement; wherein the remote wake-up requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited from waking up the host device;
[0008] A control message is generated based on the extended protocol of remote wake-up and the remote wake-up requirement, and the control message is sent to the USB slave device to enable the USB slave device to wake up the host device through the target interface or prohibit the USB slave device from waking up the host device through the target interface.
[0009] Optionally, the method further includes:
[0010] Get the protocol specification of USB standard protocol;
[0011] The extended protocol for remote wakeup is configured based on the protocol specification.
[0012] Optionally, configuring the extended protocol for remote wakeup based on the protocol specification includes:
[0013] Configure the request type bit in the request type field to manufacturer defined;
[0014] Configure the recipient bit in the request type field to interface;
[0015] Configure the data transfer direction bits in the request type field to be from the host device to the USB slave device.
[0016] Optionally, when the remote wake-up requirement is to allow the target interface of the USB slave device to wake up the host device, generating a control message based on the extended protocol of remote wake-up and the remote wake-up requirement, and sending the control message to the USB slave device includes:
[0017] Configuring the interface identifier of the target interface in the interface index field based on the extended protocol of remote wake-up;
[0018] Based on the extended protocol, an enable flag is configured in the first request field to obtain the control message; wherein the enable flag is used to enable the remote wake-up function of the target interface of the interface index field;
[0019] The control message is sent to the USB slave device to allow the USB slave device to wake up the host device through the target interface and to prohibit waking up the host device through other interfaces of the USB slave device.
[0020] Optionally, when the remote wakeup requirement is to prohibit the target interface of the USB slave device from waking up the host device, generating a control message based on the extended protocol of remote wakeup and the remote wakeup requirement, and sending the control message to the USB slave device includes:
[0021] Configuring the interface identifier of the target interface in the interface index field based on the extended protocol of remote wake-up;
[0022] Based on the extended protocol, a clear flag is configured in the first request field to obtain the control message; wherein the clear flag is used to clear the remote wake-up function of the target interface in the interface index field;
[0023] The control message is sent to the USB slave device to prohibit the USB slave device from waking up the host device through the target interface and to allow the host device to be woken up through other interfaces of the USB slave device.
[0024] Optionally, before configuring the interface identifier of the target interface in the interface index field based on the extended protocol for remote wake-up, the method further includes:
[0025] A first control message is sent to the USB slave device based on a USB standard protocol; wherein the first control message is used to enable all interfaces of the USB slave device to allow remote waking of the host device.
[0026] In a second aspect, the present application provides a remote wake-up control method, which is applied to a USB slave device, and the method includes:
[0027] Obtaining a control message sent by the host device; wherein the control message is generated based on a remote wakeup requirement and an extended protocol for remote wakeup; the remote wakeup requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited from waking up the host device;
[0028] In the case that the USB slave device has a data reporting requirement, the host device is awakened through the target interface based on the control message, or the host device is prohibited from being awakened through the target interface.
[0029] In a third aspect, the present application provides a remote wake-up control device, applied to a host device, the device comprising:
[0030] A first acquisition module is configured to acquire a remote wake-up requirement, wherein the remote wake-up requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited from waking up the host device;
[0031] A sending module is used to generate a control message based on the extended protocol of remote wake-up and the remote wake-up requirement, and send the control message to the USB slave device to enable the USB slave device to wake up the host device through the target interface or prohibit the USB slave device from waking up the host device through the target interface.
[0032] In a fourth aspect, the present application provides a remote wake-up control device, which is applied to a USB slave device, and the device includes:
[0033] a second acquisition module, configured to acquire a control message sent by the host device; wherein the control message is generated based on a remote wakeup requirement and an extended protocol for remote wakeup; the remote wakeup requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited from waking up the host device;
[0034] The control module is used to wake up the host device through the target interface based on the control message or prohibit waking up the host device through the target interface when the USB slave device has a data reporting requirement.
[0035] In a fifth aspect, the present application provides an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0036] Memory for storing computer programs;
[0037] The processor is configured to implement the remote wake-up control method described in any one of the embodiments of the first aspect or the remote wake-up control method described in any one of the embodiments of the second aspect when executing the program stored in the memory.
[0038] In a sixth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the remote wake-up control method as described in any one of the embodiments of the first aspect or the remote wake-up control method as described in any one of the embodiments of the second aspect.
[0039] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application obtains a remote wake-up requirement; wherein, the remote wake-up requirement is used to indicate that the target interface of the USB slave device is allowed to wake up the host device or that the target interface of the USB slave device is prohibited from waking up the host device; a control message is generated based on the extended protocol of remote wake-up and the remote wake-up requirement, and the control message is sent to the USB slave device, so that the USB slave device wakes up the host device through the target interface or prohibits the USB slave device from waking up the host device through the target interface. This method can generate a control message based on the extended protocol of remote wake-up and the remote wake-up requirement, and send the control message to the USB slave device, so that the USB slave device wakes up the host device through the target interface or prohibits the USB slave device from waking up the host device through the target interface, thereby realizing independent control of remote wake-up of each interface and also reducing the power consumption of the host. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0042] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0043] Figure 1 A system architecture diagram of a remote wake-up control method provided in one embodiment of the present application;
[0044] Figure 2 A flowchart of a remote wake-up control method provided in one embodiment of the present application;
[0045] Figure 3 A flowchart of a remote wake-up control method provided in another embodiment of the present application;
[0046] Figure 4 A flowchart of a remote wake-up control method provided in another embodiment of the present application;
[0047] Figure 5 A flowchart of a remote wake-up control method provided in another embodiment of the present application;
[0048] Figure 6 A flowchart of a remote wake-up control method provided in another embodiment of the present application;
[0049] Figure 7 A flowchart of a remote wake-up control method provided in another embodiment of the present application;
[0050] Figure 8 A schematic diagram of the structure of a remote wake-up control device provided in one embodiment of the present application;
[0051] Figure 9 A schematic structural diagram of a remote wake-up control device provided in another embodiment of the present application;
[0052] Figure 10 A schematic structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0053] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0054] The disclosure below provides many different embodiments or examples for implementing different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, these are merely examples and are not intended to limit the present application. In addition, the present application may repeat reference numbers and / or letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate the relationship between the various embodiments and / or settings discussed.
[0055] In order to solve the technical problem of how to independently control the remote wake-up of a composite USB device interface in the prior art, the present application provides a remote wake-up control method, device, electronic device and storage medium, which can realize the remote wake-up of each interface of the composite USB device independently controlled, while also reducing the power consumption of the host.
[0056] The first embodiment of the present application provides a remote wake-up control method, which can be applied to Figure 1 The system architecture shown includes at least a host device 101 and a USB slave device 102, which establish a communication connection between the host device 101 and the USB slave device 102. The method can be applied to the host device 101 or the USB slave device 102 in the system architecture, wherein the USB slave device 102 can be a wireless communication module.
[0057] Next, based on the system architecture, the remote wake-up control method is described in detail. When applied to a host device, such as Figure 2 , the remote wake-up control method includes:
[0058] Step 201 , obtaining a remote wake-up requirement; wherein the remote wake-up requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited to wake up the host device.
[0059] The remote wakeup requirement indicates the remote wakeup capability that the user wants the USB slave device to have. For example, the user only wants the audio interface in the wireless communication module to have remote wakeup capability, and other interfaces such as mass storage and HID cannot actively wake up the host. In this case, the remote wakeup requirement is: only the audio interface has remote wakeup function.
[0060] Step 202: Generate a control message based on the remote wakeup extension protocol and the remote wakeup requirement, and send the control message to the USB slave device to enable the USB slave device to wake up the host device through the target interface or prohibit the USB slave device from waking up the host device through the target interface.
[0061] The method can generate a control message according to the extended protocol of remote wake-up and the remote wake-up requirement, and send the control message to the USB slave device, so that the USB slave device wakes up the host device through the target interface or prohibits the USB slave device from waking up the host device through the target interface, thereby realizing independent control of the remote wake-up of each interface and reducing the power consumption of the host.
[0062] The extended protocol for remote wakeup can be pre-configured, so that when a remote wakeup request is obtained, a control message is directly generated based on the pre-configured extended protocol for remote wakeup, thereby improving the response speed. Of course, it can also be configured when there is a remote wakeup request, without restriction.
[0063] In one embodiment, the remote wakeup control method further includes: obtaining a protocol specification of a USB standard protocol; and configuring an extended protocol for remote wakeup based on the protocol specification.
[0064] In this embodiment, the extended protocol may be configured based on the protocol specification of the USB standard protocol, so that the customized extended protocol complies with the protocol specification of the USB standard protocol.
[0065] For example, the existing remote wakeup control protocols of the USB 2.0 protocol are as follows:
[0066] Table 1
[0067]
[0068] The USB control request message consists of the bmRequestType (request type), bRequest (request), wValue (value), wIndex (interface index), wLength (length), and Data (data) fields. When the bmRequestType field is 0x00 (00000000B) and the bRequest field is 0x03 (SET_FEATURE), it indicates that all interfaces of the USB slave device have remote wake-up capability. When the bmRequestType field is 0x40 (01000000B) and the bRequest field is 0x01 (CLEAR_FEATURE), it indicates that the remote wake-up capability of all interfaces of the USB slave device has been cleared.
[0069] In one embodiment, an extended protocol for remote wake-up is configured based on a protocol specification, including: configuring the request type bit in the request type field to be manufacturer-defined; configuring the receiver bit in the request type field to be an interface; and configuring the data transmission direction bit in the request type field to be from a host device to a USB slave device.
[0070] In this embodiment, when configuring the extended protocol, the request type configuration bit [D6:D5] in the bmRequestType field is configured to 2, indicating that it is customized by the vendor, the receiver bit [D4:D0] is configured to 1, indicating the interface, and the data transmission direction bit is configured to 0, indicating from the host device to the USB slave device (Host-to-device), so that the extended protocol complies with the protocol specifications of the standard protocol. When generating a control message based on the extended protocol, the corresponding interface index field can be configured with the interface identifier of the target interface, so that the USB slave device can wake up the host device through the target interface or prohibit the USB slave device from waking up the host device through the target interface.
[0071] In one embodiment, when the remote wake-up requirement is to allow the target interface of the USB slave device to wake up the host device, a control message is generated based on the remote wake-up extended protocol and the remote wake-up requirement, and the control message is sent to the USB slave device, including: configuring the interface identifier of the target interface in the interface index field based on the remote wake-up extended protocol; configuring the enable identifier in the first request field based on the extended protocol to obtain the control message; wherein the enable identifier is used to enable the remote wake-up function of the target interface of the interface index field; sending the control message to the USB slave device to allow the USB slave device to wake up the host device through the target interface, and prohibiting the host device from being woken up through other interfaces of the USB slave device.
[0072] In this embodiment, when the remote wake-up requirement is to allow the target interface of the USB slave device (also referred to as the USB slave) to wake up the host device, the remote wake-up control method is as follows: Figure 3 In the USB bus wake-up state, enable the USB slave interface N to initiate remote wake-up, configure the interface identifier of the target interface in the interface index field based on the extended protocol, such as configuring interface N in the wIndex field, and configuring 0x41 in the bmRequestType field. Configure the enable identifier in the first request field based on the extended protocol, such as configuring bRequest to 0x03, obtain a control message, and send the control message to the USB slave device. For example, the host sends a control message to the slave EP0, wherein bmRequestType=0x41, bRequest=0x03, wValue=0x01, wIndex=N, wLength=0x00, and other fields such as Data are 0x00, so as to allow the USB slave device to wake up the host device through the target interface, and prohibit waking up the host device through other interfaces of the USB slave device. At this time, only interface N of the USB slave device has the remote wake-up function.
[0073] In one embodiment, when the remote wake-up requirement is to prohibit the target interface of the USB slave device from waking up the host device, a control message is generated based on the remote wake-up extended protocol and the remote wake-up requirement, and the control message is sent to the USB slave device, including: configuring the interface identifier of the target interface in the interface index field based on the remote wake-up extended protocol; configuring a clear flag in the first request field based on the extended protocol to obtain a control message; wherein the clear flag is used to clear the remote wake-up function of the target interface of the interface index field; sending the control message to the USB slave device to prohibit the USB slave device from waking up the host device through the target interface, and to allow the host device to be woken up through other interfaces of the USB slave device.
[0074] In this embodiment, when the remote wake-up requirement is to prohibit the target interface of the USB slave device from waking up the host device, the remote wake-up control method is as follows: Figure 4In the USB bus wake-up state, clear the USB slave interface N to initiate remote wake-up, configure the interface identifier of the target interface in the interface index field based on the extended protocol, such as configuring interface N in the wIndex field, and configuring 0x41 in the bmRequestType field. Configure the clear flag in the first request field based on the extended protocol, such as configuring bRequest to 0x01, obtain the control message, and send the control message to the USB slave device. For example, the host sends a control message to the slave EP0, where bmRequestType=0x41, bRequest=0x01, wValue=0x01, wIndex=N, wLength=0x00, and other fields such as Data are 0x00, so as to prohibit the USB slave device from waking up the host device through the target interface and allow the host device to be woken up through other interfaces of the USB slave device. At this time, only interface N of the USB slave device does not have the remote wake-up function, and other interfaces can be remotely woken up.
[0075] In one embodiment, before configuring the interface identifier of the target interface in the interface index field based on the extended protocol for remote wake-up, the method also includes: sending a first control message to the USB slave device based on the USB standard protocol; wherein the first control message is used to enable all interfaces of the USB slave device to allow remote wake-up of the host device.
[0076] In this embodiment, since the extended protocol is the control of the interface and the USB2.0 standard protocol is the control of the device (i.e., the USB2.0 standard protocol controls all nodes of the USB slave device at the same time, and the extended protocol controls a certain interface of the USB slave device), the extended protocol can be used in addition to being used independently or in conjunction with the standard protocol. When the extended protocol and the standard protocol are used in combination, the remote wake-up control method is as follows: Figure 5In the USB bus wake-up state, the USB standard protocol is used to enable remote wake-up of the USB slave. For example, the host sends a control message to the slave EP0, where bmRequestType = 0x00, bRequest = 0x03, wValue = 0x01, wIndex = 0x00, wLength = 0x00, and other fields such as Data are 0x00. At this time, all interfaces of the USB slave have the remote wake-up capability. At this time, the ability of the USB slave interface N to initiate remote wake-up is cleared, and the interface identifier of the target interface is configured in the interface index field based on the extended protocol, such as configuring interface N in the wIndex field, and in the bmRequestType field. Configure 0x41 and configure the clear flag in the first request field based on the extended protocol. For example, configure bRequest to 0x01, that is, the host needs to send the following control message to the slave EP0: bmRequestType = 0x41, bRequest = 0x01, wValue = 0x01, wIndex = N, wLength = 0x00, and other fields such as Data are 0x00. The control message is sent to the USB slave device to prohibit the USB slave device from waking up the host device through the target interface, and to allow the host device to be woken up through other interfaces of the USB slave device. At this time, only interface N of the USB slave device does not have the remote wake-up function, and other interfaces can be remotely woken up.
[0077] In the above-mentioned embodiments of the present application, the USB 2.0 protocol cannot independently control the remote wakeup of each interface of the USB slave device. By extending the protocol, the remote wakeup of each interface can be independently controlled, achieving more flexible control and thus lowering the power consumption of the entire device. Moreover, the independent control of the remote wakeup of the USB slave device proposed in this application is fully compatible with the standard USB protocol, and can serve as a complement to each other.
[0078] When applied to USB slave devices, such as Figure 6 , the remote wake-up control method includes:
[0079] Step 601, obtain a control message sent by the host device; wherein the control message is generated based on a remote wakeup requirement and an extended protocol for remote wakeup; the remote wakeup requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited from waking up the host device.
[0080] Step 602 : When the USB slave device has a data reporting requirement, the host device is awakened via the target interface based on a control message, or the host device is prohibited from being awakened via the target interface.
[0081] With this method, a USB slave device can obtain a control message generated by a host device based on a remote wake-up requirement and an extended protocol for remote wake-up. Thus, when the USB slave device has a data reporting requirement, the host device is awakened through a target interface based on the control message, or awakening the host device through the target interface is prohibited. This achieves independent control of remote wake-up of each interface of the USB slave device and can also reduce the power consumption of the host caused by frequent wake-up of the slave device.
[0082] In one embodiment, when the USB slave has only interface N but no remote wake-up function, the remote wake-up control method for the USB slave to wake up the host is as follows: Figure 7 In the USB bus sleep state, when the USB slave has data to report to the host, it can first determine whether it is the data of interface N. If it is the data of interface N, the USB slave does not initiate remote wake-up. If it is not the data of interface N, the USB slave can initiate USB remote wake-up.
[0083] Based on the same technical concept, the second embodiment of the present application provides a remote wake-up control device, which, when applied to a host device, Figure 8 , the device comprises:
[0084] The first acquisition module 801 is used to obtain a remote wake-up requirement; wherein the remote wake-up requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited from waking up the host device;
[0085] The sending module 802 is used to generate a control message based on the extended protocol of remote wake-up and the remote wake-up requirement, and send the control message to the USB slave device to enable the USB slave device to wake up the host device through the target interface or prohibit the USB slave device from waking up the host device through the target interface.
[0086] The device can generate a control message according to the extended protocol of remote wake-up and the remote wake-up requirement, and send the control message to the USB slave device, so that the USB slave device wakes up the host device through the target interface or prohibits the USB slave device from waking up the host device through the target interface, thereby realizing independent control of the remote wake-up of each interface and reducing the power consumption of the host.
[0087] When applied to USB slave devices, such as Figure 9 , the device comprises:
[0088] A second acquisition module 901 is configured to acquire a control message sent by a host device; wherein the control message is generated based on a remote wakeup requirement and an extended protocol for remote wakeup; the remote wakeup requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited from waking up the host device;
[0089] The control module 902 is configured to, when the USB slave device has a data reporting requirement, wake up the host device through the target interface based on the control message or prohibit waking up the host device through the target interface.
[0090] With this device, a USB slave device can obtain control messages generated by a host device based on remote wake-up requirements and an extended protocol for remote wake-up. Thus, when the USB slave device has a data reporting requirement, the host device can be woken up through a target interface based on the control message or be prohibited from waking up the host device through the target interface, thereby independently controlling the remote wake-up of each interface of the USB slave device and reducing the power consumption of the host caused by frequent wake-up of the slave device.
[0091] like Figure 10 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0092] Memory 113, for storing computer programs;
[0093] In one embodiment of the present application, the processor 111 is configured to implement the remote wake-up control method provided by any one of the aforementioned method embodiments when executing a program stored in the memory 113 .
[0094] The communication bus mentioned in the terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0095] The communication interface is used for communication between the above terminal and other devices.
[0096] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0097] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0098] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the remote wake-up control method provided by any of the aforementioned method embodiments is implemented.
[0099] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0100] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiment.
[0101] It should be understood that the terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "comprise", "include", "contain" and "have" are inclusive and therefore specify the presence of stated features, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be performed in the specific order described or illustrated, unless the order of execution is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0102] It should be understood that the specific embodiments described herein are intended only to illustrate the present application and are not intended to limit the present application. In the description, suffixes such as "module," "component," or "unit" used to represent elements are used solely to facilitate the description of the present application and have no specific meaning. Therefore, "module," "component," or "unit" may be used interchangeably.
[0103] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.
Claims
1. A remote wake-up control method, characterized in that: Applied to a host device, the method includes: Obtaining a remote wake-up requirement; wherein the remote wake-up requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited from waking up the host device; A control message is generated based on the extended protocol of remote wake-up and the remote wake-up requirement, and the control message is sent to the USB slave device to enable the USB slave device to wake up the host device through the target interface or prohibit the USB slave device from waking up the host device through the target interface.
2. The method according to claim 1, characterized in that The method further comprises: Get the protocol specification of USB standard protocol; The extended protocol for remote wakeup is configured based on the protocol specification.
3. The method according to claim 2, characterized in that Configuring the extended protocol for remote wakeup based on the protocol specification includes: Configure the request type bit in the request type field to manufacturer defined; Configure the recipient bit in the request type field to interface; Configure the data transfer direction bits in the request type field to be from the host device to the USB slave device.
4. The method according to claim 1, wherein When the remote wakeup requirement is to allow the target interface of the USB slave device to wake up the host device, generating a control message based on the extended protocol of remote wakeup and the remote wakeup requirement, and sending the control message to the USB slave device, including: Configuring the interface identifier of the target interface in the interface index field based on the extended protocol of remote wake-up; Based on the extended protocol, an enable flag is configured in the first request field to obtain the control message; wherein the enable flag is used to enable the remote wake-up function of the target interface of the interface index field; The control message is sent to the USB slave device to allow the USB slave device to wake up the host device through the target interface and to prohibit waking up the host device through other interfaces of the USB slave device.
5. The method according to claim 1, characterized in that When the remote wakeup requirement is to prohibit the target interface of the USB slave device from waking up the host device, generating a control message based on the extended protocol of remote wakeup and the remote wakeup requirement, and sending the control message to the USB slave device, including: Configuring the interface identifier of the target interface in the interface index field based on the extended protocol of remote wake-up; Based on the extended protocol, a clear flag is configured in the first request field to obtain the control message; wherein the clear flag is used to clear the remote wake-up function of the target interface in the interface index field; The control message is sent to the USB slave device to prohibit the USB slave device from waking up the host device through the target interface and to allow the host device to be woken up through other interfaces of the USB slave device.
6. The method according to claim 5, characterized in that Before configuring the interface identifier of the target interface in the interface index field based on the extended protocol for remote wake-up, the method further includes: A first control message is sent to the USB slave device based on a USB standard protocol; wherein the first control message is used to enable all interfaces of the USB slave device to allow remote waking up of the host device.
7. A remote wake-up control method, characterized in that: Applied to a USB slave device, the method includes: Obtaining a control message sent by the host device; wherein the control message is generated based on a remote wakeup requirement and an extended protocol for remote wakeup; the remote wakeup requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited from waking up the host device; In the case that the USB slave device has a data reporting requirement, the host device is awakened through the target interface based on the control message, or the host device is prohibited from being awakened through the target interface.
8. A remote wake-up control device, characterized in that: Applied to a host device, the apparatus comprises: A first acquisition module is configured to acquire a remote wake-up requirement, wherein the remote wake-up requirement is used to indicate whether the target interface of the USB slave device is allowed to wake up the host device or whether the target interface of the USB slave device is prohibited from waking up the host device; A sending module is used to generate a control message based on the extended protocol of remote wake-up and the remote wake-up requirement, and send the control message to the USB slave device to enable the USB slave device to wake up the host device through the target interface or prohibit the USB slave device from waking up the host device through the target interface.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; The processor is configured to implement the remote wake-up control method according to any one of claims 1 to 6 or the remote wake-up control method according to claim 7 when executing the program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the remote wake-up control method according to any one of claims 1 to 6 or the remote wake-up control method according to claim 7 is implemented.