WO2025039655A1 - 设备连接方法、装置、电子设备及计算机存储介质 - Google Patents

设备连接方法、装置、电子设备及计算机存储介质 Download PDF

Info

Publication number
WO2025039655A1
WO2025039655A1 PCT/CN2024/096109 CN2024096109W WO2025039655A1 WO 2025039655 A1 WO2025039655 A1 WO 2025039655A1 CN 2024096109 W CN2024096109 W CN 2024096109W WO 2025039655 A1 WO2025039655 A1 WO 2025039655A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
target
audio
connection
callback function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/096109
Other languages
English (en)
French (fr)
Inventor
刘震鑫
曾庆忠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Publication of WO2025039655A1 publication Critical patent/WO2025039655A1/zh
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/4363Adapting the video stream to a specific local network, e.g. a Bluetooth® network
    • H04N21/43637Adapting the video stream to a specific local network, e.g. a Bluetooth® network involving a wireless protocol, e.g. Bluetooth®, RF or wireless LAN [IEEE 802.11]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8166Monomedia components thereof involving executable data, e.g. software
    • H04N21/8186Monomedia components thereof involving executable data, e.g. software specially adapted to be executed by a peripheral of the client device, e.g. by a reprogrammable remote control

Definitions

  • the present application relates to the technical field of Bluetooth connection, and in particular to a device connection method, apparatus, electronic device and computer storage medium.
  • a speaker and a TV can establish a Bluetooth connection, and the TV can send audio to the speaker for playback through the Bluetooth connection.
  • a mobile phone and a TV can establish a Bluetooth connection, and the mobile phone can send audio and video to the TV for playback through the Bluetooth connection.
  • the speaker can control the playback, pause, etc. of the audio in the TV according to the audio and video remote control protocol (Audio Video Remote Control Profile, Avrcp) in Bluetooth.
  • the speaker acts as the control device (Controller, CT) in the audio and video remote control protocol
  • the TV acts as the controlled device (Target, TG) in the audio and video remote control protocol.
  • the TV can control the playback, pause, etc. of the audio and video in the mobile phone according to the audio and video remote control protocol (Audio Video Remote Control Profile, Avrcp) in Bluetooth.
  • the TV acts as the control device (Controller, CT) in the audio and video remote control protocol
  • the mobile phone acts as the controlled device (Target, TG) in the audio and video remote control protocol.
  • the TV can only be used as a controlled device in the audio and video remote control protocol, and cannot be used as a controlling device.
  • the TV establishes a Bluetooth connection with a mobile phone, the TV cannot control operations such as playing or pausing the audio and video in the mobile phone.
  • the embodiments of the present application provide a device connection method, apparatus, electronic device and computer storage medium, which can solve the technical problem that a television cannot be used as a control device in an audio and video remote control protocol.
  • the present application provides a device connection method, which is applied to an electronic device, wherein the electronic device supports a controlled service and a control service, and the method includes:
  • a connection of the audio and video remote control protocol is established with the target device.
  • an embodiment of the present application provides a device connection apparatus, which is applied to an electronic device, wherein the electronic device supports a controlled service and a control service, and the apparatus includes:
  • An instruction acquisition module is used to acquire a Bluetooth initialization instruction, and register the callback function of the controlled service and the callback function of the control service with the audio and video remote control protocol according to the Bluetooth initialization instruction;
  • a request acquisition module used to acquire a control connection request sent by a target device for an audio and video remote control protocol, and acquire a first target service supported by the target device according to the control connection request;
  • a service screening module used to screen out a service matching the first target service from the controlled service and the control service, and obtain a second target service for the control connection request;
  • connection establishment module is used to establish a connection of the audio and video remote control protocol with the target device according to the callback function after the second target service is registered.
  • an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the device connection method provided in the embodiment of the present application.
  • an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program.
  • the computer program is suitable for loading by a processor to execute any device connection method provided in the embodiment of the present application.
  • an embodiment of the present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, any device connection method provided in the embodiment of the present application is implemented.
  • a Bluetooth initialization instruction is obtained, and according to the Bluetooth initialization instruction, the callback function of the controlled service and the callback function of the control service are registered with the audio and video remote control protocol; a control connection request sent by the target device according to the audio and video remote control protocol is obtained, and according to the control connection request, a first target service supported by the target device is obtained; a service matching the first target service is selected from the controlled service and the control service, and a second target service for the control connection request is obtained; according to the callback function after the second target service is registered, an audio and video remote control protocol is established with the target device.
  • the control service and the control service are connected to each other to realize the coexistence of the controlled service and the control service in the electronic device, and then decide whether to establish a connection of the audio and video remote control protocol with the target device according to the callback function of the controlled service or to establish a connection of the audio and video remote control protocol with the target device according to the callback function of the control service according to the first target service supported by the target device, so that the electronic device can be used as both a controlled device and a control device in the audio and video remote control protocol, thereby improving the utilization rate of the electronic device.
  • FIG1 is a schematic diagram of a flow chart of a device connection method provided in an embodiment of the present application.
  • FIG2 is a schematic diagram of a first identifier and a second identifier provided in an embodiment of the present application
  • FIG3 is a schematic diagram of a process of Bluetooth initialization provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of another device connection process provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of another device connection process provided in an embodiment of the present application.
  • FIG6 is a schematic diagram of the structure of a device connection device provided in an embodiment of the present application.
  • FIG. 7 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • the embodiment of the present application provides a device connection method, device, electronic device and computer storage medium.
  • the device connection device can be integrated in an electronic device, and the electronic device can be a server or a terminal.
  • the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.
  • cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.
  • CDN Network acceleration services
  • the terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, a smart watch, etc., but is not limited thereto.
  • the terminal and the server may be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
  • the term “plurality” in the embodiments of the present application refers to two or more than two.
  • the terms “first” and “second” in the embodiments of the present application are used to distinguish descriptions and should not be understood as implying relative importance.
  • the description will be made from the perspective of the device connection device.
  • the device connection device will be integrated in the terminal for detailed description, that is, the terminal will be taken as an example of an electronic device and the terminal will be used as the execution subject for detailed description.
  • FIG1 is a flow chart of a device connection method provided by an embodiment of the present application.
  • the device connection method is applied to an electronic device, and the electronic device supports a controlled service and a control service.
  • the device connection method may include:
  • the electronic device supports controlled services, which means that the electronic device stores programs that allow the electronic device to act as a controlled device (Television, TG) in the connection of an audio and video remote control protocol.
  • the electronic device supports control services, which means that the electronic device stores programs that allow the electronic device to act as a controlling device (Controller, CT) in the connection of an audio and video remote control protocol.
  • the terminal after obtaining the Bluetooth initialization instruction, performs Bluetooth initialization according to the Bluetooth initialization instruction.
  • the controlled service and the control service are initialized.
  • the callback function of the controlled service and the callback function of the control service are registered for the audio and video remote control protocol.
  • registering the callback function of the controlled service and the callback function of the control service with the audio and video remote control protocol can be understood as registering the callback function of the controlled service and the callback function of the control service to the application layer where the audio and video remote control protocol is located, so that the connection of the audio and video remote control protocol can be established subsequently according to the registered callback function.
  • the process of registering the callback function of the controlled service and the callback function of the control service for the audio and video remote control protocol according to the Bluetooth initialization instruction can be:
  • the callback function of the controlled service and the callback function of the control service are registered with the audio and video remote control protocol, and the first identifier corresponding to the callback function of the control service and the second identifier corresponding to the callback function of the controlled service are obtained.
  • the first identifier may be 1
  • the second identifier may be 2
  • the AvrcpCT service refers to the control service
  • the AvrcpTG service refers to the controlled service.
  • the terminal can obtain the Bluetooth initialization instruction in response to the user's operation, or the terminal can also generate the Bluetooth initialization instruction according to the Bluetooth startup instruction, or the terminal can also receive the Bluetooth initialization instruction sent by other terminals.
  • the way in which the terminal obtains the Bluetooth initialization instruction can be selected according to actual conditions, and the embodiments of the present application are not limited here.
  • the terminal can establish a Bluetooth audio transmission model protocol (Advanced Audio Distribution Profile, A2DP) connection with the target device, so that multimedia can be transmitted between the target device and the terminal through the Bluetooth audio transmission model protocol connection.
  • A2DP Advanced Audio Distribution Profile
  • Multimedia is a combination of various media, which may include at least one of text, sound, image and video.
  • the target device can be the source device (Audio Source) and the terminal can be the receiving device (Audio Sink), or the target device can be the receiving device and the terminal can be the source device.
  • the multimedia transmission direction is from the target device to the terminal.
  • the target device acts as a receiving device and the terminal acts as a source device
  • the multimedia transmission direction is from the terminal to the target device.
  • the target device is a speaker and the terminal is a TV
  • the speaker is the receiving device and the TV is the source device
  • the multimedia transmission direction is from the TV to the speaker.
  • the target device is a mobile phone and the terminal is a TV
  • the TV is the receiving device and the mobile phone is the source device
  • the multimedia transmission direction is from the mobile phone to the TV.
  • S102 Obtain a control connection request sent by a target device for an audio and video remote control protocol, and obtain a first target service supported by the target device according to the control connection request.
  • the target device can be used as a controlled device (TG) in the connection of the audio and video remote control protocol.
  • TG controlled device
  • CT control device
  • the method for obtaining the first target service supported by the target device can be selected according to actual conditions, and the embodiment of the present application does not limit this.
  • the electronic device establishes a connection with the first target device using an audio and video remote control protocol; and according to the control connection request, obtains a first target service supported by the target device, including:
  • the priority of each device can be set to determine which device to establish the audio and video remote control protocol connection with according to the priority of each device.
  • the connection of the audio and video remote control protocol with the target device is not disconnected.
  • a controlled service and a control service coexist in a terminal, and during the Bluetooth initialization process, the callback function of the controlled service and the callback function of the control service are registered for the audio and video remote control protocol, so that even if the role played by the terminal in the connection with the audio and video remote control protocol of the target device and the role played by the terminal in the connection with the audio and video remote control protocol of the first target device are different, there is no need to restart the controlled service or the control service.
  • the role of the terminal is the control device
  • the role of the terminal is the controlled device. Even if the terminal first establishes a connection of the audio and video remote control protocol with the first target device, there is no need to restart the control service when establishing a connection of the audio and video remote control protocol with the target device.
  • S103 Filter out services matching the first target service from the controlled services and the control services, and obtain a second target service for the control connection request.
  • the service matching the first target service refers to a service that is complementary to the first target service.
  • the first target service is the first controlled service
  • the target device is the controlled device
  • the second target service is the control service
  • the terminal is the control device.
  • the first target service is the first control service
  • the target device is the control device
  • the second target service is the controlled service
  • the terminal is the controlled device.
  • the process of filtering out a service matching the first target service from the controlled service and the control service to obtain a second target service for the control connection request is:
  • a service matching the third target service is screened out from the controlled service and the control service to obtain a second target service for the control connection request.
  • the third target service is the first controlled service
  • the second target service is the controlling service.
  • the third target service is the first controlling service
  • the second target service is the controlled service.
  • the target screening strategy can be set according to the actual situation, and the present application embodiment does not limit it here.
  • the process of obtaining the target screening strategy can be:
  • the target screening strategy can be determined according to the transmission direction of the multimedia between the target device and the electronic device.
  • the target screening strategy is to screen out the first controlled service
  • the third target service is the first controlled service
  • the second target service is the control service.
  • the target screening strategy is to screen out the first control service
  • the third target service is the first control service
  • the second target service is the controlled service.
  • the target device is a speaker
  • the terminal is a TV
  • the transmission direction is from the TV to the speaker.
  • the speaker serves as a control device
  • the service used by the speaker is the first control service
  • the target screening strategy is to screen out the first control service.
  • the target device is a mobile phone
  • the terminal is a TV
  • the transmission direction is from the mobile phone to the TV.
  • the mobile phone is the controlled device
  • the service used by the mobile phone is the first controlled service
  • the target screening strategy is to screen out the first controlled service.
  • the process of obtaining the target screening strategy can also be:
  • a target screening strategy may be determined based on the historical target services of the target device.
  • the historical target service is the first controlled service
  • the target device established an audio and video remote control protocol connection with the terminal through the first controlled service at time A in the past. Then the target screening strategy is to screen out the first controlled service.
  • the historical target service is the first control service
  • the target device established an audio and video remote control protocol connection with the terminal through the first control service at time A in the past, then the target screening strategy is to screen out the first control service.
  • the target filtering strategy can be determined based on the historical target service corresponding to the time closest to the current time, or, the target filtering strategy can be determined based on the historical target service that appears the most times, or, the target filtering strategy can be determined based on the historical target service corresponding to the time that matches the current time.
  • the target screening strategy is determined according to the first controlling service.
  • the target screening strategy is determined according to the first controlled service.
  • the target screening strategy is determined based on the first controlled service.
  • S104 Establishing an audio and video remote control protocol connection with the target device according to the callback function after the second target service is registered.
  • the first target service is a controlled service, then according to the callback function registered by the controlled service, a connection of the audio and video remote control protocol is established with the target device; if the first target service is a control service, then according to the callback function registered by the control service, a connection of the audio and video remote control protocol is established with the target device.
  • the process of establishing a connection of the audio and video remote control protocol with the target device can be:
  • the second target service is a control service, establishing a connection of an audio and video remote control protocol with the target device according to the callback function corresponding to the first identifier;
  • the second target service is a controlled service
  • a connection of an audio and video remote control protocol is established with the target device according to the callback function corresponding to the second identifier.
  • the terminal When the terminal establishes an audio and video remote control protocol connection with the target device according to the callback function registered by the controlled service, after the terminal establishes the audio and video remote control protocol connection with the target device, it can receive control instructions of the target device to control the multimedia in the terminal through the audio and video remote control protocol connection with the target device, and then control the multimedia according to the control instructions.
  • the terminal When the terminal establishes an audio and video remote control protocol connection with the target device according to the callback function registered with the control service, the terminal can control the multimedia in the target device through the audio and video remote control protocol connection with the target device.
  • the terminal controls the multimedia in the target device by connecting to the audio and video remote control protocol of the target device.
  • the method can be selected according to actual conditions.
  • the multimedia in the target device can be controlled to pause, play, play the previous song or the next song, etc.
  • the embodiment of the present application is not limited here.
  • a controlled service and a control service coexist in a terminal, and the role of the terminal is determined according to the role of the target device.
  • the role of the target device is a controlled device
  • the role of the terminal is a control device
  • the role of the terminal is a controlled device, so that when the terminal is connected to the audio and video remote control protocol of the target device, there will be no role errors, so that when the terminal acts as a control device and controls the multimedia in the target device through the connection with the audio and video remote control protocol of the target device, there will be no errors in the control of the multimedia, thereby improving the user experience and thus improving the utilization rate of the terminal.
  • a Bluetooth initialization instruction is obtained, and according to the Bluetooth initialization instruction, the callback function of the controlled service and the callback function of the control service are registered with the audio and video remote control protocol; a control connection request sent by the target device according to the audio and video remote control protocol is obtained, and according to the control connection request, the audio and video remote control protocol supported by the target device is obtained.
  • a first target service filtering out services matching the first target service from the controlled service and the control service to obtain a second target service for the control connection request; establishing an audio and video remote control protocol connection with the target device according to the callback function after the second target service is registered, thereby realizing the coexistence of the controlled service and the control service in the electronic device, and then deciding whether to establish an audio and video remote control protocol connection with the target device according to the callback function of the controlled service or to establish an audio and video remote control protocol connection with the target device according to the callback function of the control service according to the first target service supported by the target device, so that the electronic device can be used as both a controlled device and a control device in the audio and video remote control protocol, thereby improving the utilization rate of the electronic device.
  • the terminal obtains a Bluetooth startup instruction, and performs Bluetooth service initialization according to the Bluetooth startup instruction. During the Bluetooth initialization process, the controlled service initialization and the control service initialization are performed.
  • the terminal registers the callback function of the control service with the audio and video remote control protocol to obtain a first identifier corresponding to the callback function of the control service.
  • the terminal registers the callback function of the controlled service with the audio and video remote control protocol to obtain a second identifier corresponding to the callback function of the controlled service.
  • the terminal After the registration of the callback function is completed, the terminal will connect the audio and video remote control protocol.
  • the terminal obtains a control connection request sent by the target device for the audio and video remote control protocol, and obtains a first target service supported by the target device according to the control connection request.
  • the terminal determines the control service as the second target service, and establishes a connection of an audio and video remote control protocol with the target device according to a callback function corresponding to the first identifier.
  • the terminal determines the controlled service as the second target service, and establishes a connection of the audio and video remote control protocol with the target device according to the callback function corresponding to the second identifier.
  • the startup state of the target application is determined. If the startup state of the target application is startup, the control service is determined as the second target service, and a connection of the audio and video remote control protocol is established with the target device according to the callback function corresponding to the first identifier. If the startup state of the target application is shutdown, the page displayed by the terminal at this time can be any interface or the default interface, and the transmission direction of the multimedia can be determined.
  • the terminal determines the control service as the second target service, and establishes an audio and video remote control protocol connection with the target device according to the callback function corresponding to the first identifier. If the transmission direction is from the terminal to the target device, the terminal determines the controlled service as the second target service, and establishes an audio and video remote control protocol connection with the target device according to the callback function corresponding to the second identifier.
  • the embodiment of the present application also provides a device based on the above device connection method, which is applied to an electronic device, and the electronic device supports controlled services and control services.
  • the meanings of the terms are the same as those in the above device connection method, and the specific implementation details can refer to the description in the method embodiment.
  • the device connection device may include:
  • the instruction acquisition module 601 is used to acquire a Bluetooth initialization instruction, and register the callback function of the controlled service and the callback function of the control service with the audio and video remote control protocol according to the Bluetooth initialization instruction.
  • the request acquisition module 602 is used to acquire a control connection request sent by a target device for an audio and video remote control protocol, and acquire a first target service supported by the target device according to the control connection request.
  • the service screening module 603 is used to screen out the service matching the first target service from the controlled service and the control service, and obtain the second target service for the control connection request.
  • the connection establishment module 604 is used to establish a connection of the audio and video remote control protocol with the target device according to the callback function after the second target service is registered.
  • the first target service includes a first controlled service and a first controlling service.
  • the service screening module 603 is specifically used to execute:
  • a service matching the third target service is screened out from the controlled service and the control service to obtain a second target service for the control connection request.
  • the service screening module 603 is specifically configured to execute:
  • the service screening module 603 is specifically configured to execute:
  • the service screening module 603 is specifically configured to execute:
  • the electronic device establishes a connection with the first target device using an audio and video remote control protocol; accordingly, the request acquisition module 602 is specifically configured to execute:
  • the instruction acquisition module 601 is specifically used to execute:
  • the callback function of the controlled service and the callback function of the control service are registered with the audio and video remote control protocol, and the first identifier corresponding to the callback function of the control service and the second identifier corresponding to the callback function of the controlled service are obtained.
  • connection establishing module 604 is specifically configured to execute:
  • the second target service is a control service, establishing a connection of an audio and video remote control protocol with the target device according to the callback function corresponding to the first identifier;
  • the second target service is a controlled service
  • a connection of an audio and video remote control protocol is established with the target device according to the callback function corresponding to the second identifier.
  • the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities.
  • the specific implementation methods and corresponding beneficial effects of the above modules can be found in the previous method embodiments, which will not be repeated here.
  • the embodiment of the present application further provides an electronic device, which may be a server or a terminal, etc.
  • an electronic device which may be a server or a terminal, etc.
  • FIG. 7 it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application. Specifically:
  • the electronic device may further include an input unit 704, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • an input unit 704 which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • the electronic device may further include a display unit, etc., which will not be described in detail herein.
  • the processor 701 in the electronic device will load the executable files corresponding to the processes of one or more computer programs into the memory 702 according to the following instructions, and the processor 701 will run the computer programs stored in the memory 702, thereby realizing various functions, such as:
  • a connection of an audio and video remote control protocol is established with the target device.
  • an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any device connection method provided in the embodiment of the present application.
  • the computer program can execute the following steps:
  • a connection of an audio and video remote control protocol is established with the target device.
  • the computer readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or CD, etc.
  • the computer program stored in the computer-readable storage medium can execute the steps in any device connection method provided in the embodiments of the present application, the beneficial effects that can be achieved by any device connection method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
  • a computer program product or a computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium.
  • a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned device connection method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Selective Calling Equipment (AREA)

Abstract

本申请实施例公开了一种设备连接方法、装置、电子设备及计算机存储介质;在本申请实施例中,获取蓝牙初始化指令,根据蓝牙初始化指令,将所述被控服务的回调函数和所述控制服务的回调函数进行音视频远程控制协议注册;获取目标设备针对音视频远程控制协议发送的控制连接请求,并根据所述控制连接请求,获取所述目标设备支持的第一目标服务;从所述被控服务和所述控制服务中筛选出与所述第一目标服务匹配的服务,得到针对所述控制连接请求的第二目标服务;根据所述第二目标服务注册后的回调函数,与所述目标设备建立所述音视频远程控制协议的连接。本申请实施例在音视频远程控制协议中电子设备可以作为控制设备,也可以作为被控设备。

Description

设备连接方法、装置、电子设备及计算机存储介质
本申请要求于2023年08月23日提交中国专利局、申请号为202311069946.9、申请名称为“设备连接方法、装置、电子设备及计算机存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及蓝牙连接技术领域,具体涉及一种设备连接方法、装置、电子设备及计算机存储介质。
背景技术
随着科学技术的发展,蓝牙技术的应用越来越广泛。比如,音箱和电视可以建立蓝牙连接,电视通过蓝牙连接,将音频发送至音箱进行播放。又比如,手机和电视可以建立蓝牙连接,手机可以通过蓝牙连接,将音视频发送至电视进行播放。
在音箱和电视建立蓝牙连接之后,音箱可以根据蓝牙中的音视频远程控制协议(Audio Video Remote Control Profile,Avrcp)控制电视中音频的播放、暂停等,此时,音箱作为音视频远程控制协议中的控制设备(Controller,CT),电视作为音视频远程控制协议中的被控设备(Target,TG),在手机和电视建立蓝牙连接之后,电视可以根据蓝牙中的音视频远程控制协议(Audio Video Remote Control Profile,Avrcp)控制手机中音视频的播放、暂停等,此时,电视作为音视频远程控制协议中的控制设备(Controller,CT),手机作为音视频远程控制协议中的被控设备(Target,TG)。
目前,电视在音视频远程控制协议中只支持作为被控设备,无法作为控制设备,当电视与手机建立蓝牙连接时,会导致电视无法控制手机中音视频的播放或暂停等操作。
技术解决方案
本申请实施例提供一种设备连接方法、装置、电子设备及计算机存储介质,可以解决在音视频远程控制协议中电视无法作为控制设备的技术问题。
本申请实施例提供一种设备连接方法,应用于电子设备,上述电子设备支持被控服务和控制服务,上述方法包括:
获取蓝牙初始化指令,根据蓝牙初始化指令,将上述被控服务的回调函数和上述控制服务的回调函数进行音视频远程控制协议注册;
获取目标设备根据音视频远程控制协议发送的控制连接请求,并根据上述控制连接请求,获取上述目标设备支持的第一目标服务;
从上述被控服务和上述控制服务中筛选出与上述第一目标服务匹配的服务,得到针对上述控制连接请求的第二目标服务;
根据上述第二目标服务注册后的回调函数,与上述目标设备建立上述音视频远程控制协议的连接。
相应地,本申请实施例提供一种设备连接装置,应用于电子设备,上述电子设备支持被控服务和控制服务,上述装置包括:
指令获取模块,用于获取蓝牙初始化指令,根据蓝牙初始化指令,将上述被控服务的回调函数和上述控制服务的回调函数进行音视频远程控制协议注册;
请求获取模块,用于获取目标设备针对音视频远程控制协议发送的控制连接请求,并根据上述控制连接请求,获取上述目标设备支持的第一目标服务;
服务筛选模块,用于从上述被控服务和上述控制服务中筛选出与上述第一目标服务匹配的服务,得到针对上述控制连接请求的第二目标服务;
连接建立模块,用于根据上述第二目标服务注册后的回调函数,与上述目标设备建立上述音视频远程控制协议的连接。
此外,本申请实施例还提供一种电子设备,包括处理器和存储器,上述存储器存储有计算机程序,上述处理器用于运行上述存储器内的计算机程序实现本申请实施例提供的设备连接方法。
此外,本申请实施例还提供一种计算机可读存储介质,上述计算机可读存储介质存储有计算机程序,上述计算机程序适于处理器进行加载,以执行本申请实施例所提供的任一种设备连接方法。
此外,本申请实施例还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现本申请实施例所提供的任一种设备连接方法。
在本申请实施例中,获取蓝牙初始化指令,根据蓝牙初始化指令,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册;获取目标设备根据音视频远程控制协议发送的控制连接请求,并根据控制连接请求,获取目标设备支持的第一目标服务;从被控服务和控制服务中筛选出与第一目标服务匹配的服务,得到针对控制连接请求的第二目标服务;根据第二目标服务注册后的回调函数,与目标设备建立音视频远程控制协议 的连接,实现在电子设备中共存被控服务和控制服务,然后根据目标设备支持的第一目标服务决定是根据被控服务的回调函数与目标设备建立音视频远程控制协议的连接还是根据控制服务的回调函数与目标设备建立音视频远程控制协议的连接,使得电子设备在音视频远程控制协议中既可以作为被控设备,也可以作为控制设备,提高电子设备的使用率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的设备连接方法的流程示意图;
图2是本申请实施例提供的第一标识和第二标识的示意图;
图3是本申请实施例提供的蓝牙初始化的流程示意图;
图4是本申请实施例提供的另一种设备连接的流程示意图;
图5是本申请实施例提供的另一种设备连接的流程示意图;
图6是本申请实施例提供的设备连接装置的结构示意图;
图7是本申请实施例提供的电子设备的结构示意图。
本申请的实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请实施例提供一种设备连接方法、装置、电子设备及计算机存储介质。该设备连接装置可以集成在电子设备中,该电子设备可以是服务器,也可以是终端等设备。
其中,服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、网络加速服务(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。
终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能电视、智能手表等,但并不局限于此。终端以及服务器可以通过有线或无线通信方式进行直接或间接地连接,本申请在此不做限制。
另外,本申请实施例中的“多个”指两个或两个以上。本申请实施例中的“第一”和“第二”等用于区分描述,而不能理解为暗示相对重要性。
以下分别进行详细说明。需要说明的是,以下实施例的描述顺序不作为对实施例优选顺序的限定。
在本实施例中,将从设备连接装置的角度进行描述,为了方便对本申请的设备连接方法进行说明,以下将以设备连接装置集成在终端中进行详细说明,即以终端为电子设备为例子,以终端作为执行主体进行详细说明。
请参阅图1,图1是本申请一实施例提供的设备连接方法的流程示意图。该设备连接方法应用于电子设备,电子设备支持被控服务和控制服务,该设备连接方法可以包括:
S101、获取蓝牙初始化指令,根据蓝牙初始化指令,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册。
电子设备支持被控服务,指电子设备中存储电子设备在音视频远程控制协议的连接中,可以作为被控设备(Television,TG)的程序,电子设备支持控制服务,指电子设备中存储电子设备在音视频远程控制协议的连接中可以作为控制设备(Controller,CT)的程序。
在本申请实施例中,终端在获取到蓝牙初始化指令之后,根据蓝牙初始化指令,进行蓝牙初始化,在蓝牙初始化的过程中,对被控服务和控制服务进行初始化,在对被控服务和控制服务进行初始化的过程中,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册。
其中,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册,可以理解为向音视频远程控制协议所在的应用层注册被控服务的回调函数和控制服务的回调函数,以便后续可以根据注册后的回调函数建立音视频远程控制协议的连接。
可选地,为了在建立音视频远程控制协议的连接时,方便调用注册后的回调函数,根据蓝牙初始化指令,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册的过程可以为:
根据蓝牙初始化指令,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册,得到控制服务的回调函数对应的第一标识,以及得到被控服务的回调函数对应的第二标识。
比如,如图2所示,第一标识可以为1,第二标识可以为2,AvrcpCT服务指控制服务,AvrcpTG服务指被控服务。
可选地,终端可以响应于用户的操作,获取到蓝牙初始化指令,或者,终端也可以根据蓝牙的启动指令,生成蓝牙初始化指令,或者,终端也可以接收其他终端发送的蓝牙初始化指令。对于终端获取蓝牙初始化指令的方式,可以根据实际情况进行选择,本申请实施例在此不做限定。
可选地,终端在蓝牙初始化完成之后,可以与目标设备建立蓝牙音频传输模型协议的(Advanced Audio Distribution Profile,A2DP)连接,以便可以在目标设备和终端之间,可以通过蓝牙音频传输模型协议的连接,传输多媒体。
多媒体是多种媒体的综合,其可以包括文本、声音、图像以及视频中的至少一种。
在终端与目标设备建立蓝牙音频传输模型协议的连接时,可以是目标设备作为源设备(Audio Source),终端作为接收设备(Audio Sink),也可以是目标设备作为接收设备,终端作为源设备。
当目标设备作为源设备,终端作为接收设备时,多媒体的传输方向为从目标设备到终端,当目标设备作为接收设备,终端作为源设备时,多媒体的传输方向为从终端到目标设备。
比如,当目标设备为音箱,终端为电视时,音箱为接收设备,电视为源设备,多媒体的传输方向为从电视到音箱。又比如,当目标设备为手机,终端为电视时,电视为接收设备,手机为源设备,多媒体的传输方向为从手机到电视。
S102、获取目标设备针对音视频远程控制协议发送的控制连接请求,并根据控制连接请求,获取目标设备支持的第一目标服务。
目标设备针对音视频远程控制协议发送的控制连接请求,指用于建立音视频远程控制协议的连接的控制连接请求。
终端在获取到控制连接请求之后,获取目标设备支持的第一目标服务。第一目标服务包括第一被控服务和第一控制服务中的至少一种。
当第一目标服务包括第一被控服务时,表示目标设备在音视频远程控制协议的连接中,可以作为被控设备(TG),当第一目标服务包括第一控制服务时,表示目标设备在音视频远程控制协议的连接中,可以作为控制设备(CT)。
可选地,终端可以根据控制连接请求,从目标设备中获取目标设备支持的第一目标服务,或者,终端也可以根据控制连接请求,从服务器中获取目标设备支持的第一目标服务, 又或者,终端也可以根据控制连接请求,从本地存储空间中获取目标设备支持的第一目标服务。
对于获取目标设备支持的第一目标服务的方式,可以根据实际情况进行选择,本申请实施例在此不做限定。
在一些实施例中,电子设备与第一目标设备建立音视频远程控制协议的连接;根据控制连接请求,获取目标设备支持的第一目标服务,包括:
根据控制连接请求,获取目标设备的优先级和第一目标设备的优先级;
若目标设备的优先级高于第一目标设备的优先级,则断开与第一目标设备的音视频远程控制协议的连接;
获取目标设备支持的第一目标服务。
由于终端可以与多个设备建立音视频远程控制协议的连接,因此,可以设置每个设备的优先级,以便根据每个设备的优先级确定与哪个设备建立音视频远程控制协议的连接。
如果目标设备的优先级低于第一目标设备的优先级,则不断开与目标设备的音视频远程控制协议的连接。
在本申请实施例中,在终端中共存被控服务和控制服务,并且在蓝牙初始化的过程,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册,使得即使终端在与目标设备的音视频远程控制协议的连接中作为的角色和在与第一目标设备的音视频远程控制协议的连接中作为的角色不相同,也不需要重新启动被控服务或控制服务。
比如,在与目标设备的音视频远程控制协议的连接中,终端的角色为控制设备,在与第一目标设备的音视频远程控制协议的连接中,终端的角色为被控设备,则即使终端先与第一目标设备建立音视频远程控制协议的连接,在与目标设备建立音视频远程控制协议的连接时,也无需重新启动控制服务。
S103、从被控服务和控制服务中筛选出与第一目标服务匹配的服务,得到针对控制连接请求的第二目标服务。
与第一目标服务匹配的服务,指与第一目标服务互补的服务。比如,当第一目标服务为第一被控服务时,目标设备作为被控设备,第二目标服务为控制服务,终端作为控制设备。又比如,当第一目标服务为第一控制服务时,目标设备作为控制设备,第二目标服务为被控服务,终端作为被控设备。
可选地,当第一目标服务包括第一被控服务和第一控制服务时,从被控服务和控制服务中筛选出与第一目标服务匹配的服务,得到针对控制连接请求的第二目标服务的过程为:
获取目标筛选策略;
从第一被控服务和第一控制服务筛选与目标筛选策略匹配的服务,得到第三目标服务;
从被控服务和控制服务中筛选出与第三目标服务匹配的服务,得到针对控制连接请求的第二目标服务。
比如,当第三目标服务为第一被控服务时,第二目标服务为控制服务。又比如,当第三目标服务为第一控制服务时,第二目标服务为被控服务。
目标筛选策略可以根据实际情况进行设置,本申请实施例在此不做限定。比如,获取目标筛选策略的过程可以为:
获取多媒体在目标设备和电子设备之间的传输方向;
根据传输方向,确定目标筛选策略。
由于目标设备和终端已经通过蓝牙音频传输模型协议的连接传输多媒体,因此,可以根据多媒体在目标设备和电子设备之间的传输方向,确定目标筛选策略。
如果传输方向为从目标设备到终端,此时,目标设备为源设备,终端为接收设备,则目标筛选策略为筛选出第一被控服务,第三目标服务为第一被控服务,第二目标服务为控制服务,如果传输方向为从终端到目标设备,此时,终端为源设备,目标设备为接收设备,则目标筛选策略为筛选出第一控制服务,第三目标服务为第一控制服务,第二目标服务为被控服务。
例如,目标设备为音箱,终端为电视,传输方向为从电视到音箱,则音箱作为控制设备,音箱所采用的服务为第一控制服务,目标筛选策略为筛选出第一控制服务。
又例如,目标设备为手机,终端为电视,传输方向为从手机到电视,则手机作为被控设备,手机所采用的服务为第一被控服务,目标筛选策略为筛选出第一被控服务。
又比如,获取目标筛选策略的过程也可以为:
获取目标应用程序的启动状态;
根据启动状态,确定目标筛选策略。
在本申请实施例,可以单独设置一个目标应用程序,然后当目标应用程序的启动状态为启动时,则将第一控制服务作为第三目标服务,当目标应用程序的启动状态为关闭时,则将第一被控服务作为第三目标服务。
需要说明的是,当启动状态为启动时,可以将第一控制服务作为第三目标服务,也可以将第一被控服务作为第三目标服务,本申请实施例在此不做限定。
又比如,获取目标筛选策略的过程也可以为:
获取目标设备的历史目标服务;
根据历史目标服务,确定目标筛选策略。
在本申请实施例中,如果目标设备和终端建立过音视频远程控制协议的连接,则可以根据目标设备的历史目标服务,确定目标筛选策略。
例如,历史目标服务为第一被控服务,目标设备在过去的A时间,通过第一被控服务与终端建立音视频远程控制协议的连接,则目标筛选策略为筛选出第一被控服务。
又例如,历史目标服务为第一控制服务,目标设备在过去的A时间,通过第一控制服务与终端建立音视频远程控制协议的连接,则目标筛选策略为筛选出第一控制服务。
可选地,如果历史目标服务存在多个且多个历史目标服务不相同,则可以根据离当前时间最近的时间对应的历史目标服务,确定目标筛选策略,或者,也可以根据出现次数最多的历史目标服务,确定目标筛选策略,或者,也可以根据与当前时间匹配的时间对应的历史目标服务,确定目标筛选策略。
例如,历史目标服务存在10个,其包括第一被控服务和第一控制服务,离当前时间最近的时间对应的历史目标服务为第一控制服务,则根据第一控制服务,确定目标筛选策略。
又例如,历史目标服务存在10个,其包括第一被控服务和第一控制服务,第一被控服务出现的次数为7,第一控制服务出现的次数为3,则根据第一被控服务,确定目标筛选策略。
又例如,历史目标服务存在10个,其包括第一被控服务和第一控制服务,当前时间为a号A时间,b号A时间对应的历史目标服务为第一被控服务,b号在a号之前,则根据第一被控服务,确定目标筛选策略。
S104、根据第二目标服务注册后的回调函数,与目标设备建立音视频远程控制协议的连接。
如果第一目标服务为被控服务,则根据被控服务注册后的回调函数,与目标设备建立音视频远程控制协议的连接,如果第一目标服务为控制服务,则根据控制服务注册后的回调函数,与目标设备建立音视频远程控制协议的连接。
当将被控服务的回调函数和控制服务的回调函数注册之后,可以得到控制服务的回调函数对应的第一标识,以及得到被控服务的回调函数对应的第二标识时,根据第二目标服务注册后的回调函数,与目标设备建立音视频远程控制协议的连接的过程可以为:
若第二目标服务为控制服务,则根据第一标识对应的回调函数,与目标设备建立音视频远程控制协议的连接;
若第二目标服务为被控服务,则根据第二标识对应的回调函数,与目标设备建立音视频远程控制协议的连接。
当终端根据被控服务注册后的回调函数,与目标设备建立音视频远程控制协议的连接时,终端在与目标设备建立音视频远程控制协议的连接之后,可以通过与目标设备的音视频远程控制协议的连接,接收目标设备对终端中的多媒体进行控制的控制指令,然后根据控制指令控制多媒体。
当终端根据控制服务注册后的回调函数,与目标设备建立音视频远程控制协议的连接时,终端在与目标设备建立音视频远程控制协议的连接之后,可以通过与目标设备的音视频远程控制协议的连接,对目标设备中的多媒体进行控制。
其中,终端通过与目标设备的音视频远程控制协议的连接,控制目标设备中的多媒体的方式,可以根据实际情况进行选择,比如,可以控制目标设备中的多媒体的暂停、播放、上一首或下一首等,本申请实施例在此不做限定。
在本申请实施例中,终端中共存被控服务和控制服务,根据目标设备的角色确定终端的角色,目标设备的角色为被控设备时,终端的角色为控制设备,目标设备的角色为控制设备时,终端的角色为被控设备,使得终端在与目标设备的音视频远程控制协议的连接中,角色不会出现错误,使得当终端作为控制设备,通过与目标设备的音视频远程控制协议的连接,控制目标设备中的多媒体时,多媒体的控制不会出现错误,提高用户体验,从而提高终端的使用率。
由以上可知,在本申请实施例中,获取蓝牙初始化指令,根据蓝牙初始化指令,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册;获取目标设备根据音视频远程控制协议发送的控制连接请求,并根据控制连接请求,获取目标设备支持的 第一目标服务;从被控服务和控制服务中筛选出与第一目标服务匹配的服务,得到针对控制连接请求的第二目标服务;根据第二目标服务注册后的回调函数,与目标设备建立音视频远程控制协议的连接,实现在电子设备中共存被控服务和控制服务,然后根据目标设备支持的第一目标服务决定是根据被控服务的回调函数与目标设备建立音视频远程控制协议的连接还是根据控制服务的回调函数与目标设备建立音视频远程控制协议的连接,使得电子设备在音视频远程控制协议中既可以作为被控设备,也可以作为控制设备,提高电子设备的使用率。
下面根据图3对本申请实施例提供的蓝牙初始化的过程进行进一步说明。
终端获取蓝牙启动指令,根据蓝牙启动指令,进行蓝牙服务初始化,在蓝牙初始化的过程中,进行被控服务初始化和控制服务初始化。
终端在控制服务初始化的过程中,将控制服务的回调函数进行音视频远程控制协议注册,得到控制服务的回调函数对应的第一标识。
终端在被控服务初始化的过程中,将被控服务的回调函数进行音视频远程控制协议注册,得到被控服务的回调函数对应的第二标识。
终端在回调函数的注册完成之后,再进行音视频远程控制协议的连接。
下面根据图4和图5对本申请实施例提供的设备连接的过程进行进一步说明。
终端获取目标设备针对音视频远程控制协议发送的控制连接请求,根据控制连接请求,获取目标设备支持的第一目标服务。
若第一目标服务为第一被控服务,终端则将控制服务确定为第二目标服务,根据第一标识对应回调函数,与目标设备建立音视频远程控制协议的连接。
若第一目标服务为第一控制服务,终端则将被控服务确定为第二目标服务,根据第二标识对应回调函数,与目标设备建立音视频远程控制协议的连接。
若第一目标服务包括第一被控服务和第一控制服务,则判断目标应用程序的启动状态。若目标应用程序的启动状态为启动,则将控制服务确定为第二目标服务,根据第一标识对应回调函数,与目标设备建立音视频远程控制协议的连接。若目标应用程序的启动状态为关闭,终端此时显示的页面可以为任何一个界面,也可以为默认界面,则可以判断多媒体的传输方向。
如果传输方向为从目标设备到终端,终端则将控制服务确定为第二目标服务,根据第一标识对应回调函数,与目标设备建立音视频远程控制协议的连接。如果传输方向为从终端到目标设备,终端则将被控服务确定为第二目标服务,根据第二标识对应回调函数,与目标设备建立音视频远程控制协议的连接。
为便于更好的实施本申请实施例提供的设备连接方法,本申请实施例还提供一种基于上述设备连接方法的装置,该装置应用于电子设备,电子设备支持被控服务和控制服务。其中名词的含义与上述设备连接方法中相同,具体实现细节可以参考方法实施例中的说明。
例如,如图6所示,该设备连接装置可以包括:
指令获取模块601,用于获取蓝牙初始化指令,根据蓝牙初始化指令,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册。
请求获取模块602,用于获取目标设备针对音视频远程控制协议发送的控制连接请求,并根据控制连接请求,获取目标设备支持的第一目标服务。
服务筛选模块603,用于从被控服务和控制服务中筛选出与第一目标服务匹配的服务,得到针对控制连接请求的第二目标服务。
连接建立模块604,用于根据第二目标服务注册后的回调函数,与目标设备建立音视频远程控制协议的连接。
可选地,第一目标服务包括第一被控服务和第一控制服务。服务筛选模块603具体用于执行:
获取目标筛选策略;
从第一被控服务和第一控制服务筛选与目标筛选策略匹配的服务,得到第三目标服务;
从被控服务和控制服务中筛选出与第三目标服务匹配的服务,得到针对控制连接请求的第二目标服务。
可选地,服务筛选模块603具体用于执行:
获取多媒体在目标设备和电子设备之间的传输方向;
根据传输方向,确定目标筛选策略。
可选地,服务筛选模块603具体用于执行:
获取目标应用程序的启动状态;
根据启动状态,确定目标筛选策略。
可选地,服务筛选模块603具体用于执行:
获取目标设备的历史目标服务;
根据历史目标服务,确定目标筛选策略。
可选地,电子设备与第一目标设备建立音视频远程控制协议的连接;相应地,请求获取模块602具体用于执行:
根据控制连接请求,获取目标设备的优先级和第一目标设备的优先级;
若目标设备的优先级高于第一目标设备的优先级,则断开与第一目标设备的音视频远程控制协议的连接;
获取目标设备支持的第一目标服务。
可选地,指令获取模块601具体用于执行:
根据蓝牙初始化指令,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册,得到控制服务的回调函数对应的第一标识,以及得到被控服务的回调函数对应的第二标识。
相应地,连接建立模块604具体用于执行:
若第二目标服务为控制服务,则根据第一标识对应的回调函数,与目标设备建立音视频远程控制协议的连接;
若第二目标服务为被控服务,则根据第二标识对应的回调函数,与目标设备建立音视频远程控制协议的连接。
具体实施时,以上各个模块可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个模块的具体实施方式以及对应的有益效果可参见前面的方法实施例,在此不再赘述。
本申请实施例还提供一种电子设备,该电子设备可以是服务器或终端等,如图7所示,其示出了本申请实施例所涉及的电子设备的结构示意图,具体来讲:
该电子设备可以包括一个或者一个以上处理核心的处理器701、一个或一个以上计算机可读存储介质的存储器702、电源703和输入单元704等部件。本领域技术人员可以理解,图7中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:
处理器701是该电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器702内的计算机程序和/或模块,以及调用存储在存储 器702内的数据,执行电子设备的各种功能和处理数据。可选的,处理器701可包括一个或多个处理核心;优选的,处理器701可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器701中。
存储器702可用于存储计算机程序以及模块,处理器701通过运行存储在存储器702的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器702可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器702可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器702还可以包括存储器控制器,以提供处理器701对存储器702的访问。
电子设备还包括给各个部件供电的电源703,优选的,电源703可以通过电源管理系统与处理器701逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源703还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
该电子设备还可包括输入单元704,该输入单元704可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。
尽管未示出,电子设备还可以包括显示单元等,在此不再赘述。具体在本实施例中,电子设备中的处理器701会按照如下的指令,将一个或一个以上的计算机程序的进程对应的可执行文件加载到存储器702中,并由处理器701来运行存储在存储器702中的计算机程序,从而实现各种功能,比如:
获取蓝牙初始化指令,根据蓝牙初始化指令,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册;
获取目标设备针对音视频远程控制协议发送的控制连接请求,并根据控制连接请求,获取目标设备支持的第一目标服务;
从被控服务和控制服务中筛选出与第一目标服务匹配的服务,得到针对控制连接请求的第二目标服务;
根据第二目标服务注册后的回调函数,与目标设备建立音视频远程控制协议的连接。
以上各个操作的具体实施方式以及对应的有益效果可参见上文对设备连接方法的详细描述,在此不作赘述。
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过计算机程序来完成,或通过计算机程序控制相关的硬件来完成,该计算机程序可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。
为此,本申请实施例提供一种计算机可读存储介质,其中存储有计算机程序,该计算机程序能够被处理器进行加载,以执行本申请实施例所提供的任一种设备连接方法中的步骤。例如,该计算机程序可以执行如下步骤:
获取蓝牙初始化指令,根据蓝牙初始化指令,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册;
获取目标设备针对音视频远程控制协议发送的控制连接请求,并根据控制连接请求,获取目标设备支持的第一目标服务;
从被控服务和控制服务中筛选出与第一目标服务匹配的服务,得到针对控制连接请求的第二目标服务;
根据第二目标服务注册后的回调函数,与目标设备建立音视频远程控制协议的连接。
以上各个操作的具体实施方式以及对应的有益效果可参见前面的实施例,在此不再赘述。
其中,该计算机可读存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。
由于该计算机可读存储介质中所存储的计算机程序,可以执行本申请实施例所提供的任一种设备连接方法中的步骤,因此,可以实现本申请实施例所提供的任一种设备连接方法所能实现的有益效果,详见前面的实施例,在此不再赘述。
其中,根据本申请的一个方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述设备连接方法。
以上对本申请实施例所提供的一种设备连接方法、装置、电子设备及计算机存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员, 依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种设备连接方法,其中,应用于电子设备,所述电子设备支持被控服务和控制服务,所述方法包括:
    获取蓝牙初始化指令,根据蓝牙初始化指令,将所述被控服务的回调函数和所述控制服务的回调函数进行音视频远程控制协议注册;
    获取目标设备针对音视频远程控制协议发送的控制连接请求,并根据所述控制连接请求,获取所述目标设备支持的第一目标服务;
    从所述被控服务和所述控制服务中筛选出与所述第一目标服务匹配的服务,得到针对所述控制连接请求的第二目标服务;
    根据所述第二目标服务注册后的回调函数,与所述目标设备建立所述音视频远程控制协议的连接。
  2. 根据权利要求1所述的设备连接方法,其中,所述第一目标服务包括第一被控服务和第一控制服务;
    所述从所述被控服务和所述控制服务中筛选出与所述第一目标服务匹配的服务,得到针对所述控制连接请求的第二目标服务,包括:
    获取目标筛选策略;
    从所述第一被控服务和所述第一控制服务筛选与所述目标筛选策略匹配的服务,得到第三目标服务;
    从所述被控服务和所述控制服务中筛选出与所述第三目标服务匹配的服务,得到针对所述控制连接请求的第二目标服务。
  3. 根据权利要求2所述的设备连接方法,其中,所述获取目标筛选策略,包括:
    获取多媒体在所述目标设备和所述电子设备之间的传输方向;
    根据所述传输方向,确定目标筛选策略。
  4. 根据权利要求2所述的设备连接方法,其中,所述获取目标筛选策略,包括:
    获取目标应用程序的启动状态;
    根据所述启动状态,确定目标筛选策略。
  5. 根据权利要求2所述的设备连接方法,其中,所述获取目标筛选策略,包括:
    获取所述目标设备的历史目标服务;
    根据所述历史目标服务,确定目标筛选策略。
  6. 根据权利要求5所述的设备连接方法,其中,根据所述历史目标服务,确定目标筛选策略,包括:
    确定所述目标设备存在多个不相同的历史目标服务,则根据当前时间最近的时间对应的历史目标服务,确定目标筛选策略;
    或,根据出现次数最多的历史目标服务,确定目标筛选策略;
    或,根据与当前时间匹配的时间对应的历史目标服务,确定目标筛选策略。
  7. 根据权利要求1所述的设备连接方法,其中,所述电子设备与第一目标设备建立所述音视频远程控制协议的连接;
    所述根据所述控制连接请求,获取所述目标设备支持的第一目标服务,包括:
    根据所述控制连接请求,获取所述目标设备的优先级和所述第一目标设备的优先级;
    若所述目标设备的优先级高于所述第一目标设备的优先级,则断开与所述第一目标设备的所述音视频远程控制协议的连接;
    获取所述目标设备支持的第一目标服务。
  8. 根据权利要求1所述的设备连接方法,其中,所述根据蓝牙初始化指令,将所述被控服务的回调函数和所述控制服务的回调函数进行音视频远程控制协议注册,包括:
    根据蓝牙初始化指令,将所述被控服务的回调函数和所述控制服务的回调函数进行音视频远程控制协议注册,得到所述控制服务的回调函数对应的第一标识,以及得到所述被控服务的回调函数对应的第二标识。
  9. 根据权利要求8所述的设备连接方法,其中,所述根据所述第二目标服务注册后的回调函数,与所述目标设备建立所述音视频远程控制协议的连接,包括:
    若所述第二目标服务为所述控制服务,则根据所述第一标识对应的回调函数,与所述目标设备建立所述音视频远程控制协议的连接;
    若所述第二目标服务为所述被控服务,则根据所述第二标识对应的回调函数,与所述目标设备建立所述音视频远程控制协议的连接。
  10. 一种设备连接装置,其中,应用于电子设备,所述电子设备支持被控服务和控制服务,所述装置包括:
    指令获取模块,用于获取蓝牙初始化指令,根据蓝牙初始化指令,将所述被控服务的回调函数和所述控制服务的回调函数进行音视频远程控制协议注册;
    请求获取模块,用于获取目标设备针对音视频远程控制协议发送的控制连接请求,并根据所述控制连接请求,获取所述目标设备支持的第一目标服务;
    服务筛选模块,用于从所述被控服务和所述控制服务中筛选出与所述第一目标服务匹配的服务,得到针对所述控制连接请求的第二目标服务;
    连接建立模块,用于根据所述第二目标服务注册后的回调函数,与所述目标设备建立所述音视频远程控制协议的连接。
  11. 根据权利要求10所述的设备连接装置,其中,所述第一目标服务包括第一被控服务和第一控制服务,所述服务筛选模块还用于执行:
    获取目标筛选策略;
    从第一被控服务和第一控制服务筛选与目标筛选策略匹配的服务,得到第三目标服务;
    从被控服务和控制服务中筛选出与第三目标服务匹配的服务,得到针对控制连接请求的第二目标服务。
  12. 根据权利要求11所述的设备连接装置,其中,所述服务筛选模块还用于执行:
    获取多媒体在目标设备和电子设备之间的传输方向;
    根据传输方向,确定目标筛选策略。
  13. 根据权利要求11所述的设备连接装置,其中,所述服务筛选模块还用于执行:
    获取目标应用程序的启动状态;
    根据启动状态,确定目标筛选策略。
  14. 根据权利要求11所述的设备连接装置,其中,所述服务筛选模块还用于执行:
    获取目标设备的历史目标服务;
    根据历史目标服务,确定目标筛选策略。
  15. 根据权利要求11所述的设备连接装置,其中,所述服务筛选模块还用于执行:
    确定所述目标设备存在多个不相同的历史目标服务,则根据当前时间最近的时间对应的历史目标服务,确定目标筛选策略;
    或,根据出现次数最多的历史目标服务,确定目标筛选策略;
    或,根据与当前时间匹配的时间对应的历史目标服务,确定目标筛选策略。
  16. 根据权利要求10所述的设备连接装置,其中,所述电子设备与第一目标设备建立所述音视频远程控制协议的连接,所述请求获取模块还用于执行:
    根据控制连接请求,获取目标设备的优先级和第一目标设备的优先级;
    若目标设备的优先级高于第一目标设备的优先级,则断开与第一目标设备的音视频远程控制协议的连接;
    获取目标设备支持的第一目标服务。
  17. 根据权利要求10所述的设备连接装置,其中,所述指令获取模块还用于执行:
    根据蓝牙初始化指令,将被控服务的回调函数和控制服务的回调函数进行音视频远程控制协议注册,得到控制服务的回调函数对应的第一标识,以及得到被控服务的回调函数对应的第二标识。
  18. 根据权利要求10所述的设备连接装置,其中,所述连接建立模块还用于执行:
    若第二目标服务为控制服务,则根据第一标识对应的回调函数,与目标设备建立音视频远程控制协议的连接;
    若第二目标服务为被控服务,则根据第二标识对应的回调函数,与目标设备建立音视频远程控制协议的连接。
  19. 一种电子设备,其中,包括处理器和存储器,所述存储器存储有计算机程序,所述处理器用于运行所述存储器内的计算机程序,以执行权利要求1至9任一项所述的设备连接方法。
  20. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序适于处理器进行加载,以执行权利要求1至9任一项所述的设备连接方法。
PCT/CN2024/096109 2023-08-23 2024-05-29 设备连接方法、装置、电子设备及计算机存储介质 Pending WO2025039655A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202311069946.9 2023-08-23
CN202311069946.9A CN117412109A (zh) 2023-08-23 2023-08-23 设备连接方法、装置、电子设备及计算机存储介质

Publications (1)

Publication Number Publication Date
WO2025039655A1 true WO2025039655A1 (zh) 2025-02-27

Family

ID=89495190

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/096109 Pending WO2025039655A1 (zh) 2023-08-23 2024-05-29 设备连接方法、装置、电子设备及计算机存储介质

Country Status (2)

Country Link
CN (1) CN117412109A (zh)
WO (1) WO2025039655A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117412109A (zh) * 2023-08-23 2024-01-16 深圳Tcl新技术有限公司 设备连接方法、装置、电子设备及计算机存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101213582A (zh) * 2005-06-29 2008-07-02 西姆毕恩软件有限公司 遥控框架
CN105491135A (zh) * 2015-12-11 2016-04-13 小米科技有限责任公司 建立数据连接的方法及装置
US20170171798A1 (en) * 2015-12-10 2017-06-15 Lg Electronics Inc. Method and apparatus for transmitting and receiving data in wireless communication system
CN112738775A (zh) * 2019-10-29 2021-04-30 广东美的制冷设备有限公司 集控设备及其拓扑方法、系统和设备
CN117412109A (zh) * 2023-08-23 2024-01-16 深圳Tcl新技术有限公司 设备连接方法、装置、电子设备及计算机存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101213582A (zh) * 2005-06-29 2008-07-02 西姆毕恩软件有限公司 遥控框架
US20170171798A1 (en) * 2015-12-10 2017-06-15 Lg Electronics Inc. Method and apparatus for transmitting and receiving data in wireless communication system
CN105491135A (zh) * 2015-12-11 2016-04-13 小米科技有限责任公司 建立数据连接的方法及装置
CN112738775A (zh) * 2019-10-29 2021-04-30 广东美的制冷设备有限公司 集控设备及其拓扑方法、系统和设备
CN117412109A (zh) * 2023-08-23 2024-01-16 深圳Tcl新技术有限公司 设备连接方法、装置、电子设备及计算机存储介质

Also Published As

Publication number Publication date
CN117412109A (zh) 2024-01-16

Similar Documents

Publication Publication Date Title
CN102868729B (zh) 基于云服务的实现软件服务的方法、客户端及云服务器
JP6742465B2 (ja) ブルートゥーススピーカーにおける連続ウェイクアップ遅延低減の方法、装置及びブルートゥーススピーカー
CN110870292B (zh) 在多用户识别模块sim多待机电子设备中选择性地传送一项或多项服务
CN102754387B (zh) 在允许通用即插即用的电话设备与广域网设备之间进行多媒体会议的系统和方法
US20150088966A1 (en) Service activity user interface
US20040230687A1 (en) Service management system, and method, communications unit and integrated circuit for use in such system
CN107038046A (zh) 音频播放系统的升级方法、装置及终端
CN107025120A (zh) 软件升级处理方法、装置和终端
WO2025039655A1 (zh) 设备连接方法、装置、电子设备及计算机存储介质
WO2025040006A1 (zh) 设备控制方法、装置、控制设备及计算机存储介质
WO2024007710A1 (zh) 动画播放方法、装置、电子设备和计算机可读存储介质
CN111328061A (zh) 一种音频资源的控制方法、车载终端和系统
CN114217759B (zh) 投屏方法、装置、存储介质及电子设备
CN115766313A (zh) 影音系统控制方法、设备及存储介质
WO2023273597A1 (zh) 一种通信转移方法、计算机设备和存储介质
WO2024160020A1 (zh) 视频传输方法、装置、电子设备及计算机存储介质
WO2025152566A1 (zh) 终端配网方法、装置、设备和存储介质
WO2021036838A1 (zh) 应用程序的安装方法、运行方法、电子设备、计算机可读介质
CN113176888A (zh) 电子设备的升级方法、升级装置、存储介质及电子设备
CN112954760A (zh) 蓝牙设备的连接方法、装置和电子设备
CN113747100A (zh) 音视频通话方法、装置、存储介质及电子设备
CN113765886B (zh) 多媒体播放方法、装置、存储介质及电子设备
CN117729346B (zh) 直播控制方法、装置、电子设备及存储介质
CN115987748A (zh) 智能电视控制方法、装置、存储介质及电子设备
US8996896B2 (en) Hybrid optimized personal computer

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: 24855385

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE