[go: up one dir, main page]

CN116737404A - Method and terminal equipment for application connection - Google Patents

Method and terminal equipment for application connection Download PDF

Info

Publication number
CN116737404A
CN116737404A CN202211197093.2A CN202211197093A CN116737404A CN 116737404 A CN116737404 A CN 116737404A CN 202211197093 A CN202211197093 A CN 202211197093A CN 116737404 A CN116737404 A CN 116737404A
Authority
CN
China
Prior art keywords
application
connection
communication
terminal device
communication channel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211197093.2A
Other languages
Chinese (zh)
Other versions
CN116737404B (en
Inventor
房家鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202411003271.2A priority Critical patent/CN119166381A/en
Priority to CN202211197093.2A priority patent/CN116737404B/en
Publication of CN116737404A publication Critical patent/CN116737404A/en
Application granted granted Critical
Publication of CN116737404B publication Critical patent/CN116737404B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)

Abstract

本申请提供了一种用于应用接续的方法及终端设备,有利于为终端设备灵活分配通信资源,以实现应用和电脑管家中的接续服务之间的通信。该方法包括:响应于用户点击第一应用的图标的操作,获取共享内存中目标比特位的标识,目标比特位是值为第一预设值的比特位,第一预设值表示目标比特位对应的通信通道未被使用;基于目标比特位的标识,确定目标比特位对应的通信标识,通信标识指示用于第一应用和电脑管家通信的至少一个通信通道;基于该至少一个通信通道实现第一应用与电脑管家之间的数据传输。

This application provides a method and terminal device for application connection, which is beneficial to flexibly allocate communication resources to the terminal device to realize communication between the application and the connection service in the computer manager. The method includes: in response to the user's operation of clicking the icon of the first application, obtaining an identification of a target bit in the shared memory. The target bit is a bit whose value is a first preset value, and the first preset value represents the target bit. The corresponding communication channel is not used; based on the identification of the target bit, a communication identification corresponding to the target bit is determined, and the communication identification indicates at least one communication channel used for communication between the first application and the computer manager; based on the at least one communication channel, the first communication channel is implemented Data transmission between an application and computer manager.

Description

用于应用接续的方法及终端设备Method and terminal equipment for application connection

技术领域Technical field

本申请涉及终端领域,尤其涉及一种用于应用接续的方法及终端设备。The present application relates to the field of terminals, and in particular, to a method for application connection and a terminal device.

背景技术Background technique

目前,跨设备之间的应用接续将成为后续多设备场景中的重要功能。其中,应用接续可以理解为,当用户在个人笔记本(personal computer,PC)上使用某一应用时,用户可以在符合接续条件的手机中接续该应用的使用状态,并继续在手机上使用该应用。At present, application connection across devices will become an important function in subsequent multi-device scenarios. Among them, application connection can be understood as that when a user uses an application on a personal computer (PC), the user can continue the usage status of the application on a mobile phone that meets the connection conditions and continue to use the application on the mobile phone. .

对于应用接续场景下的PC而言,为实现将应用的使用状态同步至其他设备,或者将其他设备的应用的使用状态同步至PC的需求,PC需要对外提供接续框架和软件开发工具包(software development kit,SDK)以满足此需求。其中,接续框架是为应用提供统一的应用状态同步框架,应用需要通过SDK接入接续框架,实现与接续框架中的接续服务的数据传输,而接续服务以电脑管家为依托为应用提供对外服务能力。在PC中的应用和电脑管家启动之后,应用和电脑管家运行在两个不同的进程,应用需要通过进程间通信(interprocess communication,IPC)和电脑管家中的接续服务通信。For PCs in application connection scenarios, in order to synchronize the application usage status to other devices, or to synchronize the application usage status of other devices to the PC, the PC needs to provide an external connection framework and software development kit (software). development kit, SDK) to meet this need. Among them, the connection framework provides a unified application status synchronization framework for applications. The application needs to access the connection framework through the SDK to realize data transmission with the connection service in the connection framework. The connection service relies on Computer Butler to provide external service capabilities for the application. . After the application and computer manager in the PC are started, the application and computer manager run in two different processes. The application needs to communicate with the connection service in the computer manager through interprocess communication (IPC).

因此,如何在PC侧为应用分配IPC通信资源,以实现应用和电脑管家中的接续服务之间的通信,是一个亟待解决的问题。Therefore, how to allocate IPC communication resources to applications on the PC side to achieve communication between the application and the connection service in the computer manager is an urgent problem that needs to be solved.

发明内容Contents of the invention

本申请提供一种用于应用接续的方法及终端设备,有利于为终端设备灵活分配IPC通信资源,以实现应用和电脑管家中的接续服务之间的通信。This application provides a method and terminal equipment for application connection, which is conducive to flexibly allocating IPC communication resources to the terminal equipment to realize communication between the application and the connection service in the computer manager.

第一方面,提供了一种用于应用接续的方法,应用于终端设备,该终端设备为应用接续的发送端或者接收端,该终端设备安装有第一应用和电脑管家,该方法包括:响应于用户点击第一应用的图标的操作,获取共享内存中目标比特位的标识,目标比特位是值为第一预设值的比特位,第一预设值表示目标比特位对应的通信通道未被使用;基于目标比特位的标识,确定目标比特位对应的通信标识,通信标识指示用于第一应用和电脑管家通信的至少一个通信通道;基于至少一个通信通道实现第一应用与电脑管家之间的数据传输。In a first aspect, a method for application connection is provided, which is applied to a terminal device. The terminal device is a sending end or a receiving end of application connection. The terminal device is installed with a first application and a computer manager. The method includes: responding When the user clicks on the icon of the first application, the identification of the target bit in the shared memory is obtained. The target bit is a bit whose value is a first preset value. The first preset value indicates that the communication channel corresponding to the target bit has not been is used; based on the identification of the target bit, determine the communication identification corresponding to the target bit, the communication identification indicates at least one communication channel for communication between the first application and the computer manager; realize the communication between the first application and the computer manager based on at least one communication channel data transmission between.

在本申请中,电脑管家中集成有接续服务管理器(下文中也可简称为接续服务),第一应用与电脑管家通信,包括第一应用的接续服务SDK与电脑管家中的接续服务之间的通信。在第一应用和电脑管家启动之后,接续服务在电脑管家中运行,第一应用作为独立进程接入SDK后运行在三方应用中。因此,第一应用需要和电脑管家中的接续服务通过接续服务SDK进行跨进程通信。In this application, the computer manager is integrated with a connection service manager (hereinafter also referred to as the connection service). The first application communicates with the computer manager, including the connection between the connection service SDK of the first application and the connection service in the computer manager. Communication. After the first application and the computer manager are started, the connection service runs in the computer manager. The first application is connected to the SDK as an independent process and runs in the third-party application. Therefore, the first application needs to perform cross-process communication with the connection service in the computer manager through the connection service SDK.

在一些场景下,可能会有至少一个应用接入接续服务以期实现应用接续,在这种场景下,电脑管家需要具备与所有接入接续服务的应用通过IPC通信的能力。在本申请提供的技术方案中,针对接入接续服务的至少一个应用中的第一应用,终端设备可以获取共享内存中的目标比特位的标识,基于目标比特位的标识得到对应的通信标识,为第一应用分配与通信标识对应的至少一个通信通道,以使第一应用通过IPC通信资源与电脑管家中的接续服务进行通信。这样,通过将IPC通信和共享内存结合,终端设备可以灵活地为所有接入接续服务的应用分配IPC通信资源,实现应用接续场景下应用和电脑管家之间的数据传输。In some scenarios, there may be at least one application accessing the connection service in order to achieve application connection. In this scenario, the computer manager needs to have the ability to communicate with all applications accessing the connection service through IPC. In the technical solution provided by this application, for the first application in at least one application of the access connection service, the terminal device can obtain the identification of the target bit in the shared memory, and obtain the corresponding communication identification based on the identification of the target bit, Allocate at least one communication channel corresponding to the communication identifier to the first application, so that the first application communicates with the connection service in the computer manager through the IPC communication resource. In this way, by combining IPC communication and shared memory, the terminal device can flexibly allocate IPC communication resources to all applications accessing the connection service, realizing data transmission between the application and the computer manager in the application connection scenario.

结合第一方面,在第一方面的某些实现方式中,该方法还包括:基于对目标比特位的标识的获取,将目标比特位的值从第一预设值修改为第二预设值,第二预设值表示目标比特位对应的通信通道已被使用。In connection with the first aspect, in some implementations of the first aspect, the method further includes: based on obtaining the identifier of the target bit, modifying the value of the target bit from the first preset value to the second preset value , the second preset value indicates that the communication channel corresponding to the target bit has been used.

在本申请中,终端设备在确定目标比特位之后,可以将目标比特位的值从第一预设值修改为第二预设值,以标识目标比特位对应的通信通道已被申请或已被使用。这样当再有新的应用接入接续服务之后,终端设备可以为该新的应用申请其他的值为第一预设值的比特位对应的通信通道,实现IPC通信资源的灵活分配。In this application, after determining the target bit, the terminal device can modify the value of the target bit from the first preset value to the second preset value to identify that the communication channel corresponding to the target bit has been applied for or has been used. use. In this way, when a new application accesses the connection service, the terminal device can apply for other communication channels corresponding to the bits whose values are the first preset values for the new application, thereby realizing flexible allocation of IPC communication resources.

可选地,终端设备可以响应于用户点击第一应用的图标的操作,对共享内存中的多个比特位的值进行检测,确定多个比特位中的值为第一预设值的目标比特位。在确定目标比特位之后,终端设备可以获取目标比特位的标识。并且,在确定目标比特位之后,终端设备可以将目标比特位的值从第一预设值修改为第二预设值。其中,终端设备获取目标比特位的标识与将目标比特位的值从第一预设值修改为第二预设值执行顺序不作限定。Optionally, the terminal device may detect the values of multiple bits in the shared memory in response to the user's operation of clicking the icon of the first application, and determine that the value of the multiple bits is the target bit of the first preset value. Bit. After determining the target bit, the terminal device can obtain the identifier of the target bit. Moreover, after determining the target bit, the terminal device may modify the value of the target bit from the first preset value to the second preset value. The order in which the terminal device obtains the identification of the target bit and modifies the value of the target bit from the first preset value to the second preset value is not limited.

结合第一方面,在第一方面的某些实现方式中,基于至少一个通信通道实现第一应用与所述电脑管家之间的数据传输,包括:基于至少一个通信通道中的第一通信通道,注册接续服务和回调。In conjunction with the first aspect, in some implementations of the first aspect, implementing data transmission between the first application and the computer manager based on at least one communication channel includes: based on the first communication channel in the at least one communication channel, Register connection services and callbacks.

在本申请中,终端设备为第一应用分配的至少一个通信通道中的每个通信通道可用户传输不同类型的消息。其中,第一通信通道用于第一应用注册接续服务和回调。这样使得应用接续场景下的数据传输更加便捷高效。In this application, each of the at least one communication channel allocated by the terminal device to the first application can transmit different types of messages to the user. The first communication channel is used for the first application registration connection service and callback. This makes data transmission in application connection scenarios more convenient and efficient.

结合第一方面,在第一方面的某些实现方式中,该方法还包括:在第一应用的进程退出的情况下,将目标比特位的值从第二预设值修改为第一预设值。In connection with the first aspect, in some implementations of the first aspect, the method further includes: when the process of the first application exits, modifying the value of the target bit from the second preset value to the first preset value. value.

在本申请中,第一应用的进程退出,包括第一应用的进程正常退出和异常退出两种情况。在第一应用的进程退出后,终端设备可以将目标比特位的值从第二预设值修改为第一预设值,释放被第一应用占用的通信通道,这样在IPC通信资源有限的情况下,其他的应用便可以使用目标比特位对应的通信通道,提高了资源利用率。In this application, the process exit of the first application includes two situations: normal exit and abnormal exit of the process of the first application. After the process of the first application exits, the terminal device can modify the value of the target bit from the second preset value to the first preset value and release the communication channel occupied by the first application. In this way, in the case of limited IPC communication resources Next, other applications can use the communication channel corresponding to the target bit, improving resource utilization.

结合第一方面,在第一方面的某些实现方式中,该方法还包括:基于该至少一个通信通道中的第二通信通道,解除注册接续服务和回调;基于对接续服务和回调的解除注册,确定第一应用的进程退出。In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: deregistering the connection service and callback based on the second communication channel in the at least one communication channel; deregistering the connection service and callback based on , confirm that the process of the first application exits.

在本申请中,在第一应用正常退出的情况下,终端设备可以通过为第一应用分配的第二通信通道解除注册接续服务和回调。当终端设备中的接续服务接收到解除注册接续服务和回调的消息之后,可以确定第一应用的进程正常退出,进而终端设备可以释放为第一应用分配的通信通道。In this application, when the first application exits normally, the terminal device can deregister the connection service and callback through the second communication channel allocated for the first application. After the connection service in the terminal device receives the message of deregistering the connection service and the callback, it can be determined that the process of the first application exits normally, and then the terminal device can release the communication channel allocated for the first application.

结合第一方面,在第一方面的某些实现方式中,该方法还包括:在成功注册接续服务和回调之后,定时查询第一应用的进程是否退出。In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: after successfully registering the connection service and the callback, regularly querying whether the process of the first application has exited.

在本申请中,终端设备通过定时查询第一应用的进程是否退出,以此来及时监测第一应用的进程的状态。In this application, the terminal device monitors the status of the process of the first application in a timely manner by regularly querying whether the process of the first application has exited.

示例性地,终端设备通过电脑管家定时向第一应用发送保活包,若第一应用的进程还在运行,则电脑管家可以成功发送保活包;若第一应用的进程异常退出,则电脑管家无法成功发送保活包。终端设备根据电脑管家是否成功发送保活包来确定第一应用的进程是否已经退出。For example, the terminal device regularly sends a keep-alive packet to the first application through the computer manager. If the process of the first application is still running, the computer manager can successfully send the keep-alive packet; if the process of the first application exits abnormally, the computer manager The housekeeper cannot successfully send the keep-alive package. The terminal device determines whether the process of the first application has exited based on whether the computer manager successfully sends the keep-alive packet.

结合第一方面,在第一方面的某些实现方式中,终端设备为应用接续的发送端;在第一应用先于电脑管家启动,或电脑管家的进程异常退出的情况下,该方法还包括:广播通信回连消息,通信回连消息用于指示第一应用连接电脑管家。基于该至少一个通信通道中的第一通信通道,注册接续服务和回调,包括:在基于至少一个通信通道中的第三通信通道接收到通信回连消息的情况下,基于第一通信通道,注册接续服务和回调。Combined with the first aspect, in some implementations of the first aspect, the terminal device is the sending end of the application connection; in the case where the first application is started before the computer housekeeper, or the computer housekeeper process exits abnormally, the method also includes :Broadcast communication reconnection message. The communication reconnection message is used to instruct the first application to connect to the computer manager. Registering the connection service and callback based on the first communication channel in the at least one communication channel includes: in the case of receiving a communication connection message based on the third communication channel in the at least one communication channel, registering based on the first communication channel Continuation services and callbacks.

在本申请中,电脑管家的接续服务在启动的过程中,可以广播通信回连消息,第一应用在第三通信通道接收到通信回连消息之后,可以确定电脑管家已启动,可以正常连接。因此第一应用可以基于第一通信通道,注册接续服务和回调。In this application, the computer housekeeper's connection service can broadcast a communication reconnection message during the startup process. After the first application receives the communication reconnection message on the third communication channel, it can determine that the computer housekeeper has been started and can connect normally. Therefore, the first application can register the connection service and callback based on the first communication channel.

结合第一方面,在第一方面的某些实现方式中,终端设备为应用接续的接收端;所述响应于用户点击所述第一应用的图标的操作,获取共享内存中目标比特位的标识,包括:响应于用户点击位于终端设备的任务栏的第一应用的图标的操作,获取共享内存中目标比特位的标识。In connection with the first aspect, in some implementations of the first aspect, the terminal device is the receiving end of the application connection; in response to the operation of the user clicking the icon of the first application, the identification of the target bit in the shared memory is obtained , including: in response to the user's operation of clicking the icon of the first application located on the taskbar of the terminal device, obtaining the identification of the target bit in the shared memory.

在本申请中,作为应用接续接收端,终端设备的任务栏可以显示接续通知,接续通知可以以第一应用的图标形式显示在任务栏。这样,用户可以点击任务栏中的第一应用的图标以启动作为接收端的终端设备上的第一应用,进而为第一应用申请用于与电脑管家通信的通信通道,以使第一应用接续其他设备上的第一应用的接续数据,例如,备忘录的编辑内容、音频数据等。In this application, as the application connection receiving end, the task bar of the terminal device can display the connection notification, and the connection notification can be displayed in the task bar in the form of an icon of the first application. In this way, the user can click the icon of the first application in the taskbar to start the first application on the terminal device as the receiving end, and then apply for a communication channel for the first application to communicate with the computer manager, so that the first application can connect to other The connection data of the first application on the device, for example, the editing content of the memo, audio data, etc.

结合第一方面,在第一方面的某些实现方式中,终端设备为应用接续的发送端;响应于用户点击第一应用的图标的操作,获取共享内存中目标比特位的标识,包括:响应于用户点击位于终端设备的桌面或任务栏的第一应用的图标的操作,获取共享内存中目标比特位的标识。Combined with the first aspect, in some implementations of the first aspect, the terminal device is the sending end of the application connection; in response to the user's operation of clicking the icon of the first application, obtaining the identification of the target bit in the shared memory includes: responding When the user clicks on the icon of the first application located on the desktop or taskbar of the terminal device, the identification of the target bit in the shared memory is obtained.

在本申请中,作为应用接续的发送端,终端设备可以在桌面或者任务栏显示第一应用的图标。当用户点击(例如,双击)桌面或者任务栏中的第一应用的图标之后,终端设备可以启动作为发送端的终端设备上的第一应用,并在第一应用中进行相应的操作,例如,编辑备忘录、播放音乐等。In this application, as the sender of the application connection, the terminal device can display the icon of the first application on the desktop or taskbar. When the user clicks (for example, double-clicks) the icon of the first application on the desktop or taskbar, the terminal device can start the first application on the terminal device as the sender, and perform corresponding operations in the first application, such as editing. Notes, play music, etc.

第二方面,提供一种终端设备,包括用于执行上述第一方面中任一种可能的实现方式中的方法的获取模块和处理模块。A second aspect provides a terminal device, including an acquisition module and a processing module for executing the method in any possible implementation of the first aspect.

其中,获取模块用于:响应于用户点击所述第一应用的图标的操作,获取共享内存中目标比特位的标识,所述目标比特位是值为第一预设值的比特位,所述第一预设值表示所述目标比特位对应的通信通道未被使用。处理模块用于:基于目标比特位的标识,确定目标比特位对应的通信标识,通信标识指示用于第一应用和电脑管家通信的至少一个通信通道;基于所述至少一个通信通道实现第一应用与电脑管家之间的数据传输。Wherein, the acquisition module is configured to: in response to the user's operation of clicking the icon of the first application, acquire the identification of a target bit in the shared memory, where the target bit is a bit with a value of a first preset value, and the The first preset value indicates that the communication channel corresponding to the target bit is not used. The processing module is configured to: based on the identification of the target bit, determine the communication identification corresponding to the target bit, the communication identification indicating at least one communication channel for communication between the first application and the computer manager; implement the first application based on the at least one communication channel Data transfer to and from Computer Manager.

结合第二方面,在第二方面的某些实现方式中,处理模块用于:基于对目标比特位的标识的获取,将目标比特位的值从第一预设值修改为第二预设值,第二预设值表示目标比特位对应的通信通道已被使用。In connection with the second aspect, in some implementations of the second aspect, the processing module is configured to: based on obtaining the identifier of the target bit, modify the value of the target bit from the first preset value to the second preset value , the second preset value indicates that the communication channel corresponding to the target bit has been used.

结合第二方面,在第二方面的某些实现方式中,处理模块用于:基于至少一个通信通道中的第一通信通道,注册接续服务和回调。Combined with the second aspect, in some implementations of the second aspect, the processing module is configured to: register the connection service and the callback based on the first communication channel in the at least one communication channel.

结合第二方面,在第二方面的某些实现方式中,处理模块用于:在第一应用的进程退出的情况下,将目标比特位的值从第二预设值修改为第一预设值。In conjunction with the second aspect, in some implementations of the second aspect, the processing module is configured to: when the process of the first application exits, modify the value of the target bit from the second preset value to the first preset value. value.

结合第二方面,在第二方面的某些实现方式中,处理模块用于:基于该至少一个通信通道中的第二通信通道,解除注册接续服务和回调;以及,基于对接续服务和回调的解除注册,确定第一应用的进程退出。In connection with the second aspect, in some implementations of the second aspect, the processing module is configured to: deregister the connection service and the callback based on the second communication channel in the at least one communication channel; and, based on the connection service and the callback Unregister and confirm that the process of the first application exits.

结合第二方面,在第二方面的某些实现方式中,处理模块用于:在成功注册接续服务和回调之后,定时查询第一应用的进程是否退出。Combined with the second aspect, in some implementations of the second aspect, the processing module is configured to: after successfully registering the connection service and callback, regularly query whether the process of the first application has exited.

结合第二方面,在第二方面的某些实现方式中,终端设备为应用接续的发送端。在第一应用先于电脑管家启动,或电脑管家的进程异常退出的情况下,处理模块用于:广播通信回连消息,通信回连消息用于指示第一应用连接电脑管家;以及,在基于至少一个通信通道中的第三通信通道接收到通信回连消息的情况下,基于第一通信通道,注册接续服务和回调。Combined with the second aspect, in some implementations of the second aspect, the terminal device is the sender of the application connection. In the case where the first application is started before the computer manager, or the process of the computer manager exits abnormally, the processing module is used to: broadcast a communication reconnection message, and the communication reconnection message is used to instruct the first application to connect to the computer manager; and, based on When the third communication channel in at least one communication channel receives the communication connection message, the connection service and callback are registered based on the first communication channel.

结合第二方面,在第二方面的某些实现方式中,终端设备为应用接续的接收端。处理模块用于:响应于用户点击位于终端设备的任务栏的第一应用的图标的操作,获取共享内存中目标比特位的标识。Combined with the second aspect, in some implementations of the second aspect, the terminal device is the receiving end of the application connection. The processing module is configured to: in response to the user's operation of clicking the icon of the first application located on the taskbar of the terminal device, obtain the identification of the target bit in the shared memory.

结合第二方面,在第二方面的某些实现方式中,终端设备为应用接续的发送端。处理模块用于:响应于用户点击位于终端设备的桌面或任务栏的第一应用的图标的操作,获取共享内存中目标比特位的标识。Combined with the second aspect, in some implementations of the second aspect, the terminal device is the sender of the application connection. The processing module is configured to: in response to the user's operation of clicking the icon of the first application located on the desktop or taskbar of the terminal device, obtain the identification of the target bit in the shared memory.

第三方面,提供了另一种终端设备,包括处理器和存储器,该处理器与存储器耦合,该存储器可用于存储计算机程序,该处理器可用于调用并执行存储器中的计算机程序,以实现上述第一方面中任一种可能实现方式中的方法。In a third aspect, another terminal device is provided, including a processor and a memory. The processor is coupled to the memory. The memory can be used to store a computer program. The processor can be used to call and execute the computer program in the memory to achieve the above. A method in any possible implementation manner of the first aspect.

第四方面,提供了一种处理器,包括:输入电路、输出电路和处理电路。处理电路用于通过输入电路接收信号,并通过输出电路发射信号,使得处理器执行上述第一方面中任一种可能实现方式中的方法。In the fourth aspect, a processor is provided, including: an input circuit, an output circuit and a processing circuit. The processing circuit is configured to receive signals through the input circuit and transmit signals through the output circuit, so that the processor executes the method in any of the possible implementations of the first aspect.

在具体实现过程中,上述处理器可以为芯片,输入电路可以为输入管脚,输出电路可以为输出管脚,处理电路可以为晶体管、门电路、触发器和各种逻辑电路等。输入电路所接收的输入的信号可以是由例如但不限于接收器接收并输入的,输出电路所输出的信号可以是例如但不限于输出给发射器并由发射器发射的,且输入电路和输出电路可以是同一电路,该电路在不同的时刻分别用作输入电路和输出电路。本申请对处理器及各种电路的具体实现方式不作限制。In the specific implementation process, the above-mentioned processor can be a chip, the input circuit can be an input pin, the output circuit can be an output pin, and the processing circuit can be a transistor, a gate circuit, a flip-flop, and various logic circuits. The input signal received by the input circuit may be received and input by, for example, but not limited to, the receiver, and the signal output by the output circuit may be, for example, but not limited to, output to and transmitted by the transmitter, and the input circuit and the output A circuit may be the same circuit that functions as an input circuit and an output circuit at different times. This application does not limit the specific implementation methods of the processor and various circuits.

第五方面,提供了一种处理装置,包括处理器和存储器。该处理器用于读取存储器中存储的指令,并可通过接收器接收信号,通过发射器发射信号,以执行上述第一方面中任一种可能实现方式中的方法。In a fifth aspect, a processing device is provided, including a processor and a memory. The processor is used to read instructions stored in the memory, and can receive signals through a receiver and transmit signals through a transmitter to execute the method in any of the possible implementations of the first aspect.

可选地,处理器为一个或多个,存储器为一个或多个。Optionally, there are one or more processors and one or more memories.

可选地,存储器可以与处理器集成在一起,或者存储器与处理器分离设置。Alternatively, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

在具体实现过程中,存储器可以为非瞬时性(non-transitory)存储器,例如只读存储器(read only memory,ROM),其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请对存储器的类型以及存储器与处理器的设置方式不作限制。In the specific implementation process, the memory can be a non-transitory memory, such as a read only memory (ROM), which can be integrated on the same chip as the processor, or can be set in different On the chip, this application does not limit the type of memory and the arrangement of the memory and the processor.

应理解,相关的数据交互过程例如发送指示信息可以为从处理器输出指示信息的过程,接收能力信息可以为处理器接收输入能力信息的过程。具体地,处理输出的数据可以输出给发射器,处理器接收的输入数据可以来自接收器。其中,发射器和接收器可以统称为收发器。It should be understood that the relevant data interaction process, for example, sending instruction information may be a process of outputting instruction information from the processor, and receiving capability information may be a process of the processor receiving input capability information. Specifically, the data output by the processing can be output to the transmitter, and the input data received by the processor can come from the receiver. Among them, the transmitter and receiver can be collectively called a transceiver.

上述第五方面中的处理装置可以是一个芯片,该处理器可以通过硬件来实现也可以通过软件来实现,当通过硬件实现时,该处理器可以是逻辑电路、集成电路等;当通过软件来实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现,该存储器可以集成在处理器中,可以位于该处理器之外,独立存在。The processing device in the above fifth aspect can be a chip, and the processor can be implemented by hardware or software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, When implemented, the processor can be a general-purpose processor, which is implemented by reading the software code stored in the memory. The memory can be integrated in the processor, or can be located outside the processor and exist independently.

第六方面,提供了一种计算机程序产品,计算机程序产品包括:计算机程序代码,当该计算机程序代码被运行时,使得计算机执行上述第一方面中任一种可能实现方式中的方法。In a sixth aspect, a computer program product is provided. The computer program product includes: computer program code. When the computer program code is run, it causes the computer to execute the method in any of the possible implementations of the first aspect.

第七方面,提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,当该计算机程序被运行时,使得计算机执行上述第一方面中任一种可能实现方式中的方法。In a seventh aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. When the computer program is run, it causes the computer to execute the method in any of the possible implementations of the first aspect. .

附图说明Description of drawings

图1是本申请实施例提供的一种场景示意图;Figure 1 is a schematic diagram of a scenario provided by an embodiment of the present application;

图2是本申请实施例提供的一种应用接续的界面示意图;Figure 2 is a schematic diagram of an application connection interface provided by an embodiment of the present application;

图3是本申请实施例适用的一种终端设备的结构示意图;Figure 3 is a schematic structural diagram of a terminal device applicable to the embodiment of the present application;

图4是本申请实施例适用的终端设备的一种软件结构框图;Figure 4 is a software structure block diagram of a terminal device applicable to the embodiment of the present application;

图5是本申请实施例适用的终端设备的另一种软件结构框图;Figure 5 is another software structure block diagram of a terminal device applicable to the embodiment of the present application;

图6是本申请实施例提供的一种应用接续方法的示意性流程图;Figure 6 is a schematic flow chart of an application connection method provided by an embodiment of the present application;

图7是本申请实施例提供的一种共享内存的通信原理的示意图;Figure 7 is a schematic diagram of a shared memory communication principle provided by an embodiment of the present application;

图8是本申请实施例提供的一种申请通信通道的示意图;Figure 8 is a schematic diagram of an application communication channel provided by an embodiment of the present application;

图9是本申请实施例提供的一种用于应用接续的方法的示意性流程图。Figure 9 is a schematic flow chart of a method for application connection provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合附图,对本申请中的技术方案进行描述。The technical solutions in this application will be described below with reference to the accompanying drawings.

为了便于清楚描述本申请实施例的技术方案,以下对本申请实施例中所涉及的部分术语和技术进行简单介绍:In order to facilitate a clear description of the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:

1、接续策略:接续策略用于确定可接续的设备,各应用程序可以对应各自的接续策略。示例性的,应用程序的接续策略可以与下述的一项或多项字段有关:1. Connection strategy: The connection strategy is used to determine the devices that can be connected, and each application can correspond to its own connection strategy. For example, the application's connection policy can be related to one or more of the following fields:

应用程序支持的设备类型、安卓(Android)平台的可接续应用包名、windows平台的可接续进程名、浏览器启动参数、支持接续应用的最小版本号与最小版本等。The device types supported by the application, the continuation application package name on the Android platform, the continuation process name on the Windows platform, browser startup parameters, the minimum version number and minimum version of the supported continuation application, etc.

接续策略可以对应有用于标识接续策略状态的标志位。例如,标志位为0可以表示不支持接续,标志位为1可以表示应用接续,标志位为3可以表示浏览器接续。可以理解的是,标志位的具体值可以任意设置,能够区分不同的状态即可,本申请实施例不作具体限定。The connection policy may correspond to a flag bit used to identify the status of the connection policy. For example, a flag of 0 indicates that connection is not supported, a flag of 1 indicates application connection, and a flag of 3 indicates browser connection. It can be understood that the specific value of the flag bit can be set arbitrarily as long as it can distinguish different states, and is not specifically limited in the embodiment of the present application.

2、其他术语2. Other terms

在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。例如,第一终端设备和第二终端设备是为了区分不同的终端设备,并不对其先后顺序进行限定。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。In the embodiments of the present application, words such as “first” and “second” are used to distinguish identical or similar items with basically the same functions and effects. For example, the first terminal device and the second terminal device are used to distinguish different terminal devices, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the number and execution order, and words such as "first" and "second" do not limit the number and execution order.

需要说明的是,本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that in the embodiments of this application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "such as" is not intended to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.

此外,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b和c中的至少一项(个),可以表示:a,或b,或c,或a和b,或a和c,或b和c,或a、b和c,其中a,b,c可以是单个,也可以是多个。In addition, "at least one" means one or more, and "plurality" means two or more. "And/or" describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship. "At least one of the following" or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b and c can mean: a, or b, or c, or a and b, or a and c, or b and c, or a, b and c, where a, b, c can be single or multiple.

随着终端技术的发展,用户往往需要在多个终端设备之间进行内容切换,例如,当用户在手机的备忘录里进行内容编辑时,由于手机屏幕较小,此时用户可能希望使用平板电脑或者其他屏幕较大的设备继续编辑备忘录里的内容。With the development of terminal technology, users often need to switch content between multiple terminal devices. For example, when a user edits content in a memo on a mobile phone, the user may want to use a tablet or computer due to the smaller screen of the mobile phone. Other devices with larger screens can continue to edit the contents of the memo.

在上述手机内容切换到平板电脑的场景中,当用户想要在切换平板电脑后继续编辑之前在手机中编辑的备忘录内容时,通常需要找到并打开平板电脑中的备忘录,重新编辑手机中的备忘录内容,或者,需要将手机中的备忘录内容通过媒介拷贝到平板电脑上,例如可以通过聊天工具、或者U盘等媒介进行内容的复制粘贴,将手机中的内容切换到平板电脑上。但是上述操作使得设备间的内容切换过程较为繁琐,耗时较长。In the above scenario of switching content from a mobile phone to a tablet, when the user wants to continue editing the memo content previously edited on the phone after switching to the tablet, they usually need to find and open the memo on the tablet and re-edit the memo on the phone. content, or you need to copy the memo content in the mobile phone to the tablet through a medium. For example, you can copy and paste the content through a chat tool or a USB flash drive to switch the content in the mobile phone to the tablet. However, the above operations make the content switching process between devices relatively cumbersome and time-consuming.

终端技术的不断发展带动了设备间的互联互通的可能性,而跨设备之间的应用接续也将成为后续多设备场景中的重要功能。其中,应用接续可以理解为,当用户在设备A上使用某一应用时,用户可以在符合接续条件的设备B中接续该应用的使用状态,并继续使用该应用。这种方式使得设备间的内容切换更加简单高效。The continuous development of terminal technology has led to the possibility of interconnection between devices, and application connection across devices will also become an important function in subsequent multi-device scenarios. Among them, application connection can be understood as: when the user uses an application on device A, the user can continue the usage status of the application on device B that meets the connection conditions and continue to use the application. This method makes content switching between devices simpler and more efficient.

图1是本申请实施例提供的一种场景示意图。该场景示出了个人笔记本(personalcomputer,PC)和手机。其中,PC采用Windows系统,手机采用安卓(Android)系统。用户可以使用手机接续PC中的应用呈现的内容,也可以使用PC接续手机中的应用呈现的内容。Figure 1 is a schematic diagram of a scenario provided by an embodiment of the present application. This scene shows a personal computer (PC) and a mobile phone. Among them, the PC uses the Windows system, and the mobile phone uses the Android system. Users can use their mobile phones to connect to content presented by applications on their PCs, or they can use their PCs to connect to content presented by applications on their mobile phones.

可选地,该场景中还可以包括更多的终端设备,例如大屏、平板电脑等。示例性地,用户可以利用手机、大屏、平板电脑中的至少一个设备接续PC中应用呈现的内容。Optionally, this scene can also include more terminal devices, such as large screens, tablets, etc. For example, the user can use at least one device among a mobile phone, a large screen, and a tablet to continue the content presented by the application in the PC.

下面结合图2,以用户利用PC上的备忘录编辑文字,并且用户想要通过手机继续在备忘录中编辑文字为例进行介绍。The following is an introduction based on Figure 2, taking as an example that the user edits text in the memo on the PC, and the user wants to continue editing text in the memo through the mobile phone.

图2是本申请实施例提供的一种应用接续的界面示意图。Figure 2 is a schematic diagram of an application connection interface provided by an embodiment of the present application.

参见图2中的A界面,用户在PC上打开备忘录并编辑内容时,PC对外广播接续通知,手机接收到接续通知之后,参见图2中的B界面,手机通过dock栏(或者通过多任务中心)提示用户具有可接续任务,其中,dock栏可以是手机、PC等设备的屏幕下方的一个固定的界面,用户可以将比较常用的应用放在dock栏。若用户有更换设备继续编辑内容的需求,用户可以点击手机dock栏上的接续通知以打开手机上的备忘录进行应用接续。参见图2中的C界面,在手机的备忘录界面中接续显示之前在PC上编辑的内容,光标位置显示在接续之前PC上光标停留的位置,用户可以在手机上继续编辑内容。See the A interface in Figure 2. When the user opens the memo on the PC and edits the content, the PC broadcasts the connection notification. After the mobile phone receives the connection notification, see the B interface in Figure 2. The mobile phone passes the dock bar (or through the multitasking center ) prompts the user that there are tasks that can be continued. The dock bar can be a fixed interface at the bottom of the screen of mobile phones, PCs, etc. The user can place more commonly used applications in the dock bar. If the user needs to change the device and continue editing content, the user can click the connection notification on the dock bar of the mobile phone to open the memo on the mobile phone to continue the application. Referring to interface C in Figure 2, the content previously edited on the PC is continuously displayed in the memo interface of the mobile phone. The cursor position is displayed at the position where the cursor stayed on the PC before the connection. The user can continue to edit the content on the mobile phone.

需要说明的是,图2中示出的PC和手机属于同一个信任环中,属于同一个信任环可以理解为设备之间登录相同的设备账号、设备之间的距离满足一定阈值、并且设备之间均开启蓝牙或无线保真(wireless fidelity,Wi-Fi)。其中,设备账号可以用于设备之间连接时进行设备鉴权;蓝牙或Wi-Fi可以用于设备之间进行设备发现和连接。It should be noted that the PC and mobile phone shown in Figure 2 belong to the same trust ring. Belonging to the same trust ring can be understood as the devices are logged in with the same device account, the distance between the devices meets a certain threshold, and the devices are Turn on Bluetooth or wireless fidelity (Wi-Fi) at all times. Among them, the device account can be used for device authentication when connecting between devices; Bluetooth or Wi-Fi can be used for device discovery and connection between devices.

当用户使用PC在备忘录里进行编辑时,属于同一信任环的手机可以提示用户能够进行应用接续。当用户触发手机确认进行应用接续时,手机中的备忘录可以获取并加载PC中的备忘录数据,进而使用户可以在手机上继续编辑备忘录内容,从而可以为用户提供接续服务,降低用户在进行跨设备应用接续时的操作复杂度,提升用户体验。When the user uses a PC to edit in the memo, the mobile phone belonging to the same trust ring can prompt the user to proceed with the application connection. When the user triggers the mobile phone to confirm the application connection, the memo in the mobile phone can obtain and load the memo data in the PC, so that the user can continue to edit the memo content on the mobile phone, thereby providing the user with connection services and reducing the user's cross-device cross-device process. The operation complexity during application connection is improved to improve the user experience.

与图2类似的场景还可以包括:将手机上打开的可携带文档格式(portabledocument format,PDF)接续到平板电脑上继续显示;或,将平板电脑上播放的视频接续到手机上继续播放;或,将PC上播放的音乐接续到手机上继续播放等。Scenarios similar to Figure 2 may also include: connecting the portable document format (PDF) opened on the mobile phone to the tablet and continuing to display it; or connecting the video played on the tablet to the mobile phone to continue playing; or , connect the music played on the PC to the mobile phone to continue playing, etc.

对于应用接续场景下的PC而言,为实现将应用的使用状态同步至其他设备,或者将其他设备的应用的使用状态同步至PC的需求,PC需要对外提供接续框架和软件开发工具包(software development kit,SDK)以满足此需求。其中,接续框架是为应用提供统一的应用状态同步框架,应用需要通过SDK接入接续框架,实现与接续框架中的接续服务的数据传输。接续服务以电脑管家为依托为应用提供对外服务能力。For PCs in application connection scenarios, in order to synchronize the application usage status to other devices, or to synchronize the application usage status of other devices to the PC, the PC needs to provide an external connection framework and software development kit (software). development kit, SDK) to meet this need. Among them, the connection framework provides a unified application status synchronization framework for applications. The application needs to access the connection framework through the SDK to realize data transmission with the connection service in the connection framework. The connection service relies on computer housekeeping to provide external service capabilities for applications.

应理解的是,在PC中的应用和接续服务启动之后,应用和接续服务处于两个不同的进程,因此应用需要通过进程间通信(inter process communication,IPC)和接续服务通信。It should be understood that after the application and the connection service in the PC are started, the application and the connection service are in two different processes, so the application needs to communicate through inter-process communication (inter process communication, IPC) and the connection service.

然而,如果有多个应用同时接入接续框架,依托电脑管家与接续服务进行通信,这样会占用过多的IPC通信资源。而集成在PC的电脑管家中的接续框架为应用提供的IPC通信资源是有限的,在接入应用过多的情况下,如何灵活地为多个应用分配IPC通信资源是一个亟待解决的问题。However, if multiple applications are connected to the connection framework at the same time and rely on the computer manager to communicate with the connection service, this will occupy too many IPC communication resources. The IPC communication resources provided by the connection framework integrated in the PC's computer manager for applications are limited. When there are too many access applications, how to flexibly allocate IPC communication resources to multiple applications is an urgent problem that needs to be solved.

本申请实施例以接续应用作为具有接续功能的应用的统称,接续应用的类型可以包括:编辑类应用(或称为文档应用/办公类应用)、浏览类应用、影音娱乐类应用(或称为多媒体播放应用)等。应理解的是,占用电脑管家的IPC通信资源的应用并不全是接续应用,例如还有一些安全防护类应用、引擎类应用等也占用电脑管家的IPC通信资源。In the embodiment of the present application, connection applications are used as a general term for applications with connection functions. Types of connection applications may include: editing applications (or document applications/office applications), browsing applications, and audio-visual entertainment applications (also known as Multimedia playback application), etc. It should be understood that the applications that occupy Computer Manager's IPC communication resources are not all continuous applications. For example, there are some security protection applications, engine applications, etc. that also occupy Computer Manager's IPC communication resources.

有鉴于此,本申请实施例提供一种应用接续方法,当有多个应用同时接入接续框架,依托PC的电脑管家与接续服务进行通信时,PC可以为每个应用申请共享内存中的地址,基于申请到的共享内存的地址为每个应用分配通信资源,应用可基于该通信资源接入接续服务并与接续服务进行数据传输。In view of this, embodiments of the present application provide an application connection method. When multiple applications access the connection framework at the same time and rely on the PC's computer manager to communicate with the connection service, the PC can apply for an address in the shared memory for each application. , allocate communication resources to each application based on the applied-for shared memory address, and the application can access the connection service based on the communication resources and perform data transmission with the connection service.

图3是本申请实施例适用的一种终端设备的结构示意图。Figure 3 is a schematic structural diagram of a terminal device applicable to the embodiment of the present application.

终端设备可以包括处理器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等。The terminal device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and user Identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro 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, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.

可以理解的是,本申请实施例示意的结构并不构成对终端设备的具体限定。在本申请另一些实施例中,终端设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or less components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,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 (GPU), an image signal processor ( image signal processor (ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors.

控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从上述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instruction or data again, it can be directly called from the above-mentioned memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.

在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, a pulse code modulation (PCM) interface, and a universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and/or Universal serial bus (USB) interface, etc.

可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端设备的结构限定。在本申请另一些实施例中,终端设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present application are only schematic illustrations and do not constitute structural limitations on the terminal equipment. In other embodiments of the present application, the terminal device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

终端设备通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The terminal device implements display functions through the GPU, the display screen 194, and the application processor. The GPU is an image processing microprocessor 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 alter display information.

终端设备可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The terminal device can realize the shooting function through the ISP, camera 193, video codec, GPU, display screen 194 and application processor.

外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端设备的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.

内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端设备使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行终端设备的各种功能应用以及数据处理。例如,可以执行本申请实施例的应用接续方法。Internal memory 121 may be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.). The storage data area can store data created during the use of the terminal device (such as audio data, phone book, etc.). In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor. For example, the application connection method in the embodiment of the present application can be executed.

本申请的终端设备可以作为发送端,也可以作为接收端。终端设备的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例的图4以分层架构的Android系统为例,示例性说明本申请实施例的终端设备的软件结构。The terminal device of this application can be used as a sending end or a receiving end. The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. Figure 4 of the embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the terminal device of the embodiment of the present application.

如图4所示,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口进行数据的传输与通信。在一些实施例中,将Android系统分为五层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库、硬件抽象层(hardware abstract layer,HAL),以及内核层。As shown in Figure 4, the layered architecture divides the software into several layers, and each layer has clear roles and division of labor. Data transmission and communication are carried out between layers through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime and system library, and hardware abstract layer (HAL). , and the kernel layer.

应用程序层可以包括一系列应用程序包。如图4所示,应用程序包可以包括三方应用、接续服务SDK、蓝牙、Wi-Fi、备忘录、视频、游戏等应用程序。例如本申请实施例中,在应用程序层中,接续应用可以接入接续服务SDK,接续应用可以为终端设备中的系统应用,也可以为三方应用,备忘录、视频、游戏等应用也可以为系统应用或三方应用。The application layer can include a series of application packages. As shown in Figure 4, the application package can include third-party applications, connection service SDK, Bluetooth, Wi-Fi, memo, video, games and other applications. For example, in the embodiment of this application, in the application layer, the connection application can access the connection service SDK. The connection application can be a system application in the terminal device or a third-party application. Applications such as memos, videos, and games can also be system applications. application or third-party application.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

如图4所示,应用程序框架层可以包括接续服务管理器、通信服务管理器、鉴权服务管理器、通知管理器、窗口管理器、资源管理器、内容提供器和视图系统等。其中,管理器在一些应用场景中也可以称为模块。As shown in Figure 4, the application framework layer may include a connection service manager, a communication service manager, an authentication service manager, a notification manager, a window manager, a resource manager, a content provider, a view system, etc. Among them, managers can also be called modules in some application scenarios.

接续服务管理器可以负责接续任务的管理,为接续应用提供继续服务,是接续框架的核心。例如本申请实施例中,接续服务管理器可以负责接续应用的接入、接续应用的鉴权、接续应用的图标管理以及接续数据跨设备间的传输。The connection service manager can be responsible for the management of connection tasks and provide connection services for connection applications. It is the core of the connection framework. For example, in the embodiment of this application, the connection service manager may be responsible for the access of the connection application, the authentication of the connection application, the icon management of the connection application, and the transmission of connection data across devices.

通信服务管理器可以用于实现跨设备间的数据传输,例如本申请实施例中,通信服务管理器可以实现同账号设备的安全认证与账号鉴权、设备的自发现与自组网、设备间的数据传输以及通信服务的接入等。The communication service manager can be used to realize data transmission across devices. For example, in the embodiment of this application, the communication service manager can realize security authentication and account authentication of devices with the same account, self-discovery and self-organizing network of devices, and inter-device data transmission and access to communication services, etc.

鉴权服务管理器可以负责应用的合法性校验,例如本申请实施例中,在鉴权服务管理器校验通过后可以允许应用接入接续服务。The authentication service manager may be responsible for verifying the validity of the application. For example, in the embodiment of the present application, the application may be allowed to access the connection service after the authentication service manager passes the verification.

通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息、发出提示音、终端设备振动、指示灯闪烁等。例如本申请实施例中,当终端设备接收到接续通知时,通知管理器可以在任务栏中显示接续通知。The notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a prompt sound is emitted, the terminal device vibrates, and the indicator light flashes, etc. For example, in the embodiment of the present application, when the terminal device receives the connection notification, the notification manager may display the connection notification in the taskbar.

窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏、锁定屏幕、触摸屏幕、拖拽屏幕、截取屏幕等。A window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, capture the screen, etc.

资源管理器为应用程序提供各种资源,例如本地化字符串、图标、图片、布局文件、视频文件等等。The resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, and more.

内容提供器用于在不同的应用程序之间实现数据共享的功能,允许一个程序访问另一个程序中的数据,同时还能保证被访问的数据的安全性。Content providers are used to implement data sharing functions between different applications, allowing one program to access data in another program while ensuring the security of the accessed data.

视图系统可以负责应用程序的界面绘制和事件处理。例如本申请实施例中,视图系统可以用于处理用户点击接续应用的通知图标后的事件处理。The view system can be responsible for the application's interface drawing and event handling. For example, in this embodiment of the present application, the view system can be used to process events after the user clicks on the notification icon of the connected application.

Android runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android runtime includes core libraries and virtual machines. The Android runtime is responsible for the scheduling and management of the Android system.

核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library contains two parts: one is the functional functions that need to be called by the Java language, and the other is the core library of Android.

应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and application framework layer into binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.

系统库可以包括多个功能模块。例如:媒体库(Media Libraries)、函数库(Function Libraries)图形处理库(例如:OpenGL ES)等。System libraries can include multiple functional modules. For example: Media Libraries, Function Libraries, graphics processing libraries (for example: OpenGL ES), etc.

媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

函数库为开发者提供多种服务的API接口,方便开发者快速集成并实现各种功能。The function library provides developers with API interfaces for multiple services, making it easy for developers to quickly integrate and implement various functions.

图形处理库用于实现图形绘图、图像渲染、合成和图层处理等。The graphics processing library is used to implement graphics drawing, image rendering, composition, layer processing, etc.

硬件抽象层是介于内核层和Android runtime之间的抽象出来的一层结构。硬件抽象层可以是对硬件驱动的一个封装,为上层应用的调用提供统一接口。硬件抽象层可以包括蓝牙模块、Wi-Fi模块、硬件配置模块等。例如本申请实施例中,硬件抽象层中的蓝牙模块和Wi-Fi模块可以屏蔽内核层中蓝牙驱动和Wi-Fi驱动的具体硬件实现细节,上层应用在不必知道内核层硬件驱动的具体实现方式的情况下就可以通过调用接口实现蓝牙功能和Wi-Fi功能。The hardware abstraction layer is an abstract layer between the kernel layer and the Android runtime. The hardware abstraction layer can be an encapsulation of the hardware driver and provide a unified interface for calls to upper-layer applications. The hardware abstraction layer can include Bluetooth modules, Wi-Fi modules, hardware configuration modules, etc. For example, in the embodiment of this application, the Bluetooth module and Wi-Fi module in the hardware abstraction layer can shield the specific hardware implementation details of the Bluetooth driver and Wi-Fi driver in the kernel layer, and upper-layer applications do not need to know the specific implementation of the kernel layer hardware driver. In this case, the Bluetooth function and Wi-Fi function can be realized by calling the interface.

内核层是硬件和软件之间的层。内核层可以包括显示驱动、摄像头驱动、音频驱动、蓝牙驱动、Wi-Fi驱动、中央处理器驱动等。例如本申请实施例中,通信服务管理器可以通过蓝牙驱动以及Wi-Fi驱动等相关模块进行跨设备间的连接,实现设备的自发现与自组网。The kernel layer is the layer between hardware and software. The kernel layer can include display drivers, camera drivers, audio drivers, Bluetooth drivers, Wi-Fi drivers, central processing unit drivers, etc. For example, in the embodiment of this application, the communication service manager can perform cross-device connections through related modules such as Bluetooth drivers and Wi-Fi drivers to realize self-discovery and self-organizing networks of devices.

可以理解的是,本申请实施例的发送端或接收端也可以采用Windows系统,如图5所示,与Android系统不同的是Windows系统的分层架构主要分为用户态和内核态,用户态可以包括用户应用程序进程,以及系统进程与服务进程等;内核态可以包括内核和设备驱动层,以及硬件抽象层等。It can be understood that the sending end or receiving end of the embodiment of the present application can also use the Windows system, as shown in Figure 5. Different from the Android system, the layered architecture of the Windows system is mainly divided into user mode and kernel mode. The user mode It can include user application processes, as well as system processes and service processes, etc.; the kernel state can include kernel and device driver layers, as well as hardware abstraction layers, etc.

用户应用程序进程可以执行一系列应用程序。具体可执行的应用程序类型可以与Android系统中应用程序层中的应用程序类型相同,在此不再赘述。A user application process can execute a sequence of applications. The specific executable application type may be the same as the application type in the application layer in the Android system, and will not be described again here.

系统进程与服务进程中可以包括接续服务管理器、通信服务管理器、鉴权服务管理器、系统进程、通知管理器、窗口管理器等,可以为用户应用程序进程的执行提供相应服务。具体与本申请实施例相关的接续服务管理器、通信服务管理器、鉴权服务管理器等进程的作用可参见Android中的相关管理器描述,在此不再赘述。System processes and service processes can include connection service managers, communication service managers, authentication service managers, system processes, notification managers, window managers, etc., which can provide corresponding services for the execution of user application processes. For the specific functions of processes such as the connection service manager, communication service manager, and authentication service manager related to the embodiments of the present application, please refer to the description of the relevant managers in Android, and will not be described again here.

此外,系统进程与服务进程中还可以包括通道管理服务器,通道管理服务器用于对应用程序的通信通道进行管理,包括对通信通道的定时查询、对通信通道的释放等。In addition, the system process and service process may also include a channel management server. The channel management server is used to manage the communication channel of the application, including scheduled query of the communication channel, release of the communication channel, etc.

内核层和设备驱动层可以包括蓝牙驱动、Wi-Fi驱动、显示驱动等,硬件抽象层可以包括蓝牙模块、Wi-Fi模块、硬件配置模块等。具体的功能模块的作用可参见Android中的相关描述,在此不再赘述。下面结合终端设备之间在应用接续过程中进行接续通知显示的场景,示例性说明Windows系统分层框架中的接续数据的传输流程。The kernel layer and device driver layer can include Bluetooth drivers, Wi-Fi drivers, display drivers, etc., and the hardware abstraction layer can include Bluetooth modules, Wi-Fi modules, hardware configuration modules, etc. For the specific function modules, please refer to the relevant descriptions in Android and will not be repeated here. The following is an example of the connection data transmission process in the Windows system layered framework based on the scenario where connection notifications are displayed during the application connection process between terminal devices.

如图5所示,在发送端的应用程序层中,应用程序通过接入接续服务SDK进行初始化。接续服务SDK为应用程序申请共享内存的地址,确定应用程序的通信标识(identification,ID)。这样接续服务SDK可以向应用程序返回初始化成功。在确定应用程序的通信ID之后,应用程序可以通过接入接续服务SDK实现与接续服务的数据传输。接续服务SDK可以在通信ID指示的通信通道上向接续服务管理器发送绑定接续服务以及应用注册接续服务的请求,进而实现应用程序层与应用程序框架层之间的接续应用注册与绑定的数据传输。As shown in Figure 5, in the application layer of the sender, the application is initialized by accessing the connection service SDK. The connection service SDK applies for the shared memory address for the application program and determines the communication identification (ID) of the application program. In this way, the connection service SDK can return initialization success to the application. After determining the communication ID of the application, the application can implement data transmission with the connection service by accessing the connection service SDK. The connection service SDK can send requests for binding connection services and application registration connection services to the connection service manager on the communication channel indicated by the communication ID, thereby realizing connection application registration and binding between the application layer and the application framework layer. data transmission.

在应用程序框架层中,接续服务管理器可以通过与通信服务管理器进行信令传输与数据传输完成通信服务的绑定。接续服务管理器还可以与鉴权服务管理器进行绑定鉴权服务以及应用鉴权。In the application framework layer, the connection service manager can complete the binding of communication services by performing signaling transmission and data transmission with the communication service manager. The connection service manager can also bind authentication services and apply authentication with the authentication service manager.

在接续应用注册成功后,通信服务管理器可以调用硬件抽象层提供的蓝牙模块接口以及Wi-Fi模块接口实现设备的自发现与自组网,并通过内核层和设备驱动层中的蓝牙驱动和Wi-Fi驱动实现终端设备间的会话连接、消息传递,以及接续内容的传输等。After the connection application is successfully registered, the communication service manager can call the Bluetooth module interface and Wi-Fi module interface provided by the hardware abstraction layer to realize the self-discovery and self-organizing network of the device, and use the Bluetooth driver and the device driver layer in the kernel layer and The Wi-Fi driver implements session connections, message transmission, and transmission of continued content between terminal devices.

当接收端基于内核层和设备驱动层接收到发送端传递过来的接续相关的数据后,可以将数据传输给硬件抽象层中的相关模块。在接收端的应用程序框架层中,通信服务管理器可以通过硬件抽象层中提供的接口获取传输过来的接续数据,并与接续服务管理器进行信令传输与数据传输。接续服务管理器在接收到接续相关的数据后,可以与鉴权服务管理器进行绑定鉴权服务以及应用鉴权。进一步地,接续服务管理器可以指示桌面启动器以图标形式显示接续通知。When the receiving end receives the connection-related data passed by the sending end based on the kernel layer and device driver layer, it can transmit the data to the relevant modules in the hardware abstraction layer. In the application framework layer of the receiving end, the communication service manager can obtain the transmitted connection data through the interface provided in the hardware abstraction layer, and conduct signaling transmission and data transmission with the connection service manager. After receiving the connection-related data, the connection service manager can bind the authentication service and apply authentication with the authentication service manager. Further, the connection service manager may instruct the desktop launcher to display the connection notification in the form of an icon.

下面将结合实现跨设备间的应用接续方法的系统详细说明各模块之间的交互过程。下面的实施例可以相互结合或独立实施,对于相同或相似的概念或过程可能在某些实施例中不再赘述。The interaction process between each module will be described in detail below in conjunction with the system that implements the application connection method between devices. The following embodiments may be combined with each other or implemented independently, and the same or similar concepts or processes may not be described again in some embodiments.

图6是本申请实施例提供的一种应用接续方法的示意性流程图。实现跨设备间的应用接续方法的系统中可以包括第一终端设备和第二终端设备,第一终端设备可以作为发送端,具有如图3和图5所示的结构,第二终端设备可以作为接收端,具有如图3和图4所示的结构。第一终端设备与第二终端设备中均可以包括实现接续服务的各个功能模块,例如,可以包括接续服务SDK、接续服务管理器、通信服务管理器以及鉴权服务管理器等。Figure 6 is a schematic flow chart of an application connection method provided by an embodiment of the present application. A system that implements a cross-device application connection method may include a first terminal device and a second terminal device. The first terminal device may serve as a sending end and have a structure as shown in Figures 3 and 5. The second terminal device may serve as a sending end. The receiving end has the structure shown in Figure 3 and Figure 4. Both the first terminal device and the second terminal device may include various functional modules for implementing the connection service. For example, they may include a connection service SDK, a connection service manager, a communication service manager, an authentication service manager, etc.

本申请实施例的第一终端设备可以具体为采用Windows系统的设备,如PC,第二终端设备可以具体为采用Android系统的设备,如手机、平板电脑等。The first terminal device in the embodiment of the present application may be a device using a Windows system, such as a PC, and the second terminal device may be a device using an Android system, such as a mobile phone, a tablet computer, etc.

为了便于描述,后续将第一终端设备的接续应用称为第一接续应用,第一终端设备的接续服务SDK称为第一接续服务SDK,第一终端设备的接续服务管理器称为第一接续服务管理器第一终端设备的通道服务管理器称为第一通道服务管理器,第一终端设备的通信服务管理器称为第一通信服务管理器,第一终端设备的鉴权服务管理器称为第一鉴权服务管理器。For the convenience of description, the connection application of the first terminal device will be called the first connection application, the connection service SDK of the first terminal device will be called the first connection service SDK, and the connection service manager of the first terminal device will be called the first connection Service Manager The channel service manager of the first terminal device is called the first channel service manager, the communication service manager of the first terminal device is called the first communication service manager, and the authentication service manager of the first terminal device is called the first channel service manager. Is the first authentication service manager.

将第二终端设备的接续应用称为第二接续应用,第二终端设备的接续服务SDK称为第二接续服务SDK,第二终端设备的接续服务管理器称为第二接续服务管理器,第二终端设备的通信服务管理器称为第二通信服务管理器,第二终端设备的鉴权服务管理器称为第二鉴权服务管理器。The connection application of the second terminal device is called the second connection application, the connection service SDK of the second terminal device is called the second connection service SDK, and the connection service manager of the second terminal device is called the second connection service manager. The communication service manager of the second terminal device is called the second communication service manager, and the authentication service manager of the second terminal device is called the second authentication service manager.

本申请实施例的应用接续方法的实现过程可以分为四个阶段,第一阶段为接续应用的初始化、第二阶段为接续应用的注册与绑定,第三阶段为接续通知的显示,第四阶段为接续数据的获取与加载。下面结合图6分别介绍各阶段。The implementation process of the application connection method in the embodiment of this application can be divided into four phases. The first phase is the initialization of the connection application, the second phase is the registration and binding of the connection application, the third phase is the display of the connection notification, and the fourth phase The stage is to obtain and load the subsequent data. Each stage is introduced below with reference to Figure 6.

第一阶段、初始化。The first stage is initialization.

第一终端设备的第一接续服务管理器在电脑管家中运行,应用作为独立进程接入接续服务SDK后运行在三方应用中,因此,第一接续服务管理器需要和第一接续应用跨进程通信。当第一终端设备的第一接续应用监控到一些用户行为时,第一接续应用可以调用第一接续服务SDK的初始化接口,以申请可用于第一接续应用与第一接续服务管理器跨进程通信的通信通道。在申请到通信通道之后,第一接续应用可以接收到第一接续服务SDK返回的初始化成功的消息。The first connection service manager of the first terminal device runs in the computer manager. The application is accessed as an independent process and runs in the third-party application after accessing the connection service SDK. Therefore, the first connection service manager needs to communicate with the first connection application across processes. . When the first connection application of the first terminal device monitors some user behaviors, the first connection application can call the initialization interface of the first connection service SDK to apply for cross-process communication between the first connection application and the first connection service manager. communication channel. After applying for the communication channel, the first connection application may receive an initialization success message returned by the first connection service SDK.

用户行为可以为用户点击第一接续应用的图标启动第一接续应用,也可以为用户在第一接续应用中进行编辑等操作,还可以为用户在第一接续应用中点击播放按钮进行视频播放、音乐播放或其他媒体播放等操作,具体所监控的用户行为可以由接续应用进行自定义设置,本申请实施例不作限制。The user behavior can be for the user to click the icon of the first connection application to start the first connection application, or for the user to perform editing and other operations in the first connection application, or for the user to click the play button in the first connection application for video playback, For operations such as music playback or other media playback, the specific monitored user behavior can be customized by the subsequent application, which is not limited by the embodiments of this application.

在第一终端设备为应用接续的发送端时,第一接续应用的图标可以显示在第一终端设备的桌面或者任务栏(或称为dock栏)。When the first terminal device is the sender of the application connection, the icon of the first connected application may be displayed on the desktop or taskbar (or dock) of the first terminal device.

第一接续服务SDK在接收到初始化请求之后,可以去读取共享内存,确定共享内存中未被申请的比特位。下面结合图7,对共享内存的通信原理进行介绍。After receiving the initialization request, the first connection service SDK can read the shared memory and determine the unapplied bits in the shared memory. The communication principle of shared memory is introduced below in conjunction with Figure 7.

图7是本申请实施例提供的一种共享内存的通信原理的示意图。如图7所示,共享内存是进程间通信的方式之一,允许多个进程访问同一块内存。进程A和进程B都有属于自己的进程控制块(process control block,PCB)和地址空间(address space),并且都有一个与之对应的页表,负责将进程的虚拟地址与物理地址进行映射,通过内存管理单元(memory management unit,MMU)进行管理。两个不同的虚拟地址通过页表映射到物理空间的同一区域,它们所指向的这块区域即为共享内存。FIG. 7 is a schematic diagram of a shared memory communication principle provided by an embodiment of the present application. As shown in Figure 7, shared memory is one of the methods of inter-process communication, allowing multiple processes to access the same memory. Process A and process B have their own process control block (PCB) and address space (address space), and each has a corresponding page table, which is responsible for mapping the virtual address of the process to the physical address. , managed through the memory management unit (MMU). Two different virtual addresses are mapped to the same area of physical space through the page table, and the area they point to is shared memory.

当进程A和进程B通过页表将虚拟地址映射到物理地址时,在物理地址中有一块共同的内存区,即共享内存,这块内存可以被进程A和进程B同时看到。这样一个进程进行写操作,另一个进程进行读操作就可以实现进程间通信。When process A and process B map virtual addresses to physical addresses through page tables, there is a common memory area in the physical address, that is, shared memory. This memory can be seen by process A and process B at the same time. In this way, one process performs a write operation and another process performs a read operation, so that inter-process communication can be achieved.

图8是本申请实施例提供的一种申请通信通道的示意图。第一接续服务SDK在确定共享内存中未被申请的比特位时,按照顺序读取共享内存中各个比特位的值,每个比特位的值第一预设值或者第二预设值,值为第一预设值的比特位对应的通信通道未被申请或者未被使用,值为第二预设值的比特位对应的通信通道已被申请或者已被使用。示例性地,第一预设值可以为“0”,第二预设值可以为“1”。Figure 8 is a schematic diagram of an application communication channel provided by an embodiment of the present application. When the first connection service SDK determines the unapplied bits in the shared memory, it reads the value of each bit in the shared memory in order. The value of each bit is the first preset value or the second preset value. The communication channel corresponding to the bit with the first preset value has not been applied for or is not used, and the communication channel corresponding to the bit with the second preset value has been applied for or has been used. For example, the first preset value may be "0" and the second preset value may be "1".

如图8中的a所示,共享内存区域中的第一个比特位和第二个比特位的值“1”,表示这两个比特位对应的通信通道已经被应用A和应用B占用。As shown in a in Figure 8, the value of the first bit and the second bit in the shared memory area is "1", indicating that the communication channel corresponding to these two bits has been occupied by application A and application B.

如图8中的b所示,当第一接续应用(应用C)接入第一接续服务SDK时,第一接续服务SDK检测到共享内存区域的第三个比特位的值为“0”,因此第一接续服务SDK可以确定第三个比特位为目标比特位,并向第一接续服务SDK返回比特空位的标识n,也即返回第三个比特空位的标识。其中,比特空位表示值为“0”的比特位。As shown in b in Figure 8, when the first connection application (application C) accesses the first connection service SDK, the first connection service SDK detects that the value of the third bit in the shared memory area is "0". Therefore, the first connection service SDK can determine that the third bit is the target bit, and return the identifier n of the bit gap to the first connection service SDK, that is, return the identifier of the third bit gap. Among them, the bit gap represents a bit with a value of "0".

示例性地,第一个比特位的标识n为1,第二个比特位的标识n为2,第三个比特位的标识n为3,依次类推。For example, the identifier n of the first bit is 1, the identifier n of the second bit is 2, the identifier n of the third bit is 3, and so on.

在第一接续服务SDK检测到第三个比特位的值为“0”,确定第三个比特位为目标比特位之后,第一接续服务SDK可以将目标比特位的值修改为“1”,以指示目标比特位对应的通信通道已被申请或已被使用。After the first connection service SDK detects that the value of the third bit is "0" and determines that the third bit is the target bit, the first connection service SDK can modify the value of the target bit to "1", To indicate that the communication channel corresponding to the target bit has been applied for or has been used.

第一接续服务SDK在接收到比特空位的标识n之后,根据比特空位的标识n计算通信ID,例如,通信ID=M+n×N,其中M、N为预设值,N的数值表示申请到的通信通道所支持的消息的种类数。After receiving the identifier n of the bit gap, the first connection service SDK calculates the communication ID according to the identifier n of the bit gap. For example, communication ID=M+n×N, where M and N are preset values, and the value of N represents the application The number of message types supported by the communication channel.

应理解的是,第一接续服务SDK计算得到的通信ID是一个起始的通信ID,从起始的通信ID开始的N个连续的通信ID所标识的通信通道都可以被第一接续服务SDK使用,N为预设值。也即,第一接续服务SDK根据计算得到的通信ID可确定多个通信通道,多个通信通道的数量为N,每个通信通道支持传输一种消息类别,消息类别例如:注册接续服务和回调的消息、解除注册接续服务和回调的消息、广播接续通知的消息、通信回连的消息等。It should be understood that the communication ID calculated by the first connection service SDK is a starting communication ID, and the communication channels identified by N consecutive communication IDs starting from the starting communication ID can all be used by the first connection service SDK. Use, N is the default value. That is to say, the first connection service SDK can determine multiple communication channels based on the calculated communication ID. The number of multiple communication channels is N. Each communication channel supports the transmission of one message type. The message types are such as: registration connection service and callback. Messages, unregistered connection service and callback messages, broadcast connection notification messages, communication return messages, etc.

下面以N=3,M=0对通信ID进行举例说明。The following uses N=3 and M=0 to illustrate the communication ID as an example.

例如,应用A的接续服务SDK读取共享内存,检测到共享内存区域中的第一个比特位的值为“0”,第一个比特位的标识n=1,因此共享内存向应用A的接续服务SDK返回的比特空位的标识即为第一个比特位的标识n=1。应用A的接续服务SDK根据通信ID=M+n×N计算得到的通信ID为3,通信ID为3对应三个通信通道,三个通信通道的通信ID分别为3、4、5。For example, application A's connection service SDK reads the shared memory and detects that the value of the first bit in the shared memory area is "0", and the first bit identifier n=1, so the shared memory transfers to application A's The identifier of the bit gap returned by the connection service SDK is the identifier of the first bit n=1. The communication ID calculated by application A's connection service SDK based on communication ID=M+n×N is 3. The communication ID 3 corresponds to three communication channels, and the communication IDs of the three communication channels are 3, 4, and 5 respectively.

例如,应用B的接续服务SDK读取共享内存,检测到共享内存区域中的第二个比特位的值为“0”,第二个比特位的标识n=2,因此共享内存向应用A的接续服务SDK返回的比特空位的标识即为第二个比特位的标识n=2。应用B的接续服务SDK根据通信ID=M+n×N计算得到的通信ID为6,通信ID为6对应三个通信通道,三个通信通道的通信ID分别为6、7、8。For example, application B's connection service SDK reads the shared memory and detects that the value of the second bit in the shared memory area is "0", and the second bit identifier n=2, so the shared memory transfers to application A's The identifier of the bit gap returned by the connection service SDK is the identifier of the second bit n=2. The communication ID calculated by application B's connection service SDK based on communication ID=M+n×N is 6. The communication ID 6 corresponds to three communication channels, and the communication IDs of the three communication channels are 6, 7, and 8 respectively.

类似地,第一接续应用(应用C)的接续服务SDK根据通信ID=M+n×N计算得到的通信ID为9,通信ID为9对应三个通信通道,三个通信通道的通信ID分别为9、10、11。Similarly, the communication ID calculated by the connection service SDK of the first connection application (Application C) based on communication ID=M+n×N is 9. The communication ID 9 corresponds to three communication channels, and the communication IDs of the three communication channels are respectively It's 9, 10, 11.

应理解的是,每个应用申请到的多个通信通道中的每个通信通道上传输的是预定义的消息类型,例如,通信ID+1所标识的通信通道用于传输通信回连消息,即在上面的例子中,应用A可以通过通信ID为4所标识的通信通道接收通信回连消息、应用B可以通过通信ID为7所标识的通信通道接收通信回连消息、应用C可以通过通信ID为10所标识的通信通道接收通信回连消息。It should be understood that each communication channel among the multiple communication channels applied for by each application transmits a predefined message type. For example, the communication channel identified by communication ID+1 is used to transmit communication connection messages. That is, in the above example, application A can receive the communication reconnection message through the communication channel identified by the communication ID 4, application B can receive the communication reconnection message through the communication channel identified by the communication ID 7, and application C can receive the communication reconnection message through the communication channel. The communication channel identified by ID 10 receives the communication connection message.

在第一接续应用接收到初始化成功的消息之后,第一接续应用可以在申请到的通信通道与第一接续服务管理器进行交互,以便执行后续的应用接续的流程。After the first connection application receives the initialization success message, the first connection application can interact with the first connection service manager on the applied communication channel in order to perform subsequent application connection processes.

第二阶段、接续应用的注册与绑定。The second stage is to continue the registration and binding of the application.

第一接续应用可以通过调用第一接续服务SDK的注册接口接入接续服务。可以理解的是,第一接续应用在注册接续服务时可以携带第一接续应用的包名、版本号等信息。The first connection application can access the connection service by calling the registration interface of the first connection service SDK. It can be understood that the first connection application may carry the package name, version number and other information of the first connection application when registering the connection service.

可能的实现中,第一接续服务SDK可以通过第一接续服务管理器与其他功能管理器进行数据交互。示例性地,第一接续服务SDK可以通过通信ID为1所标识的通信通道向第一接续服务管理器发送绑定接续服务以及应用注册接续服务的请求,第一接续服务管理器在接收到第一接续服务SDK的请求后,可以与第一通信服务管理器交互进而绑定通信服务,在绑定成功后,第一接续服务管理器则可以接收到第一通信服务管理器回复的绑定成功的消息。In a possible implementation, the first connection service SDK can interact with other function managers through the first connection service manager. Exemplarily, the first connection service SDK may send a request to bind the connection service and apply the registration connection service to the first connection service manager through the communication channel identified by the communication ID of 1. After receiving the first connection service manager, the first connection service manager After a request from the connection service SDK, the first connection service manager can interact with the first communication service manager to bind the communication service. After the binding is successful, the first connection service manager can receive a reply from the first communication service manager indicating that the binding is successful. news.

第一接续服务管理器在接收到第一接续服务SDK的应用注册接续服务的请求后,可以通知第一通道服务管理器对发送该请求的通信通道的通信ID进行标记,表示该通信ID对应的通信通道已被使用。After receiving the request of the application registration connection service of the first connection service SDK, the first connection service manager may notify the first channel service manager to mark the communication ID of the communication channel sending the request, indicating that the communication ID corresponds to The communication channel is already in use.

进一步地,第一接续服务管理器可以通过调用第一鉴权服务管理器所提供的接口进行绑定鉴权服务以及应用鉴权。第一鉴权服务管理器接收鉴权请求后,可以通过与云端鉴权服务器进行数据交互完成第一接续应用的绑定与鉴权。可以理解的是,在绑定鉴权服务的过程中,云端鉴权服务器可以根据第一接续应用的包名获取用户标识(useridentification,UID),进而根据UID进行应用鉴权。当第一鉴权服务管理器对第一接续应用鉴权成功后,云端鉴权服务器中可以存储第一接续应用的图标等应用信息,并给第一接续服务管理器返回鉴权结果。Further, the first connection service manager can perform binding authentication service and application authentication by calling an interface provided by the first authentication service manager. After receiving the authentication request, the first authentication service manager can complete the binding and authentication of the first connection application through data interaction with the cloud authentication server. It can be understood that during the process of binding the authentication service, the cloud authentication server can obtain the user identification (UID) based on the package name of the first connected application, and then perform application authentication based on the UID. When the first authentication service manager successfully authenticates the first connection application, the cloud authentication server may store application information such as the icon of the first connection application and return the authentication result to the first connection service manager.

第一接续服务管理器接收到第一接续应用鉴权结果后,会将该消息传递给第一接续应用。其中,鉴权结果可以包括鉴权成功和鉴权失败,如果第一接续应用接收到的结果为鉴权成功,则说明应用注册成功,可以继续执行应用接续的方法;如果第一接续应用接收到的结果为鉴权失败,则说明应用注册失败,不会继续执行应用接续的方法。After receiving the authentication result of the first connection application, the first connection service manager will pass the message to the first connection application. The authentication results may include authentication success and authentication failure. If the result received by the first connection application is authentication success, it means that the application registration is successful, and the application connection method can continue to be executed; if the first connection application receives the authentication result If the result is authentication failure, it means that the application registration failed and the application connection method will not continue.

第一接续服务管理器接收到第一接续应用鉴权结果,鉴权结果为鉴权成功之后,还会通知第一通道服务管理器应用已注册。第一通道服务管理器在接收到应用已注册的消息之后,启动对第一接续应用的状态的定时查询,向第一接续服务SDK发送定时查询消息。其中,第一接续应用的状态包括进程仍在存活或者进程已退出。具体地,第一通道服务管理器向第一接续服务SDK发送定时查询消息可以包括:第一通道服务管理器定时向第一接续服务SDK发送保活包,成功发送保活包则表示第一接续应用的进程仍在存活,未成功发送保活包则表示第一接续应用的进程已退出。After the first connection service manager receives the first connection application authentication result, and the authentication result is successful, it will also notify the first channel service manager that the application has been registered. After receiving the message that the application has been registered, the first channel service manager starts a regular query on the status of the first connection application and sends a regular query message to the first connection service SDK. Among them, the status of the first connected application includes that the process is still alive or the process has exited. Specifically, the first channel service manager sending a scheduled query message to the first connection service SDK may include: the first channel service manager sending a keep-alive packet to the first connection service SDK regularly, and successfully sending the keep-alive packet indicates the first connection. The application process is still alive. Failure to send a keep-alive packet means that the first process connected to the application has exited.

在第一终端设备的应用注册成功之后,第一通信服务管理器与第二通信服务管理器可以通过蓝牙或者Wi-Fi进行自发现与自组网,以及进行账号鉴权。进一步地,第一通信服务管理器可以向第一接续服务管理器发送用于表示第二终端设备上线的信息。例如,用于表示第二终端设备上线的信息可以包括第二终端设备的设备标识(deviceidentification,DevID)等信息。After the application registration of the first terminal device is successful, the first communication service manager and the second communication service manager can perform self-discovery and self-organizing network through Bluetooth or Wi-Fi, and perform account authentication. Further, the first communication service manager may send information indicating that the second terminal device is online to the first connection service manager. For example, the information used to indicate that the second terminal device is online may include information such as a device identification (DeviceIdentification, DevID) of the second terminal device.

在第一接续服务管理器接收到第一通信服务管理器发送的用于表示第二终端设备上线的信息后,可以将第二终端设备的信息进行存储与管理,以便执行进行后续的应用接续的流程。After the first connection service manager receives the information sent by the first communication service manager to indicate that the second terminal device is online, it can store and manage the information of the second terminal device in order to perform subsequent application connection. process.

第三阶段、接续通知的显示。The third stage is the display of the continuation notification.

当第一接续应用注册成功后,则可以周期性向第一接续服务管理器发送广播接续通知。其中,广播接续通知中可以携带第一接续应用的包名、接续策略,以及接续内容概要(如标题)等信息。第一接续服务管理器可以根据第一接续应用的接续策略确认可接续的设备。When the first connection application is successfully registered, broadcast connection notifications may be periodically sent to the first connection service manager. The broadcast connection notification may carry information such as the package name of the first connection application, the connection strategy, and the connection content summary (such as title). The first connection service manager may confirm connectable devices according to the connection policy of the first connection application.

示例性地,当接续策略为包括应用程序所支持的设备类型时,例如,接续策略中包括第一接续应用可以支持在手机、平板电脑、电视、电脑等上实现接续服务,则第一接续服务管理器在确认第二终端设备为手机、平板电脑、电视或电脑等时,第一接续服务管理器可以指示第一通信服务管理器和第二通信服务管理器建立会话通路。For example, when the connection policy includes device types supported by the application, for example, the connection policy includes that the first connection application can support connection services on mobile phones, tablets, TVs, computers, etc., then the first connection service When the manager confirms that the second terminal device is a mobile phone, a tablet, a television, a computer, etc., the first connection service manager may instruct the first communication service manager and the second communication service manager to establish a session path.

示例性地,当接续策略为包括最小版本号或最小版本时,例如,接续策略中包括第一接续应用可以支持最小版本号为A,或最小版本为B,则第一接续服务管理器在确认第二接续应用的版本号大于或等于A时,或者第二接续应用的版本大于或等于B时,第一接续服务管理器可以指示第一通信服务管理器和第二通信服务管理器建立会话通路。For example, when the connection policy includes the minimum version number or the minimum version, for example, the connection policy includes the minimum version number that the first connection application can support is A, or the minimum version is B, then the first connection service manager confirms When the version number of the second connection application is greater than or equal to A, or when the version number of the second connection application is greater than or equal to B, the first connection service manager may instruct the first communication service manager and the second communication service manager to establish a session path. .

第一通信服务管理器和第二通信服务管理器之间则可以建立起会话通路,以便进行应用接续相关的消息传递和数据传输。A session path can be established between the first communication service manager and the second communication service manager to facilitate application connection-related messaging and data transmission.

会话通路建立成功后,第一通信服务管理器可以向第一接续服务管理器指示通道建立成功,第一接续服务管理器可以根据第一接续应用发送的广播接续通知,将携带有第一接续应用的包名以及接续内容概要等信息的广播接续通知给到第一通信服务管理器,第一通信服务管理器通过建立好的会话通路将第一接续应用的包名以及接续内容概要等信息发送给第二通信服务管理器,第二通信服务管理器进一步将第一接续应用的包名以及接续内容概要等信息上报到第二接续服务管理器。After the session path is successfully established, the first communication service manager may indicate to the first connection service manager that the channel is successfully established, and the first connection service manager may send the broadcast connection notification carrying the first connection application according to the broadcast connection notification sent by the first connection application. The broadcast connection notification of the package name and the summary of the connection content and other information is sent to the first communication service manager. The first communication service manager sends the package name of the first connection application and the summary of the connection content and other information to the first communication service manager through the established session path. The second communication service manager further reports information such as the package name of the first connection application and the connection content summary to the second connection service manager.

第二接续服务管理器可以解析第一接续应用的包名,并携带第一接续应用的包名信息与第二鉴权服务管理器进行绑定与鉴权,绑定与鉴权相关的实现同第一终端设备中的鉴权步骤类似,在此不再赘述。The second connection service manager can parse the package name of the first connection application, and carry the package name information of the first connection application for binding and authentication with the second authentication service manager. The implementation of binding and authentication is the same. The authentication steps in the first terminal device are similar and will not be described again.

在应用鉴权成功之后,第二接续服务管理器可以通过任意可能的实现获取应用图标。After the application authentication is successful, the second connection service manager can obtain the application icon through any possible implementation.

一种可能的实现中,第二接续服务管理器可以根据得到的第一接续应用的包名等应用信息在第二终端设备中查找本地是否存储有第一接续应用的图标。若可以查找到第一接续应用的图标,则第二接续服务管理器可以通知桌面启动器使用第一接续应用的图标显示接续通知;若未查找到第一接续应用的图标,则第二接续服务管理器可以通过云端鉴权服务器获取第一接续应用的图标等相关信息。进一步地,在云端鉴权服务器将第一接续应用的图标发送给第二接续服务管理器时,则第二接续服务管理器可以在第二终端设备的本地存储第一接续应用的图标等相关信息,以及第二接续服务管理器可以通知桌面启动器在第二终端设备上显示接续通知。In one possible implementation, the second connection service manager may search whether the icon of the first connection application is stored locally in the second terminal device based on the obtained application information such as the package name of the first connection application. If the icon of the first connection application can be found, the second connection service manager can notify the desktop launcher to use the icon of the first connection application to display the connection notification; if the icon of the first connection application is not found, the second connection service manager The manager can obtain the icon of the first connected application and other related information through the cloud authentication server. Further, when the cloud authentication server sends the icon of the first connection application to the second connection service manager, the second connection service manager can store the icon of the first connection application and other related information locally on the second terminal device. , and the second connection service manager can notify the desktop launcher to display the connection notification on the second terminal device.

另一种可能的实现中,第二接续服务管理器可以通过云端鉴权服务器获取第一接续应用的图标等相关信息。In another possible implementation, the second connection service manager can obtain the icon and other related information of the first connection application through the cloud authentication server.

再一种可能的实现中,第二接续服务管理器可以在第二终端设备中查找与第一接续应用包名相同的第二接续应用。若可以查找到第二接续应用,则第二接续服务管理器可以通知桌面启动器使用第二终端设备本地存储的第二接续应用的图标显示接续通知;若未查找到第二接续应用,则第二接续服务管理器可以通过上述在第二终端设备的本地或者在云端鉴权服务器中查找应用信息的方式获取第一接续应用的图标等相关信息,并通知桌面启动器使用第一接续应用的图标显示接续通知。In another possible implementation, the second connection service manager may search the second terminal device for a second connection application with the same package name as the first connection application. If the second connection application can be found, the second connection service manager may notify the desktop launcher to display the connection notification using the icon of the second connection application stored locally on the second terminal device; if the second connection application is not found, the second connection application may be found. The second connection service manager can obtain the icon of the first connection application and other related information by searching the application information locally on the second terminal device or in the cloud authentication server, and notify the desktop launcher to use the icon of the first connection application. Display the connection notification.

可以理解的是,桌面启动器控制显示接续通知时,接续通知可以在第二终端设备的最近任务、任务栏、快捷窗口或者其他界面入口中显示,具体显示接续通知的方式,本申请实施例不作限制。接续通知可以以接续应用图标的形式显示,也可以通过应用名称、提示语或者其他形式显示,具体显示接续通知的形式,本申请实施例不作限制。It can be understood that when the desktop launcher controls the display of the connection notification, the connection notification can be displayed in the recent task, taskbar, shortcut window or other interface entry of the second terminal device. The specific method of displaying the connection notification will not be described in the embodiment of this application. limit. The connection notification may be displayed in the form of a connection application icon, or may be displayed in the form of an application name, a prompt, or other forms. The specific display format of the connection notification is not limited by the embodiments of this application.

第四阶段、接续数据的获取与加载。The fourth stage is the acquisition and loading of continued data.

当第二终端设备接收到用户点击接续应用图标的事件后,可能的实现中,若第二终端设备中未安装有第二接续应用,则第二终端设备中可以提示用户安装第二接续应用,具体的提示安装应用的方式,本申请实施例不作限制。若第二终端设备中已安装有第二接续应用,或基于提示完成第二接续应用的安装,则可以执行下述的步骤。After the second terminal device receives the event that the user clicks the connection application icon, in a possible implementation, if the second connection application is not installed in the second terminal device, the second terminal device may prompt the user to install the second connection application. The specific method of prompting to install the application is not limited in the embodiment of this application. If the second connection application is already installed in the second terminal device, or the installation of the second connection application is completed based on prompts, the following steps can be performed.

第二接续服务管理器可以拉起第二接续应用,并指示第二接续应用加载过渡动画效果,则第二接续应用可以启动并加载过渡动效,过渡动效例如可以包括“加载中…”等提示信息。进一步地,第二接续应用可以通过调用第二接续服务SDK的注册接口接入接续服务,可以理解的是,第二接续应用在注册接续服务时可以携带第二接续应用的包名等信息。The second connection service manager can launch the second connection application and instruct the second connection application to load the transition animation effect. Then the second connection application can start and load the transition animation effect. The transition animation effect can include, for example, "Loading..." etc. Prompt information. Further, the second connection application can access the connection service by calling the registration interface of the second connection service SDK. It can be understood that the second connection application can carry information such as the package name of the second connection application when registering the connection service.

第二接续服务SDK可以向第二接续服务管理器发送绑定接续服务的请求,第二接续服务管理器在接收到绑定接续服务的请求后,可以向第二通信服务管理器发送绑定通信服务的请求。当第二通信服务管理器绑定成功后,第二通信服务管理器可以通过第二接续服务管理器向第二接续服务SDK发送绑定成功的消息。第二接续服务SDK在接收到绑定成功的消息后,向第二接续服务管理器发送注册接续服务的消息,第二接续服务管理器在注册成功后,可以将注册成功的消息通过第二接续服务SDK返回给第二接续应用。The second connection service SDK can send a request to bind the connection service to the second connection service manager. After receiving the request to bind the connection service, the second connection service manager can send a binding communication to the second communication service manager. Service requests. When the second communication service manager is successfully bound, the second communication service manager may send a binding success message to the second connection service SDK through the second connection service manager. After receiving the binding success message, the second connection service SDK sends a registration connection service message to the second connection service manager. After the second connection service manager successfully registers, the second connection service manager can send the registration success message through the second connection service manager. The service SDK is returned to the second connection application.

在第二接续应用启动过程中,第二接续服务管理器还可以通过第一终端设备与第二终端设备之间所建立的会话通路向第一接续服务管理器发送请求接续数据,当第一接续服务管理器接收到请求接续数据后,可以通过第一接续服务SDK将请求接续数据上报给第一接续应用,则第一接续应用可以将接续内容等相关接续数据进行打包和加密,并通过第一接续服务SDK将接续数据发送给第一接续服务管理器,第一接续服务管理器可以通过第一终端设备与第二终端设备之间所建立的会话通路将接续数据发送给第二接续服务管理器。During the startup process of the second connection application, the second connection service manager may also send connection request data to the first connection service manager through the session path established between the first terminal device and the second terminal device. When the first connection service manager After receiving the request connection data, the service manager can report the request connection data to the first connection application through the first connection service SDK. Then the first connection application can package and encrypt the connection content and other related connection data, and pass the first connection service SDK to the first connection application. The connection service SDK sends the connection data to the first connection service manager. The first connection service manager can send the connection data to the second connection service manager through the session path established between the first terminal device and the second terminal device. .

进一步地,第二接续服务管理器通过第二接续服务SDK向第二接续应用通知接续数据,第二接续应用在注册成功之后,可以加载接续数据并控制第二终端设备显示接续数据,以及向第一终端设备的第一接续应用传递用于指示接续成功的信息,进而第一接续应用可以执行退出第一接续应用的页面等流程。Further, the second connection service manager notifies the second connection application of the connection data through the second connection service SDK. After successful registration, the second connection application can load the connection data and control the second terminal device to display the connection data, and send the connection data to the second connection application. The first connection application of a terminal device transmits information indicating successful connection, and then the first connection application can execute processes such as exiting the page of the first connection application.

在上文中描述的各阶段执行的过程中,可能存在以下几种场景。During the execution of each stage described above, the following scenarios may exist.

场景一、第一接续应用正常退出。Scenario 1: The first connected application exits normally.

示例性地,第一接续应用可以在接收到接续成功通知之后退出。在该场景下,第一接续应用可以通过调用第一接续服务SDK的应用解除注册接口以解除注册。第一接续服务SDK通过申请的通信通道向第一接续服务管理器发送应用解除注册的请求,第一接续服务管理器在接收到第一接续服务SDK的请求后,可以通知第一通道服务管理器应用已退出,第一通道服务管理器停止对第一接续应用的定时查询,并清理共享内存中的占用位。例如,第一接续服务SDK在申请通信通道时,将共享内存区域的第三个比特位的值修改为“1”,因此在清理时,第一通道服务管理器将共享内存区域的第三个比特位的值修改为“0”,表示第三个比特位对应的通信通道未被使用或未被申请,可以被其他的应用申请使用,这样有利于高效利用有限的IPC通信资源,提高通信资源的利用率。For example, the first connection application may exit after receiving the connection success notification. In this scenario, the first connection application can deregister by calling the application deregistration interface of the first connection service SDK. The first connection service SDK sends an application deregistration request to the first connection service manager through the applied communication channel. After receiving the request from the first connection service SDK, the first connection service manager can notify the first channel service manager The application has exited, and the first channel service manager stops the regular query of the first connection application and clears the occupied bits in the shared memory. For example, when applying for a communication channel, the first connection service SDK changes the value of the third bit in the shared memory area to "1". Therefore, when cleaning, the first channel service manager changes the third bit in the shared memory area to "1". The value of the bit is modified to "0", indicating that the communication channel corresponding to the third bit has not been used or applied for, and can be applied for use by other applications. This is conducive to efficient use of limited IPC communication resources and improvement of communication resources. utilization rate.

进一步地,第一通道服务管理器通知第一接续服务管理器应用断开成功,第一接续服务管理器在接收到应用断开成功的消息之后,通过第一接续服务SDK向第一接续应用发送解除注册成功的消息。Further, the first channel service manager notifies the first connection service manager that the application is disconnected successfully. After receiving the message that the application is disconnected successfully, the first connection service manager sends a message to the first connection application through the first connection service SDK. Deregistration successful message.

场景二、第一接续应用异常退出。Scenario 2: The first connected application exits abnormally.

示例性地,第一接续应用卡顿退出、用户在后台任务管理器强制停止应用等情况下可能导致第一接续应用异常退出。在该场景下,第一通道服务管理器无法成功向第一接续服务SDK发送保活包,第一接续服务SDK未向第一接续服务管理器解除注册,导致第一接续应用一直占用通信通道,在IPC通信资源有限的情况下,可能使得其他的应用无法及时申请到可用的通信通道,造成通信资源的浪费。For example, if the first connected application freezes and exits, or the user forcibly stops the application in the background task manager, the first connected application may exit abnormally. In this scenario, the first channel service manager cannot successfully send the keep-alive packet to the first connection service SDK, and the first connection service SDK does not deregister with the first connection service manager, causing the first connection application to always occupy the communication channel. When IPC communication resources are limited, other applications may not be able to apply for available communication channels in time, resulting in a waste of communication resources.

在本申请实施例中,第一通道服务管理器在确定定时查询失败之后,通知第一接续服务管理器应用已退出。第一通道服务管理器停止对第一接续应用的定时查询,并清理共享内存中的占用位,这样有利于避免对通信资源的浪费。In this embodiment of the present application, after determining that the scheduled query fails, the first channel service manager notifies the first connection service manager that the application has exited. The first channel service manager stops the scheduled query for the first connection application and clears the occupied bits in the shared memory, which helps avoid waste of communication resources.

场景三、第一接续应用先于第一接续服务管理器启动。Scenario 3: The first connection application is started before the first connection service manager.

第一接续应用先于第一接续服务管理器启动,也即第一接续应用先于电脑管家启动。在该场景中,第一接续应用可以申请到通信通道,但是可能无法成功注册接续服务,因为第一接续服务管理器还未启动或者已异常退出。示例性地,用户可以手动打开电脑管家以启动第一接续服务管理器,在第一接续服务管理器启动的过程中,第一接续服务管理器在共享内存中所有可用于传输通信回连消息的通信通道上发送通信回连消息。The first connection application is started before the first connection service manager, that is, the first connection application is started before the computer manager. In this scenario, the first connection application can apply for the communication channel, but may not be able to successfully register the connection service because the first connection service manager has not been started or has exited abnormally. For example, the user can manually open the computer manager to start the first connection service manager. During the startup process of the first connection service manager, the first connection service manager stores all the connections in the shared memory that can be used to transmit communication connection messages. Send communication connection messages on the communication channel.

例如,第一接续服务SDK在通信ID+1所标识的通信通道上接收到第一接续服务管理器广播的通信回连消息,如果第一接续应用有跨设备进行应用接续的需求,第一接续应用可以确定启动接续应用的注册与绑定,第一接续服务管理器根据回连的通信通道的通信ID,维护共享内存区域的数据为最近状态。For example, the first connection service SDK receives the communication reconnection message broadcast by the first connection service manager on the communication channel identified by communication ID+1. If the first connection application has a requirement for cross-device application connection, the first connection service SDK The application can determine to start the registration and binding of the connection application, and the first connection service manager maintains the data in the shared memory area as the latest state according to the communication ID of the back-connected communication channel.

场景四、第一接续服务管理器异常退出。Scenario 4: The first connection service manager exits abnormally.

该场景下的处理流程与场景三的处理流程类似,此处不再赘述。The processing flow in this scenario is similar to that in Scenario 3 and will not be described again here.

以上结合图6描述了第一终端设备作为发送端,第二终端设备作为接收端的内部交互流程,下面介绍第一终端设备作为接收端,第二终端设备作为发送端的内部交互流程。其中,第一终端设备可以具有如图3和图5所示的结构,第二终端设备可以具有如图3和图4所示的结构。The above describes the internal interaction process of the first terminal device as the sender and the second terminal device as the receiver with reference to Figure 6. The following describes the internal interaction process of the first terminal device as the receiver and the second terminal device as the sender. The first terminal device may have a structure as shown in Figures 3 and 5, and the second terminal device may have a structure as shown in Figures 3 and 4.

第一终端设备作为接收端的前提是第一终端设备的电脑管家要先于第一接续应用启动,这样第一终端设备才可以正常进行设备的自发现与自组网等相关的应用接续流程。The prerequisite for the first terminal device to serve as the receiving end is that the computer manager of the first terminal device must be started before the first connection application, so that the first terminal device can normally perform application connection processes related to device self-discovery and ad hoc networking.

与第一终端设备作为发送端的内部交互类似,第二终端设备在作为发送端时可以执行上述阶段二以后的流程,在图4的层级架构下,第二终端设备中的第二接续服务SDK与第二接续服务管理器之间不涉及跨进程的通信,因此第二接续服务SDK无需去共享内存中申请通信通道。Similar to the internal interaction of the first terminal device as the sender, the second terminal device can perform the above-mentioned process after stage 2 when it serves as the sender. Under the hierarchical architecture of Figure 4, the second connection service SDK in the second terminal device and There is no cross-process communication between the second connection service managers, so the second connection service SDK does not need to apply for a communication channel in the shared memory.

第二终端设备可以打开第二接续应用,执行接续应用的注册与绑定、广播接续通知、绑定鉴权服务以及应用鉴权、与第一终端设备的第一通信服务管理器建立会话通路,具体流程可参照上文针对图6的描述,此处不再赘述。在建立会话通路之后,第一通信服务管理器和第二通信服务管理器通过建立好的会话通路进行消息传输,消息中包括第二接续应用的包名等信息。第一接续服务管理器与第一鉴权服务管理器根据第二接续应用的包名绑定鉴权服务、进行应用鉴权。在应用鉴权成功之后,第一接续服务管理器获取应用图标,通知第一终端设备的桌面启动器以图标形式显示接续通知。The second terminal device can open the second connection application, perform registration and binding of the connection application, broadcast connection notification, bind authentication service and application authentication, and establish a session path with the first communication service manager of the first terminal device, For the specific process, please refer to the above description of Figure 6 and will not be described again here. After the session path is established, the first communication service manager and the second communication service manager transmit messages through the established session path, and the messages include information such as the package name of the second connection application. The first connection service manager and the first authentication service manager bind the authentication service according to the package name of the second connection application and perform application authentication. After the application authentication is successful, the first connection service manager obtains the application icon and notifies the desktop launcher of the first terminal device to display the connection notification in the form of an icon.

在第一终端设备为应用接续的接收端时,第一接续应用的图标可以显示在第一终端设备的任务栏(或称为dock栏)。When the first terminal device is the receiving end of the application connection, the icon of the first connected application may be displayed on the taskbar (or dock) of the first terminal device.

当第一终端设备接收到用户点击接续应用图标的事件后,若第一终端设备中已安装第一接续应用且第一接续应用未启动,则第一接续服务管理器拉起第一接续应用,并指示第一接续应用加载过渡动画动效,则第一接续应用可以启动并加载过渡动效。When the first terminal device receives the event that the user clicks the connection application icon, if the first connection application has been installed in the first terminal device and the first connection application has not been started, the first connection service manager launches the first connection application, and instructs the first connection application to load the transition animation effect, then the first connection application can start and load the transition animation effect.

进一步地,第一终端设备可以执行与图6中的初始化阶段和接续应用的注册与绑定阶段类似的流程,此处不再赘述。Further, the first terminal device may perform a process similar to the initialization phase and the registration and binding phase of the connected application in FIG. 6 , which will not be described again here.

在第一接续应用启动的过程中,第一接续服务管理器可以通过第一终端设备与第二终端设备之间所建立的会话通路向第二接续服务管理器请求接续数据。具体请求接续数据的流程可参照上文针对图6的描述,此处不再赘述。During the process of starting the first connection application, the first connection service manager may request connection data from the second connection service manager through the session path established between the first terminal device and the second terminal device. For the specific process of requesting data connection, please refer to the above description of FIG. 6 and will not be described again here.

进一步地,第一接续服务管理器在接收到接续数据之后,在申请到的用于传输接续数据的通信通道上通过第一接续服务SDK向第一接续应用通知接续数据。例如,通信ID对应的N个通信通道中通信ID+2所标识的通信通道用于传输接续数据,则第一接续服务管理器可以在通信ID+2所标识的通信通道上向第一接续应用发送接续数据。Further, after receiving the connection data, the first connection service manager notifies the first connection application of the connection data through the first connection service SDK on the communication channel applied for transmitting the connection data. For example, the communication channel identified by communication ID+2 among the N communication channels corresponding to the communication ID is used to transmit connection data, then the first connection service manager can apply the first connection application to the communication channel identified by communication ID+2. Send connection data.

综合上文对应用接续的内部交互流程的描述,如图9所示,本申请实施例提供一种用于应用接续的方法900,方法900可以由终端设备执行,该终端设备可以具有如图3和图5所示的结构,但本申请实施例对此不作限定。该终端设备安装有第一应用和电脑管家。该终端设备对应上述第一终端设备,可以作为应用接续的发送端,也可以作为应用接续的接收端。方法900包括如下步骤:Based on the above description of the internal interaction process of application connection, as shown in Figure 9, the embodiment of the present application provides a method 900 for application connection. The method 900 can be executed by a terminal device. The terminal device can have the configuration shown in Figure 3 and the structure shown in Figure 5, but the embodiment of the present application is not limited to this. The terminal device is installed with the first application and computer manager. The terminal device corresponds to the above-mentioned first terminal device and can be used as a sender of the application connection or as a receiver of the application connection. Method 900 includes the following steps:

S901,响应于用户点击第一应用的图标的操作,获取共享内存中目标比特位的标识,目标比特位是值为第一预设值的比特位,第一预设值表示目标比特位对应的通信通道未被使用。S901. In response to the user clicking the icon of the first application, obtain the identification of the target bit in the shared memory. The target bit is a bit whose value is a first preset value. The first preset value represents the target bit corresponding to The communication channel is not in use.

在本步骤中,第一应用可以为上述第一接续应用,示例性地,第一预设值为“0”,如果共享内存中的第一个比特位的值为“0”时,则第一个比特位为目标比特位,终端设备可以获取第一个比特位的标识n=1;如果共享内存中的第一个比特位的值为“1”,第二个比特位的值为“0”时,则第二个比特位为目标比特位,终端设备可以获取第二个比特位的标识n=2。In this step, the first application may be the above-mentioned first subsequent application. For example, the first preset value is "0". If the value of the first bit in the shared memory is "0", then the first One bit is the target bit, and the terminal device can obtain the identifier n=1 of the first bit; if the value of the first bit in the shared memory is "1", the value of the second bit is " 0", the second bit is the target bit, and the terminal device can obtain the identifier n=2 of the second bit.

S902,基于目标比特位的标识,确定目标比特位对应的通信标识,通信标识指示用于第一应用和电脑管家通信的至少一个通信通道。S902. Based on the identification of the target bit, determine the communication identification corresponding to the target bit. The communication identification indicates at least one communication channel used for communication between the first application and the computer manager.

结合上文的描述,终端设备在获取到目标比特位的标识之后,可以基于预设规则计算得到目标比特位对应的通信标识,通信标识对应至少一个通信通道,这样终端设备为第一应用申请到可以用于与电脑管家通信的IPC通信资源。具体对通信通道的描述可参见上文,此处不再赘述。Based on the above description, after the terminal device obtains the identifier of the target bit, it can calculate the communication identifier corresponding to the target bit based on the preset rules. The communication identifier corresponds to at least one communication channel. In this way, the terminal device applies for the first application. IPC communication resources that can be used to communicate with computer managers. The specific description of the communication channel can be found above and will not be repeated here.

S903,基于所述至少一个通信通道实现第一应用与电脑管家之间的数据传输。S903: Implement data transmission between the first application and the computer manager based on the at least one communication channel.

在本步骤中,第一应用与电脑管家之间的数据传输可以包括上文所描述的注册接续服务和回调、广播接续通知、请求接续数据、应用解除注册、广播通信回连消息等。In this step, the data transmission between the first application and the computer manager may include the above-described registration connection service and callback, broadcast connection notification, request connection data, application deregistration, broadcast communication reconnection message, etc.

在本申请实施例中,终端设备可以将IPC通信与共享内存相结合,为接入电脑管家中的接续服务的至少一个应用灵活分配IPC通信资源,以实现应用和电脑管家中的接续服务之间的通信。In the embodiment of this application, the terminal device can combine IPC communication with shared memory to flexibly allocate IPC communication resources to at least one application that accesses the connection service in the computer manager, so as to realize the connection between the application and the connection service in the computer manager. Communication.

应理解,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的模块及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or modules, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.

所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code. .

以上所述,仅为本申请的具体实施方式,但本申请实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请实施例揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应所述以权利要求的保护范围为准。The above are only specific implementation modes of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes within the technical scope disclosed in the embodiments of the present application. or replacement, all should be covered by the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (13)

1. A method for application connection, applied to a terminal device, where the terminal device is a transmitting end or a receiving end of application connection, and the terminal device is installed with a first application and a computer manager, the method includes:
responding to the operation of clicking the icon of the first application by a user, and acquiring the identification of a target bit in a shared memory, wherein the target bit is a bit with a first preset value, and the first preset value indicates that a communication channel corresponding to the target bit is not used;
determining a communication identifier corresponding to the target bit based on the identifier of the target bit, wherein the communication identifier indicates at least one communication channel for the first application to communicate with the computer manager;
and realizing data transmission between the first application and the computer manager based on the at least one communication channel.
2. The method according to claim 1, wherein the method further comprises:
based on the acquisition of the identification of the target bit, modifying the value of the target bit from the first preset value to a second preset value, the second preset value representing that the communication channel corresponding to the target bit has been used.
3. The method of claim 2, wherein said enabling data transfer between the first application and the computer housekeeping based on the at least one communication channel comprises:
based on a first communication channel of the at least one communication channel, a continuation service and a callback are registered.
4. A method according to claim 3, characterized in that the method further comprises:
and under the condition that the process of the first application exits, modifying the value of the target bit from the second preset value to the first preset value.
5. The method according to claim 4, wherein the method further comprises:
de-registering the continuation service and the callback based on a second communication channel of the at least one communication channel;
and determining that the process of the first application exits based on the continuous service and the deregistration of the callback.
6. The method according to claim 4, wherein the method further comprises:
after successfully registering the continuation service and the callback, periodically inquiring whether the process of the first application exits.
7. A method according to claim 3, wherein the terminal device is a sender of an application connection; in the case that the first application is started before the computer manager or the process of the computer manager exits abnormally, the method further comprises:
Broadcasting a communication callback message, wherein the communication callback message is used for indicating the first application to connect with the computer manager;
the registering of the continued service and the callback based on the first communication channel of the at least one communication channel includes:
and registering a continuing service and callback based on the first communication channel under the condition that the communication callback message is received based on a third communication channel in the at least one communication channel.
8. The method according to any of claims 1 to 6, wherein the terminal device is a receiving end of an application connection; the responding to the operation of clicking the icon of the first application by the user obtains the identification of the target bit in the shared memory, and the method comprises the following steps:
and responding to the operation of clicking the icon of the first application positioned in the task bar of the terminal equipment by a user, and acquiring the identification of the target bit in the shared memory.
9. The method according to any of claims 1 to 7, wherein the terminal device is a sender of an application connection; the responding to the operation of clicking the icon of the first application by the user obtains the identification of the target bit in the shared memory, and the method comprises the following steps:
And responding to the operation of clicking the icon of the first application positioned on the desktop or the task bar of the terminal equipment by a user, and acquiring the identification of the target bit in the shared memory.
10. A terminal device comprising means for performing the method of any of claims 1 to 9.
11. A terminal device, comprising: a processor and a memory, wherein,
the memory is used for storing a computer program;
the processor is configured to invoke and execute the computer program to cause the terminal device to perform the method of any of claims 1 to 9.
12. A computer readable storage medium for storing a computer program which, when run on a computer, causes the computer to perform the method of any one of claims 1 to 9.
13. A computer program product comprising computer program code embodied therein, which when run on a computer causes the computer to carry out the method according to any one of claims 1 to 9.
CN202211197093.2A 2022-09-28 2022-09-28 Method and terminal equipment for application connection Active CN116737404B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202411003271.2A CN119166381A (en) 2022-09-28 2022-09-28 Method and terminal equipment for application connection
CN202211197093.2A CN116737404B (en) 2022-09-28 2022-09-28 Method and terminal equipment for application connection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211197093.2A CN116737404B (en) 2022-09-28 2022-09-28 Method and terminal equipment for application connection

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202411003271.2A Division CN119166381A (en) 2022-09-28 2022-09-28 Method and terminal equipment for application connection

Publications (2)

Publication Number Publication Date
CN116737404A true CN116737404A (en) 2023-09-12
CN116737404B CN116737404B (en) 2024-07-30

Family

ID=87917427

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202411003271.2A Pending CN119166381A (en) 2022-09-28 2022-09-28 Method and terminal equipment for application connection
CN202211197093.2A Active CN116737404B (en) 2022-09-28 2022-09-28 Method and terminal equipment for application connection

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202411003271.2A Pending CN119166381A (en) 2022-09-28 2022-09-28 Method and terminal equipment for application connection

Country Status (1)

Country Link
CN (2) CN119166381A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102710774A (en) * 2012-06-04 2012-10-03 深圳市宏电技术股份有限公司 Method and system for data transmission
CN109508301A (en) * 2017-09-14 2019-03-22 中国移动通信集团重庆有限公司 Terminal, using the processing method of data, data processing equipment and storage medium
CN110569130A (en) * 2019-07-29 2019-12-13 华为技术有限公司 Cross-process communication method, device and equipment
CN111030990A (en) * 2019-11-05 2020-04-17 华为技术有限公司 Method for establishing communication connection, client and server
WO2021218751A1 (en) * 2020-04-30 2021-11-04 华为技术有限公司 Cloud phone-based media data processing method and terminal device
CN113760560A (en) * 2020-06-05 2021-12-07 华为技术有限公司 An inter-process communication method and inter-process communication device
CN114090289A (en) * 2021-11-17 2022-02-25 国汽智控(北京)科技有限公司 Shared memory data calling method and device, electronic equipment and storage medium
CN114924671A (en) * 2022-07-18 2022-08-19 荣耀终端有限公司 Application connection method and device
CN115033319A (en) * 2021-06-08 2022-09-09 华为技术有限公司 Distributed display method and terminal of application interface

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102710774A (en) * 2012-06-04 2012-10-03 深圳市宏电技术股份有限公司 Method and system for data transmission
CN109508301A (en) * 2017-09-14 2019-03-22 中国移动通信集团重庆有限公司 Terminal, using the processing method of data, data processing equipment and storage medium
CN110569130A (en) * 2019-07-29 2019-12-13 华为技术有限公司 Cross-process communication method, device and equipment
CN111030990A (en) * 2019-11-05 2020-04-17 华为技术有限公司 Method for establishing communication connection, client and server
WO2021218751A1 (en) * 2020-04-30 2021-11-04 华为技术有限公司 Cloud phone-based media data processing method and terminal device
CN113760560A (en) * 2020-06-05 2021-12-07 华为技术有限公司 An inter-process communication method and inter-process communication device
CN115033319A (en) * 2021-06-08 2022-09-09 华为技术有限公司 Distributed display method and terminal of application interface
CN114090289A (en) * 2021-11-17 2022-02-25 国汽智控(北京)科技有限公司 Shared memory data calling method and device, electronic equipment and storage medium
CN114924671A (en) * 2022-07-18 2022-08-19 荣耀终端有限公司 Application connection method and device

Also Published As

Publication number Publication date
CN116737404B (en) 2024-07-30
CN119166381A (en) 2024-12-20

Similar Documents

Publication Publication Date Title
CN108536538A (en) Processor core scheduling method and device, terminal and storage medium
JP7100154B2 (en) Processor core scheduling method, equipment, terminals and storage media
WO2023087875A1 (en) Process scheduling method and terminal device
CN114222003A (en) Service calling method, system, device, equipment and storage medium
WO2025060715A1 (en) Method for managing system services, and related apparatus
CN116662270B (en) File analysis method and related device
CN116033157B (en) Screen projection method and electronic equipment
CN116737404B (en) Method and terminal equipment for application connection
CN118585294A (en) Application calling method and electronic device
CN116700552A (en) Application connection method and terminal equipment
CN116033158A (en) Screen projection method and electronic equipment
CN114489826A (en) Chip operating method, device, storage medium and electronic device
CN116366957B (en) A virtualized camera enabling method, electronic device and collaborative working system
CN111159734A (en) Communication terminal and multi-application data inter-access processing method
CN117857646B (en) Data network sharing method, electronic device and storage medium
CN116319681B (en) Inter-device communication method, electronic device, and computer-readable storage medium
CN116049096B (en) Data migration method, electronic device and storage medium
CN118301402B (en) Method, electronic device and storage medium for playing videos based on quick application cards
CN116700660B (en) Audio playing method and electronic device
CN117714279B (en) Device management method, router and readable storage medium
JP2006277204A (en) Portable communication terminal device
CN117827473A (en) Content continuation method and related device
CN117827043A (en) A content continuation method and related device
WO2025066224A1 (en) Memory sharing method and apparatus, terminal, and storage medium
CN119376907A (en) A thread management method and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address