WO2022237609A1 - Communication control method, electronic device and earphones - Google Patents

Communication control method, electronic device and earphones Download PDF

Info

Publication number
WO2022237609A1
WO2022237609A1 PCT/CN2022/090912 CN2022090912W WO2022237609A1 WO 2022237609 A1 WO2022237609 A1 WO 2022237609A1 CN 2022090912 W CN2022090912 W CN 2022090912W WO 2022237609 A1 WO2022237609 A1 WO 2022237609A1
Authority
WO
WIPO (PCT)
Prior art keywords
earphone
target application
identification information
communication
electronic device
Prior art date
Application number
PCT/CN2022/090912
Other languages
French (fr)
Chinese (zh)
Inventor
黄黎
吴远汉
Original Assignee
维沃移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2022237609A1 publication Critical patent/WO2022237609A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72469User interfaces specially adapted for cordless or mobile telephones for operating the device by selecting functions from two or more displayed items, e.g. menus or icons
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72484User interfaces specially adapted for cordless or mobile telephones wherein functions are triggered by incoming communication events
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application belongs to the technical field of communication, and in particular relates to a communication control method, electronic equipment and earphones.
  • an earphone can assist the electronic device in realizing playback of audio data.
  • multiple applications Applications, APPs
  • the electronic device will select the application with the highest priority to communicate with the headset according to the priorities of the multiple applications.
  • the electronic device will select the One of the audio APP or the video APP communicates with the headset.
  • the electronic device selects one of the applications to communicate with the headset, which will cause other applications to be unable to communicate with the headset, resulting in users being unable to use other applications provided functionality.
  • the purpose of the embodiments of the present application is to provide a communication control method, an electronic device, and an earphone, which can solve the problem that the functions of some application programs cannot be used when multiple application programs need to communicate with the earphone at the same time.
  • an embodiment of the present application provides a communication control method, which is applied to an electronic device wirelessly connected to an earphone, and the method includes:
  • the target application program is controlled to communicate with the headset having the same communication identification information.
  • the embodiment of the present application provides another communication control method, which includes:
  • the earphone is wirelessly connected to the electronic device, and the electronic device is used to determine that there are no less than two target application programs that have earphone communication requirements among the multiple running application programs, respectively
  • the target application program sets different communication identification information
  • an electronic device which includes:
  • a first determining module configured to determine a target application program with headset communication requirements from multiple running application programs
  • a setting module configured to set different communication identification information for the target application programs respectively when the number of the target application programs is not less than 2;
  • the communication module is used to control the target application program to communicate with the headset having the same communication identification information.
  • an earphone which includes:
  • a determining module configured to determine the communication identification information of the earphone; the earphone is wirelessly connected to the electronic device, and the electronic device is used to determine that there are no less than 2 target applications with earphone communication requirements among the multiple application programs running In the case of each, set different communication identification information for the target application programs respectively;
  • a communication module configured to control the headset to communicate with the target application program having the same communication identification information.
  • the embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and the program or instruction is executed by The processor implements the steps of the method described in the first aspect or the second aspect when executed.
  • the embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the implementation as described in the first aspect or the second aspect is realized. steps of the method.
  • the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect Or the method described in the second aspect.
  • the electronic device determines the target application program that has earphone communication requirements from the running multiple application programs, and when the number of target application programs is not less than two, set different
  • the communication identification information is used to control the target application program to communicate with the headset having the same communication identification information.
  • the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
  • Fig. 1 is a flowchart of steps of a communication control method provided according to an exemplary embodiment
  • Fig. 2 is a flowchart of steps of another communication control method provided according to an exemplary embodiment
  • Fig. 3 is a schematic diagram of mode setting provided according to an exemplary embodiment
  • Fig. 4 is a schematic diagram of an earphone selection interface provided according to an exemplary embodiment
  • Fig. 5 is a schematic diagram of another earphone selection interface provided according to an exemplary embodiment
  • Fig. 6 is a schematic diagram of a communication establishment process provided according to an exemplary embodiment
  • Fig. 7 is a schematic diagram of an application selection interface provided according to an exemplary embodiment
  • Fig. 8 is a flow chart of the steps of another communication control method provided according to an exemplary embodiment
  • Fig. 9 is a schematic diagram of a chat interface provided according to an exemplary embodiment.
  • Fig. 10 is a schematic flow chart of voice playback provided according to an exemplary embodiment
  • Fig. 11 is a schematic structural diagram of an electronic device according to an exemplary embodiment
  • Fig. 12 is a schematic structural diagram of an earphone provided according to an exemplary embodiment
  • Fig. 13 is a schematic structural diagram of another electronic device provided according to an exemplary embodiment
  • Fig. 14 is a schematic diagram of a hardware structure of an electronic device according to an exemplary embodiment.
  • FIG. 1 is a flow chart of the steps of a communication control method provided according to an exemplary embodiment.
  • the method is applied to an electronic device wirelessly connected to an earphone, and may include:
  • Step 101 Determine a target application program that has a headset communication requirement from multiple running application programs.
  • the communication control method may be executed by an electronic device, such as a terminal device such as a mobile phone, a computer, and a tablet computer.
  • the electronic device and the headset can be connected through a wireless connection, and the electronic device can execute a communication control method to control multiple target application programs in the electronic device to communicate with the corresponding headset.
  • the headset includes a first Bluetooth headset and a second Bluetooth headset
  • the first Bluetooth headset and the second Bluetooth headset can be a set of separate Bluetooth headsets
  • the first Bluetooth headset is set as the main for a pair of headphones.
  • the electronic device can establish a communication connection with the main earphone through the internally integrated Bluetooth module, and the main earphone can receive communication data sent by the electronic device, or send communication data to the electronic device.
  • the main earphone can forward the received communication data to the auxiliary earphone, when the auxiliary earphone sends communication data to the electronic device, it can send the communication data to the main earphone, and the main earphone forwards the communication data to the electronic device.
  • the main earphone is responsible for pairing with the electronic device, setting pairing information to establish a communication connection between the main earphone and the electronic device, and receiving or sending communication data to the electronic device based on the established communication connection.
  • the main earphone can send pairing information to the auxiliary earphone, and the auxiliary earphone can imitate the main earphone according to the pairing information to receive communication data sent by the electronic device, or send communication data to the electronic device.
  • the specific communication methods between the separate Bluetooth headset and the electronic device may include but not limited to the above two communication methods, and any communication methods known or unknown in the art may be applied in this embodiment. It should be noted that when there are multiple Bluetooth headsets, the multiple Bluetooth headsets may also be independent Bluetooth headsets, and each Bluetooth headset may respectively establish a communication connection with an electronic device.
  • the target application program is an application program having a headset communication requirement among multiple currently running applications, and the headset communication requirement includes an audio output requirement or an audio input requirement, or includes both an audio input requirement and an audio output requirement.
  • the target application program can be an audio APP for playing music, a video APP for playing video, and a calling APP for calling. Audio APP, video APP and calling APP can all be Communicate with the Bluetooth headset and output audio data through the Bluetooth headset.
  • the Bluetooth headset may generate a control instruction in response to a user operation, and send the control instruction to a corresponding APP.
  • the electronic device may determine a target application program from multiple currently running application programs, so as to control the target application program to communicate with the earphone.
  • the electronic device may determine that a Bluetooth headset is connected and detects that the application program is started, if the application program needs to output audio data, it may determine that the application program is a target application program that needs to communicate with the headset.
  • the specific process for the electronic device to determine the target application program can be set according to requirements, which is not limited in this embodiment.
  • Step 102 When the number of target application programs is not less than two, set different communication identification information for the target application programs respectively.
  • the electronic device when the electronic device determines that the number of target application programs is greater than or equal to two, it can set different communication identification information for the target application programs, so as to control the communication between the target application programs and the communication identification information of the target application programs. Headphones with the same communication identification information communicate.
  • the user may preset the priority of each target application for all target applications in the electronic device, and the electronic device may set the communication identification information of the target application according to the priority of the target application.
  • the user can preset the priority of the calling APP as 2, the priority of the video APP as 5, and the priority of the audio APP as 7.
  • the electronic device determines that the target application programs include audio APP, video APP and calling APP, it can set the communication identification information of the calling APP to A and the communication identification information of the video APP to A according to the priority order of the audio APP, video APP and calling APP.
  • the communication identification information of the audio APP is C.
  • the specific form of the communication identification information and the specific setting method of the communication identification information may be set according to requirements, which are not limited in this embodiment.
  • Step 103 controlling the target application program to communicate with the headset having the same communication identification information.
  • the earphone can set the communication identification information of the earphone according to the method for setting communication identification information of an electronic device.
  • the user can preset the priority of the main earphone as 1 and the priority of the secondary earphone as 2.
  • the main earphone can set the communication identification information of the main earphone as A, and set the communication identification information of the auxiliary earphone as B according to the order of priority.
  • the main earphone can randomly set the communication identification information of one of the bluetooth earphones to A, and the communication identification information of the other bluetooth earphone to be B.
  • the communication identification information of the main earphone is the same as that of the call APP
  • the communication identification information of the secondary earphone is the same as that of the video APP.
  • the main earphone and the auxiliary earphone can also negotiate with each other, and the main earphone and the auxiliary earphone are set to have different communication identification information respectively.
  • the multiple Bluetooth headsets are independent Bluetooth headsets
  • the multiple Bluetooth headsets can be negotiated to set each Bluetooth headset to have different communication identification information.
  • the specific negotiation process can be set according to requirements, which is not limited in this embodiment.
  • step 103 may be implemented in the following manner:
  • the electronic device when the electronic device communicates with the separate Bluetooth headset in the first communication mode, after the electronic device outputs the audio data from the calling APP, it can first package and generate a data packet including the audio data and communication identification information A, and then send the audio data to the host The headset sends packets.
  • the main earphone after receiving the data packet, the main earphone can determine that the communication identification information A in the data packet is the same as its own communication identification information A, and at this time, the main earphone can directly play the audio data in the data packet.
  • the video APP outputs the audio data
  • the electronic device after the video APP outputs the audio data, the electronic device can first package and generate a data packet including the audio data and communication identification information B, and then send the data packet to the main earphone.
  • the main earphone after the main earphone receives the data packet, it can determine that the communication identification information B in the data packet is different from its own communication identification information. At this time, the main earphone can send the audio data in the data packet to the auxiliary earphone, and the auxiliary earphone can receive And play the audio data forwarded by the main earphone.
  • the main earphone After receiving the user operation and generating the control instruction, the main earphone can package and generate a data packet including the control instruction and communication identification information A, and send the data packet to the electronic device. Correspondingly, after receiving the data packet, the electronic device can determine that the communication identification information A in the data packet is the same as the communication identification information A of the calling APP, and then forward the control instruction in the data packet to the calling APP. Similarly, after receiving a user operation and generating a control instruction, the secondary earphone can send a control instruction to the main earphone. After receiving the control instruction sent by the auxiliary earphone, the main earphone packs and generates a data packet including the control instruction and communication identification information B, and sends the data packet to the electronic device. Correspondingly, after receiving the data packet, the electronic device can determine that the communication identification information B in the data packet is the same as the communication identification information B of the video APP, and can forward the control instruction in the data packet to the video APP.
  • the secondary headset when the electronic device communicates with the separate Bluetooth headset in the second communication mode, when the secondary headset receives the data including the communication identification information B, it can determine the communication identification information B in the data packet and the The communication identification information B of itself is the same, and the audio data in the data packet can be played. Conversely, when a data packet including communication identification information A is received, it can be determined that the communication identification information A in the data packet is different from its own communication identification information B, then discard the packet. Similarly, when the main earphone receives the data packet including the communication identification information A, it plays the audio data in the data packet, and when it receives the data packet including the communication identification information B, it discards the data packet.
  • the electronic device controls the communication between the target application program and the corresponding earphone, it determines the corresponding relationship between the earphone and the target application program according to the communication identification information in the communication data, and can accurately control the communication between the target application program and the corresponding earphone. communication.
  • the electronic device can also package and generate a data packet including the audio data and the communication identification information C, and then send the data packet including the communication identification information C to the main earphone.
  • the communication identification information in the data packet is different from the communication identification information of the primary earphone and the secondary earphone, the data packet is discarded by the primary earphone and the secondary earphone.
  • the separate Bluetooth headset may further include a third Bluetooth headset.
  • the communication identification information of the third Bluetooth headset can be set to C, and at this time the electronic device can control the audio APP to communicate with the third Bluetooth headset.
  • the electronic device can first communicate with the main earphone to determine the number of earphones, and when the number of target applications is greater than the number of bluetooth earphones, it can control the low-priority audio APP to stop outputting audio data according to the priority of the target application.
  • the number of earphones in the separate Bluetooth earphones can be set according to requirements, which is not limited in this embodiment.
  • each earphone may be used by a different user.
  • the primary headset can be worn by user A
  • the secondary headset can be worn by user B.
  • the electronic device stops the audio APP and video APP according to the priorities of the calling APP, audio APP and video APP, and controls the communication between the calling APP and the Bluetooth headset, the audio APP and the video APP cannot provide corresponding functions for the user.
  • the electronic device can control the call APP to communicate with the primary headset, and control the video APP to communicate with the secondary headset.
  • User A can answer calls through the primary headset, and user B can watch videos through the secondary headset.
  • user A and user B can exchange earphones.
  • the electronic device determines the target application program that has earphone communication requirements from among the running multiple application programs. Different communication identification information is set, and the target application program is controlled to communicate with the headset with the same communication identification information.
  • the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
  • the method may include:
  • the electronic device may also perform steps 101 to 103 to control the target application program to communicate with the headset with the same communication identification information.
  • the electronic device may not set the communication identification information of the target application program, and not add the communication identification information of the target application program when sending communication data to the earphone.
  • all earphones can receive and process the communication data sent by the electronic device.
  • the electronic device can forward all communication data sent by the headset to the target application.
  • FIG. 2 is a flowchart of steps of another communication control method provided according to an exemplary embodiment.
  • the method may include:
  • step 201 the electronic device determines a target application program that requires earphone communication from multiple running application programs.
  • Step 202 when the number of target application programs is not less than two, the electronic device sets different communication identification information for the target application programs respectively.
  • the method may also include:
  • the communication identification information corresponding to the target application program is sent to the earphone, so that the communication identification information of the earphone is the same as the communication identification information corresponding to the target application program.
  • the headset can receive the communication identification information of the target application sent by the electronic device;
  • the communication identification information of the headset is set to be the same as the communication identification information of at least one target application program.
  • the electronic device may send the communication identification information of the target application programs to the earphone in advance, and the communication identification information is the target information of the target application programs. information to cause the headset to set its own communication identification information to be the same as that of one or more of the target applications.
  • the user can pre-set different modes for the target application, and the electronic device can use the mode information of the target application as communication identification information, or set different communication identification information for the target application based on the mode information.
  • Figure 3 is a schematic diagram of a mode setting provided according to an exemplary embodiment, the desktop of the electronic device displays the application program icons of call APP, audio APP and video APP, and the user can press and hold the call APP An application program icon 301 , and the electronic device displays a mode selection interface 302 in response to a user's long press operation.
  • the mode selection interface 302 includes a mode selection control 303 corresponding to the call mode, and mode selection controls for listening to music mode and video mode.
  • the user can click the mode selection control 303, and the electronic device can set the call APP as the call mode in response to the user's click operation. Similarly, you can set the video APP to the video mode, and set the audio APP to the listening mode.
  • the mode setting method can be set according to requirements, which is not limited in this embodiment.
  • the user can set different modes to have different mode levels, and different modes correspond to different priorities, and the electronic device can determine the priority of the application program according to the mode of the target application program.
  • the mode level of the call mode is 2
  • the mode level of the listening mode is 7
  • the mode level of the video mode is 5.
  • the electronic device can determine the priority of the target application program according to the mode level of the target application program.
  • the first input is used to determine the headset corresponding to the target application.
  • the electronic device may display a headset selection interface, receive a user's first input based on the headset selection interface, and determine the headset corresponding to the target application program in response to the first input.
  • FIG. 4 is a schematic diagram of an earphone selection interface provided according to an exemplary embodiment.
  • the earphone selection interface may include a first target image 401 corresponding to the main earphone, and a first target image 401 corresponding to the secondary earphone.
  • the first input is, for example, a drag operation.
  • the user can press the first control 403 and drag it. If the first control 403 is dragged by the user onto the first target image 401, the electronic device can respond to the user's drag operation to create Correspondence between the main earphone and the call APP, and send a data packet including the mode information of the call mode and the identification information of the main earphone to the main earphone.
  • the mode information in the data packet is the target of the call APP sent by the electronic device to the main earphone information.
  • the electronic device can establish a correspondence between the video APP and the secondary earphone, and send mode information including the video mode and the secondary earphone to the primary earphone.
  • a packet of identification information may be set according to requirements, which is not limited in this embodiment.
  • the main earphone after the main earphone receives the data packet sent by the electronic device, if the data packet includes its own identification information, it can set the main earphone to the call mode according to the mode information in the data packet. Similarly, after the main earphone receives the data packet, if the data packet includes the identification information of the auxiliary earphone, the auxiliary earphone can be set to the video mode according to the mode information in the data packet.
  • the electronic device may use the mode information of the target application program as the communication identification information, and the main earphone may also use the mode information of the earphone as the communication identification information, so that the target application program is the same as the communication identification information of the corresponding earphone.
  • the electronic device can communicate with the main earphone in advance to obtain the identification information of the main earphone and the auxiliary earphone, or the electronic device can use the priority as the identification information of the earphone by default.
  • the electronic device is displaying the earphone selection interface.
  • the target images respectively corresponding to priority 1 and priority 2 may be displayed on the earphone selection interface.
  • the main earphone can set the main earphone with priority 1 to the call mode, and set the secondary earphone with priority 2 to the video mode.
  • the specific forms of the mode information and the identification information can be set according to requirements, which is not limited in this embodiment.
  • the electronic device may control the target application program to communicate with all earphones when the number of target application programs is less than two.
  • an earphone selection interface is displayed, and a target image corresponding to a newly added target application program may be displayed in the earphone selection interface.
  • Figure 5 is a schematic diagram of another earphone selection interface provided according to an exemplary embodiment.
  • the electronic device can control the video APP to communicate with the main The headset and the secondary headset communicate.
  • the electronic device can display the earphone selection interface, which includes the first control 403 corresponding to the newly added call APP and the first target image 401 corresponding to the main earphone The second target image 402 corresponding to the secondary earphone.
  • the user can press and drag the first control 403. If the first control 403 is dragged onto the first target image 401, the corresponding relationship between the main earphone and the call APP will be established, and the call APP will be sent to the main earphone. mode information.
  • the secondary earphone corresponding to the second target image 402 can be automatically set to correspond to the video APP, establish a corresponding relationship between the secondary earphone and the video APP, and send the mode information of the video APP to the secondary earphone.
  • the electronic device can also establish a corresponding relationship between the target application program and multiple earphones based on the earphone selection interface, and send mode information corresponding to the target application program, that is, target information, to each earphone, so that the The target application is the same as the communication identification information of multiple headsets.
  • the earphone selection interface may further include a third target image 406 , and the third target image 406 corresponds to both the primary earphone and the secondary earphone.
  • the electronic device can determine that the calling APP corresponds to the main earphone and the auxiliary earphone at the same time, and send the mode information including the calling APP, the main earphone and the auxiliary earphone to the earphone A packet of identification information.
  • the mode of the main earphone and the auxiliary earphone can be set as the call mode.
  • the mode information of the calling APP, the main earphone and the auxiliary earphone are the same.
  • the calling APP, the main earphone and the auxiliary earphone can be set to have the same communication identification information, and the calling APP can communicate with the main earphone and the auxiliary earphone at the same time.
  • the specific form of the earphone selection interface and the interaction mode between the user and the earphone selection interface can be set according to requirements, which is not limited in this embodiment.
  • the electronic device displays the earphone selection interface, and the user can manually select the earphone corresponding to the target application program through the earphone selection interface, which can facilitate the user to choose the earphone for wearing. corresponding target application.
  • the method may also include:
  • the control target application program communicates with the corresponding audio output module.
  • the audio output module is, for example, a module with an audio output function such as a microphone and a loudspeaker integrated in the electronic device.
  • the second input is used to determine the audio output module corresponding to the target application program
  • the electronic device may also receive the user's second input based on the earphone selection interface, and establish a relationship between the target application program and the audio output module in response to the second input. The corresponding relationship between them, and control the communication between the target application program and the corresponding audio output module.
  • the earphone selection interface may further include a fourth target image 407 corresponding to the audio output module, and the fourth target image 407 corresponds to a speaker integrated in the electronic device.
  • the second input is, for example, a drag operation.
  • the electronic device can determine that the calling APP corresponds to the speaker, and establish a correspondence between the calling APP and the speaker. At this time, after the calling APP outputs the audio data, the electronic device can forward the audio data to the speaker, and play the audio data through the speaker.
  • the specific form of the second input can be set according to requirements, which is not limited in this embodiment.
  • the electronic device may stop other target application programs. For example, when it is determined that the calling APP corresponds to the speaker, the video APP and the audio APP may be stopped. Alternatively, the electronic device may also continue to control other target application programs to communicate with the corresponding headset. For example, when it is determined that the video APP corresponds to the speaker and the call APP corresponds to the main earphone, the call APP can be continuously controlled to communicate with the main earphone. At this time, the user can watch the video played by the video APP through the speaker, and talk through the main earphone.
  • the electronic device establishes the corresponding relationship between the target application program and the audio output module based on the earphone selection interface, and controls the target application program to communicate with the audio output module, which can facilitate the user to operate the electronic device flexibly.
  • the specific process of determining the audio output module corresponding to the target application program based on the earphone selection interface can be set according to requirements, which is not limited in this embodiment.
  • the earphone selection interface may further include an operation control corresponding to the target application program, so as to facilitate the user to quickly operate the target application program.
  • the earphone selection interface may include a text message reply control 408 , and the text message reply control 408 corresponds to the call APP.
  • the electronic device may respond to the user's click operation to enter the text message editing interface, edit the text message, and send the text message to the calling user.
  • the specific content included in the earphone selection interface can be set according to requirements, which is not limited in this embodiment.
  • the method may also include:
  • the communication identification information is the same.
  • the earphone may receive the target information of the target application program sent by the electronic device; based on the target information, set the communication identification information of the earphone to be the same as the communication identification information of at least one target application program.
  • the electronic device may send the target information of the target application to the earphone, so that the earphone outputs indication information corresponding to the target application, and when a user operation corresponding to the indication information is received, set the earphone's
  • the communication identification information is the same as the communication identification information indicating the target application to which the information belongs.
  • the electronic device may send the mode information of the call APP, the mode information of the audio APP, and the mode information of the video APP to the main earphone.
  • the main earphone can control the main earphone and the auxiliary earphone to output corresponding indication information.
  • the main earphone can control the main earphone and the auxiliary earphone to output the first voice at the same time, "Please double-click the pause button to set the earphone to the call mode".
  • the main earphone can respond to the user's double-click operation, and set the main earphone to the call mode.
  • the electronic device and the main earphone can use the mode information as the communication identification information at the same time, so that the calling APP and the main earphone have the same communication identification information.
  • both the main earphone and the auxiliary earphone when both the main earphone and the auxiliary earphone receive the operation of double-clicking the pause button by the user, both the main earphone and the auxiliary earphone can be set to the call mode.
  • the main earphone After outputting the first voice, the main earphone can control the main earphone and the secondary earphone to output the second voice at the same time, "Please click the pause button to set the earphone to video mode". If the user clicks the pause button in the main earphone, the main earphone can respond Based on the user's single-click operation, the main headset is set to video mode.
  • both the primary earphone and the secondary earphone When both the primary earphone and the secondary earphone receive the operation of clicking the pause button by the user, both the primary earphone and the secondary earphone are set to the video mode.
  • the specific type and output mode of the indication information can be set according to the requirement. After the earphone mode is set for the first time, if the user operation corresponding to the indication information is received for the second time, the earphone mode can be continued to be changed.
  • the headset outputs instruction information corresponding to the target application program, instructing the user to operate the headset to set the communication identification information of the headset to determine the target application program corresponding to the headset, which can facilitate the user using the headset to select the target application program corresponding to the headset according to needs .
  • Step 203 the earphone determines the communication identification information of the earphone.
  • the earphone is wirelessly connected with the electronic device, and the electronic device is configured to configure different communication identification information for the target application programs respectively under the condition that there are no less than two target application programs in the currently running application programs.
  • Step 204 the target application program communicates with the headset with the same communication identification information.
  • the method may also include:
  • the control command is determined to be an invalid command.
  • the electronic device may set the control instruction received by the target application program with a lower priority as an invalid instruction according to the priority of the target application program, so as to prevent multiple earphones from simultaneously controlling the electronic device.
  • the electronic device may determine the priority of the target application program according to the mode level of the target application program. After the electronic device receives the data packet sent by the earphone, if the data packet includes the control command sent by the secondary earphone and the mode information of the video mode, the electronic device can determine that the priority of the video APP is low according to the priorities of the video APP and the calling APP.
  • the electronic device may not transmit the control command to the video APP, or control the video APP not to execute the control command.
  • the electronic device may not transmit the control command to the video APP, or control the video APP not to execute the control command.
  • the control command sent by setting the secondary earphone is invalid, only user A wearing the primary earphone can operate the electronic device through the earphone.
  • the electronic device can set the control commands received by the target application program with lower priority as invalid commands according to the priority of the target application program, which can prevent multiple earphones from simultaneously controlling the electronic device and affecting the user's understanding of the electronic device. Normal use.
  • the method may also include:
  • the control instruction does not match other target application programs except the target application program corresponding to the earphone, then it is determined that the control instruction is an invalid instruction.
  • the electronic device after the electronic device receives a control instruction belonging to a certain application program, it can determine that the control instruction that affects other target application programs is invalid according to the influence of the control instruction on other target application programs, so as to avoid multiple headsets When controlling electronic devices at the same time, they interfere with each other.
  • the electronic device after the electronic device receives the data packet sent by the earphone, if the data packet includes the control command sent by the secondary earphone and the mode information of the video mode, it can first determine that the control command belongs to the video APP. At this time, the electronic device can determine whether the execution of the control instruction will affect the calling APP. For example, the electronic device can determine the operation object corresponding to the control instruction.
  • the operation object corresponding to the control instruction is a hardware module such as a keyboard or a display screen in the electronic device, then If it is determined that the execution of the control instruction may affect the operation of the call APP, that is, it will affect the normal call, then it is determined that the control instruction does not match the call APP, and it is determined that the control instruction is an invalid instruction. At this time, the control instruction is not executed and will not affect the user's normal conversation.
  • the specific method for determining that the control instruction does not match the target application program can be set according to requirements, which is not limited in this embodiment.
  • the electronic device After the electronic device receives the control command sent by the earphone, if the control command does not match the target application program other than the target application program corresponding to the earphone, it will determine that the control command is invalid, which can prevent multiple earphones from simultaneously controlling When electronic devices are connected, they interfere with each other and affect user operations. On the contrary, the control instruction can be executed normally, so that the user can operate the application program to which the control instruction belongs.
  • the electronic device determines the target application program that has earphone communication requirements from among the running multiple application programs. Different communication identification information is set, and the target application program is controlled to communicate with the headset with the same communication identification information.
  • the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
  • the method may also include:
  • the target application corresponding to the new headset is controlled to communicate with the new headset.
  • the electronic device while controlling the target application program to communicate with the corresponding earphone, can establish a communication connection with the new earphone, so as to control one of the target application programs to communicate with the new earphone.
  • the new headset may be, for example, a newly added third Bluetooth headset.
  • FIG. 6 is a schematic diagram of a communication establishment process provided according to an exemplary embodiment.
  • the electronic device controls the call APP to communicate with the primary earphone, and controls the video APP to communicate with the secondary earphone.
  • user A is using the first bluetooth headset to talk
  • user B is using the second bluetooth headset to watch video
  • user C can operate the third bluetooth headset, send a communication request to the electronic device, and request to pair with the electronic device to receive into the communication process between one of the target applications and the headset.
  • the electronic device may output notification information to notify the main user controlling the electronic device, and the main user may be user A or user B.
  • the electronic device may display a pairing interface in response to the main user's operation of clicking on the notification information. If the main user agrees to pair the electronic device with the third Bluetooth headset, the confirmation button in the pairing interface can be clicked. The electronic device may establish a communication connection with the third Bluetooth headset in response to the main user's operation of clicking the confirmation button. Conversely, if the main user does not agree to the access of the third Bluetooth headset, the electronic device can be operated to reject the communication request of the third Bluetooth headset.
  • the specific process of establishing a communication connection between the electronic device and the new earphone can be set according to requirements, which is not limited in this embodiment.
  • the electronic device may select a corresponding target application program of the new earphone based on the application selection interface.
  • Figure 7 is a schematic diagram of an application selection interface provided according to an exemplary embodiment.
  • the main user can operate the electronic device to make the electronic device display
  • the application selection interface includes the target images of multiple target applications currently running, and the fourth control 701 corresponding to the third Bluetooth headset. If the main user controls the fourth control 701 corresponding to the third Bluetooth headset 701 is dragged onto the target image 702 of the calling APP, and the electronic device may determine that the calling APP corresponds to the third Bluetooth headset in response to the main user's drag operation.
  • the electronic device can send the mode information of the call APP to the third Bluetooth headset, and the third Bluetooth headset can output the corresponding third voice "do you agree to join the call" after receiving the mode information.
  • user C agrees to access, he can click the confirmation button in the Bluetooth headset, and the third Bluetooth headset can respond to the click operation, and set the mode of the third Bluetooth headset as a call mode, that is, set the communication identification information of the third Bluetooth headset and the call APP
  • the communication identification information is the same.
  • the communication identification information of the first Bluetooth earphone and the third Bluetooth earphone are the same as the communication identification information of the call APP, and the electronic device can control the call APP to communicate with the first Bluetooth earphone and the third earphone at the same time, so wearing the first Bluetooth earphone User A with the bluetooth headset and user C with the third bluetooth headset can answer calls at the same time. Conversely, if user C does not agree to access, the earphone can be controlled to refuse access to the communication process between the calling APP and the first Bluetooth earphone.
  • user C who uses the third Bluetooth headset can actively operate the third Bluetooth headset to send an access request to the electronic device, so that the electronic device is set to the same A target application program corresponding to the third Bluetooth headset.
  • user C when the main user does not select a target application program for the third Bluetooth headset, user C can double-click the pause button in the third Bluetooth headset, and the third Bluetooth headset can respond to the double-click operation of user C, to The electronic device sends an access request.
  • the electronic device determines that there is only one target application program currently running, it may directly determine that the third Bluetooth headset corresponds to the calling APP. Alternatively, the electronic device may output notification information to notify user A.
  • the electronic device may display an application program selection interface as shown in FIG. 7 , and configure a corresponding target application program for the third Bluetooth headset.
  • the access process of the third Bluetooth headset can be set according to requirements, which is not specifically limited in this embodiment.
  • the electronic device in the process of controlling the target application program to communicate with the headset, can establish a communication connection with the unconnected headset to add a new headset, and control the new headset to communicate with the target application program, which can facilitate user expansion.
  • the number of headphones in the process of controlling the target application program to communicate with the headset, the electronic device can establish a communication connection with the unconnected headset to add a new headset, and control the new headset to communicate with the target application program, which can facilitate user expansion. The number of headphones.
  • the target application when the target application communicates with multiple earphones at the same time, when the electronic device receives the communication data sent by the earphones, it may add the identification information of the earphones to the communication data. For example, when the electronic device receives the audio data sent by the first Bluetooth headset, it may add the identification information of the first Bluetooth headset to the audio data, and forward the audio data to the calling APP. Similarly, when the electronic device receives the audio data sent by the third Bluetooth headset, it can add the identification information of the third Bluetooth headset to the audio data, and forward the audio data to the calling APP. At this time, the calling APP can determine the source of the audio data according to the identification information in the audio data, so that the calling APP can process the audio data differently according to the source of the audio data. Audio data is stored separately.
  • the user can set different functions of the control commands in different modes.
  • the user can set that in the call mode, the function of the double-click instruction is to activate the assist input function in the target program.
  • the electronic device controls the call APP to communicate with the main earphone
  • the main earphone receives the user's double-click operation, it can generate a double-click instruction and send a data packet including the double-click instruction to the electronic device.
  • the calling APP may respond to the double-click instruction to activate the assist input function of the calling APP.
  • the calling APP can perform voice recognition on the content of the call.
  • the electronic device controls the communication between the audio APP and the earphone, if the earphone receives the user's double-click operation, it can generate a double-click instruction and send a data packet including the double-click instruction to the electronic device.
  • the audio APP can respond to the double-click instruction to activate the collection function and collect the currently playing music.
  • the user can set different modes for the application program, and set different functions of the control commands in different modes, which can facilitate the user to control the electronic device to realize different functions when using different application programs.
  • FIG. 8 is a flowchart of steps of another communication control method provided according to an exemplary embodiment.
  • the method may include:
  • Step 801. Determine communication identification information of the headset.
  • Step 802 controlling the earphone to communicate with the target application program having the same communication identification information.
  • step 802 may be implemented in the following manner:
  • step 801 and step 802 may be performed by the earphone in the foregoing embodiment, which will not be described in detail in this embodiment.
  • the communication identification information of the earphone is determined, and based on the communication identification information of the earphone, the earphone is controlled to communicate with the target application program having the same communication identification information.
  • the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
  • the user can set different commands to have different functions, for example, the first command is used to play voice information, and the second command is used to reply to the currently played voice message.
  • the first instruction is, for example, a single-click instruction
  • the second instruction is, for example, a double-click instruction.
  • the first instruction and the second instruction may also be instructions in other forms.
  • Figure 9 is a schematic diagram of a chat interface provided according to an exemplary embodiment
  • Figure 10 is a schematic flowchart of a voice playback provided according to an exemplary embodiment
  • the chat APP may output prompt information when receiving the first voice message 901 .
  • the electronic device can send the prompt information to the bluetooth headset, at this time, the bluetooth headset outputs prompt information, prompting the user user B wearing the bluetooth headset to receive the voice information. If user B clicks the play button in the bluetooth headset, the bluetooth headset can generate a click instruction and send the click instruction to the electronic device.
  • the chat APP may play the received first voice information 901 in response to the click instruction.
  • the Bluetooth headset can generate a double-click instruction.
  • the chat APP receives the double-click instruction forwarded by the electronic device, it can control the chat APP to start replying to the currently playing first voice message 901.
  • User B can input the second voice message 902 through the Bluetooth headset.
  • the chat APP receives the bluetooth headset
  • the second voice information 902 may be sent to user A.
  • user B double-clicks the button again it can reply to user A's first voice information 901 again, generate and send third voice information 903 to user A.
  • the electronic device may continuously play the received voice information.
  • the chat APP continuously sends the second voice message 902 and the third voice message 903 to the user A.
  • the chat APP can continue to send the fourth voice information 904 to the Bluetooth headset, so that the Bluetooth headset can play the fourth voice information 904 .
  • the chat APP may wait for a preset time period, for example, 2 seconds. If the double-click instruction sent by the Bluetooth headset is not received within the preset time period, the fifth voice message 905 will continue to be played. And so on, until the last voice message is played.
  • the last voice message After playing the last voice message, if a double-click instruction is received within the preset time period, the last voice message will be replied. Conversely, if after waiting for a preset period of time, the double-click instruction sent by the Bluetooth headset is not received, then continue to determine whether the voice message sent by other users is received, and if the voice message of other users is received, continue to play the voice message of other users , if no voice messages from other users are received, the voice message playback will end.
  • the chat APP when the chat APP plays the voice information, it can mark the voice information according to the received single-click instruction and double-click instruction, and divide the voice information.
  • FIG. 9 when playing the first voice message 901 sent by user A, user B replies to the second voice message 902 and the third voice message 903 continuously, then the first voice message 901, the second voice message 902 can be and the third voice information 903 are determined as the first topic, and at the same time, the first voice information 901 is marked to determine that user B has replied to the first voice information 901 .
  • the fourth voice message 904 and the fifth voice message 905 sent by user A when the fourth voice message 904 and the fifth voice message 905 sent by user A are played, user B replies to the fifth voice message 905 and replies to the sixth voice message 906 and the seventh voice message 907 continuously.
  • the fifth voice information 905 can be marked to determine that user B has replied to the fifth voice information 905, and at the same time, the fourth voice information 904, the fifth voice information 905, the sixth voice information 906 and the seventh voice information 907 is set as the second topic.
  • the marked fifth voice information can be started to be played, and the fourth voice information can be ignored, so that the user can quickly determine the specific content of the voice information.
  • the chat APP can sequentially store the voice information according to the reply process of the voice information.
  • the chat APP plays the fourth voice information 904 and the fifth voice information 905 sequentially.
  • the chat information can confirm that the sixth voice message 906 is located between the fourth voice message 904 and the fifth voice message Between 905.
  • the fourth voice information 904 , the sixth voice information 906 and the fifth voice information 906 can be stored in order according to the fourth voice information 904 , the sixth voice information 906 , and the fifth voice information 805 .
  • the chat APP can play the voice order in the order of the fourth voice information 904, the sixth voice information 906, and the fifth voice information 905, which can maintain the continuity of the voice content.
  • the user can manually operate the voice information to group the voice information. As shown in Figure 9, if the user plays the eighth voice message 908 after playing the seventh voice message 907, and receives the ninth voice message 909 sent by user A, user B can manually drag the eighth voice message 908 , divide the eighth voice information 908 and the ninth voice information 909 into one voice topic.
  • the specific process for the user to manually operate the voice information can be set according to requirements, which is not limited in this implementation.
  • the user manually operates the voice information to divide the voice topic, which can facilitate the user to classify the voice information according to the voice content, so that the user can quickly find the voice information in the future.
  • the communication control method provided in the embodiment of the present application may be executed by an earphone, or a control module in the earphone for executing the communication control method.
  • the headset provided in the embodiment of the present application is described by taking the communication control method performed by the headset as an example.
  • FIG. 11 is a schematic structural diagram of an electronic device according to an exemplary embodiment.
  • the electronic device 1100 may include:
  • the first determining module 1101 is configured to determine a target application program that requires earphone communication from a plurality of running application programs.
  • the setting module 1102 is configured to set different communication identification information for target application programs respectively when the number of target application programs is not less than two.
  • the communication module 1103 is used to control the target application program to communicate with the headset with the same communication identification information.
  • electronic device 1100 may also include:
  • the display module is used for displaying the earphone selection interface.
  • the receiving module is configured to receive the first input in the earphone selection interface.
  • the second determining module is configured to determine the earphone corresponding to the target application program in response to the first input.
  • the first sending module is configured to send the communication identification information corresponding to the target application program to the headset, so that the communication identification information of the headset is the same as the communication identification information corresponding to the target application program.
  • electronic device 1100 may also include:
  • the second sending module is configured to send the target information of the target application to the earphone, so that the earphone outputs the instruction information corresponding to the target application program, and in the case of receiving the user operation corresponding to the instruction information, make the communication identification information of the earphone It is the same as the communication identification information indicating the target application to which the information belongs.
  • the communication module 1103 is specifically configured to, in the case of receiving the communication data sent by the earphone, transfer the communication data to the target application program to which the communication identification information in the communication data belongs; in the communication data sent by the target application program The communication identification information of the target application is added, and the communication data with the communication identification information added is sent to the earphone, so that the earphone processes the communication data according to the communication identification information in the communication data.
  • the communication module 1103 is further configured to, in the case that the communication data sent by the earphone includes a control instruction, if the priority of the target application having the same communication identification information as the earphone is lower than that of other target applications, Then it is determined that the control instruction is an invalid instruction.
  • the electronic device determines the target application program that has earphone communication requirements from among the running multiple application programs. Different communication identification information is set, and the target application program is controlled to communicate with the headset with the same communication identification information.
  • the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
  • the electronic device in the embodiment of the present application may be a mobile electronic device, or may be a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant).
  • assistant, PDA personal digital assistant
  • non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
  • the electronic device in this embodiment of the present application may be a device with an operating system.
  • the operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
  • the electronic device provided in the embodiment of the present application can implement various processes implemented by the method embodiments in FIG. 1 and FIG. 2 , and details are not repeated here to avoid repetition.
  • FIG. 12 is a schematic structural diagram of an earphone according to an exemplary embodiment.
  • the earphone 1200 may include:
  • the determining module 1201 is configured to determine the communication identification information of the earphone; the earphone is wirelessly connected to the electronic device, and the electronic device is used to determine that there are no less than two target application programs that have earphone communication requirements among the running multiple application programs, Set different communication identification information for target applications respectively;
  • the communication module 1202 is configured to control the earphone to communicate with the target application program having the same communication identification information.
  • the earphone 1200 may include: a receiving module, configured to receive the target information of the target application sent by the electronic device;
  • the determining module 1201 is specifically configured to set the communication identification information of the headset to be the same as the communication identification information of at least one target application program based on the target information.
  • the communication identification information of the earphone is determined, and the earphone is controlled to communicate with the target application program having the same communication identification information.
  • the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
  • the headset in this embodiment of the present application may be a device with an operating system.
  • the operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
  • the earphone provided in the embodiment of the present application can implement various processes implemented in the method embodiment in FIG. 8 , and details are not repeated here to avoid repetition.
  • FIG. 13 is a schematic structural diagram of another electronic device provided according to an exemplary embodiment.
  • the electronic device 1300 includes a processor 1301 and a memory 1302 .
  • the program or instruction running on the computer when the program or instruction is executed by the processor 1301, implements the various processes of the communication control method embodiment above, and can achieve the same technical effect. To avoid repetition, details are not repeated here.
  • an embodiment of the present application further provides an electronic device, including a processor and a memory, a program or instruction stored in the memory and operable on the processor, and the above-mentioned program or instruction is implemented when executed by the processor.
  • the various processes of the communication control method performed by the electronic device or the earphone can achieve the same technical effect, and will not be repeated here to avoid repetition.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • Fig. 14 is a schematic diagram of a hardware structure of an electronic device according to an exemplary embodiment.
  • the electronic device 1400 includes, but is not limited to: a radio frequency unit 1401, a network module 1402, an audio output unit 1403, an input unit 1404, a sensor 1405, a display unit 1406, a user input unit 1407, an interface unit 1408, a memory 1409, and a processor 1410, etc. part.
  • the electronic device 1400 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 1410 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions.
  • a power supply such as a battery
  • the structure of the electronic device shown in FIG. 14 does not constitute a limitation to the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange different components, and details will not be repeated here. .
  • the processor 1410 is used to determine the target application program with earphone communication requirements from the running multiple application programs; when the number of target application programs is not less than 2, set different communication channels for the target application programs respectively. identifying information;
  • a network module 1402 configured to control the target application program to communicate with the headset having the same communication identification information.
  • the electronic device determines the target application program that has earphone communication requirements from among the running multiple application programs. Different communication identification information is set, and the target application program is controlled to communicate with the headset with the same communication identification information.
  • the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
  • the display unit 1406 is configured to display an earphone selection interface; in the earphone selection interface, receive a first input; in response to the first input, determine an earphone corresponding to the target application;
  • the network module 1402 is configured to send the communication identification information corresponding to the target application program to the headset, so that the communication identification information of the headset is the same as the communication identification information corresponding to the target application program.
  • the electronic device displays the earphone selection interface, and the user can manually select the earphone corresponding to the target application program through the earphone selection interface, which can facilitate the user to choose the earphone for wearing. corresponding target application.
  • the network module 1402 is configured to send the target information of the target application to the earphone, so that the earphone outputs indication information corresponding to the target application program, and when a user operation corresponding to the indication information is received, the earphone's
  • the communication identification information is the same as the communication identification information indicating the target application to which the information belongs.
  • the headset outputs instruction information corresponding to the target application program, instructing the user to operate the headset to set the communication identification information of the headset to determine the target application program corresponding to the headset, which can facilitate the user using the headset to select the target application program corresponding to the headset according to needs .
  • the network module 1402 is configured to transfer the communication data to the target application program to which the communication identification information in the communication data belongs when the communication data sent by the earphone is received;
  • the electronic device controls the communication between the target application program and the corresponding earphone, it determines the corresponding relationship between the earphone and the target application program according to the communication identification information in the communication data, and can accurately control the communication between the target application program and the corresponding earphone. communication.
  • the processor 1410 is further configured to, in the case that the communication data sent by the earphone includes a control instruction, if the priority of the target application having the same communication identification information as the earphone is lower than the priority of other target applications, Then it is determined that the control instruction is an invalid instruction.
  • the electronic device can set the control commands received by the target application program with lower priority as invalid commands according to the priority of the target application program, which can prevent multiple earphones from simultaneously controlling the electronic device and affecting the user's understanding of the electronic device. Normal use.
  • the input unit 1404 may include a graphics processor (Graphics Processing Unit, GPU) 14041 and a microphone 14042, and the graphics processor 14041 is used for the image capture device (such as the image data of the still picture or video obtained by the camera) for processing.
  • the display unit 1406 may include a display panel 14061, and the display panel 14061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 1407 includes a touch panel 14071 and other input devices 14072 . Touch panel 14071, also called touch screen.
  • the touch panel 14071 may include two parts, a touch detection device and a touch controller.
  • Other input devices 14072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.
  • Memory 1409 can be used to store software programs as well as various data, including but not limited to application programs and operating systems.
  • the processor 1410 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, and the modem processor mainly processes wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 1410 .
  • the embodiment of the present application also provides a readable storage medium.
  • the readable storage medium stores programs or instructions.
  • the program or instructions are executed by the processor, the various processes of the above-mentioned communication control method embodiments can be achieved, and the same To avoid repetition, the technical effects will not be repeated here.
  • the processor is the processor in the electronic device described in the above embodiments.
  • the readable storage medium includes computer readable storage medium, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
  • the embodiment of the present application also provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above communication control method embodiment Each process can achieve the same technical effect, so in order to avoid repetition, it will not be repeated here.
  • chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
  • the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase “comprising a " does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
  • the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
  • modules, units, and subunits can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processor, DSP), digital signal processing equipment (DSP Device, DSPD ), programmable logic device (Programmable Logic Device, PLD), field-programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, used to implement the disclosure other electronic units or combinations thereof.
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processor
  • DSP Device digital signal processing equipment
  • PLD programmable logic device
  • FPGA field-programmable gate array
  • controller microcontroller, microprocessor
  • the technologies described in the embodiments of the present disclosure may be implemented through modules (such as procedures, functions, etc.) that execute the functions described in the embodiments of the present disclosure.
  • Software codes can be stored in memory and executed by a processor.
  • Memory can be implemented within the processor or external to the processor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Telephone Function (AREA)

Abstract

Disclosed in the present application are a communication control method, an electronic device and earphones, which belong to the technical field of communications. The method comprises: determining a target application, which has an earphone communication requirement, from among a plurality of running applications; when there are not less than two target applications, respectively setting different communication identification information for the target applications; and controlling the target applications to communicate with respective earphones, which have the same communication identification information.

Description

通信控制方法、电子设备和耳机Communication control method, electronic device and headset
本申请要求在2021年05月8日提交中国专利局、申请号为202110504454.2、发明名称为“通信控制方法、电子设备和耳机”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110504454.2 and the title of the invention "communication control method, electronic equipment and earphone" submitted to the China Patent Office on May 8, 2021, the entire contents of which are incorporated in this application by reference middle.
技术领域technical field
本申请属于通信技术领域,具体涉及一种通信控制方法、电子设备和耳机。The present application belongs to the technical field of communication, and in particular relates to a communication control method, electronic equipment and earphones.
背景技术Background technique
耳机作为电子设备的一种外设,可以辅助电子设备实现音频数据的播放。在一些场景下,电子设备中的多个应用程序(Application,APP)同时需要与耳机进行通信,此时电子设备会根据多个应用程序的优先级,选择优先级最高的应用程序与耳机进行通信。例如,当播放音频的音频APP与播放视频的视频APP同时运行时,播放音频的音频APP与播放视频的视频APP同时需要与耳机进行通信,电子设备会根据音频APP和视频APP的优先级,选择音频APP或者视频APP中的一个与耳机进行通信。As a peripheral device of an electronic device, an earphone can assist the electronic device in realizing playback of audio data. In some scenarios, multiple applications (Applications, APPs) in the electronic device need to communicate with the headset at the same time. At this time, the electronic device will select the application with the highest priority to communicate with the headset according to the priorities of the multiple applications. . For example, when an audio app that plays audio and a video app that plays video run at the same time, the audio app that plays audio and the video app that plays video need to communicate with the headset at the same time, and the electronic device will select the One of the audio APP or the video APP communicates with the headset.
在先技术中,当出现多个应用程序同时需要与耳机通信的情况时,电子设备选择其中的一个应用程序与耳机通信,会导致其他应用程序无法与耳机通信,从而导致用户无法使用其他应用程序提供的功能。In the prior art, when multiple applications need to communicate with the headset at the same time, the electronic device selects one of the applications to communicate with the headset, which will cause other applications to be unable to communicate with the headset, resulting in users being unable to use other applications provided functionality.
发明内容Contents of the invention
本申请实施例的目的是提供一种通信控制方法、电子设备和耳机,能够解决多个应用程序同时需要与耳机通信时,部分应用程序的功能无法使用的问题。The purpose of the embodiments of the present application is to provide a communication control method, an electronic device, and an earphone, which can solve the problem that the functions of some application programs cannot be used when multiple application programs need to communicate with the earphone at the same time.
第一方面,本申请实施例提供了一种通信控制方法,应用于与耳机无线连接的电子设备,该方法包括:In the first aspect, an embodiment of the present application provides a communication control method, which is applied to an electronic device wirelessly connected to an earphone, and the method includes:
从运行的多个应用程序中确定具有耳机通信需求的目标应用程序;Determining a target application with headset communication needs from among multiple running applications;
在所述目标应用程序的数量不少于2个的情况下,分别为所述目标应用程序设置不同的通信识别信息;When the number of the target application programs is not less than two, setting different communication identification information for the target application programs respectively;
控制所述目标应用程序与具有相同通信识别信息的耳机进行通信。The target application program is controlled to communicate with the headset having the same communication identification information.
第二方面,本申请实施例提供了另一种通信控制方法,该方法包括:In the second aspect, the embodiment of the present application provides another communication control method, which includes:
确定耳机的通信识别信息;所述耳机与电子设备无线连接,所述电子设备用于在确定运行的多个应用程序中具有耳机通信需求的目标应用程序不少于2个的情况下,分别为所述目标应用程序设置不同的通信识别信息;Determine the communication identification information of the earphone; the earphone is wirelessly connected to the electronic device, and the electronic device is used to determine that there are no less than two target application programs that have earphone communication requirements among the multiple running application programs, respectively The target application program sets different communication identification information;
控制所述耳机与具有相同通信识别信息的所述目标应用程序进行通信。controlling the headset to communicate with the target application program having the same communication identification information.
第三方面,本申请实施例提供了一种电子设备,该电子设备包括:In a third aspect, an embodiment of the present application provides an electronic device, which includes:
第一确定模块,用于从运行的多个应用程序中确定具有耳机通信需求的目标应用程序;A first determining module, configured to determine a target application program with headset communication requirements from multiple running application programs;
设置模块,用于在所述目标应用程序的数量不少于2个的情况下,分别为所述目标应用程序设置不同的通信识别信息;A setting module, configured to set different communication identification information for the target application programs respectively when the number of the target application programs is not less than 2;
通信模块,用于控制所述目标应用程序与具有相同通信识别信息的耳机进行通信。The communication module is used to control the target application program to communicate with the headset having the same communication identification information.
第四方面,本申请实施例提供了一种耳机,该耳机包括:In a fourth aspect, the embodiment of the present application provides an earphone, which includes:
确定模块,用于确定所述耳机的通信识别信息;所述耳机与电子设备无线连接,所述电子设备用于在确定运行的多个应用程序中具有耳机通信需求的目标应用程序不少于2个的情况下,分别为所述目标应用程序设置不同的通信识别信息;A determining module, configured to determine the communication identification information of the earphone; the earphone is wirelessly connected to the electronic device, and the electronic device is used to determine that there are no less than 2 target applications with earphone communication requirements among the multiple application programs running In the case of each, set different communication identification information for the target application programs respectively;
通信模块,用于控制所述耳机与具有相同通信识别信息的所述目标应用程序进行通信。A communication module, configured to control the headset to communicate with the target application program having the same communication identification information.
第五方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面或第二方面所述的方法的步骤。In the fifth aspect, the embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and the program or instruction is executed by The processor implements the steps of the method described in the first aspect or the second aspect when executed.
第六方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面或第二方面所述的方法的步骤。In the sixth aspect, the embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the implementation as described in the first aspect or the second aspect is realized. steps of the method.
第七方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面或第二方面所述的方法。In the seventh aspect, the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect Or the method described in the second aspect.
在本申请实施例中,电子设备从运行的多个应用程序中确定具有耳机通信需求的目标应用程序,在目标应用程序的数量不少于2个的情况下,分别为目标应用程序设置不同的通信识别信息,控制目标应用程序与具有相同通信识别信息的耳机进行通信。当出现多个应用程序同时需要与耳机通信的情 况时,通过通信识别信息控制多个应用程序分别与对应的耳机进行通信,可以使多个应用程序同时工作,从而可以解决部分应用程序的功能无法使用的问题。In the embodiment of the present application, the electronic device determines the target application program that has earphone communication requirements from the running multiple application programs, and when the number of target application programs is not less than two, set different The communication identification information is used to control the target application program to communicate with the headset having the same communication identification information. When multiple applications need to communicate with the headset at the same time, the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
附图说明Description of drawings
为了更清楚地说明本申请实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings that need to be used in the descriptions of the embodiments or related technologies. Obviously, the drawings in the following description are the For some embodiments of the application, those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1是根据一示例性实施例提供的一种通信控制方法的步骤流程图;Fig. 1 is a flowchart of steps of a communication control method provided according to an exemplary embodiment;
图2是根据一示例性实施例提供的另一种通信控制方法的步骤流程图;Fig. 2 is a flowchart of steps of another communication control method provided according to an exemplary embodiment;
图3是根据一示例性实施例提供的一种模式设置示意图;Fig. 3 is a schematic diagram of mode setting provided according to an exemplary embodiment;
图4是根据一示例性实施例提供的一种耳机选择界面的示意图;Fig. 4 is a schematic diagram of an earphone selection interface provided according to an exemplary embodiment;
图5是根据一示例性实施例提供的另一种耳机选择界面的示意图;Fig. 5 is a schematic diagram of another earphone selection interface provided according to an exemplary embodiment;
图6是根据一示例性实施例提供的一种通信建立过程的示意图;Fig. 6 is a schematic diagram of a communication establishment process provided according to an exemplary embodiment;
图7是根据一示例性实施例提供的一种应用选择界面的示意图;Fig. 7 is a schematic diagram of an application selection interface provided according to an exemplary embodiment;
图8是根据一示例性实施例提供的又一种通信控制方法的步骤流程图Fig. 8 is a flow chart of the steps of another communication control method provided according to an exemplary embodiment
图9是根据一示例性实施例提供的一种聊天界面的示意图;Fig. 9 is a schematic diagram of a chat interface provided according to an exemplary embodiment;
图10是根据一示例性实施例提供的一种语音播放的流程示意图;Fig. 10 is a schematic flow chart of voice playback provided according to an exemplary embodiment;
图11是根据一示例性实施例提供的一种电子设备的结构示意图;Fig. 11 is a schematic structural diagram of an electronic device according to an exemplary embodiment;
图12是根据一示例性实施例提供的一种耳机的结构示意图;Fig. 12 is a schematic structural diagram of an earphone provided according to an exemplary embodiment;
图13是根据一示例性实施例提供的另一种电子设备的结构示意图;Fig. 13 is a schematic structural diagram of another electronic device provided according to an exemplary embodiment;
图14是根据一示例性实施例提供的一种电子设备的硬件结构示意图。Fig. 14 is a schematic diagram of a hardware structure of an electronic device according to an exemplary embodiment.
具体实施例specific embodiment
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The following will clearly describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application belong to the protection scope of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此 外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific sequence or sequence. It should be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application can be practiced in sequences other than those illustrated or described herein, and that references to "first," "second," etc. distinguish Objects are generally of one type, and the number of objects is not limited. For example, there may be one or more first objects. In addition, "and/or" in the description and claims means at least one of the connected objects, and the character "/" generally means that the related objects are an "or" relationship.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的通信控制方法进行详细地说明。The communication control method provided by the embodiment of the present application will be described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.
参照图1,图1是根据一示例性实施例提供的一种通信控制方法的步骤流程图,该方法应用于与耳机无线连接的电子设备,可以包括:Referring to FIG. 1, FIG. 1 is a flow chart of the steps of a communication control method provided according to an exemplary embodiment. The method is applied to an electronic device wirelessly connected to an earphone, and may include:
步骤101、从运行的多个应用程序中确定具有耳机通信需求的目标应用程序。 Step 101. Determine a target application program that has a headset communication requirement from multiple running application programs.
本实施例中,通信控制方法可以由电子设备执行,电子设备例如手机、计算机和平板电脑等终端设备。电子设备与耳机之间可以通过无线连接的方式连接,电子设备可以执行通信控制方法,以控制电子设备中的多个目标应用程序分别与对应的耳机进行通信。In this embodiment, the communication control method may be executed by an electronic device, such as a terminal device such as a mobile phone, a computer, and a tablet computer. The electronic device and the headset can be connected through a wireless connection, and the electronic device can execute a communication control method to control multiple target application programs in the electronic device to communicate with the corresponding headset.
示例性地,耳机包括第一蓝牙耳机和第二蓝牙耳机,第一蓝牙耳机和第二蓝牙耳机可以为一组分离式蓝牙耳机,第一蓝牙耳机被设置为主耳机,第二蓝牙耳机被设置为副耳机。在第一种通信方式中,电子设备可以通过内部集成的蓝牙模块与主耳机建立通信连接,主耳机可以接收电子设备发送的通信数据,或者向电子设备发送通信数据。同时,主耳机可以将接收到的通信数据转发给副耳机,副耳机在向电子设备发送通信数据时,可以向主耳机发送通信数据,由主耳机将通信数据转发给电子设备。在第二种通信方式中,主耳机负责与电子设备配对,设置配对信息,以建立主耳机与电子设备之间的通信连接,基于建立的通信连接接收或向电子设备发送通信数据。同时,主耳机可以将配对信息发送给副耳机,副耳机可以根据配对信息模仿主耳机,以接收电子设备发出的通信数据,或者向电子设备发送通信数据。其中,分离式蓝牙耳机与电子设备之间的具体通信方式可以包括但不限于上述两种通信方式,本领域已知或未知的通信方式都可以应用在本实施例中。需要说明的是,当蓝牙耳机为多个时,多个蓝牙耳机也可以为独立式蓝牙耳机,每个蓝牙耳机可以分别与电子设备建立通信连接。Exemplarily, the headset includes a first Bluetooth headset and a second Bluetooth headset, the first Bluetooth headset and the second Bluetooth headset can be a set of separate Bluetooth headsets, the first Bluetooth headset is set as the main for a pair of headphones. In the first communication mode, the electronic device can establish a communication connection with the main earphone through the internally integrated Bluetooth module, and the main earphone can receive communication data sent by the electronic device, or send communication data to the electronic device. At the same time, the main earphone can forward the received communication data to the auxiliary earphone, when the auxiliary earphone sends communication data to the electronic device, it can send the communication data to the main earphone, and the main earphone forwards the communication data to the electronic device. In the second communication mode, the main earphone is responsible for pairing with the electronic device, setting pairing information to establish a communication connection between the main earphone and the electronic device, and receiving or sending communication data to the electronic device based on the established communication connection. At the same time, the main earphone can send pairing information to the auxiliary earphone, and the auxiliary earphone can imitate the main earphone according to the pairing information to receive communication data sent by the electronic device, or send communication data to the electronic device. Wherein, the specific communication methods between the separate Bluetooth headset and the electronic device may include but not limited to the above two communication methods, and any communication methods known or unknown in the art may be applied in this embodiment. It should be noted that when there are multiple Bluetooth headsets, the multiple Bluetooth headsets may also be independent Bluetooth headsets, and each Bluetooth headset may respectively establish a communication connection with an electronic device.
其中,目标应用程序为当前运行的多个应用程序中,具有耳机通信需求的应用程序,耳机通信需求包括音频输出需求或音频输入需求,或者同时包括音频输入需求和音频输出需求。结合上述举例,当耳机为蓝牙耳机时,目标应用程序可以为用于播放音乐的音频APP,用于播放视频的视频APP,以及用于通话的通话APP,音频APP、视频APP和通话APP均可以与蓝牙耳机 通信,通过蓝牙耳机输出音频数据。或者,蓝牙耳机可以响应于用户操作,生成控制指令,向对应的APP发送控制指令。Wherein, the target application program is an application program having a headset communication requirement among multiple currently running applications, and the headset communication requirement includes an audio output requirement or an audio input requirement, or includes both an audio input requirement and an audio output requirement. Combining the above example, when the headset is a Bluetooth headset, the target application program can be an audio APP for playing music, a video APP for playing video, and a calling APP for calling. Audio APP, video APP and calling APP can all be Communicate with the Bluetooth headset and output audio data through the Bluetooth headset. Alternatively, the Bluetooth headset may generate a control instruction in response to a user operation, and send the control instruction to a corresponding APP.
本实施例中,电子设备在连接耳机之后,可以从当前运行的多个应用程序中确定目标应用程序,以控制目标应用程序与耳机进行通信。结合上述举例,电子设备在确定连接有蓝牙耳机之后,在监测到应用程序启动之后,若应用程序需要输出音频数据,则可以确定应用程序为具有耳机通信需求的目标应用程序。其中,电子设备确定目标应用程序的具体过程可以根据需求设置,本实施例对此不做限制。In this embodiment, after the earphone is connected, the electronic device may determine a target application program from multiple currently running application programs, so as to control the target application program to communicate with the earphone. With reference to the above example, after the electronic device determines that a Bluetooth headset is connected and detects that the application program is started, if the application program needs to output audio data, it may determine that the application program is a target application program that needs to communicate with the headset. The specific process for the electronic device to determine the target application program can be set according to requirements, which is not limited in this embodiment.
步骤102、在目标应用程序的数量不少于2个的情况下,分别为目标应用程序设置不同的通信识别信息。 Step 102. When the number of target application programs is not less than two, set different communication identification information for the target application programs respectively.
本实施例中,电子设备在确定目标应用程序的数量大于或等于两个时,可以为目标应用程序分别设置不同的通信识别信息,以根据目标应用程序的通信识别信息,控制目标应用程序与具有相同通信识别信息的耳机进行通信。In this embodiment, when the electronic device determines that the number of target application programs is greater than or equal to two, it can set different communication identification information for the target application programs, so as to control the communication between the target application programs and the communication identification information of the target application programs. Headphones with the same communication identification information communicate.
示例性地,用户可以针对电子设备中的所有目标应用程序,预先设置每个目标应用程序的优先级,电子设备可以根据目标应用程序的优先级,设置目标应用程序的通信识别信息。结合上述举例,用户可以预先设置通话APP的优先级为2,视频APP的优先级为5,音频APP的优先级为7。电子设备在确定目标应用程序包括音频APP、视频APP和通话APP之后,可以根据音频APP、视频APP和通话APP的优先级顺序,设置通话APP的通信识别信息为A,视频APP的通信识别信息为B,音频APP的通信识别信息为C。通信识别信息的具体形式,以及通信识别信息的具体设置方法可以根据需求设置,本实施例对此不做限制。Exemplarily, the user may preset the priority of each target application for all target applications in the electronic device, and the electronic device may set the communication identification information of the target application according to the priority of the target application. Combining the above example, the user can preset the priority of the calling APP as 2, the priority of the video APP as 5, and the priority of the audio APP as 7. After the electronic device determines that the target application programs include audio APP, video APP and calling APP, it can set the communication identification information of the calling APP to A and the communication identification information of the video APP to A according to the priority order of the audio APP, video APP and calling APP. B. The communication identification information of the audio APP is C. The specific form of the communication identification information and the specific setting method of the communication identification information may be set according to requirements, which are not limited in this embodiment.
步骤103、控制目标应用程序与具有相同通信识别信息的耳机进行通信。 Step 103, controlling the target application program to communicate with the headset having the same communication identification information.
在一种实施例中,耳机可以按电子设备设置通信识别信息的方法,设置耳机的通信识别信息。结合上述举例,当耳机为分离式蓝牙耳机时,用户可以预先设置主耳机的优先级为1,副耳机的优先级为2。主耳机可以按优先级顺序,设置主耳机的通信识别信息为A,设置副耳机的通信识别信息为B。或者,主耳机可以随机的设置其中一个蓝牙耳机的通信识别信息为A,另一个蓝牙耳机的通信识别信息为B。此时,主耳机与通话APP的通信识别信息相同,副耳机与视频APP的通信识别信息相同。In an embodiment, the earphone can set the communication identification information of the earphone according to the method for setting communication identification information of an electronic device. With reference to the above example, when the earphone is a separate Bluetooth earphone, the user can preset the priority of the main earphone as 1 and the priority of the secondary earphone as 2. The main earphone can set the communication identification information of the main earphone as A, and set the communication identification information of the auxiliary earphone as B according to the order of priority. Alternatively, the main earphone can randomly set the communication identification information of one of the bluetooth earphones to A, and the communication identification information of the other bluetooth earphone to be B. At this time, the communication identification information of the main earphone is the same as that of the call APP, and the communication identification information of the secondary earphone is the same as that of the video APP.
在另一种实施例中,主耳机和副耳机也可以相互协商,设置主耳机和副 耳机分别具有不同的通信识别信息。其中,当多个蓝牙耳机为独立式蓝牙耳机时,多个蓝牙耳机之间可以协商设置每个蓝牙耳机分别具有不同的通信识别信息。具体协商过程可以根据需求设置,本实施例对此不做限制。In another embodiment, the main earphone and the auxiliary earphone can also negotiate with each other, and the main earphone and the auxiliary earphone are set to have different communication identification information respectively. Wherein, when the multiple Bluetooth headsets are independent Bluetooth headsets, the multiple Bluetooth headsets can be negotiated to set each Bluetooth headset to have different communication identification information. The specific negotiation process can be set according to requirements, which is not limited in this embodiment.
可选地,步骤103可以通过如下方式实现:Optionally, step 103 may be implemented in the following manner:
在接收到耳机发送的通信数据的情况下,向与通信数据中的通信识别信息所属的目标应用程序传递通信数据;In the case of receiving the communication data sent by the earphone, transfer the communication data to the target application program to which the communication identification information in the communication data belongs;
在目标应用程序发出的通信数据中添加目标应用程序的通信识别信息,并向耳机发送添加通信识别信息后的通信数据,以使耳机根据通信数据中的通信识别信息,处理通信数据。Add the communication identification information of the target application program to the communication data sent by the target application program, and send the communication data with the communication identification information added to the earphone, so that the earphone processes the communication data according to the communication identification information in the communication data.
示例性地,当电子设备与分离式蓝牙耳机以第一种通信方式通信时,电子设备在通话APP输出音频数据之后,首先可以打包生成包括音频数据和通信识别信息A的数据包,然后向主耳机发送数据包。相应的,主耳机在接收到数据包之后,可以确定数据包中的通信识别信息A与自身的通信识别信息A相同,此时主耳机可以直接播放数据包中的音频数据。同样的,电子设备在视频APP输出音频数据之后,首先可以打包生成包括音频数据和通信识别信息B的数据包,然后向主耳机发送数据包。相应的,主耳机在接收到数据包之后,可以确定数据包中的通信识别信息B与自身的通信识别信息不同,此时主耳机可以向副耳机发送数据包中的音频数据,副耳机可以接收并播放主耳机转发的音频数据。Exemplarily, when the electronic device communicates with the separate Bluetooth headset in the first communication mode, after the electronic device outputs the audio data from the calling APP, it can first package and generate a data packet including the audio data and communication identification information A, and then send the audio data to the host The headset sends packets. Correspondingly, after receiving the data packet, the main earphone can determine that the communication identification information A in the data packet is the same as its own communication identification information A, and at this time, the main earphone can directly play the audio data in the data packet. Similarly, after the video APP outputs the audio data, the electronic device can first package and generate a data packet including the audio data and communication identification information B, and then send the data packet to the main earphone. Correspondingly, after the main earphone receives the data packet, it can determine that the communication identification information B in the data packet is different from its own communication identification information. At this time, the main earphone can send the audio data in the data packet to the auxiliary earphone, and the auxiliary earphone can receive And play the audio data forwarded by the main earphone.
主耳机在接收到用户操作,生成控制指令之后,可以打包生成包括控制指令和通信识别信息A的数据包,并向电子设备发送数据包。相应的,电子设备在接收到数据包之后,可以确定数据包中的通信识别信息A与通话APP的通信识别信息A相同,则可以将数据包中的控制指令转发给通话APP。同理,副耳机在接收到用户操作,生成控制指令之后,可以向主耳机发送控制指令。主耳机在接收到副耳机发送的控制指令之后,打包生成包括控制指令和通信识别信息B的数据包,并向电子设备发送数据包。相应的,电子设备在接收到数据包之后,可以确定数据包中的通信识别信息B与视频APP的通信识别信息B相同,可以将数据包中的控制指令转发给视频APP。After receiving the user operation and generating the control instruction, the main earphone can package and generate a data packet including the control instruction and communication identification information A, and send the data packet to the electronic device. Correspondingly, after receiving the data packet, the electronic device can determine that the communication identification information A in the data packet is the same as the communication identification information A of the calling APP, and then forward the control instruction in the data packet to the calling APP. Similarly, after receiving a user operation and generating a control instruction, the secondary earphone can send a control instruction to the main earphone. After receiving the control instruction sent by the auxiliary earphone, the main earphone packs and generates a data packet including the control instruction and communication identification information B, and sends the data packet to the electronic device. Correspondingly, after receiving the data packet, the electronic device can determine that the communication identification information B in the data packet is the same as the communication identification information B of the video APP, and can forward the control instruction in the data packet to the video APP.
在另一种实施例中,当电子设备与分离式蓝牙耳机以第二种通信方式通信时,副耳机在接收到包括通信识别信息B的数据时,可以确定数据包中的通信识别信息B与自身的通信识别信息B相同,可以播放数据包中的音频数据,反之当接收到包括通信识别信息A的数据包时,可以确定数据包中的通 信识别信息A与自身的通信识别信息B不同,则丢弃数据包。同理,主耳机在接收到包括通信识别信息A的数据包时,播放数据包中的音频数据,在接收到包括通信识别信息B的数据包时,丢弃数据包。In another embodiment, when the electronic device communicates with the separate Bluetooth headset in the second communication mode, when the secondary headset receives the data including the communication identification information B, it can determine the communication identification information B in the data packet and the The communication identification information B of itself is the same, and the audio data in the data packet can be played. Conversely, when a data packet including communication identification information A is received, it can be determined that the communication identification information A in the data packet is different from its own communication identification information B, then discard the packet. Similarly, when the main earphone receives the data packet including the communication identification information A, it plays the audio data in the data packet, and when it receives the data packet including the communication identification information B, it discards the data packet.
实际应用中,电子设备在控制目标应用程序与对应的耳机通信时,根据通信数据中的通信识别信息确定耳机与目标应用程序之间的对应关系,可以准确的控制目标应用程序与对应的耳机进行通信。In practical applications, when the electronic device controls the communication between the target application program and the corresponding earphone, it determines the corresponding relationship between the earphone and the target application program according to the communication identification information in the communication data, and can accurately control the communication between the target application program and the corresponding earphone. communication.
其中,电子设备在音频APP输出音频数据之后,同样可以打包生成包括音频数据和通信识别信息C的数据包,然后向主耳机发送包括通信识别信息C的数据包。此时,由于数据包中的通信识别信息与主耳机和副耳机的通信识别信息均不相同,数据包被主耳机和副耳机丢弃。Wherein, after the audio APP outputs the audio data, the electronic device can also package and generate a data packet including the audio data and the communication identification information C, and then send the data packet including the communication identification information C to the main earphone. At this time, since the communication identification information in the data packet is different from the communication identification information of the primary earphone and the secondary earphone, the data packet is discarded by the primary earphone and the secondary earphone.
在另一种实施例中,分离式蓝牙耳机中还可以包括第三蓝牙耳机。结合上述举例,第三蓝牙耳机的通信识别信息可以设置为C,此时电子设备可以控制音频APP与第三蓝牙耳机进行通信。或者,电子设备首先可以与主耳机进行通信,确定耳机数量,当目标应用程序的数量大于蓝牙耳机数量时,可以根据目标应用程序的优先级,控制低优先级的音频APP停止输出音频数据。其中,分离式蓝牙耳机中的耳机数量可以根据需求设置,本实施例对此不做限制。In another embodiment, the separate Bluetooth headset may further include a third Bluetooth headset. With reference to the above example, the communication identification information of the third Bluetooth headset can be set to C, and at this time the electronic device can control the audio APP to communicate with the third Bluetooth headset. Alternatively, the electronic device can first communicate with the main earphone to determine the number of earphones, and when the number of target applications is greater than the number of bluetooth earphones, it can control the low-priority audio APP to stop outputting audio data according to the priority of the target application. Wherein, the number of earphones in the separate Bluetooth earphones can be set according to requirements, which is not limited in this embodiment.
在一些应用场景中,当电子设备同时连接多个耳机时,每个耳机可以分别由不同的用户使用。例如,当电子设备连接分离式蓝牙耳机时,主耳机可以由用户A佩戴,副耳机可以由用户B佩戴。此时,若电子设备根据通话APP、音频APP和视频APP的优先级,停止音频APP和视频APP,控制通话APP与蓝牙耳机通信,音频APP和视频APP无法为用户提供对应的功能。使用本实施例提供的通信控制方法,电子设备可以控制通话APP与主耳机通信,控制视频APP与副耳机通信,用户A可以通过主耳机接听电话,用户B可以通过副耳机观看视频。其中,当用户A需要观看视频,用户B需要通话时,用户A与用户B可以交换耳机。In some application scenarios, when an electronic device is connected to multiple earphones at the same time, each earphone may be used by a different user. For example, when the electronic device is connected to a detachable Bluetooth headset, the primary headset can be worn by user A, and the secondary headset can be worn by user B. At this time, if the electronic device stops the audio APP and video APP according to the priorities of the calling APP, audio APP and video APP, and controls the communication between the calling APP and the Bluetooth headset, the audio APP and the video APP cannot provide corresponding functions for the user. Using the communication control method provided in this embodiment, the electronic device can control the call APP to communicate with the primary headset, and control the video APP to communicate with the secondary headset. User A can answer calls through the primary headset, and user B can watch videos through the secondary headset. Wherein, when user A needs to watch a video and user B needs to talk, user A and user B can exchange earphones.
综上所述,本实施例中,电子设备从运行的多个应用程序中确定具有耳机通信需求的目标应用程序,在目标应用程序的数量不少于2个的情况下,分别为目标应用程序设置不同的通信识别信息,控制目标应用程序与具有相同通信识别信息的耳机进行通信。当出现多个应用程序同时需要与耳机通信的情况时,通过通信识别信息控制多个应用程序分别与对应的耳机进行通信,可以使多个应用程序同时工作,从而可以解决部分应用程序的功能无法 使用的问题。To sum up, in this embodiment, the electronic device determines the target application program that has earphone communication requirements from among the running multiple application programs. Different communication identification information is set, and the target application program is controlled to communicate with the headset with the same communication identification information. When multiple applications need to communicate with the headset at the same time, the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
可选地,该方法可以包括:Optionally, the method may include:
在确定目标应用程序的数量为一个的情况下,设置目标应用程序的通信识别信息,控制目标应用程序与通信识别信息相同的耳机进行通信;或者,在确定目标应用程序的数量为一个的情况下,控制目标应用程序与所有耳机进行通信。When the number of target application programs is determined to be one, set the communication identification information of the target application program, and control the target application program to communicate with the headset with the same communication identification information; or, when the number of target application programs is determined to be one , which controls the target application to communicate with all headsets.
本实施例中,电子设备在确定目标应用程序只有一个的情况下,同样可以执行步骤101至步骤103,控制目标应用程序与通信识别信息相同的耳机进行通信。或者,电子设备可以不设置目标应用程序的通信识别信息,在向耳机发送通信数据时,不添加目标应用程序的通信识别信息。此时,所有耳机均可以接收并处理电子设备发送的通信数据。同样的,电子设备可以将所有耳机发送的通信数据转发给目标应用程序。In this embodiment, when it is determined that there is only one target application program, the electronic device may also perform steps 101 to 103 to control the target application program to communicate with the headset with the same communication identification information. Alternatively, the electronic device may not set the communication identification information of the target application program, and not add the communication identification information of the target application program when sending communication data to the earphone. At this point, all earphones can receive and process the communication data sent by the electronic device. Likewise, the electronic device can forward all communication data sent by the headset to the target application.
参照图2,图2是根据一示例性实施例提供的另一种通信控制方法的步骤流程图,该方法可以包括:Referring to FIG. 2, FIG. 2 is a flowchart of steps of another communication control method provided according to an exemplary embodiment. The method may include:
步骤201、电子设备从运行的多个应用程序中确定具有耳机通信需求的目标应用程序。In step 201, the electronic device determines a target application program that requires earphone communication from multiple running application programs.
步骤202、电子设备在目标应用程序的数量不少于2个的情况下,分别为目标应用程序设置不同的通信识别信息。 Step 202, when the number of target application programs is not less than two, the electronic device sets different communication identification information for the target application programs respectively.
可选地,该方法还可以包括:Optionally, the method may also include:
显示耳机选择界面;Display the headset selection interface;
在耳机选择界面中,接收第一输入;In the earphone selection interface, receiving a first input;
响应于第一输入,确定目标应用程序对应的耳机;In response to the first input, determining a headset corresponding to the target application;
向耳机发送对应目标应用程序的通信识别信息,以使耳机的通信识别信息与对应目标应用程序的通信识别信息相同。The communication identification information corresponding to the target application program is sent to the earphone, so that the communication identification information of the earphone is the same as the communication identification information corresponding to the target application program.
相应的,耳机可以接收电子设备发送的目标应用程序的通信识别信息;Correspondingly, the headset can receive the communication identification information of the target application sent by the electronic device;
设置耳机的通信识别信息与至少一个目标应用程序的通信识别信息相同。The communication identification information of the headset is set to be the same as the communication identification information of at least one target application program.
本实施例中,电子设备在确定目标应用程序的数量不少于2个的情况下,可以预先向耳机发送目标应用程序的通信识别信息,通信识别信息为目标应用程序的目标信息,通过通信识别信息使耳机设置自身的通信识别信息与其中一个或多个目标应用程序的通信识别信息相同。In this embodiment, when the number of target application programs is determined to be no less than two, the electronic device may send the communication identification information of the target application programs to the earphone in advance, and the communication identification information is the target information of the target application programs. information to cause the headset to set its own communication identification information to be the same as that of one or more of the target applications.
示例性地,用户可以预先为目标应用程序设置不同的模式,电子设备可 以将目标应用程序的模式信息作为通信识别信息,或者基于模式信息为目标应用程序设置不同的通信识别信息。如图3所示,图3是根据一示例性实施例提供的一种模式设置示意图,电子设备的桌面中显示有通话APP、音频APP和视频APP的应用程序图标,用户可以长按通话APP的应用程序图标301,电子设备响应于用户的长按操作,显示模式选择界面302。模式选择界面302中包括通话模式对应的模式选择控件303,以及听歌模式和视频模式的模式选择控件。用户可以点击模式选择控件303,电子设备可以响应于用户的点击操作,设置通话APP为通话模式。同样的,可以设置视频APP为视频模式,设置音频APP为听歌模式。其中,模式的设置方法可以根据需求设置,本实施例对此不做限制。Exemplarily, the user can pre-set different modes for the target application, and the electronic device can use the mode information of the target application as communication identification information, or set different communication identification information for the target application based on the mode information. As shown in Figure 3, Figure 3 is a schematic diagram of a mode setting provided according to an exemplary embodiment, the desktop of the electronic device displays the application program icons of call APP, audio APP and video APP, and the user can press and hold the call APP An application program icon 301 , and the electronic device displays a mode selection interface 302 in response to a user's long press operation. The mode selection interface 302 includes a mode selection control 303 corresponding to the call mode, and mode selection controls for listening to music mode and video mode. The user can click the mode selection control 303, and the electronic device can set the call APP as the call mode in response to the user's click operation. Similarly, you can set the video APP to the video mode, and set the audio APP to the listening mode. Wherein, the mode setting method can be set according to requirements, which is not limited in this embodiment.
可选的,用户可以设置不同模式具有不同的模式等级,不同模式对应不同的优先级,电子设备可以根据目标应用程序的模式确定应用程序的优先级。如图3所示,通话模式的模式等级为2,听歌模式的模式等级为7,视频模式的模式等级为5,电子设备可以根据目标应用程序的模式等级确定目标应用程序的优先级。Optionally, the user can set different modes to have different mode levels, and different modes correspond to different priorities, and the electronic device can determine the priority of the application program according to the mode of the target application program. As shown in FIG. 3 , the mode level of the call mode is 2, the mode level of the listening mode is 7, and the mode level of the video mode is 5. The electronic device can determine the priority of the target application program according to the mode level of the target application program.
在一种实施例中,第一输入用于确定目标应用程序对应的耳机。电子设备在确定目标应用程序的数量不少于两个的情况下,可以显示耳机选择界面,基于耳机选择界面接收用户的第一输入,响应于第一输入确定目标应用程序对应的耳机。如图4所示,图4是根据一示例性实施例提供的一种耳机选择界面的示意图,结合上述举例,耳机选择界面中可以包括主耳机对应的第一目标图像401,副耳机对应的第二目标图像402,以及通话APP对应的第一控件403,视频APP对应的第二控件404,音频APP对应的第三控件405。第一输入例如拖动操作,用户可以按压第一控件403并拖动,若第一控件403被用户拖动到第一目标图像401之上,则电子设备可以响应于用户的拖动操作,建立主耳机与通话APP之间的对应关系,并向主耳机发送包括通话模式的模式信息和主耳机的标识信息的数据包,数据包中的模式信息即电子设备向主耳机发送的通话APP的目标信息。同理,若第二控件405被用户拖动到第二目标图标402之上,电子设备可以建立视频APP与副耳机之间的对应关系,并向主耳机发送包括视频模式的模式信息和副耳机的标识信息的数据包。第一输入的具体形式可以根据需求设置,本实施例对此不做限制。In one embodiment, the first input is used to determine the headset corresponding to the target application. When the number of target application programs is determined to be not less than two, the electronic device may display a headset selection interface, receive a user's first input based on the headset selection interface, and determine the headset corresponding to the target application program in response to the first input. As shown in FIG. 4, FIG. 4 is a schematic diagram of an earphone selection interface provided according to an exemplary embodiment. With reference to the above examples, the earphone selection interface may include a first target image 401 corresponding to the main earphone, and a first target image 401 corresponding to the secondary earphone. Two target images 402, and a first control 403 corresponding to the calling APP, a second control 404 corresponding to the video APP, and a third control 405 corresponding to the audio APP. The first input is, for example, a drag operation. The user can press the first control 403 and drag it. If the first control 403 is dragged by the user onto the first target image 401, the electronic device can respond to the user's drag operation to create Correspondence between the main earphone and the call APP, and send a data packet including the mode information of the call mode and the identification information of the main earphone to the main earphone. The mode information in the data packet is the target of the call APP sent by the electronic device to the main earphone information. Similarly, if the second control 405 is dragged onto the second target icon 402 by the user, the electronic device can establish a correspondence between the video APP and the secondary earphone, and send mode information including the video mode and the secondary earphone to the primary earphone. A packet of identification information. The specific form of the first input may be set according to requirements, which is not limited in this embodiment.
相应的,主耳机在接收到电子设备发送的数据包之后,若数据包中包括自身的标识信息,则可以根据数据包中的模式信息,设置主耳机为通话模式。 同理,主耳机在接收到数据包之后,若数据包中包括副耳机的标识信息,则可以根据数据包中的模式信息,设置副耳机为视频模式。此时,电子设备可以将目标应用程序的模式信息作为通信识别信息,主耳机也可以将耳机的模式信息作为通信识别信息,使目标应用程序与对应耳机的通信识别信息相同。Correspondingly, after the main earphone receives the data packet sent by the electronic device, if the data packet includes its own identification information, it can set the main earphone to the call mode according to the mode information in the data packet. Similarly, after the main earphone receives the data packet, if the data packet includes the identification information of the auxiliary earphone, the auxiliary earphone can be set to the video mode according to the mode information in the data packet. At this time, the electronic device may use the mode information of the target application program as the communication identification information, and the main earphone may also use the mode information of the earphone as the communication identification information, so that the target application program is the same as the communication identification information of the corresponding earphone.
其中,电子设备可以预先与主耳机进行通信,获取主耳机和副耳机的标识信息,或者,电子设备可以默认将优先级作为耳机的标识信息,此时电子设备在显示耳机选择界面的过程中,可以在耳机选择界面中显示优先级1和优先级2分别对应的目标图像。主耳机可以根据数据包中优先级,将优先级为1的主耳机设置为通话模式,将优先级为2的副耳机设置为视频模式。模式信息和标识信息的具体形式可以根据需求设置,本实施例对此不做限制。Wherein, the electronic device can communicate with the main earphone in advance to obtain the identification information of the main earphone and the auxiliary earphone, or the electronic device can use the priority as the identification information of the earphone by default. At this time, the electronic device is displaying the earphone selection interface. The target images respectively corresponding to priority 1 and priority 2 may be displayed on the earphone selection interface. According to the priority in the data packet, the main earphone can set the main earphone with priority 1 to the call mode, and set the secondary earphone with priority 2 to the video mode. The specific forms of the mode information and the identification information can be set according to requirements, which is not limited in this embodiment.
在一种实施例中,电子设备可以在目标应用程序的数量少于两个的情况下,控制目标应用程序与所有耳机通信。在确定目标应用程序的数量大于或等于两个的情况下,显示耳机选择界面,耳机选择界面中可以显示新增加的目标应用程序对应的目标图像。如图5所示,图5是根据一示例性实施例提供的另一种耳机选择界面的示意图,结合上述举例,若当前运行的目标应用程序为视频APP,电子设备可以控制视频APP同时与主耳机和副耳机进行通信。此时,若电子设备接收到来电通知,通话APP启动,电子设备可以显示耳机选择界面,耳机选择界面中包括新增加的通话APP对应的第一控件403,以及主耳机对应的第一目标图像401和副耳机对应的第二目标图像402。此时,用户可以按压并拖动第一控件403,若第一控件403被拖动至第一目标图像401之上,则建立主耳机与通话APP之间的对应关系,向主耳机发送通话APP的模式信息。同时,可以自动设置第二目标图像402对应的副耳机与视频APP对应,建立副耳机与视频APP之间的对应关系,向副耳机发送视频APP的模式信息。In one embodiment, the electronic device may control the target application program to communicate with all earphones when the number of target application programs is less than two. When it is determined that the number of target application programs is greater than or equal to two, an earphone selection interface is displayed, and a target image corresponding to a newly added target application program may be displayed in the earphone selection interface. As shown in Figure 5, Figure 5 is a schematic diagram of another earphone selection interface provided according to an exemplary embodiment. In combination with the above example, if the currently running target application program is a video APP, the electronic device can control the video APP to communicate with the main The headset and the secondary headset communicate. At this time, if the electronic device receives the incoming call notification and the call APP is started, the electronic device can display the earphone selection interface, which includes the first control 403 corresponding to the newly added call APP and the first target image 401 corresponding to the main earphone The second target image 402 corresponding to the secondary earphone. At this time, the user can press and drag the first control 403. If the first control 403 is dragged onto the first target image 401, the corresponding relationship between the main earphone and the call APP will be established, and the call APP will be sent to the main earphone. mode information. At the same time, the secondary earphone corresponding to the second target image 402 can be automatically set to correspond to the video APP, establish a corresponding relationship between the secondary earphone and the video APP, and send the mode information of the video APP to the secondary earphone.
在另一种实施例中,电子设备还可以基于耳机选择界面,建立目标应用程序与多个耳机的对应关系,并向每个耳机发送对应目标应用程序的模式信息,即目标信息,从而可以使目标应用程序与多个耳机的通信识别信息相同。如图5所示,耳机选择界面中还可以包括第三目标图像406,第三目标图像406同时与主耳机和副耳机对应。当用户将第一控件403拖动到第三目标图像406之上时,电子设备可以确定通话APP同时与主耳机和副耳机对应,并向耳机发送包括通话APP的模式信息、主耳机和副耳机的标识信息的数据包。 相应的,主耳机在接收到数据包之后,根据主耳机和副耳机的标识信息,可以设置主耳机和副耳机的模式均为通话模式。此时,通话APP、主耳机和副耳机三者的模式信息相同,进一步的可以设置通话APP、主耳机和副耳机具有相同的通信识别信息,通话APP可以同时与主耳机和副耳机通信。In another embodiment, the electronic device can also establish a corresponding relationship between the target application program and multiple earphones based on the earphone selection interface, and send mode information corresponding to the target application program, that is, target information, to each earphone, so that the The target application is the same as the communication identification information of multiple headsets. As shown in FIG. 5 , the earphone selection interface may further include a third target image 406 , and the third target image 406 corresponds to both the primary earphone and the secondary earphone. When the user drags the first control 403 onto the third target image 406, the electronic device can determine that the calling APP corresponds to the main earphone and the auxiliary earphone at the same time, and send the mode information including the calling APP, the main earphone and the auxiliary earphone to the earphone A packet of identification information. Correspondingly, after the main earphone receives the data packet, according to the identification information of the main earphone and the auxiliary earphone, the mode of the main earphone and the auxiliary earphone can be set as the call mode. At this time, the mode information of the calling APP, the main earphone and the auxiliary earphone are the same. Further, the calling APP, the main earphone and the auxiliary earphone can be set to have the same communication identification information, and the calling APP can communicate with the main earphone and the auxiliary earphone at the same time.
需要说明的是,耳机选择界面的具体形式,以及用户与耳机选择界面之间的交互方式可以根据需求设置,本实施例对此不做限制。实际应用中,电子设备在确定目标应用程序的数量不少于两个的情况下,显示耳机选择界面,用户可以通过耳机选择界面手动选择目标应用程序对应的耳机,可以方便用户为佩戴的耳机选择对应的目标应用程序。It should be noted that the specific form of the earphone selection interface and the interaction mode between the user and the earphone selection interface can be set according to requirements, which is not limited in this embodiment. In practical applications, when the number of target application programs is determined to be not less than two, the electronic device displays the earphone selection interface, and the user can manually select the earphone corresponding to the target application program through the earphone selection interface, which can facilitate the user to choose the earphone for wearing. corresponding target application.
可选地,该方法还可以包括:Optionally, the method may also include:
在耳机选择界面中,接收第二输入;In the earphone selection interface, receiving a second input;
响应于第二输入,确定目标应用程序对应的集成于电子设备内部的音频输出模块;In response to the second input, determine an audio output module integrated in the electronic device corresponding to the target application;
控制目标应用程序与对应的音频输出模块进行通信。The control target application program communicates with the corresponding audio output module.
其中,音频输出模块例如电子设备中集成的麦克风和扬声器等具有音频输出功能的模块。Wherein, the audio output module is, for example, a module with an audio output function such as a microphone and a loudspeaker integrated in the electronic device.
本实施例中,第二输入用于确定与目标应用程序对应的音频输出模块,电子设备还可以基于耳机选择界面接收用户的第二输入,响应于第二输入建立目标应用程序与音频输出模块之间的对应关系,并控制目标应用程序与对应的音频输出模块通信。如图5所示,耳机选择界面中还可以包括与音频输出模块对应的第四目标图像407,第四目标图像407与电子设备中集成的扬声器对应。第二输入例如拖动操作,当用户将第一控件403拖动到第四目标图像407之上时,电子设备可以确定通话APP与扬声器对应,建立通话APP与扬声器之间的对应关系。此时,通话APP在输出音频数据之后,电子设备可以将音频数据转发给扬声器,通过扬声器播放音频数据。第二输入的具体形式可以根据需求设置,本实施例对此不做限制。In this embodiment, the second input is used to determine the audio output module corresponding to the target application program, and the electronic device may also receive the user's second input based on the earphone selection interface, and establish a relationship between the target application program and the audio output module in response to the second input. The corresponding relationship between them, and control the communication between the target application program and the corresponding audio output module. As shown in FIG. 5 , the earphone selection interface may further include a fourth target image 407 corresponding to the audio output module, and the fourth target image 407 corresponds to a speaker integrated in the electronic device. The second input is, for example, a drag operation. When the user drags the first control 403 onto the fourth target image 407, the electronic device can determine that the calling APP corresponds to the speaker, and establish a correspondence between the calling APP and the speaker. At this time, after the calling APP outputs the audio data, the electronic device can forward the audio data to the speaker, and play the audio data through the speaker. The specific form of the second input can be set according to requirements, which is not limited in this embodiment.
在一种实施例中,当电子设备确定某个目标应用程序与音频输出模块对应时,电子设备可以停止其他目标应用程序。例如,当确定通话APP与扬声器对应时,可以停止视频APP和音频APP。或者,电子设备也可以继续控制其他目标应用程序与对应的耳机通信。例如,当确定视频APP与扬声器对应,通话APP与主耳机对应时,可以继续控制通话APP与主耳机进行通信。此时,用户可以通过扬声器观看视频APP播放的视频,并通过主耳机通话。In an embodiment, when the electronic device determines that a certain target application program corresponds to the audio output module, the electronic device may stop other target application programs. For example, when it is determined that the calling APP corresponds to the speaker, the video APP and the audio APP may be stopped. Alternatively, the electronic device may also continue to control other target application programs to communicate with the corresponding headset. For example, when it is determined that the video APP corresponds to the speaker and the call APP corresponds to the main earphone, the call APP can be continuously controlled to communicate with the main earphone. At this time, the user can watch the video played by the video APP through the speaker, and talk through the main earphone.
实际应用中,电子设备基于耳机选择界面,建立目标应用程序与音频输出模块之间的对应关系,控制目标应用程序与音频输出模块进行通信,可以方便用户灵活的操作电子设备。基于耳机选择界面确定目标应用程序对应的音频输出模块的具体过程可以根据需求设置,本实施例对此不做限制。In practical application, the electronic device establishes the corresponding relationship between the target application program and the audio output module based on the earphone selection interface, and controls the target application program to communicate with the audio output module, which can facilitate the user to operate the electronic device flexibly. The specific process of determining the audio output module corresponding to the target application program based on the earphone selection interface can be set according to requirements, which is not limited in this embodiment.
在一种实施例中,耳机选择界面中还可以包括与目标应用程序对应的操作控件,以便于用户快速操作目标应用程序。如图5所示,耳机选择界面中可以包括短信回复控件408,短信回复控件408与通话APP对应。当用户点击短信回复控件408之后,电子设备可以响应于用户的点击操作,进入短信编辑界面,编辑短信,并向来电的用户发送短信。耳机选择界面中包括的具体内容可以根据需求设置,本实施例对此不做限制。In an embodiment, the earphone selection interface may further include an operation control corresponding to the target application program, so as to facilitate the user to quickly operate the target application program. As shown in FIG. 5 , the earphone selection interface may include a text message reply control 408 , and the text message reply control 408 corresponds to the call APP. After the user clicks the text message reply control 408, the electronic device may respond to the user's click operation to enter the text message editing interface, edit the text message, and send the text message to the calling user. The specific content included in the earphone selection interface can be set according to requirements, which is not limited in this embodiment.
可选地,该方法还可以包括:Optionally, the method may also include:
向耳机发送目标应用程序的目标信息,以使耳机输出与目标应用程序对应的指示信息,并在接收到对应指示信息的用户操作的情况下,使耳机的通信识别信息与指示信息所属目标应用程序的通信识别信息相同。Send the target information of the target application to the earphone, so that the earphone outputs the indication information corresponding to the target application, and when the user operation corresponding to the indication information is received, make the communication identification information of the earphone and the indication information belong to the target application The communication identification information is the same.
可选地,耳机可以接收电子设备发送的目标应用程序的目标信息;基于目标信息,设置耳机的通信识别信息与至少一个目标应用程序的通信识别信息相同。Optionally, the earphone may receive the target information of the target application program sent by the electronic device; based on the target information, set the communication identification information of the earphone to be the same as the communication identification information of at least one target application program.
在一种实施例中,电子设备可以向耳机发送目标应用程序的目标信息,以使耳机输出与目标应用程序对应的指示信息,在接收到与指示信息对应的用户操作的情况下,设置耳机的通信识别信息与指示信息所属目标应用程序的通信识别信息相同。结合上述举例,电子设备可以向主耳机发送通话APP的模式信息、音频APP的模式信息,以及视频APP的模式信息。相应的,主耳机在接收到模式信息之后,可以控制主耳机和副耳机输出对应的指示信息。例如,针对通话APP的模式信息,主耳机可以控制主耳机和副耳机同时输出第一语音“请双击暂停键,设置耳机为通话模式”。此时,若用户双击主耳机中的暂停键,主耳机可以响应于用户的双击操作,将主耳机设置为通话模式。此时,电子设备和主耳机可以同时将模式信息作为通信识别信息,使通话APP和主耳机具有相同的通信识别信息。In one embodiment, the electronic device may send the target information of the target application to the earphone, so that the earphone outputs indication information corresponding to the target application, and when a user operation corresponding to the indication information is received, set the earphone's The communication identification information is the same as the communication identification information indicating the target application to which the information belongs. With reference to the above examples, the electronic device may send the mode information of the call APP, the mode information of the audio APP, and the mode information of the video APP to the main earphone. Correspondingly, after receiving the mode information, the main earphone can control the main earphone and the auxiliary earphone to output corresponding indication information. For example, for the mode information of the calling APP, the main earphone can control the main earphone and the auxiliary earphone to output the first voice at the same time, "Please double-click the pause button to set the earphone to the call mode". At this time, if the user double-clicks the pause button in the main earphone, the main earphone can respond to the user's double-click operation, and set the main earphone to the call mode. At this time, the electronic device and the main earphone can use the mode information as the communication identification information at the same time, so that the calling APP and the main earphone have the same communication identification information.
其中,当主耳机和副耳机均接收到用户双击暂停键的操作时,可以将主耳机和副耳机均设置为通话模式。在输出第一语音之后,主耳机可以控制主耳机和副耳机同时输出第二语音“请单击暂停键,设置耳机为视频模式”,若用户单击主耳机中的暂停键,主耳机可以响应于用户的单击操作,将主耳 机设置为视频模式。当主耳机和副耳机均接收到用户单击暂停键的操作时,将主耳机和副耳机均设置为视频模式。其中,指示信息的具体类型和输出方式可以根据需求设置,在第一次设置耳机的模式之后,若第二次接收到与指示信息对应的用户操作,可以继续对耳机的模式进行更改。Wherein, when both the main earphone and the auxiliary earphone receive the operation of double-clicking the pause button by the user, both the main earphone and the auxiliary earphone can be set to the call mode. After outputting the first voice, the main earphone can control the main earphone and the secondary earphone to output the second voice at the same time, "Please click the pause button to set the earphone to video mode". If the user clicks the pause button in the main earphone, the main earphone can respond Based on the user's single-click operation, the main headset is set to video mode. When both the primary earphone and the secondary earphone receive the operation of clicking the pause button by the user, both the primary earphone and the secondary earphone are set to the video mode. Wherein, the specific type and output mode of the indication information can be set according to the requirement. After the earphone mode is set for the first time, if the user operation corresponding to the indication information is received for the second time, the earphone mode can be continued to be changed.
实际应用中,耳机输出与目标应用程序对应的指示信息,指示用户操作耳机设置耳机的通信识别信息,以确定耳机对应的目标应用程序,可以方便使用耳机的用户根据需求选择耳机对应的目标应用程序。In practical applications, the headset outputs instruction information corresponding to the target application program, instructing the user to operate the headset to set the communication identification information of the headset to determine the target application program corresponding to the headset, which can facilitate the user using the headset to select the target application program corresponding to the headset according to needs .
步骤203、耳机确定耳机的通信识别信息。 Step 203, the earphone determines the communication identification information of the earphone.
其中,耳机与电子设备无线连接,电子设备用于在确定当前运行的应用程序中的目标应用程序不少于两个的情况下,分别为目标应用程序配置不同的通信识别信息。Wherein, the earphone is wirelessly connected with the electronic device, and the electronic device is configured to configure different communication identification information for the target application programs respectively under the condition that there are no less than two target application programs in the currently running application programs.
步骤204、目标应用程序与通信识别信息相同的耳机进行通信。 Step 204, the target application program communicates with the headset with the same communication identification information.
可选地,该方法还可以包括:Optionally, the method may also include:
在耳机发送的通信数据中包括控制指令的情况下,若与耳机具有相同通信识别信息的目标应用程序的优先级低于其他目标应用程序的优先级,则确定控制指令为无效指令。In the case that the communication data sent by the headset includes a control command, if the priority of the target application having the same communication identification information as the headset is lower than that of other target applications, the control command is determined to be an invalid command.
本实施例中,电子设备可以根据目标应用程序的优先级,将优先级较低的目标应用程序接收到的控制指令设置为无效指令,以避免多个耳机同时控制电子设备。结合上述举例,电子设备可以根据目标应用程序的模式等级,确定目标应用程序的优先级。电子设备在接收到耳机发送的数据包之后,若数据包中包括副耳机发送的控制指令和视频模式的模式信息,电子设备可以根据视频APP和通话APP的优先级,确定视频APP的优先级低于通话APP的优先级,设置控制指令为无效指令,电子设备可以不向视频APP传递控制指令,或者控制视频APP不执行控制指令。此时,若用户A在使用主耳机通话,用户B在使用副耳机观看视屏,由于设置副耳机发送的控制指令无效,因此只有佩戴主耳机的用户A可以通过耳机操作电子设备。In this embodiment, the electronic device may set the control instruction received by the target application program with a lower priority as an invalid instruction according to the priority of the target application program, so as to prevent multiple earphones from simultaneously controlling the electronic device. With reference to the above example, the electronic device may determine the priority of the target application program according to the mode level of the target application program. After the electronic device receives the data packet sent by the earphone, if the data packet includes the control command sent by the secondary earphone and the mode information of the video mode, the electronic device can determine that the priority of the video APP is low according to the priorities of the video APP and the calling APP. Based on the priority of the call APP, set the control command as an invalid command, and the electronic device may not transmit the control command to the video APP, or control the video APP not to execute the control command. At this time, if user A is using the primary earphone to talk, and user B is using the secondary earphone to watch the video, since the control command sent by setting the secondary earphone is invalid, only user A wearing the primary earphone can operate the electronic device through the earphone.
实际应用中,电子设备可以根据目标应用程序的优先级,将优先级较低的目标应用程序接收到的控制指令设置为无效指令,可以避免多个耳机同时控制电子设备,影响用户对电子设备的正常使用。In practical applications, the electronic device can set the control commands received by the target application program with lower priority as invalid commands according to the priority of the target application program, which can prevent multiple earphones from simultaneously controlling the electronic device and affecting the user's understanding of the electronic device. Normal use.
可选地,该方法还可以包括:Optionally, the method may also include:
在耳机发送的通信数据中包括控制指令的情况下,若控制指令与除耳机对应的目标应用程序之外的其他目标应用程序不匹配,则确定控制指令为无 效指令。In the case that the communication data sent by the earphone includes a control instruction, if the control instruction does not match other target application programs except the target application program corresponding to the earphone, then it is determined that the control instruction is an invalid instruction.
本实施例中,电子设备在接收到属于某个应用程序的控制指令之后,可以根据控制指令对其他目标应用程序的影响,确定对其他目标应用程序有影响的控制指令无效,以避免多个耳机同时控制电子设备时,相互干扰。结合上述举例,电子设备在接收到耳机发送的数据包之后,若数据包中包括副耳机发送的控制指令和视频模式的模式信息,首先可以确定控制指令属于视频APP。此时电子设备可以判断控制指令的执行是否会影响通话APP,例如电子设备可以确定控制指令对应的操作对象,若控制指令对应的操作对象为电子设备中的键盘、显示屏等硬件模块,则可以确定控制指令的执行可能会影响通话APP的运行,即会影响正常通话,则确定控制指令与通话APP不匹配,确定控制指令为无效指令。此时,控制指令不执行,不会对用户的正常通话产生影响。其中,确定控制指令与目标应用程序不匹配的具体方法可以根据需求设置,本实施例对此不做限制。In this embodiment, after the electronic device receives a control instruction belonging to a certain application program, it can determine that the control instruction that affects other target application programs is invalid according to the influence of the control instruction on other target application programs, so as to avoid multiple headsets When controlling electronic devices at the same time, they interfere with each other. With reference to the above example, after the electronic device receives the data packet sent by the earphone, if the data packet includes the control command sent by the secondary earphone and the mode information of the video mode, it can first determine that the control command belongs to the video APP. At this time, the electronic device can determine whether the execution of the control instruction will affect the calling APP. For example, the electronic device can determine the operation object corresponding to the control instruction. If the operation object corresponding to the control instruction is a hardware module such as a keyboard or a display screen in the electronic device, then If it is determined that the execution of the control instruction may affect the operation of the call APP, that is, it will affect the normal call, then it is determined that the control instruction does not match the call APP, and it is determined that the control instruction is an invalid instruction. At this time, the control instruction is not executed and will not affect the user's normal conversation. Wherein, the specific method for determining that the control instruction does not match the target application program can be set according to requirements, which is not limited in this embodiment.
实际应用中,电子设备在接收到耳机发送的控制指令之后,若控制指令与除耳机对应的目标应用程序之外的其他目标应用程序不匹配,则确定控制指令无效,可以避免多个耳机同时控制电子设备时,相互干扰,影响用户操作。相反的,可以使控制指令正常执行,便于用户对控制指令所属的应用程序进行操作。In practical applications, after the electronic device receives the control command sent by the earphone, if the control command does not match the target application program other than the target application program corresponding to the earphone, it will determine that the control command is invalid, which can prevent multiple earphones from simultaneously controlling When electronic devices are connected, they interfere with each other and affect user operations. On the contrary, the control instruction can be executed normally, so that the user can operate the application program to which the control instruction belongs.
综上所述,本实施例中,电子设备从运行的多个应用程序中确定具有耳机通信需求的目标应用程序,在目标应用程序的数量不少于2个的情况下,分别为目标应用程序设置不同的通信识别信息,控制目标应用程序与具有相同通信识别信息的耳机进行通信。当出现多个应用程序同时需要与耳机通信的情况时,通过通信识别信息控制多个应用程序分别与对应的耳机进行通信,可以使多个应用程序同时工作,从而可以解决部分应用程序的功能无法使用的问题。To sum up, in this embodiment, the electronic device determines the target application program that has earphone communication requirements from among the running multiple application programs. Different communication identification information is set, and the target application program is controlled to communicate with the headset with the same communication identification information. When multiple applications need to communicate with the headset at the same time, the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
可选地,该方法还可以包括:Optionally, the method may also include:
建立与新的耳机的通信连接;establishing a communication connection with the new headset;
确定新的耳机对应的目标应用程序;Determine the target application for the new headset;
控制对应新的耳机的目标应用程序与新的耳机通信。The target application corresponding to the new headset is controlled to communicate with the new headset.
本实施例中,电子设备在控制目标应用程序与对应的耳机通信的同时,可以建立与新的耳机的通信连接,以控制其中的一个目标应用程序与新的耳机进行通信。新的耳机例如可以为新增加的第三蓝牙耳机。In this embodiment, while controlling the target application program to communicate with the corresponding earphone, the electronic device can establish a communication connection with the new earphone, so as to control one of the target application programs to communicate with the new earphone. The new headset may be, for example, a newly added third Bluetooth headset.
示例性地,如图6所示,图6是根据一示例性实施例提供的一种通信建立过程的示意图,在电子设备控制通话APP与主耳机进行通信,以及控制视频APP与副耳机进行通信的过程中,即用户A正在使用第一蓝牙耳机通话,用户B正在使用第二蓝牙耳机观看视频,用户C可以操作第三蓝牙耳机,向电子设备发送通信请求,请求与电子设备配对,以接入其中一个目标应用程序与耳机之间的通信过程。电子设备在接收到通信请求之后,可以输出通知信息,通知控制电子设备的主用户,主用户可以为用户A或用户B。电子设备可以响应于主用户点击通知信息的操作,显示配对界面。若主用户同意电子设备与第三蓝牙耳机配对,可以点击配对界面中的确认按键。电子设备可以响应于主用户点击确认按键的操作,建立与第三蓝牙耳机之间的通信连接。反之,若主用户不同意第三蓝牙耳机接入,可以操作电子设备,拒绝第三蓝牙耳机的通信请求。电子设备建立与新的耳机之间的通信连接的具体过程可以根据需求设置,本实施例对此不做限制。For example, as shown in FIG. 6, FIG. 6 is a schematic diagram of a communication establishment process provided according to an exemplary embodiment. The electronic device controls the call APP to communicate with the primary earphone, and controls the video APP to communicate with the secondary earphone. In the process, that is, user A is using the first bluetooth headset to talk, user B is using the second bluetooth headset to watch video, user C can operate the third bluetooth headset, send a communication request to the electronic device, and request to pair with the electronic device to receive into the communication process between one of the target applications and the headset. After receiving the communication request, the electronic device may output notification information to notify the main user controlling the electronic device, and the main user may be user A or user B. The electronic device may display a pairing interface in response to the main user's operation of clicking on the notification information. If the main user agrees to pair the electronic device with the third Bluetooth headset, the confirmation button in the pairing interface can be clicked. The electronic device may establish a communication connection with the third Bluetooth headset in response to the main user's operation of clicking the confirmation button. Conversely, if the main user does not agree to the access of the third Bluetooth headset, the electronic device can be operated to reject the communication request of the third Bluetooth headset. The specific process of establishing a communication connection between the electronic device and the new earphone can be set according to requirements, which is not limited in this embodiment.
在一种实施例中,电子设备可以基于应用选择界面,选择新的耳机的对应的目标应用程序。如图7所示,图7是根据一示例性实施例提供的一种应用选择界面的示意图,结合上述举例,若主用户同意用户C接入,主用户可以操作电子设备,使电子设备显示图7所示的应用选择界面,应用选择界面中包括当前运行的多个目标应用程序的目标图像,以及第三蓝牙耳机对应的第四控件701,若主用户将第三蓝牙耳机对应的第四控件701拖动到通话APP的目标图像702上,电子设备可以响应于主用户的拖动操作,确定通话APP与第三蓝牙耳机对应。此时,电子设备可以向第三蓝牙耳机发送通话APP的模式信息,第三蓝牙耳机在接收到模式信息之后,可以输出对应的第三语音“是否同意接入通话”。若用户C同意接入,可以点击蓝牙耳机中的确认按键,第三蓝牙耳机可以响应于点击操作,设置第三蓝牙耳机的模式为通话模式,即设置第三蓝牙耳机的通信识别信息与通话APP的通信识别信息相同。此时,第一蓝牙耳机和第三蓝牙耳机的通信识别信息均与通话APP的通信识别信息相同,电子设备可以控制通话APP同时与第一蓝牙耳机和第三栏耳机进行通信,因此佩戴第一蓝牙耳机的用户A和佩戴第三蓝牙耳机的用户C可以同时接听电话。反之,若用户C不同意接入,则可以控制耳机拒绝接入通话APP与第一蓝牙耳机的通信过程。In an embodiment, the electronic device may select a corresponding target application program of the new earphone based on the application selection interface. As shown in Figure 7, Figure 7 is a schematic diagram of an application selection interface provided according to an exemplary embodiment. In combination with the above example, if the main user agrees to user C's access, the main user can operate the electronic device to make the electronic device display In the application selection interface shown in 7, the application selection interface includes the target images of multiple target applications currently running, and the fourth control 701 corresponding to the third Bluetooth headset. If the main user controls the fourth control 701 corresponding to the third Bluetooth headset 701 is dragged onto the target image 702 of the calling APP, and the electronic device may determine that the calling APP corresponds to the third Bluetooth headset in response to the main user's drag operation. At this time, the electronic device can send the mode information of the call APP to the third Bluetooth headset, and the third Bluetooth headset can output the corresponding third voice "do you agree to join the call" after receiving the mode information. If user C agrees to access, he can click the confirmation button in the Bluetooth headset, and the third Bluetooth headset can respond to the click operation, and set the mode of the third Bluetooth headset as a call mode, that is, set the communication identification information of the third Bluetooth headset and the call APP The communication identification information is the same. At this time, the communication identification information of the first Bluetooth earphone and the third Bluetooth earphone are the same as the communication identification information of the call APP, and the electronic device can control the call APP to communicate with the first Bluetooth earphone and the third earphone at the same time, so wearing the first Bluetooth earphone User A with the bluetooth headset and user C with the third bluetooth headset can answer calls at the same time. Conversely, if user C does not agree to access, the earphone can be controlled to refuse access to the communication process between the calling APP and the first Bluetooth earphone.
在另一种实施例中,在建立与电子设备之间的通信连接之后,使用第三蓝牙耳机的用户C可以主动操作第三蓝牙耳机,向电子设备发送接入请求, 以使电子设备设置与第三蓝牙耳机对应的目标应用程序。如图6所示,在主用户未给第三蓝牙耳机选择目标应用程序的情况下,用户C可以双击第三蓝牙耳机中的暂停键,第三蓝牙耳机可以响应于用户C的双击操作,向电子设备发送接入请求。当电子设备确定当前运行的目标应用程序只有一个时,可以直接确定第三蓝牙耳机与通话APP对应。或者,电子设备可以输出通知信息,通知用户A。若用户A同意用户C接入,可以点击确定按钮,确定第三蓝牙耳机与通话APP对应。若当前运行的目标应用程序不少于两个,电子设备可以显示如图7所示的应用程序选择界面,为第三蓝牙耳机配置一个对应的目标应用程序。In another embodiment, after establishing a communication connection with the electronic device, user C who uses the third Bluetooth headset can actively operate the third Bluetooth headset to send an access request to the electronic device, so that the electronic device is set to the same A target application program corresponding to the third Bluetooth headset. As shown in Figure 6, when the main user does not select a target application program for the third Bluetooth headset, user C can double-click the pause button in the third Bluetooth headset, and the third Bluetooth headset can respond to the double-click operation of user C, to The electronic device sends an access request. When the electronic device determines that there is only one target application program currently running, it may directly determine that the third Bluetooth headset corresponds to the calling APP. Alternatively, the electronic device may output notification information to notify user A. If user A agrees to user C's access, he can click the OK button to confirm that the third Bluetooth headset corresponds to the call APP. If there are not less than two target application programs currently running, the electronic device may display an application program selection interface as shown in FIG. 7 , and configure a corresponding target application program for the third Bluetooth headset.
需要说明的是,第三蓝牙耳机的接入过程可以根据需求设置,本实施例对此不做具体限制。实际应用中,电子设备在控制目标应用程序与耳机通信的过程中,可以建立与未连接的耳机的通信连接,以增加新的耳机,控制新的耳机与目标应用程序进行通信,可以方便用户扩展耳机的数量。It should be noted that the access process of the third Bluetooth headset can be set according to requirements, which is not specifically limited in this embodiment. In practical applications, in the process of controlling the target application program to communicate with the headset, the electronic device can establish a communication connection with the unconnected headset to add a new headset, and control the new headset to communicate with the target application program, which can facilitate user expansion. The number of headphones.
可选地,当目标应用程序同时与多个耳机通信时,电子设备在接收到耳机发送的通信数据时,可以在通信数据中添加耳机的标识信息。例如,电子设备在接收到第一蓝牙耳机发送的音频数据时,可以在音频数据中添加第一蓝牙耳机的标识信息,并向通话APP转发音频数据。同理,电子设备在接收到第三蓝牙耳机发送的音频数据时,可以在音频数据中添加第三蓝牙耳机的标识信息,并向通话APP转发音频数据。此时,通话APP可以根据音频数据中的标识信息,确定音频数据的来源,以便于通话APP根据音频数据的来源对音频数据做不同的处理,例如通话APP可以根据音频数据的来源对不同来源的音频数据分别进行存储。Optionally, when the target application communicates with multiple earphones at the same time, when the electronic device receives the communication data sent by the earphones, it may add the identification information of the earphones to the communication data. For example, when the electronic device receives the audio data sent by the first Bluetooth headset, it may add the identification information of the first Bluetooth headset to the audio data, and forward the audio data to the calling APP. Similarly, when the electronic device receives the audio data sent by the third Bluetooth headset, it can add the identification information of the third Bluetooth headset to the audio data, and forward the audio data to the calling APP. At this time, the calling APP can determine the source of the audio data according to the identification information in the audio data, so that the calling APP can process the audio data differently according to the source of the audio data. Audio data is stored separately.
可选地,针对耳机发送的控制指令,用户可以设置不同模式下,控制指令的作用不同。Optionally, for the control commands sent by the earphones, the user can set different functions of the control commands in different modes.
示例地,如图3所示,用户可以设置通话模式下,双击指令的作用是启动目标程序中的协助输入功能。例如,电子设备在控制通话APP与主耳机通信时,若主耳机接收到用户双击按键的操作,可以生成双击指令,向电子设备发送包括双击指令的数据包。电子设备在将双击指令转发给通话APP时,通话APP可以响应于双击指令,启动通话APP的协助输入功能。此时,在用户A使用主耳机通话的过程中,通话APP可以对通话内容进行语音识别,若识别到用户A需要输入数字“1”,可以自动控制电子设备中的键盘输入1。再例如,用户可以设置听歌模式下,双击指令的作用是收藏当前播放的音乐。 电子设备在控制音频APP与耳机通信时,若耳机接收到用户双击按键的操作,可以生成双击指令,向电子设备发送包括双击指令的数据包。电子设备在将双击指令转发给音频APP时,音频APP可以响应于双击指令,启动收藏功能,收藏当前播放的音乐。For example, as shown in FIG. 3 , the user can set that in the call mode, the function of the double-click instruction is to activate the assist input function in the target program. For example, when the electronic device controls the call APP to communicate with the main earphone, if the main earphone receives the user's double-click operation, it can generate a double-click instruction and send a data packet including the double-click instruction to the electronic device. When the electronic device forwards the double-click instruction to the calling APP, the calling APP may respond to the double-click instruction to activate the assist input function of the calling APP. At this time, when user A is using the main earphone to talk, the calling APP can perform voice recognition on the content of the call. If it recognizes that user A needs to input the number "1", it can automatically control the keyboard in the electronic device to input 1. For another example, the user can set that in the listening mode, the function of double-clicking the command is to save the currently playing music. When the electronic device controls the communication between the audio APP and the earphone, if the earphone receives the user's double-click operation, it can generate a double-click instruction and send a data packet including the double-click instruction to the electronic device. When the electronic device forwards the double-click instruction to the audio APP, the audio APP can respond to the double-click instruction to activate the collection function and collect the currently playing music.
实际应用中,用户可以为应用程序设置不同的模式,并设置不同模式下控制指令的作用不同,可以方便用户在使用不同应用程序时,控制电子设备实现不同功能。In practical application, the user can set different modes for the application program, and set different functions of the control commands in different modes, which can facilitate the user to control the electronic device to realize different functions when using different application programs.
参照图8,图8是根据一示例性实施例提供的又一种通信控制方法的步骤流程图,该方法可以包括:Referring to FIG. 8, FIG. 8 is a flowchart of steps of another communication control method provided according to an exemplary embodiment. The method may include:
步骤801、确定耳机的通信识别信息。 Step 801. Determine communication identification information of the headset.
步骤802、控制耳机与具有相同通信识别信息的目标应用程序进行通信。Step 802, controlling the earphone to communicate with the target application program having the same communication identification information.
可选地,步骤802可通过如下方式实现:Optionally, step 802 may be implemented in the following manner:
在接收到电子设备发送的通信数据的情况下,基于通信数据中包括的通信识别信息,处理具有相同通信识别信息的目标应用程序发送的通信数据;In the case of receiving the communication data sent by the electronic device, based on the communication identification information included in the communication data, process the communication data sent by the target application having the same communication identification information;
向电子设备发送包括通信识别信息的通信数据,以使电子设备根据通信识别信息,将通信数据转发给具有相同通信识别信息的目标应用程序。Sending the communication data including the communication identification information to the electronic device, so that the electronic device forwards the communication data to the target application program with the same communication identification information according to the communication identification information.
其中,步骤801和步骤802可以由上述实施例中的耳机执行,本实施例对此不做详细描述。Wherein, step 801 and step 802 may be performed by the earphone in the foregoing embodiment, which will not be described in detail in this embodiment.
综上所述,确定耳机的通信识别信息,并基于耳机的通信识别信息,控制耳机与具有相同通信识别信息的目标应用程序进行通信。当出现多个应用程序同时需要与耳机通信的情况时,通过通信识别信息控制多个应用程序分别与对应的耳机进行通信,可以使多个应用程序同时工作,从而可以解决部分应用程序的功能无法使用的问题。To sum up, the communication identification information of the earphone is determined, and based on the communication identification information of the earphone, the earphone is controlled to communicate with the target application program having the same communication identification information. When multiple applications need to communicate with the headset at the same time, the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
在一种实施例中,针对耳机发送的不同指令,用户可以设置不同指令具有不同的作用,例如第一指令用于播放语音信息,第二指令用于回复当前播放的语音信息。第一指令例如单击指令,第二指令例如双击指令,第一指令和第二指令也可以为其他形式的指令。In one embodiment, for different commands sent by the earphone, the user can set different commands to have different functions, for example, the first command is used to play voice information, and the second command is used to reply to the currently played voice message. The first instruction is, for example, a single-click instruction, and the second instruction is, for example, a double-click instruction. The first instruction and the second instruction may also be instructions in other forms.
示例性的,如图9和图10所示,图9是根据一示例性实施例提供的一种聊天界面的示意图,图10是根据一示例性实施例提供的一种语音播放的流程示意图,当电子设备控制聊天APP与其中一个蓝牙耳机通信时,聊天APP接收到第一语音信息901时,可以输出提示信息。电子设备可以将提示信息发送给蓝牙耳机,此时蓝牙耳机输出提示信息,提示佩戴蓝牙耳机的用户用 户B接收到语音信息。若用户B单击蓝牙耳机中的播放按键,蓝牙耳机可以生成单击指令,并向电子设备发送单击指令。聊天APP在接收到电子设备转发的单击指令之后,可以响应于单击指令,播放接收到的第一语音信息901。此时,若用户B双击蓝牙耳机中的按键,蓝牙耳机可以生成双击指令。聊天APP在接收到电子设备转发的双击指令之后,可以控制聊天APP启动对当前播放的第一语音信息901的回复,用户B可以通过蓝牙耳机输入第二语音信息902,聊天APP在接收到蓝牙耳机发送的第二语音信息902时,可以向用户A发送第二语音信息902。其中,当用户B再次双击按键时,可以再次对用户A的第一语音信息901进行回复,生成并向用户A发送第三语音信息903。Exemplarily, as shown in Figures 9 and 10, Figure 9 is a schematic diagram of a chat interface provided according to an exemplary embodiment, and Figure 10 is a schematic flowchart of a voice playback provided according to an exemplary embodiment, When the electronic device controls the chat APP to communicate with one of the Bluetooth headsets, the chat APP may output prompt information when receiving the first voice message 901 . The electronic device can send the prompt information to the bluetooth headset, at this time, the bluetooth headset outputs prompt information, prompting the user user B wearing the bluetooth headset to receive the voice information. If user B clicks the play button in the bluetooth headset, the bluetooth headset can generate a click instruction and send the click instruction to the electronic device. After receiving the click instruction forwarded by the electronic device, the chat APP may play the received first voice information 901 in response to the click instruction. At this time, if user B double-clicks the button in the Bluetooth headset, the Bluetooth headset can generate a double-click instruction. After the chat APP receives the double-click instruction forwarded by the electronic device, it can control the chat APP to start replying to the currently playing first voice message 901. User B can input the second voice message 902 through the Bluetooth headset. After the chat APP receives the bluetooth headset When the second voice information 902 is sent, the second voice information 902 may be sent to user A. Wherein, when user B double-clicks the button again, it can reply to user A's first voice information 901 again, generate and send third voice information 903 to user A.
在另一种实施例中,电子设备在接收到蓝牙耳机发送的单击指令之后,可以连续播放接收到的语音信息。如图9所示,聊天APP在播放第一语音信息901之后,连续向用户A发送了第二语音信息902和第三语音信息903。此时,聊天APP可以继续向蓝牙耳机发送第四语音信息904,使蓝牙耳机播放第四语音信息904。在播放第四语音信息904之后,聊天APP可以等待预设时长,预设时长例如2秒。若在预设时长内未接收到蓝牙耳机发送的双击指令,则继续播放第五语音信息905。依次类推,直至播放到最后一条语音信息。在播放最后一条语音信息之后,若在预设时长内接收到双击指令,则回复最后一条语音信息。反之,若在等待预设时长后,未接收到蓝牙耳机发送的双击指令,则继续确定是否接收到其他用户发送的语音消息,若接收到其他用户的语音消息,在继续播放其他用户的语音信息,若未接收到其他用户的语音消息,则结束语音消息的播放。In another embodiment, after receiving the click instruction sent by the Bluetooth headset, the electronic device may continuously play the received voice information. As shown in FIG. 9 , after playing the first voice message 901 , the chat APP continuously sends the second voice message 902 and the third voice message 903 to the user A. At this time, the chat APP can continue to send the fourth voice information 904 to the Bluetooth headset, so that the Bluetooth headset can play the fourth voice information 904 . After playing the fourth voice message 904, the chat APP may wait for a preset time period, for example, 2 seconds. If the double-click instruction sent by the Bluetooth headset is not received within the preset time period, the fifth voice message 905 will continue to be played. And so on, until the last voice message is played. After playing the last voice message, if a double-click instruction is received within the preset time period, the last voice message will be replied. Conversely, if after waiting for a preset period of time, the double-click instruction sent by the Bluetooth headset is not received, then continue to determine whether the voice message sent by other users is received, and if the voice message of other users is received, continue to play the voice message of other users , if no voice messages from other users are received, the voice message playback will end.
其中,聊天APP在播放语音信息时,可以根据接收到的单击指令和双击指令,对语音信息进行标记,并对语音信息进行划分。结合图9所示,在播放用户A发送的第一语音信息901时,用户B连续回复了第二语音信息902和第三语音信息903,则可以将第一语音信息901、第二语音信息902和第三语音信息903确定为第一话题,同时对第一语音信息901进行标记,以确定用户B对第一语音信息901进行了回复。同理,在播放用户A发送的第四语音信息904和第五语音信息905时,用户B对第五语音信息905进行了回复,并连续回复了第六语音信息906和第七语音信息907。此时,可以对第五语音信息905进行标记,确定用户B对第五语音信息905进行了回复,同时将第四语音信息904、第五语音信息905、第六语音信息906和第七语音 信息907定为第二话题。在播放第二话题中的语音信息时,可以从添加标记的第五语音信息开始播放,忽略第四语音信息,可以方便用户快速的确定语音信息中的具体内容。Wherein, when the chat APP plays the voice information, it can mark the voice information according to the received single-click instruction and double-click instruction, and divide the voice information. As shown in FIG. 9 , when playing the first voice message 901 sent by user A, user B replies to the second voice message 902 and the third voice message 903 continuously, then the first voice message 901, the second voice message 902 can be and the third voice information 903 are determined as the first topic, and at the same time, the first voice information 901 is marked to determine that user B has replied to the first voice information 901 . Similarly, when the fourth voice message 904 and the fifth voice message 905 sent by user A are played, user B replies to the fifth voice message 905 and replies to the sixth voice message 906 and the seventh voice message 907 continuously. At this time, the fifth voice information 905 can be marked to determine that user B has replied to the fifth voice information 905, and at the same time, the fourth voice information 904, the fifth voice information 905, the sixth voice information 906 and the seventh voice information 907 is set as the second topic. When playing the voice information in the second topic, the marked fifth voice information can be started to be played, and the fourth voice information can be ignored, so that the user can quickly determine the specific content of the voice information.
本实施例中,聊天APP可以根据语音信息的回复过程,对语音信息进行顺序存储。如图9所示,聊天APP在连续接收到用户A发送的第四语音信息904和第五语音信息905之后,聊天APP顺序播放第四语音信息904和第五语音信息905,若在播放第四语音信息905时,用户B双击蓝牙耳机,对第四语音信息904进行了回复,回复了第六语音信息906,则聊天信息可以确定第六语音信息906位于第四语音信息904和第五语音信息905之间。在存储语音信息的过程中,可以按第四语音信息904、第六语音信息906、第五语音信息805,依次存储第四语音信息904、第六语音信息906和第五语音信息906。此时,用户在第二次播放语音信息时,聊天APP可以按第四语音信息904、第六语音信息906、第五语音信息905顺序播放语音顺序,可以保持语音内容的连贯性。In this embodiment, the chat APP can sequentially store the voice information according to the reply process of the voice information. As shown in Figure 9, after the chat APP continuously receives the fourth voice information 904 and the fifth voice information 905 sent by user A, the chat APP plays the fourth voice information 904 and the fifth voice information 905 sequentially. When the voice message 905 is received, user B double-clicks the Bluetooth headset to reply to the fourth voice message 904 and the sixth voice message 906, then the chat information can confirm that the sixth voice message 906 is located between the fourth voice message 904 and the fifth voice message Between 905. During the process of storing the voice information, the fourth voice information 904 , the sixth voice information 906 and the fifth voice information 906 can be stored in order according to the fourth voice information 904 , the sixth voice information 906 , and the fifth voice information 805 . At this time, when the user plays the voice information for the second time, the chat APP can play the voice order in the order of the fourth voice information 904, the sixth voice information 906, and the fifth voice information 905, which can maintain the continuity of the voice content.
在一种实施例中,用户可以手动操作语音信息,以对语音信息进行分组。如图9所示,若用户在播放第七语音信息907之后,还播放了第八语音信息908,并且接收到了用户A发送的第九语音信息909,用户B可以手动拖动第八语音信息908,将第八语音信息908和第九语音信息909划分为一个语音话题。用户手动操作语音信息的具体过程可以根据需求设置,本实施对此不做限制。In one embodiment, the user can manually operate the voice information to group the voice information. As shown in Figure 9, if the user plays the eighth voice message 908 after playing the seventh voice message 907, and receives the ninth voice message 909 sent by user A, user B can manually drag the eighth voice message 908 , divide the eighth voice information 908 and the ninth voice information 909 into one voice topic. The specific process for the user to manually operate the voice information can be set according to requirements, which is not limited in this implementation.
实际应用中,用户手动操作语音信息划分语音话题,可以方便用户根据语音内容对语音信息进行归类,以便于用户日后快速查找语音信息。In practical applications, the user manually operates the voice information to divide the voice topic, which can facilitate the user to classify the voice information according to the voice content, so that the user can quickly find the voice information in the future.
需要说明的是,本申请实施例提供的通信控制方法,执行主体可以为耳机,或者该耳机中用于执行通信控制方法的控制模块。本申请实施例中以耳机执行通信控制方法为例,说明本申请实施例提供的耳机。It should be noted that, the communication control method provided in the embodiment of the present application may be executed by an earphone, or a control module in the earphone for executing the communication control method. In the embodiment of the present application, the headset provided in the embodiment of the present application is described by taking the communication control method performed by the headset as an example.
参照图11,图11是根据一示例性实施例提供的一种电子设备的结构示意图,电子设备1100可以包括:Referring to FIG. 11 , FIG. 11 is a schematic structural diagram of an electronic device according to an exemplary embodiment. The electronic device 1100 may include:
第一确定模块1101,用于从运行的多个应用程序中确定具有耳机通信需求的目标应用程序。The first determining module 1101 is configured to determine a target application program that requires earphone communication from a plurality of running application programs.
设置模块1102,用于在目标应用程序的数量不少于2个的情况下,分别为目标应用程序设置不同的通信识别信息。The setting module 1102 is configured to set different communication identification information for target application programs respectively when the number of target application programs is not less than two.
通信模块1103,用于控制目标应用程序与具有相同通信识别信息的耳 机进行通信。The communication module 1103 is used to control the target application program to communicate with the headset with the same communication identification information.
可选地,电子设备1100还可以包括:Optionally, electronic device 1100 may also include:
显示模块,用于显示耳机选择界面。The display module is used for displaying the earphone selection interface.
接收模块,用于在耳机选择界面中,接收第一输入。The receiving module is configured to receive the first input in the earphone selection interface.
第二确定模块,用于响应于第一输入,确定目标应用程序对应的耳机。The second determining module is configured to determine the earphone corresponding to the target application program in response to the first input.
第一发送模块,用于向耳机发送对应目标应用程序的通信识别信息,以使耳机的通信识别信息与对应目标应用程序的通信识别信息相同。The first sending module is configured to send the communication identification information corresponding to the target application program to the headset, so that the communication identification information of the headset is the same as the communication identification information corresponding to the target application program.
可选地,电子设备1100还可以包括:Optionally, electronic device 1100 may also include:
第二发送模块,用于向耳机发送目标应用程序的目标信息,以使耳机输出与目标应用程序对应的指示信息,并在接收到对应指示信息的用户操作的情况下,使耳机的通信识别信息与指示信息所属目标应用程序的通信识别信息相同。The second sending module is configured to send the target information of the target application to the earphone, so that the earphone outputs the instruction information corresponding to the target application program, and in the case of receiving the user operation corresponding to the instruction information, make the communication identification information of the earphone It is the same as the communication identification information indicating the target application to which the information belongs.
可选地,通信模块1103,具体用于在接收到耳机发送的通信数据的情况下,向与通信数据中的通信识别信息所属的目标应用程序传递通信数据;在目标应用程序发出的通信数据中添加目标应用程序的通信识别信息,并向耳机发送添加通信识别信息后的通信数据,以使耳机根据通信数据中的通信识别信息,处理通信数据。Optionally, the communication module 1103 is specifically configured to, in the case of receiving the communication data sent by the earphone, transfer the communication data to the target application program to which the communication identification information in the communication data belongs; in the communication data sent by the target application program The communication identification information of the target application is added, and the communication data with the communication identification information added is sent to the earphone, so that the earphone processes the communication data according to the communication identification information in the communication data.
可选地,通信模块1103,还用于在耳机发送的通信数据中包括控制指令的情况下,若与耳机具有相同通信识别信息的目标应用程序的优先级低于其他目标应用程序的优先级,则确定控制指令为无效指令。Optionally, the communication module 1103 is further configured to, in the case that the communication data sent by the earphone includes a control instruction, if the priority of the target application having the same communication identification information as the earphone is lower than that of other target applications, Then it is determined that the control instruction is an invalid instruction.
综上所述,本实施例中,电子设备从运行的多个应用程序中确定具有耳机通信需求的目标应用程序,在目标应用程序的数量不少于2个的情况下,分别为目标应用程序设置不同的通信识别信息,控制目标应用程序与具有相同通信识别信息的耳机进行通信。当出现多个应用程序同时需要与耳机通信的情况时,通过通信识别信息控制多个应用程序分别与对应的耳机进行通信,可以使多个应用程序同时工作,从而可以解决部分应用程序的功能无法使用的问题。To sum up, in this embodiment, the electronic device determines the target application program that has earphone communication requirements from among the running multiple application programs. Different communication identification information is set, and the target application program is controlled to communicate with the headset with the same communication identification information. When multiple applications need to communicate with the headset at the same time, the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
本申请实施例中的电子设备可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器 (Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The electronic device in the embodiment of the present application may be a mobile electronic device, or may be a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant). assistant, PDA), etc., non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
本申请实施例中的电子设备可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The electronic device in this embodiment of the present application may be a device with an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
本申请实施例提供的电子设备能够实现图1和图2的方法实施例实现的各个过程,为避免重复,这里不再赘述。The electronic device provided in the embodiment of the present application can implement various processes implemented by the method embodiments in FIG. 1 and FIG. 2 , and details are not repeated here to avoid repetition.
参照图12,图12是根据一示例性实施例提供的一种耳机的结构示意图,耳机1200可以包括:Referring to FIG. 12, FIG. 12 is a schematic structural diagram of an earphone according to an exemplary embodiment. The earphone 1200 may include:
确定模块1201,用于确定耳机的通信识别信息;耳机与电子设备无线连接,电子设备用于在确定运行的多个应用程序中具有耳机通信需求的目标应用程序不少于2个的情况下,分别为目标应用程序设置不同的通信识别信息;The determining module 1201 is configured to determine the communication identification information of the earphone; the earphone is wirelessly connected to the electronic device, and the electronic device is used to determine that there are no less than two target application programs that have earphone communication requirements among the running multiple application programs, Set different communication identification information for target applications respectively;
通信模块1202,用于控制耳机与具有相同通信识别信息的目标应用程序进行通信。The communication module 1202 is configured to control the earphone to communicate with the target application program having the same communication identification information.
可选地,耳机1200可以包括:接收模块,用于接收电子设备发送的目标应用程序的目标信息;Optionally, the earphone 1200 may include: a receiving module, configured to receive the target information of the target application sent by the electronic device;
确定模块1201,具体用于基于目标信息,设置耳机的通信识别信息与至少一个目标应用程序的通信识别信息相同。The determining module 1201 is specifically configured to set the communication identification information of the headset to be the same as the communication identification information of at least one target application program based on the target information.
综上所述,确定耳机的通信识别信息,控制耳机与具有相同通信识别信息的目标应用程序进行通信。当出现多个应用程序同时需要与耳机通信的情况时,通过通信识别信息控制多个应用程序分别与对应的耳机进行通信,可以使多个应用程序同时工作,从而可以解决部分应用程序的功能无法使用的问题。To sum up, the communication identification information of the earphone is determined, and the earphone is controlled to communicate with the target application program having the same communication identification information. When multiple applications need to communicate with the headset at the same time, the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
本申请实施例中的耳机可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The headset in this embodiment of the present application may be a device with an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
本申请实施例提供的耳机能够实现图8的方法实施例实现的各个过程,为避免重复,这里不再赘述。The earphone provided in the embodiment of the present application can implement various processes implemented in the method embodiment in FIG. 8 , and details are not repeated here to avoid repetition.
如图13所示,图13是根据一示例性实施例提供的另一种电子设备的结构示意图,电子设备1300包括处理器1301,存储器1302,存储在存储器1302 上并可在所述处理器1301上运行的程序或指令,该程序或指令被处理器1301执行时实现上述通信控制方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。As shown in FIG. 13 , FIG. 13 is a schematic structural diagram of another electronic device provided according to an exemplary embodiment. The electronic device 1300 includes a processor 1301 and a memory 1302 . The program or instruction running on the computer, when the program or instruction is executed by the processor 1301, implements the various processes of the communication control method embodiment above, and can achieve the same technical effect. To avoid repetition, details are not repeated here.
可选地,本申请实施例还提供一种电子设备,包括处理器和存储器,存储在存储器上并可在所述处理器上运行的程序或指令,该程序或指令被处理器执行时实现上述电子设备或耳机执行的通信控制方法的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, an embodiment of the present application further provides an electronic device, including a processor and a memory, a program or instruction stored in the memory and operable on the processor, and the above-mentioned program or instruction is implemented when executed by the processor. The various processes of the communication control method performed by the electronic device or the earphone can achieve the same technical effect, and will not be repeated here to avoid repetition.
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
图14是根据一示例性实施例提供的一种电子设备的硬件结构示意图。Fig. 14 is a schematic diagram of a hardware structure of an electronic device according to an exemplary embodiment.
该电子设备1400包括但不限于:射频单元1401、网络模块1402、音频输出单元1403、输入单元1404、传感器1405、显示单元1406、用户输入单元1407、接口单元1408、存储器1409、以及处理器1410等部件。The electronic device 1400 includes, but is not limited to: a radio frequency unit 1401, a network module 1402, an audio output unit 1403, an input unit 1404, a sensor 1405, a display unit 1406, a user input unit 1407, an interface unit 1408, a memory 1409, and a processor 1410, etc. part.
本领域技术人员可以理解,电子设备1400还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1410逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图14中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 1400 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 1410 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions. The structure of the electronic device shown in FIG. 14 does not constitute a limitation to the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange different components, and details will not be repeated here. .
其中,处理器1410,用于从运行的多个应用程序中确定具有耳机通信需求的目标应用程序;在目标应用程序的数量不少于2个的情况下,分别为目标应用程序设置不同的通信识别信息;Among them, the processor 1410 is used to determine the target application program with earphone communication requirements from the running multiple application programs; when the number of target application programs is not less than 2, set different communication channels for the target application programs respectively. identifying information;
网络模块1402,用于控制目标应用程序与具有相同通信识别信息的耳机进行通信。A network module 1402, configured to control the target application program to communicate with the headset having the same communication identification information.
综上所述,本实施例中,电子设备从运行的多个应用程序中确定具有耳机通信需求的目标应用程序,在目标应用程序的数量不少于2个的情况下,分别为目标应用程序设置不同的通信识别信息,控制目标应用程序与具有相同通信识别信息的耳机进行通信。当出现多个应用程序同时需要与耳机通信的情况时,通过通信识别信息控制多个应用程序分别与对应的耳机进行通信,可以使多个应用程序同时工作,从而可以解决部分应用程序的功能无法使用的问题。To sum up, in this embodiment, the electronic device determines the target application program that has earphone communication requirements from among the running multiple application programs. Different communication identification information is set, and the target application program is controlled to communicate with the headset with the same communication identification information. When multiple applications need to communicate with the headset at the same time, the communication identification information can be used to control multiple applications to communicate with the corresponding headset, so that multiple applications can work at the same time, which can solve the problem that some applications cannot function. problem of use.
可选地,显示单元1406,用于显示耳机选择界面;在耳机选择界面中, 接收第一输入;响应于第一输入,确定目标应用程序对应的耳机;Optionally, the display unit 1406 is configured to display an earphone selection interface; in the earphone selection interface, receive a first input; in response to the first input, determine an earphone corresponding to the target application;
网络模块1402,用于向耳机发送对应目标应用程序的通信识别信息,以使耳机的通信识别信息与对应目标应用程序的通信识别信息相同。The network module 1402 is configured to send the communication identification information corresponding to the target application program to the headset, so that the communication identification information of the headset is the same as the communication identification information corresponding to the target application program.
实际应用中,电子设备在确定目标应用程序的数量不少于两个的情况下,显示耳机选择界面,用户可以通过耳机选择界面手动选择目标应用程序对应的耳机,可以方便用户为佩戴的耳机选择对应的目标应用程序。In practical applications, when the number of target application programs is determined to be not less than two, the electronic device displays the earphone selection interface, and the user can manually select the earphone corresponding to the target application program through the earphone selection interface, which can facilitate the user to choose the earphone for wearing. corresponding target application.
可选地,网络模块1402,用于向耳机发送目标应用程序的目标信息,以使耳机输出与目标应用程序对应的指示信息,并在接收到对应指示信息的用户操作的情况下,使耳机的通信识别信息与指示信息所属目标应用程序的通信识别信息相同。Optionally, the network module 1402 is configured to send the target information of the target application to the earphone, so that the earphone outputs indication information corresponding to the target application program, and when a user operation corresponding to the indication information is received, the earphone's The communication identification information is the same as the communication identification information indicating the target application to which the information belongs.
实际应用中,耳机输出与目标应用程序对应的指示信息,指示用户操作耳机设置耳机的通信识别信息,以确定耳机对应的目标应用程序,可以方便使用耳机的用户根据需求选择耳机对应的目标应用程序。In practical applications, the headset outputs instruction information corresponding to the target application program, instructing the user to operate the headset to set the communication identification information of the headset to determine the target application program corresponding to the headset, which can facilitate the user using the headset to select the target application program corresponding to the headset according to needs .
可选地,网络模块1402,用于在接收到耳机发送的通信数据的情况下,向与通信数据中的通信识别信息所属的目标应用程序传递通信数据;Optionally, the network module 1402 is configured to transfer the communication data to the target application program to which the communication identification information in the communication data belongs when the communication data sent by the earphone is received;
在目标应用程序发出的通信数据中添加目标应用程序的通信识别信息,并向耳机发送添加通信识别信息后的通信数据,以使耳机根据通信数据中的通信识别信息,处理通信数据。Add the communication identification information of the target application program to the communication data sent by the target application program, and send the communication data with the communication identification information added to the earphone, so that the earphone processes the communication data according to the communication identification information in the communication data.
实际应用中,电子设备在控制目标应用程序与对应的耳机通信时,根据通信数据中的通信识别信息确定耳机与目标应用程序之间的对应关系,可以准确的控制目标应用程序与对应的耳机进行通信。In practical applications, when the electronic device controls the communication between the target application program and the corresponding earphone, it determines the corresponding relationship between the earphone and the target application program according to the communication identification information in the communication data, and can accurately control the communication between the target application program and the corresponding earphone. communication.
可选地,处理器1410,还用于在耳机发送的通信数据中包括控制指令的情况下,若与耳机具有相同通信识别信息的目标应用程序的优先级低于其他目标应用程序的优先级,则确定控制指令为无效指令。Optionally, the processor 1410 is further configured to, in the case that the communication data sent by the earphone includes a control instruction, if the priority of the target application having the same communication identification information as the earphone is lower than the priority of other target applications, Then it is determined that the control instruction is an invalid instruction.
实际应用中,电子设备可以根据目标应用程序的优先级,将优先级较低的目标应用程序接收到的控制指令设置为无效指令,可以避免多个耳机同时控制电子设备,影响用户对电子设备的正常使用。In practical applications, the electronic device can set the control commands received by the target application program with lower priority as invalid commands according to the priority of the target application program, which can prevent multiple earphones from simultaneously controlling the electronic device and affecting the user's understanding of the electronic device. Normal use.
应理解的是,本申请实施例中,输入单元1404可以包括图形处理器(Graphics Processing Unit,GPU)14041和麦克风14042,图形处理器14041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1406可包括显示面板14061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板14061。用户 输入单元1407包括触控面板14071以及其他输入设备14072。触控面板14071,也称为触摸屏。触控面板14071可包括触摸检测装置和触摸控制器两个部分。其他输入设备14072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器1409可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器1410可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1410中。It should be understood that, in the embodiment of the present application, the input unit 1404 may include a graphics processor (Graphics Processing Unit, GPU) 14041 and a microphone 14042, and the graphics processor 14041 is used for the image capture device ( Such as the image data of the still picture or video obtained by the camera) for processing. The display unit 1406 may include a display panel 14061, and the display panel 14061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1407 includes a touch panel 14071 and other input devices 14072 . Touch panel 14071, also called touch screen. The touch panel 14071 may include two parts, a touch detection device and a touch controller. Other input devices 14072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here. Memory 1409 can be used to store software programs as well as various data, including but not limited to application programs and operating systems. The processor 1410 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, and the modem processor mainly processes wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 1410 .
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述通信控制方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a readable storage medium. The readable storage medium stores programs or instructions. When the program or instructions are executed by the processor, the various processes of the above-mentioned communication control method embodiments can be achieved, and the same To avoid repetition, the technical effects will not be repeated here.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer readable storage medium, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
本申请实施例还提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述通信控制方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above communication control method embodiment Each process can achieve the same technical effect, so in order to avoid repetition, it will not be repeated here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示 例中被组合。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present application can be embodied in the form of computer software products, which are stored in a storage medium (such as ROM/RAM, magnetic disk, etc.) , optical disc), including several instructions to enable a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
可以理解的是,本公开实施例描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,模块、单元、子单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本公开所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本公开实施例所述功能的模块(例如过程、函数等)来实现本公开实施例所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。It should be understood that the embodiments described in the embodiments of the present disclosure may be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, modules, units, and subunits can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processor, DSP), digital signal processing equipment (DSP Device, DSPD ), programmable logic device (Programmable Logic Device, PLD), field-programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, used to implement the disclosure other electronic units or combinations thereof. For software implementation, the technologies described in the embodiments of the present disclosure may be implemented through modules (such as procedures, functions, etc.) that execute the functions described in the embodiments of the present disclosure. Software codes can be stored in memory and executed by a processor. Memory can be implemented within the processor or external to the processor.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from the purpose of this application and the scope of protection of the claims, many forms can also be made, all of which belong to the protection of this application.

Claims (17)

  1. 一种通信控制方法,应用于与耳机无线连接的电子设备,所述方法包括:A communication control method applied to an electronic device wirelessly connected to an earphone, the method comprising:
    从运行的多个应用程序中确定具有耳机通信需求的目标应用程序;Determining a target application with headset communication needs from among multiple running applications;
    在所述目标应用程序的数量不少于2个的情况下,分别为所述目标应用程序设置不同的通信识别信息;When the number of the target application programs is not less than two, setting different communication identification information for the target application programs respectively;
    控制所述目标应用程序与具有相同通信识别信息的耳机进行通信。The target application program is controlled to communicate with the headset having the same communication identification information.
  2. 根据权利要求1所述的方法,其中,在所述控制所述目标应用程序与具有相同通信识别信息的耳机进行通信之前,还包括:The method according to claim 1, wherein before said controlling said target application program to communicate with a headset having the same communication identification information, further comprising:
    显示耳机选择界面;Display the headset selection interface;
    在所述耳机选择界面中,接收第一输入;In the earphone selection interface, receiving a first input;
    响应于所述第一输入,确定所述目标应用程序对应的所述耳机;determining the headset corresponding to the target application in response to the first input;
    向所述耳机发送对应目标应用程序的通信识别信息,以使所述耳机的通信识别信息与对应目标应用程序的通信识别信息相同。Sending the communication identification information corresponding to the target application program to the earphone, so that the communication identification information of the earphone is the same as the communication identification information corresponding to the target application program.
  3. 根据权利要求1所述的方法,其中,在所述从运行的多个应用程序中确定具有耳机通信需求的目标应用程序之后,还包括:The method according to claim 1, wherein, after determining the target application program with headset communication requirements from the running multiple application programs, further comprising:
    向所述耳机发送所述目标应用程序的目标信息,以使所述耳机输出与所述目标应用程序对应的指示信息,并在接收到对应所述指示信息的用户操作的情况下,使所述耳机的通信识别信息与所述指示信息所属目标应用程序的通信识别信息相同。sending the target information of the target application to the earphone, so that the earphone outputs indication information corresponding to the target application, and upon receiving a user operation corresponding to the indication information, causes the The communication identification information of the headset is the same as the communication identification information of the target application program to which the indication information belongs.
  4. 根据权利要求1-3中任一项所述的方法,其中,所述控制所述目标应用程序与具有相同通信识别信息的耳机进行通信,包括:The method according to any one of claims 1-3, wherein the controlling the target application program to communicate with the headset having the same communication identification information comprises:
    在接收到所述耳机发送的通信数据的情况下,向与所述通信数据中的通信识别信息所属的所述目标应用程序传递所述通信数据;In the case of receiving the communication data sent by the earphone, transfer the communication data to the target application program to which the communication identification information in the communication data belongs;
    在所述目标应用程序发出的通信数据中添加所述目标应用程序的通信识别信息,并向所述耳机发送添加通信识别信息后的通信数据,以使所述耳 机根据所述通信数据中的通信识别信息,处理所述通信数据。Add the communication identification information of the target application program to the communication data sent by the target application program, and send the communication data with the communication identification information added to the headset, so that the headset can identifying information, processing said communication data.
  5. 根据权利要求4所述的方法,其中,还包括:The method according to claim 4, further comprising:
    在所述耳机发送的通信数据中包括控制指令的情况下,若与所述耳机具有相同通信识别信息的目标应用程序的优先级低于其他目标应用程序的优先级,则确定所述控制指令为无效指令。In the case that the communication data sent by the earphone includes a control instruction, if the priority of the target application program having the same communication identification information as the earphone is lower than the priority of other target application programs, then determine that the control instruction is Invalid command.
  6. 一种通信控制方法,,包括:A communication control method, comprising:
    确定耳机的通信识别信息;所述耳机与电子设备无线连接,所述电子设备用于在确定运行的多个应用程序中具有耳机通信需求的目标应用程序不少于2个的情况下,分别为所述目标应用程序设置不同的通信识别信息;Determine the communication identification information of the earphone; the earphone is wirelessly connected to the electronic device, and the electronic device is used to determine that there are no less than two target application programs that have earphone communication requirements among the multiple running application programs, respectively The target application program sets different communication identification information;
    控制所述耳机与具有相同通信识别信息的所述目标应用程序进行通信。controlling the headset to communicate with the target application program having the same communication identification information.
  7. 根据权利要求6所述的方法,其中,在所述确定耳机的通信识别信息之前,还包括:The method according to claim 6, wherein, before determining the communication identification information of the headset, further comprising:
    接收所述电子设备发送的所述目标应用程序的目标信息;receiving target information of the target application sent by the electronic device;
    所述确定耳机的通信识别信息,包括:The determination of the communication identification information of the headset includes:
    基于所述目标信息,设置所述耳机的通信识别信息与至少一个所述目标应用程序的通信识别信息相同。Based on the target information, the communication identification information of the headset is set to be the same as the communication identification information of at least one target application program.
  8. 一种电子设备,包括:An electronic device comprising:
    第一确定模块,用于从运行的多个应用程序中确定具有耳机通信需求的目标应用程序;A first determining module, configured to determine a target application program with headset communication requirements from multiple running application programs;
    设置模块,用于在所述目标应用程序的数量不少于2个的情况下,分别为所述目标应用程序设置不同的通信识别信息;A setting module, configured to set different communication identification information for the target application programs respectively when the number of the target application programs is not less than 2;
    通信模块,用于控制所述目标应用程序与具有相同通信识别信息的耳机进行通信。The communication module is used to control the target application program to communicate with the headset having the same communication identification information.
  9. 根据权利要求8所述的电子设备,其中,还包括:The electronic device according to claim 8, further comprising:
    显示模块,用于显示耳机选择界面;A display module, configured to display an earphone selection interface;
    接收模块,用于在所述耳机选择界面中,接收第一输入;A receiving module, configured to receive a first input in the earphone selection interface;
    第二确定模块,用于响应于所述第一输入,确定所述目标应用程序对应 的所述耳机;A second determining module, configured to determine the earphone corresponding to the target application program in response to the first input;
    第一发送模块,用于向所述耳机发送对应目标应用程序的通信识别信息,以使所述耳机的通信识别信息与对应目标应用程序的通信识别信息相同。The first sending module is configured to send the communication identification information corresponding to the target application program to the earphone, so that the communication identification information of the earphone is the same as the communication identification information corresponding to the target application program.
  10. 根据权利要求8所述的电子设备,其中,还包括:The electronic device according to claim 8, further comprising:
    第二发送模块,用于向所述耳机发送所述目标应用程序的目标信息,以使所述耳机输出与所述目标应用程序对应的指示信息,并在接收到对应所述指示信息的用户操作的情况下,使所述耳机的通信识别信息与所述指示信息所属目标应用程序的通信识别信息相同。The second sending module is configured to send the target information of the target application to the earphone, so that the earphone outputs indication information corresponding to the target application, and upon receiving a user operation corresponding to the indication information In the case of , make the communication identification information of the earphone the same as the communication identification information of the target application program to which the indication information belongs.
  11. 根据权利要求8-10任一项所述的电子设备,其中,所述通信模块,具体用于在接收到所述耳机发送的通信数据的情况下,向与所述通信数据中的通信识别信息所属的所述目标应用程序传递所述通信数据;在所述目标应用程序发出的通信数据中添加所述目标应用程序的通信识别信息,并向所述耳机发送添加通信识别信息后的通信数据,以使所述耳机根据所述通信数据中的通信识别信息,处理所述通信数据。The electronic device according to any one of claims 8-10, wherein the communication module is specifically configured to, when receiving the communication data sent by the earphone, send the communication identification information to the communication data in the communication data The target application program to which it belongs transmits the communication data; adding the communication identification information of the target application program to the communication data sent by the target application program, and sending the communication data with the communication identification information added to the earphone, The earphone is configured to process the communication data according to the communication identification information in the communication data.
  12. 根据权利要求11所述的电子设备,其中,所述通信模块,还用于在所述耳机发送的通信数据中包括控制指令的情况下,若与所述耳机具有相同通信识别信息的目标应用程序的优先级低于其他目标应用程序的优先级,则确定所述控制指令为无效指令。The electronic device according to claim 11, wherein the communication module is further configured to, if the communication data sent by the earphone includes a control instruction, if the target application program having the same communication identification information as the earphone is lower than the priorities of other target application programs, then it is determined that the control instruction is an invalid instruction.
  13. 一种耳机,包括:A headset comprising:
    确定模块,用于确定所述耳机的通信识别信息;所述耳机与电子设备无线连接,所述电子设备用于在确定运行的多个应用程序中具有耳机通信需求的目标应用程序不少于2个的情况下,分别为所述目标应用程序设置不同的通信识别信息;A determining module, configured to determine the communication identification information of the earphone; the earphone is wirelessly connected to the electronic device, and the electronic device is used to determine that there are no less than 2 target applications that require earphone communication among the multiple application programs that are running In the case of each, set different communication identification information for the target application programs respectively;
    通信模块,用于控制所述耳机与具有相同通信识别信息的所述目标应用程序进行通信。A communication module, configured to control the headset to communicate with the target application program having the same communication identification information.
  14. 根据权利要求13所述的耳机,其中,还包括:接收模块,用于接收 所述电子设备发送的所述目标应用程序的目标信息;The earphone according to claim 13, further comprising: a receiving module, configured to receive the target information of the target application program sent by the electronic device;
    所述确定模块,具体用于基于所述目标信息,设置所述耳机的通信识别信息与至少一个所述目标应用程序的通信识别信息相同。The determining module is specifically configured to set the communication identification information of the earphone to be the same as the communication identification information of at least one target application program based on the target information.
  15. 一种电子设备,所述电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-7中任一项所述方法。An electronic device, the electronic device includes a processor, a memory, and a program or instruction stored on the memory and operable on the processor, when the program or instruction is executed by the processor, the The method described in any one of Claims 1-7.
  16. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-7中任一项所述方法。A readable storage medium storing programs or instructions on the readable storage medium, and implementing the method according to any one of claims 1-7 when the programs or instructions are executed by a processor.
  17. 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1-7中任一项所述方法。A chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the method according to any one of claims 1-7.
PCT/CN2022/090912 2021-05-08 2022-05-05 Communication control method, electronic device and earphones WO2022237609A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110504454.2A CN113271376B (en) 2021-05-08 2021-05-08 Communication control method, electronic equipment and earphone
CN202110504454.2 2021-05-08

Publications (1)

Publication Number Publication Date
WO2022237609A1 true WO2022237609A1 (en) 2022-11-17

Family

ID=77230236

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/090912 WO2022237609A1 (en) 2021-05-08 2022-05-05 Communication control method, electronic device and earphones

Country Status (2)

Country Link
CN (1) CN113271376B (en)
WO (1) WO2022237609A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116761156A (en) * 2023-08-23 2023-09-15 腾讯科技(深圳)有限公司 Audio processing method, device, storage medium and electronic equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113271376B (en) * 2021-05-08 2023-08-22 维沃移动通信有限公司 Communication control method, electronic equipment and earphone

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108769431A (en) * 2018-07-03 2018-11-06 Oppo(重庆)智能科技有限公司 Audio play control method, device, storage medium and mobile terminal
CN109445740A (en) * 2018-09-30 2019-03-08 Oppo广东移动通信有限公司 Audio frequency playing method, device, electronic equipment and storage medium
CN110381485A (en) * 2019-06-14 2019-10-25 华为技术有限公司 Bluetooth communication method, TWS bluetooth headset and terminal
US20200092651A1 (en) * 2018-05-10 2020-03-19 Microchip Technology Incorporated Data packet compensation in multi-device media systems
CN111459456A (en) * 2020-04-07 2020-07-28 维沃移动通信有限公司 Audio control method and electronic equipment
CN113271376A (en) * 2021-05-08 2021-08-17 维沃移动通信有限公司 Communication control method, electronic equipment and earphone

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180124180A (en) * 2017-05-10 2018-11-21 주식회사 비즈모델라인 Method for Providing Transaction by using Bluetooth Ear Set
CN109194827B (en) * 2018-08-28 2021-02-23 维沃移动通信有限公司 Terminal device, audio signal output method and system
CN111884908B (en) * 2020-06-23 2022-09-02 维沃移动通信有限公司 Contact person identification display method and device and electronic equipment
CN112351507B (en) * 2020-10-30 2023-04-14 维沃移动通信有限公司 Interaction control method, interaction control device, electronic equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200092651A1 (en) * 2018-05-10 2020-03-19 Microchip Technology Incorporated Data packet compensation in multi-device media systems
CN108769431A (en) * 2018-07-03 2018-11-06 Oppo(重庆)智能科技有限公司 Audio play control method, device, storage medium and mobile terminal
CN109445740A (en) * 2018-09-30 2019-03-08 Oppo广东移动通信有限公司 Audio frequency playing method, device, electronic equipment and storage medium
CN110381485A (en) * 2019-06-14 2019-10-25 华为技术有限公司 Bluetooth communication method, TWS bluetooth headset and terminal
CN111459456A (en) * 2020-04-07 2020-07-28 维沃移动通信有限公司 Audio control method and electronic equipment
CN113271376A (en) * 2021-05-08 2021-08-17 维沃移动通信有限公司 Communication control method, electronic equipment and earphone

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116761156A (en) * 2023-08-23 2023-09-15 腾讯科技(深圳)有限公司 Audio processing method, device, storage medium and electronic equipment
CN116761156B (en) * 2023-08-23 2023-11-14 腾讯科技(深圳)有限公司 Audio processing method, device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN113271376A (en) 2021-08-17
CN113271376B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
US11604572B2 (en) Multi-screen interaction method and apparatus, and storage medium
WO2019090726A1 (en) Method for selecting bluetooth device, terminal, and system
WO2020133614A1 (en) Wireless communication method, terminal, audio component, apparatus, and storage medium
WO2022237609A1 (en) Communication control method, electronic device and earphones
CN107690796B (en) Call management between multiple user devices
US9077796B2 (en) System containing a mobile communication device and associated docking station
WO2016184302A1 (en) Message forwarding method and electronic device
US20180139252A1 (en) Network call method and apparatus, terminal, and server
WO2021104271A1 (en) Control method, stylus, and electronic assembly
WO2021104230A1 (en) Synchronization method and electronic device
WO2019196691A1 (en) Keyboard interface display method and mobile terminal
WO2022156662A1 (en) Method and apparatus for switching audio playing mode, and electronic device and storage medium
EP4318199A1 (en) Method for interaction between electronic devices and electronic device
WO2021129529A1 (en) Device switching method and related device
CN115190197B (en) Bluetooth headset-based communication method and device and storage medium
WO2021022720A1 (en) Bluetooth-based data transmission method, storage medium and terminal
WO2020007300A1 (en) Incoming call processing method and device, readable storage medium, and mobile terminal
US20200382646A1 (en) Enhanced controls for a computer based on states communicated with a peripheral device
CN111654450A (en) Data transmission method and device and storage medium
WO2022206651A1 (en) Instant communication method and apparatus, electronic device, and storage medium
WO2020015534A1 (en) Mobile terminal, and method and device for realizing instant communication with fixed terminal
WO2022057552A1 (en) Device control system
WO2015078349A1 (en) Microphone sound-reception status switching method and apparatus
WO2023241455A1 (en) Group chat operation processing method and apparatus, electronic device, and storage medium
WO2021134866A1 (en) Call switching method and apparatus, storage medium and mobile terminal

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22806577

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE