Usb configuration method and apparatus, electronic device, storage medium, and program product

By transmitting execution completion notifications and creation completion notifications across multiple mobile terminals, the configuration issues caused by disconnection during USB initialization are resolved, enabling synchronized activation of USB device descriptors and improving efficiency.

CN115658154BActive Publication Date: 2026-07-21PRANUS BEIJING TECH CO LTD
2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PRANUS BEIJING TECH CO LTD
Filing Date
2022-09-21
Publication Date
2026-07-21

Smart Images

  • Figure CN115658154B_ABST
    Figure CN115658154B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a USB configuration method and device, electronic equipment, storage medium and program product, and relate to the technical field of computers. The method comprises: an active system in a plurality of container systems receiving an execution completion notification sent by a container manager and at least one inactive system respectively, and then the active system responding to the execution completion notification, performing a debugging operation, and creating a first USB device descriptor; and the active system sending a creation completion notification for the first USB device descriptor to the container manager and the at least one inactive system respectively, so that the first USB device descriptor and a second USB device descriptor are executed simultaneously. The USB configuration method provided by the present application can make the USB descriptors of a plurality of systems take effect simultaneously, thereby realizing the normal configuration of USB in a multi-system scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a USB configuration method, apparatus, electronic device, storage medium, and computer program product. Background Technology

[0002] With the widespread adoption of smart mobile devices, connecting and performing related operations between mobile devices has become commonplace. When connecting mobile devices, it is often necessary to configure the USB (Universal Serial Bus). For example, when connecting a PC (Personal Computer) to a mobile device such as a mobile phone, the mobile phone's USB port needs to be configured.

[0003] When a mobile terminal runs at least two operating systems, such as when a mobile phone connected to a PC runs multiple systems, the USB descriptors created by different systems cannot be executed simultaneously. This can easily lead to a situation where one system has just completed USB initialization when another system sends a disconnect message, triggering a disconnect operation, which results in the USB failing to configure properly. Summary of the Invention

[0004] This application aims to solve the problem that in a multi-system setup, if one system has just completed USB initialization while another system sends a disconnect message triggering a disconnection operation, causing the USB to become unconfigurable, the technical solution is as follows:

[0005] In a first aspect, this application provides a USB configuration method, which is applied to an active system in multiple container systems, including:

[0006] Receive execution completion notifications from the container manager and at least one inactive system respectively; wherein, the execution completion notification is a completion notification for the debugging operation executed based on the USB event sent by the container manager and the at least one inactive system respectively based on the underlying driver;

[0007] In response to the execution completion notification, after performing the debugging operation, a first USB device descriptor is created;

[0008] A creation completion notification for the first USB device descriptor is sent to the container manager and the at least one inactive system, respectively; the creation completion notification is used to enable the second USB device descriptor and the first USB device descriptor created by the container manager and the at least one inactive system to be executed simultaneously.

[0009] In an alternative embodiment of the first aspect, the container manager and the at least one inactive system are further configured to change the creation status of the second USB device descriptor upon completion of the creation of the second USB device descriptor;

[0010] The method further includes:

[0011] Obtain the creation status of the container manager and the at least one inactive system for the second USB device descriptor, respectively;

[0012] The creation completion notification is used to enable the container manager and the at least one inactive system to execute the second USB device descriptor and the first USB device descriptor simultaneously when the obtained creation status is "created".

[0013] Secondly, this application provides a USB configuration method applicable to any inactive system within a container manager or multiple container systems, comprising:

[0014] The system receives USB events sent by the underlying driver, performs debugging operations, and sends execution completion notifications to active systems in multiple container systems. The execution completion notification is used to enable the active system to perform debugging operations and then create a first USB device descriptor.

[0015] Create a second USB device descriptor;

[0016] Receive the creation completion notification sent by the activity system;

[0017] In response to the creation completion notification, the first USB device descriptor and the second USB device descriptor are executed simultaneously with the active system.

[0018] In an alternative embodiment of the second aspect, the method further includes:

[0019] Change the creation status for the second USB device descriptor;

[0020] The step of simultaneously executing the first USB device descriptor and the second USB device descriptor in response to the creation completion notification and the activity system includes:

[0021] If the creation status of the second USB device descriptor is "created", then in response to the creation completion notification, the first USB device descriptor and the second USB device descriptor are executed simultaneously with the active system.

[0022] Thirdly, this application provides a USB configuration method, which includes:

[0023] The underlying driver detects a USB event and sends the USB event to the container manager and multiple container systems respectively;

[0024] In response to the USB event, the container manager and at least one inactive system in the plurality of container systems respectively perform debugging operations and send execution completion notifications to the active system in the plurality of container systems respectively.

[0025] The container manager and the at least one inactive system create a second USB device descriptor;

[0026] In response to the execution completion notification, the active system performs debugging operations and creates a first USB device descriptor;

[0027] The active system sends a creation completion notification for the first USB device descriptor to the container manager and the at least one inactive system, respectively.

[0028] In response to the creation completion notification, the container manager and the at least one inactive system simultaneously execute the first USB device descriptor and the second USB device descriptor, respectively, along with the active system.

[0029] Fourthly, a USB configuration device is provided, the device comprising:

[0030] A receiving module is configured to receive execution completion notifications sent by the container manager and at least one inactive system, respectively; wherein, the execution completion notification is a completion notification for the debugging operation executed based on the USB event sent by the container manager and the at least one inactive system based on the underlying driver.

[0031] In response to the execution completion notification, the processing module performs a debugging operation and then creates a first USB device descriptor.

[0032] The notification module is configured to send creation completion notifications for the first USB device descriptor to the container manager and the at least one inactive system, respectively; the creation completion notifications are configured to cause the second USB device descriptor and the first USB device descriptor created by the container manager and the at least one inactive system to be executed simultaneously.

[0033] Fifthly, a USB configuration device is provided, the device comprising:

[0034] The processing module receives USB events sent by the underlying driver, performs debugging operations, and sends execution completion notifications to active systems in multiple container systems; the execution completion notification is used to enable the active system to perform debugging operations and create a first USB device descriptor.

[0035] Create a module to create a second USB device descriptor;

[0036] The receiving module receives the creation completion notification sent by the activity system;

[0037] The execution module, in response to the creation completion notification, executes the first USB device descriptor and the second USB device descriptor simultaneously with the activity system.

[0038] In a sixth aspect, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the USB configuration method shown in any one of the first, second, or third aspects of this application.

[0039] In a seventh aspect, a computer-readable storage medium is provided having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the USB configuration method shown in any one of the first, second, or third aspects of this application.

[0040] Eighthly, a computer program product is provided, comprising a computer program, characterized in that, when the computer program is executed by a processor, it implements the USB configuration method shown in any one of the first, second, or third aspects of this application.

[0041] The beneficial effects of the technical solutions provided in this application are:

[0042] The USB configuration method provided in this application overcomes the problem of multiple systems not being able to synchronize their debugging operations and USB device descriptors by having multiple systems perform debugging operations and create USB device descriptors on their own systems, and by transmitting execution completion notifications and creation completion notifications between multiple systems. This enables the USB device descriptors of multiple systems to take effect simultaneously, thereby achieving normal USB configuration in multi-system scenarios.

[0043] Furthermore, when the active system receives the execution completion notification and begins to perform debugging operations, the container manager and at least one inactive system can simultaneously create their own second USB device descriptors. They can complete the creation of their own second USB device descriptors before receiving the creation completion instruction of the first USB device descriptor, so that the first USB device descriptor and the second USB device descriptor can be executed simultaneously as early as possible, thereby improving the efficiency of USB configuration. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.

[0045] Figure 1 This is a schematic diagram illustrating an application scenario of a USB configuration method provided in an embodiment of this application;

[0046] Figure 2 A flowchart illustrating a USB configuration method applied to multiple container systems, provided as an embodiment of this application;

[0047] Figure 3 A flowchart illustrating a USB configuration method applied to any inactive system in a container manager or multiple container systems, provided as an embodiment of this application;

[0048] Figure 4 A flowchart illustrating a USB configuration method provided in an embodiment of this application;

[0049] Figure 5 A timing diagram of a USB configuration method provided in an embodiment of this application;

[0050] Figure 6 This application provides a schematic diagram of the structure of a USB configuration device applied to multiple container systems.

[0051] Figure 7 A schematic diagram of the structure of a USB configuration device applied to any inactive system in a container manager or multiple container systems, provided for an embodiment of this application;

[0052] Figure 8 This is a schematic diagram of the structure of an electronic device to which a USB configuration method is applicable, as provided in an embodiment of this application. Detailed Implementation

[0053] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.

[0054] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, and component, but do not exclude implementation as other features, information, data, steps, operations, components, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the element can be directly connected or coupled to the other element, or it can mean that the element and the other element are connected through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.”

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0056] First, we will introduce and explain several terms involved in this application.

[0057] USB is an external bus standard that can be used to standardize the connection and communication between computers and external devices.

[0058] Multi-system refers to a physical device, such as a mobile terminal, running multiple operating systems. Currently, Linux container technology is commonly used to achieve this functionality, loading an independent operating system into each container, allowing multiple operating systems to run on the same physical device. A multi-system implementation based on container technology typically includes a container manager and multiple operating systems. The operating system can be a mobile terminal operating system such as Android, and the physical device can include a mobile terminal. The operating system is also called a container system, and can be simply referred to as the system without ambiguity. The implementation of a container manager is quite flexible; it can be based on the Linux kernel or a middleware layer built on top of the kernel. The container manager is used to manage the container system, such as creating or destroying container systems, monitoring the execution of container systems, and setting permissions for container system users.

[0059] Container operating systems (Container OS) typically involve completely removing unnecessary components and services from a traditional operating system, ensuring only the necessary user functions function correctly. On the same physical device, only one of the multiple container systems is active, in the foreground and available, while the others are inactive, in the background and unavailable.

[0060] In view of at least one of the above-mentioned technical problems or areas requiring improvement in the related technologies, this application proposes a USB configuration method, apparatus, electronic device, storage medium, and computer program product. This solution overcomes the problem that multiple systems cannot operate synchronously when they each perform debugging operations and create their own USB device descriptors, by enabling multiple systems to perform debugging operations and create their own USB device descriptors in their respective systems and transmitting notifications between the multiple systems. This allows the USB device descriptors of multiple systems to be effective simultaneously, thereby realizing normal USB configuration in multi-system scenarios.

[0061] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.

[0062] Figure 1 This is a schematic diagram illustrating an application scenario of the USB configuration method provided in this application embodiment. The application environment may include a mobile terminal 101 and a computer terminal 102 carrying multiple systems, connected via a USB cable. The mobile terminal 101 includes multiple container systems and a container manager.

[0063] Specifically, the mobile terminal 101, through the aforementioned USB configuration method, includes: the underlying driver of the physical device detects a USB event and sends it to the container manager and multiple container systems respectively; in response to the USB event, at least one inactive system among the container manager and multiple container systems performs debugging operations and sends an execution completion notification to the active system respectively; then, the container manager and at least one inactive system create a second USB device descriptor; in response to the execution completion notification, the active system performs debugging operations and creates a first USB device descriptor; the active system sends a creation completion notification for the first USB device descriptor; in response to the creation completion notification, the container manager and at least one inactive system simultaneously execute the first USB device descriptor and the second USB device descriptor with the active system respectively to perform USB configuration. The device descriptors of each system take effect synchronously, configuring the USB function, thereby enabling the multiple systems on the mobile terminal 101 and the computer terminal 102 to achieve USB functionality.

[0064] In the above application scenario, the mobile terminal 101 is connected to the computer terminal 102 to configure the USB connection. The above application scenario is just an example and does not limit the application scenario of the USB configuration method of this application.

[0065] In some possible implementations, taking an active system in a multi-container system as an example, embodiments of this application provide a USB configuration method, such as... Figure 2 As shown, it may include the following steps:

[0066] S201, Receive execution completion notifications from the container manager and at least one inactive system respectively.

[0067] The active system can be any one of multiple container systems, while the inactive system can be any system other than the active system.

[0068] The execution completion notification is a completion notification for debugging operations sent by the container manager and the at least one inactive system based on the underlying driver's USB event.

[0069] Specifically, a USB event can be a connection event between a computer and a mobile phone.

[0070] Specifically, the underlying driver detects a USB event and sends it to the container manager and multiple container systems. Then, after receiving the USB event, the container manager and at least one inactive system in the multiple container systems start to perform debugging operations and generate an execution completion notification when the operation is completed.

[0071] In practice, the container manager and at least one inactive system create a second USB device descriptor after sending an execution completion notification.

[0072] Specifically, the trigger condition for creating the second USB device descriptor can be sending an execution completion notification. This way, when the active system receives the execution completion notification and begins debugging, the container manager and at least one inactive system can each synchronously create their second USB device descriptor. This ensures that the creation of the second USB device descriptor is completed before receiving the creation completion instruction for the first USB device descriptor, thus guaranteeing that the first and second USB device descriptors execute simultaneously and improving configuration efficiency.

[0073] S202, in response to the execution completion notification, after performing the debugging operation, a first USB device descriptor is created.

[0074] For example, debugging operations may include ADB (Android Debug Bridge), a tool in the Android development kit that allows direct management of Android emulators or real Android devices. ADB is a client-server program; the client is typically an external computer or other device, and the server is the mobile device running Android. Android's USB-related parameters include sys.usb.configfs, sys.usb.ffs.ready, and sys.usb.ffs.mtp.ready. For instance, setting sys.usb.ffs.ready instructs init to call the rc script to configure USB.

[0075] S203, a creation completion notification for the first USB device descriptor is sent to the container manager and the at least one inactive system, respectively.

[0076] The creation completion notification is used to enable the simultaneous execution of the second USB device descriptor and the first USB device descriptor created by the container manager and the at least one inactive system, respectively.

[0077] Specifically, after the container manager and at least one inactive system complete their respective debugging operations and send execution completion notifications, they each create a second USB device descriptor. When the active system sends a creation completion notification to both the container manager and at least one inactive system, upon receiving the notification, the active system, the inactive system, and the container manager simultaneously execute their respective USB device descriptors; that is, the active system executes the first USB device descriptor, and the container manager and at least one inactive system execute the second USB device descriptor.

[0078] In the above embodiments, after the container manager and at least one inactive system complete the debugging operation, they send an execution completion notification to the active system and simultaneously create a second USB device descriptor. When the active system receives the execution completion notifications from the container manager and at least one inactive system, it performs the debugging operation, then creates the first USB device descriptor, and then sends creation completion notifications for the first USB device descriptor to the container manager and at least one inactive system, enabling the USB device descriptors of multiple systems to take effect simultaneously, thereby realizing USB configuration in a multi-system scenario.

[0079] In some possible implementations, the container manager and at least one inactive system are also used to change the creation status of the second USB device descriptor when the creation of the second USB device descriptor is complete.

[0080] The above methods also include:

[0081] (1) Obtain the creation status of the container manager and at least one inactive system for the second USB device descriptor, respectively;

[0082] (2) The creation completion notification is used to enable the container manager and at least one inactive system to execute the second USB device descriptor and the first USB device descriptor simultaneously when the obtained creation status is "created".

[0083] Specifically, when the container manager and at least one inactive system complete the creation of the second USB device descriptor, the creation status of the second USB device descriptor is changed to "created". After the active system completes the creation of the first USB device descriptor, the creation status of the second USB device descriptor for the container manager and at least one inactive system is obtained respectively. If both are "created", the second USB device descriptor and the first USB device descriptor are executed simultaneously. If at least one is in an "uncreated" state, the USB device descriptor is not executed, and the first USB device descriptor and the second USB device descriptor are executed simultaneously after both are in a "created" state.

[0084] In the specific implementation process, the creation status can be represented by preset characters. For example, "0" can be set as the uncreated status, and "1" can be set as the created status.

[0085] The above embodiments describe the USB configuration method of this application from the perspective of the execution subject being the active system. The following describes the USB configuration method from the perspective of the execution subject being the container manager or any inactive system in multiple container systems.

[0086] In some possible implementations, taking the execution entity as a container manager or any inactive system among multiple container systems as an example, embodiments of this application provide a USB configuration method, such as... Figure 3 As shown, it may include the following steps:

[0087] S301 receives USB events sent by the underlying driver, performs debugging operations, and sends execution completion notifications to the active system in multiple container systems.

[0088] The active system can be any one of multiple container systems, while the inactive system can be any system other than the active system.

[0089] The execution completion notification is used to enable the active system to perform debugging operations and then create a first USB device descriptor.

[0090] The underlying driver of the physical device receives the USB event and sends it to the container manager, the active system, and at least one inactive system. The USB message can include the insertion and removal of the USB device.

[0091] S302, Create a second USB device descriptor.

[0092] The second USB device descriptor can be created by the container manager or any inactive system.

[0093] Specifically, the container manager or any inactive system creates a second USB descriptor after completing the debugging operation and sending a completion notification.

[0094] Specifically, the trigger condition for creating the second USB device descriptor can be sending an execution completion notification. This way, when the active system receives the execution completion notification and begins debugging, the container manager and at least one inactive system can each synchronously create their second USB device descriptor. This ensures that the second USB device descriptor is created before the first USB device descriptor's creation completion instruction is received, guaranteeing that both the first and second USB device descriptors execute simultaneously and improving configuration efficiency.

[0095] S303, Receive the creation completion notification sent by the activity system.

[0096] The "completion notification" indicates that the active system has completed the debugging operation and the creation of the first USB device descriptor.

[0097] Specifically, when the container manager or any inactive system receives a creation completion notification from the active system, the container manager or any inactive system may have already completed creating the second USB device descriptor.

[0098] S304, in response to the creation completion notification, the first USB device descriptor and the second USB device descriptor are executed simultaneously with the active system.

[0099] Specifically, when the active system sends the creation completion notification to the container manager and at least one inactive system, after the container manager and at least one inactive system receive the creation completion notification, the active system, the inactive system and the container manager execute their respective USB device descriptors at the same time. That is, the active system executes the first USB device descriptor, and the container manager and at least one inactive system execute the second USB device descriptor.

[0100] In some possible implementations, the USB configuration method applied to any inactive system within a container manager or multiple container systems may further include:

[0101] Change the creation status for the second USB device descriptor;

[0102] The step of simultaneously executing the first USB device descriptor and the second USB device descriptor in response to the creation completion notification and the activity system includes:

[0103] If the creation status of the second USB device descriptor is "created", then in response to the creation completion notification, the first USB device descriptor and the second USB device descriptor are executed simultaneously with the active system.

[0104] Specifically, when the creation of the second USB device descriptor is complete, the creation status of the second USB device descriptor is changed to "created", and the creation completion notification sent by the active system is responded to, so that the second USB device descriptor and the first USB device descriptor are executed simultaneously.

[0105] The above embodiments describe the USB configuration method of this application from the perspective that the execution subject is a container manager or any inactive system in multiple container systems. The USB configuration method is further described below from an overall perspective.

[0106] In some possible implementations, embodiments of this application provide a USB configuration method, such as... Figure 4 As shown, it may include the following steps:

[0107] S401: The underlying driver detects a USB event and sends the USB event to the container manager and multiple container systems respectively.

[0108] Specifically, a USB event can be a connection event between a computer and a mobile phone. The underlying driver of the physical device detects the USB event and sends it to the container manager and multiple container systems.

[0109] S402, the container manager and at least one inactive system in the plurality of container systems respond to the USB event, respectively perform debugging operations, and respectively send execution completion notifications to the active system in the plurality of container systems.

[0110] Specifically, after the container manager and at least one inactive system in the multiple container systems receive a USB event, they begin to perform debugging operations, send an execution completion notification upon completion, and then begin creating a second USB descriptor.

[0111] S403, the container manager and the at least one inactive system create a second USB device descriptor.

[0112] Specifically, the trigger condition for creating the second USB device descriptor can be sending an execution completion notification. This way, when the active system receives the execution completion notification and begins debugging, the container manager and at least one inactive system can each synchronously create their second USB device descriptor. This ensures that the creation of the second USB device descriptor is completed before receiving the creation completion instruction for the first USB device descriptor, thus guaranteeing that the first and second USB device descriptors execute simultaneously and improving configuration efficiency.

[0113] S404, in response to the execution completion notification, the active system performs a debugging operation and creates a first USB device descriptor.

[0114] Specifically, the active system receives and responds to the execution completion notification, begins to perform debugging operations, and creates a first USB device descriptor. This reduces the time interval between the creation of a second USB device descriptor and the creation of the first USB device descriptor by the container manager and at least one inactive system, thus improving the efficiency of USB configuration.

[0115] S405, the active system sends a creation completion notification for the first USB device descriptor to the container manager and the at least one inactive system, respectively.

[0116] Specifically, after completing their respective debugging operations and sending execution completion notifications, the container manager and at least one inactive system each create a second USB device descriptor. When the active system sends a creation completion notification to both the container manager and at least one inactive system, upon receiving the notification, the active system, the inactive system, and the container manager simultaneously execute their respective USB device descriptors; that is, the active system executes the first USB device descriptor, while the container manager and at least one inactive system execute the second USB device descriptor.

[0117] S406, the container manager and the at least one inactive system, in response to the creation completion notification, simultaneously execute the first USB device descriptor and the second USB device descriptor, respectively, along with the active system.

[0118] The method further includes: after the container manager and at least one inactive system complete the creation of the second USB device descriptor, they change the creation status of the second USB device descriptor. The active system obtains the creation status of the container manager and at least one inactive system for the second USB device descriptor respectively. If the creation status of the container manager and at least one inactive system is "created", then the second USB device descriptor and the first USB device descriptor are executed simultaneously.

[0119] In the above embodiments, the underlying driver sends USB events to the container manager and multiple container systems respectively. After the container manager and at least one inactive system complete the debugging operation, they send an execution completion notification to the active system and simultaneously create a second USB device descriptor. When the active system receives the execution completion notifications sent by the container manager and at least one inactive system respectively, it performs the debugging operation, then creates a first USB device descriptor, and then sends a creation completion notification for the first USB device descriptor to the container manager and at least one inactive system respectively, so that the USB device descriptors of multiple systems can be effective at the same time, thereby realizing USB configuration in a multi-system scenario.

[0120] Furthermore, when the active system receives the completion notification and begins debugging, the container manager and at least one inactive system can each synchronously create a second USB device descriptor. They can complete the creation of their own second USB device descriptor before receiving the completion instruction for the creation of the first USB device descriptor, so that the first USB device descriptor and the second USB device descriptor can be executed simultaneously as early as possible, thereby improving USB configuration efficiency.

[0121] To better understand the USB configuration method described in the embodiments of this application, the following will provide a more detailed explanation with reference to examples.

[0122] In one example, the USB configuration method of this application is as follows: Figure 5 As shown, it includes:

[0123] When the underlying driver detects a USB message, it generates a USB event and sends it to the container manager and multiple container systems. At least one inactive system in the container manager and multiple container systems responds to the USB event, performs debugging operations, and sends an execution completion notification to the active system in each of the multiple container systems. It then begins creating a second USB device descriptor and modifies its creation status upon completion. The active system responds to the execution completion notification, begins performing debugging operations and creating a first USB device descriptor, and upon completion, sends a creation completion notification to the container manager and at least one inactive system. It then obtains the creation status from the container manager and at least one active system. If both have been created, the first and second USB device descriptors are executed simultaneously.

[0124] The USB configuration method described above enables USB descriptors of multiple systems to take effect simultaneously by sending and receiving completion notifications and creation completion notifications between multiple systems and by changing the USB descriptor creation status, thereby realizing USB configuration in multi-system scenarios.

[0125] This application provides a USB configuration device, such as... Figure 6 As shown, the device 60 may include: a receiving module 601, a processing module 602, and a notification module 603, wherein,

[0126] The receiving module 601 is configured to receive execution completion notifications sent by the container manager and at least one inactive system respectively; wherein, the execution completion notification is a completion notification for the debugging operation executed based on the USB event sent by the container manager and the at least one inactive system respectively based on the underlying driver.

[0127] Processing module 602 is configured to create a first USB device descriptor after performing a debugging operation in response to the execution completion notification.

[0128] The notification module 603 is configured to send creation completion notifications for the first USB device descriptor to the container manager and the at least one inactive system, respectively; the creation completion notifications are configured to cause the second USB device descriptor and the first USB device descriptor created by the container manager and the at least one inactive system to be executed simultaneously.

[0129] In the specific implementation process, the container manager and the at least one inactive system in the receiving module 601 are used to create the second USB device descriptor after sending the execution completion notification.

[0130] In some possible implementations, the container manager and at least one inactive system in the receiving module 601 are also configured to change the creation status of the second USB device descriptor when the creation of the second USB device descriptor is complete.

[0131] The method further includes:

[0132] Obtain the creation status of the container manager and the at least one inactive system for the second USB device descriptor, respectively;

[0133] The creation completion notification is used to enable the container manager and the at least one inactive system to execute the second USB device descriptor and the first USB device descriptor simultaneously when the obtained creation status is "created".

[0134] This application provides another USB configuration device, such as... Figure 7 As shown, the device 70 may include: a processing module 701, a creation module 702, a receiving module 703, and an execution module 704, wherein,

[0135] Processing module 701 is used to receive USB events sent by the underlying driver, perform debugging operations, and send execution completion notifications to active systems in multiple container systems; the execution completion notification is used to enable the active system to perform debugging operations and then create a first USB device descriptor.

[0136] Create module 702 to create a second USB device descriptor;

[0137] The receiving module 703 is used to receive the creation completion notification sent by the activity system;

[0138] Execution module 704 is configured to execute the first USB device descriptor and the second USB device descriptor simultaneously with the activity system in response to the creation completion notification.

[0139] In some possible implementations, the creation module 702 is also used for:

[0140] Change the creation status for the second USB device descriptor;

[0141] The step of simultaneously executing the first USB device descriptor and the second USB device descriptor in response to the creation completion notification and the activity system includes:

[0142] If the creation status of the second USB device descriptor is "created", then in response to the creation completion notification, the first USB device descriptor and the second USB device descriptor are executed simultaneously with the active system.

[0143] In the USB configuration device provided in this application, the underlying driver sends USB events to the container manager and multiple container systems respectively. After the container manager and at least one inactive system complete the debugging operation, they send an execution completion notification to the active system and simultaneously create a second USB device descriptor. When the active system receives the execution completion notifications sent by the container manager and at least one inactive system respectively, it performs the debugging operation, then creates a first USB device descriptor, and then sends a creation completion notification for the first USB device descriptor to the container manager and at least one inactive system respectively, so that the USB device descriptors of multiple systems can be effective at the same time, thereby realizing USB configuration in a multi-system scenario.

[0144] Furthermore, when the active system receives the completion notification and begins debugging, the container manager and at least one inactive system can simultaneously create their own second USB device descriptors. They can complete the creation of their own second USB device descriptors before receiving the completion instruction for the first USB device descriptor, so that the first and second USB device descriptors can be executed simultaneously as early as possible, thereby improving USB configuration efficiency.

[0145] This application provides an electronic device including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the USB configuration method. Compared with related technologies, this method enables multiple systems' USB descriptors to be active simultaneously, shortens USB configuration time, and optimizes USB debugging functionality.

[0146] In one alternative embodiment, an electronic device is provided, such as Figure 8 As shown, Figure 8 The illustrated electronic device 8000 includes a processor 8001 and a memory 8003. The processor 8001 and the memory 8003 are connected, for example, via a bus 8002. Optionally, the electronic device 8000 may further include a transceiver 8004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 8004 is not limited to one type, and the structure of the electronic device 8000 does not constitute a limitation on the embodiments of this application.

[0147] The processor 8001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor 8001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0148] Bus 8002 may include a pathway for transmitting information between the aforementioned components. Bus 8002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 8002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0149] The memory 8003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.

[0150] The memory 8003 stores computer programs that execute embodiments of this application, and its execution is controlled by the processor 8001. The processor 8001 executes the computer programs stored in the memory 8003 to implement the steps shown in the foregoing method embodiments.

[0151] Electronic devices include, but are not limited to, smartphones.

[0152] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding content of the aforementioned method embodiments.

[0153] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.

[0154] The terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.

[0155] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.

[0156] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.

Claims

1. A Universal Serial Bus (USB) configuration method, characterized in that, Active systems applied across multiple container systems include: Receive execution completion notifications from the container manager and at least one inactive system respectively; wherein, the execution completion notification is a completion notification for the debugging operation executed based on the USB event sent by the container manager and the at least one inactive system respectively based on the underlying driver; In response to the execution completion notification, after performing the debugging operation, a first USB device descriptor is created; A creation completion notification for the first USB device descriptor is sent to the container manager and the at least one inactive system, respectively; the creation completion notification is used to enable the second USB device descriptor and the first USB device descriptor created by the container manager and the at least one inactive system to be executed simultaneously.

2. The USB configuration method according to claim 1, characterized in that, The container manager and the at least one inactive system are also configured to change the creation status of the second USB device descriptor when the creation of the second USB device descriptor is completed. The method further includes: Obtain the creation status of the container manager and the at least one inactive system for the second USB device descriptor, respectively; The creation completion notification is used to enable the container manager and the at least one inactive system to execute the second USB device descriptor and the first USB device descriptor simultaneously when the obtained creation status is "created".

3. A USB configuration method, characterized in that, Applicable to any inactive system within a container manager or multiple container systems, including: Receive USB events sent by the underlying driver, perform debugging operations, and send execution completion notifications to active systems in multiple container systems; the execution completion notifications are used to enable the active systems to perform debugging operations and create a first USB device descriptor; Create a second USB device descriptor; Receive the creation completion notification sent by the activity system; In response to the creation completion notification, the first USB device descriptor and the second USB device descriptor are executed simultaneously with the active system.

4. The USB configuration method according to claim 3, characterized in that, The method further includes: Change the creation status for the second USB device descriptor; The step of simultaneously executing the first USB device descriptor and the second USB device descriptor in response to the creation completion notification and the activity system includes: If the creation status of the second USB device descriptor is "created", then in response to the creation completion notification, the first USB device descriptor and the second USB device descriptor are executed simultaneously with the active system.

5. A USB configuration method, characterized in that, include: The underlying driver detects a USB event and sends the USB event to the container manager and multiple container systems respectively; In response to the USB event, the container manager and at least one inactive system in the plurality of container systems respectively perform debugging operations and send execution completion notifications to the active system in the plurality of container systems respectively. The container manager and the at least one inactive system create a second USB device descriptor; In response to the execution completion notification, the active system performs debugging operations and creates a first USB device descriptor; The active system sends a creation completion notification for the first USB device descriptor to the container manager and the at least one inactive system, respectively. In response to the creation completion notification, the container manager and the at least one inactive system simultaneously execute the first USB device descriptor and the second USB device descriptor, respectively, along with the active system.

6. A USB configuration device, characterized in that, The device is applied to active systems within multiple container systems, including: A receiving module is configured to receive execution completion notifications sent by the container manager and at least one inactive system, respectively; wherein, the execution completion notification is a completion notification for the debugging operation executed based on the USB event sent by the container manager and the at least one inactive system based on the underlying driver. In response to the execution completion notification, the processing module performs a debugging operation and then creates a first USB device descriptor. The notification module is configured to send creation completion notifications for the first USB device descriptor to the container manager and the at least one inactive system, respectively; the creation completion notifications are configured to cause the second USB device descriptor and the first USB device descriptor created by the container manager and the at least one inactive system to be executed simultaneously.

7. A USB configuration device, characterized in that, The device is applied to any inactive system within a container manager or multiple container systems, including: The processing module receives USB events sent by the underlying driver, performs debugging operations, and sends execution completion notifications to active systems in multiple container systems; the execution completion notification is used to enable the active system to perform debugging operations and create a first USB device descriptor. Create a module to create a second USB device descriptor; The receiving module receives the creation completion notification sent by the activity system; The execution module, in response to the creation completion notification, executes the first USB device descriptor and the second USB device descriptor simultaneously with the activity system.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 2, 3 to 4 and 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the USB configuration method according to any one of claims 1 to 2, 3 to 4 and 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2, 3 to 4 and 5.