WO2022242312A1 - Application-based device connection relationship establishment method and related apparatus - Google Patents

Application-based device connection relationship establishment method and related apparatus Download PDF

Info

Publication number
WO2022242312A1
WO2022242312A1 PCT/CN2022/083299 CN2022083299W WO2022242312A1 WO 2022242312 A1 WO2022242312 A1 WO 2022242312A1 CN 2022083299 W CN2022083299 W CN 2022083299W WO 2022242312 A1 WO2022242312 A1 WO 2022242312A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
application
session
service
information
Prior art date
Application number
PCT/CN2022/083299
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 WO2022242312A1 publication Critical patent/WO2022242312A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • 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

Definitions

  • the second instruction received by the above-mentioned first electronic device may come from a user operation acting on the first application.
  • the first electronic device runs the first application, and displays the user interface of the first application.
  • the first electronic device receives a user operation for invoking other electronic devices to provide the first service, acting on the user interface of the first application.
  • the first electronic device may search for one or more electronic devices that can provide the first service.
  • the one or more electronic devices capable of providing the first service include a second electronic device.
  • the first electronic device may receive the above second instruction, and send the above first instruction to the second electronic device according to the above second instruction.
  • the first electronic device may store the first connection relationship with the second electronic device. When the first electronic device calls another electronic device to provide the first service again, the first electronic device may call the second electronic device to provide the first service according to the first connection relationship.
  • the second electronic device receives the sixth instruction.
  • the sixth instruction is used to instruct the second electronic device to call the fourth electronic device to provide the second service through the running application providing the first service.
  • the second electronic device sends the fifth instruction to the fourth electronic device according to the sixth instruction.
  • the first electronic device invokes the second electronic device to provide the second service through the first application
  • the second electronic device invokes the first electronic device to run the first application through the application providing the second service.
  • the above problem of cyclic calling may cause the connection information between the two electronic devices to be cyclically transmitted between the two devices, wasting computing resources and storage resources of the two electronic devices.
  • the above-mentioned embodiment can avoid the problem of cyclic calling between electronic devices in a session, and save computing resources and storage resources of electronic devices.
  • the account name input box 221 can be used to output the login account name. For example "Zhang San”.
  • After-school exercises area 243 may include homework exercises for the first lesson.
  • the after-school exercise area 243 may also include a text input box for taking notes. That is, the electronic device 100 can invoke the note-taking and answering service for the user to take notes and complete homework exercises.
  • a communication connection (such as a Wi-Fi communication connection) is established between the electronic device 100 and the electronic device 200 .
  • the electronic device 200 may display a user interface 260 .
  • the user interface 260 is a user interface for playing a course video (such as the course video of the first lesson). Wherein, the user may instruct the electronic device 200 to play the first lesson video or pause playing the first lesson video by acting on the user operation of the play control or the pause control on the remote control.
  • connection information may include the device identifiers of the other electronic devices, the application identifiers of the applications invoked by the other electronic devices during the collaborative work, and the service identifiers of the services in the applications invoked by the other electronic devices during the collaborative work (optional ).
  • the above connection information may be used by the electronic device 100 to establish a connection with the historical cooperation device when requesting other electronic devices to work together again to realize the application scenario A.
  • the electronic device 100 may instruct the historical coordinated devices to call the applications that were respectively called when the application scenario A was implemented. This not only simplifies the user operation when multiple electronic devices are connected, but also facilitates the user to call the electronic device he is accustomed to, and enters the familiar application scene more quickly, thus improving the user experience.
  • the electronic device 300 can display the latest received note data and answer data. That is, the user can continue to take notes from the notes that have been recorded, and continue to complete the after-school exercises from the completed after-school exercises.
  • the note data and answer data received last time may be sent by the electronic device 100 , or may be obtained by the electronic device 300 from the storage sandbox of session A stored by the electronic device 300 .
  • the application bar 512 may include one or more recently used applications of the electronic device 100 (such as code scanning applications, payment code applications, music applications, etc.).
  • the electronic device 100 may display the payment code in response to a user operation acting on the payment code application.
  • the embodiment of the present application does not limit the applications in the application column 512 .
  • the second recommendation box 522 may be used to display the electronic device information requested by the electronic device 100 to work together through the network disk application A.
  • the second recommendation box 522 may include a network disk application A icon 522A, a last used device 522B, and a nearby collaboratively recommended device 522C.
  • the network disk application A may be the traditional application in the foregoing embodiments. It can be known from the second recommendation box 522 that the electronic device 100 once instructed the electronic device named "Zhang San's tablet" to perform collaborative work on document editing through the network disk application A.
  • the electronic device 100 may send the location of the session 1 storage sandbox 711 in the router to the electronic device 200 .
  • the electronic device 200 can acquire the snapshot information of the session 1 from the session 1 storage sandbox 711 , and store the activity information of the course video playing application in the session 1 storage sandbox 711 . In this way, if the electronic device 100 leaves during the process of the electronic device 100 instructing the electronic device 200 to play the course video through the exercise answer providing application, the electronic device 200 can continue to update the snapshot information of the session 1.
  • connection information table 912 in the electronic device 910 The connection information table 912 in the electronic device 910, the connection information table 922 in the electronic device 920, the connection information table 932 in the electronic device 930, the connection information table 952 in the electronic device 950, the connection information table 972 in the electronic device 970, and
  • connection information table 912 in the electronic device 910 the connection information table 922 in the electronic device 920
  • connection information table 932 in the electronic device 930 the connection information table 952 in the electronic device 950
  • connection information table 972 in the electronic device 970 For the data and functions contained in the connection information table 920 in the electronic device 980, reference may be made to the foregoing embodiment shown in FIG. 9 . I won't go into details here.

Abstract

The present application provides an application-based device connection relationship establishment method and a related apparatus. When a first electronic device invokes, by means of a first application for the first time, a second electronic device to provide a first service, connection information of the first electronic device and the second electronic device can be stored. The connection information can comprise a device identifier of the second electronic device and an identifier of the first service. When the first electronic device invokes, by means of the first application again, another electronic device to provide the first service, the first electronic device can invoke, according to the connection information, the second electronic device to provide the first service. According to the method, connection relationships between a plurality of electronic devices can be quickly established. A user does not need to respectively operate on the plurality of electronic devices, such that user operations during the establishment of connections between the plurality of electronic devices are simplified.

Description

基于应用的设备连接关系建立方法及相关装置Application-based device connection relationship establishment method and related device
本申请要求于2021年05月20日提交中国专利局、申请号为202110552602.8、申请名称为“基于应用的设备连接关系建立方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110552602.8 and the application title "Application-Based Device Connection Relationship Establishment Method and Related Devices" submitted to the China Patent Office on May 20, 2021, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请涉及终端技术领域,尤其涉及一种基于应用的设备连接关系建立方法及相关装置。The present application relates to the field of terminal technology, in particular to an application-based method for establishing a device connection relationship and a related device.
背景技术Background technique
随着物联网的发展,在一些应用场景中,用户可能需要同时使用多个电子设备协同工作。例如,在通过一个学习应用进行课程学习的应用场景中,用户可以使用大屏播放课程视频,同时使用平板记笔记以及完成课后习题。With the development of the Internet of Things, in some application scenarios, users may need to use multiple electronic devices to work together. For example, in the application scenario of course learning through a learning application, the user can use the large screen to play the course video, and at the same time use the tablet to take notes and complete the homework after class.
目前,电子设备上的应用一般是响应于用户作用在该应用的图标上的用户操作而打开。对于上述需要多个电子设备协同工作的应用场景,用户每一次都需要分别在这多个电子设备上进行操作,来建立这多个电子设备之间的连接关系,以及打开这多个电子设备上用于协同工作以实现一个应用场景的多个应用。上述过程用户操作繁琐,难以快速建立多个电子设备之间的连接关系。Currently, an application on an electronic device is generally opened in response to a user operation performed by the user on an icon of the application. For the above-mentioned application scenarios that require multiple electronic devices to work together, the user needs to operate on the multiple electronic devices each time to establish the connection relationship between the multiple electronic devices, and to open the multiple electronic devices. Multiple applications used to work together to implement an application scenario. The above process is cumbersome for the user to operate, and it is difficult to quickly establish a connection relationship between multiple electronic devices.
发明内容Contents of the invention
本申请实施例提供一种基于应用的设备连接关系建立方法及相关装置。其中,第一电子设备可以获取已存储的连接信息。该连接信息可包括第二电子设备的设备标识、第一服务的服务标识。根据该连接信息,第一电子设备调用第二电子设备提供第一服务。该方法可以快速建立多个电子设备之间的连接关系。Embodiments of the present application provide an application-based method for establishing a device connection relationship and a related device. Wherein, the first electronic device may acquire the stored connection information. The connection information may include a device identifier of the second electronic device and a service identifier of the first service. According to the connection information, the first electronic device invokes the second electronic device to provide the first service. The method can quickly establish the connection relationship between multiple electronic devices.
第一方面,本申请提供一种基于应用的设备连接关系建立方法。该方法可应用于通信系统。该通信系统可包括第一电子设备和第二电子设备。第一电子设备安装有第一应用。第二电子设备安装有用于提供第一服务的应用。在该方法中,第一电子设备可获取第一会话的第一快照信息。第一会话为第一电子设备通过第一应用调用一个或多个电子设备提供一项或多项服务所进行的通信。第一快照信息可包括第一连接信息。第一连接信息包括第二电子设备的设备标识、第一服务的标识。第一电子设备可根据第一连接信息向第二电子设备发送第一指令。第一指令可用于指示第二电子设备提供第一服务。第二电子设备接收到第一指令,提供第一服务。In a first aspect, the present application provides an application-based method for establishing a device connection relationship. The method can be applied to communication systems. The communication system may include a first electronic device and a second electronic device. The first electronic device is installed with a first application. The second electronic device is installed with an application for providing the first service. In this method, the first electronic device may acquire first snapshot information of the first session. The first session is a communication in which the first electronic device invokes one or more electronic devices to provide one or more services through the first application. The first snapshot information may include first connection information. The first connection information includes the device identifier of the second electronic device and the identifier of the first service. The first electronic device may send the first instruction to the second electronic device according to the first connection information. The first instruction may be used to instruct the second electronic device to provide the first service. The second electronic device receives the first instruction and provides the first service.
结合第一方面,在一些实施例中,第一电子设备可接收到第二指令,该第二指令可用于指示第一电子设备通过第一应用调用第二电子设备提供第一服务。第一电子设备可以创建第一会话,并存储第一快照信息。第一电子设备可以根据第二指令向第二电子设备发送上述第一指令。With reference to the first aspect, in some embodiments, the first electronic device may receive a second instruction, and the second instruction may be used to instruct the first electronic device to call the second electronic device to provide the first service through the first application. The first electronic device can create a first session and store first snapshot information. The first electronic device may send the first instruction to the second electronic device according to the second instruction.
由上述实施例可以看出,第一电子设备首次通过第一应用调用第二电子设备提供第一服务时,可以存储第一电子设备和第二电子设备之间的第一连接信息。当第一电子设备再次通过第一应用调用其它电子设备提供第一服务时,第一电子设备可以根据上述第一连接信息调 用第二电子设备提供第一服务。上述方法可以快速建立多个电子设备之间的连接关系。用户可以不用在多个电子设备上分别进行操作,这简化了多个电子设备建立连接时的用户操作。It can be seen from the above embodiments that when the first electronic device invokes the second electronic device to provide the first service through the first application for the first time, it may store the first connection information between the first electronic device and the second electronic device. When the first electronic device invokes other electronic devices to provide the first service again through the first application, the first electronic device may invoke the second electronic device to provide the first service according to the first connection information. The above method can quickly establish the connection relationship between multiple electronic devices. The user does not need to perform operations on multiple electronic devices separately, which simplifies user operations when multiple electronic devices are connected.
上述第一应用和上述用于提供第一服务的应用可以是分布式应用中提供各项服务的程序实体,或者是
Figure PCTCN2022083299-appb-000001
系统、
Figure PCTCN2022083299-appb-000002
系统等系统中的传统应用。
The above-mentioned first application and the above-mentioned application for providing the first service may be a program entity providing various services in a distributed application, or a
Figure PCTCN2022083299-appb-000001
system,
Figure PCTCN2022083299-appb-000002
System and other traditional applications in the system.
上述第一服务的标识可用于指示第一服务的具体内容。例如,上述第一服务为课程视频播放服务。上述第一服务的标识可以为指示课程视频播放服务的数据。根据第一服务的标识,第一电子设备可以调用其它电子设备提供第一服务。The above identifier of the first service may be used to indicate specific content of the first service. For example, the above-mentioned first service is a course video playing service. The identifier of the above-mentioned first service may be data indicating a course video playing service. According to the identifier of the first service, the first electronic device can call other electronic devices to provide the first service.
第一电子设备在创建上述第一会话时,可以为第一会话分配一个存储沙箱。每一个会话均可被分配有一个存储沙箱。一个存储沙箱的位置可以有电子设备的设备账号(如华为账号)、该电子设备在会话中调用的应用标识、该这一个存储沙箱对应的会话的会话标识来确定。每个会话的存储沙箱是隔离的。电子设备可以根据根据一个会话的存储沙箱的位置获取这一个会话的快照信息。When creating the above-mentioned first session, the first electronic device may allocate a storage sandbox for the first session. Each session can be assigned a storage sandbox. The location of a storage sandbox can be determined by the device account of the electronic device (such as Huawei account), the application identifier invoked by the electronic device in the session, and the session identifier of the session corresponding to the storage sandbox. The storage sandbox for each session is isolated. The electronic device may acquire the snapshot information of a session according to the location of the storage sandbox of the session.
上述第一电子设备接收到的第二指令可以来自于作用在第一应用中的用户操作。示例性的,第一电子设备运行第一应用,显示第一应用的用户界面。第一电子设备接收到作用在第一应用的用户界面中用于调用其它电子设备提供第一服务的用户操作。第一电子设备可以搜索到一个或多个可提供第一服务的电子设备。这一个或多个可提供第一服务的电子设备包括第二电子设备。响应于选择第二电子设备的用户操作,第一电子设备可以接收到上述第二指令,并根据上述第二指令向第二电子设备发送上述第一指令。其中,第一电子设备可以存储与第二电子设备之间的第一连接关系。当第一电子设备再次调用其它电子设备提供第一服务时,第一电子设备可以根据上述第一连接关系调用第二电子设备提供第一服务。The second instruction received by the above-mentioned first electronic device may come from a user operation acting on the first application. Exemplarily, the first electronic device runs the first application, and displays the user interface of the first application. The first electronic device receives a user operation for invoking other electronic devices to provide the first service, acting on the user interface of the first application. The first electronic device may search for one or more electronic devices that can provide the first service. The one or more electronic devices capable of providing the first service include a second electronic device. In response to the user operation of selecting the second electronic device, the first electronic device may receive the above second instruction, and send the above first instruction to the second electronic device according to the above second instruction. Wherein, the first electronic device may store the first connection relationship with the second electronic device. When the first electronic device calls another electronic device to provide the first service again, the first electronic device may call the second electronic device to provide the first service according to the first connection relationship.
结合第一方面,在一些实施例中,上述第一会话具有第一会话标识。第一会话的会话标识可以由第一电子设备的设备账号和第一应用的应用标识确定。第一电子设备可以根据第一会话标识获取上述第一快照信息。另外,在第一电子设备通过第一应用调用第二电子设备提供第一服务时,第一电子设备可以将上述第一会话标识传递给第二电子设备。第一会话标识可以包含在上述第一指令中。With reference to the first aspect, in some embodiments, the above-mentioned first session has a first session identifier. The session identifier of the first session may be determined by the device account of the first electronic device and the application identifier of the first application. The first electronic device may acquire the first snapshot information according to the first session identifier. In addition, when the first electronic device invokes the second electronic device to provide the first service through the first application, the first electronic device may transfer the above-mentioned first session identifier to the second electronic device. The first session identifier may be included in the above-mentioned first instruction.
结合第一方面,在一些实施例中,第一电子设备可以向第二电子设备指示提供第一服务的应用。具体的,第二电子设备安装有第二应用。第二应用可用于提供第一服务。上述第一连接信息中还可包括第二应用的应用标识。第一电子设备根据第一连接信息向第二电子设备发送第一指令。该第一指令可以用于指示第二电子设备运行第二应用来提供第一服务。With reference to the first aspect, in some embodiments, the first electronic device may indicate to the second electronic device the application that provides the first service. Specifically, the second electronic device is installed with the second application. The second application can be used to provide the first service. The first connection information may further include an application identifier of the second application. The first electronic device sends the first instruction to the second electronic device according to the first connection information. The first instruction may be used to instruct the second electronic device to run the second application to provide the first service.
上述第二应用可以是一个分布式应用中提供第一服务的程序实体。例如,第二应用与第一应用是同一个分布式应用中提供不同服务的程序实体。上述第二应用的应用标识可包括第二应用所属分布式应用的应用包名和第一服务的程序实体的服务包名。或者,上述第二应用可以是前述传统应用。第二应用的应用标识可以为第二应用的应用包名。The above-mentioned second application may be a program entity providing the first service in a distributed application. For example, the second application and the first application are program entities providing different services in the same distributed application. The application identifier of the second application may include the application package name of the distributed application to which the second application belongs and the service package name of the program entity of the first service. Or, the above-mentioned second application may be the above-mentioned traditional application. The application identifier of the second application may be an application package name of the second application.
结合第一方面,在一些实施例中,第一电子设备可以不指示第二电子设备提供第一服务的应用。第二电子设备中可能包含多个可提供第一服务的应用。第二电子设备可以从这多个可提供第一服务的应用中选取出一个应用来提供第一服务。具体的,第二电子设备安装有第二应用和第三应用。第二应用和第三应用均可用于提供第一服务。当接收到来自第一电子设备的第一指令,第二电子设备可以判断第二应用是否可用。若判断出第二应用可用,第二电子设备可以运行第二应用,提供第一服务。若判断出第二应用不可用,第二电子设备可以判断第三应用是否可用。若判断出第三应用可用,第二电子设备可以运行第三应用,提供第一服务。With reference to the first aspect, in some embodiments, the first electronic device may not instruct the second electronic device to provide the application of the first service. The second electronic device may contain multiple applications that can provide the first service. The second electronic device may select an application from the multiple applications capable of providing the first service to provide the first service. Specifically, the second electronic device is installed with the second application and the third application. Both the second application and the third application can be used to provide the first service. When receiving the first instruction from the first electronic device, the second electronic device can determine whether the second application is available. If it is determined that the second application is available, the second electronic device may run the second application to provide the first service. If it is determined that the second application is unavailable, the second electronic device may determine whether the third application is available. If it is determined that the third application is available, the second electronic device may run the third application to provide the first service.
一个应用不可用的情况可以包括:这一个应用在电子设备中被删除,电子设备无法找到该应用、电子设备无法再次安装这一个应用。The situation that an application is unavailable may include: the application is deleted in the electronic device, the electronic device cannot find the application, and the electronic device cannot install the application again.
其中,若第二电子设备中多个可提供第一服务的应用中存在与第一应用属于同一个分布式应用的应用,第二电子设备可以优先选取与第一应用属于同一个分布式应用的应用来提供第一服务。Wherein, if there is an application that belongs to the same distributed application as the first application among the multiple applications that can provide the first service in the second electronic device, the second electronic device can preferentially select the application that belongs to the same distributed application as the first application. application to provide the first service.
结合第一方面,在一些实施例中,第二电子设备可以将提供第一服务的应用的第一活动信息发送给第一电子设备。其中,第一活动信息可包括第一服务被提供过程中用于指示应用的用户界面在第一时刻呈现内容的数据。第一时刻为第一服务被提供过程中的任一时刻。第一电子设备可以在第一会话的存储沙箱中存储第一活动信息。第一活动信息包含于第一快照信息。With reference to the first aspect, in some embodiments, the second electronic device may send the first activity information of the application providing the first service to the first electronic device. Wherein, the first activity information may include data for instructing the user interface of the application to present content at the first moment during the provision of the first service. The first moment is any moment when the first service is provided. The first electronic device may store the first activity information in a storage sandbox of the first session. The first activity information is included in the first snapshot information.
在第二电子设备提供第一服务的过程中,第二电子设备可以每隔预设时间段周期性发送提供第一服务的应用的活动信息。可选的,第二电子设备可以在结束提供第一服务时将提供第一服务的应用的活动信息发送给第一电子设备。活动信息可以例如是播放视频的视频标识、播放进度、在用户界面接收到用户输入的数据等等。其中,第一电子设备在存储第二电子设备中提供第一服务的应用的活动信息时,可以利用最新一次接收到的活动信息来更新前一次接收到的活动信息。即第一电子设备可以仅保存最新一次接收到的活动信息。During the process of providing the first service by the second electronic device, the second electronic device may periodically send activity information of the application providing the first service every preset time period. Optionally, the second electronic device may send the activity information of the application providing the first service to the first electronic device when the provision of the first service ends. The activity information may be, for example, the video ID of the playing video, the playing progress, data input by the user received on the user interface, and so on. Wherein, when the first electronic device stores the activity information of the application providing the first service in the second electronic device, the activity information received last time may be used to update the activity information received last time. That is, the first electronic device may only store the latest received activity information.
结合第一方面,在一些实施例中,第一电子设备再次通过第一应用调用其它电子设备提供第一服务时,可以从第一会话的存储沙箱中获取第一快照信息。第一快照信息中可包括上述第一活动信息。第一电子设备可以将上述第一活动信息发送给第二电子设备。第二电子设备可以根据第一活动信息确定在运行用于提供第一服务的应用初始时刻应用的用户界面的呈现内容。例如,上述第一服务为课程视频播放服务。上述第一活动信息包括提供第一服务的应用在第一时刻播放课程视频的视频标识(或课程标识)、播放进度。第二电子设备在开始运行提供第一服务的应用时,可以将用户界面中需要播放的视频以及进度调整为第一活动信息中指示的视频以及播放进度。With reference to the first aspect, in some embodiments, when the first electronic device invokes another electronic device to provide the first service through the first application again, it may obtain the first snapshot information from the storage sandbox of the first session. The first snapshot information may include the above-mentioned first activity information. The first electronic device may send the first activity information to the second electronic device. The second electronic device may determine, according to the first activity information, the presentation content of the user interface of the application at the initial moment of running the application for providing the first service. For example, the above-mentioned first service is a course video playing service. The above-mentioned first activity information includes the video identification (or course identification) and playback progress of the course video played by the application providing the first service at the first moment. When the second electronic device starts to run the application providing the first service, the video and the progress to be played in the user interface may be adjusted to the video and the playing progress indicated in the first activity information.
由上述实施例可知,第一电子设备除了可以根据第一快照信息中的第一连接信息快速与第二电子设备建立连接,调用第二电子设备提供第一服务,还可以根据第一快照信息中的第一活动信息使得第二电子设备将提供第一服务的应用的状态恢复至第一时刻的状态。这样,用户在第一时刻之前在提供第一服务的应用上的操作痕迹可以被保存,用户的使用体验得以提高。It can be seen from the above embodiments that, in addition to quickly establishing a connection with the second electronic device according to the first connection information in the first snapshot information, and calling the second electronic device to provide the first service, the first electronic device can also The first activity information enables the second electronic device to restore the state of the application providing the first service to the state at the first moment. In this way, the operation traces of the user on the application providing the first service before the first moment can be saved, and the user experience can be improved.
结合第一方面,在一些实施例中,第一电子设备在首次通过一个应用调用其它电子设备提供一项服务时,第一电子设备可以查找自己是否通过其它应用调用其它电子设备提供与上述一项服务同类型的服务。若查找到,第一电子设备可以推荐通过上述通过其它应用调用其它电子设备提供与上述一项服务同类型的服务对应的连接关系。In combination with the first aspect, in some embodiments, when the first electronic device calls other electronic devices to provide a service through an application for the first time, the first electronic device can check whether it calls other electronic devices through other applications to provide a service related to the above-mentioned one. Services of the same type. If found, the first electronic device may recommend calling other electronic devices through other applications to provide a connection relationship corresponding to a service of the same type as the above-mentioned service.
具体的,第一电子设备还安装有第四应用。第一电子设备可以接收到第三指令。第三指令用于指示第一电子设备通过第四应用调用电子设备提供第一服务。第一电子设备可以从一个会话或多个会话的快照信息中查找包含第一服务的标识的连接信息,得到第一连接信息。上述一个会话或多个会话是第一电子设备创建的。第一电子设备可以根据第一连接信息向第二电子设备发送第四指令,并创建第二会话,存储第二会话的第二快照信息。第四指令可用于指示第二电子设备提供第一服务。第二会话为第一电子设备通过第四应用调用一个或多个电子设备提供一项或多项服务所进行的通信。第二快照信息可包括第二连接信息。第二连接信息可包括第二电子设备的设备标识、第一服务的标识。第二电子设备接收到第四指令,提 供第一服务。Specifically, the first electronic device is further installed with a fourth application. The first electronic device may receive the third instruction. The third instruction is used to instruct the first electronic device to call the electronic device to provide the first service through the fourth application. The first electronic device may obtain the first connection information by searching for the connection information including the identifier of the first service from the snapshot information of one session or multiple sessions. The above one or more sessions are created by the first electronic device. The first electronic device may send a fourth instruction to the second electronic device according to the first connection information, create a second session, and store second snapshot information of the second session. The fourth instruction may be used to instruct the second electronic device to provide the first service. The second session is a communication performed by the first electronic device calling one or more electronic devices to provide one or more services through the fourth application. The second snapshot information may include second connection information. The second connection information may include a device identifier of the second electronic device and an identifier of the first service. The second electronic device receives the fourth instruction and provides the first service.
其中,第一电子设备中各会话的存储沙箱是隔离的。例如,上述第一会话的存储沙箱仅能被第一电子设备中的第一应用访问,而不能被第一电子设备中的第四应用访问。第一电子设备可以将各会话的快照信息中的连接信息存储至协同记录存储模块。该协同记录存储模块可以被第一电子设中的一个或多个应用访问。第一电子设备可以将第一会话的存储沙箱中获取第一连接信息,并将第一连接信息存储至协同记录存储模块。第一电子设备通过第一应用调用其它电子设备提供第一服务时,可以从协同记录存储模块查找到包含第一服务的标识的第一连接信息。进一步的,根据第一连接信息,第一电子设备可以通过第四应用调用第二电子设备提供第一服务。Wherein, the storage sandbox of each session in the first electronic device is isolated. For example, the above-mentioned storage sandbox of the first session can only be accessed by the first application in the first electronic device, but cannot be accessed by the fourth application in the first electronic device. The first electronic device may store the connection information in the snapshot information of each session to the collaborative record storage module. The collaborative record storage module can be accessed by one or more applications in the first electronic device. The first electronic device may obtain the first connection information from the storage sandbox of the first session, and store the first connection information in the collaborative record storage module. When the first electronic device invokes other electronic devices to provide the first service through the first application, it may find the first connection information including the identifier of the first service from the collaborative record storage module. Further, according to the first connection information, the first electronic device may call the second electronic device to provide the first service through the fourth application.
不限于查找包含第一服务的标识的连接信息,第一电子设备还可以查找与第一服务的类型相同的服务对应的连接信息。服务的类型可以提供这一项服务需要电子设备所执行的动作的类型。服务的类型可以由服务的标识确定。例如,服务的标识为指示课程视频播放服务的数据。即这一项服务为课程视频播放服务。那么这一项服务的类型可以为视频播放类。第一电子设备可以从协同记录存储模块中查找所有服务的类型为视频播放类的服务对应的连接信息。The search is not limited to connection information including the identifier of the first service, the first electronic device may also search for connection information corresponding to a service of the same type as the first service. The type of service may provide the type of action that this service requires the electronic device to perform. The type of service can be determined by the service's identification. For example, the identifier of the service is the data indicating the course video playing service. That is, this service is a course video playback service. Then the type of this service can be a video playback class. The first electronic device may search the connection information corresponding to all services whose type is video playing from the cooperative record storage module.
上述实施例可以方便用于调用自己习惯的电子设备来协同工作,提供了用户的使用体验。The above-mentioned embodiments can be conveniently used to call the electronic devices that one is used to to work together, and provide user experience.
结合第一方面,在一些实施例中,第一电子设备获取第一会话的第一快照信息之后,可以先判断第二电子设备是否可用。若判断出第二电子设备不可用,第一电子设备可以从搜索到的多个电子设备中选取出第三电子设备,并调用第三电子设备提供第一服务。上述第三电子设备为上述多个被搜索到的电子设备中可用且可提供第一服务的一个电子设备。With reference to the first aspect, in some embodiments, after the first electronic device acquires the first snapshot information of the first session, it may first determine whether the second electronic device is available. If it is determined that the second electronic device is unavailable, the first electronic device may select a third electronic device from the searched multiple electronic devices, and invoke the third electronic device to provide the first service. The third electronic device is an electronic device that is available among the plurality of searched electronic devices and can provide the first service.
其中,第一电子设备可以通过向第二电子设备发送询问消息来确定第二电子设备是否可用。若第一电子设备接收到来自第二电子设备对上述询问消息的应答消息,且该应答消息指示第二电子设备可用,则第一电子设备可以确定第二电子设备可用。否则,第一电子设备确定第二电子设备不可用。Wherein, the first electronic device may determine whether the second electronic device is available by sending an inquiry message to the second electronic device. If the first electronic device receives a response message from the second electronic device to the above inquiry message, and the response message indicates that the second electronic device is available, the first electronic device may determine that the second electronic device is available. Otherwise, the first electronic device determines that the second electronic device is unavailable.
第一电子设备在通过第一应用调用其它电子设备提供第一服务时,除了获取第一会话的第一快照信息,还可以搜索可提供第一服务的电子设备。其中,第一电子设备可以搜索与自己处于同一局域网(例如同一家庭Wi-Fi)的电子设备。即上述被搜索到的多个电子设备与第一电子设备处于同一局域网。When the first electronic device invokes other electronic devices to provide the first service through the first application, in addition to acquiring the first snapshot information of the first session, it may also search for electronic devices that can provide the first service. Wherein, the first electronic device may search for electronic devices in the same local area network (for example, the same home Wi-Fi) as the first electronic device. That is, the plurality of electronic devices found above are in the same local area network as the first electronic device.
在一种可能的实现方式中,第一电子设备具体可以根据第一规则从搜索到的多个电子设备中选取出第三电子设备。其中,第三电子设备为这多个电子设备中可用、可提供第一服务且优先级最高的电子设备。第一规则包括:与第一电子设备的设备账号相同且设备类型相同的电子设备的优先级>与第一电子设备的设备账号相同且设备类型不同的电子设备的优先级>与第一电子设备的设备账号不同但设备类型相同的电子设备的优先级>与第一电子设备的设备账号不同且设备类型不同的电子设备的优先级。In a possible implementation manner, the first electronic device may specifically select the third electronic device from the searched multiple electronic devices according to the first rule. Wherein, the third electronic device is an electronic device that is available among the plurality of electronic devices, can provide the first service, and has the highest priority. The first rule includes: the priority of the electronic device with the same device account and the same device type as the first electronic device> the priority of the electronic device with the same device account as the first electronic device but a different device type> the priority of the electronic device with the same device account as the first electronic device Priorities of electronic devices with different device accounts but the same device type>priorities of electronic devices with different device accounts and different device types from the first electronic device.
可选的,第一电子设备的设备账号相同且设备类型不同的电子设备有多个,或者与第一电子设备的设备账号不同且设备类型不同的电子设备有多个。那么,第一规则还可包括:在设备类型不同的多个电子设备中,电子设备的优先级由电子设备的私密度确定,电子设备的私密度越低,电子设备的优先级越高。电子设备的私密度包括:电视=音箱<平板<手表=手机。Optionally, there are multiple electronic devices with the same device account and different device types of the first electronic device, or multiple electronic devices with different device accounts and different device types from the first electronic device. Then, the first rule may further include: among multiple electronic devices of different device types, the priority of the electronic device is determined by the privacy degree of the electronic device, and the lower the privacy degree of the electronic device, the higher the priority of the electronic device. The privacy of electronic devices includes: TV = speaker < tablet < watch = mobile phone.
第一电子设备调用私密度高的电子设备提供第一服务可能需要用户在私密度高的电子设备上确认。私密度越低的电子设备,排序越靠前。第一电子设备优先选择私密度低的电子设备可以简化连接过程中的用户操作,提高设备连接的效率。The first electronic device calling the electronic device with a high degree of privacy to provide the first service may require the user to confirm on the electronic device with a high degree of privacy. Electronic devices with lower privacy are ranked higher. The first electronic device preferentially selects an electronic device with a low privacy density, which can simplify user operations during the connection process and improve device connection efficiency.
结合第一方面,在一些实施例中,第一电子设备获取第一会话的第一快照信息之后,还可以根据第一连接信息在用户界面显示第二电子设备选项。第一电子设备可以检测到作用于第二电子设备选项的第一用户操作。该第一用户操作用于触发第一电子设备向第二电子设备发送第一指令。响应于该第一用户操作,第一电子设备可以向第二电子设备发送第一指令。With reference to the first aspect, in some embodiments, after the first electronic device obtains the first snapshot information of the first session, it may further display options of the second electronic device on the user interface according to the first connection information. The first electronic device may detect a first user action on an option of the second electronic device. The first user operation is used to trigger the first electronic device to send the first instruction to the second electronic device. In response to the first user operation, the first electronic device may send a first instruction to the second electronic device.
上述第二电子设备选项可以以不同的显示状态显示在用户界面中。具体的,第一电子设备可以判断第二电子设备是否可用。若判断出第二电子设备可用,第一电子设备可将第二电子设备选项显示为第一状态。第一状态用于指示第二电子设备可用。若判断出第二电子设备不可用,第一电子设备可将第二电子设备选项显示为第二状态。第二状态用于指示第二电子设备不可用。The aforementioned second electronic device options may be displayed in the user interface in different display states. Specifically, the first electronic device may determine whether the second electronic device is available. If it is determined that the second electronic device is available, the first electronic device may display the options of the second electronic device in the first state. The first state is used to indicate that the second electronic device is available. If it is determined that the second electronic device is unavailable, the first electronic device may display the options of the second electronic device as a second state. The second state is used to indicate that the second electronic device is unavailable.
结合第一方面,在一些实施例中,一个会话对应的通信系统可以包括多级连接。创建这一个会话的电子设备可以存储这多级连接中每个节点之间的连接信息,并将这些连接信息存储至这一个会话的存储沙箱中。根据这些连接信息,创建这一个会话的电子设备可以恢复这多级连接。With reference to the first aspect, in some embodiments, a communication system corresponding to a session may include multi-level connections. The electronic device that creates the session can store the connection information between each node in the multi-level connection, and store the connection information in the storage sandbox of the session. According to the connection information, the electronic device that created the session can restore the multi-level connection.
具体的,通信系统还可包括第四电子设备。第四电子设备安装有用于提供第二服务的应用。第一快照信息包括第三连接信息。第三连接信息包括源设备信息和目的设备信息。第三连接信息中的源设备信息包括第二电子设备的设备标识、第一服务的标识。第三连接信息中的目的设备信息包括第四电子设备的设备标识、第二服务的标识。第一电子设备获取第一会话的第一快照信息之后,第一电子设备可以将第三连接信息发送给第二电子设备。第二电子设备可以根据第三连接信息,利用提供第一服务的应用向第四电子设备发送第五指令。第五指令用于指示第四电子设备提供第二服务。第四电子设备接收到第五指令,提供第二服务。Specifically, the communication system may further include a fourth electronic device. The fourth electronic device is installed with an application for providing the second service. The first snapshot information includes third connection information. The third connection information includes source device information and destination device information. The source device information in the third connection information includes the device identifier of the second electronic device and the identifier of the first service. The destination device information in the third connection information includes the device identifier of the fourth electronic device and the identifier of the second service. After the first electronic device obtains the first snapshot information of the first session, the first electronic device may send the third connection information to the second electronic device. The second electronic device may use the application providing the first service to send the fifth instruction to the fourth electronic device according to the third connection information. The fifth instruction is used to instruct the fourth electronic device to provide the second service. The fourth electronic device receives the fifth instruction and provides the second service.
源设备可以为调用其它电子设备提供服务的电子设备。目的设备可以为接收到调用指令提供服务的电子设备。The source device may be an electronic device that invokes services provided by other electronic devices. The destination device may be an electronic device that receives the calling instruction and provides services.
结合第一方面,在一些实施例中,第二电子设备接收到第六指令。第六指令用于指示第二电子设备通过提供第一服务运行的应用调用第四电子设备提供第二服务。第二电子设备根据第六指令向第四电子设备发送上述第五指令。With reference to the first aspect, in some embodiments, the second electronic device receives the sixth instruction. The sixth instruction is used to instruct the second electronic device to call the fourth electronic device to provide the second service through the running application providing the first service. The second electronic device sends the fifth instruction to the fourth electronic device according to the sixth instruction.
若第二电子设备判断出自己开启提供第一服务的应用的方式为主动开启,第二电子设备创建第三会话,并存储第三会话的第三快照信息。主动开启表示电子设备接收到作用在一个应用上用于开启这一个应用的用户操作,而开启这一个应用。第三会话为第二电子设备通过提供第一服务的应用调用一个或多个电子设备提供一项或多项服务所进行的通信,第三快照信息包括第三连接信息。其中,第二电子设备可以为上述第三会话分配存储沙箱,来存储上述第三快照信息。If the second electronic device determines that the way to open the application providing the first service is actively opening, the second electronic device creates a third session and stores third snapshot information of the third session. Active opening means that the electronic device receives a user operation acting on an application to open the application, and starts the application. The third session is a communication in which the second electronic device invokes one or more electronic devices to provide one or more services through the application providing the first service, and the third snapshot information includes third connection information. Wherein, the second electronic device may assign a storage sandbox to the third session to store the third snapshot information.
若第二电子设备判断出自己开启提供第一服务的应用的方式为被动开启,第二电子设备将第三连接信息发送给第一电子设备。第一电子设备在第一会话的存储沙箱中存储第三连接信息。被动开启表示电子设备接收到其它电子设备用于提供一项服务的调用指令,而开启用于提供这一项服务的应用。If the second electronic device determines that the mode of opening the application providing the first service is passive opening, the second electronic device sends the third connection information to the first electronic device. The first electronic device stores the third connection information in the storage sandbox of the first session. Passive opening means that the electronic device receives an invocation instruction for providing a service from another electronic device, and starts an application for providing the service.
由上述实施例可知,第一电子设备可以通过第一应用调用第二电子设备提供第一服务。在第二电子设备被第一电子设备调用提供第一服务的基础上,第二电子设备通过提供第一服务的应用调用第四电子设备提供第四服务。其中,第一电子设备可以将第一会话的第一会话标识传递给第二电子设备。第二电子设备将第一会话的会话标识传递给第四电子设备。第二电子设备可以将自己与第四电子设备的连接信息发送给第一电子设备。第一电子设备可以跟自己存储的连接信息恢复自己与第二电子设备的连接关系,以及第二电子设备与第四电子设 备的连接关系。上述方法可以快速建立多个电子设备之间的连接关系。用户可以不用在多个电子设备上分别进行操作,这不仅简化了多个电子设备建立连接时的用户操作,还方便用户调用自己习惯的电子设备,更快地进入到熟悉的应用场景,提高了用户体验。It can be seen from the foregoing embodiments that the first electronic device may call the second electronic device to provide the first service through the first application. On the basis that the second electronic device is invoked by the first electronic device to provide the first service, the second electronic device invokes the fourth electronic device to provide the fourth service through the application providing the first service. Wherein, the first electronic device may transfer the first session identifier of the first session to the second electronic device. The second electronic device transmits the session identifier of the first session to the fourth electronic device. The second electronic device may send the connection information between itself and the fourth electronic device to the first electronic device. The first electronic device can restore the connection relationship between itself and the second electronic device, and the connection relationship between the second electronic device and the fourth electronic device based on the connection information stored by itself. The above method can quickly establish the connection relationship between multiple electronic devices. Users do not need to operate on multiple electronic devices separately, which not only simplifies the user operations when multiple electronic devices are connected, but also facilitates users to call their accustomed electronic devices and enter familiar application scenarios faster, improving the user experience. user experience.
在上述实施例中,第二电子设备发送给第四电子设备的第五指令可包括提供第二服务的应用(如第五应用)的应用标识。那么,第四电子设备根据第五指令,运行第五应用来提供第二服务。In the foregoing embodiment, the fifth instruction sent by the second electronic device to the fourth electronic device may include an application identifier of an application (such as a fifth application) that provides the second service. Then, the fourth electronic device runs the fifth application to provide the second service according to the fifth instruction.
结合第一方面,在一些实施例中,第一快照信息还包括第四连接信息,第四连接信息包括源设备信息和目的设备信息,第四连接信息中的源设备信息包括第二电子设备的设备标识、第一服务的标识,第四连接信息中的目的设备信息包括第一电子设备的设备标识、第一应用的应用标识。第一电子设备获取第一会话的第一快照信息之后,第一电子设备可以将第四连接信息发送给第二电子设备。第二电子设备根据第四连接信息,利用提供第一服务的应用向第一电子设备发送第七指令,第七指令用于指示第一电子设备调用第一应用。第一电子设备比较自己的第一层级标识和第二电子设备的第二层级标识,确定第一层级标识低于第二层级标识,第一电子设备拒绝响应第七指令。一个会话中的一个电子设备具有层级标识,一个电子设备的层级标识由一个电子设备与创建一个会话的电子设备之间的连接距离确定,与创建一个会话的电子设备之间的连接距离越远,一个电子设备的层级标识越高。With reference to the first aspect, in some embodiments, the first snapshot information further includes fourth connection information, the fourth connection information includes source device information and destination device information, and the source device information in the fourth connection information includes the information of the second electronic device. The device identifier, the identifier of the first service, and the destination device information in the fourth connection information include the device identifier of the first electronic device and the application identifier of the first application. After the first electronic device acquires the first snapshot information of the first session, the first electronic device may send fourth connection information to the second electronic device. According to the fourth connection information, the second electronic device uses the application providing the first service to send a seventh instruction to the first electronic device, where the seventh instruction is used to instruct the first electronic device to invoke the first application. The first electronic device compares its first-level identification with the second-level identification of the second electronic device, determines that the first-level identification is lower than the second-level identification, and the first electronic device refuses to respond to the seventh instruction. An electronic device in a session has a hierarchical identification, and the hierarchical identification of an electronic device is determined by the connection distance between an electronic device and the electronic device that creates a session, and the farther the connection distance from the electronic device that creates a session, The higher the level identification of an electronic device is.
由上述实施例可知,第一电子设备通过第一应用调用第二电子设备提供第二服务,而第二电子设备又通过提供第二服务的应用调用第一电子设备运行第一应用。上述循环调用的问题可能导致两个电子设备之间的连接信息在这两个设备之间循环传递,浪费这两个电子设备的计算资源和存储资源。而上述实施例可以避免一个会话中的电子设备之间出现循环调用的问题,实现了对电子设备计算资源和存储资源的节约。It can be known from the above embodiments that the first electronic device invokes the second electronic device to provide the second service through the first application, and the second electronic device invokes the first electronic device to run the first application through the application providing the second service. The above problem of cyclic calling may cause the connection information between the two electronic devices to be cyclically transmitted between the two devices, wasting computing resources and storage resources of the two electronic devices. However, the above-mentioned embodiment can avoid the problem of cyclic calling between electronic devices in a session, and save computing resources and storage resources of electronic devices.
第二方面,本申请提供一种基于应用的设备连接关系建立方法。其中,第一电子设备获取第一会话的第一快照信息,第一电子设备安装有第一应用,第一会话为第一电子设备通过第一应用调用一个或多个电子设备提供一项或多项服务所进行的通信,第一快照信息包括第一连接信息,第一连接信息包括第二电子设备的设备标识、第一服务的标识。第二电子设备安装有用于提供第一服务的应用。第一电子设备根据第一连接信息向第二电子设备发送第一指令,第一指令用于指示第二电子设备提供第一服务。In a second aspect, the present application provides an application-based method for establishing a device connection relationship. Wherein, the first electronic device acquires the first snapshot information of the first session, the first electronic device is installed with the first application, and the first session provides one or more items for the first electronic device to call one or more electronic devices through the first application For communications performed by a service, the first snapshot information includes first connection information, and the first connection information includes a device identifier of the second electronic device and an identifier of the first service. The second electronic device is installed with an application for providing the first service. The first electronic device sends a first instruction to the second electronic device according to the first connection information, where the first instruction is used to instruct the second electronic device to provide the first service.
结合第二方面,在一些实施例中,第一电子设备接收到第二指令,第二指令用于指示第一电子设备通过第一应用调用第二电子设备提供第一服务。第一电子设备可以创建第一会话,并在第一会话的存储沙箱中存储第一快照信息。第一电子设备可以根据第二指令向第二电子设备发送第一指令。With reference to the second aspect, in some embodiments, the first electronic device receives a second instruction, and the second instruction is used to instruct the first electronic device to call the second electronic device to provide the first service through the first application. The first electronic device may create a first session, and store first snapshot information in a storage sandbox of the first session. The first electronic device may send the first instruction to the second electronic device according to the second instruction.
由上述实施例可以看出,第一电子设备首次通过第一应用调用第二电子设备提供第一服务时,可以存储第一电子设备和第二电子设备之间的第一连接信息。当第一电子设备再次通过第一应用调用其它电子设备提供第一服务时,第一电子设备可以根据上述第一连接信息调用第二电子设备提供第一服务。上述方法可以快速建立多个电子设备之间的连接关系。用户可以不用在多个电子设备上分别进行操作,这简化了多个电子设备建立连接时的用户操作。It can be seen from the above embodiments that when the first electronic device invokes the second electronic device to provide the first service through the first application for the first time, it may store the first connection information between the first electronic device and the second electronic device. When the first electronic device calls another electronic device to provide the first service again through the first application, the first electronic device may call the second electronic device to provide the first service according to the first connection information. The above method can quickly establish the connection relationship between multiple electronic devices. The user does not need to perform operations on multiple electronic devices separately, which simplifies user operations when multiple electronic devices are connected.
结合第二方面,在一些实施例中,第一会话具有第一会话标识,第一会话标识由第一电子设备的设备账号和第一应用的应用标识确定。第一会话标识可用于第一电子设备获取第一快照信息。第一指令可包含第一会话标识。With reference to the second aspect, in some embodiments, the first session has a first session identifier, and the first session identifier is determined by a device account of the first electronic device and an application identifier of the first application. The first session identifier can be used by the first electronic device to acquire the first snapshot information. The first instruction may include a first session identification.
结合第二方面,在一些实施例中,第二电子设备安装有第二应用。第二应用用于提供第一服务。第一连接信息还包括第二应用的应用标识。第一指令用于指示第二电子设备运行第 二应用来提供第一服务。With reference to the second aspect, in some embodiments, the second electronic device is installed with the second application. The second application is used to provide the first service. The first connection information also includes an application identifier of the second application. The first instruction is used to instruct the second electronic device to run the second application to provide the first service.
结合第二方面,在一些实施例中,第一电子设备接收并存储第二电子设备发送的第一活动信息,第一活动信息包含于第一快照信息。第一活动信息包括第二电子设备提供第一服务的过程中用于指示提供第一服务的应用的用户界面在第一时刻呈现内容的数据。第一时刻为第二电子设备提供第一服务的过程中的任一时刻。With reference to the second aspect, in some embodiments, the first electronic device receives and stores the first activity information sent by the second electronic device, and the first activity information is included in the first snapshot information. The first activity information includes data for instructing the user interface of the application providing the first service to present content at the first moment during the process of the second electronic device providing the first service. The first moment is any moment in the process of providing the first service by the second electronic device.
结合第二方面,在一些实施例中,第一电子设备获取第一会话的第一快照信息之后,可以将第一快照信息中的第一活动信息发送给第二电子设备。第一活动信息用于确定第二电子设备在运行提供第一服务的应用初始时刻应用的用户界面的呈现内容。With reference to the second aspect, in some embodiments, after the first electronic device obtains the first snapshot information of the first session, it may send the first activity information in the first snapshot information to the second electronic device. The first activity information is used to determine the presentation content of the user interface applied by the second electronic device at the initial moment of running the application providing the first service.
结合第二方面,在一些实施例中,第一电子设备在首次通过一个应用调用其它电子设备提供一项服务时,第一电子设备可以查找自己是否通过其它应用调用其它电子设备提供与上述一项服务同类型的服务。若查找到,第一电子设备可以推荐通过上述通过其它应用调用其它电子设备提供与上述一项服务同类型的服务对应的连接关系。In combination with the second aspect, in some embodiments, when the first electronic device calls other electronic devices to provide a service through an application for the first time, the first electronic device can check whether it calls other electronic devices through other applications to provide a service related to the above-mentioned one. Services of the same type. If found, the first electronic device may recommend calling other electronic devices through other applications to provide a connection relationship corresponding to a service of the same type as the above-mentioned service.
具体的,第一电子设备还安装有第四应用。第一电子设备接收到第三指令,第三指令用于指示第一电子设备通过第四应用调用电子设备提供第一服务。第一电子设备从一个会话或多个会话的快照信息中查找包含第一服务的标识的连接信息,得到第一连接信息。一个会话或多个会话是第一电子设备创建的。第一电子设备根据第一连接信息向第二电子设备发送第四指令,并创建第二会话,存储第二会话的第二快照信息。第二快照信息可以存储在第二会话的存储沙箱中。第四指令用于指示第二电子设备提供第一服务。第二会话为第一电子设备通过第四应用调用一个或多个电子设备提供一项或多项服务所进行的通信。第二快照信息包括第二连接信息,第二连接信息包括第二电子设备的设备标识、第一服务的标识。Specifically, the first electronic device is further installed with a fourth application. The first electronic device receives the third instruction, and the third instruction is used to instruct the first electronic device to call the electronic device to provide the first service through the fourth application. The first electronic device searches for the connection information including the identifier of the first service from the snapshot information of one session or multiple sessions, and obtains the first connection information. The session or sessions are created by the first electronic device. The first electronic device sends a fourth instruction to the second electronic device according to the first connection information, creates a second session, and stores second snapshot information of the second session. The second snapshot information may be stored in the storage sandbox of the second session. The fourth instruction is used to instruct the second electronic device to provide the first service. The second session is a communication performed by the first electronic device calling one or more electronic devices to provide one or more services through the fourth application. The second snapshot information includes second connection information, and the second connection information includes a device identifier of the second electronic device and an identifier of the first service.
结合第二方面,在一些实施例中,第一电子设备获取第一会话的第一快照信息之后,可以判断第二电子设备是否可用。若判断出第二电子设备不可用,第一电子设备从搜索到的多个电子设备中选取出第三电子设备,并调用第三电子设备提供第一服务。第三电子设备为多个电子设备中可用且可提供第一服务的一个电子设备。With reference to the second aspect, in some embodiments, after the first electronic device obtains the first snapshot information of the first session, it may determine whether the second electronic device is available. If it is determined that the second electronic device is unavailable, the first electronic device selects a third electronic device from the searched multiple electronic devices, and invokes the third electronic device to provide the first service. The third electronic device is an electronic device that is available among the plurality of electronic devices and can provide the first service.
结合第二方面,在一些实施例中,第一电子设备可以根据第一规则从搜索到的多个电子设备中选取出第三电子设备。第三电子设备为被搜索到的多个电子设备中可用、可提供第一服务且优先级最高的电子设备。第一规则包括:与第一电子设备的设备账号相同且设备类型相同的电子设备的优先级>与第一电子设备的设备账号相同且设备类型不同的电子设备的优先级>与第一电子设备的设备账号不同但设备类型相同的电子设备的优先级>与第一电子设备的设备账号不同且设备类型不同的电子设备的优先级。With reference to the second aspect, in some embodiments, the first electronic device may select the third electronic device from the searched multiple electronic devices according to the first rule. The third electronic device is an electronic device that is available among the searched multiple electronic devices, can provide the first service, and has the highest priority. The first rule includes: the priority of the electronic device with the same device account and the same device type as the first electronic device> the priority of the electronic device with the same device account as the first electronic device but a different device type> the priority of the electronic device with the same device account as the first electronic device Priorities of electronic devices with different device accounts but the same device type>priorities of electronic devices with different device accounts and different device types from the first electronic device.
结合第二方面,在一些实施例中,第一电子设备的设备账号相同且设备类型不同的电子设备有多个,或者与第一电子设备的设备账号不同且设备类型不同的电子设备有多个。第一规则还包括:在设备类型不同的多个电子设备中,电子设备的优先级由电子设备的私密度确定,电子设备的私密度越低,电子设备的优先级越高。电子设备的私密度包括:电视=音箱<平板<手表=手机。With reference to the second aspect, in some embodiments, there are multiple electronic devices with the same device account and different device types of the first electronic device, or there are multiple electronic devices with different device accounts and different device types from the first electronic device . The first rule further includes: among multiple electronic devices of different device types, the priority of the electronic device is determined by the privacy degree of the electronic device, and the lower the privacy degree of the electronic device, the higher the priority of the electronic device. The privacy of electronic devices includes: TV = speaker < tablet < watch = mobile phone.
结合第二方面,在一些实施例中,第一电子设备获取第一会话的第一快照信息之后,可以根据第一快照信息中的第一连接信息在用户界面显示第二电子设备选项。第一电子设备检测到作用于第二电子设备选项的第一用户操作,第一用户操作用于触发第一电子设备向第二电子设备发送第一指令。With reference to the second aspect, in some embodiments, after the first electronic device obtains the first snapshot information of the first session, it may display options of the second electronic device on the user interface according to the first connection information in the first snapshot information. The first electronic device detects a first user operation acting on an option of the second electronic device, and the first user operation is used to trigger the first electronic device to send a first instruction to the second electronic device.
上述第二电子设备选项可以以不同的显示状态显示在用户界面中。具体的,第一电子设备可以判断第二电子设备是否可用。若判断出第二电子设备可用,第一电子设备可将第二电 子设备选项显示为第一状态。第一状态用于指示第二电子设备可用。若判断出第二电子设备不可用,第一电子设备可将第二电子设备选项显示为第二状态。第二状态用于指示第二电子设备不可用。The aforementioned second electronic device options may be displayed in the user interface in different display states. Specifically, the first electronic device may determine whether the second electronic device is available. If it is determined that the second electronic device is available, the first electronic device may display the second electronic device option as the first state. The first state is used to indicate that the second electronic device is available. If it is determined that the second electronic device is unavailable, the first electronic device may display the options of the second electronic device as a second state. The second state is used to indicate that the second electronic device is unavailable.
结合第二方面,在一些实施例中,第一快照信息还包括第三连接信息,第三连接信息包括源设备信息和目的设备信息,第三连接信息中的源设备信息包括第二电子设备的设备标识、第一服务的标识,第三连接信息中的目的设备信息包括第四电子设备的设备标识、第二服务的标识。第四电子设备安装有用于提供第二服务的应用。第一电子设备获取第一会话的第一快照信息之后,可以将第一快照信息中的第三连接信息方给第二电子设备。第三连接信息使得第二电子设备通过提供第一服务的应用向第四电子设备发送第五指令,第五指令用于指示第四电子设备提供第二服务。With reference to the second aspect, in some embodiments, the first snapshot information further includes third connection information, the third connection information includes source device information and destination device information, and the source device information in the third connection information includes the information of the second electronic device. The device identifier, the identifier of the first service, and the destination device information in the third connection information include the device identifier of the fourth electronic device and the identifier of the second service. The fourth electronic device is installed with an application for providing the second service. After the first electronic device obtains the first snapshot information of the first session, it may send the third connection information in the first snapshot information to the second electronic device. The third connection information enables the second electronic device to send a fifth instruction to the fourth electronic device through the application providing the first service, where the fifth instruction is used to instruct the fourth electronic device to provide the second service.
上述方法可以快速建立多个电子设备之间的连接关系。用户可以不用在多个电子设备上分别进行操作,这不仅简化了多个电子设备建立连接时的用户操作,还方便用户调用自己习惯的电子设备,更快地进入到熟悉的应用场景,提高了用户体验。The above method can quickly establish the connection relationship between multiple electronic devices. Users do not need to operate on multiple electronic devices separately, which not only simplifies the user operations when multiple electronic devices are connected, but also facilitates users to call their accustomed electronic devices and enter familiar application scenarios faster, improving the user experience. user experience.
结合第二方面,在一些实施例中,第一快照信息还包括第四连接信息。第四连接信息包括源设备信息和目的设备信息,第四连接信息中的源设备信息包括第二电子设备的设备标识、第一服务的标识,第四连接信息中的目的设备信息包括第一电子设备的设备标识、第一应用的应用标识。第一电子设备获取第一会话的第一快照信息之后,可以将第四连接信息发送给第二电子设备。第四连接信息使得第二电子设备通过提供第一服务的应用向第一电子设备发送第七指令,第七指令用于指示第一电子设备调用第一应用。第一电子设备接收到第七指令,比较自己的第一层级标识和第二电子设备的第二层级标识,确定第一层级标识低于第二层级标识,第一电子设备拒绝响应第七指令。一个会话中的一个电子设备具有层级标识,一个电子设备的层级标识由一个电子设备与创建一个会话的电子设备之间的连接距离确定,与创建一个会话的电子设备之间的连接距离越远,一个电子设备的层级标识越高。With reference to the second aspect, in some embodiments, the first snapshot information further includes fourth connection information. The fourth connection information includes source device information and destination device information. The source device information in the fourth connection information includes the device identifier of the second electronic device and the identifier of the first service. The destination device information in the fourth connection information includes the first electronic The device identifier of the device and the application identifier of the first application. After the first electronic device obtains the first snapshot information of the first session, it may send the fourth connection information to the second electronic device. The fourth connection information enables the second electronic device to send a seventh instruction to the first electronic device through the application providing the first service, and the seventh instruction is used to instruct the first electronic device to invoke the first application. The first electronic device receives the seventh instruction, compares its own first-level identification with the second-level identification of the second electronic device, determines that the first-level identification is lower than the second-level identification, and the first electronic device refuses to respond to the seventh instruction. An electronic device in a session has a hierarchical identification, and the hierarchical identification of an electronic device is determined by the connection distance between an electronic device and the electronic device that creates a session, and the farther the connection distance from the electronic device that creates a session, The higher the level identification of an electronic device is.
由上述实施例可知,第一电子设备通过第一应用调用第二电子设备提供第二服务,而第二电子设备又通过提供第二服务的应用调用第一电子设备运行第一应用。上述循环调用的问题可能导致两个电子设备之间的连接信息在这两个设备之间循环传递,浪费这两个电子设备的计算资源和存储资源。而上述实施例可以避免一个会话中的电子设备之间出现循环调用的问题,实现了对电子设备计算资源和存储资源的节约。It can be known from the above embodiments that the first electronic device invokes the second electronic device to provide the second service through the first application, and the second electronic device invokes the first electronic device to run the first application through the application providing the second service. The above problem of cyclic calling may cause the connection information between the two electronic devices to be cyclically transmitted between the two devices, wasting computing resources and storage resources of the two electronic devices. However, the above-mentioned embodiment can avoid the problem of cyclic calling between electronic devices in a session, and save computing resources and storage resources of electronic devices.
第三方面,本申请提供一种基于应用的设备连接关系建立方法。其中,第二电子设备可以接收到来自第一电子设备的第一指令。第二电子设备安装有用于提供第一服务的应用。第一指令用于指示第二电子设备提供第一服务。第一指令是第一电子设备根据第一连接信息发送的。第一连接信息包括第二电子设备的设备标识、第一服务的服务标识。第一连接信息包含于第一会话的第一快照信息。第一电子设备安装有第一应用。第一会话为第一电子设备通过第一应用调用一个或多个电子设备提供一项或多项服务所进行的通信。根据第一指令,第二电子设备可以提供第一服务。In a third aspect, the present application provides an application-based method for establishing a device connection relationship. Wherein, the second electronic device may receive the first instruction from the first electronic device. The second electronic device is installed with an application for providing the first service. The first instruction is used to instruct the second electronic device to provide the first service. The first instruction is sent by the first electronic device according to the first connection information. The first connection information includes the device identifier of the second electronic device and the service identifier of the first service. The first connection information is included in the first snapshot information of the first session. The first electronic device is installed with a first application. The first session is a communication in which the first electronic device invokes one or more electronic devices to provide one or more services through the first application. According to the first instruction, the second electronic device may provide the first service.
结合第三方面,在一些实施例中,第二电子设备中安装有第二应用。第二应用用于提供第一服务。上述第一连接信息还包括第二应用的应用标识。第一指令可用于指示第二电子设备运行第二应用来提供第一服务。当接收到第二指令,第二电子设备可以运行第二应用,提供第一服务。With reference to the third aspect, in some embodiments, the second electronic device is installed with the second application. The second application is used to provide the first service. The above-mentioned first connection information also includes the application identifier of the second application. The first instruction may be used to instruct the second electronic device to run the second application to provide the first service. When receiving the second instruction, the second electronic device can run the second application to provide the first service.
结合第三方面,在一些实施例中,第二电子设备安装有第二应用和第三应用。第二应用和第三应用均用于提供第一服务。第二电子设备接收到第一指令之后,可以判断第二应用是 否可用。若判断出第二应用可用,第二电子设备运行第二应用,提供第一服务。若判断出第二应用不可用,第二电子设备判断第三应用是否可用。若判断出第三应用可用,第二电子设备运行第三应用,提供第一服务。With reference to the third aspect, in some embodiments, the second electronic device is installed with the second application and the third application. Both the second application and the third application are used to provide the first service. After receiving the first instruction, the second electronic device can determine whether the second application is available. If it is determined that the second application is available, the second electronic device runs the second application to provide the first service. If it is determined that the second application is unavailable, the second electronic device determines whether the third application is available. If it is determined that the third application is available, the second electronic device runs the third application to provide the first service.
结合第三方面,在一些实施例中,第二电子设备提供第一服务之后,可以将提供第一服务的应用(如第二应用或第三应用)的第一活动信息发送给第一电子设备。其中,第一活动信息包括第一服务被提供过程中用于指示提供第一服务的应用的用户界面在第一时刻呈现内容的数据。第一时刻为第一服务被提供过程中的任一时刻。With reference to the third aspect, in some embodiments, after the second electronic device provides the first service, it may send the first activity information of the application providing the first service (such as the second application or the third application) to the first electronic device . Wherein, the first activity information includes data for instructing the user interface of the application providing the first service to present content at the first moment during the process of providing the first service. The first moment is any moment when the first service is provided.
结合第三方面,在一些实施例中,除了上述第一指令,第二电子设备还可以接收到第一电子设备发送的第一活动信息。根据第一活动信息,第二电子设备可以确定在运行用于提供第一服务的应用初始时刻该应用的用户界面的呈现内容。With reference to the third aspect, in some embodiments, in addition to the above first instruction, the second electronic device may also receive the first activity information sent by the first electronic device. According to the first activity information, the second electronic device may determine the presentation content of the user interface of the application at the initial moment of running the application for providing the first service.
结合第三方面,在一些实施例中,除了上述第一指令,第二电子设备还可以接收到第一电子设备发送的第三连接信息。第三连接信息包括源设备信息和目的设备信息。第三连接信息中的源设备信息包括第二电子设备的设备标识、第一服务的标识。第三连接信息中的目的设备信息包括第四电子设备的设备标识、第二服务的标识。第四电子设备安装有用于提供第二服务的应用。根据第三连接信息,第二电子设备可以利用提供第一服务的应用向第四电子设备发送第五指令。第五指令用于指示第三电子设备提供第二服务。With reference to the third aspect, in some embodiments, in addition to the above first instruction, the second electronic device may also receive third connection information sent by the first electronic device. The third connection information includes source device information and destination device information. The source device information in the third connection information includes the device identifier of the second electronic device and the identifier of the first service. The destination device information in the third connection information includes the device identifier of the fourth electronic device and the identifier of the second service. The fourth electronic device is installed with an application for providing the second service. According to the third connection information, the second electronic device may use the application providing the first service to send the fifth instruction to the fourth electronic device. The fifth instruction is used to instruct the third electronic device to provide the second service.
结合第三方面,在一些实施例中,第二电子设备接收到第六指令,第六指令用于指示第二电子设备通过提供第一服务运行的应用调用第四电子设备提供第二服务。第二电子设备根据第六指令向第四电子设备发送第五指令。若第二电子设备判断出自己开启提供第一服务的应用的方式为主动开启,第二电子设备创建第三会话,并存储第三会话的第三快照信息;主动开启表示电子设备接收到作用在一个应用上用于开启这一个应用的用户操作,而开启这一个应用。第三会话为第二电子设备通过提供第一服务的应用调用一个或多个电子设备提供一项或多项服务所进行的通信,第三快照信息包括第三连接信息。若第二电子设备判断出自己开启提供第一服务的应用的方式为被动开启,第二电子设备将第三连接信息发送给第一电子设备。被动开启表示电子设备接收到其它电子设备用于提供一项服务的调用指令,而开启用于提供这一项服务的应用。With reference to the third aspect, in some embodiments, the second electronic device receives a sixth instruction, and the sixth instruction is used to instruct the second electronic device to call the fourth electronic device to provide the second service through the running application providing the first service. The second electronic device sends the fifth instruction to the fourth electronic device according to the sixth instruction. If the second electronic device determines that the way to open the application providing the first service is active opening, the second electronic device creates a third session and stores the third snapshot information of the third session; A user operation on an application for opening the application, and the application is opened. The third session is a communication in which the second electronic device invokes one or more electronic devices to provide one or more services through the application providing the first service, and the third snapshot information includes third connection information. If the second electronic device determines that the mode of opening the application providing the first service is passive opening, the second electronic device sends the third connection information to the first electronic device. Passive opening means that the electronic device receives an invocation instruction for providing a service from another electronic device, and starts an application for providing the service.
上述实施例可以快速建立多个电子设备之间的连接关系。用户可以不用在多个电子设备上分别进行操作,这不仅简化了多个电子设备建立连接时的用户操作,还方便用户调用自己习惯的电子设备,更快地进入到熟悉的应用场景,提高了用户体验。The foregoing embodiments can quickly establish connection relationships among multiple electronic devices. Users do not need to operate on multiple electronic devices separately, which not only simplifies the user operations when multiple electronic devices are connected, but also facilitates users to call their accustomed electronic devices and enter familiar application scenarios faster, improving the user experience. user experience.
第四方面,本申请提供一种通信系统。该通信系统至少包括第一电子设备、第二电子设备。其中,第一电子设备、第二电子设备配合执行如第一方面中任一可能的实现方式。In a fourth aspect, the present application provides a communication system. The communication system includes at least a first electronic device and a second electronic device. Wherein, the first electronic device and the second electronic device cooperate to implement any possible implementation manner in the first aspect.
第五方面,本申请提供一种电子设备。该电子设备包括:通信装置、存储器、处理器。存储器可用于存储计算机程序,处理器可用于调用计算机程序,使得电子设备执行如第二方面或第三方面中任一可能的实现方式。In a fifth aspect, the present application provides an electronic device. The electronic equipment includes: a communication device, a memory, and a processor. The memory can be used to store computer programs, and the processor can be used to invoke computer programs, so that the electronic device executes any possible implementation manner as in the second aspect or the third aspect.
第六方面,本申请提供一种芯片,该芯片应用于电子设备,该芯片包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行如第一方面或第二方面中任一可能的实现方式。In a sixth aspect, the present application provides a chip, the chip is applied to an electronic device, the chip includes one or more processors, and the processor is used to invoke computer instructions so that the electronic device executes the electronic device as described in the first aspect or the second aspect. any possible implementation.
第七方面,本申请提供一种包含指令的计算机程序产品,其特征在于,当上述计算机程序产品在电子设备上运行时,使得该电子设备执行如第一方面或第二方面中任一可能的实现方式。In the seventh aspect, the present application provides a computer program product containing instructions, which is characterized in that, when the above-mentioned computer program product is run on an electronic device, the electronic device is made to execute any of the possible steps in the first aspect or the second aspect. Method to realize.
第八方面,本申请提供一种计算机可读存储介质,包括指令,其特征在于,当上述指令 在电子设备上运行时,使得该电子设备执行如第一方面或第二方面中任一可能的实现方式。In an eighth aspect, the present application provides a computer-readable storage medium, including instructions, which is characterized in that, when the above-mentioned instructions are run on an electronic device, the electronic device is made to perform any possible operation according to the first aspect or the second aspect. Method to realize.
可以理解地,上述第四方面提供的通信系统、第五方面提供的电子设备、第六方面提供的芯片、第七方面提供的计算机程序产品和第八方面提供的计算机可读存储介质均用于执行本申请实施例所提供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。Understandably, the communication system provided by the fourth aspect, the electronic device provided by the fifth aspect, the chip provided by the sixth aspect, the computer program product provided by the seventh aspect, and the computer-readable storage medium provided by the eighth aspect are all used for Execute the method provided in the embodiment of this application. Therefore, the beneficial effects that it can achieve can refer to the beneficial effects in the corresponding method, and will not be repeated here.
附图说明Description of drawings
图1是本申请实施例提供的一种分布式应用的结构示意图;FIG. 1 is a schematic structural diagram of a distributed application provided by an embodiment of the present application;
图2A~图2I是本申请实施例提供的一些电子设备建立连接关系的场景示意图;FIG. 2A-FIG. 2I are schematic diagrams of scenarios in which some electronic devices establish connection relationships provided by the embodiments of the present application;
图3A~图3F是本申请实施例提供的另一些电子设备建立连接关系的场景示意图;FIG. 3A-FIG. 3F are schematic diagrams of other electronic devices establishing connection relationships provided by the embodiments of the present application;
图4A~图4D是本申请实施例提供的另一些电子设备建立连接关系的场景示意图;FIG. 4A-FIG. 4D are schematic diagrams of other electronic devices establishing connection relationships provided by the embodiments of the present application;
图5A~图5D是本申请实施例提供的另一些电子设备建立连接关系的场景示意图;5A to 5D are schematic diagrams of other electronic devices establishing connection relationships provided by the embodiments of the present application;
图6~图10是本申请实施例提供的一些通信系统的结构示意图;6 to 10 are schematic structural diagrams of some communication systems provided by the embodiments of the present application;
图11是本申请实施例提供的一种电子设备的结构示意图。FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. Among them, in the description of the embodiments of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in the text is only a description of associated objects The association relationship indicates that there may be three kinds of relationships, for example, A and/or B, which may indicate: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiment of the present application , "plurality" means two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as implying or implying relative importance or implicitly specifying the quantity of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, the "multiple" The meaning is two or more.
本申请提供一种基于应用的设备连接关系建立方法。在该方法中,电子设备100在首次通过应用A与其它电子设备建立通信连接,并请求上述其它电子设备协同工作以实现应用场景A之后,可以存储电子设备100与上述其它电子设备的连接信息。上述连接信息可包括在上述协同工作过程中电子设备100的设备标识、与电子设备100连接的电子设备的设备标识、与电子设备100连接的电子设备在协同工作过程中各自调用的应用标识。当电子设备100再次通过应用A请求电子设备协同工作以实现上述应用场景A时,电子设备100可以根据自己存储的上述连接信息与历史协同设备建立通信连接,并指示历史协同设备调用在曾经实现应用场景A时各自调用的应用。上述历史协同设备即为上述与电子设备100曾经建立过通信连接并协同工作实现应用场景A的电子设备。可以看出,上述方法可以快速建立多个电子设备之间的连接关系。用户可以只需要在电子设备100上进行操作,而不用分别在多个电子设备上进行操作,来建立这多个电子设备的连接关系。这简化了多个电子设备建立连接时的用户操作。The present application provides an application-based method for establishing a device connection relationship. In this method, the electronic device 100 may store connection information between the electronic device 100 and the other electronic device after first establishing a communication connection with the other electronic device through the application A and requesting the other electronic device to work together to realize the application scenario A. The connection information may include the device ID of the electronic device 100 during the collaborative work process, the device IDs of the electronic devices connected to the electronic device 100 , and the application IDs invoked by the electronic devices connected to the electronic device 100 during the collaborative work process. When the electronic device 100 requests the electronic device to work cooperatively through the application A again to realize the above-mentioned application scenario A, the electronic device 100 can establish a communication connection with the historical coordination device according to the above-mentioned connection information stored by itself, and instruct the historical coordination device to call the application that was implemented in the past. The respective applications invoked in scenario A. The above-mentioned historical collaboration device is the above-mentioned electronic device that has established a communication connection with the electronic device 100 and worked cooperatively to implement the application scenario A. It can be seen that the above method can quickly establish the connection relationship between multiple electronic devices. The user may only need to perform operations on the electronic device 100 instead of performing operations on multiple electronic devices to establish connection relationships among the multiple electronic devices. This simplifies user operations when a plurality of electronic devices establish a connection.
上述电子设备100与其它电子设备建立的通信连接可以例如是无线保真(wireless fidelity,Wi-Fi)网络通信连接等短距离通信连接。本申请实施例对上述通信连接的具体方式 不作限定。The communication connection established between the electronic device 100 and other electronic devices may be, for example, a short-distance communication connection such as a wireless fidelity (Wi-Fi) network communication connection. The embodiment of the present application does not limit the specific manner of the above-mentioned communication connection.
多个电子设备协同工作可以表示这多个电子设备之间建立有通信连接,且这多个电子设备进行通信,交互数据和指令,分别执行不同的功能。上述多个电子设备分别执行不同的功能所组成的场景可以是这多个电子设备协同工作实现的一个应用场景。示例性的,手机中安装有学习应用。该学习应用可用于提供课程习题的答案。电视中安装有播放课程视频的应用。平板中安装有记笔记和答题的应用。手机可以通过该学习应用与电视和平板建立通信连接。手机可以指示电视调用播放课程视频的应用。手机可以指示平板调用记笔记和答题的应用。那么,学生可以在电视上观看课程视频,并通过平板记笔记和完成课程习题。家长可以通过手机中的学习应用来检查学生课程习题的完成结果。可以看出,上述手机、电视、平板可以协同工作,实现学生观看课程视频、记录笔记、完成课后习题以及家长检查学生完成的课后习题的应用场景。Cooperative work of multiple electronic devices may mean that a communication connection is established between the multiple electronic devices, and the multiple electronic devices communicate, exchange data and instructions, and perform different functions respectively. The scenario composed of the above-mentioned multiple electronic devices respectively performing different functions may be an application scenario implemented by the multiple electronic devices working together. Exemplarily, a learning application is installed in the mobile phone. This learning app can be used to provide answers to course questions. An application that plays lesson videos is installed on the TV. Note-taking and quiz-answering apps are installed on the tablet. The mobile phone can establish a communication connection with the TV and the tablet through the learning application. The phone can instruct the TV to call up an app that plays lesson videos. The phone can instruct the tablet to call apps for note-taking and answering questions. Then, students can watch lecture videos on TV and take notes and complete course exercises on the tablet. Parents can check the completion results of students' course exercises through the learning application in the mobile phone. It can be seen that the above-mentioned mobile phones, TVs, and tablets can work together to realize the application scenarios in which students watch course videos, record notes, complete after-school exercises, and parents check the after-school exercises completed by students.
需要进行说明的是,在上述设备连接关系建立方法中,电子设备100可以是主设备。主设备可用于存储协同工作过程中主设备与其它电子设备的连接信息。并且,主设备可用于根据自己存储的连接信息建立多个电子设备的连接关系。主设备建立多个电子设备的连接关系的具体实现方式在后续实施例中进行具体介绍,这里先不展开说明。It should be noted that, in the above method for establishing a device connection relationship, the electronic device 100 may be a master device. The master device can be used to store connection information between the master device and other electronic devices during the collaborative work process. In addition, the master device can be used to establish a connection relationship between multiple electronic devices according to the connection information stored by itself. A specific implementation manner for the master device to establish a connection relationship between multiple electronic devices will be described in detail in subsequent embodiments, and will not be described here.
在一些实施例中,在电子设备100和其它电子设备实现上述应用场景A的协同工作的过程中,电子设备100调用的应用A与其它电子设备各自调用的应用可以属于同一个分布式应用。或者,这些应用也可以不属于同一个分布式应用。In some embodiments, during the collaborative work between the electronic device 100 and other electronic devices to implement the above application scenario A, the application A invoked by the electronic device 100 and the applications invoked by other electronic devices may belong to the same distributed application. Alternatively, these applications may not belong to the same distributed application.
本申请实施例涉及分布式应用。为了便于理解本申请提供的方法,下面先对相关概念进行介绍。The embodiments of the present application relate to distributed applications. In order to facilitate the understanding of the method provided by the present application, related concepts are firstly introduced below.
1、分布式应用(distributed application)和服务1. Distributed application and service
一个分布式应用可以提供多项服务。服务也可以称为功能(ability)。一个分布式应用的程序安装包可包括这多项服务的程序安装包。这多项服务的程序安装包可分别安装在多个不同的电子设备中。其中,一个电子设备可安装这多项服务中一项或若干项服务的程序安装包。这一项或若干项服务的程序安装包中的程序实体可以称为这一个电子设备中的一个应用。也即是说,一个分布式应用可以支持以服务为单位进行安装。一个分布式应用中的多项服务可分布在多个不同的电子设备中。这多个不同的电子设备可以协同工作,分别调用这一个分布式应用中的各项服务来共同完成一项任务,实现一个应用场景。A distributed application can provide multiple services. Services may also be referred to as capabilities. A program installation package of a distributed application may include program installation packages of these multiple services. The program installation packages of these multiple services can be respectively installed in multiple different electronic devices. Wherein, one electronic device can install program installation packages of one or more of these multiple services. The program entity in the program installation package of the one or several services may be called an application in the one electronic device. That is to say, a distributed application can support installation in units of services. Multiple services in a distributed application can be distributed among multiple different electronic devices. These multiple different electronic devices can work together, and respectively call various services in this distributed application to jointly complete a task and realize an application scenario.
下面以课程学习分布式应用为例来介绍上述分布式应用和服务之间的关系。The following is an example of learning distributed applications in the course to introduce the relationship between the above-mentioned distributed applications and services.
如图1所示,课程学习分布式应用可提供以下多项服务:习题答案提供服务,课程视频播放服务,记笔记和答题服务。其中,手机中可包括习题答案提供服务的程序安装包。电视中可包括课程视频播放服务的程序安装包。平板中可包括记笔记和答题服务的程序安装包。在一种可能的应用场景中,手机可以是家长的手机。响应于家长的用户操作,手机可以指示电视调用课程视频播放服务,来播放课程视频。并且,手机还可以指示平板调用记笔记和答题服务,来显示用于记笔记和答题的用户界面。其中,学生可以观看电视播放的课程视频,并在平板200上记录笔记和完成课程习题。另外,平板200可以将完成的课程习题发送给手机。手机可以调用习题答案提供服务,来检查上述课程习题的完成结果。As shown in Figure 1, the course learning distributed application can provide the following multiple services: exercise answer providing service, course video playing service, note taking and answering service. Wherein, the mobile phone may include a program installation package that provides services for answering exercises. The TV may include a program installation package for the course video playback service. The tablet may include program installation packages for note-taking and answering services. In a possible application scenario, the mobile phone may be a parent's mobile phone. In response to the parent's user operation, the mobile phone can instruct the TV to call the course video playing service to play the course video. Moreover, the mobile phone can also instruct the tablet to call the note-taking and question-answering service to display a user interface for taking notes and answering questions. Among them, students can watch the course videos played on TV, and record notes and complete course exercises on the tablet 200 . In addition, the tablet 200 can send the completed course exercises to the mobile phone. The mobile phone can invoke the exercise answer providing service to check the completion results of the above-mentioned course exercises.
由图1可以看出,手机、电视和平板可以协同工作,分别调用课程学习分布式应用中的各项服务,来实现学生观看课程视频、记录笔记、完成课后习题以及家长检查学生完成的课 后习题的应用场景。It can be seen from Figure 1 that mobile phones, TVs, and tablets can work together to call various services in the course learning distributed application to enable students to watch course videos, record notes, complete after-school exercises, and parents to check the lessons completed by students. The application scenario of the post-exercise.
一个分布式应用的程序安装包可具有应用包名。每一个服务的程序安装包可具有服务包名。在一种可能的实现方式中,当一个电子设备下载一个分布式应用中一个服务的程序安装包,这一个服务的程序安装包的存储路径可以为:…/<应用包名>/<服务包名>/…。示例性的,图1所示课程学习分布式应用的应用包名可以为com.example.study。记笔记和答题服务的服务包名可以为StudyNotepadServiceAbility。平板中记笔记和答题服务的程序安装包的存储路径可以为:…/<com.example.study>/<StudyNotepadServiceAbility>/…。其中,该课程分布式应用下的多项服务的存储路径均可以为:…/<com.example.study>/…。本申请实施例对上述应用包名和服务包名的具体名称不作限定。A program installation package of a distributed application may have an application package name. The program installation package of each service may have a service package name. In a possible implementation, when an electronic device downloads a program installation package of a service in a distributed application, the storage path of the program installation package of this service can be: .../<application package name>/<service package name>/…. Exemplarily, the application package name of the course learning distributed application shown in FIG. 1 may be com.example.study. The service package name of the note-taking and answering service can be StudyNotepadServiceAbility. The storage path of the program installation package of the note-taking and answering service in the tablet can be: …/<com.example.study>/<StudyNotepadServiceAbility>/…. Among them, the storage path of multiple services under the distributed application of this course can be: …/<com.example.study>/…. The embodiment of the present application does not limit the specific names of the above-mentioned application package name and service package name.
图1仅为本申请示例性提供的一种分布式应用及其对应的服务,不应对本申请构成限定。FIG. 1 is only an example of a distributed application and its corresponding service provided by this application, which should not limit this application.
在一些实施例中,安装有一个服务的程序安装包的电子设备中可包括与这一个服务对应的图标。响应于作用在该图标上的用户操作,电子设备可以调用这一个服务。即上述图标可相当于调用与该图标对应的服务的入口。用户可以触摸一个服务对应的图标,来触发电子设备调用这一个服务。不限于上述图标的形式,电子设备还可以通过其它形式为用户提供调用服务的入口。In some embodiments, an electronic device installed with a program installation package of a service may include an icon corresponding to the service. The electronic device can invoke this one service in response to a user operation acting on the icon. That is, the above-mentioned icon may correspond to an entry for invoking a service corresponding to the icon. The user may touch an icon corresponding to a service to trigger the electronic device to call the service. Not limited to the form of the above icon, the electronic device may also provide the user with an entry to call the service in other forms.
可选的,安装有一个服务的程序安装包的电子设备可以响应于与之协同工作的电子设备的指示,调用这一个服务。即安装有一个服务的程序安装包的电子设备中可以没有供用户直接调用这一个服务的入口。例如,在如图1所示的课程学习分布式应用中。电视中包括课程视频播放服务的程序安装包。但电视中没有供用户直接调用课程视频播放服务的入口。响应于相关用户操作,手机可以指示电视调用课程视频播放服务(即电视运行课程视频播放服务对应的程序)。Optionally, the electronic device installed with the program installation package of a service may invoke the service in response to an instruction of the electronic device working with it. That is, the electronic device installed with the program installation package of a service may not have an entry for the user to directly call the service. For example, in the course learning distributed application shown in FIG. 1 . The program installation package of the course video playback service is included in the TV. But there is no entrance for the user to directly call the course video playback service in the TV. In response to relevant user operations, the mobile phone may instruct the TV to call the course video playing service (that is, the TV runs the program corresponding to the course video playing service).
本申请后续实施例中的应用可以指提供分布式应用中各项服务的程序实体,或者也可以指传统应用,如
Figure PCTCN2022083299-appb-000003
系统、
Figure PCTCN2022083299-appb-000004
系统等系统中的相机应用、图库应用、视频应用等等。例如,在图1所示的课程学习分布式应用中,手机安装有习题答案提供应用。该习题答案提供应用可以提供习题答案提供服务。电视中安装有课程视频播放应用。该课程视频播放应用可以提供课程视频播放服务。平板中安装有记笔记和答题应用。该记笔记和答题应用可以提供记笔记和答题服务。电子设备调用一个应用即为调用这一个应用可以提供的服务。例如,电子设备调用课程视频播放应用可以表示电子设备调用课程视频播放服务。上述习题答案提供应用、上述课程视频播放应用、上述记笔记和答题应用均属于同一个分布式应用(课程学习分布式应用),可以具有相同的应用包名(如com.example.study)。一个传统应用也可以提供多项服务。相比于分布式应用,一个传统应用中提供多项服务的程序安装包可作为一个整体安装在一个电子设备上。也即是说上述传统应用不支持以服务为单位进行安装。上述传统应用可提供的多项服务不具有分布在不同电子设备上的能力。一个传统应用可以具有与之对应的应用包名。
The application in the subsequent embodiments of this application may refer to a program entity that provides various services in a distributed application, or may refer to a traditional application, such as
Figure PCTCN2022083299-appb-000003
system,
Figure PCTCN2022083299-appb-000004
Camera application, gallery application, video application, etc. in the system such as system. For example, in the course learning distributed application shown in Figure 1, the mobile phone is installed with an application for providing answers to exercises. The exercise answer providing application may provide exercise answer providing services. A course video playback application is installed on the TV. The course video playing application can provide a course video playing service. Note-taking and answering apps are installed in the tablet. The note-taking and answering application can provide note-taking and answering services. Calling an application by an electronic device is calling a service that the application can provide. For example, calling the course video playing application by the electronic device may mean that the electronic device calls the course video playing service. The above-mentioned exercise answer providing application, the above-mentioned course video playing application, and the above-mentioned note-taking and question-answering application all belong to the same distributed application (distributed application for course learning), and may have the same application package name (such as com.example.study). A traditional application can also provide multiple services. Compared with distributed applications, a program installation package that provides multiple services in a traditional application can be installed on an electronic device as a whole. That is to say, the above-mentioned traditional applications do not support installation in units of services. The multiple services that can be provided by the above conventional applications do not have the ability to be distributed on different electronic devices. A traditional application can have a corresponding application package name.
本申请后续实施例具体以分布式应用为例来介绍本申请实施例提供的设备连接关系建立方法。Subsequent embodiments of the present application specifically use a distributed application as an example to introduce the method for establishing a device connection relationship provided in the embodiments of the present application.
2、会话2. Conversation
在一些实施例中,在协同工作实现一个应用场景的多个电子设备中可存在一个主设备。该主设备可用于建立这多个电子设备在协同工作时的连接关系。由主设备请求,与主设备协同工作的电子设备均为子设备。例如,在图1所示的手机、电视和平板协同工作的场景中。 手机可以是主设备。电视和平板可以均为子设备。手机可以与电视建立通信连接,并指示电视调用课程视频播放服务。手机可以与平板建立通信连接,并指示平板调用记笔记和答题服务。In some embodiments, there may be a master device among multiple electronic devices that work together to implement an application scenario. The master device can be used to establish a connection relationship between the plurality of electronic devices when working together. Requested by the master device, the electronic devices that work together with the master device are sub-devices. For example, in the scenario where a mobile phone, a TV, and a tablet work together as shown in FIG. 1 . A mobile phone can be the master device. Both TV and tablet can be child devices. The mobile phone can establish a communication connection with the TV, and instruct the TV to call the course video playback service. The mobile phone can establish a communication connection with the tablet, and instruct the tablet to call note-taking and question-answering services.
会话可以表示上述主设备、子设备之间进行连接,在协同工作的过程中交互数据。一个会话可具有会话标识。一个会话的会话标识可以由主设备的设备账号(如华为账号),以及运行在主设备上请求子设备协同工作的应用的应用标识来确定。上述设备账号可以唯一标识登录在主设备上的用户。在一种可能的实现方式中,主设备运行应用A对应的程序请求子设备协同工作。上述应用标识可以是上述应用A的应用包名。在另一种可能的实现方式中,主设备运行应用A下服务A对应的程序请求子设备协同工作。上述应用标识仍然为应用A的应用包名。例如,运行在手机上请求子设备(如电视、平板)协同工作的应用为课程学习分布式应用。该应用标识可以是课程学习分布式应用的应用包名(如com.example.study)。本申请实施例对上述设备账号和应用标识的具体内容不作限定。A session can mean that the above-mentioned main device and sub-device are connected to exchange data during the process of cooperative work. A session can have a session ID. The session ID of a session can be determined by the device account (such as Huawei ID) of the main device and the application ID of the application running on the main device that requests the sub-device to work together. The above-mentioned device account can uniquely identify the user logged in on the master device. In a possible implementation manner, the master device runs a program corresponding to application A to request the sub-devices to work together. The above application identifier may be the application package name of the above application A. In another possible implementation manner, the master device runs a program corresponding to service A under application A to request the sub-devices to work together. The above application identifier is still the application package name of application A. For example, an application that runs on a mobile phone and requests sub-devices (such as a TV, a tablet) to work together is a distributed application for course learning. The application identifier may be an application package name (such as com.example.study) of the course learning distributed application. The embodiment of the present application does not limit the specific content of the above-mentioned device account and application identifier.
在一些实施例中,主设备调用一个应用请求子设备协同工作时,可以根据上述设备账号和应用标识查找是否存储有对应的会话标识。若不存在对应的会话标识,主设备可以建立一个会话,并根据设备账号和应用标识确定这一个会话的会话标识。在主设备与各个子设备建立连接时,主设备可以将这一个会话的会话标识传递给各个子设备。在协同工作实现一个应用场景的过程中,主设备和子设备均可存储有同一个会话标识。主设备和子设备在协同工作中通信是在上述同一个会话标识所指示的会话下进行的。In some embodiments, when the master device invokes an application to request the sub-device to work together, it may check whether a corresponding session identifier is stored according to the above-mentioned device account and application identifier. If there is no corresponding session ID, the main device can establish a session, and determine the session ID of the session according to the device account and the application ID. When the main device establishes a connection with each sub-device, the main device may pass the session identifier of this session to each sub-device. In the process of working together to implement an application scenario, both the main device and the sub-device can store the same session identifier. The communication between the main device and the sub-device is carried out under the session indicated by the above-mentioned same session identifier during cooperative work.
主设备建立一个会话的过程可以为确定这一个会话的会话标识,以及为这一个会话分配一个存储沙箱的过程。该存储沙箱可用于存储在这一个会话下主设备和子设备之间交互的数据、以及主设备和子设备之间的连接信息。The process of establishing a session by the master device may be a process of determining a session identifier of the session and assigning a storage sandbox to the session. The storage sandbox can be used to store the data interacted between the main device and the sub-device in this session, and the connection information between the main device and the sub-device.
若存在对应的会话标识,主设备可以将查找到的会话标识传递给各个子设备。主设备和子设备在该会话标识对应的会话下交互的数据可以存储至该会话的存储沙箱中。在一些实施例中,当查找到对应的会话标识,主设备可以根据会话的存储沙箱中存储的设备之间的连接信息与相应的子设备建立连接。也即是说,在主设备与子设备曾经建立过连接来实现一个应用场景的情况下,若主设备再次需要请求其它电子设备协同工作来实现这一个应用场景,主设备可以根据会话的存储沙箱中存储的设备之间的连接信息快速与曾经连接过的子设备建立连接。这极大地简化了设备之间建立连接的用户操作。If there is a corresponding session identifier, the main device may transfer the found session identifier to each sub-device. The data exchanged between the main device and the sub-device under the session corresponding to the session identifier can be stored in the storage sandbox of the session. In some embodiments, when the corresponding session identifier is found, the main device can establish a connection with the corresponding sub-device according to the connection information between devices stored in the storage sandbox of the session. That is to say, when the main device and the sub-device have established a connection to realize an application scenario, if the main device needs to request other electronic devices to work together to realize this application scenario, the main device can The connection information between the devices stored in the box can quickly establish a connection with the sub-device that has been connected. This greatly simplifies user operations for establishing connections between devices.
一个会话的生命周期起始于主设备首次调用一个应用请求子设备协同工作之时。其中,主设备首次调用一个应用请求子设备协同工作之时,主设备查找不到与设备账号和应用标识对应的会话标识。主设备可以定期或不定期清理会话。若一个会话的会话标识与这一个会话的存储沙箱被删除,则这一个会话结束。在一种可能的实现方式中,主设备可以根据最近最少使用(least recently used,LRU)算法对会话进行清理。具体实现方法可以参考现有技术中LRU算法的实现过程。本申请实施例对主设备清理会话的方法不作限定。The life cycle of a session begins when the master device calls an application for the first time to request the sub-device to work together. Wherein, when the main device calls an application for the first time to request the sub-device to work together, the main device cannot find the session ID corresponding to the device account and the application ID. The master device can clean up sessions periodically or irregularly. If the session ID of a session and the storage sandbox of the session are deleted, the session ends. In a possible implementation manner, the master device may clean up the session according to a least recently used (LRU) algorithm. For a specific implementation method, reference may be made to the implementation process of the LRU algorithm in the prior art. The embodiment of the present application does not limit the method for the master device to clear the session.
其中,在一个会话已经建立的情况下,若主设备和各个子设备中的一个或多个电子设备退出自己在这一个会话中调用的应用,这一个会话仍然存在。即主设备中仍可存储这一个会话的会话标识以及存储沙箱中的数据。例如,在图1所示的课程学习分布式应用中,若电视结束调用课程视频播放服务,不再播放课程视频。利用上述课程学习分布式应用,手机在与电视、平板协同工作时建立的会话仍然存在。Wherein, in the case that a session has been established, if one or more electronic devices in the main device and each sub-device exits the application invoked in the session, the session still exists. That is, the master device can still store the session identifier of this session and store the data in the sandbox. For example, in the course learning distributed application shown in FIG. 1 , if the TV finishes invoking the course video playing service, the course video will no longer be played. Using the above courses to learn distributed applications, the sessions established when mobile phones work with TVs and tablets still exist.
在一些实施例中,在协同工作完成一个应用场景的过程中,主设备和子设备分别调用属于一个分布式应用的服务。主设备可以在该次协同工作与子设备连接时,向各子设备传递同 一个会话的会话标识。在另一些实施例中,在协同工作完成一个应用场景的过程中,主设备和子设备调用的服务不属于同一个分布式应用。主设备让仍可在该次协同工作与子设备连接时,向各子设备传递同一个会话的会话标识。该同一个会话的会话标识可由在该次协同工作时,主设备上的设备账号和应用标识来确定。例如,在图1所示的课程学习分布式应用中,电视中的课程视频播放服务不可用(如电视已经课程视频播放服务的程序安装包清理,且暂时无法获取该程序安装包)。在手机指示电视播放课程视频时,电视可以调用其它应用(如华为视频应用)来播放课程视频。其中,手机可以将会话标识传递给电视。该会话标识可以由登录在手机上的设备账号以及课程学习分布式应用的应用标识确定。In some embodiments, in the process of cooperating to complete an application scenario, the main device and the sub-device respectively invoke services belonging to a distributed application. The master device can pass the session identification of the same session to each sub-device when the cooperative work is connected with the sub-device. In some other embodiments, in the process of cooperating to complete an application scenario, the services invoked by the main device and the sub-device do not belong to the same distributed application. The main device can still pass the session identifier of the same session to each sub-device when it is connected to the sub-device in this cooperative work. The session identifier of the same session can be determined by the device account and application identifier on the master device during the collaborative work. For example, in the course learning distributed application shown in FIG. 1 , the course video playback service in the TV is unavailable (for example, the program installation package of the course video playback service has been cleaned up on the TV, and the program installation package cannot be obtained temporarily). When the mobile phone instructs the TV to play the course video, the TV can call other applications (such as the Huawei video application) to play the course video. Wherein, the mobile phone may transmit the session identifier to the TV. The session identifier can be determined by the device account logged in on the mobile phone and the application identifier of the course learning distributed application.
3、快照信息(snapshot)3. Snapshot information (snapshot)
快照信息是指定数据的复制品。快照信息可用于数据备份和恢复。与一个会话关联的快照信息可包括这一个会话下电子设备之间的连接信息。上述连接信息可包括源设备的设备标识、目的设备的设备标识、目的设备上被调用应用的应用标识、目的设备上被调用应用中服务的服务标识(可选的)。上述源设备为指示其它电子设备调用相关应用的电子设备。上述目的设备为接收调用指令调用相关应用的电子设备。例如,在手机指示电视调用课程视频播放应用的场景中,手机为源设备,电视为目的设备。可选的,上述连接信息还可包括源设备上请求其它电子设备协同工作的应用的应用标识等信息。本申请实施例对此不作限定。Snapshot information is a copy of the specified data. Snapshot information can be used for data backup and recovery. The snapshot information associated with a session may include connection information between electronic devices in this session. The above connection information may include a device identifier of the source device, a device identifier of the destination device, an application identifier of the called application on the destination device, and a service identifier (optional) of a service in the called application on the destination device. The aforementioned source device is an electronic device that instructs other electronic devices to invoke related applications. The above-mentioned target device is an electronic device that receives a call instruction to call a related application. For example, in the scenario where the mobile phone instructs the TV to call the course video playing application, the mobile phone is the source device and the TV is the destination device. Optionally, the above connection information may also include information such as an application identifier of an application on the source device that requests other electronic devices to work together. This embodiment of the present application does not limit it.
在一些实施例中,与一个会话关联的快照信息还可包括这一个会话下各电子设备调用对应的应用时的活动(activity)信息。示例性的,在手机指示电视调用课程视频播放应用的场景中,上述活动信息可以包括电视播放课程视频的课程标识、播放进度。电视可以将该活动信息发送给手机。手机可以将该活动信息存储至与之关联的会话的存储沙箱中。在手机指示平板调用记笔记和答题应用的场景中,上述活动信息可以包括记录的笔记数据以及答题数据等。平板可以将该活动信息发送给手机。手机可以将该活动信息存储至与之关联的会话的存储沙箱中。In some embodiments, the snapshot information associated with a session may further include activity (activity) information when each electronic device in this session invokes a corresponding application. Exemplarily, in the scenario where the mobile phone instructs the TV to call the course video playing application, the above activity information may include the course identification and playing progress of the course video played by the TV. The TV can send this activity information to the mobile phone. The phone can store this activity information in the storage sandbox of the session associated with it. In the scenario where the mobile phone instructs the tablet to call the note-taking and answering applications, the above activity information may include recorded note data and answering data. The tablet can send the activity information to the mobile phone. The phone can store this activity information in the storage sandbox of the session associated with it.
与一个会话关联的快照信息可存储在建立这一个会话的主设备中。即主设备中为这一个会话分配的存储沙箱中可存储与这一个会话关联的快照信息。Snapshot information associated with a session may be stored in the master device that established the session. That is, the snapshot information associated with the session can be stored in the storage sandbox allocated for the session in the master device.
主设备可以周期性记录与一个会话关联的快照信息。例如,主设备可以每隔1分钟获取一次与一个会话关联的快照信息,并利用当前这一次获取到的快照信息更新存储沙箱中最近一次获取到的快照信息。可选的,主设备可以响应用户操作来记录与一个会话关联的快照信息。例如,在手机指示电视调用课程视频播放应用的场景中,响应于作用在电视上用于退出课程视频播放的用户操作,电视可以将退出课程视频播放时播放课程视频的课程标识、播放进度发送给主设备。主设备可以将上述播放课程视频的课程标识、播放进度存储至对应会话的存储沙箱中。本申请实施例对触发主设备记录快照信息的用户操作不作限定。The master device can periodically record snapshot information associated with a session. For example, the master device may acquire snapshot information associated with a session every minute, and use the currently acquired snapshot information to update the latest acquired snapshot information in the storage sandbox. Optionally, the master device may record snapshot information associated with a session in response to a user operation. For example, in the scenario where the mobile phone instructs the TV to call the course video playback application, in response to the user operation on the TV for exiting the course video playback, the TV can send the course identification and playback progress of the course video to the master device. The main device may store the above-mentioned course identification and playing progress of playing the course video in the storage sandbox of the corresponding session. The embodiment of the present application does not limit the user operation that triggers the master device to record the snapshot information.
4、存储沙箱4. Storage sandbox
一个存储沙箱为电子设备中内存的一块存储区域。电子设备可以为上述一个会话分配一个存储沙箱。存储沙箱可用于存储与一个会话关联的快照信息(如在这一个会话下电子设备之间的连接信息、在这一个会话下各电子设备调用对应的应用时的活动信息)。A storage sandbox is a storage area of memory in an electronic device. The electronic device may assign a storage sandbox to one of the above sessions. The storage sandbox can be used to store snapshot information associated with a session (such as connection information between electronic devices in this session, activity information when each electronic device calls a corresponding application in this session).
一个存储沙箱的位置可以由电子设备的设备账号(如华为账号)、该电子设备在会话中调用的应用标识以及该会话的会话标识来确定。示例性的,一个存储沙箱的位置可以是:…/data/user/<设备账号>/<应用标识>/<会话标识>/…。上述应用标识可以是应用的应用包 名。每个会话的存储沙箱是隔离的。电子设备可以根据根据一个会话的存储沙箱的位置获取与这一个会话关联的快照信息。The location of a storage sandbox can be determined by the device account of the electronic device (such as a Huawei account), the application identifier invoked by the electronic device in a session, and the session identifier of the session. Exemplarily, a storage sandbox location may be: .../data/user/<device account>/<application ID>/<session ID>/.... The above application identification may be the application package name of the application. The storage sandbox for each session is isolated. The electronic device may obtain snapshot information associated with a session according to the location of the storage sandbox of the session.
在图1所示的课程学习分布式应用中,手机可以通过已安装的习题答案提供应用指示电视调用课程视频播放服务,并指示平板调用记笔记和答题服务。手机可以创建会话。该会话是在手机登录当前的设备账号时基于课程学习分布式应用的会话。手机可以为该会话分配存储沙箱。该存储沙箱的位置可以是:…/data/user/<手机的设备账号>/<课程学习分布式应用的应用包名>/<会话标识>/…。手机可以将该会话标识传递给电视和手机。其中,电视可以为该会话标识对应的会话分配存储沙箱。电视中该存储沙箱的位置可以是:…/data/user/<电视的设备账号>/<课程学习分布式应用的应用包名>/<会话标识>/…。电视可以将播放课程视频的课程标识、播放进度等数据存储至电视中该会话的存储沙箱。手机可以为该会话标识对应的会话分配存储沙箱。手机中该存储沙箱的位置可以是:…/data/user/<手机的设备账号>/<课程学习分布式应用的应用包名>/<会话标识>/…。手机可以将笔记数据以及答题数据等数据存储至该手机中该会话的存储沙箱。In the course learning distributed application shown in Figure 1, the mobile phone can instruct the TV to call the course video playback service through the installed exercise answer providing application, and instruct the tablet to call the note-taking and answering service. The phone can create sessions. The session is a session for learning the distributed application based on the course when the mobile phone logs into the current device account. The phone can assign a storage sandbox to this session. The location of the storage sandbox can be: .../data/user/<device account of the mobile phone>/<application package name of the course learning distributed application>/<session identifier>/.... The phone can pass the session ID to the TV and the phone. Wherein, the television may assign a storage sandbox to the session corresponding to the session identifier. The location of the storage sandbox in the TV may be: .../data/user/<device account of the TV>/<application package name of the distributed application for course learning>/<session ID>/.... The TV can store data such as course identification and playback progress of the course video in the storage sandbox of the session on the TV. The mobile phone may assign a storage sandbox to the session corresponding to the session identifier. The location of the storage sandbox in the mobile phone can be: .../data/user/<device account of the mobile phone>/<application package name of the course learning distributed application>/<session ID>/.... The mobile phone can store data such as note data and answer data in the storage sandbox of the session in the mobile phone.
基于图1所示的课程学习分布式应用,下面介绍本申请实施例提供的一种建立设备连接关系的场景。Based on the distributed application for course learning shown in FIG. 1 , a scenario of establishing a device connection relationship provided by the embodiment of the present application is introduced below.
图2A~图2I示例性示出了一种建立设备连接关系的场景示意图。FIG. 2A to FIG. 2I exemplarily show a schematic diagram of a scenario of establishing a device connection relationship.
如图2A所示,电子设备100(如手机)可以显示用户界面210。用户界面210显示了一个放置有应用图标的页面。该页面可包括多个应用图标(例如,时钟应用图标、文件管理应用图标、华为视频应用图标、学习应用图标211等等)。上述多个应用图标下方还可显示有页面指示符,以表明当前显示的页面与其他页面的位置关系。页面指示符的下方有多个托盘图标(例如,相机应用图标、联系人应用图标、拨号应用图标、信息应用图标)。托盘图标在页面切换时保持显示。本申请实施例对用户界面410上显示的内容不作限定。As shown in FIG. 2A , an electronic device 100 (such as a mobile phone) may display a user interface 210 . The user interface 210 displays a page on which application icons are placed. The page may include multiple application icons (for example, a clock application icon, a file management application icon, a Huawei video application icon, a learning application icon 211, etc.). A page indicator may also be displayed below the plurality of application icons to indicate the positional relationship between the currently displayed page and other pages. Below the page indicators are multiple tray icons (eg, camera app icon, contacts app icon, dialer app icon, messaging app icon). The tray icon remains displayed across page switches. The embodiment of the present application does not limit the content displayed on the user interface 410 .
上述学习应用图标211为指示课程学习分布式应用的应用图标。在一些实施例中,电子设备100中包含习题答案提供服务的程序安装包。那么,响应于作用在学习应用图标211的用户操作,电子设备100可以显示包含习题答案的用户界面。The learning application icon 211 is an application icon indicating a course learning distributed application. In some embodiments, the electronic device 100 includes a program installation package that provides a service for answering exercises. Then, in response to a user operation acting on the learning application icon 211, the electronic device 100 may display a user interface including answers to exercises.
在一些实施例中,除了上述习题答案提供服务的程序安装包,电子设备100中课程学习分布式应用的程序安装包中还可包括设备连接程序。上述设备连接程序可用于电子设备100与其它电子设备建立通信连接,指示其它电子设备调用课程学习分布式应用可提供的服务(如课程视频播放服务,记笔记和答题服务)。可选的,电子设备100中还可包含课程视频视频播放服务的程序安装包、记笔记和答题服务的程序安装包。即电子设备100可以调用习题答案提供服务、课程视频播放服务、记笔记和答题服务这多项服务。In some embodiments, in addition to the program installation package of the above-mentioned exercise answer providing service, the program installation package of the course learning distributed application in the electronic device 100 may also include a device connection program. The above-mentioned device connection program can be used for the electronic device 100 to establish a communication connection with other electronic devices, and instruct other electronic devices to call the services provided by the course learning distributed application (such as course video playing service, note taking and answering service). Optionally, the electronic device 100 may also include a program installation package for course video playback services, and a program installation package for note-taking and question-answering services. That is to say, the electronic device 100 can call multiple services such as exercise answer providing service, course video playing service, note taking and question answering service.
这里具体以电子设备100可以调用习题答案提供服务、课程视频播放服务、记笔记和答题服务这多项服务为例进行介绍。Here, the electronic device 100 is specifically introduced by taking multiple services such as the service of providing answers to exercises, the service of playing lecture videos, and the services of taking notes and answering questions as examples.
响应于作用在学习应用图标211的用户操作,电子设备100可以显示如图2B所示的登录界面220。登录界面220可包括账号名称输入框221、密码输入框222、登录控件223和注册控件224。其中:In response to a user operation acting on the learning application icon 211, the electronic device 100 may display a login interface 220 as shown in FIG. 2B. The login interface 220 may include an account name input box 221 , a password input box 222 , a login control 223 and a registration control 224 . in:
注册控件224可用于注册账号。用户可以通过注册控件224在学习应用上注册新的账号。A registration control 224 may be used to register an account. The user can register a new account on the learning application through the registration control 224 .
若注册过账号,用户可以通过输入自己已注册的账号的账号名称和密码登录学习应用。If an account has been registered, the user can log in to the learning application by entering the account name and password of the registered account.
账号名称输入框221可用于输出登录的账号名称。例如“张三”。The account name input box 221 can be used to output the login account name. For example "Zhang San".
密码输入框222可用于输入登录的密码。The password input box 222 can be used to input the password for login.
登录控件223可用于触发电子设备100根据账号名称输入框221和密码输入框222中接收到的数据进行登录操作。The login control 223 can be used to trigger the electronic device 100 to perform a login operation according to the data received in the account name input box 221 and the password input box 222 .
当登录成功,电子设备100可以显示如图2C所示的用户界面230。用户界面230可以包括课程选择区域231、“首页”控件232、“学习”控件233、“我的”控件234。其中:When the login is successful, the electronic device 100 may display a user interface 230 as shown in FIG. 2C . The user interface 230 may include a course selection area 231 , a “Home” control 232 , a “Learning” control 233 , and a “My” control 234 . in:
“首页”控件232、“学习”控件233、“我的”控件234可用于指示用户界面230中显示的内容。例如,如图2C所示,“学习”控件233处于被选中状态,用户界面230中显示的内容可为课程选择区域231中包含的各项课程。响应于作用在“首页”控件232、“学习”控件233、“我的”控件234中任意一个控件的用户操作,电子设备100可以切换用户界面230中显示的内容。The “Home” control 232 , the “Learning” control 233 , and the “My” control 234 can be used to indicate the content displayed in the user interface 230 . For example, as shown in FIG. 2C , the “Learning” control 233 is in a selected state, and the content displayed on the user interface 230 may be various courses included in the course selection area 231 . In response to a user operation acting on any one of the “Home” control 232 , the “Learning” control 233 , and the “My” control 234 , the electronic device 100 can switch the content displayed on the user interface 230 .
课程选择区域231中可包括第一课课程选项、第二课课程选项、第三课课程选项、第四课课程选项等等。可选的,其中每一个课程选中可包括课程进度。例如:第一课课程进度为“已完成0%”。上述课程进度可由课程视频是否播放完成、课后习题是否完成来确定。The course selection area 231 may include course options for the first lesson, course options for the second lesson, course options for the third lesson, course options for the fourth lesson and so on. Optionally, each course selection may include course progress. Example: Lesson 1 course progress is "0% complete". The above-mentioned course progress can be determined by whether the course video is played and whether the after-school exercises are completed.
响应于作用在第一课课程选项的用户操作,电子设备100可以显示如图2D所示的用户界面240。用户界面240可包括课程视频区域241、视频输出设备选择控件242、课后习题区域243、学生学习设备选择控件244、习题答案区域245。其中:In response to a user operation acting on the course option of the first lesson, the electronic device 100 may display a user interface 240 as shown in FIG. 2D . The user interface 240 may include a course video area 241 , a video output device selection control 242 , an after-school exercise area 243 , a student learning device selection control 244 , and an exercise answer area 245 . in:
课程视频区域241中可包括第一课的课程视频。当接收到用于播放课程视频的用户操作,电子设备100可以调用学习应用中的课程视频播放服务,播放第一课的课程视频。The course video of the first lesson may be included in the course video area 241 . When receiving a user operation for playing the course video, the electronic device 100 may call the course video playing service in the learning application to play the course video of the first lesson.
视频输出设备选择控件242可用于电子设备100指示其它电子设备调用课程视频播放服务。The video output device selection control 242 can be used for the electronic device 100 to instruct other electronic devices to call the course video playing service.
课后习题区域243中可包括第一课的课后习题。可选的,课后习题区域243中还可包括用于记笔记的文本输入框。即电子设备100可以调用记笔记和答题服务,供用户记笔记和完成课后习题。After-school exercises area 243 may include homework exercises for the first lesson. Optionally, the after-school exercise area 243 may also include a text input box for taking notes. That is, the electronic device 100 can invoke the note-taking and answering service for the user to take notes and complete homework exercises.
学生学习设备选择控件244可用于电子设备100指示其它电子设备调用记笔记和答题服务。The student learning device selection control 244 may be used by the electronic device 100 to instruct other electronic devices to invoke note-taking and quiz-answering services.
习题答案区域245中可包括第一课课后习题的答案。The homework answer area 245 may contain the answers to the homework questions after the first lesson.
如图2D所示,响应于作用在视频输出设备选择控件242的用户操作,电子设备100可以搜索附近可用于播放视频的电子设备,并显示如图2E所示的用户界面250。As shown in FIG. 2D , in response to a user operation acting on the video output device selection control 242 , the electronic device 100 may search for nearby electronic devices that can be used to play videos, and display a user interface 250 as shown in FIG. 2E .
在一种可能的实现方式中,电子设备100可以搜索与自己处于同一局域网(如同一家庭Wi-Fi),且可用于播放视频的电子设备。用户界面250中可包括设备选择区域251和搜索控件252。其中,搜索控件252可用于触发电子设备100继续搜索与自己处于同一局域网(如同一家庭Wi-Fi)中,且可用于播放视频的电子设备。上述搜索的过程可以例如是电子设备100向与自己处于同一家庭Wi-Fi中的各个电子设备发送消息。该消息可用于询问电子设备是否具有播放视频的能力。当接收到该消息,具有视频播放能力的电子设备可以向电子设备100发送应答消息。那么,电子设备100可以搜索到与自己处于同一家庭Wi-Fi中,且可用于播放视频的电子设备。本申请实施例对电子设备100搜索电子设备的方法不作限定。In a possible implementation manner, the electronic device 100 may search for electronic devices that are in the same local area network (such as the same home Wi-Fi) as the electronic device 100 and that can be used to play videos. A device selection area 251 and a search control 252 may be included in the user interface 250 . Wherein, the search control 252 can be used to trigger the electronic device 100 to continue searching for an electronic device that is in the same local area network (such as the same home Wi-Fi) as itself and can be used to play videos. The above search process may be, for example, that the electronic device 100 sends a message to each electronic device in the same home Wi-Fi as itself. This message can be used to ask whether the electronic device has the ability to play video. When receiving the message, the electronic device capable of playing video may send a response message to the electronic device 100 . Then, the electronic device 100 can search for an electronic device that is in the same home Wi-Fi as itself and can be used to play videos. The embodiment of the present application does not limit the method for the electronic device 100 to search for the electronic device.
设备选择区域251中可包括一个或多个电子设备100搜索到的电子设备的设备选项。例如,张三的平板、张三的电视、李四的平板、李四的电视。本申请实施例对上述设备选项的名称不作限定。响应于作用在上述设备选项中任一个设备选项的用户操作,电子设备100可以与该设备选项对应的电子设备,电子设备100可以指示该电子设备调用课程视频播放服务。The device selection area 251 may include device options of one or more electronic devices searched by the electronic device 100 . For example, Zhang San's tablet, Zhang San's TV, Li Si's tablet, Li Si's TV. The embodiment of the present application does not limit the names of the above equipment options. In response to a user operation acting on any one of the above-mentioned device options, the electronic device 100 may be an electronic device corresponding to the device option, and the electronic device 100 may instruct the electronic device to call the course video playing service.
示例性的,响应于作用在设备选项“张三的电视”的用户操作,电子设备100可以指示电子设备200(即张三的电视)调用课程视频播放服务。Exemplarily, in response to the user operation acting on the device option "Zhang San's TV", the electronic device 100 may instruct the electronic device 200 (that is, Zhang San's TV) to call the course video playing service.
在一些实施例中,电子设备200中已安装有上述课程视频播放服务的程序安装包。电子设备200可以调用课程视频播放服务,显示如图2F所示的用户界面260。In some embodiments, the electronic device 200 has already installed the program installation package of the course video playing service. The electronic device 200 can invoke the course video playing service, and display the user interface 260 as shown in FIG. 2F .
如图2F所示,电子设备100和电子设备200之间建立有通信连接(如Wi-Fi通信连接)。电子设备200可以显示用户界面260。该用户界面260为播放课程视频(如第一课的课程视频)的用户界面。其中,用户可以通过作用在遥控器上播放控件或暂停控件的用户操作,来指示电子设备200播放第一课课程视频或者暂停播放第一课课程视频。As shown in FIG. 2F , a communication connection (such as a Wi-Fi communication connection) is established between the electronic device 100 and the electronic device 200 . The electronic device 200 may display a user interface 260 . The user interface 260 is a user interface for playing a course video (such as the course video of the first lesson). Wherein, the user may instruct the electronic device 200 to play the first lesson video or pause playing the first lesson video by acting on the user operation of the play control or the pause control on the remote control.
在另一些实施例中,电子设备200中还未安装有上述课程视频播放服务的程序安装包。当接收到来自电子设备100用于指示电子设备200调用课程视频播放服务的指令,电子设备200可以获取(如从云服务器获取)课程视频播放服务的程序安装包。当获取了课程视频播放服务的程序安装包,电子设备200可以调用课程视频播放服务,显示如图2F所示的用户界面260。本申请实施例对电子设备200获取课程视频播放服务的程序安装包的方法不作限定。In some other embodiments, the electronic device 200 has not yet installed the program installation package of the course video playing service. When receiving an instruction from the electronic device 100 for instructing the electronic device 200 to call the course video playing service, the electronic device 200 may obtain (for example, obtain from a cloud server) the program installation package of the course video playing service. When the program installation package of the course video playing service is acquired, the electronic device 200 may invoke the course video playing service, and display a user interface 260 as shown in FIG. 2F . The embodiment of the present application does not limit the method for the electronic device 200 to obtain the program installation package of the course video playing service.
在另一些实施例中,电子设备200中还未安装有上述课程视频播放服务的程序安装包,且电子设备200获取不到课程视频播放服务的程序安装包。电子设备200可以调用其它可用于播放视频的应用(如视频播放器应用、华为视频应用等等),来播放课程视频。上述被调用的应用可以是电子设备200中默认的,或者,是用户选择的。本申请实施例对此不作限定。其中,电子设备200可以获取(如从电子设备100,或者从云服务器获取)需要播放的课程视频的数据。In some other embodiments, the electronic device 200 has not yet installed the program installation package of the course video playback service, and the electronic device 200 cannot obtain the program installation package of the course video playback service. The electronic device 200 can call other applications that can be used to play videos (such as video player applications, Huawei video applications, etc.) to play course videos. The aforementioned invoked application may be a default one in the electronic device 200, or may be selected by the user. This embodiment of the present application does not limit it. Wherein, the electronic device 200 may obtain (for example, obtain from the electronic device 100 or from a cloud server) the data of the course video to be played.
当接收到上述作用在视频输出设备选择控件242的用户操作,电子设备100可以根据电子设备100的设备账号(如华为账号)以及学习应用的应用标识(如应用包名)查找自己是否存储有会话标识。若存在会话标识对应的会话(该会话为在电子设备100上登录当前的设备账号时基于学习应用的会话),电子设备100可以从与该会话关联的快照信息中查找是否存在与调用课程视频播放服务的电子设备连接的连接信息。可选的,电子设备100还可以从与该会话关联的快照信息中查找是否存在与调用用于播放视频的应用的电子设备连接的连接信息。When receiving the above-mentioned user operation acting on the video output device selection control 242, the electronic device 100 can check whether it has stored the session according to the device account of the electronic device 100 (such as Huawei account) and the application identification of the learning application (such as the application package name). logo. If there is a session corresponding to the session identifier (the session is a session based on the learning application when logging into the current device account on the electronic device 100), the electronic device 100 can find out whether there is a session related to calling the course video playback from the snapshot information associated with the session. Connection information for electronic device connections to the service. Optionally, the electronic device 100 may also find, from the snapshot information associated with the session, whether there is connection information connected to the electronic device calling the application for playing the video.
若不存在会话标识对应的会话,电子设备100可以建立会话。该会话的会话标识根据电子设备100的设备账号以及学习应用的应用标识确定。电子设备100可以为该会话分配一个存储沙箱。If there is no session corresponding to the session identifier, the electronic device 100 may establish a session. The session ID of the session is determined according to the device account of the electronic device 100 and the application ID of the learning application. The electronic device 100 may assign a storage sandbox to the session.
在上述电子设备100与电子设备200连接,且电子设备100指示电子设备200播放课程视频的过程中,电子设备100可以将电子设备100与电子设备200的连接信息存储至会话的存储沙箱中。可选的,电子设备100还可以将一个时刻电子设备200播放课程视频的课程标识、播放进度存储至该会话的存储沙箱中。During the above-mentioned process in which the electronic device 100 is connected to the electronic device 200 and the electronic device 100 instructs the electronic device 200 to play the course video, the electronic device 100 may store the connection information between the electronic device 100 and the electronic device 200 in the storage sandbox of the session. Optionally, the electronic device 100 may also store the course identification and playing progress of the course video played by the electronic device 200 at a moment in the storage sandbox of the session.
上述不存在会话标识对应的会话的情况可以包括:电子设备100未曾创建过与该会话标识对应的会话。或者,电子设备100曾经创建过与该会话标识对应的会话。但是,该会话已被删除。上述会话被删除可以表示上述会话对应的会话标识以及会话的存储沙箱被删除。The foregoing situation that there is no session corresponding to the session identifier may include: the electronic device 100 has never created a session corresponding to the session identifier. Or, the electronic device 100 once created a session corresponding to the session identifier. However, the session has been deleted. The deletion of the above session may indicate that the session identifier corresponding to the above session and the storage sandbox of the session are deleted.
可以看出,图2D~图2F示例性示出了电子设备100建立会话的场景示意图。It can be seen that FIG. 2D to FIG. 2F exemplarily show schematic diagrams of scenarios where the electronic device 100 establishes a session.
如图2G所示,响应于作用在学生学习设备选择控件244的用户操作,电子设备100可以搜索附近可用于提供记笔记和答题服务的电子设备,并显示如图2H所示的用户界面270。As shown in FIG. 2G , in response to a user operation acting on the student learning device selection control 244 , the electronic device 100 can search for nearby electronic devices that can provide note-taking and answering services, and display a user interface 270 as shown in FIG. 2H .
电子设备100搜索附近可用于提供记笔记和答题服务的电子设备可以参考前述实施例中电子设备100搜索可用于播放视频的电子设备的方法。这里不再赘述。For the electronic device 100 to search for nearby electronic devices that can be used to provide note-taking and answering services, refer to the method for the electronic device 100 to search for electronic devices that can be used to play videos in the foregoing embodiments. I won't go into details here.
用户界面270可包括学习设备选择区域271。该学习设备选择区域271中可包括一个或多个电子设备100搜索到的电子设备的设备选项。例如,张三的平板、张三的电视、李四的平板、李四的电视。本申请实施例对上述设备选项的名称不作限定。响应于作用在上述设备选项中任一个设备选项的用户操作,电子设备100可以与该设备选项对应的电子设备,电子设备100可以指示该电子设备调用记笔记和答题服务。 User interface 270 may include a learning device selection area 271 . The learning device selection area 271 may include device options of one or more electronic devices searched by the electronic device 100 . For example, Zhang San's tablet, Zhang San's TV, Li Si's tablet, Li Si's TV. The embodiment of the present application does not limit the names of the above equipment options. In response to a user operation acting on any one of the above-mentioned device options, the electronic device 100 can be the electronic device corresponding to the device option, and the electronic device 100 can instruct the electronic device to call the note-taking and answering service.
示例性的,响应于作用在设备选项“张三的平板”的用户操作,电子设备100可以指示电子设备300(即张三的平板)调用记笔记和答题服务,显示如图2I所示的用户界面280。Exemplarily, in response to the user operation acting on the device option "Zhang San's tablet", the electronic device 100 may instruct the electronic device 300 (that is, Zhang San's tablet) to call the note-taking and answering service, and display the user's Interface 280.
如图2I所示,电子设备100和电子设备300之间建立有通信连接(如Wi-Fi通信连接)。电子设备300可以显示用户界面280。该用户界面280中可包括课程资料、记笔记的文本输入框、课后习题等等内容。即用户可以在电子设备300上记笔记、完成课后习题。As shown in FIG. 2I , a communication connection (such as a Wi-Fi communication connection) is established between the electronic device 100 and the electronic device 300 . The electronic device 300 may display the user interface 280 . The user interface 280 may include course materials, text input boxes for taking notes, homework exercises and so on. That is, the user can take notes and complete homework exercises on the electronic device 300 .
当接收到上述作用在学生学习设备选择控件244的用户操作,电子设备100可以根据电子设备100的设备账号(如华为账号)以及学习应用的应用标识(如应用包名)查找自己是否存储有会话标识。在前述图2D~图2F所示的实施例中,电子设备100建立了会话。该会话为在电子设备100上登录当前的设备账号时基于学习应用的会话。那么,电子设备100可以查找到会话标识对应的会话。电子设备100可以从与该会话关联的快照信息中查找是否存在与调用记笔记和答题服务的电子设备连接的连接信息。When receiving the above-mentioned user operation acting on the student learning device selection control 244, the electronic device 100 can check whether it has stored sessions according to the device account of the electronic device 100 (such as Huawei account) and the application identification of the learning application (such as the application package name). logo. In the foregoing embodiments shown in FIG. 2D to FIG. 2F , the electronic device 100 establishes a session. The session is a session based on a learning application when logging into the current device account on the electronic device 100 . Then, the electronic device 100 can find the session corresponding to the session identifier. The electronic device 100 may find, from the snapshot information associated with the session, whether there is connection information connected to the electronic device calling the note-taking and quiz-answering service.
若存在上述与调用记笔记和答题服务的电子设备连接的连接信息,电子设备100可以与该连接信息指示的电子设备连接,并指示该电子设备调用记笔记和答题服务。If there is connection information about the electronic device calling the note-taking and answering service, the electronic device 100 may connect to the electronic device indicated by the connection information, and instruct the electronic device to call the note-taking and answering service.
在上述电子设备100与电子设备300连接,且电子设备100指示电子设备300调用记笔记和答题服务的过程中,电子设备100可以将电子设备100与电子设备300的连接信息存储至会话的存储沙箱中。可选的,电子设备100还可以将一个时刻电子设备300接收到的笔记和答题数据存储至该会话沙箱中。During the above-mentioned process in which the electronic device 100 is connected to the electronic device 300, and the electronic device 100 instructs the electronic device 300 to call the note-taking and answering service, the electronic device 100 may store the connection information between the electronic device 100 and the electronic device 300 in the storage sandbox of the session. in the box. Optionally, the electronic device 100 may also store notes and answer data received by the electronic device 300 in the session sandbox.
可以看出,图2G~图2I示例性示出了电子设备100未在快照信息中查找到连接信息的场景示意图。该连接信息为电子设备100与调用记笔记和答题服务的电子设备的连接信息。It can be seen that FIG. 2G to FIG. 2I exemplarily show schematic diagrams of scenarios where the electronic device 100 does not find the connection information in the snapshot information. The connection information is the connection information between the electronic device 100 and the electronic device that invokes the note-taking and answering service.
图2A~图2I所示的用户界面仅为示例性说明,不应对本申请构成限定。The user interfaces shown in FIG. 2A to FIG. 2I are only exemplary illustrations, and should not be construed as limiting the present application.
由上述图2A~图2I所示的实施例可知,电子设备100在首次请求其它电子设备协同工作,来实现应用场景A时,可以存储自己与上述其它电子设备的连接信息。上述连接信息可包括上述其它电子设备的设备标识、上述其它电子设备在协同工作中各自调用的应用的应用标识、上述其它电子设备在协同工作中各自调用的应用中服务的服务标识(可选的)。上述连接信息可用于电子设备100再次请求其它电子设备协同工作,来实现应用场景A时,与历史协同设备建立连接。并且,电子设备100可以指示历史协同设备调用在曾经实现应用场景A时各自调用的应用。这不仅简化了多个电子设备建立连接时的用户操作,还方便用户调用自己习惯的电子设备,更快地进入到熟悉的应用场景,提高了用户体验。From the embodiments shown in FIGS. 2A to 2I , it can be seen that when the electronic device 100 first requests other electronic devices to work together to implement application scenario A, it can store connection information between itself and the other electronic devices. The above connection information may include the device identifiers of the other electronic devices, the application identifiers of the applications invoked by the other electronic devices during the collaborative work, and the service identifiers of the services in the applications invoked by the other electronic devices during the collaborative work (optional ). The above connection information may be used by the electronic device 100 to establish a connection with the historical cooperation device when requesting other electronic devices to work together again to realize the application scenario A. And, the electronic device 100 may instruct the historical coordinated devices to call the applications that were respectively called when the application scenario A was implemented. This not only simplifies the user operation when multiple electronic devices are connected, but also facilitates the user to call the electronic device he is accustomed to, and enters the familiar application scene more quickly, thus improving the user experience.
在一些实施例中,电子设备100可以通过应用A请求与其它电子设备协同工作实现应用场景A。若电子设备100中存在在电子设备100上登录当前的设备账号时基于应用A的会话,且与该会话关联的快照信息中包括实现上述应用场景A时电子设备100与其它电子设备的连接信息,电子设备100可以根据该连接信息恢复与历史协同设备的连接关系,并指示历史协同设备调用在曾经实现应用场景A时各自调用的应用。上述历史协同设备可以是在曾经实现应用场景A时与电子设备100建立过连接关系的电子设备。In some embodiments, the electronic device 100 may implement the application scenario A by requesting the application A to cooperate with other electronic devices. If there is a session based on application A when the electronic device 100 logs in the current device account on the electronic device 100, and the snapshot information associated with the session includes the connection information between the electronic device 100 and other electronic devices when the above application scenario A is implemented, The electronic device 100 may restore the connection relationship with the historical coordination device according to the connection information, and instruct the historical coordination device to invoke the applications invoked when the application scenario A was implemented. The aforementioned historical collaboration device may be an electronic device that has established a connection relationship with the electronic device 100 when the application scenario A was implemented.
下面以电子设备100与其它电子设备建立连接关系时调用学习应用为例,介绍本申请实施例提供的另一种建立设备连接关系的场景。Taking the example of invoking a learning application when the electronic device 100 establishes a connection relationship with other electronic devices, another scenario of establishing a device connection relationship provided by the embodiment of the present application is introduced below.
图3A~图3F示例性示出了另一种建立设备连接关系的场景示意图。FIG. 3A to FIG. 3F exemplarily show another schematic diagram of a scenario for establishing a device connection relationship.
当开启学习应用,电子设备100可以显示如图3A所示的用户界面230。用户界面230包含的内容可以参考前述图2C的介绍。When the learning application is started, the electronic device 100 may display a user interface 230 as shown in FIG. 3A . For the content included in the user interface 230, reference may be made to the introduction of the aforementioned FIG. 2C.
如图3A所示,第一课课程已完成100%。第二课课程已完成30%。响应于作用在第二课课程选项的用户操作,电子设备100可以显示如图3B所示的用户界面240。用户界面240包含的内容可参考前述图2D的介绍。如图3B所示,课后习题区域243中的一部分习题已被完成。上述图3A所示的课程进度以及图3B所示的答题数据可以是根据与会话A关联的快照信息确定的。上述会话A为在电子设备100上登录当前的设备账号时基于学习应用的会话。As shown in Figure 3A, the first lesson is 100% complete. 30% of the second course is completed. In response to a user operation acting on the course option of the second lesson, the electronic device 100 may display a user interface 240 as shown in FIG. 3B . For the content contained in the user interface 240, reference may be made to the introduction of the aforementioned FIG. 2D. As shown in FIG. 3B , some exercises in the homework area 243 have been completed. The course progress shown in FIG. 3A and the answer data shown in FIG. 3B may be determined according to the snapshot information associated with session A. The above-mentioned session A is a session based on a learning application when logging into a current device account on the electronic device 100 .
会话A可以是前述图2A~图2I所示建立设备连接关系的过程中建立的。与会话A关联的快照信息可包括:电子设备100的设备标识、电子设备200的设备标识、电子设备200调用服务所属应用的应用标识、电子设备200调用服务的服务标识、电子设备200上播放课程视频的课程表示和播放进度、电子设备300的设备标识、电子设备300调用服务所属应用的应用标识、电子设备300调用服务的服务标识、电子设备300上接收到的笔记数据以及答题数据等。与会话A关联的快照信息存储在电子设备100为会话A分配的存储沙箱中。Session A may be established during the process of establishing a device connection relationship shown in FIG. 2A to FIG. 2I. The snapshot information associated with session A may include: the device identifier of the electronic device 100, the device identifier of the electronic device 200, the application identifier of the application to which the electronic device 200 invokes the service, the service identifier of the service invoked by the electronic device 200, and the course played on the electronic device 200. Course display and playback progress of the video, the device ID of the electronic device 300, the application ID of the application to which the electronic device 300 invokes the service, the service ID of the service invoked by the electronic device 300, note data and answer data received on the electronic device 300, etc. Snapshot information associated with session A is stored in a storage sandbox allocated for session A by electronic device 100 .
响应于作用在视频输出设备选择控件242的用户操作,电子设备100可以从与会话A关联的快照信息中查找是否存在与调用用于播放视频的应用的电子设备的连接信息。可选的,电子设备100还可以搜索与自己处于同一局域网,且可用于播放视频的电子设备。电子设备100搜索用于播放视频的电子设备的方法可以参考前述实施例的介绍。In response to a user operation acting on the video output device selection control 242 , the electronic device 100 may search from the snapshot information associated with session A whether there is connection information with the electronic device calling the application for playing the video. Optionally, the electronic device 100 can also search for an electronic device that is in the same local area network as itself and can be used to play videos. For a method for the electronic device 100 to search for an electronic device for playing a video, reference may be made to the introduction of the foregoing embodiments.
电子设备100可以显示图3C所示的用户界面250。用户界面250中可包括设备选择区域251。设备选择区域251可包括历史协同设备区域251A和附近可用设备区域251B。The electronic device 100 may display the user interface 250 shown in FIG. 3C. A device selection area 251 may be included in the user interface 250 . The device selection area 251 may include a historical collaborative device area 251A and a nearby available device area 251B.
其中,历史协同设备区域251中的设备选项可用于提示用户曾经与电子设备100连接且播放课程视频的电子设备。历史协同设备区域251A中的设备选项为电子设备100根据与会话A关联的快照信息查找到的电子设备的设备选项。例如,在与会话A关联的快照信息中,调用用于播放视频的应用(如提供课程视频播放服务的应用)的电子设备包括电子设备200(即张三的电视)。上述历史协同设备区域251A的设备选项中可包括电子设备200。Among them, the device option in the history cooperation device area 251 can be used to remind the user of the electronic device that has been connected with the electronic device 100 and played the course video. The device options in the history collaboration device area 251A are the device options of the electronic device found by the electronic device 100 according to the snapshot information associated with the session A. For example, in the snapshot information associated with session A, the electronic device that invokes an application for playing video (such as an application that provides a course video playback service) includes electronic device 200 (that is, Zhang San's TV). The device options in the historical collaboration device area 251A may include the electronic device 200 .
附近可用设备区域251B中的设备选项可用于提示用户未曾但可以与电子设备100连接且播放课程视频的电子设备。例如,电子设备100可以搜索与自己处于同一家庭Wi-Fi、可用于播放视频且未曾在自己的指示下播放过课程视频的电子设备。被搜索到的电子设备可以包括张三的平板、李四的平板、李四的电视。附近可用设备区域251B中的设备选项可以包括上述被搜索到的电子设备的设备选项。The device options in the nearby available devices area 251B can be used to prompt the user for electronic devices that the user has not but can connect with the electronic device 100 and play the lesson video. For example, the electronic device 100 can search for an electronic device that is in the same home Wi-Fi as itself, can be used to play videos, and has never played a course video under its instruction. The searched electronic devices may include Zhang San's tablet, Li Si's tablet, and Li Si's TV. The device options in the nearby available device area 251B may include the device options of the above-mentioned searched electronic devices.
如图3C所示,响应于作用在设备选项“张三的电视”的用户操作,电子设备100可以指示电子设备200调用课程视频播放服务。As shown in FIG. 3C , in response to the user operation on the device option "Zhang San's TV", the electronic device 100 may instruct the electronic device 200 to call the course video playing service.
如图3D所示,响应于作用在学生学习设备选择控件244的用户操作,电子设备100可以从与会话A关联的快照信息中查找是否存在与调用记笔记和答题服务的电子设备的连接信息。可选择的,电子设备100还可以搜索与自己处于同一局域网,且可调用记笔记和答题服务的电子设备。电子设备100搜索用于调用记笔记和答题服务的电子设备的方法可以参考前述实施例的介绍。As shown in FIG. 3D , in response to a user operation acting on the student learning device selection control 244 , the electronic device 100 may search from the snapshot information associated with session A whether there is connection information with the electronic device calling the note-taking and answering service. Optionally, the electronic device 100 can also search for an electronic device that is in the same local area network as itself and can call note-taking and question-answering services. For the method for the electronic device 100 to search for an electronic device for invoking the note-taking and answering service, reference may be made to the introduction of the foregoing embodiments.
电子设备100可以显示图3E所示的用户界面270。用户界面270可包括学习设备选择区域271。学习设备选择区域271中可包括历史学习设备区域271A和附近学习设备区域271B。The electronic device 100 may display the user interface 270 shown in FIG. 3E. User interface 270 may include a learning device selection area 271 . The learning device selection area 271 may include a historical learning device area 271A and a nearby learning device area 271B.
其中,历史学习设备区域271A中的设备选项可用于提示用户曾经与电子设备100连接且调用记笔记和答题服务的电子设备。历史学习设备区域271A中的设备选项为电子设备100根据与会话A关联的快照信息查找的电子设备的设备选项。例如,在与会话A关联的快照信息中,调用记笔记和答题服务的电子设备包括电子设备300(即张三的平板)。上述历史学习设备区域271A的设备选项中可包括电子设备300。Among them, the device option in the historical learning device area 271A can be used to remind the user of the electronic devices that have been connected with the electronic device 100 and invoked note-taking and answering services. The device options in the historical learning device area 271A are the device options of the electronic device that the electronic device 100 finds according to the snapshot information associated with the session A. For example, in the snapshot information associated with session A, the electronic device that invokes the note-taking and answering service includes electronic device 300 (that is, Zhang San's tablet). The device options in the history learning device area 271A may include the electronic device 300 .
附近学习设备区域271B中设备选项可用于提示用户未曾但可以与电子设备100连接且调用记笔记和答题服务的电子设备。例如,电子设备100可以搜索与自己处于同一家庭Wi-Fi、可调用记笔记和答题服务且未曾在自己的指示下调用记笔记和答题服务的电子设备。被搜索到的电子设备可以包括张三的电视、李四的平板、李四的电视。附近学习设备区域271B中的设备选项可以包括上述被搜索到的电子设备的设备选项。The device options in the nearby learning devices area 271B can be used to prompt the user for electronic devices that the user has not but can connect to the electronic device 100 and invoke note-taking and answering services. For example, the electronic device 100 may search for an electronic device that is in the same home Wi-Fi as itself, can call the note-taking and question-answering service, and has not called the note-taking and question-answering service under its instruction. The searched electronic devices may include Zhang San's TV, Li Si's tablet, and Li Si's TV. The device options in the nearby learning device area 271B may include the device options of the above-mentioned searched electronic devices.
如图3E所示,响应于作用在设备选项“张三的平板”的用户操作,电子设备100可以指示电子设备300调用记笔记和答题服务。As shown in FIG. 3E , in response to the user operation acting on the device option "Zhang San's Tablet", the electronic device 100 may instruct the electronic device 300 to call the note-taking and answering service.
如图3F所示,电子设备100与电子设备200、电子设备300之间建立有通信连接。As shown in FIG. 3F , communication connections are established between the electronic device 100 , the electronic device 200 , and the electronic device 300 .
电子设备100可以指示电子设备200调用课程视频播放服务(或者其它用于播放视频的应用、服务),来播放第二课课程视频。当接收到来自电子设备100的指令,电子设备200可以调用课程视频播放服务,显示如图3F所示的用户界面260。用户界面260为播放课程视频的用户界面。The electronic device 100 may instruct the electronic device 200 to call the course video playing service (or other applications and services for playing videos) to play the course video of the second lesson. When receiving an instruction from the electronic device 100, the electronic device 200 may invoke the course video playing service, and display the user interface 260 as shown in FIG. 3F. The user interface 260 is a user interface for playing course videos.
在一种可能的实现方式中,电子设备100可以从会话A的快照信息中确定出指示电子设备200播放课程视频时课程视频的课程标识和播放进度。上述课程视频的课程标识和播放进度可以为电子设备100最近一次更新会话A的快照信息中的数据。电子设备100可以将上述课程视频的课程标识和播放进度发送给电子设备200。电子设备200可以根据上述课程视频的课程标识和播放进度,在用户界面260中从上述播放进度指示的位置处开始播放上述课程标识对应的课程视频。例如,在电子设备100最近一次更新会话A的快照信息中,电子设备200播放课程视频的课程标识为第二课课程视频。第二课课程视频的播放进度为“3:04”。“3:04”可以表示第二课课程视频播放时3分4秒的位置处。电子设备100指示电子设备200调用课程视频播放服务时,可以将上述课程视频的课程标识以及播放进度发送给电子设备200。那么,电子设备200可以从3分4秒的位置处开始播放第二课课程视频。In a possible implementation manner, the electronic device 100 may determine, from the snapshot information of session A, the course identification and playing progress of the course video when the electronic device 200 is playing the course video. The above course identification and playing progress of the course video may be the data in the snapshot information of session A last updated by the electronic device 100 . The electronic device 100 may send the course identification and playing progress of the course video to the electronic device 200 . The electronic device 200 may start playing the course video corresponding to the above-mentioned course logo from the position indicated by the above-mentioned playing progress in the user interface 260 according to the course logo and the playing progress of the above-mentioned course video. For example, in the latest snapshot information of session A updated by the electronic device 100, the course identification of the course video played by the electronic device 200 is the second course course video. The playback progress of the second lesson video is "3:04". "3:04" may represent the position at 3 minutes and 4 seconds when the video of the second lesson is played. When the electronic device 100 instructs the electronic device 200 to call the course video playing service, it may send the course identification and playing progress of the course video to the electronic device 200 . Then, the electronic device 200 may start playing the second lesson video from the position of 3 minutes and 4 seconds.
在另一种可能的实现方式中,电子设备100与电子设备200建立图3F所示的通信连接时,可以将会话A的会话标识传递给电子设备200。电子设备200可以为会话A分配存储沙箱。电子设备200中该会话A的存储沙箱可用于存储播放课程视频的课程标识和播放进度等等数据。电子设备200可以周期性记录播放课程视频的课程标识和播放进度。或者,电子设备200可以响应用户操作(例如退出课程视频播放的用户操作)来记录播放课程视频的课程标识和播放进度。当接收到来自电子设备100用于调用课程视频播放服务的指令,电子设备200可以调用课程视频播放服务。其中,电子设备200可以根据会话A的存储沙箱中最近一次记录的数据来播放课程视频。例如,电子设备200中会话A的存储沙箱中最近一次记录的数据为:播放课程视频的课程标识为第二课课程视频的课程标识、播放进度为“3:04”。电子设备200可以从3分4秒的位置处开始播放第二课课程视频。In another possible implementation manner, when the electronic device 100 and the electronic device 200 establish the communication connection shown in FIG. 3F , the session identifier of the session A may be transferred to the electronic device 200 . The electronic device 200 may assign a storage sandbox to session A. The storage sandbox of the session A in the electronic device 200 can be used to store data such as the course identification and playing progress of playing the course video. The electronic device 200 may periodically record the course identification and playing progress of playing the course video. Alternatively, the electronic device 200 may record the course identification and playing progress of playing the course video in response to a user operation (for example, a user operation to quit playing the course video). When receiving an instruction from the electronic device 100 for invoking the course video playing service, the electronic device 200 may call the course video playing service. Wherein, the electronic device 200 may play the course video according to the last recorded data in the storage sandbox of session A. For example, the last recorded data in the storage sandbox of session A in the electronic device 200 is: the course ID of the course video played is the course ID of the second lesson video, and the playback progress is "3:04". The electronic device 200 may start playing the second lesson video from the position of 3 minutes and 4 seconds.
如图3F所示,电子设备100可以指示电子设备300调用记笔记和答题服务。当接收到来自电子设备100的指令,电子设备300调用记笔记和答题服务,显示如图3F所示的用户界面280。用户界面该280中可包括课程资料、记笔记的文本输入框、课后习题等等内容。即用户可以在电子设备300上记笔记、完成课后习题。As shown in FIG. 3F , the electronic device 100 may instruct the electronic device 300 to call a note-taking and answering service. When receiving an instruction from the electronic device 100, the electronic device 300 invokes the note taking and answering service, and displays the user interface 280 shown in FIG. 3F. The user interface 280 may include course materials, a text input box for taking notes, homework exercises and the like. That is, the user can take notes and complete homework exercises on the electronic device 300 .
如用户界面280所示,电子设备300可以显示最近一次接收到的笔记数据和答题数据。即用户可以从曾经记录的笔记处继续记笔记,并从曾经完成的课后习题处继续完成课后习题。其中,上述最近一次接收到的笔记数据和答题数据可以是电子设备100发送的,也可以是电子设备300从自己存储的会话A的存储沙箱中获取的。As shown in the user interface 280, the electronic device 300 can display the latest received note data and answer data. That is, the user can continue to take notes from the notes that have been recorded, and continue to complete the after-school exercises from the completed after-school exercises. Wherein, the note data and answer data received last time may be sent by the electronic device 100 , or may be obtained by the electronic device 300 from the storage sandbox of session A stored by the electronic device 300 .
上述图3A~图3F所示的用户界面仅为示例性说明,不应对本申请构成限定。The above user interfaces shown in FIGS. 3A to 3F are only exemplary illustrations, and should not be construed as limiting the present application.
由上述图3A~图3F所示的实施例可知,在电子设备100再次请求其它电子设备协同工作,来实现应用场景A时,电子设备100可以获取曾经实现应用场景A时建立的会话A的快照信息。根据该快照信息,电子设备100可以恢复与历史协同设备的连接关系,并指示历史协同设备调用在曾经实现应用场景A时各自调用的应用。上述历史协同设备可以是在曾经实现应用场景A时与电子设备100建立过连接关系的电子设备。这样,用户可以不用分别在多个电子设备上进行操作,来建立这多个电子设备的连接关系。这不仅简化了多个电子设备建立连接时的用户操作,还方便用户调用自己习惯的电子设备,更快地进入到熟悉的应用场景,提高了用户体验。It can be known from the above-mentioned embodiments shown in FIG. 3A to FIG. 3F that when the electronic device 100 requests other electronic devices to work together again to realize the application scenario A, the electronic device 100 can obtain a snapshot of the session A established when the application scenario A was implemented. information. According to the snapshot information, the electronic device 100 can restore the connection relationship with the historical coordinated device, and instruct the historical coordinated device to call the applications that were invoked when the application scenario A was implemented. The aforementioned historical collaboration device may be an electronic device that has established a connection relationship with the electronic device 100 when the application scenario A was implemented. In this way, the user can establish a connection relationship between the multiple electronic devices without performing operations on the multiple electronic devices respectively. This not only simplifies the user operation when multiple electronic devices are connected, but also facilitates the user to call the electronic device he is accustomed to, and enters the familiar application scene more quickly, thus improving the user experience.
另外,上述会话A的快照信息中还可包括在实现应用场景A时,电子设备100和历史协同设备各自调用应用的活动信息。根据该活动信息,电子设备100和历史协同设备调用应用实现应用场景A时可以将应用的状态恢复至活动信息指示的状态。该活动信息例如是视频的播放进度。电子设备可以从活动信息指示的播放进度来播放视频。这样,电子设备100和历史协同设备可以从最近一次中断协同工作的位置处继续协同工作,来实现应用场景A。In addition, the above-mentioned snapshot information of session A may also include the activity information of invoking applications by the electronic device 100 and the historical coordination device when the application scenario A is implemented. According to the activity information, when the electronic device 100 and the history coordination device invoke the application to implement the application scenario A, the state of the application can be restored to the state indicated by the activity information. The activity information is, for example, the playing progress of the video. The electronic device can play the video from the play progress indicated by the activity information. In this way, the electronic device 100 and the historical cooperation device can continue to work together from the position where the cooperation work was interrupted last time, so as to realize the application scenario A.
在一些实施例中,电子设备100中存储有会话A的会话标识以及会话A的快照信息。上述会话A的快照信息中包括电子设备100与电子设备200的连接信息、电子设备100电子设备300的连接信息。电子设备100与电子设备200、电子设备300协同工作可以实现应用场景A。响应于触发电子设备100与其它电子设备连接来实现应用场景A的用户操作,电子设备100可以获取A的快照信息。根据该快照信息,电子设备100可以自动与电子设备200、电子设备300连接,并指示电子设备200、电子设备调用相关应用来实现应用场景A。即,电子设备100可以自动恢复曾经建立过的连接关系,提高设备建立连接关系的效率。用户可以不用进行图3C和图3E所示选择设备的用户操作。这可以简化上述设备连接过程中的用户操作。In some embodiments, the electronic device 100 stores the session identifier of session A and the snapshot information of session A. The above-mentioned snapshot information of session A includes the connection information of the electronic device 100 and the electronic device 200 , and the connection information of the electronic device 100 and the electronic device 300 . The electronic device 100 cooperates with the electronic device 200 and the electronic device 300 to implement the application scenario A. In response to a user operation that triggers the connection of the electronic device 100 with other electronic devices to implement the application scenario A, the electronic device 100 may obtain the snapshot information of A. According to the snapshot information, the electronic device 100 can automatically connect with the electronic device 200 and the electronic device 300 , and instruct the electronic device 200 and the electronic device to call related applications to realize the application scenario A. That is, the electronic device 100 can automatically restore the connection relationship that was once established, so as to improve the efficiency of establishing the connection relationship on the device. The user may not perform the user operation of the selection device shown in FIG. 3C and FIG. 3E . This can simplify user operations during the connection of the aforementioned devices.
在一些实施例中,在电子设备100首次通过应用A请求与其它电子设备协同工作实现应用场景A时,电子设备100可以查询自己是否通过其它应用与其它电子设备进行过同类型的协同工作。上述同类型的协同工作可以表示电子设备100指示其它电子设备进行相同的动作。上述相同的动作例如是:播放视频的动作、文档编辑的动作等等。本申请实施例对上述动作的类型不作限定。In some embodiments, when the electronic device 100 requests to cooperate with other electronic devices through application A to implement application scenario A for the first time, the electronic device 100 may query whether it has performed the same type of cooperative work with other electronic devices through other applications. The aforementioned same type of cooperative work may mean that the electronic device 100 instructs other electronic devices to perform the same action. The above-mentioned same action is, for example, an action of playing a video, an action of editing a document, and so on. The embodiment of the present application does not limit the types of the foregoing actions.
若电子设备100查询到自己通过其它应用与其它电子设备进行过同类型的协同工作,电子设备100可以推荐上述同类型的协同工作过程中电子设备的连接关系。例如,电子设备100查询到自己通过应用B请求电子设备200调用播放视频的应用来播放视频。在电子设备100首次通过应用A请求其它电子设备播放视频时,电子设备100可以提示用户应用B曾经调用过电子设备200中播放视频的应用来播放视频。响应于选择上述电子设备200的用户操作,电子设备100可以通过应用A调用电子设备200中播放视频的应用来播放视频。If the electronic device 100 inquires that it has performed the same type of collaborative work with other electronic devices through other applications, the electronic device 100 may recommend the connection relationship of the electronic device during the same type of collaborative work. For example, the electronic device 100 finds out that it requests the electronic device 200 to play the video through the application B by invoking an application for playing the video. When the electronic device 100 requests other electronic devices to play a video through the application A for the first time, the electronic device 100 may prompt the user that the application B has called the video playing application in the electronic device 200 to play the video. In response to the user operation of selecting the above electronic device 200 , the electronic device 100 may call the video playing application in the electronic device 200 through the application A to play the video.
图4A~图4D示例性示出了另一种建立设备连接关系的场景示意图。4A to 4D exemplarily show another schematic diagram of a scenario for establishing a device connection relationship.
图4A所示的用户界面410可以参考前述图2A中用户界面210的介绍。用户界面410可包括网盘应用A图标411、网盘应用B图标412。即电子设备100中安装有网盘应用A的程序安装包、网盘应用B的程序安装包。For the user interface 410 shown in FIG. 4A, reference may be made to the introduction of the user interface 210 in FIG. 2A. The user interface 410 may include a network disk application A icon 411 and a network disk application B icon 412 . That is, the program installation package of the network disk application A and the program installation package of the network disk application B are installed in the electronic device 100 .
响应于作用在网盘应用B图标的用户操作,电子设备100可以显示如图4B所示的用户界面420。用户界面420可包括文档显示区域421、编辑控件422、分享控件423、下载控件424和删除控件425。其中:In response to a user operation acting on the icon of the network disk application B, the electronic device 100 may display a user interface 420 as shown in FIG. 4B . The user interface 420 may include a document display area 421 , an edit control 422 , a share control 423 , a download control 424 and a delete control 425 . in:
文档显示区域421可用于显示文档内容。The document display area 421 can be used to display document content.
分享控件423可用于分享文档显示区域421中的文档内容。The share control 423 can be used to share the content of the document in the document display area 421 .
下载控件424可用于下载文档显示区域421中的文档内容。The download control 424 can be used to download the document content in the document display area 421 .
删除控件425可用于将文档显示区域421中的文档内容从网盘应用B对应的云服务器中删除。The delete control 425 can be used to delete the document content in the document display area 421 from the cloud server corresponding to the network disk application B.
编辑控件422可用于编辑文档显示区域421中的文档内容。响应于作用在编辑控件422的用户操作,电子设备100可以搜索附近可用于编辑文档的电子设备,并显示如图4C所示的选项框426。选项框426A可包括本地编辑选项426A、推荐设备选择区域426B、可用设备选择区域426C、设备搜索控件426D。其中:The edit control 422 can be used to edit document content in the document display area 421 . In response to a user operation acting on the editing control 422, the electronic device 100 may search for nearby electronic devices that can be used to edit the document, and display an option box 426 as shown in FIG. 4C. The options box 426A may include a local edit option 426A, a recommended device selection area 426B, an available device selection area 426C, and a device search control 426D. in:
本地编辑选项426A可用于触发电子设备100调用自己安装的可用于进行文档编辑的应用,对图4B所示文档显示区域421中的文档内容进行编辑。The local editing option 426A can be used to trigger the electronic device 100 to invoke its own installed application for document editing, and edit the content of the document in the document display area 421 shown in FIG. 4B .
可用设备选择区域426C中可包括一个或多个电子设备的设备选项。这一个或多个电子设备可以是电子设备100搜索到的且未曾在自己的指示下进行文档编辑的电子设备。其中,电子设备100可以在与自己处于同一家庭Wi-Fi的电子设备中搜索。本申请实施例对电子设备100搜索附近可用于编辑文档的电子设备的方法不作限定。Device options for one or more electronic devices may be included in the available device selection area 426C. The one or more electronic devices may be electronic devices that are searched by the electronic device 100 and have not edited the document under its instruction. Wherein, the electronic device 100 may search among electronic devices that are in the same home Wi-Fi as the electronic device 100 . The embodiment of the present application does not limit the method for the electronic device 100 to search for nearby electronic devices that can be used to edit documents.
设备搜索控件426D可用于可用于触发电子设备100继续搜索与自己处于同一局域网(如同一家庭Wi-Fi)中,且可用于编辑文档的电子设备。The device search control 426D can be used to trigger the electronic device 100 to continue searching for an electronic device that is in the same local area network (such as the same home Wi-Fi) and can be used to edit documents.
推荐设备选择区域426B可包括一个或多个电子设备的设备选项。这一个或多个电子设备可以是曾经根据电子设备100的指示调用过用于进行文档编辑的应用的电子设备。示例性的,推荐设备选择区域426B包括电子设备300(即张三的平板)的设备选项、以及电子设备300的推荐信息“上次网盘应用A文档编辑协同使用文档编辑应用A”。也即是说,电子设备100曾经通过网盘应用A指示电子设备300调用文档编辑应用A进行文档编辑。电子设备100中存储有会话B的快照信息。上述会话B为在电子设备100上登录当前的设备账号时基于网盘应用A的会话。会话B的快照信息可包括:电子设备100的设备标识、电子设备300的设备标识、电子设备300调用应用的应用标识(如文档编辑应用A的应用包名)、电子设备300的动作类型(即文档编辑的动作)。电子设备100中可存在协同记录存储模块。该协同记录存储模块可用于存储电子设备100指示其它电子设备进行不同类型的协同工作的数据。这些数据可包括电子设备100和与之协同工作的电子设备各自调用的应用的应用标识、与电子设备100协同工作的电子设备所进行的动作的类型。那么,电子设备100在上述会话B中指示电子设备300进行文档编辑的相关数据可存储至上述协同记录存储模块。响应于作用在图4B所示编辑控件的用户操作,电子设备100可以从上述协同记录存储模块中查找电子设备100是否与指示过其它电子设备调用用于进行文档编辑的应用。Recommended device selection area 426B may include device options for one or more electronic devices. The one or more electronic devices may be the electronic devices that once invoked the application for document editing according to the instruction of the electronic device 100 . Exemplarily, the recommended device selection area 426B includes the device options of the electronic device 300 (ie Zhang San's tablet) and the recommendation information of the electronic device 300 "the last time the network disk application A was used for document editing together with the document editing application A". That is to say, the electronic device 100 once instructed the electronic device 300 to call the document editing application A to edit the document through the network disk application A. The snapshot information of session B is stored in the electronic device 100 . The above-mentioned session B is a session based on the network disk application A when logging in the current device account on the electronic device 100 . The snapshot information of session B may include: the device identifier of the electronic device 100, the device identifier of the electronic device 300, the application identifier of the application invoked by the electronic device 300 (such as the application package name of the document editing application A), the action type of the electronic device 300 (i.e. document editing actions). A collaborative record storage module may exist in the electronic device 100 . The collaboration record storage module can be used to store data that the electronic device 100 instructs other electronic devices to perform different types of collaborative work. These data may include the application identifiers of the applications invoked by the electronic device 100 and the electronic devices that work with it, and the types of actions performed by the electronic devices that work with the electronic device 100 . Then, the relevant data that the electronic device 100 instructs the electronic device 300 to edit the document in the above session B can be stored in the above collaborative record storage module. In response to a user operation acting on the editing control shown in FIG. 4B , the electronic device 100 may search from the collaborative record storage module whether the electronic device 100 has instructed other electronic devices to invoke an application for document editing.
响应于作用在电子设备300的设备选项的用户操作,电子设备100可以将图4B所示文档显示区域421中的文档数据发送给电子设备300,并指示电子设备300调用文档编辑应用A。In response to user operations on the device options of the electronic device 300, the electronic device 100 may send the document data in the document display area 421 shown in FIG.
如图4D所示,电子设备100和电子设备300之间建立有通信连接。当接收到电子设备100发送的文档数据和调用文档编辑应用A的指令,电子设备300可以调用文档编辑应用A,并显示用户界面430。用户界面430可包括文档编辑区域431、保存控件432和取消控件433。文档编辑区域431可用于显示文档内容。保存控件432可用于触发电子设备300保存文档编辑区域431中经过编辑的文档内容。响应于作用在保存控件432的用户操作,电子设备300还可以将经过编辑的文档内容发送给电子设备100。取消控件433用于触发电子设备删除对文档编辑区域431中文档内容的编辑操作。As shown in FIG. 4D , a communication connection is established between the electronic device 100 and the electronic device 300 . When receiving the document data sent by the electronic device 100 and the instruction to call the document editing application A, the electronic device 300 can call the document editing application A and display the user interface 430 . The user interface 430 may include a document editing area 431 , a save control 432 and a cancel control 433 . The document editing area 431 can be used to display document content. The save control 432 can be used to trigger the electronic device 300 to save the edited document content in the document editing area 431 . In response to a user operation acting on the save control 432 , the electronic device 300 can also send the edited document content to the electronic device 100 . The cancel control 433 is used to trigger the electronic device to delete the editing operation on the document content in the document editing area 431 .
需要进行说明的是,电子设备100首次通过网盘应用B指示电子设备300调用文档编辑应用A的过程中,电子设备100可以建立会话C,并为会话C分配存储沙箱。会话C的存储沙箱中可用于存储会话C的快照信息。该会话C的快照信息可包括:电子设备100的设备标识、电子设备300的设备标识、电子设备调用应用的应用标识(如网盘应用B的应用包名)、电子设备300的动作类型(即文档编辑的动作)。电子设备100在上述会话C中指示电子设备300进行文档编辑的相关数据可存储至上述协同记录存储模块。It should be noted that when the electronic device 100 instructs the electronic device 300 to call the document editing application A through the network disk application B for the first time, the electronic device 100 may establish a session C and assign a storage sandbox to the session C. The storage sandbox of session C can be used to store the snapshot information of session C. The snapshot information of the session C may include: the device identifier of the electronic device 100, the device identifier of the electronic device 300, the application identifier of the application invoked by the electronic device (such as the application package name of the network disk application B), the action type of the electronic device 300 (i.e. document editing actions). The relevant data that the electronic device 100 instructs the electronic device 300 to edit the document in the above session C can be stored in the above collaborative record storage module.
上述图4A~图4D所示的用户界面仅为示例性说明,不应对本申请构成限定。The above-mentioned user interfaces shown in FIGS. 4A-4D are only exemplary illustrations, and should not be construed as limiting the present application.
由上述图4A~图4D所示的实施例可知,电子设备100可以将自己指示其它电子设备进行不同类型的协同工作的数据存储在协同记录存储模块。在电子设备100通过应用A请求其它电子设备协同工作时,电子设备100可以从上述协同记录存储模块查找自己是否通过其它应用与其它电子设备进行过同类型的协同工作。若查找到,电子设备100可以通过应用A请求查找到的连接信息所指示的电子设备来进行上述同类型的协同工作。这可以方便用户调用自己习惯的电子设备来协同工作,提高用户的使用体验。It can be seen from the above embodiments shown in FIGS. 4A to 4D that the electronic device 100 can store the data that it instructs other electronic devices to perform different types of collaborative work in the collaborative record storage module. When the electronic device 100 requests other electronic devices to cooperate with each other through the application A, the electronic device 100 can check whether it has performed the same type of coordinated work with other electronic devices through other applications from the above-mentioned cooperation record storage module. If found, the electronic device 100 may request the electronic device indicated by the found connection information through the application A to perform the above-mentioned same type of collaborative work. This can facilitate the user to call the electronic device he is accustomed to to work together, and improve the user experience.
图5A~图5D示例性示出了另一种建立设备连接关系的场景示意图。5A to 5D exemplarily show another schematic diagram of a scenario for establishing a device connection relationship.
电子设备100可以显示如图5A所示的负一屏界面510。负一屏界面510可包括搜索栏510、应用栏512、快捷工具栏513和新闻栏514。其中:The electronic device 100 may display a negative one-screen interface 510 as shown in FIG. 5A . The negative one-screen interface 510 may include a search bar 510 , an application bar 512 , a shortcut tool bar 513 and a news bar 514 . in:
搜索栏510可用于在电子设备100本地或者在线搜索信息(如应用、新闻、文件等等)。The search bar 510 can be used to search for information (such as applications, news, files, etc.) locally on the electronic device 100 or online.
应用栏512中可包括一个或多个电子设备100最近使用的应用(如扫码应用、付款码应用、音乐应用等等)。例如,响应于作用在付款码应用的用户操作,电子设备100可以显示付款码。本申请实施例对应用栏512中的应用不作限定。The application bar 512 may include one or more recently used applications of the electronic device 100 (such as code scanning applications, payment code applications, music applications, etc.). For example, the electronic device 100 may display the payment code in response to a user operation acting on the payment code application. The embodiment of the present application does not limit the applications in the application column 512 .
新闻514可用于显示新闻信息。本申请实施例对新闻514中显示的新闻信息不作限定。 News 514 may be used to display news information. The embodiment of the present application does not limit the news information displayed in the news 514 .
快捷工具栏513可包括天气控件513A、快递控件513B和协同设备推荐控件513C。天气控件513可用于查看天气情况(如温度等)。快递控件513B可用于查看快递信息(如快递的物流状态等)。协同设备推荐控件513C可用于获取电子设备100中安装的应用可以请求协同工作的电子设备的信息。快捷工具栏513中还可以包括更多或更少的控件,本申请实施例对此不作限定。The shortcut toolbar 513 may include a weather control 513A, a courier control 513B, and a collaborative device recommendation control 513C. The weather control 513 can be used to view weather conditions (such as temperature, etc.). The courier control 513B can be used to check the courier information (such as the logistics status of the courier, etc.). The collaborative device recommendation control 513C can be used to acquire information of electronic devices that the application installed in the electronic device 100 can request for collaborative work. The shortcut toolbar 513 may also include more or fewer controls, which is not limited in this embodiment of the present application.
响应于作用在协同设备推荐控件513C的用户操作,电子设备100可以显示如图5B所示的用户界面520。用户界面520可以包括第一推荐框521、第二推荐框522和第三推荐框523。其中:In response to a user operation acting on the collaborative device recommendation control 513C, the electronic device 100 may display a user interface 520 as shown in FIG. 5B . The user interface 520 may include a first recommendation box 521 , a second recommendation box 522 and a third recommendation box 523 . in:
第一推荐框521可用于显示电子设备100通过学习应用请求协同工作的电子设备信息。第一推荐框521中可包括学习应用图标521A、上次使用设备521B、附近协同推荐设备521C。电子设备100中的学习应用可用于提供前述实施例中的习题答案提供服务。该学习应用即为 前述实施例中课程学习分布式应用中的习题答案提供应用。上次使用设备521B中的电子设备即为前述实施例中的历史协同设备。电子设备100曾经通过学习应用指示上次使用设备521B中的电子设备调用相关的应用进行协同工作。示例性的,上次使用设备521B包括名称为“张三的平板”的电子设备(即电子设备300)和名称为“张三的电视”的电子设备(即电子设备200)。上述会话A为在电子设备100上登录当前的设备账号时基于学习应用的会话。其中,电子设备300为学习终端,可以表示电子设备100指示电子设备300调用的应用为记笔记和答题应用。电子设备300提供记笔记和答题服务,显示如图3F所示的用户界面280。电子设备200为视频输出设备,可以表示电子设备100指示电子设备200进行协同工作的类型为播放视频。电子设备200可以调用用于播放视频的应用(如课程视频播放应用、华为视频应用),播放课程视频,显示如图3F所示的用户界面260。上述电子设备200和电子设备300的信息可以是电子设备100从会话A的存储沙箱中获取的。具体的获取方式可以参考前述实施例的介绍,这里不再赘述。The first recommendation box 521 may be used to display electronic device information requested by the electronic device 100 to work together through a learning application. The first recommendation box 521 may include a learning application icon 521A, a last used device 521B, and a nearby collaboratively recommended device 521C. The learning application in the electronic device 100 can be used to provide the exercise answer providing service in the foregoing embodiments. This learning application provides the application for the answers to the exercises in the course learning distributed application in the foregoing embodiments. The electronic device in the last used device 521B is the historical coordination device in the foregoing embodiment. The electronic device 100 once used the electronic device 521B in the device 521B to call a related application to perform collaborative work by learning the application instruction last time. Exemplarily, the last used device 521B includes an electronic device named "Zhang San's tablet" (namely the electronic device 300 ) and an electronic device named "Zhang San's TV" (namely the electronic device 200 ). The above-mentioned session A is a session based on a learning application when logging into a current device account on the electronic device 100 . Wherein, the electronic device 300 is a learning terminal, which may indicate that the electronic device 100 instructs the electronic device 300 to call an application for taking notes and answering questions. The electronic device 300 provides note-taking and question-answering services, and displays the user interface 280 as shown in FIG. 3F . The electronic device 200 is a video output device, which may indicate that the electronic device 100 instructs the electronic device 200 to play video as a type of collaborative work. The electronic device 200 can invoke an application for playing videos (such as a course video playing application, a Huawei video application), play the course video, and display a user interface 260 as shown in FIG. 3F . The above information of the electronic device 200 and the electronic device 300 may be acquired by the electronic device 100 from the storage sandbox of the session A. For a specific acquisition method, reference may be made to the introduction of the foregoing embodiments, and details are not repeated here.
在一些实施例中,电子设备100可以确定历史协同设备是否处于可用状态。例如,当从会话1的存储沙箱中获取到电子设备200的设备标识,电子设备100可以向电子设备200发送询问消息。若接收到来自电子设备200的回应,电子设备100可以确定电子设备200处于可用状态。若未接收到来自电子设备200的回应(如电子设备200处于断电状态,无法响应电子设备100的询问消息),电子设备200可以确定电子设备200处于不可用状态。本申请实施例对电子设备100确定历史协同设备是否处于可用状态的实现方式不作限定。In some embodiments, the electronic device 100 may determine whether the historical collaboration device is in an available state. For example, when the device identifier of the electronic device 200 is obtained from the storage sandbox of the session 1, the electronic device 100 may send an inquiry message to the electronic device 200 . If a response from the electronic device 200 is received, the electronic device 100 may determine that the electronic device 200 is in an available state. If no response is received from the electronic device 200 (for example, the electronic device 200 is in a power-off state and cannot respond to the inquiry message of the electronic device 100), the electronic device 200 may determine that the electronic device 200 is in an unavailable state. The embodiment of the present application does not limit the implementation manner for the electronic device 100 to determine whether the historical collaboration device is in an available state.
电子设备100可以对处于不可用的历史协同设备进行标记,以提示用户该历史协同设备不可用。例如,电子设备100确定上述电子设备200处于不可用状态。上次使用设备521B中的电子设备200可以呈现为灰色。本申请实施例对电子设备100标记不可用的历史协同设备的方法不作限定。The electronic device 100 may mark the historical coordination device that is unavailable, so as to prompt the user that the historical coordination device is unavailable. For example, the electronic device 100 determines that the electronic device 200 is in an unavailable state. The electronic device 200 in the last used device 521B may be grayed out. The embodiment of the present application does not limit the method for the electronic device 100 to mark an unavailable historical coordination device.
在一些实施例中,电子设备100在请求其它电子设备协同工作时,未指定该电子设备中调用的应用。该电子设备中的多个应用均可与电子设备100实现同类型的协同工作。电子设备100可以显示如图5C的应用选择界面530。响应于作用在应用选择界面530中选择任意一个应用选项的用户操作,电子设备100可以指示与自己协同工作的电子设备调用被选择的应用。示例性的,上次使用设备521B中的电子设备均处于可用状态。响应于作用在图5B所示上次使用设备521B的用户操作,电子设备100可以请求上述使用设备521B中的电子设备进行协同工作。其中,电子设备100可以指示电子设备300提供记笔记和答题服务,并指示电子设备200提供课程视频播放服务。电子设备300中用于提供记笔记和答题服务的应用为记笔记和答题应用。电子设备200中用于提供课程视频播放服务的应用包括课程视频播放应用和华为视频应用。电子设备100可以显示如图5C所示的应用选择界面530。应用选择界面530可包括应用选项区域521和确定控件532。应用选项区域521可包括课程视频播放应用的选项和华为视频应用的选项。响应于选择课程视频播放应用的选项的用户操作以及作用在确定控件532的用户操作,电子设备100可以指示电子设备200调用课程视频播放应用。另外,电子设备300可以调用记笔记和答题应用来提供记笔记和答题服务。In some embodiments, when the electronic device 100 requests other electronic devices to work together, it does not specify the application to be invoked in the electronic device. Multiple applications in the electronic device can achieve the same type of collaborative work with the electronic device 100 . The electronic device 100 may display an application selection interface 530 as shown in FIG. 5C . In response to a user operation for selecting any one of the application options in the application selection interface 530 , the electronic device 100 may instruct an electronic device that works with itself to invoke the selected application. Exemplarily, all the electronic devices in the last used device 521B are in an available state. In response to a user operation acting on the last used device 521B shown in FIG. 5B , the electronic device 100 may request the electronic devices in the above used device 521B to perform cooperative work. Wherein, the electronic device 100 may instruct the electronic device 300 to provide note-taking and question answering services, and instruct the electronic device 200 to provide course video playing services. The application in the electronic device 300 for providing note-taking and question-answering services is a note-taking and question-answering application. The applications in the electronic device 200 for providing the course video playing service include a course video playing application and a Huawei video application. The electronic device 100 may display an application selection interface 530 as shown in FIG. 5C . The application selection interface 530 may include an application option area 521 and a determination control 532 . The application option area 521 may include options for the course video playing application and options for the Huawei video application. In response to the user operation of selecting the option of the lesson video playing application and the user operation acting on the determination control 532 , the electronic device 100 may instruct the electronic device 200 to invoke the lesson video playing application. In addition, the electronic device 300 may invoke a note-taking and answering application to provide note-taking and answering services.
在一些实施例中,电子设备100可以根据会话A的快照信息来指定与自己协同工作的电子设备调用的应用。示例性的,根据会话A的快照信息,电子设备100可以确定自己曾经与电子设备200和电子设备300协同工作的过程中,电子设备200调用的应用为课程视频播放应用,电子设备300调用的应用为记笔记和答题应用。响应于作用在上次使用设备521B的用户操作,电子设备100可以指示电子设备200调用课程视频播放应用,并指示电子设备300 调用记笔记和答题应用。In some embodiments, the electronic device 100 may specify an application invoked by the electronic device that works with itself according to the snapshot information of session A. Exemplarily, according to the snapshot information of session A, the electronic device 100 can determine that in the process of cooperating with the electronic device 200 and the electronic device 300, the application invoked by the electronic device 200 is a course video playing application, and the application invoked by the electronic device 300 App for note taking and answering questions. In response to the user operation acting on the last used device 521B, the electronic device 100 may instruct the electronic device 200 to invoke the course video playing application, and instruct the electronic device 300 to invoke the note-taking and answering application.
在一些实施例中,电子设备100可以响应作用在上次使用设备521B中任意一个电子设备上的用户操作,并指示该电子设备提供相应的服务。示例性的,响应于作用在上次使用设备521B中名称为“张三的平板”的电子设备的用户操作,电子设备100可以指示名称为“张三的平板”的电子设备提供记笔记和答题服务。进一步的,响应于作用在上次使用设备521B中名称为“张三的电视”的电子设备的用户操作,电子设备100可以指示名称为“张三的电视”的电子设备提供课程视频播放服务。In some embodiments, the electronic device 100 may respond to a user operation on any electronic device in the last used device 521B, and instruct the electronic device to provide a corresponding service. Exemplarily, in response to user operations on the electronic device named "Zhang San's Tablet" in the last used device 521B, the electronic device 100 may instruct the electronic device named "Zhang San's Tablet" to provide notes and answer questions. Serve. Further, in response to the user operation on the electronic device named "Zhang San's TV" in the last used device 521B, the electronic device 100 may instruct the electronic device named "Zhang San's TV" to provide the course video playing service.
附近协同推荐设备521C可以包括电子设备100搜索到,但未在电子设备100的指示下进行协同工作的电子设备。例如,名称为“李四的平板”的电子设备和名称为“李四的电视”的电子设备。其中,根据上述会话1的快照信息,电子设备100可以将与历史协同设备同类型的电子设备推荐为与该历史协同设备进行同类型的协同工作的电子设备。例如,名称为“李四的平板”的电子设备与电子设备300是同类型的电子设备。电子设备100可以将名称为“李四的平板”的电子设备确定为学习终端。即响应于作用在附近协同推荐设备521的用户操作,电子设备100可以指示名称为“李四的平板”的电子设备调用记笔记和答题应用。同样的,名称为“李四的电视”的电子设备与电子设备200是同类型的电子设备。电子设备100可以将名称为“李四的电视”的电子设备确定为视频输出设备。即响应于作用在附近协同推荐设备521的用户操作,电子设备100可以指示名称为“李四的电视”的电子设备播放课程视频。电子设备100搜索得到附近协同推荐设备521C中的电子设备的方法可以参考前述图2E所示的实施例,这里不再赘述。The nearby collaborative recommendation device 521C may include electronic devices searched by the electronic device 100 but not performing collaborative work under the instruction of the electronic device 100 . For example, an electronic device named "Si Li's tablet" and an electronic device named "Si Li's TV". Wherein, according to the above-mentioned snapshot information of session 1, the electronic device 100 may recommend an electronic device of the same type as the historical collaborative device as an electronic device that performs the same type of collaborative work with the historical collaborative device. For example, the electronic device named "Lisi's Tablet" and the electronic device 300 are of the same type. The electronic device 100 may determine the electronic device named "Li Si's Tablet" as the learning terminal. That is, in response to a user operation acting on the nearby collaborative recommendation device 521 , the electronic device 100 may instruct the electronic device named "Li Si's Tablet" to invoke the note-taking and question-answering application. Similarly, the electronic device named "Li Si's TV" and the electronic device 200 are of the same type. The electronic device 100 may determine the electronic device named "Lisi's TV" as the video output device. That is, in response to a user operation acting on the nearby collaborative recommendation device 521 , the electronic device 100 may instruct the electronic device named "Li Si's TV" to play the course video. For the method for the electronic device 100 to search for the electronic devices in the nearby collaborative recommendation device 521C, reference may be made to the embodiment shown in FIG. 2E , which will not be repeated here.
第二推荐框522可用于显示电子设备100通过网盘应用A请求协同工作的电子设备信息。第二推荐框522中可包括网盘应用A图标522A、上次使用设备522B、附近协同推荐设备522C。上次使用设备522B、附近协同推荐设备522C可以参考前述第一推荐框521中的介绍,这里不再赘述。网盘应用A可以是前述实施例中的传统应用。由第二推荐框522可知,电子设备100曾经通过网盘应用A指示名称为“张三的平板”的电子设备进行文档编辑的协同工作。The second recommendation box 522 may be used to display the electronic device information requested by the electronic device 100 to work together through the network disk application A. The second recommendation box 522 may include a network disk application A icon 522A, a last used device 522B, and a nearby collaboratively recommended device 522C. For the device 522B used last time and the nearby collaboratively recommended device 522C, reference may be made to the introduction in the aforementioned first recommendation box 521 , which will not be repeated here. The network disk application A may be the traditional application in the foregoing embodiments. It can be known from the second recommendation box 522 that the electronic device 100 once instructed the electronic device named "Zhang San's tablet" to perform collaborative work on document editing through the network disk application A.
第三推荐框522可用于显示电子设备100通过网盘应用B请求协同工作的电子设备信息。第三推荐框522中可包括网盘应用B图标523A和附近协同推荐设备523B。附近协同推荐设备523B中可包括电子设备100通过网盘应用B之外的应用请求进行同类型的协同工作的电子设备。示例性的,电子设备100未通过网盘应用B请求其它电子设备进行协同工作。电子设备100可以在前述协同记录存储模块中查找到自己通过网盘应用A指示名称为“张三的平板”的电子设备调用文档编辑应用A。附近协同推荐设备523B中可包括名称为“张三的平板”的电子设备。附近协同推荐设备523B中还可以包括提示语“上次网盘应用A文档编辑协同使用文档编辑应用A”,来向用户推荐同一类型协同工作的记录。The third recommendation box 522 may be used to display the electronic device information requested by the electronic device 100 for collaborative work through the network disk application B. The third recommendation box 522 may include a network disk application B icon 523A and a nearby collaborative recommendation device 523B. The nearby collaborative recommendation device 523B may include electronic devices that the electronic device 100 requests to perform the same type of collaborative work through applications other than the network disk application B. Exemplarily, the electronic device 100 does not request other electronic devices to perform cooperative work through the network disk application B. The electronic device 100 can find out in the aforementioned cooperative record storage module that it calls the document editing application A through the network disk application A and instructs the electronic device named "Zhang San's tablet". The nearby collaborative recommendation device 523B may include an electronic device named "Zhang San's tablet". The nearby collaborative recommendation device 523B may also include a prompt "the last time the network disk application A document edited collaboratively used the document editing application A" to recommend the same type of collaborative work records to the user.
如图5D所示,响应于作用在附近协同推荐设备523B的用户操作,电子设备100可以通过网盘应用B指示名称为“张三的平板”的电子设备调用文档编辑应用A。这样,对于电子设备100中一个未与其它电子设备协同工作的应用,用户也可以方便地在电子设备100上通过该应用调用自己习惯的电子设备来协同工作,提高用户的使用体验。电子设备100推荐同类型的协同工作的电子设备的具体方法可以参考前述图4A~图4D所示的实施例。As shown in FIG. 5D , in response to a user operation acting on the nearby collaborative recommendation device 523B, the electronic device 100 can instruct the electronic device named "Zhang San's tablet" to invoke the document editing application A through the network disk application B. In this way, for an application in the electronic device 100 that does not cooperate with other electronic devices, the user can also conveniently use the application on the electronic device 100 to call the electronic device that he is used to to work together, thereby improving the user experience. For a specific method for the electronic device 100 to recommend electronic devices that work together in the same type, reference may be made to the foregoing embodiments shown in FIG. 4A to FIG. 4D .
用户界面520中还可以包含更多或更少与电子设备100中的应用关联的推荐框。The user interface 520 may also include more or less recommendation boxes associated with applications in the electronic device 100 .
电子设备100显示图5A所示负一屏界面510的方法可以参考现有技术中的实现方法,本申请实施例对此不作限定。For the method for the electronic device 100 to display the negative one-screen interface 510 shown in FIG. 5A , reference may be made to the implementation method in the prior art, which is not limited in this embodiment of the present application.
图5A~图5D示例性示出了一些用户在电子设备100上通过一个应用来请求其它电子设 备协同工作的用户操作。其中,电子设备100通过一个应用请求其它电子设备协同工作过程中,电子设备之间建立通信连接的方法、电子设备创建会话和存储会话的快照信息的方法均可以参考前述实施例。相比于图3A~图3F和图4A~图4D所示的用户操作,通过图5A~图5D所示的用户操作,用户可以在负一屏界面510中的快捷工具栏,更便捷地通过一个应用与其它电子设备建立通信连接并请求上述其它电子设备协同工作。FIG. 5A-FIG. 5D exemplarily show user operations in which some users request other electronic devices to work together through an application on the electronic device 100. Wherein, when the electronic device 100 requests other electronic devices to work together through an application, the method for establishing a communication connection between the electronic devices, the method for creating a session and storing snapshot information of the session by the electronic device can refer to the foregoing embodiments. Compared with the user operations shown in FIGS. 3A to 3F and FIGS. 4A to 4D , through the user operations shown in FIGS. 5A to 5D , the user can more conveniently access the An application establishes a communication connection with other electronic devices and requests the above-mentioned other electronic devices to work together.
下面基于图2A~图2I所示的场景,介绍本申请实施例提供的一种通信系统500。Based on the scenarios shown in FIG. 2A to FIG. 2I , a communication system 500 provided in the embodiment of the present application is introduced below.
图6示例性示出了通信系统500的架构示意图。如图6所示,通信系统500可包括电子设备100、电子设备200和电子设备300。电子设备100、电子设备200和电子设备300中安装有课程学习分布式应用中不同服务的程序安装包。例如,电子设备100中安装有习题答案提供应用。该习题答案提供应用可以提供习题答案提供服务(即ability1)。该习题答案提供应用可以是前述图2A中学习应用图标211对应的应用。电子设备200中安装有课程视频播放应用。该课程视频播放应用可以提供课程视频播放服务(即ability2)。电子设备300中安装有记笔记和答题应用。该记笔记和答题应用可以提供记笔记和答题服务(即ability3)。上述习题答案提供应用、上述课程视频播放应用、上述记笔记和答题应用均属于课程学习分布式应用。上述课程学习分布式应用的应用包名可以例如是com.example.study。可提供一个分布式应用中一项服务的应用还可以具有服务包名。例如,上述记笔记和答题应用还可以具有服务包名,如:.StudyNotePadServiceAbility。本申请对上述应用包名不作限定。可选的,用于提供一个分布式应用中不同服务的应用也可以具有不同的应用包名。FIG. 6 exemplarily shows a schematic structural diagram of a communication system 500 . As shown in FIG. 6 , a communication system 500 may include an electronic device 100 , an electronic device 200 and an electronic device 300 . The electronic device 100, the electronic device 200 and the electronic device 300 are installed with program installation packages of different services in the course learning distributed application. For example, an application for providing answers to exercises is installed in the electronic device 100 . The exercise answer providing application can provide exercise answer providing service (namely ability1). The application for providing answers to exercises may be the application corresponding to the learning application icon 211 in FIG. 2A . A course video playing application is installed in the electronic device 200 . The course video playing application can provide a course video playing service (namely ability2). Note-taking and question-answering applications are installed in the electronic device 300 . The note-taking and question-answering application may provide note-taking and question-answering services (ie, ability3). The above-mentioned application for providing answers to exercises, the above-mentioned application for playing course video, and the above-mentioned application for taking notes and answering questions are all distributed applications for course learning. The application package name of the distributed application for learning the above course may be, for example, com.example.study. An application that can provide a service in a distributed application can also have a service package name. For example, the above note-taking and question-answering application may also have a service package name, such as: .StudyNotePadServiceAbility. This application does not limit the above application package names. Optionally, applications used to provide different services in a distributed application may also have different application package names.
在一些实施例中,电子设备100中的习题答案提供应用还包括设备连接程序。上述设备连接程序可用于电子设备100与其它电子设备协同工作。其中,运行上述设备连接程序,电子设备100可以与设备连接程序中指示的电子设备建立通信连接。电子设备100还可以指示与之连接的电子设备调用相应的应用。可选的,上述设备连接程序和习题答案提供应用可以分别包含于两个独立的程序安装包。当电子设备100安装上述习题答案提供应用和设备连接程序,电子设备100可以通过习题答案提供应用中的接口(如图2D所示的视频输出设备选择控件242、学生学习设备选择控件243)接收相关用户操作,执行设备连接程序,来调用其它电子设备进行协同工作。或者,电子设备100可以通过图5A所示快捷工具栏513中的接口(如协同设备推荐控件513C)接收相关用户操作,执行设备连接程序,来调用其它电子设备进行协同工作。In some embodiments, the exercise answer providing application in the electronic device 100 further includes a device connection program. The above device connection program can be used for the electronic device 100 to cooperate with other electronic devices. Wherein, by running the above device connection program, the electronic device 100 can establish a communication connection with the electronic device indicated in the device connection program. The electronic device 100 may also instruct the electronic device connected to it to invoke a corresponding application. Optionally, the above-mentioned device connection program and the application for providing answers to exercises may be included in two independent program installation packages. When the electronic device 100 installs the above-mentioned exercise answer providing application and device connection program, the electronic device 100 can receive relevant information through the interface in the exercise answer providing application (such as the video output device selection control 242 and the student learning device selection control 243 shown in FIG. 2D ). The user operates and executes the device connection program to call other electronic devices for collaborative work. Alternatively, the electronic device 100 may receive relevant user operations through the interface in the shortcut toolbar 513 shown in FIG. 5A (such as the collaborative device recommendation control 513C), execute the device connection program, and call other electronic devices for collaborative work.
示例性的,电子设备100中设备连接程序可以为:Exemplarily, the device connection program in the electronic device 100 may be:
Figure PCTCN2022083299-appb-000005
Figure PCTCN2022083299-appb-000005
Figure PCTCN2022083299-appb-000006
Figure PCTCN2022083299-appb-000006
上述指令“reqConnections”可用于定义不同类型的协同工作。协同工作的类型可以由电子设备100指示其它电子设备所进行的动作的类型确定。下述表1可说明在定义不同类型的协同工作时需要确定的字段,以及各字段的含义。The above directive "reqConnections" can be used to define different types of coroutines. The type of cooperative work may be determined by the type of action that the electronic device 100 instructs other electronic devices to perform. The following Table 1 can illustrate the fields that need to be determined when defining different types of collaborative work, and the meaning of each field.
字段field 是否必选Is it required? 描述describe
actionaction Yes 动作的类型type of action
devicesdevices Yes 可连接的设备类型Connectable Device Types
bundleNamebundleName no 应用包名Application package name
abilityNameabilityName no 服务包名service package name
labellabel no 动作的名称action name
表1Table 1
由表1可知,字段“action”、“devices”是必须确定的字段。字段“bundleName”、“abilityName”、“label”是可选的字段。不限于上述字段,定义不同类型的协同工作时还可以包含更多或更少的字段。It can be seen from Table 1 that the fields "action" and "devices" must be determined. The fields "bundleName", "abilityName", "label" are optional fields. Not limited to the above fields, more or less fields may be included when defining different types of collaborative work.
由上述设备连接程序可知,上述指令“reqConnections”中定义了两种不同类型的协同工作。其中,第一种类型的协同工作为电子设备100指示其它电子设备播放视频的协同工作。在该第一种类型的协同工作中,电子设备100可以连接的设备类型包括:手机、平板、电视、智能汽车。即电子设备100在搜索电子设备时,可以搜索上述字段“devices”中包括的设备类 型。该第一种类型的协同工作没有指定应用包名和服务包名。即电子设备100指示其它电子设备播放课程视频时,不指定上述其它电子设备调用的应用。It can be seen from the above device connection program that two different types of cooperative work are defined in the above instruction "reqConnections". Wherein, the first type of collaborative work is the collaborative work in which the electronic device 100 instructs other electronic devices to play videos. In the first type of collaborative work, the types of devices to which the electronic device 100 can be connected include: mobile phones, tablets, TVs, and smart cars. That is, when the electronic device 100 searches for electronic devices, it can search for the device types included in the above-mentioned field "devices". This first type of collaboration does not specify the application package name and service package name. That is, when the electronic device 100 instructs other electronic devices to play the course video, it does not specify the application called by the other electronic devices.
在一种可能的实现方式中,电子设备100通过习题答案提供应用指示电子设备200播放课程视频。电子设备200可以优先调用与上述习题答案提供应用属于同一分布式应用的应用(如课程视频播放应用)来播放课程视频。若电子设备200中未安装有上述课程视频播放应用,电子设备100可以调用其它应用(如华为视频应用)来播放课程视频。In a possible implementation manner, the electronic device 100 instructs the electronic device 200 to play the course video through the exercise answer providing application. The electronic device 200 may preferentially call an application that belongs to the same distributed application as the above-mentioned exercise answer providing application (such as a course video playing application) to play the course video. If the above-mentioned course video playing application is not installed in the electronic device 200, the electronic device 100 may call other applications (such as Huawei video application) to play the course video.
在另一种可能的实现方式中,电子设备100曾经通过习题答案提供应用指示电子设备200播放课程视频,且电子设备200调用上述课程视频播放应用来播放课程视频。电子设备100中存储有会话1的快照信息。该会话1为在电子设备100上登录当前的设备账号时基于习题答案提供应用的会话。该会话1的快照信息中可包括上述课程视频播放应用的应用标识(即课程学习分布式应用的应用包名com.example.study)。当电子设备100再次通过习题答案提供应用指示电子设备200播放课程视频时,电子设备100可以将上述课程视频播放应用的应用标识发送给电子设备200,来指示电子设备200调用历史协同应用(即上述课程视频播放应用)播放课程视频。若电子设备200无法调用上述课程视频播放应用,电子设备200也可以调用其它应用(如华为视频应用)来播放课程视频。In another possible implementation, the electronic device 100 instructs the electronic device 200 to play the course video through the exercise answer providing application, and the electronic device 200 invokes the above-mentioned course video playing application to play the course video. Snapshot information of session 1 is stored in electronic device 100 . The session 1 is a session in which an application is provided based on the answers to exercises when the electronic device 100 is logged into the current device account. The snapshot information of session 1 may include the application identifier of the course video playing application (ie, the application package name com.example.study of the course learning distributed application). When the electronic device 100 instructs the electronic device 200 to play the course video through the exercise answer providing application again, the electronic device 100 may send the application identification of the above-mentioned course video playing application to the electronic device 200 to instruct the electronic device 200 to call the historical collaborative application (that is, the above-mentioned Course video playback application) to play course videos. If the electronic device 200 cannot call the above course video playing application, the electronic device 200 can also call other applications (such as Huawei video application) to play the course video.
在另一种可能的实现方式中,电子设备100通过习题答案提供应用指示电子设备200播放课程视频。电子设备200可以查找可用于播放视频的应用,并显示查找到应用的应用选项。响应于选择上述应用选项中一个应用选项的用户操作,电子设备200可以调用该应用选项对应的应用来播放课程视频。In another possible implementation manner, the electronic device 100 instructs the electronic device 200 to play the course video through the exercise answer providing application. The electronic device 200 can search for an application that can be used to play the video, and display the application options of the found application. In response to a user operation of selecting one of the above application options, the electronic device 200 may invoke an application corresponding to the application option to play the course video.
第二种类型的协同工作为电子设备100指示其它电子设备提供记笔记和答题服务的协同工作。该第二种类型的协同工作指定了应用包名和服务包名。上述应用包名和服务包名可用于指示电子设备协同工作的实现方式。即电子设备100指示其它电子设备提供记笔记和答题服务时,指定上述其它电子设备调用的应用。The second type of collaborative work is that the electronic device 100 instructs other electronic devices to provide note-taking and question-answering services. This second type of collaboration specifies an application package name and a service package name. The above application package name and service package name can be used to indicate the implementation manner of electronic equipment working together. That is, when the electronic device 100 instructs other electronic devices to provide note-taking and question-answering services, it specifies the application called by the other electronic devices.
示例性的,电子设备100通过习题答案提供应用指示电子设备300调用上述记笔记和答题应用。若电子设备300中安装有记笔记和答题应用,电子设备300可以调用记笔记和答题应用。若电子设备300中没有安装记笔记和答题应用,电子设备300可以向云服务器获取记笔记和答题应用并进行调用。Exemplarily, the electronic device 100 instructs the electronic device 300 to invoke the aforementioned note-taking and question-answering application through the exercise answer providing application. If the note-taking and question-answering application is installed in the electronic device 300, the electronic device 300 can invoke the note-taking and question-answering application. If the note-taking and question-answering application is not installed in the electronic device 300, the electronic device 300 may obtain and call the note-taking and question-answering application from the cloud server.
在一些实施例中,上述设备连接程序中定义一种类型的协同工作时可以仅指定应用包名,而不指定服务包名。示例性的,电子设备100通过习题答案提供应用指示电子设备200调用传统应用(如华为视频应用),来播放课程视频。上述第一种类型的协同工作的定义中可包括字段“bundleName”。该字段“bundleName”的值可以为华为视频应用的应用包名。In some embodiments, when defining a type of cooperative work in the above-mentioned device connection program, only the name of the application package may be specified without specifying the name of the service package. Exemplarily, the electronic device 100 instructs the electronic device 200 to call a traditional application (such as a Huawei video application) to play the course video through the exercise answer providing application. The definition of the above-mentioned first type of collaborative work may include a field "bundleName". The value of the field "bundleName" can be the application package name of the Huawei video application.
上述指令“onConnectAbilityReq”可用于电子设备100与电子设备300建立连接,并指示电子设备300调用记笔记和答题应用。The above instruction "onConnectAbilityReq" can be used to establish a connection between the electronic device 100 and the electronic device 300, and instruct the electronic device 300 to call the note-taking and answering application.
在一些实施例中,电子设备100首次通过上述习题答案提供应用请求其它电子设备协同工作。例如,电子设备100请求电子设备300调用记笔记和答题应用。电子设备300调用记笔记和答题应用可以显示如图2I所述的用户界面280。电子设备100可以创建图6所示的会话1。电子设备100可以根据电子设备100上登录的设备账号以及习题答案提供应用的应用包名(如com.example.study)确定会话1的会话标识。电子设备100可以为会话1分配存储沙箱(即图6所示的会话1存储沙箱A)。会话1存储沙箱A的位置可以是:…/data/user/<电子设备100的设备账号>/com.example.study/<会话1的会话标识>/…。In some embodiments, the electronic device 100 requests other electronic devices to work cooperatively through the above-mentioned exercise answer providing application for the first time. For example, the electronic device 100 requests the electronic device 300 to invoke a note-taking and answering application. The electronic device 300 invoking the note-taking and answering application may display the user interface 280 as described in FIG. 2I. The electronic device 100 can create a session 1 shown in FIG. 6 . The electronic device 100 may determine the session ID of the session 1 according to the device account logged in on the electronic device 100 and the application package name (such as com.example.study) of the exercise answer providing application. The electronic device 100 may assign a storage sandbox to session 1 (ie session 1 storage sandbox A shown in FIG. 6 ). The location where session 1 stores sandbox A may be: .../data/user/<device account of electronic device 100>/com.example.study/<session ID of session 1>/....
由于上述第二种类型的协同工作的定义中指定了应用包名和服务包名,电子设备100可以将上述会话1的会话标识传递给电子设备300,并指示电子设备300调用记笔记和答题应用。电子设备300中,上述会话1的会话标识可以传递至上述记笔记和答题应用。电子设备300可以在本地为会话1分配存储沙箱(即图6所示的会话1存储沙箱C)。会话1存储沙箱C的位置可以是:…/data/user/<电子设备300的设备账号>/com.example.study/<会话1的会话标识>/…。Since the application package name and service package name are specified in the definition of the above-mentioned second type of collaborative work, the electronic device 100 can pass the session identifier of the above-mentioned session 1 to the electronic device 300, and instruct the electronic device 300 to call the note-taking and answering application. In the electronic device 300, the session identifier of the above-mentioned session 1 may be transmitted to the above-mentioned note-taking and question-answering application. The electronic device 300 may locally allocate a storage sandbox for session 1 (ie, session 1 storage sandbox C shown in FIG. 6 ). The location where session 1 stores sandbox C may be: .../data/user/<device account of electronic device 300>/com.example.study/<session identifier of session 1>/....
会话1存储沙箱A可用于存储会话1的快照信息。会话1的快照信息可包括电子设备100与电子设备300的连接信息。该连接信息可包括:电子设备100的设备标识、电子设备300的设备标识、电子设备300调用服务所述应用的应用标识、电子设备300调用服务的服务标识,电子设备300动作的类型。会话1的快照信息还可包括电子设备300中记笔记和答题应用的活动信息。该活动信息可包括:笔记数据、答题数据。不限于上述内容,会话1的快照信息还可以包括更多或更少的内容。Session 1 storage sandbox A can be used to store the snapshot information of session 1. The snapshot information of session 1 may include connection information of the electronic device 100 and the electronic device 300 . The connection information may include: the device ID of the electronic device 100, the device ID of the electronic device 300, the application ID of the application invoked by the electronic device 300, the service ID of the service invoked by the electronic device 300, and the action type of the electronic device 300. The snapshot information of Session 1 may also include activity information of note-taking and quiz-answering applications in the electronic device 300 . The activity information may include: note data, answer data. Not limited to the above content, the snapshot information of session 1 may also include more or less content.
会话1存储沙箱C可用于存储上述电子设备300中记笔记和答题应用的活动信息。当再次调用上述记笔记和答题应用时,电子设备300可以根据会话1存储沙箱C中存储的上述活动信息来确定记笔记和答题应用的状态。这样,电子设备100再次指示电子设备300调用记笔记和答题应用时,电子设备300可以将记笔记和答题应用恢复至最近一次退出记笔记和答题应用的状态。The session 1 storage sandbox C can be used to store activity information of note-taking and question-answering applications in the above-mentioned electronic device 300 . When the above note-taking and question-answering application is invoked again, the electronic device 300 may determine the state of the note-taking and question-answering application according to the above-mentioned activity information stored in the session 1 storage sandbox C. In this way, when the electronic device 100 instructs the electronic device 300 to invoke the note-taking and question-answering application again, the electronic device 300 can restore the note-taking and question-answering application to the state that the note-taking and question-answering application was exited last time.
电子设备100创建会话1的场景不限于上述电子设备100首次通过上述习题答案提供应用请求其它电子设备协同工作的场景。在一些实施例中,电子设备100曾经通过上述习题答案提供应用请求电子设备300调用过记笔记和答题服务,且该过程创建的会话已被清理。那么,电子设备100再次通过上述习题答案提供应用请求其它电子设备协同工作时,电子设备100查找不到响应的会话标识。电子设备100可以创建会话1。该会话1是在电子设备100登录当前设备账号时基于上述习题答案提供应用的会话。The scenario in which the electronic device 100 creates the session 1 is not limited to the scenario in which the electronic device 100 requests other electronic devices to work together through the above exercise answer providing application for the first time. In some embodiments, the electronic device 100 once requested the electronic device 300 to call the note-taking and answering service through the above-mentioned exercise answer providing application, and the session created by this process has been cleared. Then, when the electronic device 100 requests another electronic device to work together through the above-mentioned exercise answer providing application again, the electronic device 100 cannot find the corresponding session identifier. The electronic device 100 may create a session 1 . The session 1 is a session in which an application is provided based on the answers to the above exercises when the electronic device 100 logs into the current device account.
在另一些实施例中,电子设备100通过上述习题答案提供应用请求其它电子设备协同工作时,可以查询到会话1的会话标签。即电子设备100曾经通过上述习题答案提供应用请求其它电子设备协同工作。电子设备100可以从上述会话1存储沙箱A中获取会话1的快照信息。电子设备100可以将会话1的会话标识发送给会话1的快照信息指示的电子设备(如电子设备300),并请求电子设备300调用记笔记和答题应用。其中,电子设备300可以显示如图3F所示的用户界面280。In some other embodiments, when the electronic device 100 requests other electronic devices to work together through the above-mentioned exercise answer providing application, the session tag of session 1 may be queried. That is, the electronic device 100 once requested other electronic devices to work together by providing an application through the answers to the above exercises. The electronic device 100 may obtain the snapshot information of the session 1 from the above session 1 storage sandbox A. The electronic device 100 may send the session identifier of the session 1 to the electronic device (such as the electronic device 300 ) indicated by the snapshot information of the session 1, and request the electronic device 300 to call the note-taking and answering application. Wherein, the electronic device 300 may display the user interface 280 as shown in FIG. 3F .
电子设备100与电子设备200建立连接,并指示电子设备200播放课程视频的指令可以参考上述指令“onConnectAbilityReq”。The instruction for establishing a connection between the electronic device 100 and the electronic device 200 and instructing the electronic device 200 to play the course video may refer to the above-mentioned instruction "onConnectAbilityReq".
在一些实施例中,电子设备100中存储有会话1的会话标识以及会话1的快照信息。该会话1的快照信息可存储在会话1存储沙箱A中。In some embodiments, the electronic device 100 stores the session ID of the session 1 and the snapshot information of the session 1 . The snapshot information of session 1 may be stored in session 1 storage sandbox A.
由于上述第一种类型的协同工作的定义中未指定应用包名和服务包名,电子设备100通过上述习题答案提供应用指示电子设备200播放课程视频时,可以将上述会话1的会话标识传递给电子设备200。电子设备200可以选择一个可用于播放课程视频的应用(如课程视频播放应用、华为视频应用等)。具体的选择方法可以为:选择与上述习题答案提供应用属于同一个分布式应用的应用、根据会话1的快照信息选择电子设备200曾经与电子设备100协同工作时播放视频的应用、根据接收到的用于选择播放课程视频的应用的用户操作进行选择。本申请实施例对电子设备200选择一个可用于播放课程视频的应用的方法不作限定。例如, 电子设备200可以选择调用课程视频播放应用。那么在电子设备200中,上述会话1的会话标识可以传递至上述课程视频播放应用。电子设备200可以在本地为会话1分配存储沙箱(即图6所示的会话1存储沙箱B)。会话1存储沙箱B的位置可以是:…/data/user/<电子设备200的设备账号>/com.example.study/<会话1的会话标识>/…。Since the application package name and service package name are not specified in the definition of the above-mentioned first type of collaborative work, when the electronic device 100 instructs the electronic device 200 to play the course video through the above-mentioned exercise answer providing application, it can pass the session identification of the above-mentioned session 1 to the electronic device. Device 200. The electronic device 200 can select an application that can be used to play the course video (such as a course video playing application, a Huawei video application, etc.). The specific selection method may be: select an application that belongs to the same distributed application as the application that provides the answers to the above exercises, select an application that plays a video when the electronic device 200 used to work with the electronic device 100 according to the snapshot information of A user action to select an app to play a course video to select. The embodiment of the present application does not limit the method for the electronic device 200 to select an application that can be used to play the course video. For example, the electronic device 200 may choose to call the course video playing application. Then, in the electronic device 200, the session identification of the above-mentioned session 1 may be transmitted to the above-mentioned course video playing application. The electronic device 200 may locally allocate a storage sandbox for session 1 (ie, session 1 storage sandbox B shown in FIG. 6 ). The location where session 1 stores sandbox B may be: .../data/user/<device account of electronic device 200>/com.example.study/<session ID of session 1>/....
会话1存储沙箱B可用于存储电子设备200中课程视频播放应用的活动信息。该活动信息可包括电子设备200播放课程视频的课程标识、播放进度。当再次调用上述课程视频播放应用时,电子设备100可以根据会话1存储沙箱B中存储的活动信息来确定课程视频播放应用的状态。这样,电子设备100再次指示电子设备200调用课程视频播放应用时,电子设备200可以将课程视频播放应用恢复至最近一次退出课程视频播放应用的状态。例如,电子设备200可以显示如图3F所示的用户界面260。The session 1 storage sandbox B can be used to store the activity information of the course video playing application in the electronic device 200 . The activity information may include the course identification and playing progress of the course video played by the electronic device 200 . When the above-mentioned course video playing application is invoked again, the electronic device 100 can determine the state of the course video playing application according to the activity information stored in the session 1 storage sandbox B. In this way, when the electronic device 100 instructs the electronic device 200 to call the course video playing application again, the electronic device 200 can restore the course video playing application to the state of the last exit from the course video playing application. For example, the electronic device 200 may display a user interface 260 as shown in FIG. 3F.
若电子设备100首次通过习题答案提供服务指示其它电子设备播放课程视频,且电子设备200被选中,电子设备200调用课程视频播放应用,那么电子设备100可以将电子设备100与电子设备200的连接信息存储至会话1存储沙箱A。上述电子设备100与电子设备200的连接信息可包括:电子设备100的设备标识、电子设备200的设备标识、电子设备200调用服务所述应用的应用标识、电子设备200调用服务的服务标识、电子设备200的动作类型。上述电子设备100与电子设备200的连接信息可以包含与会话1的快照信息。会话1的快照信息还可以包括上述电子设备200课程视频播放应用的活动信息。If the electronic device 100 instructs other electronic devices to play the course video through the exercise answer service for the first time, and the electronic device 200 is selected, and the electronic device 200 invokes the course video playing application, then the electronic device 100 can share the connection information between the electronic device 100 and the electronic device 200 Store to session 1 storage sandbox A. The above connection information between the electronic device 100 and the electronic device 200 may include: the device identification of the electronic device 100, the device identification of the electronic device 200, the application identification of the application that the electronic device 200 calls the service, the service identification that the electronic device 200 calls the service, the electronic The action type of the device 200. The above connection information between the electronic device 100 and the electronic device 200 may include the snapshot information with the session 1 . The snapshot information of session 1 may also include the activity information of the above-mentioned course video playing application of the electronic device 200 .
若电子设备100曾经通过习题答案提供服务指示电子设备200播放课程视频,并且电子设备200调用课程视频播放应用来播放视频,那么存储在会话1存储沙箱A中会话1的快照信息可包括电子设备100与电子设备200的连接信息。会话1的快照信息还可以包括上述电子设备200课程视频播放应用的活动信息。会话1存储沙箱A中存储有电子设备100与电子设备200的连接信息时,电子设备100通过上述习题答案提供应用请求其它电子设备播放课程视频的方法可以前述实施例中,电子设备100再次通过习题答案提供应用请求其它电子设备调用记笔记和答题服务的方法。这里不再赘述。If the electronic device 100 once instructed the electronic device 200 to play the course video through the exercise answer providing service, and the electronic device 200 invokes the course video playing application to play the video, then the snapshot information of the session 1 stored in the session 1 storage sandbox A may include the electronic device 100 and the connection information of the electronic device 200 . The snapshot information of session 1 may also include the activity information of the above-mentioned course video playing application of the electronic device 200 . When the connection information between the electronic device 100 and the electronic device 200 is stored in the session 1 storage sandbox A, the method for the electronic device 100 to request other electronic devices to play the course video through the above-mentioned exercise answer providing application can be described above. Exercise Answers provides a method for applications to request other electronic devices to invoke note-taking and answering services. I won't go into details here.
下面对电子设备100更新会话1的快照信息的方法进行介绍。The method for updating the snapshot information of the session 1 by the electronic device 100 is introduced below.
在一些实施例中,电子设备100可以周期性记录会话1的快照信息。In some embodiments, the electronic device 100 may periodically record the snapshot information of the session 1 .
电子设备100可以根据前述实施例中的方法请求电子设备200和电子设备300与自己协同工作。如图6所示,电子设备100可以通过习题答案提供应用指示电子设备200调用课程视频播放应用,并指示电子设备300调用记笔记和答题应用。在上述协同工作的过程中,电子设备100可以在会话1存储沙箱A中存储图6所示会话1的快照信息。The electronic device 100 may request the electronic device 200 and the electronic device 300 to cooperate with itself according to the methods in the foregoing embodiments. As shown in FIG. 6 , the electronic device 100 can instruct the electronic device 200 to call the course video playing application through the exercise answer providing application, and instruct the electronic device 300 to call the note-taking and answering application. During the above collaborative work process, the electronic device 100 may store the snapshot information of the session 1 shown in FIG. 6 in the session 1 storage sandbox A.
如图6所示,会话1的快照信息可以包括一条或多条记录。其中,一条记录可包括电子设备100与一个电子设备的连接信息、在该连接关系下上述一个电子设备中调用应用的活动信息、这一条记录的记录时间。上述一条记录中的连接信息可以包括源设备标识、目的设备标识、应用标识和服务标识。源设备可以为指示其它电子设备调用相关应用的电子设备(如电子设备100)。目的设备可以为接收调用指令调用相关应用的电子设备(如电子设备200、电子设备300)。应用标识可以为目的设备调用应用的应用包名(如com.example.study)。服务标识可以为目的设备调用服务的服务包名。上述服务标识可以是可选字段。例如,若目的设备调用的应用为不以服务为单位提供程序安装包,该目的设备所在的一条记录中服务标识可以为空。一条记录的记录时间可以由这一条记录的活动信息确定。即上述活动信息可以为目的设备中调用应用在上述记录时间的活动信息。例如,图6所示的第一条记录为电子设备 100与电子设备200协同工作的记录。这一条记录的记录时间为t1。这一条记录的活动信息可包括电子设备200在时间为t1时播放课程视频的课程标识以及播放进度。As shown in FIG. 6 , the snapshot information of session 1 may include one or more records. Wherein, a record may include connection information between the electronic device 100 and an electronic device, activity information of invoking an application in the above-mentioned electronic device under the connection relationship, and a record time of this record. The connection information in the above record may include a source device identifier, a destination device identifier, an application identifier and a service identifier. The source device may be an electronic device (such as the electronic device 100 ) that instructs other electronic devices to invoke related applications. The destination device may be an electronic device (such as the electronic device 200, the electronic device 300) that receives the calling instruction to call the relevant application. The application identifier can call the application package name (such as com.example.study) of the application for the destination device. The service identifier is the service package name that can call the service for the destination device. The above service identifier may be an optional field. For example, if the application invoked by the destination device does not provide a program installation package in units of services, the service identifier in a record of the destination device may be empty. The recording time of a record can be determined by the activity information of this record. That is, the above activity information may be the activity information of the calling application in the destination device at the above recording time. For example, the first record shown in FIG. 6 is a record of electronic device 100 and electronic device 200 working together. The recording time of this record is t1. The recorded activity information may include the course identifier and the playing progress of the course video played by the electronic device 200 at time t1.
电子设备100可以周期性记录会话1的快照信息的具体方法可以为:电子设备100可以每隔预设时间段请求获取电子设备200中课程视频播放应用的活动信息。当得到上述活动信息,电子设备100可以更新图6所示会话1的快照信息中第一条记录的活动信息和记录时间。The specific method for the electronic device 100 to periodically record the snapshot information of session 1 may be as follows: the electronic device 100 may request to acquire the activity information of the course video playing application in the electronic device 200 every preset time period. When the above activity information is obtained, the electronic device 100 may update the activity information and record time of the first record in the snapshot information of Session 1 shown in FIG. 6 .
电子设备200可以在会话1存储沙箱中B中存储课程视频播放应用的活动信息。电子设备200也可以周期性记录上述活动信息。不限于上述课程视频的课程标识、播放进度,会话1存储沙箱B中还可存储有课程视频的缓存数据等等。本申请实施例对此不作限定。The electronic device 200 may store the activity information of the course video playing application in the session 1 storage sandbox B. The electronic device 200 may also periodically record the above activity information. Not limited to the course identification and playback progress of the above-mentioned course video, the cache data of the course video, etc. may also be stored in the session 1 storage sandbox B. This embodiment of the present application does not limit it.
电子设备100记录图6所示会话1的快照信息中第二条记录的方法可以参考前述实施例。会话1的快照信息中一条记录还可以包括更多或更少的字段。例如,一条记录的字段还可以包括目的设备的动作的类型等等。本申请实施例对会话的快照信息的存储形式不作限定。除了图6所示的表格形式,快照信息还可以其它形式存储于存储沙箱中。For the method for the electronic device 100 to record the second record in the snapshot information of session 1 shown in FIG. 6 , reference may be made to the foregoing embodiments. A record in the snapshot information of session 1 may also include more or less fields. For example, the fields of a record may also include the type of action of the destination device and so on. The embodiment of the present application does not limit the storage form of the session snapshot information. In addition to the tabular form shown in FIG. 6, snapshot information may also be stored in the storage sandbox in other forms.
在另一些实施例中,电子设备100可以响应用户操作来记录会话1的快照信息。In some other embodiments, the electronic device 100 may record the snapshot information of session 1 in response to a user operation.
示例性的,在电子设备100与电子设备200协同工作的过程中,响应于作用在电子设备200上用于退出课程视频播放的用户操作,电子设备200可以将退出课程视频播放时(如t3时刻)播放课程视频的课程标识、播放进度发送给电子设备100。电子设备100可以利用接收到的t3时刻播放课程视频的课程标识、播放进度,来更新会话1的快照信息中第一条记录的活动信息和记录时间。Exemplarily, during the cooperative work of the electronic device 100 and the electronic device 200, in response to a user operation on the electronic device 200 for exiting the playing of the course video, the electronic device 200 may record the time when the playing of the course video (such as time t3 ) to send the course identification and playing progress of the course video to the electronic device 100. The electronic device 100 may update the activity information and recording time of the first record in the snapshot information of session 1 by using the received course identification and playback progress of the course video played at time t3.
由图6所示的通信系统500可知,电子设备100通过应用A(如上述习题答案提供应用)请求其它电子设备协同工作实现应用场景A时,电子设备100可以将会话A(如上述会话1)的会话标识传递给与自己协同工作的电子设备。电子设备100可以与自己处于同一会话的电子设备交互数据。上述会话A为在电子设备100上登录当前的设备账号时基于应用A的会话。电子设备100可以利用会话A的快照信息恢复与历史协同设备的连接关系。上述历史协同设备可以是在曾经实现应用场景A时与电子设备100建立过连接关系的电子设备。这样,用户可以不用分别在多个电子设备上进行操作,来建立这多个电子设备的连接关系。这不仅简化了多个电子设备建立连接时的用户操作,还方便用户调用自己习惯的电子设备,更快地进入到熟悉的应用场景,提高了用户体验。It can be seen from the communication system 500 shown in FIG. 6 that when the electronic device 100 requests other electronic devices to cooperate to realize the application scenario A through the application A (such as the above-mentioned application for answering exercises), the electronic device 100 can send the session A (such as the above-mentioned session 1) The session ID passed to the electronic device that works with itself. The electronic device 100 can exchange data with electronic devices in the same session. The above-mentioned session A is a session based on application A when logging into the current device account on the electronic device 100 . The electronic device 100 can use the snapshot information of session A to restore the connection relationship with the historical coordination device. The aforementioned historical collaboration device may be an electronic device that has established a connection relationship with the electronic device 100 when the application scenario A was implemented. In this way, the user can establish a connection relationship between the multiple electronic devices without performing operations on the multiple electronic devices respectively. This not only simplifies the user operation when multiple electronic devices are connected, but also facilitates the user to call the electronic device he is accustomed to, and enters the familiar application scene more quickly, thus improving the user experience.
另外,上述会话A的快照信息中还可包括在实现应用场景A时,电子设备100和历史协同设备各自调用应用的活动信息。可选的,历史协同设备本地也可存储有自己调用应用的互动信息。根据上述活动信息,电子设备100和历史协同设备调用应用实现应用场景A时可以将应用的状态恢复至活动信息指示的状态。该活动信息例如是视频的播放进度。电子设备可以从活动信息指示的播放进度来播放视频。这样,电子设备100和历史协同设备可以从最近一次中断协同工作的位置处继续协同工作,来实现应用场景A。In addition, the above-mentioned snapshot information of session A may also include the activity information of invoking applications by the electronic device 100 and the historical coordination device when the application scenario A is implemented. Optionally, the historical collaboration device may also locally store the interaction information of the application it invokes. According to the above activity information, when the electronic device 100 and the historical coordination device call the application to realize the application scenario A, the state of the application can be restored to the state indicated by the activity information. The activity information is, for example, the playing progress of the video. The electronic device can play the video from the play progress indicated by the activity information. In this way, the electronic device 100 and the historical cooperation device can continue to work together from the position where the cooperation work was interrupted last time, so as to realize the application scenario A.
下面介绍本申请实施例提供的另一种通信系统600。Another communication system 600 provided by the embodiment of the present application is introduced below.
图7示例性示出了通信系统600的架构示意图。如图7所示,通信系统600可包括电子设备100、电子设备200和电子设备400。电子设备100上登录的设备账号与电子设备400上的登录的设备账号不同。FIG. 7 exemplarily shows a schematic structural diagram of a communication system 600 . As shown in FIG. 7 , a communication system 600 may include an electronic device 100 , an electronic device 200 and an electronic device 400 . The device account registered on the electronic device 100 is different from the device account registered on the electronic device 400 .
电子设备100、电子设备200和电子设备400中可安装有课程学习分布式应用中不同服务的程序安装包。例如,电子设备100和电子设备400中均安装有习题答案提供应用。该习 题答案提供应用可以提供习题答案提供服务(即ability1)。电子设备200中安装有课程视频播放应用。该课程视频播放应用可以提供课程视频播放服务(即ability2)。The electronic device 100 , the electronic device 200 and the electronic device 400 may be installed with program installation packages of different services in the course learning distributed application. For example, both the electronic device 100 and the electronic device 400 are installed with exercises answer providing applications. The exercise answer providing application can provide exercise answer providing service (namely ability1). A course video playing application is installed in the electronic device 200 . The course video playing application can provide a course video playing service (namely ability2).
电子设备100可以通过自己安装了习题答案提供应用请求电子设备200播放课程视频。电子设备400也可以通过自己安装了习题答案提供应用请求电子设备200播放课程视频。电子设备100和电子设备400请求电子设备200播放课程视频的实现过程可以参考前述图6所示的实施例。The electronic device 100 may request the electronic device 200 to play the course video by installing the exercise answer providing application. The electronic device 400 may also request the electronic device 200 to play the course video by installing the exercise answer providing application. The implementation process of the electronic device 100 and the electronic device 400 requesting the electronic device 200 to play the course video may refer to the embodiment shown in FIG. 6 above.
由图7可以看出,在电子设备100通过习题答案提供应用指示电子设备200播放课程视频时,电子设备100可以将会话1的会话标识发送给电子设备200。电子设备200可以调用课程视频播放应用,并为会话1分配存储沙箱(即会话1存储沙箱B)。会话1存储沙箱B的位置可以是:…/data/user/<电子设备200的设备账号>/com.example.study/<会话1的会话标识>/…。在电子设备100和电子设备200基于上述会话1进行通信的过程中,课程视频播放应用可以读取会话1存储沙箱B中的数据,并向会话1存储沙箱B中写入数据。It can be seen from FIG. 7 that when the electronic device 100 instructs the electronic device 200 to play the course video through the exercise answer providing application, the electronic device 100 may send the session ID of session 1 to the electronic device 200 . The electronic device 200 may invoke the course video playing application, and allocate a storage sandbox for session 1 (ie session 1 storage sandbox B). The location where session 1 stores sandbox B may be: .../data/user/<device account of electronic device 200>/com.example.study/<session ID of session 1>/.... During the communication between the electronic device 100 and the electronic device 200 based on the above-mentioned session 1, the course video playback application can read the data in the session 1 storage sandbox B, and write data into the session 1 storage sandbox B.
电子设备400中包括会话2存储沙箱A。会话2存储沙箱A可用于存储会话2的快照信息。该会话2是在电子设备400登录当前设备账号时基于上述习题答案提供应用的会话。在电子设备400通过习题答案提供应用指示电子设备200播放课程视频时,电子设备400可以将会话2的会话标识发送给电子设备200。电子设备200可以调用课程视频播放应用,并为会话2分配存储沙箱(即会话2存储沙箱B)。会话2存储沙箱B的位置可以是:…/data/user/<电子设备200的设备账号>/com.example.study/<会话2的会话标识>/…。在电子设备400和电子设备200基于上述会话2进行通信的过程中,课程视频播放应用可以读取会话2存储沙箱B中的数据,并向会话2存储沙箱B中写入数据。The electronic device 400 includes a session 2 storage sandbox A. Session 2 storage sandbox A can be used to store snapshot information of session 2. This session 2 is a session in which an application is provided based on the answers to the above-mentioned exercises when the electronic device 400 logs into the current device account. When the electronic device 400 instructs the electronic device 200 to play the course video through the exercise answer providing application, the electronic device 400 may send the session identification of the session 2 to the electronic device 200 . The electronic device 200 may invoke the course video playing application, and allocate a storage sandbox for session 2 (ie session 2 storage sandbox B). The location where session 2 stores sandbox B may be: .../data/user/<device account of electronic device 200>/com.example.study/<session ID of session 2>/.... During the communication between the electronic device 400 and the electronic device 200 based on the above-mentioned session 2, the course video playing application can read the data in the session 2 storage sandbox B, and write data into the session 2 storage sandbox B.
由上述实施例可以看出,电子设备可以以应用和会话为单位来隔离本地的存储沙箱。It can be seen from the above embodiments that the electronic device can isolate a local storage sandbox in units of applications and sessions.
在一些实施例中,一个电子设备可以接收到来自不同电子设备用于调用同一个应用的指令。上述不同电子设备上登录的设备账号不同。上述不同电子设备可以分别向上述一个电子设备发送自己创建的会话的会话标识。当接收到不同会话的会话标识,上述一个电子设备可以为这些不同的会话分别分配存储沙箱。由于上述不同的电子设备指示上述一个电子设备调用同一个应用,则上述不同会话的存储沙箱均可被上述同一个应用读写数据。其中,上述一个电子设备在基于一个会话进行协同工作的过程中,上述一个电子设备调用的应用可以对这一个会话的存储沙箱进行读写数据的操作。即同一个应用在不同会话下可对不同的存储沙箱进行读写数据的操作。In some embodiments, an electronic device may receive instructions for invoking the same application from different electronic devices. The device accounts registered on the above-mentioned different electronic devices are different. The above-mentioned different electronic devices may respectively send the session identifiers of the sessions created by themselves to the above-mentioned one electronic device. When receiving session identifiers of different sessions, the above-mentioned one electronic device may assign storage sandboxes to these different sessions respectively. Since the above-mentioned different electronic devices instruct the above-mentioned one electronic device to call the same application, the storage sandboxes of the above-mentioned different sessions can all be read and written by the same application. Wherein, during the collaborative work of the above-mentioned one electronic device based on one session, the application invoked by the above-mentioned one electronic device can perform operations of reading and writing data on the storage sandbox of the session. That is, the same application can read and write data to different storage sandboxes in different sessions.
在另一些实施例中,一个电子设备通过应用C指示另一个电子设备调用应用D和应用E。上述一个电子设备中存在会话C的会话标识。该会话C的会话标识是在上述一个电子设备登录当前设备账号时基于上述应用C的会话。上述一个电子设备通过应用C指示上述另一个电子设备调用应用D时,上述一个电子设备可以将会话C的会话标识传递给上述另一个电子设备。上述另一个电子设备可以将本地的存储沙箱D分配给会话C。上述应用D可以对存储沙箱D进行读写数据的操作。上述一个电子设备通过应用C指示上述另一个电子设备调用应用E时,上述一个电子设备可以将会话C的会话标识传递给上述另一个电子设备。上述另一个电子设备可以将本地的存储沙箱E分配给会话C。上述应用E可以对存储沙箱E进行读写数据的操作。即不同应用在同一个会话下可对不同的存储沙箱进行读写数据的操作。In some other embodiments, one electronic device instructs another electronic device to invoke application D and application E through application C. The session identifier of session C exists in the above-mentioned one electronic device. The session identifier of the session C is a session based on the application C when the above-mentioned one electronic device logs into the current device account. When the above-mentioned one electronic device instructs the above-mentioned other electronic device to call the application D through the application C, the above-mentioned one electronic device may transfer the session identifier of the session C to the above-mentioned another electronic device. The above-mentioned another electronic device may assign the local storage sandbox D to the session C. The application D above can perform data read and write operations on the storage sandbox D. When the above-mentioned one electronic device instructs the above-mentioned another electronic device to call the application E through the application C, the above-mentioned one electronic device may transfer the session identifier of the session C to the above-mentioned another electronic device. The above another electronic device may assign the local storage sandbox E to the session C. The above-mentioned application E can perform operations of reading and writing data on the storage sandbox E. That is, different applications can read and write data to different storage sandboxes in the same session.
在一些实施例中,一个会话的快照信息可以存储在分布式存储系统中。上述分布式存储系统可以包括多个存储设备。这多个存储设备可以进行数据共享和同步。与一个会话相关的 多个电子设备均可以从分布式存储系统中获取这一个会话的快照信息。与一个会话相关的多个电子设备可以为一个会话中的主设备(如电子设备100)和子设备(这一个会话中与电子设备100协同工作的电子设备)。上述方法可以方便与一个会话相关的电子设备获取这一个会话的快照信息。并且,分布式存储系统中的存储设备可以是计算性能和存储性能优于与一个会话相关的多个电子设备的设备。利用上述分布式存储系统,与一个会话相关的多个电子设备可以节省自己的计算资源和存储资源。In some embodiments, snapshot information of a session may be stored in a distributed storage system. The above distributed storage system may include multiple storage devices. These multiple storage devices can perform data sharing and synchronization. Multiple electronic devices related to a session can obtain the snapshot information of the session from the distributed storage system. The multiple electronic devices related to a session may be a main device (such as the electronic device 100 ) and a sub-device (an electronic device that cooperates with the electronic device 100 in this session) in a session. The above method can facilitate the electronic device related to a session to obtain the snapshot information of the session. Moreover, the storage devices in the distributed storage system may be devices with higher computing performance and storage performance than multiple electronic devices related to one session. Using the above-mentioned distributed storage system, multiple electronic devices related to a session can save their own computing resources and storage resources.
下面具体以图8所示的通信系统700来介绍本申请实施例涉及的一种分布式存储的方法。The following specifically uses the communication system 700 shown in FIG. 8 to introduce a distributed storage method involved in the embodiment of the present application.
如图8所示,通信系统700可包括电子设备100、电子设备200、电子设备300和分布式存储系统710。其中,电子设备100可以通过习题答案提供应用指示电子设备200调用课程视频播放应用。这一协同工作过程中的连接信息、课程视频播放应用的活动信息均可包含于会话1的快照信息。会话1为电子设备100在登录当前设备账号时基于习题答案提供应用的会话。电子设备200可以通过习题答案提供应用指示电子设备200地道用课程视频播放应用。这一协同工作过程中的连接信息、课程视频播放应用的活动信息均可包含于会话2的快照信息。会话2为电子设备400在登录当前设备账号时基于习题答案提供应用的会话。电子设备100和电子设备400中登录的设备账号不同。As shown in FIG. 8 , a communication system 700 may include an electronic device 100 , an electronic device 200 , an electronic device 300 and a distributed storage system 710 . Wherein, the electronic device 100 may instruct the electronic device 200 to call the course video playing application through the exercise answer providing application. The connection information in the collaborative work process and the activity information of the course video playback application can be included in the snapshot information of session 1. Session 1 is a session in which the electronic device 100 provides applications based on the answers to exercises when logging into the current device account. The electronic device 200 may instruct the electronic device 200 to use the course video playing application through the exercise answer providing application. The connection information in the collaborative work process and the activity information of the course video playing application can be included in the snapshot information of session 2. Session 2 is a session in which the electronic device 400 provides applications based on the answers to exercises when logging into the current device account. The device accounts registered in the electronic device 100 and the electronic device 400 are different.
在一种可能的实现方式中,分布式存储系统710中可包括会话1存储沙箱711、会话2存储沙箱712等等其它为其它会话分配的存储沙箱。分布式存储系统710中一个会话的存储沙箱的位置可以根据这一个会话中主设备的设备账号、主设备上调用子设备协同工作的应用的应用标识、这一个会话的会话标识确定。一个会话相关的多个电子设备均可以对分布式存储系统710中这一个会话的存储沙箱进行读写操作。上述会话1存储沙箱711和会话2存储沙箱712分别为分布式存储系统710为会话1和会话2分配的存储沙箱。In a possible implementation manner, the distributed storage system 710 may include a session 1 storage sandbox 711 , a session 2 storage sandbox 712 and other storage sandboxes allocated for other sessions. The location of the storage sandbox of a session in the distributed storage system 710 can be determined according to the device account of the master device in the session, the application identifier of the application on the master device that calls the sub-device to work together, and the session identifier of the session. Multiple electronic devices related to a session can perform read and write operations on the storage sandbox of the session in the distributed storage system 710 . The above-mentioned session 1 storage sandbox 711 and session 2 storage sandbox 712 are storage sandboxes allocated by the distributed storage system 710 for session 1 and session 2 respectively.
电子设备100建立会话1时,可以指示分布式存储系统710为会话1分配存储沙箱。会话1存储沙箱711的位置可以由电子设备100的设备账号、上述习题答案提供应用的应用标识、会话1的会话标识确定。当电子设备100通过习题答案提供应用请求其它电子设备调用课程视频播放应用时,电子设备100可以从分布式存储系统710的会话1存储沙箱711中获取会话1的快照信息。该会话1的快照信息可包括电子设备100与电子设备200的连接信息。那么,电子设备100可以请求与电子设备200连接,并指示电子设备200调用课程视频播放应用。电子设备100可以将会话1的会话标识传递至电子设备200。电子设备200确定自己在会话1的通信连接中。电子设备200可以将课程视频播放应用的活动信息(如课程视频的课程标识、播放进度)存储至分布式存储系统710的会话1存储沙箱711中。When the electronic device 100 establishes the session 1, it may instruct the distributed storage system 710 to allocate a storage sandbox for the session 1. The location of the session 1 storage sandbox 711 may be determined by the device account of the electronic device 100 , the application identifier of the above-mentioned exercise answer providing application, and the session identifier of the session 1 . When the electronic device 100 requests other electronic devices to call the course video playing application through the exercise answer providing application, the electronic device 100 may obtain the session 1 snapshot information from the session 1 storage sandbox 711 in the distributed storage system 710 . The snapshot information of the session 1 may include connection information between the electronic device 100 and the electronic device 200 . Then, the electronic device 100 may request to be connected with the electronic device 200, and instruct the electronic device 200 to invoke the course video playing application. The electronic device 100 may transfer the session identifier of the session 1 to the electronic device 200 . The electronic device 200 determines that it is in the communication connection of Session 1 . The electronic device 200 may store the activity information of the course video playing application (such as the course identification and playing progress of the course video) in the session 1 storage sandbox 711 of the distributed storage system 710 .
电子设备400建立会话2时确定上述会话2存储沙箱712的方法可以参考电子设备100建立会话1确定会话1存储沙箱711的方法。电子设备200确定自己在会话2的通信连接中时,可以对上述会话2存储沙箱712进行读写操作。The method for determining the session 2 storage sandbox 712 when the electronic device 400 establishes the session 2 may refer to the method for establishing the session 1 storage sandbox 711 of the electronic device 100 . When the electronic device 200 determines that it is in the communication connection of the session 2, it may perform read and write operations on the session 2 storage sandbox 712 .
分布式存储系统710中的多个存储设备可以包括与各会话的主设备、子设备中的一个或多个电子设备。例如,分布式存储系统710中的多个存储设备可以包括电子设备100和电子设备200。可选的,分布式存储系统710中的多个存储设备还可以包括各会话的主设备、子设备以外的电子设备。例如,电子设备100和电子设备200均与同一个路由器连接。在电子设备100通过习题答案提供应用指示电子设备100调用课程视频播放应用的场景中,电子设备100可以指示与自己连接的路由器为会话1分配存储沙箱。该路由器中可存在会话1存储沙箱711。该路由器即可为分布式存储沙箱710中的一个存储设备。The multiple storage devices in the distributed storage system 710 may include one or more electronic devices among the main device and the sub-device that communicate with each other. For example, the multiple storage devices in the distributed storage system 710 may include the electronic device 100 and the electronic device 200 . Optionally, the multiple storage devices in the distributed storage system 710 may also include electronic devices other than the main device and sub-device of each session. For example, both the electronic device 100 and the electronic device 200 are connected to the same router. In the scenario where the electronic device 100 instructs the electronic device 100 to invoke the course video playing application through the exercise answer providing application, the electronic device 100 may instruct a router connected to itself to allocate a storage sandbox for Session 1 . There may be a session 1 storage sandbox 711 in the router. The router can be a storage device in the distributed storage sandbox 710 .
在一种可能的实现方式中,电子设备100可以对路由器中的会话1存储沙箱进行读写操 作。电子设备200可以将课程视频播放应用的活动信息发送给电子设备100。进一步的,电子设备100可以将接收到的课程视频播放应用的活动信息存储至会话1存储沙箱711。In a possible implementation manner, the electronic device 100 may perform read and write operations on the session 1 storage sandbox in the router. The electronic device 200 may send the activity information of the course video playing application to the electronic device 100 . Further, the electronic device 100 may store the received activity information of the course video playing application in the session 1 storage sandbox 711 .
在另一种可能的实现方式中,电子设备100可以将路由器中会话1存储沙箱711的位置发送给电子设备200。电子设备200可以从会话1存储沙箱711获取会话1的快照信息,并将课程视频播放应用的活动信息存储至会话1存储沙箱711。这样,若在电子设备100通过习题答案提供应用指示电子设备200播放课程视频的过程中,电子设备100离开,电子设备200可以继续更新会话1的快照信息。In another possible implementation manner, the electronic device 100 may send the location of the session 1 storage sandbox 711 in the router to the electronic device 200 . The electronic device 200 can acquire the snapshot information of the session 1 from the session 1 storage sandbox 711 , and store the activity information of the course video playing application in the session 1 storage sandbox 711 . In this way, if the electronic device 100 leaves during the process of the electronic device 100 instructing the electronic device 200 to play the course video through the exercise answer providing application, the electronic device 200 can continue to update the snapshot information of the session 1.
在一些实施例中,一个会话中的主设备、子设备仍可在本地为这一个会话分配图6和图7所示的存储沙箱,并将会话的快照信息存储在本地的存储沙箱中。In some embodiments, the master device and sub-device in a session can still locally allocate the storage sandbox shown in Figure 6 and Figure 7 for this session, and store the snapshot information of the session in the local storage sandbox .
本申请实施例对各会话中的主设备、子设备与分布式存储系统710中的存储设备建立通信连接的方法不作限定。具体可以参考现有技术中分布式存储技术的实现方法。The embodiment of the present application does not limit the method for establishing a communication connection between the main device and the sub-device in each session and the storage device in the distributed storage system 710 . For details, reference may be made to the implementation method of the distributed storage technology in the prior art.
通过上述分布式存储系统,一个会话中的主设备和子设备均可以便捷地获取并记录这一个会话的快照信息。并且,分布式存储系统中的存储设备可以是计算性能和存储性能优于与一个会话相关的多个电子设备的设备。利用上述分布式存储系统,与一个会话相关的多个电子设备可以节省自己的计算资源和存储资源。Through the above-mentioned distributed storage system, both the main device and the sub-device in a session can conveniently obtain and record the snapshot information of the session. Moreover, the storage devices in the distributed storage system may be devices with higher computing performance and storage performance than multiple electronic devices related to one session. Using the above-mentioned distributed storage system, multiple electronic devices related to a session can save their own computing resources and storage resources.
在一些实施例中,一个电子设备通过一个应用请求其它电子设备与自己协同工作时,这一个电子设备可以对自己搜索到的电子设备进行优先级排序。这一个电子设备可以选择优先级排序最前且可以进行协同工作的电子设备。In some embodiments, when an electronic device requests other electronic devices to cooperate with itself through an application, the electronic device may prioritize the electronic devices found by itself. This electronic device may select the electronic device with the highest priority and that can perform cooperative work.
下面对本申请实施例提供的一种电子设备选择与自己协同工作的电子设备的方法进行介绍。A method for an electronic device to select an electronic device that cooperates with itself provided by an embodiment of the present application is introduced below.
这里具体以电子设备100通过习题答案提供服务来请求其它电子设备播放课程视频的场景为例进行介绍。其中,电子设备100可以建立会话1。会话1可以是在电子设备100登录当前设备账号时基于上述习题答案提供应用的会话。Here, a scenario in which the electronic device 100 requests other electronic devices to play the course video by providing a service through the answers to the exercises is used as an example for introduction. Wherein, the electronic device 100 may establish a session 1 . Session 1 may be a session in which an application is provided based on the answers to the above exercises when the electronic device 100 logs into the current device account.
首先,电子设备100可以从会话1的存储沙箱中获取会话1的快照信息。若会话1的快照信息存在电子设备100请求其它电子设备播放课程视频的连接信息,电子设备100可以可以根据该连接信息指示历史协同设备调用历史协同应用来播放课程视频。例如,会话1的快照信息中包括图6所示会话1存储沙箱A中快照信息的第一条记录。该第一条记录可以表示电子设备100指示电子设备200调用课程视频播放应用。则历史协同设备为电子设备200。历史协同应用为课程视频播放应用。如果电子设备200处于可用状态,电子设备100可以指示电子设备200调用课程视频播放应用。可选的,若电子设备200无法调用课程视频播放应用,电子设备200可以调用其它可用于播放课程视频的应用(如华为视频应用)来播放课程视频。电子设备200处于可用状态可以表示电子设备可以与其它电子设备建立通信连接,并运行自己安装的应用。First, the electronic device 100 may acquire the snapshot information of session 1 from the storage sandbox of session 1 . If the snapshot information of session 1 contains the connection information for the electronic device 100 to request other electronic devices to play the course video, the electronic device 100 can instruct the history collaboration device to call the history collaboration application to play the course video according to the connection information. For example, the snapshot information of session 1 includes the first record of the snapshot information in session 1 storage sandbox A shown in FIG. 6 . The first record may indicate that the electronic device 100 instructs the electronic device 200 to call the course video playing application. Then the historical collaboration device is the electronic device 200 . The historical collaborative application is a course video playback application. If the electronic device 200 is in an available state, the electronic device 100 may instruct the electronic device 200 to call the course video playing application. Optionally, if the electronic device 200 cannot call the application for playing the course video, the electronic device 200 may call other applications that can play the course video (such as the Huawei video application) to play the course video. The fact that the electronic device 200 is in the usable state may indicate that the electronic device can establish a communication connection with other electronic devices and run applications installed by itself.
在一些实施例中,若电子设备100从会话1的快照信息中查找到多个被指示播放课程视频的历史协同设备,且这多个历史协同设备均处于可用状态,电子设备100可以根据设备类型对这多个历史协同设备进行优先级排序。设备类型可以表示设备的私密度。私密度越低的电子设备,排序越靠前。不同类型的设备的私密度可以为电视=音箱<平板<手表=手机。例如,这多个历史协同设备中包括电视和平板,电子设备100可以优先选取指示电视调用课程视频播放应用。可选的,电子设备100的设备连接程序中包括设备的优先级排序。该优先级排序可以例如是电视、平板、手机、智能汽车。其中电视的优先级排序最前。若这多个历史协同 设备中包括电视和平板,电子设备100可以优先选择指示电视调用课程视频播放应用。In some embodiments, if the electronic device 100 finds multiple historical collaborative devices instructed to play course videos from the snapshot information of session 1, and these multiple historical collaborative devices are all available, the electronic device 100 can Prioritize the multiple historical collaborative devices. The device type may represent the degree of privacy of the device. Electronic devices with lower privacy are ranked higher. The degree of privacy of different types of devices can be TV=speaker<tablet<watch=mobile phone. For example, the plurality of historical collaboration devices include a TV and a tablet, and the electronic device 100 may preferentially select and instruct the TV to call the course video playing application. Optionally, the device connection program of the electronic device 100 includes prioritization of devices. This prioritization can eg be TV, tablet, mobile phone, smart car. Among them, TV has the highest priority. If the multiple historical collaboration devices include a TV and a tablet, the electronic device 100 may preferentially instruct the TV to call the course video playing application.
电子设备100请求私密度高的电子设备协同工作可能需要用户在私密度高的电子设备上确认。私密度越低的电子设备,排序越靠前。电子设备100优先选择私密度低的电子设备可以简化连接过程中的用户操作,提高设备连接的效率。The request of the electronic device 100 to cooperate with an electronic device with a high degree of privacy may require the user to confirm on the electronic device with a high degree of privacy. Electronic devices with lower privacy are ranked higher. The electronic device 100 preferentially selects electronic devices with low privacy, which can simplify user operations during the connection process and improve device connection efficiency.
在一些实施例中,若电子设备100从会话1的快照信息中查找到上述历史协同设备但历史协同设备处于不可用的状态,电子设备100可以对自己搜索到的但未曾在自己的指示下播放过课程视频的电子设备进行优先级排序。其中,被搜索到的电子设备中的优先级排序从前到后可以为:与历史协同设备的设备账号相同且设备类型相同的电子设备、与历史协同设备的设备账号相同但设备类型不同电子设备、与历史协同设备的设备账号不同但设备类型相同的电子设备、与历史协同设备的设备账号不同且设备类型不同的电子设备。In some embodiments, if the electronic device 100 finds the above-mentioned historical coordination device from the snapshot information of session 1 but the historical coordination device is in an unavailable state, the electronic device 100 can play the content that it has searched for but has not been instructed by itself. Prioritize electronics over lesson videos. Among them, the priority order of the searched electronic devices may be from front to back: electronic devices with the same device account and the same device type as the historical collaborative device, electronic devices with the same device account as the historical collaborative device but different device types, An electronic device with a device account different from that of the historical collaborative device but of the same device type, and an electronic device with a device account different from that of the historical collaborative device but of a different device type.
其中,若上述与历史协同设备的设备账号相同但设备类型不同电子设备有多个,则这多个电子设备可以根据上述私密程度进行优先级排序,或者根据电子设备100的设备连接程序中定义的顺序进行优先级排序。若与历史协同设备的设备账号不同且设备类型不同的电子设备有多个,则这多个电子设备也可以根据上述私密程度进行优先级排序,或者根据电子设备100的设备连接程序中定义的顺序进行优先级排序。电子设备100可以指示优先级排序最前且可以进行协同工作的电子设备来播放课程视频。Wherein, if there are multiple electronic devices with the same device account as the historical collaboration device but with different device types, the multiple electronic devices can be prioritized according to the above privacy level, or according to the device connection program defined in the electronic device 100. order of priority. If there are multiple electronic devices with different device accounts and different device types from the historical collaboration device, these multiple electronic devices can also be prioritized according to the above privacy level, or according to the order defined in the device connection program of the electronic device 100 Prioritize. The electronic device 100 may instruct the electronic device that has the highest priority and can work together to play the course video.
在一些实施例中,若电子设备100从会话1的快照信息中未查找到被指示播放课程视频的历史协同设备,电子设备100可以从前述实施例所述的协同记录存储模块中查找电子设备100是否指示过其它电子设备进行过同类型的协同工作(即指示其它电子设备进行播放视频的动作)。例如,电子设备100通过一个应用(习题答案提供应用以外的应用)指示电子设备200调用华为视频应用。电子设备100可以将与电子设备200连接并调用华为视频应用播放课程视频的选项提供给用户。或者,电子设备100可以直接指示电子设备200调用华为视频应用播放课程视频。In some embodiments, if the electronic device 100 does not find the historical collaborative device instructed to play the course video from the snapshot information of session 1, the electronic device 100 may search the electronic device 100 from the collaborative record storage module described in the previous embodiment. Whether it has instructed other electronic devices to perform the same type of collaborative work (that is, instruct other electronic devices to play video). For example, the electronic device 100 instructs the electronic device 200 to call the Huawei video application through an application (an application other than the application for providing answers to exercises). The electronic device 100 may provide the user with the option of connecting with the electronic device 200 and calling the Huawei video application to play the course video. Alternatively, the electronic device 100 may directly instruct the electronic device 200 to call the Huawei video application to play the course video.
在一些实施例中,电子设备100可以将自己搜索到的电子设备按照上述优先级排序的顺序推荐给用户,并接收用于选择设备的用户操作。电子设备100可以指示被选择的电子设备调用课程视频播放应用。In some embodiments, the electronic device 100 may recommend the electronic devices it has searched for to the user in the order of priority sorted above, and receive a user operation for selecting a device. The electronic device 100 may instruct the selected electronic device to call the course video playing application.
由上述选择协同工作的电子设备的方法可知,一个会话中的主设备可以优先选择请求历史协同设备再次进行协同工作。这方便用户调用自己习惯的电子设备,更快地进入到熟悉的应用场景,提高了用户体验。并且,若历史协同设备不可用,主设备可以根据上述优先级排序选择排序在前且可以协同工作的电子设备进行协同工作。It can be seen from the above method of selecting electronic devices for cooperative work that the master device in a session may preferentially request historical cooperative devices to perform cooperative work again. This makes it convenient for users to call their accustomed electronic devices, enter familiar application scenarios faster, and improve user experience. Moreover, if the historical coordinated device is unavailable, the main device may select the electronic device that is ranked first and that can work cooperatively to perform coordinated work according to the above priority ranking.
在一些实施例中,一个会话的主设备和子设备组成的通信系统中可包括多级连接。上述主设备可以将上述多级连接中每个节点之间的连接信息存储至这一个会话的存储沙箱中。根据上述每个节点之间的连接信息,上述主设备可以恢复上述多级连接。In some embodiments, a communication system composed of a master device and sub-devices of a session may include multi-level connections. The master device may store the connection information between each node in the multi-level connection in the storage sandbox of this session. According to the connection information between each of the above nodes, the above-mentioned master device can restore the above-mentioned multi-level connection.
下面以图9所示的通信系统800为例介绍本申请实施例提供的电子设备建立多级连接的方法。The following uses the communication system 800 shown in FIG. 9 as an example to introduce the method for establishing a multi-level connection of an electronic device provided in the embodiment of the present application.
如图9所示,通信系统800可包括电子设备810、电子设备820、电子设备830、电子设备840和电子设备850。其中,电子设备810中可安装有应用811。电子设备820中可安装有应用821。电子设备830中可安装有应用831。电子设备840中可安装有应用841。电子设备850中可安装有应用851。As shown in FIG. 9 , the communication system 800 may include an electronic device 810 , an electronic device 820 , an electronic device 830 , an electronic device 840 and an electronic device 850 . Wherein, an application 811 may be installed in the electronic device 810 . An application 821 may be installed in the electronic device 820 . An application 831 may be installed in the electronic device 830 . An application 841 may be installed in the electronic device 840 . An application 851 may be installed in the electronic device 850 .
通信系统800可以是由会话801的主设备和子设备组成的。一个会话的主设备可用于建 立这一个会话中协同工作的多个电子设备之间的连接关系。这一个会话的会话标识可以由主设备的设备账号和主设备上请求其它电子设备协同工作的应用的应用标识确定。一个会话可以仅有一个主设备。一个会话的子设备可以为这一个会话中与主设备协同工作的电子设备。如图9所示,会话801的主设备为电子设备810,子设备包括电子设备820、电子设备830、电子设备840和电子设备850。The communication system 800 may be composed of a session 801 master device and slave devices. The master device of a session can be used to establish a connection relationship between multiple electronic devices working together in this session. The session identifier of this session may be determined by the device account of the master device and the application identifier of the application on the master device that requests other electronic devices to work together. A session can have only one master device. A sub-device of a session may be an electronic device that cooperates with the main device in this session. As shown in FIG. 9 , the main device of session 801 is electronic device 810 , and the sub-devices include electronic device 820 , electronic device 830 , electronic device 840 and electronic device 850 .
在会话801中,电子设备810通过应用指示电子设备820调用应用821,并指示电子设备840调用应用841。电子设备820通过应用821指示电子设备830调用应用831。电子设备840通过应用841指示电子设备850调用应用851。其中,一个电子设备可以存储自己开启一个应用的方式。上述开启一个应用的方式可以包括被动开启和主动开启。被动开启可以表示电子设备接收到来自其它电子设备指示调用这一个应用的指令,而开启这一个应用。主动开启可以表示电子设备接收到用于开启这一个应用的用户操作(如作用在这一个应用的应用图标上的用户操作),而开启这一个应用。在电子设备820开启应用821的开启方式为上述被动开启的情况下,电子设备820通过应用821指示电子设备830调用应用831的连接信息包含于会话801的快照信息。若电子设备820主动开启应用821,并通过应用821指示电子设备830调用应用831,电子设备820可以作为主设备创建会话,并将与电子设备830的连接信息存储至自己创建的会话的存储沙箱中。In the session 801 , the electronic device 810 instructs the electronic device 820 to invoke the application 821 through the application, and instructs the electronic device 840 to invoke the application 841 . The electronic device 820 instructs the electronic device 830 to invoke the application 831 through the application 821 . The electronic device 840 instructs the electronic device 850 to invoke the application 851 through the application 841 . Wherein, an electronic device may store its own way of opening an application. The above-mentioned ways of opening an application may include passive opening and active opening. Passive opening may mean that the electronic device receives an instruction from another electronic device to call the application, and starts the application. Active opening may mean that the electronic device receives a user operation for opening the application (such as a user operation acting on an application icon of the application), and starts the application. In the case that the electronic device 820 opens the application 821 in the above-mentioned passive opening mode, the electronic device 820 instructs the electronic device 830 to invoke the snapshot information contained in the connection information of the application 831 through the application 821 . If the electronic device 820 actively starts the application 821, and instructs the electronic device 830 to call the application 831 through the application 821, the electronic device 820 can create a session as the master device, and store the connection information with the electronic device 830 in the storage sandbox of the session created by itself middle.
通信系统800包括两级连接。第一级连接为主设备(即电子设备810)与第一层节点中的电子设备(如电子设备820、电子设备840)之间的连接。第二级连接为上述第一层节点中的电子设备与第二层节点中的电子设备之间的连接。例如,电子设备820和电子设备830之间的连接、电子设备840和电子设备850之间的连接。Communication system 800 includes two levels of connectivity. The first-level connection is the connection between the master device (ie, the electronic device 810 ) and the electronic devices (such as the electronic device 820 and the electronic device 840 ) in the first-level nodes. The second-level connection is the connection between the electronic device in the above-mentioned first layer node and the electronic device in the second layer node. For example, the connection between the electronic device 820 and the electronic device 830 , the connection between the electronic device 840 and the electronic device 850 .
在一种可能的实现方式中,电子设备810可以在会话1的存储沙箱中存储如图9所示的连接信息表812。连接信息表812可以包括会话801中每个节点之间的连接信息。这里以会话中的主设备和子设备均在本地为这一个会话分配存储沙箱为例进行说明。即上述连接信息表812可以存储在电子设备810中为会话1分配的存储沙箱。例如,连接信息表812中的字段可以包括源设备中的源应用和目的设备中的目标应用。源设备可以表示一级连接中指示其它电子设备调用相关应用的电子设备。源应用可以表示源设备中用于指示其它电子设备调用相关应用的应用。目的设备可以表示一级连接中接收调用指令调用相关应用的电子设备。目的应用可以表示目的设备接收调用指令所调用的应用。In a possible implementation manner, the electronic device 810 may store the connection information table 812 shown in FIG. 9 in the storage sandbox of the session 1. Connection information table 812 may include connection information between each node in session 801 . Here, the main device and the sub-device in the session all allocate storage sandboxes locally for this session as an example. That is, the connection information table 812 may be stored in the storage sandbox allocated for the session 1 in the electronic device 810 . For example, the fields in the connection information table 812 may include a source application in the source device and a target application in the destination device. The source device may represent an electronic device instructing other electronic devices to invoke related applications in the first-level connection. The source application may refer to an application in the source device for instructing other electronic devices to invoke related applications. The destination device may refer to an electronic device receiving a call instruction to call a related application in the first-level connection. The target application may refer to the application called by the target device after receiving the calling instruction.
需要进行说明的是,连接信息表中的数据具体可以是电子设备的设备标识和应用的应用标识。若上述应用可提供一个分布式应用中的一项服务,这个应用的应用标识可以包括这一个分布式应用的应用包名以及这一项服务的服务包名。若上述应用为传统应用,这个应用的应用标识可以为这一个传统应用的应用包名。图9所示的各连接信息标识中用电子设备的标号和应用的标号分别表示电子设备的设备标识和应用的应用标识。上述电子设备的标号和应用的标号不应对本申请构成限定。It should be noted that the data in the connection information table may specifically be the device identifier of the electronic device and the application identifier of the application. If the above application can provide a service in a distributed application, the application identifier of the application may include the application package name of the distributed application and the service package name of the service. If the above application is a traditional application, the application identifier of this application may be the application package name of this traditional application. In each connection information identifier shown in FIG. 9 , the device identifier of the electronic device and the application identifier of the application are respectively represented by the label of the electronic device and the label of the application. The symbols and applied symbols of the above-mentioned electronic equipment shall not limit the present application.
由连接信息表812可知,源设备为电子设备810且源应用为应用811时,目的设备可以为电子设备820和电子设备840。其中,电子设备820中的目的应用为应用821。电子设备840中的目的应用为应用841。源设备为电子设备820且源应用为821时,目的设备可以为电子设备830。电子设备830中的目的应用为应用831。源设备为电子设备840且源应用为841时,目的设备可以为电子设备850。电子设备850中的目的应用为应用851。It can be known from the connection information table 812 that when the source device is the electronic device 810 and the source application is the application 811 , the destination devices may be the electronic device 820 and the electronic device 840 . Wherein, the target application in the electronic device 820 is the application 821 . The target application in the electronic device 840 is the application 841 . When the source device is the electronic device 820 and the source application is 821 , the destination device may be the electronic device 830 . The target application in the electronic device 830 is the application 831 . When the source device is the electronic device 840 and the source application is 841 , the destination device may be the electronic device 850 . The target application in the electronic device 850 is the application 851 .
当接收到用于恢复会话801的快照信息所指示的连接关系的指令时,电子设备810可以根据上述连接信息表812恢复通信系统800中的多级连接。上述用于恢复会话801的快照信 息所指示的连接关系的指令可以是上述应用811自动触发的,或者可以是由作用在应用811中的用户操作触发的(如图3B所示视频输出设备选择控件242的用户操作)。本申请实施例对上述指令不作限定。When receiving an instruction for restoring the connection relationship indicated by the snapshot information of the session 801 , the electronic device 810 may restore the multi-level connection in the communication system 800 according to the above connection information table 812 . The above-mentioned instruction for restoring the connection relationship indicated by the snapshot information of the session 801 may be automatically triggered by the above-mentioned application 811, or may be triggered by a user operation acting on the application 811 (as shown in FIG. 3B , the video output device selection control 242 user actions). The embodiment of the present application does not limit the above instructions.
具体的,电子设备810可以从会话801的存储沙箱中获取上述连接信息表812。根据连接信息表812,电子设备810可以与第一层节点中的电子设备连接,并指示第一层节点中的电子设备调用对应的目的应用。电子设备810还可以将第一层节点中的电子设备与第一层节点后续层级节点中的电子设备之间的连接信息发送给第一层节点中的电子设备。例如,电子设备810可以与电子设备820连接,并通过应用811指示电子设备820调用应用821。电子设备810还可以将电子设备820与电子设备830之间的连接信息发送给电子设备820。那么,电子设备820可以与电子设备830连接,并通过应用821指示电子设备830调用应用831。Specifically, the electronic device 810 may obtain the connection information table 812 from the storage sandbox of the session 801 . According to the connection information table 812, the electronic device 810 can connect with the electronic device in the first layer node, and instruct the electronic device in the first layer node to call the corresponding destination application. The electronic device 810 may also send the connection information between the electronic device in the first layer node and the electronic device in the subsequent layer nodes of the first layer node to the electronic device in the first layer node. For example, the electronic device 810 may be connected to the electronic device 820 and instruct the electronic device 820 to call the application 821 through the application 811 . The electronic device 810 may also send the connection information between the electronic device 820 and the electronic device 830 to the electronic device 820 . Then, the electronic device 820 can be connected with the electronic device 830 , and instruct the electronic device 830 to call the application 831 through the application 821 .
在一种可能的应用场景中,电子设备810为手机。应用811为前述实施例中的习题答案提供应用。电子设备820为电视。应用821为前述实施例中的课程视频播放应用。电子设备830为音箱。应用831为音频播放应用。手机可以通过习题答案提供应用指示电视调用课程视频播放应用,并将电视与音箱的连接信息发送给电视。根据上述电视与音箱的连接信息,电视通过课程视频播放应用指示音箱调用音频播放应用。在上述手机、电视和音箱协同工作实现的应用场景中,手机可用于提供习题答案。电视可以显示课程视频的用户界面。音箱可以播放该课程视频的音频。In a possible application scenario, the electronic device 810 is a mobile phone. Application 811 provides applications for the answers to exercises in the foregoing embodiments. Electronic device 820 is a television. Application 821 is the course video playing application in the foregoing embodiments. The electronic device 830 is a speaker. Application 831 is an audio playback application. The mobile phone can instruct the TV to call the course video playing application through the application for providing answers to the exercises, and send the connection information between the TV and the sound box to the TV. According to the above connection information between the TV and the speaker, the TV instructs the speaker to call the audio playback application through the course video playback application. In the above-mentioned application scenario where the mobile phone, TV and speakers work together, the mobile phone can be used to provide answers to exercises. The TV can display the user interface of the course videos. Speakers can play the audio of the lesson video.
若在会话801中,电子设备830还与一个电子设备连接,并通过应用831指示这一个电子设备调用相应的应用,连接信息表812中还可以包括电子设备830与这一个电子设备的连接信息。除了电子设备820与电子设备830的连接信息,电子设备810还可以将电子设备830与这一个电子设备的连接信息发送给电子设备820。进一步的,电子设备820可以将电子设备830与这一个电子设备的连接信息发送给电子设备830。这样,电子设备830可以与这一个电子设备连接。If in the session 801, the electronic device 830 is also connected to an electronic device, and the application 831 instructs the electronic device to call a corresponding application, the connection information table 812 may also include the connection information between the electronic device 830 and the electronic device. In addition to the connection information between the electronic device 820 and the electronic device 830 , the electronic device 810 may also send the connection information between the electronic device 830 and the electronic device to the electronic device 820 . Further, the electronic device 820 may send the connection information between the electronic device 830 and the electronic device to the electronic device 830 . In this way, the electronic device 830 can be connected with this one electronic device.
在一些实施例中,一个会话的子设备中可存储自己与后续层级节点中的电子设备之间的连接信息。例如,电子设备820为会话801的子设备。电子设备820可以存储图9所示的连接信息表822。由连接信息表822可知,源设备为电子设备820且源应用为应用821时,目的设备可以为电子设备830。电子设备830中的目的应用为应用831。该连接信息表822可以存储在电子设备820在本地为会话801分配的存储沙箱中。当接收到电子设备810中的应用811调用应用821的指令,电子设备820可以调用应用821,并根据连接信息表822与电子设备830连接,指示电子设备830调用应用831。In some embodiments, a sub-device of a session may store connection information between itself and an electronic device in a subsequent hierarchical node. For example, electronic device 820 is a child device of session 801 . The electronic device 820 may store the connection information table 822 shown in FIG. 9 . It can be known from the connection information table 822 that when the source device is the electronic device 820 and the source application is the application 821 , the destination device may be the electronic device 830 . The target application in the electronic device 830 is the application 831 . The connection information table 822 may be stored in a storage sandbox locally allocated by the electronic device 820 to the session 801 . When receiving an instruction from the application 811 in the electronic device 810 to call the application 821, the electronic device 820 can call the application 821, connect with the electronic device 830 according to the connection information table 822, and instruct the electronic device 830 to call the application 831.
连接信息表822还可用于同类型协同推荐。具体的,电子设备820中可包括前述实施例中的协同记录存储模块。电子设备820可以在协同记录存储模块中存储电子设备820与电子设备830协同工作的数据。这些数据可以包括电子设备820和电子设备830在协同工作时各自调用的应用的应用标识(如应用821和应用831的应用标识)、电子设备830调用应用831所进行的动作的类型。若电子设备820通过该已安装的应用823请求其它电子设备协同工作,且该协同工作的类型与电子设备820指示电子设备830所进行的动作的类型相同,电子设备820可以通过应用823指示电子设备830调用应用831。上述协同工作的类型可以由前述设备连接程序中的字段“action”确定。示例性的,上述应用821为课程视频播放应用。应用831为音频播放应用。电子设备820中的协同记录存储模块可包括电子设备820通过应用821指示电子设备830调用应用831的协同工作的数据。当电子设备820通过华为视频应用请求其它电子设备播放音频时,电子设备820可以从协同记录存储模块中查找到上述电子设备820通 过应用821指示电子设备830调用应用831的协同工作的数据。那么,电子设备820可以通过华为视频应用指示电子设备830调用应用831来播放音频。The connection information table 822 can also be used for collaborative recommendation of the same type. Specifically, the electronic device 820 may include the collaborative record storage module in the foregoing embodiments. The electronic device 820 may store data on the cooperative work of the electronic device 820 and the electronic device 830 in the collaborative record storage module. These data may include the application identifiers of the applications invoked by the electronic device 820 and the electronic device 830 when working together (such as the application identifiers of the application 821 and the application 831 ), and the type of action performed by the electronic device 830 invoking the application 831 . If the electronic device 820 requests other electronic devices to work together through the installed application 823, and the type of the cooperation is the same as the type of action that the electronic device 820 instructs the electronic device 830 to perform, the electronic device 820 can instruct the electronic device through the application 823 830 invokes the application 831 . The type of the aforementioned cooperative work can be determined by the field "action" in the aforementioned device connection program. Exemplarily, the above-mentioned application 821 is a course video playing application. Application 831 is an audio playback application. The collaborative record storage module in the electronic device 820 may include the collaborative work data that the electronic device 820 instructs the electronic device 830 to call the application 831 through the application 821 . When the electronic device 820 requests other electronic devices to play audio through the Huawei video application, the electronic device 820 can find the collaborative work data of the above-mentioned electronic device 820 instructing the electronic device 830 to call the application 831 through the application 821 from the collaborative record storage module. Then, the electronic device 820 can instruct the electronic device 830 to call the application 831 to play audio through the Huawei video application.
电子设备810通过应用811指示电子设备840调用应用841,以及电子设备840通过应用841指示电子设备850调用应用851的连接过程可以参考前述实施例中电子设备810、电子设备820和电子设备830的连接过程,这里不再赘述。连接信息表812中第一层节点以及后续层级节点中的电子设备之间的连接信息可以是通过层层上报的方式传递至电子设备810。例如,会话801中,电子设备820与电子设备830之间的连接信息可以是由电子设备820发送给电子设备810的。若在会话801中,电子设备830还与一个电子设备连接。电子设备830可以将自己与这一个电子设备的连接信息发送给电子设备820。进一步的,电子设备820可以将电子设备830与这一个电子设备的连接信息发送给电子设备810。The electronic device 810 instructs the electronic device 840 to call the application 841 through the application 811, and the electronic device 840 instructs the electronic device 850 to call the application 851 through the application 841. The connection process can refer to the connection of the electronic device 810, the electronic device 820 and the electronic device 830 in the foregoing embodiments. The process will not be repeated here. The connection information between the first layer nodes and the electronic devices in the subsequent layer nodes in the connection information table 812 may be transmitted to the electronic device 810 by layer-by-layer reporting. For example, in the session 801, the connection information between the electronic device 820 and the electronic device 830 may be sent by the electronic device 820 to the electronic device 810. If in the session 801, the electronic device 830 is also connected to an electronic device. The electronic device 830 may send the connection information between itself and the electronic device to the electronic device 820 . Further, the electronic device 820 may send the connection information between the electronic device 830 and the electronic device to the electronic device 810 .
在一些实施例中,电子设备810可以分级恢复上述多级连接。例如,电子设备810可以先恢复第一级连接。该第一级连接可包括:电子设备810与电子设备820的连接、电子设备810与电子设备840的连接。响应于作用在第一层节点中的电子设备上用于请求其它电子设备协同工作的用户操作,电子设备810可以指示第一层节点中的电子设备恢复第二级连接。该第二级连接可包括:电子设备820与电子设备830的连接、电子设备840与电子设备850的连接。In some embodiments, the electronic device 810 can restore the above-mentioned multi-level connections hierarchically. For example, the electronic device 810 may restore the first-level connection first. The first-level connection may include: a connection between the electronic device 810 and the electronic device 820 , and a connection between the electronic device 810 and the electronic device 840 . In response to a user operation acting on the electronic device in the first-level node to request other electronic devices to work together, the electronic device 810 may instruct the electronic device in the first-level node to resume the second-level connection. The second-level connection may include: a connection between the electronic device 820 and the electronic device 830 , and a connection between the electronic device 840 and the electronic device 850 .
在一些实施例中,电子设备910可以恢复上述多级连接中的一部分连接。例如,响应于作用在电子设备810上用于请求电子设备820协同工作的用户操作,电子设备810可以恢复图9所示电子设备810与电子设备820的连接以及电子设备820和电子设备830的连接。电子设备810与电子设备840的连接可以在电子设备810接收到相应的用户操作后被恢复。In some embodiments, the electronic device 910 may restore a part of the above-mentioned multi-level connections. For example, in response to a user operation acting on the electronic device 810 for requesting the electronic device 820 to work together, the electronic device 810 may restore the connection between the electronic device 810 and the electronic device 820 and the connection between the electronic device 820 and the electronic device 830 shown in FIG. 9 . The connection between the electronic device 810 and the electronic device 840 may be restored after the electronic device 810 receives a corresponding user operation.
在一些实施例中,会话801的存储沙箱也可以位于分布式存储系统中。会话801中的主设备和子设备均可以对分布式存储系统中会话801的存储沙箱进行读写操作。分布式存储协同为会话801分配存储沙箱的实现方式可以参考前述图8所示的实施例,这里不再赘述。In some embodiments, the storage sandbox of session 801 may also be located in a distributed storage system. Both the main device and the sub-device in the session 801 can perform read and write operations on the storage sandbox of the session 801 in the distributed storage system. For an implementation manner of distributed storage collaboration allocating a storage sandbox to the session 801, reference may be made to the embodiment shown in FIG. 8 above, which will not be repeated here.
由图9所示的通信系统可知,不限于图3F所示的单级连接,一个会话中的主设备可以存储多级连接的连接信息。主设备可以根据这多级连接的连接信息恢复该多级连接。这可以简化了多个电子设备建立连接时的用户操作,方便用户调用自己习惯的电子设备,更快地进入到熟悉的应用场景。It can be seen from the communication system shown in FIG. 9 that, not limited to the single-level connection shown in FIG. 3F , the master device in a session can store connection information of multi-level connections. The master device can restore the multi-level connection according to the connection information of the multi-level connection. This simplifies user operations when multiple electronic devices are connected, making it convenient for users to call their accustomed electronic devices and quickly enter familiar application scenarios.
在一些实施例中,一个会话中的主设备根据这一个会话的快照信息恢复这一个会话中多个电子设备之间的连接关系时,可能会存在循环调用、历史协同设备不可用等问题。上述循环调用的问题可以表示源设备通过源应用指示目的设备调用目的应用。而上述目的设备又通过目的应用指示上述源设备调用上述源应用。上述循环调用可能导致两个电子设备之间的连接信息在这两个设备之间循环传递,浪费这两个电子设备的计算资源和存储资源。In some embodiments, when the master device in a session restores the connection relationship between multiple electronic devices in the session according to the snapshot information of the session, there may be problems such as cyclic calling, unavailable historical coordination devices, and the like. The above problem of circular calling may mean that the source device instructs the destination device to call the destination application through the source application. The destination device instructs the source device to call the source application through the destination application. The above cyclic call may cause the connection information between the two electronic devices to be cyclically transmitted between the two devices, wasting computing resources and storage resources of the two electronic devices.
下面以图10所示的通信系统900为例来介绍避免设备连接过程中出现上述循环调用问题的方法,以及历史协同设备不可用时连接信息的传递方法。The following uses the communication system 900 shown in FIG. 10 as an example to introduce a method for avoiding the above-mentioned cycle call problem during the device connection process, and a method for transferring connection information when the historical collaboration device is unavailable.
如图10所示,通信系统900可包括电子设备910、电子设备920、电子设备930、电子设备940、电子设备950、电子设备960、电子设备970、电子设备980、电子设备990和电子设备9100。其中,电子设备910、电子设备920、电子设备930、电子设备940、电子设备950、电子设备960、电子设备970、电子设备980、电子设备990和电子设备9100中可分别安装有应用911、应用921、应用931、应用941、应用951、应用961、应用971、应用981、 应用991和应用9101。As shown in FIG. 10 , the communication system 900 may include an electronic device 910 , an electronic device 920 , an electronic device 930 , an electronic device 940 , an electronic device 950 , an electronic device 960 , an electronic device 970 , an electronic device 980 , an electronic device 990 and an electronic device 9100 . Among them, the electronic device 910, the electronic device 920, the electronic device 930, the electronic device 940, the electronic device 950, the electronic device 960, the electronic device 970, the electronic device 980, the electronic device 990, and the electronic device 9100 can respectively install the application 911, the application 921 , application 931 , application 941 , application 951 , application 961 , application 971 , application 981 , application 991 and application 9101 .
通信系统900可以是由会话901的主设备和子设备组成的。由前述实施例可知,电子设备910为会话901的主设备。通信系统900中除电子设备910以外的电子设备均为会话901的子设备。通信系统900中各电子设备之间建立连接关系的方法可以参考前述实施例。电子设备910中的连接信息表912、电子设备920中的连接信息表922、电子设备930中的连接信息表932、电子设备950中的连接信息表952、电子设备970中的连接信息表972和电子设备980中的连接信息表920中包含的数据以及作用均可以参考前述图9所示的实施例。这里不再赘述。The communication system 900 may be composed of a master device and a slave device of a session 901 . It can be known from the foregoing embodiments that the electronic device 910 is the master device of the session 901 . All electronic devices in the communication system 900 except the electronic device 910 are sub-devices of the session 901 . For a method for establishing a connection relationship between electronic devices in the communication system 900, reference may be made to the foregoing embodiments. The connection information table 912 in the electronic device 910, the connection information table 922 in the electronic device 920, the connection information table 932 in the electronic device 930, the connection information table 952 in the electronic device 950, the connection information table 972 in the electronic device 970, and For the data and functions contained in the connection information table 920 in the electronic device 980, reference may be made to the foregoing embodiment shown in FIG. 9 . I won't go into details here.
在一些实施例中,根据连接信息表912,电子设备910可以利用应用911指示电子设备950调用应用951。电子设备910还可以将电子设备950为源设备的连接信息发送给电子设备950。上述电子设备950为源设备的连接可包括:电子设备950通过应用951指示电子设备960调用应用961、电子设备950通过应用951指示电子设备910调用应用911。那么,在会话901中,电子设备910通过应用911指示电子设备950调用应用951、电子设备950通过应用951指示电子设备910调用应用会导致上述循环调用的问题。其中,电子设备910通过应用911向电子设备950发送调用指令,电子设备950又通过应用951向电子设备910发送调用指令。In some embodiments, according to the connection information table 912 , the electronic device 910 can use the application 911 to instruct the electronic device 950 to call the application 951 . The electronic device 910 may also send the connection information that the electronic device 950 is the source device to the electronic device 950 . The aforementioned connection of the electronic device 950 as the source device may include: the electronic device 950 instructs the electronic device 960 to call the application 961 through the application 951 , and the electronic device 950 instructs the electronic device 910 to call the application 911 through the application 951 . Then, in the session 901, the electronic device 910 instructs the electronic device 950 to call the application 951 through the application 911, and the electronic device 950 instructs the electronic device 910 to call the application through the application 951, which will cause the above-mentioned problem of cyclic calling. Wherein, the electronic device 910 sends the calling instruction to the electronic device 950 through the application 911 , and the electronic device 950 sends the calling instruction to the electronic device 910 through the application 951 .
为了避免上述循环调用的问题,一个会话中的主设备和子设备可以存储自己的层级标识。一个电子设备的层级标识可以由这一个电子设备与主设备之间的连接距离确定。该连接距离可以表示一个电子设备与主设备之间间隔的设备数量。一个电子设备与主设备之间间隔的设备数据越多,这一个电子设备与主设备之间的连接距离越大,这一个电子设备的层级标识越高。在一种可能的实现方式中,在一个会话中,层级标识高的电子设备指示层级标识低的电子设备调用一个应用时,可以向层级标识低的电子设备发送调用指令。若层级标识低的电子设备识别出该调用指令指示自己调用的应用为在一个会话中已经被调用的应用,层级标识低的电子设备可以不执行该调用指令(如抛弃该调用指令),并向上述层级标识高的电子设备发送应答消息。该应答消息可用于指示上述调用指令是无效指令。在另一种可能的实现方式中,层级标识高的电子设备可以从自己作为源设备的连接信息中,查找是否存在目的设备为层级标识比自己的层级标识低的电子设备的连接信息。若存在,该层级标识高的电子设备可以进一步判断该连接信息中目标应用是否为在这一个会话中已经被调用的应用。若是,该层级标识高的电子设备可以不根据该连接信息向层级标识低的电子设备发送调用指令。这样,一个会话中的两个电子设备之间可以避免上述循环调用的问题,实现了对电子设备计算资源和存储资源的节约。In order to avoid the above-mentioned circular call problem, the master device and the sub-devices in a session can store their own hierarchical identifiers. The hierarchical identification of an electronic device may be determined by the connection distance between this electronic device and the master device. The connection distance may represent the number of devices separated between one electronic device and the main device. The more device data there is between an electronic device and the main device, the greater the connection distance between this electronic device and the main device, and the higher the level identification of this electronic device. In a possible implementation manner, in a session, when an electronic device with a higher level identifier instructs an electronic device with a lower level identifier to invoke an application, an invocation instruction may be sent to the electronic device with a lower level identifier. If the electronic device with a lower level identifier recognizes that the call instruction indicates that the application it calls is an application that has been called in a session, the electronic device with a lower level identifier may not execute the call instruction (for example, discard the call instruction), and send the call instruction to The above-mentioned electronic device with a higher level identifier sends a response message. The response message may be used to indicate that the above calling instruction is an invalid instruction. In another possible implementation, the electronic device with a higher level identifier may search for connection information of the destination device as an electronic device with a lower level identification than its own from the connection information of itself as the source device. If it exists, the electronic device with a higher level identifier can further determine whether the target application in the connection information is an application that has been invoked in this session. If so, the electronic device with a higher level identifier may not send the calling instruction to the electronic device with a lower level identifier according to the connection information. In this way, the above-mentioned circular calling problem can be avoided between two electronic devices in a session, and the computing resources and storage resources of the electronic devices are saved.
示例性的,主设备,即电子设备910的层级标识可以为第0层。会话901中与主设备直接连接的子设备(如电子设备920、电子设备950、电子设备970)的层级标识可以为第1层。会话901中与层级标识为第1层的电子设备直接连接的子设备(如电子设备930、电子设备960、电子设备980)的层级标识可以为第2层。会话901中与层级标识为第2层的电子设备直接连接的子设备(如电子设备940、电子设备990)的层级标识可以为第3层。以此类推,可以确定一个会话中层级标识为第4层、第5层……的电子设备。Exemplarily, the master device, that is, the layer identifier of the electronic device 910 may be layer 0. The sub-device directly connected to the main device in the session 901 may have a level identifier of the first level. In the session 901, the sub-device directly connected to the electronic device with the first-level identification (such as the electronic equipment 930, the electronic equipment 960, and the electronic equipment 980) may have a second-level identification. In the session 901, the sub-device directly connected to the electronic device with the second-level identification (for example, the electronic device 940 and the electronic device 990) may have a third-level identification. By analogy, it is possible to determine the electronic devices whose layers are identified as layer 4, layer 5, . . . in a session.
由连接信息表952可知,电子设备950可以获取到自己作为源设备且电子设备910作为目的设备的连接信息:电子设备950通过应用951指示电子设备910调用应用911。由于应用911为会话901中已经被调用的应用。电子设备950通过应用951向电子设备910发送调用应用911的调用指令,电子设备910可以确定应用911为会话901中已经被调用的应用, 且该调用指令的发送设备为层级标识比自己高的电子设备。电子设备910可以抛弃该调用指令并向电子设备950发送上述应答消息。或者,电子设备950可以确定应用911为会话901中已经被调用的应用,且该调用指令的接收设备为层级标识比自己低的电子设备。电子设备950可以删除连接信息表952中自己与电子设备910的连接信息。It can be known from the connection information table 952 that the electronic device 950 can obtain the connection information of itself as the source device and the electronic device 910 as the destination device: the electronic device 950 instructs the electronic device 910 to call the application 911 through the application 951 . Since the application 911 is an application that has been called in the session 901 . The electronic device 950 sends a call instruction to the electronic device 910 to call the application 911 through the application 951, and the electronic device 910 can determine that the application 911 is an application that has been called in the session 901, and the sending device of the call instruction is an electronic device with a higher level identification than itself. equipment. The electronic device 910 may discard the calling instruction and send the above-mentioned response message to the electronic device 950 . Alternatively, the electronic device 950 may determine that the application 911 is an application that has been called in the session 901, and the receiving device of the calling instruction is an electronic device with a lower level identifier than itself. The electronic device 950 may delete the connection information between itself and the electronic device 910 in the connection information table 952 .
在一些实施例中,电子设备970中的连接信息表972可包括:电子设备970与电子设备980的连接信息、电子设备980与电子设备990的连接信息。即在会话901中,电子设备970曾经通过应用971指示电子设备980调用应用981。电子设备980曾经通过应用981指示电子设备990调用应用991。当电子设备970通过应用971请求电子设备980调用应用981时,电子设备970发现电子设备980处于不可用状态。例如电子设备980关机。电子设备970无法连接到980。电子设备970可以根据前述实施例中选择与自己协同工作的电子设备的方法,选择电子设备9100。其中,在会话901中,电子设备970未曾与电子设备9100连接。上述连接信息表912和连接信息表972中查找不到电子设备970与电子设备9100的连接信息。In some embodiments, the connection information table 972 in the electronic device 970 may include: connection information between the electronic device 970 and the electronic device 980 , and connection information between the electronic device 980 and the electronic device 990 . That is, in the session 901 , the electronic device 970 once instructed the electronic device 980 to call the application 981 through the application 971 . The electronic device 980 once instructed the electronic device 990 to invoke the application 991 through the application 981 . When the electronic device 970 requests the electronic device 980 to invoke the application 981 through the application 971, the electronic device 970 finds that the electronic device 980 is in an unavailable state. For example, the electronic device 980 is turned off. Electronic device 970 cannot connect to 980. The electronic device 970 may select the electronic device 9100 according to the method for selecting an electronic device that cooperates with itself in the foregoing embodiments. Wherein, in the session 901, the electronic device 970 has never been connected with the electronic device 9100. The connection information between the electronic device 970 and the electronic device 9100 cannot be found in the above connection information table 912 and the connection information table 972 .
当电子设备970与电子设备9100连接,且通过应用971指示电子设备调用应用9101时,电子设备970可以将自己与电子设备9100的连接信息加入上述连接信息表972,并将该连接信息发送给电子设备910。电子设备910可以将电子设备970和电子设备9100的连接信息加入连接信息表912。另外,电子设备970可以将会话901的会话标识传递给电子设备9100。When the electronic device 970 is connected to the electronic device 9100 and instructs the electronic device to call the application 9101 through the application 971, the electronic device 970 can add the connection information between itself and the electronic device 9100 to the above-mentioned connection information table 972, and send the connection information to the electronic device. device 910. The electronic device 910 may add the connection information of the electronic device 970 and the electronic device 9100 into the connection information table 912 . In addition, the electronic device 970 may transfer the session identification of the session 901 to the electronic device 9100 .
应用9101可以与应用981是相同的应用(例如均为课程视频播放应用),或者应用9101与应用981是不相同的应用,但这两个应用可以提供相同的服务。例如,应用981为课程视频播放应用。应用9101为华为视频应用。这两个应用均可提供播放视频的服务。Application 9101 and application 981 may be the same application (for example, both are course video playing applications), or application 9101 and application 981 may be different applications, but the two applications may provide the same service. For example, application 981 is a course video playing application. Application 9101 is a Huawei video application. Both applications can provide services to play videos.
由于电子设备980不可用,电子设备970可以终止传输源设备为电子设备980的连接信息。即电子设备980可以不将电子设备980与电子设备990的连接信息发送给电子设备9100,以避免设备连接关系恢复不恰当而影响用户使用体验。Since the electronic device 980 is unavailable, the electronic device 970 may terminate transmission of the connection information that the source device is the electronic device 980 . That is, the electronic device 980 may not send the connection information between the electronic device 980 and the electronic device 990 to the electronic device 9100, so as to avoid affecting the user experience due to inappropriate restoration of the device connection relationship.
一个会话的快照信息中的连接信息可以根据前述图9和图10所示的方法传递。一个会话的快照信息中应用的活动信息也可以根据前述图9和图10所示的方法传递。这里不再赘述。The connection information in the snapshot information of a session may be transferred according to the method shown in FIG. 9 and FIG. 10 . The activity information of the application in the snapshot information of a session can also be transmitted according to the methods shown in FIG. 9 and FIG. 10 . I won't go into details here.
在一些实施例中,一个会话的会话标识可以由主设备的设备账号、运行在主设备上请求子设备协同工作的应用的应用标识、运行在主设备上请求子设备协同工作的应用中的应用账号共同确定。也即是说,主设备上的设备账号不变。主设备通过一个应用请求子设备协同工作。若这一个应用上先后登录有不同的应用账号,主设备可以创建不同的会话。一个会话可以是主设备在登录当前设备账号,基于这一个应用中的一个应用账号的会话。一个会话的快照信息可以参考前述实施例。结合应用账号来标识会话的会话标识,主设备可以区分上述应用在登录有不同的应用账号时,子设备上调用的应用的活动信息。In some embodiments, the session ID of a session can be the device account of the main device, the application ID of the application running on the main device that requests the sub-device to work together, and the application running on the main device that requests the sub-device to work together The account number is determined jointly. That is to say, the device account on the main device remains unchanged. The master device requests the sub-devices to work together through an application. If different application accounts are logged in successively on this application, the main device can create different sessions. A session may be a session based on an application account in the application when the main device logs in the current device account. For the snapshot information of a session, reference may be made to the foregoing embodiments. Combining the application account to identify the session ID of the session, the main device can distinguish the activity information of the application invoked by the sub-device when the above-mentioned application logs in with different application accounts.
例如,主设备通过前述实施例中的习题答案提供应用指示子设备调用课程视频播放应用。习题答案提供应用上登录的应用账号为用户A和用户B时,子设备上课程视频播放应用中课程视频的播放进度不同。在上述不同的应用账号下,子设备上调用应用的活动信息可以分别存储在不同会话的存储沙箱中。For example, the main device instructs the sub-device to call the course video playing application through the application for providing answers to exercises in the foregoing embodiments. When user A and user B log in to the app that provides answers to the exercises, the playback progress of the course video in the course video playback app on the sub-device is different. Under the above-mentioned different application accounts, the activity information of calling the application on the sub-device may be stored in storage sandboxes of different sessions respectively.
可选的,上述子设备上调用应用的活动信息可以与上述应用账号关联,并存储在云服务器中。子设备可以从云服务器中获取与上述应用账号关联的活动信息来回复自己调用的应用状态。Optionally, the activity information of the application invoked on the sub-device may be associated with the application account and stored in the cloud server. The sub-device can obtain the activity information associated with the above-mentioned application account from the cloud server to reply to the status of the application called by itself.
本申请实施例对前述实施例提及的各电子设备的类型不作限定。前述实施例中的电子设备可以例如是手机、平板电脑、电视、可穿戴电子设备、车机、笔记本电脑、手持计算机、上网本、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备等等,还可以是物联网设备(internet of things,IOT)或智能家居设备,例如音箱、空调、冰箱、热水器、灯具等等。The embodiment of the present application does not limit the types of the electronic devices mentioned in the foregoing embodiments. The electronic device in the foregoing embodiments may be, for example, a mobile phone, a tablet computer, a television, a wearable electronic device, a vehicle machine, a notebook computer, a handheld computer, a netbook, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) equipment, virtual reality (virtual reality, VR) equipment, artificial intelligence (AI) equipment, etc., can also be Internet of Things (IOT) or smart home equipment, such as speakers, air conditioners, refrigerators , water heaters, lamps, etc.
下面介绍本申请实施例提供的一种电子设备100的结构示意图。A schematic structural diagram of an electronic device 100 provided in an embodiment of the present application is introduced below.
如图11所示,电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。As shown in FIG. 11 , the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, and a battery 142 , antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193 , a display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Wherein, the controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可 以通过电源管理模块141为电子设备供电。The charging management module 140 is configured to receive a charging input from a charger. Wherein, the charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger through the USB interface 130 . In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100 . While charging the battery 142, the charging management module 140 can also provide power for the electronic device through the power management module 141.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。The power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 . The power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 . The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 . In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 . In some embodiments, the modem processor may be a stand-alone device. In some other embodiments, the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite, etc. applied on the electronic device 100. System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处 理器等实现拍摄功能。The electronic device 100 can realize the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used for processing the data fed back by the camera 193 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By referring to the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process input information and continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer-executable program codes including instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 . The internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。Speaker 170A, also referred to as a "horn", is used to convert audio electrical signals into sound signals. Electronic device 100 can listen to music through speaker 170A, or listen to hands-free calls.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。Receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the receiver 170B can be placed close to the human ear to receive the voice.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。The microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.
耳机接口170D用于连接有线耳机。The earphone interface 170D is used for connecting wired earphones.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, pressure sensor 180A may be disposed on display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may be comprised of at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view short messages is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B can be used to determine the motion posture of the electronic device 100 . In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y and z axes) may be determined by the gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 180D includes a Hall sensor. The electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a clamshell machine, the electronic device 100 can detect opening and closing of the clamshell according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, features such as automatic unlocking of the flip cover are set.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。The distance sensor 180F is used to measure the distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F for distance measurement to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used for sensing ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket, so as to prevent accidental touch.
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access to application locks, take pictures with fingerprints, answer incoming calls with fingerprints, and the like.
温度传感器180J用于检测温度。The temperature sensor 180J is used to detect temperature.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also known as "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
骨传导传感器180M可以获取振动信号。The bone conduction sensor 180M can acquire vibration signals.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power key, a volume key and the like. The key 190 may be a mechanical key. It can also be a touch button. The electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
马达191可以产生振动提示。The motor 191 can generate a vibrating reminder.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The SIM card interface 195 is used for connecting a SIM card. The SIM card can be connected and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 . The electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The electronic device 100 interacts with the network through the SIM card to implement functions such as calling and data communication. In some embodiments, the electronic device 100 adopts an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still understand the foregoing The technical solutions described in each embodiment are modified, or some of the technical features are replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the various embodiments of the application.

Claims (33)

  1. 一种设备连接关系建立方法,其特征在于,所述方法应用于通信系统,所述通信系统包括第一电子设备和第二电子设备,所述第一电子设备安装有第一应用,所述第二电子设备安装有用于提供第一服务的应用;A method for establishing a device connection relationship, characterized in that the method is applied to a communication system, the communication system includes a first electronic device and a second electronic device, the first electronic device is installed with a first application, and the first electronic device is installed with a first application. The second electronic device is installed with an application for providing the first service;
    所述方法包括:The methods include:
    所述第一电子设备获取第一会话的第一快照信息,所述第一会话为所述第一电子设备通过所述第一应用调用一个或多个电子设备提供一项或多项服务所进行的通信,所述第一快照信息包括第一连接信息,所述第一连接信息包括所述第二电子设备的设备标识、所述第一服务的标识;The first electronic device obtains first snapshot information of a first session, the first session is performed by the first electronic device calling one or more electronic devices to provide one or more services through the first application communication, the first snapshot information includes first connection information, and the first connection information includes the device identifier of the second electronic device and the identifier of the first service;
    所述第一电子设备根据所述第一连接信息向所述第二电子设备发送第一指令,所述第一指令用于指示所述第二电子设备提供所述第一服务;The first electronic device sends a first instruction to the second electronic device according to the first connection information, and the first instruction is used to instruct the second electronic device to provide the first service;
    所述第二电子设备接收到所述第一指令,提供所述第一服务。The second electronic device receives the first instruction and provides the first service.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, further comprising:
    所述第一电子设备接收到第二指令,所述第二指令用于指示所述第一电子设备通过所述第一应用调用所述第二电子设备提供所述第一服务;The first electronic device receives a second instruction, the second instruction is used to instruct the first electronic device to call the second electronic device to provide the first service through the first application;
    所述第一电子设备创建所述第一会话,并存储所述第一快照信息;The first electronic device creates the first session and stores the first snapshot information;
    所述第一电子设备根据所述第二指令向所述第二电子设备发送所述第一指令。The first electronic device sends the first instruction to the second electronic device according to the second instruction.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一会话具有第一会话标识,所述第一会话标识由所述第一电子设备的设备账号和所述第一应用的应用标识确定;所述第一会话标识用于所述第一电子设备获取所述第一快照信息;The method according to claim 1 or 2, wherein the first session has a first session identifier, and the first session identifier consists of the device account of the first electronic device and the application of the first application Identification determination; the first session identification is used for the first electronic device to obtain the first snapshot information;
    所述第一指令包含所述第一会话标识。The first instruction includes the first session identifier.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述第二电子设备安装有第二应用,所述第二应用用于提供所述第一服务,所述第一连接信息还包括所述第二应用的应用标识,所述第一指令用于指示所述第二电子设备运行所述第二应用来提供所述第一服务;The method according to any one of claims 1-3, wherein the second electronic device is installed with a second application, the second application is used to provide the first service, and the first connection The information further includes an application identifier of the second application, and the first instruction is used to instruct the second electronic device to run the second application to provide the first service;
    所述第二电子设备提供所述第一服务,所述方法包括:The second electronic device provides the first service, and the method includes:
    所述第二电子设备运行所述第二应用,提供所述第一服务。The second electronic device runs the second application to provide the first service.
  5. 根据权利要求1-3中任一项所述的方法,其特征在于,所述第二电子设备安装有第二应用和第三应用,所述第二应用和所述第三应用均用于提供所述第一服务,所述第二电子设备接收到所述第一指令之后,所述方法还包括:The method according to any one of claims 1-3, wherein the second electronic device is installed with a second application and a third application, and both the second application and the third application are used to provide The first service, after the second electronic device receives the first instruction, the method further includes:
    所述第二电子设备判断所述第二应用是否可用;The second electronic device determines whether the second application is available;
    若判断出所述第二应用可用,所述第二电子设备运行所述第二应用,提供所述第一服务;If it is determined that the second application is available, the second electronic device runs the second application to provide the first service;
    若判断出所述第二应用不可用,所述第二电子设备判断所述第三应用是否可用;If it is determined that the second application is unavailable, the second electronic device determines whether the third application is available;
    若判断出所述第三应用可用,所述第二电子设备运行所述第三应用,提供所述第一服务。If it is determined that the third application is available, the second electronic device runs the third application to provide the first service.
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述第二电子设备提供所述第 一服务之后,所述方法还包括:The method according to any one of claims 1-5, wherein after the second electronic device provides the first service, the method further comprises:
    所述第二电子设备将提供所述第一服务的应用的第一活动信息发送给所述第一电子设备;其中,所述第一活动信息包括所述第一服务被提供过程中用于指示所述应用的用户界面在第一时刻呈现内容的数据,所述第一时刻为所述第一服务被提供过程中的任一时刻;The second electronic device sends first activity information of the application providing the first service to the first electronic device; wherein, the first activity information includes an indicator for indicating that the first service is being provided. The user interface of the application presents the data of the content at a first moment, and the first moment is any moment in the process of providing the first service;
    所述第一电子设备存储所述第一活动信息,所述第一活动信息包含于所述第一快照信息。The first electronic device stores the first activity information, and the first activity information is included in the first snapshot information.
  7. 根据权利要求6所述的方法,其特征在于,所述第一电子设备获取第一会话的第一快照信息之后,所述方法还包括:The method according to claim 6, wherein after the first electronic device obtains the first snapshot information of the first session, the method further comprises:
    所述第一电子设备将所述第一活动信息发送给所述第二电子设备;The first electronic device sends the first activity information to the second electronic device;
    所述第二电子设备根据所述第一活动信息确定在运行用于提供所述第一服务的应用初始时刻所述应用的用户界面的呈现内容。The second electronic device determines, according to the first activity information, the presentation content of the user interface of the application at the initial moment of running the application for providing the first service.
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述第一电子设备还安装有第四应用;所述方法还包括:The method according to any one of claims 1-7, wherein the first electronic device is also installed with a fourth application; the method further comprises:
    所述第一电子设备接收到第三指令,所述第三指令用于指示第一电子设备通过所述第四应用调用电子设备提供所述第一服务;The first electronic device receives a third instruction, and the third instruction is used to instruct the first electronic device to call the electronic device to provide the first service through the fourth application;
    所述第一电子设备从一个会话或多个会话的快照信息中查找包含所述第一服务的标识的连接信息,得到所述第一连接信息;所述一个会话或多个会话是所述第一电子设备创建的;The first electronic device searches for the connection information including the identifier of the first service from the snapshot information of one session or multiple sessions, and obtains the first connection information; the one session or multiple sessions are the first Created by an electronic device;
    所述第一电子设备根据所述第一连接信息向所述第二电子设备发送第四指令,并创建第二会话,存储第二会话的第二快照信息;所述第四指令用于指示所述第二电子设备提供所述第一服务;所述第二会话为所述第一电子设备通过所述第四应用调用一个或多个电子设备提供一项或多项服务所进行的通信;所述第二快照信息包括第二连接信息,所述第二连接信息包括所述第二电子设备的设备标识、所述第一服务的标识;The first electronic device sends a fourth instruction to the second electronic device according to the first connection information, and creates a second session, and stores second snapshot information of the second session; the fourth instruction is used to indicate the The second electronic device provides the first service; the second session is a communication performed by the first electronic device calling one or more electronic devices to provide one or more services through the fourth application; The second snapshot information includes second connection information, and the second connection information includes the device identifier of the second electronic device and the identifier of the first service;
    所述第二电子设备接收到所述第四指令,提供所述第一服务。The second electronic device receives the fourth instruction and provides the first service.
  9. 根据权利要求1-8中任一项所述的方法,其特征在于,所述第一电子设备获取第一会话的第一快照信息之后,所述方法还包括:The method according to any one of claims 1-8, wherein after the first electronic device obtains the first snapshot information of the first session, the method further comprises:
    所述第一电子设备判断所述第二电子设备是否可用;The first electronic device determines whether the second electronic device is available;
    若判断出所述第二电子设备不可用,所述第一电子设备从搜索到的多个电子设备中选取出第三电子设备,并调用所述第三电子设备提供所述第一服务;所述第三电子设备为所述多个电子设备中可用且可提供所述第一服务的一个电子设备。If it is determined that the second electronic device is unavailable, the first electronic device selects a third electronic device from the searched multiple electronic devices, and invokes the third electronic device to provide the first service; The third electronic device is an electronic device that is available among the plurality of electronic devices and can provide the first service.
  10. 根据权利要求9所述的方法,其特征在于,所述第一电子设备从搜索到的多个电子设备中选取出第三电子设备,所述方法包括:The method according to claim 9, wherein the first electronic device selects a third electronic device from the searched multiple electronic devices, the method comprising:
    所述第一电子设备根据第一规则从搜索到的多个电子设备中选取出所述第三电子设备,所述第三电子设备为所述多个电子设备中可用、可提供所述第一服务且优先级最高的电子设备;所述第一规则包括:与所述第一电子设备的设备账号相同且设备类型相同的电子设备的优先级>与所述第一电子设备的设备账号相同且设备类型不同的电子设备的优先级>与所述第一电子设备的设备账号不同但设备类型相同的电子设备的优先级>与所述第一电子设备的设备账号不同且设备类型不同的电子设备的优先级。The first electronic device selects the third electronic device from the plurality of searched electronic devices according to the first rule, and the third electronic device is available among the plurality of electronic devices and can provide the first The electronic device that serves and has the highest priority; the first rule includes: the priority of the electronic device with the same device account and the same device type as the first electronic device>same as the device account of the first electronic device and The priority of electronic devices with different device types>the priority of electronic devices with different device accounts from the first electronic device but the same device type>the electronic devices with different device accounts and different device types from the first electronic device priority.
  11. 根据权利要求10所述的方法,其特征在于,所述第一电子设备的设备账号相同且设备类型不同的电子设备有多个,或者与所述第一电子设备的设备账号不同且设备类型不同的电子设备有多个;所述第一规则还包括:在设备类型不同的多个电子设备中,电子设备的优先级由电子设备的私密度确定,电子设备的私密度越低,电子设备的优先级越高;所述电子设备的私密度包括:电视=音箱<平板<手表=手机。The method according to claim 10, characterized in that there are multiple electronic devices with the same device account and different device types of the first electronic device, or different device accounts and different device types from the first electronic device There are multiple electronic devices; the first rule also includes: among multiple electronic devices with different device types, the priority of the electronic device is determined by the privacy degree of the electronic device, and the lower the privacy degree of the electronic device, the lower the privacy degree of the electronic device. The higher the priority; the privacy of the electronic device includes: TV=speaker<tablet<watch=mobile phone.
  12. 根据权利要求1-11中任一项所述的方法,其特征在于,所述第一电子设备获取第一会话的第一快照信息之后,所述方法还包括:The method according to any one of claims 1-11, wherein after the first electronic device acquires the first snapshot information of the first session, the method further comprises:
    所述第一电子设备根据所述第一连接信息在用户界面显示第二电子设备选项;The first electronic device displays options of the second electronic device on the user interface according to the first connection information;
    所述第一电子设备检测到作用于所述第二电子设备选项的第一用户操作,所述第一用户操作用于触发所述第一电子设备向所述第二电子设备发送所述第一指令。The first electronic device detects a first user operation acting on an option of the second electronic device, and the first user operation is used to trigger the first electronic device to send the first electronic device to the second electronic device. instruction.
  13. 根据权利要求12所述的方法,其特征在于,所述第一电子设备判断所述第二电子设备是否可用之后,所述方法还包括:The method according to claim 12, wherein after the first electronic device determines whether the second electronic device is available, the method further comprises:
    若判断出所述第二电子设备可用,所述第一电子设备将所述第二电子设备选项显示为第一状态,所述第一状态用于指示所述第二电子设备可用;If it is determined that the second electronic device is available, the first electronic device displays the option of the second electronic device as a first state, and the first state is used to indicate that the second electronic device is available;
    若判断出所述第二电子设备不可用,所述第一电子设备将所述第二电子设备选项显示为第二状态,所述第二状态用于指示所述第二电子设备不可用。If it is determined that the second electronic device is unavailable, the first electronic device displays the second electronic device option as a second state, and the second state is used to indicate that the second electronic device is unavailable.
  14. 根据权利要求1-8中任一项所述的方法,其特征在于,所述通信系统还包括第四电子设备,所述第四电子设备安装有用于提供第二服务的应用;所述第一快照信息包括第三连接信息,所述第三连接信息包括源设备信息和目的设备信息,所述第三连接信息中的源设备信息包括所述第二电子设备的设备标识、所述第一服务的标识,所述第三连接信息中的目的设备信息包括所述第四电子设备的设备标识、所述第二服务的标识;The method according to any one of claims 1-8, wherein the communication system further comprises a fourth electronic device, and the fourth electronic device is installed with an application for providing the second service; the first The snapshot information includes third connection information, the third connection information includes source device information and destination device information, and the source device information in the third connection information includes the device identifier of the second electronic device, the first service The destination device information in the third connection information includes the device identifier of the fourth electronic device and the identifier of the second service;
    所述第一电子设备获取第一会话的第一快照信息之后,所述方法还包括:After the first electronic device obtains the first snapshot information of the first session, the method further includes:
    所述第一电子设备将所述第三连接信息发送给所述第二电子设备;The first electronic device sends the third connection information to the second electronic device;
    所述第二电子设备根据所述第三连接信息,利用提供所述第一服务的应用向所述第四电子设备发送第五指令,所述第五指令用于指示所述第四电子设备提供所述第二服务;The second electronic device sends a fifth instruction to the fourth electronic device by using an application providing the first service according to the third connection information, and the fifth instruction is used to instruct the fourth electronic device to provide said second service;
    所述第四电子设备接收到所述第五指令,提供所述第二服务。The fourth electronic device receives the fifth instruction and provides the second service.
  15. 根据权利要求14所述的方法,其特征在于,所述方法还包括:The method according to claim 14, characterized in that the method further comprises:
    所述第二电子设备接收到第六指令,所述第六指令用于指示所述第二电子设备通过提供所述第一服务运行的应用调用所述第四电子设备提供所述第二服务;The second electronic device receives a sixth instruction, and the sixth instruction is used to instruct the second electronic device to call the fourth electronic device to provide the second service through an application running on the first service;
    所述第二电子设备根据所述第六指令向所述第四电子设备发送所述第五指令;The second electronic device sends the fifth instruction to the fourth electronic device according to the sixth instruction;
    若所述第二电子设备判断出自己开启提供所述第一服务的应用的方式为主动开启,所述第二电子设备创建第三会话,并存储所述第三会话的第三快照信息;所述主动开启表示电子设备接收到作用在一个应用上用于开启这一个应用的用户操作,而开启这一个应用;所述第三会话为所述第二电子设备通过提供所述第一服务的应用调用一个或多个电子设备提供一项或多项服务所进行的通信,所述第三快照信息包括所述第三连接信息;If the second electronic device determines that the mode of opening the application providing the first service is to open it actively, the second electronic device creates a third session and stores third snapshot information of the third session; The active opening means that the electronic device receives a user operation acting on an application to open this application, and starts this application; the third session is the application that the second electronic device provides the first service through calling one or more electronic devices to provide one or more services for communication, the third snapshot information includes the third connection information;
    若所述第二电子设备判断出自己开启提供所述第一服务的应用的方式为被动开启,所述第二电子设备将所述第三连接信息发送给所述第一电子设备;所述第一电子设备存储所述第 三连接信息;所述被动开启表示电子设备接收到其它电子设备用于提供一项服务的调用指令,而开启用于提供这一项服务的应用。If the second electronic device determines that the mode of opening the application providing the first service is passive opening, the second electronic device sends the third connection information to the first electronic device; the second electronic device sends the third connection information to the first electronic device; An electronic device stores the third connection information; the passive opening means that the electronic device receives an invocation instruction from another electronic device for providing a service, and starts an application for providing the service.
  16. 根据权利要求1-8所述的方法,其特征在于,所述第一快照信息还包括第四连接信息,所述第四连接信息包括源设备信息和目的设备信息,所述第四连接信息中的源设备信息包括所述第二电子设备的设备标识、所述第一服务的标识,所述第四连接信息中的目的设备信息包括所述第一电子设备的设备标识、所述第一应用的应用标识;The method according to claim 1-8, wherein the first snapshot information further includes fourth connection information, the fourth connection information includes source device information and destination device information, and the fourth connection information includes The source device information in the fourth connection information includes the device identifier of the second electronic device and the identifier of the first service, and the destination device information in the fourth connection information includes the device identifier of the first electronic device, the first application The application identification;
    所述第一电子设备获取第一会话的第一快照信息之后,所述方法还包括:After the first electronic device obtains the first snapshot information of the first session, the method further includes:
    所述第一电子设备将所述第四连接信息发送给所述第二电子设备;The first electronic device sends the fourth connection information to the second electronic device;
    所述第二电子设备根据所述第四连接信息,利用提供所述第一服务的应用向所述第一电子设备发送第七指令,所述第七指令用于指示所述第一电子设备调用所述第一应用;The second electronic device uses the application providing the first service to send a seventh instruction to the first electronic device according to the fourth connection information, and the seventh instruction is used to instruct the first electronic device to call said first application;
    所述第一电子设备比较自己的第一层级标识和所述第二电子设备的第二层级标识,确定所述第一层级标识低于所述第二层级标识,所述第一电子设备拒绝响应所述第七指令;一个会话中的一个电子设备具有层级标识,所述一个电子设备的层级标识由所述一个电子设备与创建所述一个会话的电子设备之间的连接距离确定,与创建所述一个会话的电子设备之间的连接距离越远,所述一个电子设备的层级标识越高。The first electronic device compares its first-level identification with the second-level identification of the second electronic device, determines that the first-level identification is lower than the second-level identification, and the first electronic device refuses to respond The seventh instruction: an electronic device in a session has a hierarchical identifier, and the hierarchical identifier of the electronic device is determined by the connection distance between the electronic device and the electronic device that created the session, and is related to the established The farther the connection distance between the electronic devices in the one session is, the higher the level identifier of the one electronic device is.
  17. 一种设备连接关系建立方法,其特征在于,所述方法包括:A method for establishing a device connection relationship, characterized in that the method includes:
    所述第一电子设备获取第一会话的第一快照信息,所述第一电子设备安装有第一应用,所述第一会话为所述第一电子设备通过所述第一应用调用一个或多个电子设备提供一项或多项服务所进行的通信,所述第一快照信息包括第一连接信息,所述第一连接信息包括第二电子设备的设备标识、第一服务的标识;所述第二电子设备安装有用于提供所述第一服务的应用;The first electronic device acquires first snapshot information of a first session, the first electronic device is installed with a first application, and the first session is for the first electronic device to call one or more Communication performed by an electronic device providing one or more services, the first snapshot information includes first connection information, and the first connection information includes a device identifier of a second electronic device and an identifier of a first service; The second electronic device is installed with an application for providing the first service;
    所述第一电子设备根据所述第一连接信息向所述第二电子设备发送第一指令,所述第一指令用于指示所述第二电子设备提供所述第一服务。The first electronic device sends a first instruction to the second electronic device according to the first connection information, where the first instruction is used to instruct the second electronic device to provide the first service.
  18. 根据权利要求17所述的方法,其特征在于,所述方法还包括:The method according to claim 17, further comprising:
    所述第一电子设备接收到第二指令,所述第二指令用于指示所述第一电子设备通过所述第一应用调用所述第二电子设备提供所述第一服务;The first electronic device receives a second instruction, the second instruction is used to instruct the first electronic device to call the second electronic device to provide the first service through the first application;
    所述第一电子设备创建所述第一会话,并存储所述第一快照信息;The first electronic device creates the first session and stores the first snapshot information;
    所述第一电子设备根据所述第二指令向所述第二电子设备发送所述第一指令。The first electronic device sends the first instruction to the second electronic device according to the second instruction.
  19. 根据权利要求17或18所述的方法,其特征在于,所述第一会话具有第一会话标识,所述第一会话标识由所述第一电子设备的设备账号和所述第一应用的应用标识确定;所述第一会话标识用于所述第一电子设备获取所述第一快照信息;The method according to claim 17 or 18, wherein the first session has a first session ID, and the first session ID consists of the device account of the first electronic device and the application of the first application Identification determination; the first session identification is used for the first electronic device to obtain the first snapshot information;
    所述第一指令包含所述第一会话标识。The first instruction includes the first session identifier.
  20. 根据权利要求17-19中任一项所述的方法,其特征在于,所述第二电子设备安装有第二应用,所述第二应用用于提供所述第一服务,所述第一连接信息还包括所述第二应用的应用标识,所述第一指令用于指示所述第二电子设备运行所述第二应用来提供所述第一服务。The method according to any one of claims 17-19, wherein the second electronic device is installed with a second application, the second application is used to provide the first service, and the first connection The information further includes an application identifier of the second application, and the first instruction is used to instruct the second electronic device to run the second application to provide the first service.
  21. 根据权利要求17-20中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 17-20, wherein the method further comprises:
    所述第一电子设备接收并存储所述第二电子设备发送的第一活动信息,所述第一活动信息包含于所述第一快照信息;所述第一活动信息包括所述第二电子设备提供所述第一服务的过程中用于指示提供所述第一服务的应用的用户界面在第一时刻呈现内容的数据;所述第一时刻为所述第二电子设备提供所述第一服务的过程中的任一时刻。The first electronic device receives and stores the first activity information sent by the second electronic device, the first activity information is included in the first snapshot information; the first activity information includes the second electronic device In the process of providing the first service, it is used to indicate that the user interface of the application providing the first service presents content data at a first moment; the second electronic device provides the first service at the first moment at any point in the process.
  22. 根据权利要求21所述的方法,其特征在于,所述第一电子设备获取第一会话的第一快照信息之后,所述方法还包括:The method according to claim 21, wherein after the first electronic device obtains the first snapshot information of the first session, the method further comprises:
    所述第一电子设备将所述第一活动信息发送给所述第二电子设备;所述第一活动信息用于确定所述第二电子设备在运行提供所述第一服务的应用初始时刻所述应用的用户界面的呈现内容。The first electronic device sends the first activity information to the second electronic device; the first activity information is used to determine the initial moment when the second electronic device runs the application that provides the first service. Presentation content of the user interface of the application.
  23. 根据权利要求17-22所述的方法,其特征在于,所述第一电子设备还安装有第四应用;所述方法还包括:The method according to claim 17-22, wherein the first electronic device is further installed with a fourth application; the method further comprises:
    所述第一电子设备接收到第三指令,所述第三指令用于指示第一电子设备通过所述第四应用调用电子设备提供所述第一服务;The first electronic device receives a third instruction, and the third instruction is used to instruct the first electronic device to call the electronic device to provide the first service through the fourth application;
    所述第一电子设备从一个会话或多个会话的快照信息中查找包含所述第一服务的标识的连接信息,得到所述第一连接信息;所述一个会话或多个会话是所述第一电子设备创建的;The first electronic device searches for the connection information including the identifier of the first service from the snapshot information of one session or multiple sessions, and obtains the first connection information; the one session or multiple sessions are the first Created by an electronic device;
    所述第一电子设备根据所述第一连接信息向所述第二电子设备发送第四指令,并创建第二会话,存储第二会话的第二快照信息;所述第四指令用于指示所述第二电子设备提供所述第一服务;所述第二会话为所述第一电子设备通过所述第四应用调用一个或多个电子设备提供一项或多项服务所进行的通信;所述第二快照信息包括第二连接信息,所述第二连接信息包括所述第二电子设备的设备标识、所述第一服务的标识。The first electronic device sends a fourth instruction to the second electronic device according to the first connection information, and creates a second session, and stores second snapshot information of the second session; the fourth instruction is used to indicate the The second electronic device provides the first service; the second session is a communication performed by the first electronic device calling one or more electronic devices to provide one or more services through the fourth application; The second snapshot information includes second connection information, and the second connection information includes the device identifier of the second electronic device and the identifier of the first service.
  24. 根据权利要求17-23中任一项所述的方法,其特征在于,所述第一电子设备获取第一会话的第一快照信息之后,所述方法还包括:The method according to any one of claims 17-23, wherein after the first electronic device obtains the first snapshot information of the first session, the method further comprises:
    所述第一电子设备判断所述第二电子设备是否可用;The first electronic device determines whether the second electronic device is available;
    若判断出所述第二电子设备不可用,所述第一电子设备从搜索到的多个电子设备中选取出第三电子设备,并调用第三电子设备提供所述第一服务;所述第三电子设备为所述多个电子设备中可用且可提供所述第一服务的一个电子设备。If it is determined that the second electronic device is unavailable, the first electronic device selects a third electronic device from the searched multiple electronic devices, and invokes the third electronic device to provide the first service; The third electronic device is an electronic device that is available among the plurality of electronic devices and can provide the first service.
  25. 根据权利要求24所述的方法,其特征在于,所述第一电子设备从搜索到的多个电子设备中选取出第三电子设备,所述方法包括:The method according to claim 24, wherein the first electronic device selects a third electronic device from the searched multiple electronic devices, the method comprising:
    所述第一电子设备根据第一规则从搜索到的多个电子设备中选取出所述第三电子设备,所述第三电子设备为所述多个电子设备中可用、可提供所述第一服务且优先级最高的电子设备;所述第一规则包括:与所述第一电子设备的设备账号相同且设备类型相同的电子设备的优先级>与所述第一电子设备的设备账号相同且设备类型不同的电子设备的优先级>与所述第一电子设备的设备账号不同但设备类型相同的电子设备的优先级>与所述第一电子设备的设备账号不同且设备类型不同的电子设备的优先级。The first electronic device selects the third electronic device from the plurality of searched electronic devices according to the first rule, and the third electronic device is available among the plurality of electronic devices and can provide the first The electronic device that serves and has the highest priority; the first rule includes: the priority of the electronic device with the same device account and the same device type as the first electronic device>same as the device account of the first electronic device and The priority of electronic devices with different device types>the priority of electronic devices with different device accounts from the first electronic device but the same device type>the electronic devices with different device accounts and different device types from the first electronic device priority.
  26. 根据权利要求25所述的方法,其特征在于,所述第一电子设备的设备账号相同且设 备类型不同的电子设备有多个,或者与所述第一电子设备的设备账号不同且设备类型不同的电子设备有多个;所述第一规则还包括:在设备类型不同的多个电子设备中,电子设备的优先级由电子设备的私密度确定,电子设备的私密度越低,电子设备的优先级越高;所述电子设备的私密度包括:电视=音箱<平板<手表=手机。The method according to claim 25, characterized in that there are multiple electronic devices with the same device account and different device types for the first electronic device, or different device accounts and different device types from the first electronic device There are multiple electronic devices; the first rule also includes: among multiple electronic devices with different types of devices, the priority of the electronic device is determined by the privacy degree of the electronic device, the lower the privacy degree of the electronic device, the higher the priority of the electronic device. The higher the priority; the privacy of the electronic device includes: TV=speaker<tablet<watch=mobile phone.
  27. 根据权利要求17-26中任一项所述的方法,其特征在于,所述第一电子设备获取第一会话的第一快照信息之后,所述方法还包括:The method according to any one of claims 17-26, wherein after the first electronic device acquires the first snapshot information of the first session, the method further comprises:
    所述第一电子设备根据所述第一连接信息在用户界面显示第二电子设备选项;The first electronic device displays options of the second electronic device on the user interface according to the first connection information;
    所述第一电子设备检测到作用于所述第二电子设备选项的第一用户操作,所述第一用户操作用于触发所述第一电子设备向所述第二电子设备发送所述第一指令。The first electronic device detects a first user operation acting on an option of the second electronic device, and the first user operation is used to trigger the first electronic device to send the first electronic device to the second electronic device. instruction.
  28. 根据权利要求27所述的方法,其特征在于,所述第一电子设备判断所述第二电子设备是否可用之后,所述方法还包括:The method according to claim 27, wherein after the first electronic device determines whether the second electronic device is available, the method further comprises:
    若判断出所述第二电子设备可用,所述第一电子设备将所述第二电子设备选项显示为第一状态,所述第一状态用于指示所述第二电子设备可用;If it is determined that the second electronic device is available, the first electronic device displays the option of the second electronic device as a first state, and the first state is used to indicate that the second electronic device is available;
    若判断出所述第二电子设备不可用,所述第一电子设备将所述第二电子设备选项显示为第二状态,所述第二状态用于指示所述第二电子设备不可用。If it is determined that the second electronic device is unavailable, the first electronic device displays the second electronic device option as a second state, and the second state is used to indicate that the second electronic device is unavailable.
  29. 根据权利要求17-23中任一项所述的方法,其特征在于,所述第一快照信息还包括第三连接信息,所述第三连接信息包括源设备信息和目的设备信息,所述第三连接信息中的源设备信息包括所述第二电子设备的设备标识、所述第一服务的标识,所述第三连接信息中的目的设备信息包括第四电子设备的设备标识、第二服务的标识;所述第四电子设备安装有用于提供所述第二服务的应用;The method according to any one of claims 17-23, wherein the first snapshot information further includes third connection information, the third connection information includes source device information and destination device information, and the first The source device information in the third connection information includes the device identifier of the second electronic device and the first service identifier, and the destination device information in the third connection information includes the device identifier of the fourth electronic device and the second service identifier. the identification of; the fourth electronic device is installed with an application for providing the second service;
    所述第一电子设备获取第一会话的第一快照信息之后,所述方法还包括:After the first electronic device obtains the first snapshot information of the first session, the method further includes:
    所述第一电子设备将所述第三连接信息方给所述第二电子设备;所述第三连接信息使得所述第二电子设备通过提供所述第一服务的应用向所述第四电子设备发送第五指令,所述第五指令用于指示所述第四电子设备提供所述第二服务。The first electronic device sends the third connection information to the second electronic device; the third connection information enables the second electronic device to send the fourth electronic device information to the fourth electronic device through the application that provides the first service. The device sends a fifth instruction, where the fifth instruction is used to instruct the fourth electronic device to provide the second service.
  30. 根据权利要求17-23所述的方法,其特征在于,所述第一快照信息还包括第四连接信息,所述第四连接信息包括源设备信息和目的设备信息,所述第四连接信息中的源设备信息包括所述第二电子设备的设备标识、所述第一服务的标识,所述第四连接信息中的目的设备信息包括所述第一电子设备的设备标识、所述第一应用的应用标识;The method according to claim 17-23, wherein the first snapshot information further includes fourth connection information, the fourth connection information includes source device information and destination device information, and the fourth connection information includes The source device information in the fourth connection information includes the device identifier of the second electronic device and the identifier of the first service, and the destination device information in the fourth connection information includes the device identifier of the first electronic device, the first application the application identifier;
    所述第一电子设备获取第一会话的第一快照信息之后,所述方法还包括:After the first electronic device obtains the first snapshot information of the first session, the method further includes:
    所述第一电子设备将所述第四连接信息发送给所述第二电子设备;所述第四连接信息使得所述第二电子设备通过提供所述第一服务的应用向所述第一电子设备发送第七指令,所述第七指令用于指示所述第一电子设备调用所述第一应用;The first electronic device sends the fourth connection information to the second electronic device; the fourth connection information enables the second electronic device to send the first electronic service to the first electronic device through the application that provides the first service. The device sends a seventh instruction, where the seventh instruction is used to instruct the first electronic device to invoke the first application;
    所述第一电子设备接收到所述第七指令,比较自己的第一层级标识和所述第二电子设备的第二层级标识,确定所述第一层级标识低于所述第二层级标识,所述第一电子设备拒绝响应所述第七指令;一个会话中的一个电子设备具有层级标识,所述一个电子设备的层级标识由所述一个电子设备与创建所述一个会话的电子设备之间的连接距离确定,与创建所述一个会话的电子设备之间的连接距离越远,所述一个电子设备的层级标识越高。The first electronic device receives the seventh instruction, compares its own first-level identification with the second-level identification of the second electronic device, and determines that the first-level identification is lower than the second-level identification, The first electronic device refuses to respond to the seventh instruction; an electronic device in a session has a hierarchical identification, and the hierarchical identification of the electronic device is established between the electronic device and the electronic device that created the session The connection distance is determined, and the farther the connection distance with the electronic device creating the one session is, the higher the level identification of the one electronic device is.
  31. 一种通信系统,其特征在于,所述通信系统至少包括第一电子设备、第二电子设备,其中,所述第一电子设备、所述第二电子设备配合执行权利要求1-16中任一项所述的方法。A communication system, characterized in that the communication system includes at least a first electronic device and a second electronic device, wherein the first electronic device and the second electronic device cooperate to perform any one of claims 1-16 method described in the item.
  32. 一种电子设备,其特征在于,所述电子设备包括:通信装置、存储器、处理器,所述存储器用于存储计算机程序,所述处理器用于调用所述计算机程序,使得所述电子设备执行权利要求17-30中任一项所述的方法。An electronic device, characterized in that the electronic device includes: a communication device, a memory, and a processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the electronic device executes the rights The method of any one of claims 17-30.
  33. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在电子设备上运行,使得所述电子设备执行权利要求17-30中任一项所述的方法。A computer-readable storage medium, comprising instructions, wherein, when the instructions are run on an electronic device, the electronic device is made to execute the method described in any one of claims 17-30.
PCT/CN2022/083299 2021-05-20 2022-03-28 Application-based device connection relationship establishment method and related apparatus WO2022242312A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110552602.8A CN115460233A (en) 2021-05-20 2021-05-20 Application-based equipment connection relation establishing method and related device
CN202110552602.8 2021-05-20

Publications (1)

Publication Number Publication Date
WO2022242312A1 true WO2022242312A1 (en) 2022-11-24

Family

ID=84140269

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/083299 WO2022242312A1 (en) 2021-05-20 2022-03-28 Application-based device connection relationship establishment method and related apparatus

Country Status (2)

Country Link
CN (1) CN115460233A (en)
WO (1) WO2022242312A1 (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160034161A1 (en) * 2014-08-01 2016-02-04 Content Maker, Inc. Methods and systems of providing interactive media presentations
US20160034160A1 (en) * 2014-08-01 2016-02-04 Content Maker, Inc. Methods and systems of providing interactive media presentations
CN108200464A (en) * 2018-01-25 2018-06-22 青岛海信电器股份有限公司 Smart television and the method convenient for selecting educational class content
CN108235091A (en) * 2018-01-25 2018-06-29 青岛海信电器股份有限公司 Smart television and the method that upper content is applied based on access homepage in display equipment
CN109147442A (en) * 2018-10-15 2019-01-04 两栖教育科技有限公司 Sync instruction system based on student classroom answer situation
CN109326157A (en) * 2018-11-27 2019-02-12 湖南长沙阳环科技实业有限公司 A kind of classroom answering system based on plate
CN111628916A (en) * 2019-02-27 2020-09-04 华为技术有限公司 Method for cooperation of intelligent sound box and electronic equipment
CN111741351A (en) * 2020-08-03 2020-10-02 腾讯科技(深圳)有限公司 Video data processing method and device and storage medium
CN112492371A (en) * 2020-11-18 2021-03-12 海信视像科技股份有限公司 Display device
CN112543361A (en) * 2020-12-02 2021-03-23 江苏北斗星通汽车电子有限公司 Multi-device playing method and device based on intelligent cabin and electronic terminal

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160034161A1 (en) * 2014-08-01 2016-02-04 Content Maker, Inc. Methods and systems of providing interactive media presentations
US20160034160A1 (en) * 2014-08-01 2016-02-04 Content Maker, Inc. Methods and systems of providing interactive media presentations
CN108200464A (en) * 2018-01-25 2018-06-22 青岛海信电器股份有限公司 Smart television and the method convenient for selecting educational class content
CN108235091A (en) * 2018-01-25 2018-06-29 青岛海信电器股份有限公司 Smart television and the method that upper content is applied based on access homepage in display equipment
CN109147442A (en) * 2018-10-15 2019-01-04 两栖教育科技有限公司 Sync instruction system based on student classroom answer situation
CN109326157A (en) * 2018-11-27 2019-02-12 湖南长沙阳环科技实业有限公司 A kind of classroom answering system based on plate
CN111628916A (en) * 2019-02-27 2020-09-04 华为技术有限公司 Method for cooperation of intelligent sound box and electronic equipment
CN111741351A (en) * 2020-08-03 2020-10-02 腾讯科技(深圳)有限公司 Video data processing method and device and storage medium
CN112492371A (en) * 2020-11-18 2021-03-12 海信视像科技股份有限公司 Display device
CN112543361A (en) * 2020-12-02 2021-03-23 江苏北斗星通汽车电子有限公司 Multi-device playing method and device based on intelligent cabin and electronic terminal

Also Published As

Publication number Publication date
CN115460233A (en) 2022-12-09

Similar Documents

Publication Publication Date Title
US20230021994A1 (en) Cross-Device Content Projection Method and Electronic Device
CN111628916B (en) Method for cooperation of intelligent sound box and electronic equipment
CN110503959B (en) Voice recognition data distribution method and device, computer equipment and storage medium
US11868463B2 (en) Method for managing application permission and electronic device
CN113329047B (en) Distributed service scheduling method and related device
WO2020224447A1 (en) Method and system for adding smart home device to contacts
WO2020216098A1 (en) Method for providing forwarding service across electronic apparatuses, apparatus, and system
US20230185943A1 (en) Family event combination method and apparatus
WO2022100222A1 (en) Information retrieval method, apparatus and system, and storage medium
CN114124980B (en) Method, device, system, terminal and storage medium for starting application
CN111835904A (en) Method for starting application based on context awareness and user portrait and electronic equipment
WO2022160991A1 (en) Permission control method and electronic device
WO2022135157A1 (en) Page display method and apparatus, and electronic device and readable storage medium
WO2022095712A1 (en) Data sharing method, apparatus and system, and electronic device
WO2022242312A1 (en) Application-based device connection relationship establishment method and related apparatus
EP4293997A1 (en) Display method, electronic device, and system
WO2022152174A1 (en) Screen projection method and electronic device
WO2021147483A1 (en) Data sharing method and apparatus
WO2022062902A1 (en) File transfer method and electronic device
WO2023179682A1 (en) Device collaboration method
WO2023045966A1 (en) Capability sharing method, electronic devices and computer-readable storage medium
WO2023142941A1 (en) Playing record display method and related device
WO2022222780A1 (en) Audio output method, media file recording method, and electronic device
WO2022143273A1 (en) Information processing method and electronic device
WO2022068578A1 (en) File sharing method and electronic device

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE