Method and device for setting audio mode, electronic equipment and storage medium
By negotiating charging with electronic devices through an adapter and automatically setting the audio mode, the poor user experience caused by users manually setting the audio transmission mode is solved, and the automatic matching and stable operation of the audio transmission mode are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2026-04-14
AI Technical Summary
In the existing technology, the audio transmission mode setting of electronic devices relies on manual operation by the user, resulting in a poor user experience, and the user has difficulty knowing which audio transmission mode to select in the current scenario or device.
The adapter enables automatic audio mode setting. The adapter negotiates charging with the first and second devices to determine the audio signal transmission method of the first device, and negotiates charging with the second device based on proprietary protocol data information to enable it to enter the corresponding audio signal transmission mode.
It enables automatic matching of audio transmission modes, improves user experience, avoids the hassle of manual settings, and ensures the normal operation and stability of audio signal transmission.
Smart Images

Figure CN121858058A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of audio transmission technology, and in particular to a method, apparatus, electronic device, and storage medium for setting audio modes. Background Technology
[0002] Some electronic devices (including but not limited to head-mounted displays) may have audio output capabilities. Taking head-mounted displays as an example, some require audio signals from a host device for playback and have multiple audio signal transmission modes. Different audio signal transmission modes use different transmission methods to meet the audio signal transmission needs of different usage scenarios. However, currently, setting audio transmission modes still relies on manual user configuration (e.g., via buttons), resulting in a poor user experience. Therefore, a new technical solution is needed to at least partially improve these issues. Summary of the Invention
[0003] In view of the above, embodiments of this application provide a method, apparatus, electronic device, and storage medium for setting an audio mode, so as to at least partially solve the above problems.
[0004] According to a first aspect of the embodiments of this application, a method for setting an audio mode is provided, applied to an adapter connected between a first device and a second device, wherein the adapter is configured to supply power to the first device and the second device. The method includes: receiving a communication request sent by the first device based on a first charging standard protocol, and determining transmission mode information of the first device based on the communication request, wherein the transmission mode information is used to indicate a target audio signal transmission mode supported by the first device; performing privatization settings on a second charging standard protocol according to the transmission mode information to obtain privatization protocol data information; and negotiating charging with the second device based on the privatization protocol data information, so that the second device enters an audio signal transmission mode corresponding to the target audio signal transmission mode based on the privatization protocol data information.
[0005] According to a second aspect of the embodiments of this application, a method for setting an audio mode is provided, applied to a second device, the second device being connected to a first device via an adapter, and the adapter being configured to supply power to both the first and second devices. The method includes: negotiating a charging mode with the adapter based on proprietary protocol data information, wherein the proprietary protocol data information is obtained by the adapter privatizing a second charging standard protocol according to transmission mode information, the transmission mode information being used to indicate a target audio signal transmission mode supported by the first device, and the adapter receiving a communication request sent by the first device based on a first charging standard protocol, and determining the mode based on the communication request; and entering an audio signal transmission mode corresponding to the target audio signal transmission mode based on the proprietary protocol data information.
[0006] According to a third aspect of the embodiments of this application, an apparatus for setting an audio mode is provided, comprising an adapter connected between a first device and a second device, the adapter being configured to supply power to the first device and the second device. The apparatus includes: a determining module, configured to receive a communication request sent by the first device based on a first charging standard protocol, and determine transmission mode information of the first device based on the communication request, wherein the transmission mode information is used to indicate a target audio signal transmission mode supported by the first device; a setting module, configured to perform privatization settings on a second charging standard protocol according to the transmission mode information to obtain privatization protocol data information; and a negotiation module, configured to negotiate charging with the second device based on the privatization protocol data information, so that the second device enters an audio signal transmission mode corresponding to the target audio signal transmission mode based on the privatization protocol data information.
[0007] According to a fourth aspect of the embodiments of this application, an apparatus for setting an audio mode is provided, disposed in a second device, the second device being connected to a first device via an adapter, and the adapter being configured to supply power to both the first and second devices. The apparatus includes: a receiving module, configured to perform charging negotiation with the adapter based on proprietary protocol data information, wherein the proprietary protocol data information is obtained by the adapter performing proprietary settings on a second charging standard protocol according to transmission mode information, the transmission mode information being used to indicate a target audio signal transmission mode supported by the first device, the transmission mode information being determined based on a communication request sent by the first device, the communication request being a request sent by the first device based on a first charging standard protocol; and a control module, configured to enter an audio signal transmission mode corresponding to the target audio signal transmission mode based on the proprietary protocol data information.
[0008] According to a fifth aspect of the embodiments of this application, an electronic device is provided, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store a computer program; and the processor is used to execute the method of either the first aspect or the second aspect by running the computer program stored in the memory.
[0009] According to a sixth aspect of the embodiments of this application, a computer storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method as described in either the first or second aspect.
[0010] According to a seventh aspect of the embodiments of this application, a computer program product is provided, on which a computer program is stored, which, when executed by a processor, implements the method as described in either the first or second aspect. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0012] Figure 1A This is a schematic diagram of the system architecture for some technical solutions that can be applied to the embodiments of this application.
[0013] Figure 1B This is a schematic diagram of the connection method of the system architecture for some technical solutions that can be applied to the embodiments of this application.
[0014] Figure 2 This is a flowchart of some optional methods for setting audio modes in embodiments of this application.
[0015] Figure 3 This is a flowchart of some optional processes for determining transmission method information in the embodiments of this application.
[0016] Figure 4 This is a schematic diagram illustrating the process of PD charging negotiation between the first device and the adapter in an embodiment of this application.
[0017] Figure 5A This is a schematic diagram of the data link between the first device, the second device, and the adapter in an embodiment of this application.
[0018] Figure 5B A schematic diagram illustrating the working process of an example of the second device.
[0019] Figure 5C A schematic diagram illustrating the working process of another example of the second device.
[0020] Figure 6 This is a flowchart of some optional methods for setting audio modes in the embodiments of this application.
[0021] Figure 7 This is a structural block diagram of some optional devices for setting audio modes in the embodiments of this application.
[0022] Figure 8 This is a structural block diagram of some other optional devices for setting audio modes in the embodiments of this application.
[0023] Figure 9 This is a structural block diagram of some optional electronic devices in the embodiments of this application.
[0024] Explanation of reference numerals in the attached figures:
[0025] 100. First device; 200. Second device; 300. Adapter; 400. External power supply; 700. Device for setting audio mode; 702. Determining module; 704. Setting module; 706. Negotiation module; 800. Device for setting audio mode; 802. Receiving module; 804. Control module; 900. Electronic device; 902. Processor; 904. Communication interface; 906. Memory; 908. Communication bus; 910. Computer program. Detailed Implementation
[0026] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art should fall within the protection scope of this application. It should be understood that the various steps described in the method implementation of this disclosure can be performed in different orders and / or in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0027] Some electronic devices (including but not limited to head-mounted displays) may have audio output capabilities. Taking head-mounted displays as an example, in addition to their display function, audio output is also an essential feature. For instance, some head-mounted displays require audio signals from a host device for playback and have multiple audio signal transmission modes suitable for different host devices or scenarios. Different audio signal transmission modes employ different methods of audio signal transmission. For example, some audio signal transmission modes support bidirectional input / output audio signal transmission; that is, the head-mounted display can both receive audio signals input from the host device and output them outwards, and also support the head-mounted display device outputting audio signals to the host device. For example, in one example, such an audio signal transmission mode may include an audio transmission mode based on the UAC (USB Audio Class) protocol, which supports the aforementioned bidirectional input / output audio signal transmission. Conversely, other audio signal transmission modes only support unidirectional output audio signal transmission. For example, in one example, such an audio signal transmission mode may include an audio transmission mode based on the DP (DisplayPort) protocol, which supports the aforementioned unidirectional output audio signal transmission. In comparison, the UAC-based audio transmission mode mentioned above typically allows for bidirectional audio signal transmission, making it well-suited for scenarios such as voice calls. The DP-based audio transmission mode, on the other hand, can transmit both video and audio data, offering advantages in audio-visual synchronization. This DP mode is better suited for scenarios such as video games. Different audio signal transmission modes can be set as needed to meet the audio signal transmission requirements of different usage scenarios. Therefore, it is clear that choosing the appropriate audio transmission mode when needed can improve the user experience. However, currently, setting audio transmission modes still relies on manual user configuration (e.g., via buttons), and users generally do not easily know which audio transmission mode is required for the current scenario or device, which can easily lead to a poor user experience.
[0028] This application provides a new technical solution that can change the setting of audio transmission mode of electronic devices (including but not limited to head-mounted display devices), thereby facilitating the improvement of user experience.
[0029] To better illustrate the solution for device audio modes in this application, we will first provide an exemplary description with reference to the system architecture applicable to this solution shown in Figure 1. Figure 1A and Figure 1B As shown, the system architecture includes a first device 100, a second device 200, and an adapter 300. The adapter 300 is connected between the first device 100 and the second device 200, meaning that this solution can be implemented based on the adapter 300.
[0030] The adapter 300 is configured to power the first device 100 and the second device 200. For example, in some embodiments, the adapter 300 may have its own power source (e.g., a battery) to power the first device 100 and the second device 200. In other embodiments, the adapter 300 may be connected to an external power source (e.g., a charger, a power bank) to power the first device 100 and the second device 200.
[0031] Optionally, the adapter 300 can be connected to the first device 100 and the second device 200 via any type of connection interface. For example, the adapter 300 can be connected to the first device 100 via a USB Type-C interface. Optionally, the adapter 300 can be connected to the second device 200 via a USB Type-C interface. The USB Type-C interface facilitates data transmission using various communication protocols, such as UAC, DP, and PD (Power Delivery) protocols, and ensures the reliability of the corresponding data transmission. Optionally, when the adapter 300 is connected to an external power source, a USB Type-C interface can also be used to meet power requirements.
[0032] As an example, refer to Figure 1B This diagram illustrates the connection methods of the adapter 300 with the first device 100, the second device 200, and the external power supply 400. The adapter 300 may include a first interface, a second interface, and a third interface, all of which can be USB Type-C interfaces. In some optional examples, the first and third interfaces can be female, and the second interface can be male. The adapter 300 can be connected to the first device 100 via the first interface. For example, if the first device 100 may include another USB Type-C female port, the first interface can be connected to the first device 100 via a corresponding data cable. The adapter 300 can be connected to the second device 200 via the second interface. For example, if the second device 200 may include another USB Type-C female port, the second interface can be connected to the second device 200 by inserting the male second interface into the female port on the first device 100. The adapter 300 can be connected to the external power supply 400 via the third interface. For example, the external power supply 400 may include another USB Type-C female port, and a third interface can be connected to the external power supply 400 via a corresponding data cable. Of course, the above examples are merely optional; male and female ports can be selected arbitrarily as needed, and the above content is not intended to limit the embodiments of this application.
[0033] In some optional embodiments, the second device 200 can be any electronic device. For example, it may include, but is not limited to, mobile phones, tablets, computers, in-vehicle systems, servers, and other electronic devices. In some optional embodiments, the second device 200 can be a head-mounted display device. Head-mounted display devices may include, but are not limited to, AR (Augmented Reality) glasses, VR (Virtual Reality) glasses, etc. By connecting the second device 200 to the adapter 300, the second device 200 can easily obtain power through the adapter 300 for operation. It is understood that if the second device 200 is a rechargeable device with a battery or the like, the second device 200 can be charged through the power supplied by the adapter 300.
[0034] In some alternative embodiments, the first device 100 can be any electronic device. For example, it may include, but is not limited to, mobile phones, tablets, computers, in-vehicle systems, servers, game consoles, and other electronic devices. The first device 100 can serve as the host device of the second device 200, providing at least computing functionality to the second device 200. In one example application scenario, the second device 200 can be a head-mounted display device, and the first device 100 can be the host device of that head-mounted display device. For example, the host device can provide multimedia data (including at least one of video or audio data) for playback to the head-mounted display device, and the adapter 300 can supply power to the head-mounted display device directly or indirectly, thereby enabling the head-mounted display device to operate and meet the user's entertainment needs through the head-mounted display device.
[0035] In some alternative embodiments, the adapter 300 may obtain electrical signals from the first device 100 connected to the first interface and supply power to the second device 200 connected to the second interface. Alternatively, the adapter 300 may obtain electrical signals from a third interface and supply power to the second device 200 connected to the second interface.
[0036] Based on the above system architecture, the scheme for setting audio modes according to embodiments of this application will be described below. It should be understood that some content related to the above will not be repeated below.
[0037] According to a first aspect of the embodiments of this application, a method for setting an audio mode is provided. This method can be applied to an adapter 300 connected between a first device 100 and a second device 200, and the adapter 300 can be configured to supply power to both the first device 100 and the second device 200. Figure 2 A flowchart illustrating the steps of some optional methods for setting audio modes in embodiments of this application is shown. (Refer to...) Figure 2 As shown, the method includes steps S202, S204, and S206, specifically:
[0038] S202: Receive a communication request sent by the first device based on the first charging standard protocol, and determine the transmission mode information of the first device based on the communication request, wherein the transmission mode information is used to indicate the target audio signal transmission mode supported by the first device.
[0039] Optionally, the adapter 300 can charge the first device 100 via a first charging standard protocol. When the first device 100 is connected to the adapter 300, the first device 100 can send a communication request to the adapter 300 based on the first charging standard protocol. The adapter 300 can then negotiate a charging configuration with the first device 100 based on the communication request and determine the transmission method information of the first device 100 based on the charging negotiation. After the charging negotiation is completed, the adapter 300 can begin charging the first device 100.
[0040] This application does not limit the specific type of the first charging standard protocol. In some optional embodiments, the first charging standard protocol can be a Universal Serial Bus Power Delivery protocol, also known as the PD (Power Delivery) protocol. This charging standard protocol is a USB technology standard that can be used to provide faster and more efficient charging and data transfer. By adopting the PD protocol to realize the interaction and charging between the first device 100 and the adapter 300, it is faster and more efficient.
[0041] The transmission method information in this application can be any type of information, such as text information, identification information, etc. The target audio signal transmission method supported by the first device 100 can depend on the specific characteristics of the first device 100 itself. For example, the first device 100 may only support audio signal transmission methods based on the DP protocol.
[0042] In some examples, the second device 200 can support both UAC-based and DP-based audio signal transmission modes, while the first device 100 only supports DP-based audio signal transmission. Through step S102, the transmission mode information of the first device 100 can be determined, indicating that the target audio signal transmission mode supported by the first device 100 is DP-based. This has the advantage that subsequent steps can prevent the second device 200 from entering the UAC-based audio signal transmission mode, automatically switching to the DP-based mode, thus better supporting audio signal transmission from the first device 100 and improving the user experience.
[0043] This application does not limit the specific implementation of determining the transmission method information in step S102. In some optional embodiments, refer to... Figure 3The flowchart shown above illustrates that the method for determining the transmission method information may include the following steps S2021 and S2022, specifically:
[0044] S2021: Based on the communication request, perform charging negotiation with the first device, and determine the identity information of the first device based on the protocol data information received from the first device during the charging negotiation process.
[0045] Optionally, taking the PD protocol as the first charging standard protocol as an example, PD charging negotiation can be performed with the first device based on a communication request to obtain PD protocol data information. Then, based on the PD protocol data information, the identity information of the first device can be determined. The identity information of the first device 100 can be used to characterize the identity of the first device 100 and can indicate the type of product of the first device 100. For example, the identity information of the first device may include the product model of the first device 100, etc.
[0046] In some optional embodiments, the identity information of the first device can be determined in the following way: in response to determining that there is customized second unstructured information in the protocol data information, the identity information of the first device can be determined based on the second unstructured information.
[0047] Based on this, by identifying customized second unstructured information, the identity information of the first device can be effectively determined based on the second unstructured information, thereby facilitating the subsequent determination of the transmission method information of the first device based on the identity information.
[0048] Optionally, when the first charging standard protocol is the PD protocol, the second unstructured information can be a second unstructured VDM (Unstructured Vendor Define Message, or simply Unstructured VDM) message, that is, a second unstructured vendor-defined message. The unstructured VDM message can be customized by the equipment manufacturer of the first device 100. During the PD charging negotiation process between the first device 100 and the adapter 300, a series of second unstructured VDM messages can be sent. By identifying the second unstructured VDM messages, the identity information of the first device can be determined. For example, by identifying the customized content (e.g., customized fields, identifiers, etc.) in the second unstructured VDM message, the product type information of the first device can be determined, and the determined information can be used as the identity information of the first device.
[0049] In some optional implementations, customized content of multiple unstructured VDM messages corresponding to multiple products can be pre-stored. By comparing the customized content determined from the second unstructured VDM message with the pre-stored customized content, the corresponding identity information can be determined and used as the identity information of the first device.
[0050] For example, the first device 100 mentioned above supports the PD protocol, see reference. Figure 4 The diagram illustrates the process of PD charging negotiation between the first device 100 and the adapter 300. During the PD charging negotiation between the first device 100 and the adapter 300, after confirming that the adapter 300 can supply power to the first device 100, the process enters the first stage (also known as the Alternative Mode stage) for protocol data confirmation. The protocol data may include structured vendor-defined messages (or Structured VDM information), Discovery Identity, DP Configure, etc. For each message, the adapter 300 will reply with a corresponding ACK (Acknowledge character) data packet, which allows the device 100 and the adapter 300 to enter the DP function mode. Afterwards, the adapter starts sending Attention messages to inform the first device 100 that it can begin preparing for the DP negotiation phase. At the same time, the adapter monitors in real time whether there is protocol data information for the second phase. The protocol data information for the second phase may include a second unstructured VDM message. This part may include a dedicated VDM message for the first device 100 customized by the device manufacturer. Based on the second unstructured VDM message, the product model information of the first device 100 can be determined, thereby identifying it as the identity information of the first device 100.
[0051] S2022: Determine the transmission method information based on the identity information.
[0052] Optionally, multiple pairs of transmission mode information and identity information can be pre-stored. By matching the determined identity information with the pre-stored pairs of transmission mode information and identity information, the transmission mode information corresponding to the identity information can be determined. The determined transmission mode information can be the transmission mode information of the first device 100.
[0053] Alternatively, when dealing with a specific type of first device, it can be determined whether it is a first device of that specific type based solely on the identity information. If so, the corresponding transmission method information can be directly determined.
[0054] Based on this, in the optional implementation of steps S2021-S2022 described above, during the charging negotiation process between the first device and the adapter, the transmission mode information indicating the target audio signal transmission mode supported by the first device can be effectively determined based on the communication request sent by the first device. This implementation can accurately determine the audio signal transmission mode of the first device using existing charging negotiation, resulting in high efficiency and low computational load. Furthermore, this implementation also facilitates subsequent accurate private setting of the second charging standard protocol to obtain private protocol data information, which can be used to accurately enable the second device to enter the audio signal transmission mode corresponding to the target audio signal transmission mode. This ensures the normal operation of audio signal transmission between the first and second devices and improves the user experience by avoiding reliance on manual user settings of the second device's audio transmission mode.
[0055] S204: Based on the transmission method information, the second charging standard protocol is configured to be private, and the private protocol data information is obtained.
[0056] In some optional embodiments, the second charging standard protocol can be privatized based on the transmission method information to obtain privatized protocol data information, which can be used for charging negotiation between the second device 200 and the adapter 300. The privatized protocol data information can also be used to subsequently set the audio signal transmission mode of the second device, realizing an automatic setting method for the audio signal transmission mode of the second device at the protocol level.
[0057] This application does not limit the specific type of the second charging standard protocol. In some optional embodiments, the first charging standard protocol and the second charging standard protocol can be the same charging standard protocol.
[0058] It should be understood that since the first charging standard protocol and the second charging standard protocol can use the same charging standard protocol, and the transmission method information is determined based on the first charging standard protocol, the transmission method information can be directly used to make private settings for the second charging standard protocol, which is more accurate and convenient.
[0059] In some optional embodiments, the second charging standard protocol can be a Universal Serial Bus Power Delivery protocol, also known as the PD (Power Delivery) protocol. This application employs the PD protocol to achieve faster and more efficient interaction and charging between the second device 200 and the adapter 300.
[0060] Optionally, both the first and second charging standard protocols adopt the Universal Serial Bus Power Transfer Protocol (PD protocol). This allows for more accurate and convenient customization of the second charging standard protocol based on transmission method information, and also enables faster and more efficient interaction and charging.
[0061] In this application, the second charging standard protocol can be privatized in any way to obtain privatized protocol data information. In some optional embodiments, the method of obtaining privatized protocol data information may include: setting predetermined flag bits of the structured messages in the second charging standard protocol according to the transmission method information, thereby obtaining privatized protocol data information.
[0062] Based on this, by privatizing the predetermined flag bits of the structured messages in the second charging standard protocol, privatized protocol data information can be obtained. On the one hand, this simplifies the privatization setting method, making it more accurate and convenient to privatize the second charging standard protocol based on transmission mode information, with less development and computational workload. On the other hand, by privatizing the predetermined flag bits of the structured messages, when negotiating charging with the second device based on the privatized protocol data information, the second device only needs to parse the structured messages of the privatized protocol data information to determine the target audio signal transmission mode so that the second device can subsequently enter that mode. This eliminates the need to parse the unstructured messages of the privatized protocol data information, thereby reducing the parsing workload and improving the efficiency of setting the audio signal transmission mode, ultimately enhancing the user experience.
[0063] Optionally, when the second charging standard protocol is the PD protocol, the structured message can be a Structured Vendor Defined Message (or simply Structured VDM) message, that is, a structured vendor-defined message. During the PD charging negotiation process between the second device 200 and the adapter 300, a series of proprietary structured VDM messages will be sent. The second device 200 can select the target audio signal transmission method by recognizing the proprietary structured VDM messages.
[0064] Optionally, when setting a predetermined flag, the value of the predetermined flag can be set. For example, assuming the predetermined flag is 0 by default, it can be set to 1 or other values according to the transmission method information when needed. Each different value can correspond to a different audio signal transmission mode indicated by the transmission method information.
[0065] This application allows for the privatization of any suitable predetermined flag bits in the structured messages of the second charging standard protocol when necessary. In some optional embodiments, the predetermined flag bits may include reserved flag bits that do not affect charging negotiation.
[0066] It should be understood that by privatizing the reserved flags that do not affect charging negotiation, the normal communication process of charging negotiation will not be affected, the risk of communication failure can be effectively avoided, and the effect of privatization can be improved.
[0067] Taking the PD protocol as the second charging standard protocol as an example, in normal PD communication, the VDO (Vendor-Defined Data Object) in the structured VDM message is a 32-bit data, which generally reserves at least one unused bit. These bits can be called reserved bits. Therefore, a suitable VDO packet can be used to select bits from the reserved bits as reserved flags. By privately setting the value of this reserved bit, the normal PD negotiation communication process will not be affected, and the risk of communication failure can be effectively avoided, which is beneficial to improving the effect of private setting. Furthermore, when negotiating charging with the second device 200 based on the private protocol data information, the second device 200 only needs to parse the structured message (i.e., the structured VDM message) of the private protocol data information to determine the target audio signal transmission mode so that it can enter that mode later. It is not necessary to parse the unstructured message (i.e., the unstructured VDM message) of the private protocol data information, thereby reducing the workload of parsing and improving the efficiency of setting the audio signal transmission mode, which is beneficial to improving the user experience.
[0068] For ease of reference below, the privatization setting method for setting the predetermined flag bits of the structured messages in the second charging standard protocol mentioned above will be referred to as "method a".
[0069] Understandably, method a above does not break the standard protocol, so it has good compatibility. In addition, it is less likely to cause communication failure and requires less development effort.
[0070] In some optional embodiments, the second charging standard protocol may be privately configured in this application, and may include at least one of the following methods: method b, method c, and method d.
[0071] Optionally, method b may include: making privatized modifications to the contents of the data header in the second charging standard protocol.
[0072] Taking the PD protocol as an example of the second charging standard protocol, the header of the structured VDM message in the second charging standard protocol can be modified privately to achieve the purpose of private setting of the second charging standard protocol.
[0073] For example, the content of different data headers can correspond to different audio signal transmission modes. In one example, the data header content can be set to include "A0 content," corresponding to an audio signal transmission mode based on the UAC protocol; the data header content can include "A1 content," corresponding to an audio signal transmission mode based on the DP protocol, and so on. When the adapter 300 negotiates charging with the second device 200 based on proprietary protocol data information, the second device 200 can identify the content of the data header that has been privately modified in the proprietary protocol data information to determine the corresponding target audio transmission mode. For example, if the data header content is identified to include A0 content, the target audio transmission mode is determined to be an audio signal transmission mode based on the UAC protocol; if the data header content is identified to include A1 content, the target audio transmission mode is determined to be an audio signal transmission mode based on the DP protocol. Then, it can automatically directly enter or automatically switch to the audio signal transmission mode corresponding to the target audio signal transmission mode. It should be understood that the above examples are not intended to limit the embodiments of this application.
[0074] Optionally, method c may include: adding new settings to the data types in the second charging standard protocol.
[0075] In this case, it is necessary to avoid the data types already defined in the second charging standard protocol and add new data types.
[0076] For example, the newly added different data types can correspond to different audio signal transmission modes. For instance, in one example, the data types could be set to include "B0 type," corresponding to an audio signal transmission mode based on the UAC protocol; and "B1 type," corresponding to an audio signal transmission mode based on the DP protocol, etc. When the adapter 300 negotiates charging with the second device 200 based on proprietary protocol data information, the second device 200 can identify the newly added data types in the proprietary protocol data information and determine the corresponding target audio transmission mode. For example, if the data type identified includes B0 type, the target audio transmission mode is determined to be an audio signal transmission mode based on the UAC protocol; if the data type identified includes B1 type, the target audio transmission mode is determined to be an audio signal transmission mode based on the DP protocol. Then, it can automatically directly enter or automatically switch to the audio signal transmission mode corresponding to the target audio signal transmission mode. It should be understood that the above examples are not intended to limit the embodiments of this application.
[0077] Optionally, method d may include: privately defining the content of the first unstructured message of the second charging standard protocol.
[0078] For example, when the second charging standard protocol is the PD protocol, the first unstructured message can be a first unstructured VDM (Unstructured Vendor Define Message, or simply Unstructured VDM) message, that is, a first unstructured vendor-defined message. Unstructured VDM messages can be customized by the equipment manufacturer. Method d involves customization of the proprietary content of the second charging standard protocol, allowing for flexible content definition.
[0079] For example, the content of different first unstructured messages can correspond to different audio signal transmission modes. For instance, in one example, the content of the first unstructured message can be set to include "C0 content," corresponding to an audio signal transmission mode based on the UAC protocol; the content of the first unstructured message can include "C1 content," corresponding to an audio signal transmission mode based on the DP protocol, and so on. When the adapter 300 negotiates charging with the second device 200 based on proprietary protocol data information, the second device 200 can identify the content of the first unstructured message defined in the proprietary protocol data information and determine the corresponding target audio transmission mode. For example, if the content of the first unstructured message includes C0 content, the target audio transmission mode is determined to be an audio signal transmission mode based on the UAC protocol; if the content of the first unstructured message includes C1 content, the target audio transmission mode is determined to be an audio signal transmission mode based on the DP protocol. Then, it can automatically directly enter or automatically switch to the audio signal transmission mode corresponding to the target audio signal transmission mode. It should be understood that the above examples are not intended to limit the embodiments of this application.
[0080] It should be understood that this application uses at least one of the above-mentioned methods to privatize the second charging standard protocol, thereby improving the flexibility of the privatization settings and making the setting of the audio signal transmission mode of the second device more flexible.
[0081] It should also be understood that in some optional embodiments of this application, one or more of the above-mentioned methods a, b, c, and d can be used to implement the private settings of the second charging standard protocol to obtain private protocol data information when actual needs are met. This application does not impose specific limitations on this. Optionally, when multiple methods are combined, different combinations of the value of the predetermined flag bit, the content of the data header, the data type, and the content of the first unstructured message can correspond to different audio signal transmission modes.
[0082] S206: Negotiate charging with the second device based on proprietary protocol data information, so that the second device enters an audio signal transmission mode corresponding to the target audio signal transmission method based on proprietary protocol data information.
[0083] For example, taking the PD protocol as the second charging standard protocol, the adapter 300 and the second device 200 can negotiate PD charging based on proprietary protocol data. During the PD charging negotiation process, the second device 200 can parse the proprietary protocol data to determine the target audio signal transmission mode supported by the first device 100. This allows the second device 200 to automatically enter the audio signal transmission mode corresponding to the target audio signal transmission mode when the first device 100 is connected to the adapter 300. Here, there are several ways to make the second device 200 enter the audio signal transmission mode corresponding to the target audio signal transmission mode. One possibility is that when the second device 200 is currently in the audio signal transmission mode corresponding to the target audio signal transmission mode, it can be understood as directly entering the audio signal transmission mode corresponding to the target audio signal transmission mode. In an example scenario, if the second device 200 supports both UAC-based and DP-based audio signal transmission modes, and if the method for setting the audio mode in this application determines that the target audio signal transmission mode is DP-based when the second device 200 is first powered on, and the second device 200 is currently in DP-based mode, it can be understood that it automatically enters the DP-based audio signal transmission mode to meet the requirement of the first device 100 transmitting and playing audio signals to the second device 200.
[0084] Another scenario is that if the second device 200 is already in an audio signal transmission mode, and this transmission mode differs from the transmission mode corresponding to the target audio signal transmission method, then it needs to switch to the audio signal transmission mode corresponding to the target audio signal transmission method. In an example scenario, if the second device 200 supports both UAC-based and DP-based audio signal transmission modes, and the second device 200 is currently in UAC-based mode, while the first device 100 only supports DP-based audio signal output and not UAC-based audio signal output, if the method for setting the audio mode in this application determines that the target audio signal transmission mode is DP-based, then the second device 200 can automatically switch from UAC-based audio signal transmission mode to DP-based audio signal transmission mode to meet the requirement of the first device 100 transmitting and playing audio signals to the second device 200. Of course, the above are merely examples and do not constitute any limitation on the embodiments of this application.
[0085] In some optional embodiments, the adapter 300 is connected to the first device 100 and the second device 200, and can charge the first device 100 and the second device 200 respectively using a corresponding charging standard protocol. When the adapter 300 is connected to the first device 100 and the second device 200 and charging, the method described above for setting the audio mode can be executed to ensure that the audio signal transmission mode of the second device 200 matches the transmission method supported by the first device 100. It is understood that this application can solve the problem that the audio signal transmission mode cannot be automatically matched when the first device 100 and the second device 200 are connected through an adapter 300 (and the adapter 300 can supply power to the first device 100 and the second device 200). It can be seen that the connection mode of the first device 100, the second device 200 and the adapter 300 and the function of charging with the charging standard protocol are the basis of this solution. On this basis, the audio signal transmission mode of the first device 100 can be determined through the first charging standard protocol. By privatizing the second charging standard protocol, the second device 200 can enter an audio signal transmission mode that matches the audio signal transmission mode of the first device 100, thereby realizing the automatic matching of the audio signal transmission modes of the first device 100 and the second device 200. Based on this, this application uses an adapter connected between the first and second devices to provide power to both devices. It determines transmission mode information indicating the target audio signal transmission mode supported by the first device, and then privatizes the second charging standard protocol based on this transmission mode information. This yields privatized protocol data information, which is then used to negotiate charging with the second device. This allows the second device to enter an audio signal transmission mode corresponding to the target audio signal transmission mode. Therefore, on the one hand, this application effectively avoids relying on manual user settings for the second device's audio transmission mode, while ensuring the normal operation of audio signal transmission between the first and second devices and improving the user experience. On the other hand, because this application privatizes the second charging standard protocol between the second device and the adapter, it defines an automatic setting method for the second device's audio signal transmission mode at the protocol level. This results in better stability, higher efficiency, and greater accuracy in setting the audio signal transmission mode of the second device, leading to a better setting effect and further improving the user experience.
[0086] In this application, the specific method by which the second device enters the audio signal transmission mode corresponding to the target audio signal transmission method is not limited. Optionally, taking the aforementioned implementation method of "setting a predetermined flag bit of the structured message in the second charging standard protocol according to the transmission method information to obtain proprietary protocol data information" as an example, the second device can identify the predetermined flag bit and determine the target audio transmission mode according to the predetermined flag bit, so as to enter the audio signal transmission mode corresponding to the target audio signal transmission method.
[0087] Different values of the aforementioned predetermined flag bits (e.g., can be understood as reserved flag bits that do not affect charging negotiation, such as the reserved bit mentioned above) can correspond to different audio signal transmission modes. For example, in one example, a predetermined flag bit of 0 can be set to correspond to an audio signal transmission mode based on the UAC protocol, and a predetermined flag bit of 1 can correspond to an audio signal transmission mode based on the DP protocol, etc. When the adapter 300 negotiates charging with the second device 200 based on proprietary protocol data information, the second device 200 can identify the value of the predetermined flag bits set in the proprietary protocol data information to determine the corresponding target audio transmission mode. For example, if a predetermined flag bit of 0 is identified, the target audio transmission mode can be determined to be an audio signal transmission mode based on the UAC protocol; if a predetermined flag bit of 1 is identified, the target audio transmission mode can be determined to be an audio signal transmission mode based on the DP protocol. Then, it can automatically directly enter or automatically switch to the audio signal transmission mode corresponding to the target audio signal transmission mode. It should be understood that the above examples are not intended to limit the embodiments of this application.
[0088] The following, in conjunction with some accompanying drawings, provides further illustrative examples of the solutions in the embodiments of this application.
[0089] In some examples, refer to Figure 5A This illustrates a schematic diagram of the data link between the first device, the second device, and the adapter in an example of Embodiment 1 of this application. Figure 5A As shown, the adapter 300 is connected between the first device 100 and the second device 200. The adapter 300 can negotiate and interact with the first device 100 via a first charging standard protocol, and can negotiate and interact with the second device 200 via a second charging standard protocol, such as... Figure 5AAs shown. Both the first and second charging standard protocols can be PD protocols, and both charging negotiations mentioned above are PD charging negotiations. The second device 200 can simultaneously possess audio signal transmission modes based on the UAC protocol and audio signal transmission modes based on the DP protocol. The first device 100 and the second device 200 can also form a DP link through an adapter 300, which can be used to transmit audio signals based on the DP protocol (unidirectional transmission is possible). The first device 100 and the second device 200 can also form a USB connection through the adapter 300. When the first device 100 supports UAC protocol audio signal transmission, audio signals can be transmitted via USB based on the UAC protocol (bidirectional transmission is possible). It should be understood that the first device 100 can support at least one of the audio signal transmission methods based on the UAC protocol and the audio signal transmission method based on the DP protocol. For ease of explanation, this example assumes that the first device 100 does not support UAC protocol audio signal output and only supports DP protocol audio signal output.
[0090] In some examples, refer to Figure 5B This illustrates a schematic diagram of the operation of an example of the second device. In some application scenarios, the first device 100 can be a handheld game console, and the second device 200 can be a head-mounted display device (such as AR glasses). In this application scenario, a user can use the second device 200 to connect to the first device 100 via an adapter 300 to play games. Figure 5B As shown, the second device 200 is connected to the adapter 300 for operation. The second device 200 and the adapter 300 can negotiate PD charging based on proprietary protocol data information, so that the adapter 300 can charge the second device 200. During the PD charging negotiation process between the second device 200 and the adapter 300, the second device 200 can identify predetermined flag information set proprietaryly, and thus enter different audio signal transmission modes (UAC mode, DP mode) according to different flag information. For example... Figure 5B The example shown can be configured such that a predetermined flag bit of 0 corresponds to an audio signal transmission mode based on the UAC protocol, and a predetermined flag bit of 1 corresponds to an audio signal transmission mode based on the DP protocol. If a predetermined flag bit of 0 is detected, the target audio transmission mode is determined to be the audio signal transmission mode based on the UAC protocol and preparations are made to enter it; if a predetermined flag bit of 1 is detected, the target audio transmission mode is determined to be the audio signal transmission mode based on the DP protocol and preparations are made to enter it. In this example, since the second device 200 supports the DP protocol, the first device 100 completes the DP protocol handshake process with the second device 200 through the adapter 300 and completes the audio channel initialization process; afterwards, audio signal transmission can be performed between the first device 100 and the second device 200.
[0091] The method for obtaining the privatization protocol data information has been explained above. Here, we will use "method a" to illustrate the privatization settings.
[0092] For example, after negotiating PD charging with the first device 100, the adapter 300 can determine the identity information of the first device 100 based on the customized second unstructured VDM message in the protocol data information sent by the first device 100 during the PD charging negotiation process. Based on the identity information of the first device 100, the adapter 300 can determine the transmission mode information supported by the first device 100. The adapter 300 can then set the value of a predetermined flag (also denoted as Flag) in the structured VDM message of the second charging standard protocol to 0 or 1 according to the transmission mode information, thereby obtaining the private protocol data information.
[0093] In some examples, refer to Figure 5C This illustrates a schematic diagram of the operation of another example of the second device 200. Alternatively, as... Figure 5C As shown, the second device 200 may include a PD chip (Power Delivery chip) and an MCU (Microcontroller Unit). The adapter 300 can negotiate PD charging with the PD chip in the second device 200, which is responsible for PD communication, based on proprietary protocol data information. After initialization, the MCU in the second device 200 waits for the PD charging negotiation to end. The MCU can enter different audio signal links for initialization according to different values of the predetermined flag bit (Flag). For example, if the predetermined flag bit (Flag) is 0, the UAC link is initialized to automatically enter (either directly or by switching) the audio signal transmission mode based on the UAC protocol; if the predetermined flag bit (Flag) is 1, the DP link is initialized to automatically enter (either directly or by switching) the audio signal transmission mode based on the DP protocol. Furthermore, if entering the DP protocol-based audio signal transmission mode, the second device 200 must send EDID (Extended Display Identification Data) data containing DP audio information to the first device 100 before entering this mode, so that the first device 100 can report the corresponding data. If entering UAC mode, the second device 200 must send EDID data without DP audio information to the first device 100 before entering this mode. In the example, since the first device 100 only supports DP protocol audio signal output, the second device 200 sends EDID data containing DP audio information to the first device 100.
[0094] It should be understood that the above refers to... Figure 5A , Figure 5B and Figure 5C The description provided is for the purpose of facilitating understanding of the technical solution and is not intended to limit the technical solutions of the embodiments of this application.
[0095] In summary, the method for setting the audio mode in this application effectively avoids relying on the user to manually set the audio transmission mode of the second device, while ensuring the normal operation of the audio signal transmission between the first and second devices and improving the user experience. Furthermore, because this application privatizes the second charging standard protocol between the second device and the adapter, it defines an automatic setting method for the audio signal transmission mode of the second device at the protocol level. This results in better stability, higher efficiency, and greater accuracy in setting the audio signal transmission mode of the second device, leading to a better setting effect and further enhancing the user experience.
[0096] According to a second aspect of the embodiments of this application, a method for setting an audio mode is provided. The method is applied to a second device connected to a first device via an adapter, and the adapter is configured to supply power to both the first and second devices. Figure 6 Flowcharts illustrating the steps of some other optional methods for setting audio modes in embodiments of this application are shown. (Refer to...) Figure 6 As shown, the method includes steps S602 and S604, specifically:
[0097] S602: Based on the proprietary protocol data information, perform charging negotiation with the adapter. The proprietary protocol data information is obtained by the adapter through proprietary settings of the second charging standard protocol according to the transmission mode information. The transmission mode information is used to indicate the target audio signal transmission mode supported by the first device. The transmission mode information is determined based on the communication request sent by the first device. The communication request is a request sent by the first device based on the first charging standard protocol.
[0098] S604: Based on the proprietary protocol data information, enter the audio signal transmission mode corresponding to the target audio signal transmission method.
[0099] In some optional embodiments, the privatization protocol data information is obtained by the adapter setting predetermined flag bits of the structured messages in the second charging standard protocol according to the transmission method information.
[0100] In some alternative embodiments, the predetermined flag bit includes a reserved flag bit that does not affect charging negotiation.
[0101] In some optional embodiments, S604 includes: identifying a predetermined flag bit and determining a target audio transmission mode based on the predetermined flag bit, so as to enter an audio signal transmission mode corresponding to the target audio signal transmission mode.
[0102] In some optional embodiments, the first charging standard protocol and the second charging standard protocol are the same charging standard protocol.
[0103] In some alternative embodiments, the charging standard protocol is the Universal Serial Bus Power Transfer Protocol.
[0104] In some optional embodiments, the privatized protocol data information is obtained by the adapter according to the transmission method information by implementing at least one of the following methods: privatizing the content of the data header in the second charging standard protocol; adding new data types in the second charging standard protocol; and privatizing the content of the first unstructured message of the second charging standard protocol.
[0105] In some optional embodiments, the transmission method information is determined by the adapter based on the communication request, the first device's charging negotiation, and the identity information of the first device is determined based on the protocol data information received from the first device during the charging negotiation process.
[0106] In some alternative embodiments, the adapter responds to the presence of customized second unstructured information in the protocol data information, and determines the identity information of the first device based on the second unstructured information.
[0107] The method embodiments of the second aspect described above are based on the same inventive concept as the method embodiments of the first aspect. The relevant contents of each embodiment have been described in the method embodiments of the first aspect above, and have the beneficial effects of the corresponding embodiments. They can be understood by referring to the above text, so they will not be repeated here.
[0108] According to a third aspect of the application, an apparatus for setting an audio mode is provided. The apparatus is disposed in an adapter connected between a first device and a second device, and the adapter is configured to supply power to both the first and second devices. (Refer to...) Figure 7 As shown, the device 700 for setting audio modes includes:
[0109] The determining module 702 is used to receive a communication request sent by the first device based on the first charging standard protocol, and determine the transmission mode information of the first device based on the communication request, wherein the transmission mode information is used to indicate the target audio signal transmission mode supported by the first device.
[0110] The setting module 704 is used to perform private settings on the second charging standard protocol according to the transmission method information, and obtain private protocol data information.
[0111] The negotiation module 706 is used to negotiate charging with the second device based on proprietary protocol data information, so that the second device can enter the audio signal transmission mode corresponding to the target audio signal transmission mode based on proprietary protocol data information.
[0112] In some optional embodiments, the setting module 704 is specifically used to: set a predetermined flag bit of the structured message in the second charging standard protocol according to the transmission method information to obtain private protocol data information.
[0113] In some alternative embodiments, the predetermined flag bit includes a reserved flag bit that does not affect charging negotiation.
[0114] In some optional embodiments, the second device enters an audio signal transmission mode corresponding to the target audio signal transmission method based on proprietary protocol data information, including: the second device identifies a predetermined flag bit and determines the target audio transmission mode according to the predetermined flag bit, so as to enter the audio signal transmission mode corresponding to the target audio signal transmission method.
[0115] In some optional embodiments, the first charging standard protocol and the second charging standard protocol are the same charging standard protocol.
[0116] In some alternative embodiments, the charging standard protocol is the Universal Serial Bus Power Transfer Protocol.
[0117] In some optional embodiments, the setting module 704 is specifically used to implement at least one of the following: privately modifying the content of the data header in the second charging standard protocol; adding new data types in the second charging standard protocol; and privately defining the content of the first unstructured message of the second charging standard protocol.
[0118] In some optional embodiments, the determining module 702 is specifically used to: negotiate charging with the first device based on a communication request, and determine the identity information of the first device based on the protocol data information sent by the first device received during the charging negotiation process; and determine the transmission method information based on the identity information.
[0119] In some optional embodiments, the determining module 702 is specifically used to: in response to the existence of customized second unstructured information in the protocol data information, determine the identity information of the first device based on the second unstructured information.
[0120] The apparatus 700 for setting an audio mode provided in the third aspect of this application is based on the same inventive concept as the method for setting an audio mode provided in the first aspect above. It corresponds to the respective methods for setting an audio mode in the foregoing multiple method embodiments and has the beneficial effects of the corresponding method embodiments for setting an audio mode; therefore, it will not be described again here. Furthermore, the implementation of each module in the apparatus 700 for setting an audio mode in this application embodiment can refer to the description of the corresponding part in the foregoing method embodiments for setting an audio mode, and will not be described again here.
[0121] According to a fourth aspect of the application, an apparatus for setting an audio mode is provided. The apparatus is disposed in a second device, which is connected to a first device via an adapter, and the adapter is configured to supply power to both the first and second devices. (Refer to...) Figure 8 As shown, the device 800 for setting audio modes includes:
[0122] The receiving module 802 is used to negotiate charging with the adapter based on the proprietary protocol data information. The proprietary protocol data information is obtained by the adapter through proprietary settings of the second charging standard protocol according to the transmission mode information. The transmission mode information is used to indicate the target audio signal transmission mode supported by the first device. The transmission mode information is determined based on the communication request sent by the first device. The communication request is a request sent by the first device based on the first charging standard protocol.
[0123] The control module 804 is used to enter the audio signal transmission mode corresponding to the target audio signal transmission method based on the proprietary protocol data information.
[0124] In some optional embodiments, the privatization protocol data information is obtained by the adapter setting predetermined flag bits of the structured messages in the second charging standard protocol according to the transmission method information.
[0125] In some alternative embodiments, the predetermined flag bit includes a reserved flag bit that does not affect charging negotiation.
[0126] In some optional embodiments, the control module 804 is specifically used to: identify a predetermined flag bit and determine a target audio transmission mode based on the predetermined flag bit, so as to enter an audio signal transmission mode corresponding to the target audio signal transmission mode.
[0127] In some optional embodiments, the first charging standard protocol and the second charging standard protocol are the same charging standard protocol.
[0128] In some alternative embodiments, the charging standard protocol is the Universal Serial Bus Power Transfer Protocol.
[0129] In some optional embodiments, the privatized protocol data information is obtained by the adapter according to the transmission method information by implementing at least one of the following methods: privatizing the content of the data header in the second charging standard protocol; adding new data types in the second charging standard protocol; and privatizing the content of the first unstructured message of the second charging standard protocol.
[0130] In some optional embodiments, the transmission method information is determined by the adapter based on the communication request, the first device's charging negotiation, and the identity information of the first device is determined based on the protocol data information received from the first device during the charging negotiation process.
[0131] In some alternative embodiments, the adapter responds to the presence of customized second unstructured information in the protocol data information, and determines the identity information of the first device based on the second unstructured information.
[0132] The apparatus 800 for setting an audio mode provided in the fourth aspect of this application is based on the same inventive concept as the method for setting an audio mode provided in the second aspect above. It corresponds to the respective methods for setting an audio mode in the foregoing multiple method embodiments and has the beneficial effects of the corresponding method embodiments for setting an audio mode; therefore, it will not be described again here. Furthermore, the implementation of each module in the apparatus 800 for setting an audio mode in this application embodiment can refer to the description of the corresponding part in the foregoing method embodiments for setting an audio mode, and will not be described again here.
[0133] According to a fifth aspect of the embodiments of this application, an electronic device is provided, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store a computer program; and the processor is used to execute the method of either the first aspect or the second aspect by running the computer program stored in the memory.
[0134] Reference Figure 9 This illustration shows a structural schematic diagram of an electronic device according to an embodiment of this application. The embodiments of this application do not limit the specific implementation of the electronic device. Figure 9 As shown, the electronic device 900 may include: a processor 902, a communications interface 904, a memory 906, and a communications bus 908.
[0135] in:
[0136] The processor 902, communication interface 904, and memory 906 communicate with each other via communication bus 908.
[0137] Communication interface 904 is used to communicate with other electronic devices or servers.
[0138] The processor 902 is used to execute the computer program 910, specifically the relevant steps in the above-described method embodiment for setting the audio mode.
[0139] Specifically, computer program 910 may include program code that includes computer operation instructions.
[0140] The processor 902 may be a CPU, a GPU (Graphics Processing Unit), an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The smart device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0141] Memory 906 is used to store computer program 910. Memory 906 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0142] The computer program 910 may include multiple computer instructions. Specifically, the computer program 910 may use multiple computer instructions to cause the processor 902 to perform the operation corresponding to the method for setting an audio mode described in any of the multiple method embodiments of the first or second aspect.
[0143] The specific implementation of each step in computer program 910 can be found in the corresponding descriptions of the steps and units in the above method embodiments, and has corresponding beneficial effects, which will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.
[0144] According to a sixth aspect of the embodiments of this application, the embodiments of this application also provide a computer storage medium having a computer program stored thereon. When executed by a processor, the computer program implements the method for setting an audio mode described in any of the multiple method embodiments provided in the first or second aspect. The computer storage medium includes, but is not limited to, compact disc read-only memory (CD-ROM), random access memory (RAM), floppy disk, hard disk, or magneto-optical disk, etc.
[0145] According to a seventh aspect of the present application, the present application also provides a computer program product, including a computer program that, when executed by a processor, implements the method for setting an audio mode described in any of the multiple method embodiments provided in the first or second aspect.
[0146] The embodiments of the device 700 / device 800 / electronic device 900 / computer storage medium / computer program product for setting audio modes in this application have been described in detail in the foregoing method embodiments for setting audio modes. Therefore, the relevant content and beneficial effects can be understood by referring to the above method embodiments, and will not be repeated here.
[0147] Furthermore, it should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used for training the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0148] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application. It should be understood that the various technical features in the technical solutions of the embodiments of this application can be combined in any suitable manner.
[0149] The methods described in the embodiments of this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium. Thus, the methods described herein can be stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an Application Specific Integrated Circuit (ASIC) or a Field Programmable Gate Array (FPGA)). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., Random Access Memory (RAM), Read-Only Memory (ROM), Flash Memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.
[0150] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for specific applications, but such implementations should not be considered beyond the scope of the embodiments of this application.
[0151] The above embodiments are only used to illustrate the embodiments of this application, and are not intended to limit the embodiments of this application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this application, and the patent protection scope of the embodiments of this application should be defined by the claims.
[0152] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". It should be noted that the concepts of "first", "second", etc., mentioned in the embodiments of this application are only used to distinguish different devices, modules, or units, and are not used to limit the order of functions performed by these devices, modules, or units or their interdependencies. It should be noted that the modifications of "a" and "a plurality" mentioned in the embodiments of this application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of this application, and are not intended to limit them; although the embodiments of this application have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for setting an audio mode, applied to an adapter connected between a first device and a second device, the adapter being configured to power both the first device and the second device, the method comprising: The system receives a communication request sent by the first device based on a first charging standard protocol, and determines the transmission mode information of the first device based on the communication request, wherein the transmission mode information is used to indicate the target audio signal transmission mode supported by the first device. Based on the transmission method information, the second charging standard protocol is configured to be privatized to obtain privatized protocol data information; The second device negotiates charging based on the proprietary protocol data information, so that the second device enters an audio signal transmission mode corresponding to the target audio signal transmission mode based on the proprietary protocol data information.
2. The method according to claim 1, wherein, The step of privatizing the second charging standard according to the transmission method information to obtain privatized protocol data information includes: Based on the transmission method information, a predetermined flag bit is set for the structured message in the second charging standard protocol to obtain the private protocol data information.
3. The method according to claim 2, wherein, The predetermined flags include reserved flags that do not affect charging negotiation.
4. The method according to claim 2, wherein, The second device, based on the proprietary protocol data information, enters an audio signal transmission mode corresponding to the target audio signal transmission method, including: The second device identifies the predetermined flag bit and determines the target audio transmission mode based on the predetermined flag bit, so as to enter the audio signal transmission mode corresponding to the target audio signal transmission method.
5. The method according to claim 1, wherein, The first charging standard protocol and the second charging standard protocol are the same charging standard protocol.
6. The method according to claim 5, wherein, The charging standard protocol is the Universal Serial Bus Power Transfer Protocol.
7. The method according to any one of claims 1-6, wherein, The privatization of the second charging standard protocol includes at least one of the following methods: The contents of the data header in the second charging standard protocol are modified to be private; Add new settings to the data types in the second charging standard protocol; The content of the first unstructured message of the second charging standard protocol is defined in a private way.
8. The method according to any one of claims 1-7, wherein, Determining the transmission mode information of the first device based on the communication request includes: Based on the communication request, a charging negotiation is conducted with the first device, and the identity information of the first device is determined based on the protocol data information received from the first device during the charging negotiation process. Based on the identity information, the transmission method information is determined.
9. The method according to claim 8, wherein, The step of determining the identity information of the first device based on the protocol data information received from the first device during the charging negotiation process includes: In response to the existence of customized second unstructured information in the protocol data information, the identity information of the first device is determined based on the second unstructured information.
10. A method for setting an audio mode, applied to a second device connected to a first device via an adapter, the adapter being configured to power both the first device and the second device, the method comprising: Based on the proprietary protocol data information, charging negotiation is performed with the adapter. The proprietary protocol data information is obtained by the adapter through proprietary settings of the second charging standard protocol according to the transmission mode information. The transmission mode information is used to indicate the target audio signal transmission mode supported by the first device. The transmission mode information is determined based on the communication request sent by the first device, which is a request sent by the first device based on the first charging standard protocol. Based on the privatization protocol data information, the system enters the audio signal transmission mode corresponding to the target audio signal transmission method.
11. An apparatus for setting an audio mode, disposed in an adapter connected between a first device and a second device, the adapter being configured to power the first device and the second device, the apparatus comprising: The determining module is configured to receive a communication request sent by the first device based on a first charging standard protocol, and determine the transmission mode information of the first device based on the communication request, wherein the transmission mode information is used to indicate the target audio signal transmission mode supported by the first device; The setting module is used to perform private settings on the second charging standard protocol according to the transmission method information to obtain private protocol data information. The negotiation module is used to negotiate charging with the second device based on the proprietary protocol data information, so that the second device can enter the audio signal transmission mode corresponding to the target audio signal transmission mode based on the proprietary protocol data information.
12. An apparatus for setting an audio mode, disposed in a second device, the second device being connected to a first device via an adapter, the adapter being configured to supply power to both the first device and the second device, the apparatus comprising: The receiving module is used to negotiate charging with the adapter based on proprietary protocol data information. The proprietary protocol data information is obtained by the adapter through proprietary settings of the second charging standard protocol according to the transmission mode information. The transmission mode information is used to indicate the target audio signal transmission mode supported by the first device. The transmission mode information is determined based on the communication request sent by the first device, which is a request sent by the first device based on the first charging standard protocol. The control module is used to enter the audio signal transmission mode corresponding to the target audio signal transmission mode based on the private protocol data information.
13. An electronic device, comprising: The processor, the communication interface, the memory, and the communication bus are provided, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus. The memory is used to store computer programs; The processor is configured to perform the method of any one of claims 1-10 by running the computer program stored in the memory.
14. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-10.
15. A computer program product having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-10.