Application connection method and terminal equipment
By obtaining the target bit identifier in shared memory and allocating IPC communication resources, the problem of limited IPC communication resources of PC devices is solved, and efficient data transmission and resource utilization between the application and the computer manager is realized.
Patent Information
- Application Number
- CN202411003271.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-09-28
AI Technical Summary
In application continuation scenarios, the IPC communication resources of PC devices are limited and it is difficult to flexibly allocate them to multiple applications, resulting in low communication efficiency.
By obtaining the identification of the target bit in the shared memory, determining the corresponding communication channel, and on the basis of it, data transmission between the application and the computer manager is realized, combining IPC communication and shared memory, IPC communication resources are flexibly allocated.
It improves data transmission efficiency and resource utilization in application continuity scenarios, ensuring that multiple applications can communicate efficiently.
Smart Images

Figure CN119166381A_ABST
Abstract
Description
[0001] This application is a divisional application of the Chinese patent application submitted to the China Patent Office on September 28, 2022, with application number 202211197093.2 and application name “Method and terminal device for application continuation”. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of terminals, and in particular to a method and terminal device for application connection. Background Art
[0003] At present, cross-device application continuation will become an important function in the subsequent multi-device scenarios. Application continuation can be understood as when a user is using an application on a personal computer (PC), the user can continue the use of the application on a mobile phone that meets the continuation conditions and continue to use the application on the mobile phone.
[0004] For PCs in application continuation scenarios, in order to synchronize the usage status of applications to other devices, or synchronize the usage status of applications on other devices to the PC, the PC needs to provide a continuation framework and software development kit (SDK) to meet this requirement. The continuation framework provides a unified application status synchronization framework for applications. Applications need to access the continuation framework through the SDK to achieve data transmission with the continuation service in the continuation framework, and the continuation service relies on the computer manager to provide external service capabilities for applications. After the application and computer manager in the PC are started, the application and computer manager run in two different processes, and the application needs to communicate with the continuation service in the computer manager through interprocess communication (IPC).
[0005] Therefore, how to allocate IPC communication resources to applications on the PC side to achieve communication between applications and the follow-up services in the computer manager is an urgent problem to be solved. Summary of the invention
[0006] The present application provides a method and terminal device for application continuation, which is conducive to the flexible allocation of IPC communication resources for the terminal device to achieve communication between the application and the continuation service in the computer manager.
[0007] In a first aspect, a method for application continuation is provided, which is applied to a terminal device, the terminal device being a sending end or a receiving end of the application continuation, the terminal device being installed with a first application and a computer manager, the method comprising: in response to a user clicking on an icon of the first application, obtaining an identifier of a target bit in a shared memory, the target bit being a bit having a value of a first preset value, the first preset value indicating that a communication channel corresponding to the target bit is not in use; based on the identifier of the target bit, determining a communication identifier corresponding to the target bit, the communication identifier indicating at least one communication channel used for communication between the first application and the computer manager; and realizing data transmission between the first application and the computer manager based on the at least one communication channel.
[0008] In this application, a continuation service manager (hereinafter referred to as continuation service) is integrated in the computer manager, and the first application communicates with the computer manager, including the communication between the continuation service SDK of the first application and the continuation service in the computer manager. After the first application and the computer manager are started, the continuation service runs in the computer manager, and the first application runs in the third-party application after connecting to the SDK as an independent process. Therefore, the first application needs to communicate with the continuation service in the computer manager through the continuation service SDK for cross-process communication.
[0009] In some scenarios, there may be at least one application that accesses the continuation service in order to achieve application continuation. In this scenario, the computer manager needs to have the ability to communicate with all applications that access the continuation service through IPC. In the technical solution provided in the present application, for the first application in at least one application that accesses the continuation service, the terminal device can obtain the identifier of the target bit in the shared memory, obtain the corresponding communication identifier based on the identifier of the target bit, and allocate at least one communication channel corresponding to the communication identifier to the first application, so that the first application can communicate with the continuation service in the computer manager through the IPC communication resources. In this way, by combining IPC communication and shared memory, the terminal device can flexibly allocate IPC communication resources to all applications that access the continuation service, and realize data transmission between applications and the computer manager in the application continuation scenario.
[0010] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: based on obtaining an identifier of the target bit, modifying the value of the target bit from a first preset value to a second preset value, the second preset value indicating that the communication channel corresponding to the target bit has been used.
[0011] In the present 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 indicate that the communication channel corresponding to the target bit has been applied for or used. In this way, when a new application accesses the service, the terminal device can apply for other communication channels corresponding to the bit with the first preset value for the new application, thereby realizing flexible allocation of IPC communication resources.
[0012] Optionally, in response to a user clicking on the icon of the first application, the terminal device may detect the values of multiple bits in the shared memory and determine a target bit whose value among the multiple bits is a first preset value. After determining the target bit, the terminal device may obtain an identifier of the target bit. Furthermore, 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 identifier 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.
[0013] In combination with the first aspect, in certain implementations of the first aspect, data transmission between the first application and the computer manager is implemented based on at least one communication channel, including: registering a connection service and a callback based on a first communication channel in the at least one communication channel.
[0014] In the present application, each of the at least one communication channel allocated by the terminal device to the first application can be used to transmit different types of messages. Among them, the first communication channel is used for the first application to register for the continuation service and callback. This makes data transmission in the application continuation scenario more convenient and efficient.
[0015] In combination 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.
[0016] In the present 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, when the IPC communication resources are limited, other applications can use the communication channel corresponding to the target bit, thereby improving resource utilization.
[0017] In combination with the first aspect, in some implementations of the first aspect, the method further includes: deregistering the continuation service and the callback based on the second communication channel in the at least one communication channel; and determining the process exit of the first application based on the deregistration of the continuation service and the callback.
[0018] In the present application, when the first application exits normally, the terminal device can unregister the continuation service and callback through the second communication channel allocated to the first application. After the continuation service in the terminal device receives the message of unregistering the continuation service and 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 to the first application.
[0019] In combination with the first aspect, in some implementations of the first aspect, the method further includes: after successfully registering the connection service and the callback, periodically querying whether the process of the first application has exited.
[0020] In the present application, the terminal device monitors the status of the process of the first application in a timely manner by periodically querying whether the process of the first application has exited.
[0021] For example, the terminal device periodically 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 cannot successfully send the keep-alive packet. 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.
[0022] In combination with the first aspect, in some implementations of the first aspect, the terminal device is a sending end of the application continuation; when the first application is started before the computer manager, or the process of the computer manager exits abnormally, the method further includes: broadcasting a communication reconnection message, the communication reconnection message is used to instruct the first application to connect to the computer manager. Based on the first communication channel of the at least one communication channel, registering the continuation service and callback includes: when receiving the communication reconnection message based on the third communication channel of the at least one communication channel, registering the continuation service and callback based on the first communication channel.
[0023] In this application, the connection service of the computer manager 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 be determined that the computer manager has been started and can be connected normally. Therefore, the first application can register the connection service and callback based on the first communication channel.
[0024] In combination with the first aspect, in certain implementations of the first aspect, the terminal device is the receiving end of the application connection; the obtaining of the identifier of the target bit in the shared memory in response to the user clicking the icon of the first application includes: obtaining the identifier of the target bit in the shared memory in response to the user clicking the icon of the first application located in the taskbar of the terminal device.
[0025] In the present application, as the application connection receiving end, the taskbar of the terminal device can display the connection notification, and the connection notification can be displayed in the taskbar in the form of the 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 the connection data of the first application on other devices, such as the edited content of the memo, audio data, etc.
[0026] In combination with the first aspect, in certain implementations of the first aspect, the terminal device is the sending end of the application connection; in response to the user clicking the icon of the first application, the identifier of the target bit in the shared memory is obtained, including: in response to the user clicking the icon of the first application located on the desktop or taskbar of the terminal device, the identifier of the target bit in the shared memory is obtained.
[0027] In the present application, as the sending end 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 sending end and perform corresponding operations in the first application, for example, editing a memo, playing music, etc.
[0028] In a second aspect, a terminal device is provided, comprising an acquisition module and a processing module for executing the method in any possible implementation manner of the first aspect.
[0029] The acquisition module is used to: in response to a user clicking on the icon of the first application, acquire the identifier of a target bit in the shared memory, the target bit being a bit with a first preset value, the first preset value indicating that the communication channel corresponding to the target bit is not in use. The processing module is used to: determine the communication identifier corresponding to the target bit based on the identifier of the target bit, the communication identifier indicating at least one communication channel used for communication between the first application and the computer manager; and implement data transmission between the first application and the computer manager based on the at least one communication channel.
[0030] In combination with the second aspect, in certain implementations of the second aspect, the processing module is used to: based on obtaining the identifier of the target bit, modify the value of the target bit from a first preset value to a second preset value, and the second preset value indicates that the communication channel corresponding to the target bit has been used.
[0031] In combination with the second aspect, in some implementations of the second aspect, the processing module is used to: register a continuation service and a callback based on a first communication channel in at least one communication channel.
[0032] In combination with the second aspect, in some implementations of the second aspect, the processing module is used 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.
[0033] In combination with the second aspect, in certain implementations of the second aspect, the processing module is used to: deregister the continuation service and the callback based on the second communication channel in the at least one communication channel; and determine the process exit of the first application based on the deregistration of the continuation service and the callback.
[0034] In combination with the second aspect, in some implementations of the second aspect, the processing module is used to: after successfully registering the connection service and callback, periodically query whether the process of the first application has exited.
[0035] In conjunction with the second aspect, in some implementations of the second aspect, the terminal device is a sending end of the application continuation. 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, the communication reconnection message is used to instruct the first application to connect to the computer manager; and, in the case where the communication reconnection message is received based on a third communication channel among the at least one communication channel, register a continuation service and callback based on the first communication channel.
[0036] In conjunction with the second aspect, in some implementations of the second aspect, the terminal device is a receiving end of the application connection. The processing module is used to: in response to a user clicking an icon of a first application located in a taskbar of the terminal device, obtain an identifier of a target bit in the shared memory.
[0037] In conjunction with the second aspect, in some implementations of the second aspect, the terminal device is a sending end of the application connection. The processing module is used to: in response to a user clicking an icon of a first application located on a desktop or taskbar of the terminal device, obtain an identifier of a target bit in the shared memory.
[0038] In a third aspect, another terminal device is provided, including a processor and a memory, wherein the processor is coupled to the memory, the memory can be used to store a computer program, and the processor can be used to call and execute the computer program in the memory to implement the method in any possible implementation of the first aspect above.
[0039] In a fourth aspect, a processor is provided, comprising: an input circuit, an output circuit and a processing circuit. The processing circuit is used to receive a signal through the input circuit and transmit a signal through the output circuit, so that the processor executes the method in any possible implementation of the first aspect.
[0040] 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 trigger, and various logic circuits. The input signal received by the input circuit can be, for example, but not limited to, received and input by a receiver, and the signal output by the output circuit can be, for example, but not limited to, output to a transmitter and transmitted by the transmitter, and the input circuit and the output circuit can be the same circuit, which is used 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.
[0041] In a fifth aspect, a processing device is provided, comprising 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 possible implementation of the first aspect.
[0042] Optionally, there are one or more processors and one or more memories.
[0043] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0044] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.
[0045] It should be understood that the relevant data interaction process, such as sending indication information, can be a process of outputting indication information from a processor, and receiving capability information can be a process of receiving input capability information from a processor. Specifically, the processed output data can be output to a transmitter, and the input data received by the processor can come from a receiver. Among them, the transmitter and the receiver can be collectively referred to as a transceiver.
[0046] The processing device in the fifth aspect mentioned above can be a chip. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, 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.
[0047] In a sixth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed, enables a computer to execute the method in any possible implementation manner of the above-mentioned first aspect.
[0048] In a seventh aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed, the computer executes the method in any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a schematic diagram of a scenario provided by an embodiment of the present application;
[0050] Figure 2 This is a schematic diagram of an application connection interface provided by an embodiment of the present application;
[0051] Figure 3 It is a schematic diagram of the structure of a terminal device applicable to the embodiment of the present application;
[0052] Figure 4 It is a software structure block diagram of a terminal device to which the embodiment of the present application is applicable;
[0053] Figure 5 It is another software structure block diagram of a terminal device to which the embodiment of the present application is applicable;
[0054] Figure 6 is a schematic flow chart of an application connection method provided in an embodiment of the present application;
[0055] Figure 7 It is a schematic diagram of a communication principle of a shared memory provided in an embodiment of the present application;
[0056] Figure 8 It is a schematic diagram of an application communication channel provided in an embodiment of the present application;
[0057] Fig. 9 It is a schematic flowchart of a method for application continuation provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0059] In order to clearly describe the technical solutions of the embodiments of the present application, some of the terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0060] 1. Connection strategy: The connection strategy is used to determine the devices that can be connected. Each application can correspond to its own connection strategy. For example, the connection strategy of an application can be related to one or more of the following fields:
[0061] The device types supported by the application, the connectable application package name on the Android platform, the connectable process name on the Windows platform, the browser startup parameters, the minimum version number and minimum version supported for the connectable application, etc.
[0062] The continuation strategy may correspond to a flag bit for identifying the continuation strategy state. For example, a flag bit of 0 may indicate that continuation is not supported, a flag bit of 1 may indicate application continuation, and a flag bit of 3 may indicate browser continuation. It is understood that the specific value of the flag bit can be set arbitrarily as long as it can distinguish different states, and the embodiments of the present application do not make specific limitations.
[0063] 2. Other terms
[0064] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first terminal device and the second terminal device are used to distinguish different terminal devices, and the order of precedence is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0065] It should be noted that in the embodiments of the present application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplarily" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0066] In addition, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural 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.
[0067] With the development of terminal technology, users often need to switch content between multiple terminal devices. For example, when a user is editing content in a memo on a mobile phone, due to the small screen of the mobile phone, the user may want to use a tablet computer or other device with a larger screen to continue editing the content in the memo.
[0068] In the above scenario where the content of the mobile phone is switched to the tablet computer, when the user wants to continue editing the memo content previously edited in the mobile phone after switching to the tablet computer, it is usually necessary to find and open the memo in the tablet computer and re-edit the memo content in the mobile phone, or copy the memo content in the mobile phone to the tablet computer through a medium, such as copying and pasting the content through a chat tool or a USB flash drive, and switching the content in the mobile phone to the tablet computer. However, the above operations make the content switching process between devices more cumbersome and time-consuming.
[0069] The continuous development of terminal technology has promoted the possibility of interconnection between devices, and application continuation between devices will also become an important function in subsequent multi-device scenarios. Among them, application continuation can be understood as when a user uses an application on device A, the user can continue the use of the application on device B that meets the continuation conditions and continue to use the application. This method makes content switching between devices simpler and more efficient.
[0070] Figure 1 This is a schematic diagram of a scenario provided by an embodiment of the present application. The scenario shows a personal computer (PC) and a mobile phone. The PC uses the Windows system and the mobile phone uses the Android system. The user can use the mobile phone to continue the content presented by the application in the PC, or use the PC to continue the content presented by the application in the mobile phone.
[0071] Optionally, the scenario may also include more terminal devices, such as a large screen, a tablet computer, etc. Exemplarily, the user may use at least one of a mobile phone, a large screen, and a tablet computer to access the content presented by the application in the PC.
[0072] Combine the following Figure 2 , an example is given in which a user edits text using a memo on a PC and the user wants to continue editing the text in the memo through a mobile phone.
[0073] Figure 2 This is a schematic diagram of an application connection interface provided in an embodiment of the present application.
[0074] See also Figure 2 In the A interface, when the user opens the memo on the PC and edits the content, the PC broadcasts a connection notification. After the mobile phone receives the connection notification, see Figure 2In the B interface, the phone prompts the user through the dock bar (or through the multitasking center) that there are tasks that can be continued. The dock bar can be a fixed interface at the bottom of the screen of a mobile phone, PC or other device. The user can put the more commonly used applications in the dock bar. If the user needs to change the device to continue editing the content, the user can click the continue notification on the dock bar of the mobile phone to open the memo on the mobile phone to continue the application. See Figure 2 In the C interface, the content previously edited on the PC continues to be displayed in the memo interface of the mobile phone, and the cursor position is displayed at the position where the cursor on the PC was before the connection. Users can continue to edit the content on the mobile phone.
[0075] It should be noted that Figure 2 The PC and mobile phone shown in the figure belong to the same trust ring. The same trust ring can be understood as the same device account logged in between devices, the distance between devices meets a certain threshold, and Bluetooth or wireless fidelity (Wi-Fi) is turned on between devices. 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.
[0076] When a user is editing a memo on a PC, a mobile phone in the same trust circle can prompt the user to continue the application. When the user triggers the mobile phone to confirm the application continuation, 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 users with continuation services, reducing the complexity of operations when users continue cross-device applications, and improving user experience.
[0077] and Figure 2 Similar scenarios may also include: continuing to display a portable document format (PDF) opened on a mobile phone on a tablet computer; or continuing to play a video played on a tablet computer on a mobile phone; or continuing to play music played on a PC on a mobile phone, etc.
[0078] For PCs in application continuation scenarios, in order to synchronize the usage status of applications to other devices, or synchronize the usage status of applications on other devices to the PC, the PC needs to provide a continuation framework and software development kit (SDK) to meet this requirement. The continuation framework provides a unified application status synchronization framework for applications. Applications need to access the continuation framework through the SDK to achieve data transmission with the continuation service in the continuation framework. The continuation service provides external service capabilities for applications based on PC Manager.
[0079] 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 with the connection service through inter-process communication (IPC).
[0080] However, if multiple applications are connected to the connection framework at the same time, relying on the PC manager to communicate with the connection service, this will occupy too many IPC communication resources. The connection framework integrated in the PC manager provides limited IPC communication resources for applications. When there are too many connected applications, how to flexibly allocate IPC communication resources for multiple applications is an urgent problem to be solved.
[0081] In the embodiment of the present application, the continuation application is used as a general term for applications with a continuation function, and the types of continuation applications may include: editing applications (or document applications / office applications), browsing applications, audio and video entertainment applications (or multimedia playback applications), etc. It should be understood that not all applications occupying the IPC communication resources of the computer manager are continuation applications, for example, some security protection applications, engine applications, etc. also occupy the IPC communication resources of the computer manager.
[0082] In view of this, an embodiment of the present application provides an application continuation method. When multiple applications access the continuation framework at the same time and rely on the PC's computer manager to communicate with the continuation service, the PC can apply for an address in the shared memory for each application, and allocate communication resources to each application based on the applied shared memory address. The application can access the continuation service based on the communication resources and transmit data to the continuation service.
[0083] Figure 3 It is a structural diagram of a terminal device applicable to an embodiment of the present application.
[0084] 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, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0085] It is to be understood that the structure illustrated in the embodiments 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 fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0086] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0087] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0088] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0089] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0090] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the terminal device. 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.
[0091] The terminal device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0092] The terminal device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0093] 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 a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0094] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor. For example, the application continuation method of an embodiment of the present application may be executed.
[0095] The terminal device of the present application can be used as a transmitter or a receiver. The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Figure 4 Taking the Android system with a layered architecture as an example, the software structure of the terminal device of the embodiment of the present application is exemplified.
[0096] like Figure 4 As shown, the layered architecture divides the software into several layers, each with clear roles and division of labor. Data is transmitted and communicated between layers through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime and system library, the hardware abstract layer (HAL), and the kernel layer.
[0097] The application layer can include a series of application packages. Figure 4As shown, the application package may include third-party applications, connection service SDK, Bluetooth, Wi-Fi, memo, video, game and other applications. For example, in the embodiment of the present 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, and the memo, video, game and other applications can also be system applications or third-party applications.
[0098] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0099] like Figure 4 As shown, 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, and a view system, etc. Among them, the manager may also be called a module in some application scenarios.
[0100] The continuation service manager can be responsible for the management of continuation tasks and provide continuation services for continuation applications, and is the core of the continuation framework. For example, in the embodiment of the present application, the continuation service manager can be responsible for the access of continuation applications, the authentication of continuation applications, the icon management of continuation applications, and the transmission of continuation data across devices.
[0101] The communication service manager can be used to realize data transmission across devices. For example, in the embodiment of the present application, the communication service manager can realize security authentication and account authentication of devices with the same account, self-discovery and self-organizing networking of devices, data transmission between devices, and access to communication services.
[0102] The authentication service manager may be responsible for verifying the legitimacy of the application. For example, in an embodiment of the present application, the application may be allowed to access the subsequent service after the authentication service manager passes the verification.
[0103] The notification manager enables applications to display notification information in the status bar. It 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 the completion of downloads, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt tone is issued, the terminal device vibrates, an indicator light flashes, etc. For example, in an embodiment of the present application, when the terminal device receives a follow-up notification, the notification manager can display the follow-up notification in the taskbar.
[0104] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, capture the screen, etc.
[0105] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0106] Content providers are used to implement data sharing between different applications, allowing one program to access data in another program while ensuring the security of the accessed data.
[0107] The view system can be responsible for the interface drawing and event processing of the application program. For example, in the embodiment of the present application, the view system can be used to process the event processing after the user clicks the notification icon of the subsequent application.
[0108] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0109] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0110] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0111] The system library may include multiple functional modules, such as media libraries, function libraries, graphics processing libraries (such as OpenGL ES), etc.
[0112] 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.
[0113] The function library provides developers with API interfaces for multiple services, making it easy for developers to quickly integrate and implement various functions.
[0114] The graphics processing library is used to implement graphics drawing, image rendering, synthesis and layer processing.
[0115] The hardware abstraction layer is an abstracted structure between the kernel layer and the Android runtime. The hardware abstraction layer can be a package of the hardware driver, providing a unified interface for the call of the upper layer application. The hardware abstraction layer may include a Bluetooth module, a Wi-Fi module, a hardware configuration module, etc. For example, in an embodiment of the present application, the Bluetooth module and the Wi-Fi module in the hardware abstraction layer can shield the specific hardware implementation details of the Bluetooth driver and the Wi-Fi driver in the kernel layer, and the upper layer application can implement the Bluetooth function and the Wi-Fi function by calling the interface without having to know the specific implementation method of the kernel layer hardware driver.
[0116] The kernel layer is the layer between hardware and software. The kernel layer may include display drivers, camera drivers, audio drivers, Bluetooth drivers, Wi-Fi drivers, CPU drivers, etc. For example, in the embodiment of the present application, the communication service manager can connect across devices through related modules such as Bluetooth drivers and Wi-Fi drivers to achieve self-discovery and self-organizing networking of devices.
[0117] It is understandable that the sending end or the receiving end of the embodiment of the present application may also adopt the Windows system, such as Figure 5 As shown, unlike the Android system, the layered architecture of the Windows system is mainly divided into user state and kernel state. The user state can include user application processes, system processes, service processes, etc.; the kernel state can include the kernel and device driver layer, as well as the hardware abstraction layer, etc.
[0118] The user application process can execute a series of applications. The specific executable application types can be the same as the application types in the application layer of the Android system, which will not be repeated here.
[0119] The system process and service process may include a connection service manager, a communication service manager, an authentication service manager, a system process, a notification manager, a window manager, etc., which can provide corresponding services for the execution of user application processes. The functions of the connection service manager, the communication service manager, the authentication service manager and other processes related to the embodiment of the present application can be found in the description of the relevant managers in Android, which will not be repeated here.
[0120] In addition, the system process and the service process may also include a channel management server, which is used to manage the communication channels of the application programs, including timed query of the communication channels, release of the communication channels, etc.
[0121] The kernel layer and device driver layer may include Bluetooth driver, Wi-Fi driver, display driver, etc., and the hardware abstraction layer may include Bluetooth module, Wi-Fi module, hardware configuration module, etc. The functions of the specific functional modules can be found in the relevant description in Android, which will not be repeated here. The following is an example of the transmission process of connection data in the Windows system layered framework, combined with the scenario of displaying connection notifications between terminal devices during the application connection process.
[0122] like Figure 5 As shown, in the application layer of the sending end, the application is initialized by accessing the continuation service SDK. The continuation service SDK applies for the address of the shared memory for the application and determines the communication identification (identification, ID) of the application. In this way, the continuation service SDK can return the initialization success to the application. After determining the communication ID of the application, the application can realize data transmission with the continuation service by accessing the continuation service SDK. The continuation service SDK can send a request to bind the continuation service and register the continuation service for the application to the continuation service manager on the communication channel indicated by the communication ID, thereby realizing the continuation application registration and binding data transmission between the application layer and the application framework layer.
[0123] 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 application authentication with the authentication service manager.
[0124] After the follow-up 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 device self-discovery and self-organizing networking, and realize session connection, message transmission, and transmission of follow-up content between terminal devices through the Bluetooth driver and Wi-Fi driver in the kernel layer and device driver layer.
[0125] When the receiving end receives the connection-related data transmitted from the sending end based on the kernel layer and the device driver layer, the data can be transmitted 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 perform signaling 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 the authentication with the authentication service manager. Furthermore, the connection service manager can instruct the desktop launcher to display the connection notification in the form of an icon.
[0126] The following will describe the interaction process between the modules in detail in conjunction with a system for implementing a method for connecting applications across 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 in detail in some embodiments.
[0127] Figure 6 The system for implementing the cross-device application connection method may include a first terminal device and a second terminal device. The first terminal device may be used as a sending end and has the following features: Figure 3 and Figure 5 The structure shown in FIG. 1 shows, the second terminal device can be used as a receiving end, and has the following Figure 3 and Figure 4 The first terminal device and the second terminal device may include various functional modules for implementing the connection service, for example, a connection service SDK, a connection service manager, a communication service manager, and an authentication service manager.
[0128] The first terminal device in the embodiment of the present application can be specifically a device using the Windows system, such as a PC, and the second terminal device can be specifically a device using the Android system, such as a mobile phone, a tablet computer, etc.
[0129] For the sake of ease of description, the connection application of the first terminal device will be referred to as the first connection application, the connection service SDK of the first terminal device will be referred to as the first connection service SDK, the connection service manager of the first terminal device will be referred to as the first connection service manager, the channel service manager of the first terminal device will be referred to as the first channel service manager, the communication service manager of the first terminal device will be referred to as the first communication service manager, and the authentication service manager of the first terminal device will be referred to as the first authentication service manager.
[0130] The continuation application of the second terminal device is called the second continuation application, the continuation service SDK of the second terminal device is called the second continuation service SDK, the continuation service manager of the second terminal device is called the second continuation 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.
[0131] The implementation process of the application continuation method of the embodiment of the present application can be divided into four stages: the first stage is the initialization of the continuation application, the second stage is the registration and binding of the continuation application, the third stage is the display of the continuation notification, and the fourth stage is the acquisition and loading of the continuation data. Figure 6 Each stage is introduced separately.
[0132] Phase 1: Initialization.
[0133] The first continuation service manager of the first terminal device runs in the computer manager. The application is connected to the continuation service SDK as an independent process and runs in the third-party application. Therefore, the first continuation service manager needs to communicate with the first continuation application across processes. When the first continuation application of the first terminal device monitors some user behaviors, the first continuation application can call the initialization interface of the first continuation service SDK to apply for a communication channel that can be used for cross-process communication between the first continuation application and the first continuation service manager. After applying for the communication channel, the first continuation application can receive a successful initialization message returned by the first continuation service SDK.
[0134] The user behavior may be that the user clicks on the icon of the first continuation application to launch the first continuation application, or that the user performs editing and other operations in the first continuation application, or that the user clicks on the play button in the first continuation application to perform operations such as video playback, music playback or other media playback. The specific monitored user behavior may be customized by the continuation application, and the embodiments of the present application are not limited thereto.
[0135] When the first terminal device is the sending end of the application connection, the icon of the first connection application can be displayed on the desktop or task bar (or dock bar) of the first terminal device.
[0136] After receiving the initialization request, the first connection service SDK can read the shared memory to determine the unused bits in the shared memory. Figure 7 , the communication principle of shared memory is introduced.
[0137] Figure 7 Schematic diagram of a shared memory communication principle provided by an embodiment of the present application. Figure 7 As shown in the figure, shared memory is one of the ways of inter-process communication, allowing multiple processes to access the same memory. Process A and process B each have their own process control block (PCB) and address space, and each has a corresponding page table, which is responsible for mapping the virtual address of the process to the physical address and is managed by the memory management unit (MMU). Two different virtual addresses are mapped to the same area of the physical space through the page table, and the area they point to is the shared memory.
[0138] 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, namely shared memory, which can be seen by both process A and process B. In this way, inter-process communication can be achieved when one process performs a write operation and the other performs a read operation.
[0139] Figure 8 It is a schematic diagram of applying for a 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 values of each bit in the shared memory in sequence. 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 is not applied for or is not used, and the communication channel corresponding to the bit with the second preset value is applied for or has been used. Exemplarily, the first preset value can be "0" and the second preset value can be "1".
[0140] like Figure 8 As shown in a in FIG. 1 , the values of the first bit and the second bit in the shared memory area are "1", indicating that the communication channels corresponding to these two bits have been occupied by application A and application B.
[0141] like Figure 8 As shown in b, 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 of the shared memory area is "0", so the first connection service SDK can determine that the third bit is the target bit, and returns the bit empty position identifier n to the first connection service SDK, that is, returns the identifier of the third bit empty position. Among them, the bit empty position represents a bit with a value of "0".
[0142] Exemplarily, 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.
[0143] 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 used.
[0144] After receiving the bit position identifier n, the first connection service SDK calculates the communication ID according to the bit position identifier n, for example, communication ID=M+n×N, where M and N are preset values, and the value of N represents the number of message types supported by the applied communication channel.
[0145] 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 be used by the first connection service SDK, where N is a preset value. That is, the first connection service SDK can determine multiple communication channels based on the calculated communication ID, and the number of multiple communication channels is N. Each communication channel supports the transmission of a message category, such as: messages for registering connection services and callbacks, messages for unregistering connection services and callbacks, messages for broadcasting connection notifications, messages for communication reconnection, etc.
[0146] The following takes N=3, M=0 as an example to illustrate the communication ID.
[0147] For example, the connection service SDK of application A reads the shared memory and detects that the value of the first bit in the shared memory area is "0", and the identifier of the first bit is n = 1, so the identifier of the bit space returned by the shared memory to the connection service SDK of application A is the identifier of the first bit n = 1. The connection service SDK of application A calculates the communication ID as 3 based on the communication ID = M + n × N. The communication ID 3 corresponds to three communication channels, and the communication IDs of the three communication channels are 3, 4, and 5 respectively.
[0148] For example, the connection service SDK of application B reads the shared memory and detects that the value of the second bit in the shared memory area is "0", and the identifier of the second bit is n = 2. Therefore, the identifier of the bit space returned by the shared memory to the connection service SDK of application A is the identifier of the second bit n = 2. The connection service SDK of application B calculates the communication ID as 6 based on the communication ID = M + n × N. The communication ID 6 corresponds to three communication channels, and the communication IDs of the three communication channels are 6, 7, and 8 respectively.
[0149] Similarly, the connection service SDK of the first connection application (application C) calculates the communication ID as 9 according to the communication ID=M+n×N. The communication ID 9 corresponds to three communication channels, and the communication IDs of the three communication channels are 9, 10, and 11 respectively.
[0150] It should be understood that a predefined message type is transmitted on each of the multiple communication channels applied for by each application. For example, the communication channel identified by communication ID+1 is used to transmit the communication return message. That is, in the above example, application A can receive the communication return message through the communication channel identified by communication ID 4, application B can receive the communication return message through the communication channel identified by communication ID 7, and application C can receive the communication return message through the communication channel identified by communication ID 10.
[0151] After the first connection application receives the message of successful initialization, the first connection application may interact with the first connection service manager on the applied communication channel to execute the subsequent application connection process.
[0152] The second stage is to register and bind the subsequent application.
[0153] The first connection application can access the connection service by calling the registration interface of the first connection service SDK. It is understandable that the first connection application can carry information such as the package name and version number of the first connection application when registering the connection service.
[0154] In a possible implementation, the first connection service SDK can exchange data with other function managers through the first connection service manager. For example, the first connection service SDK can send a request for binding the connection service and applying the registration connection service to the first connection service manager through the communication channel identified by the communication ID 1. After receiving the request from the first 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 successful binding message from the first communication service manager.
[0155] After receiving the request for application registration of the connection service from 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 channel corresponding to the communication ID has been used.
[0156] Furthermore, the first connection service manager can bind the authentication service and perform application authentication by calling the 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 by exchanging data with the cloud authentication server. It can be understood that in the process of binding the authentication service, the cloud authentication server can obtain the user identification (UID) according to the package name of the first connection application, and then perform application authentication according to the UID. When the first authentication service manager successfully authenticates the first connection application, the cloud authentication server can store the application information such as the icon of the first connection application, and return the authentication result to the first connection service manager.
[0157] 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 result 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 result received by the first connection application is authentication failure, it means that the application registration fails and the application connection method will not be executed.
[0158] After the first connection service manager receives the authentication result of the first connection application 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 scheduled query on the status of the first connection application and sends a scheduled query message to the first connection service SDK. The status of the first connection application includes whether 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 regularly sends a keep-alive packet to the first connection service SDK, and successfully sending the keep-alive packet indicates that the process of the first connection application is still alive, and failing to send the keep-alive packet indicates that the process of the first connection application has exited.
[0159] 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-networking through Bluetooth or Wi-Fi, as well as account authentication. Furthermore, the first communication service manager can send information indicating that the second terminal device is online to the first connection service manager. For example, the information indicating that the second terminal device is online may include information such as the device identification (DevID) of the second terminal device.
[0160] After the first connection service manager receives the information sent by the first communication service manager indicating that the second terminal device is online, the information of the second terminal device can be stored and managed so as to execute the subsequent application connection process.
[0161] The third stage is the display of the follow-up notification.
[0162] When the first connection application is successfully registered, a broadcast connection notification 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 policy, and the connection content summary (such as the title). The first connection service manager may confirm the connectable device according to the connection policy of the first connection application.
[0163] Exemplarily, when the connection policy includes the device types supported by the application, for example, the connection policy includes that the first connection application can support the implementation of connection services on mobile phones, tablet computers, televisions, computers, etc., then when the first connection service manager confirms that the second terminal device is a mobile phone, tablet computer, television or computer, etc., the first connection service manager can instruct the first communication service manager and the second communication service manager to establish a session path.
[0164] Exemplarily, when the continuation policy includes a minimum version number or a minimum version, for example, the continuation policy includes that the first continuation application can support a minimum version number of A, or a minimum version of B, then when the first continuation service manager confirms that the version number of the second continuation application is greater than or equal to A, or the version of the second continuation application is greater than or equal to B, the first continuation service manager can instruct the first communication service manager and the second communication service manager to establish a session path.
[0165] A session path may be established between the first communication service manager and the second communication service manager to facilitate application connection-related message delivery and data transmission.
[0166] After the session path is successfully established, the first communication service manager can indicate to the first connection service manager that the channel is successfully established. The first connection service manager can, based on the broadcast connection notification sent by the first connection application, send a broadcast connection notification carrying information such as the package name of the first connection application and a summary of the connection content to the first communication service manager. The first communication service manager sends information such as the package name of the first connection application and a summary of the connection content to the second 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 a summary of the connection content to the second connection service manager.
[0167] 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 to bind and authenticate with the second authentication service manager. The implementation related to binding and authentication is similar to the authentication steps in the first terminal device, which will not be repeated here.
[0168] After the application authentication is successful, the second connection service manager may obtain the application icon through any possible implementation.
[0169] In a possible implementation, the second connection service manager can search whether the icon of the first connection application is stored locally in the second terminal device based on the 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 can obtain the icon of the first connection application and other related information through the cloud authentication server. Furthermore, 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.
[0170] In another possible implementation, the second connection service manager may obtain relevant information such as the icon of the first connection application through the cloud authentication server.
[0171] In another possible implementation, the second connection service manager can search for a second connection application with the same package name as the first connection application in the second terminal device. If the second connection application can be found, the second connection service manager can notify the desktop launcher to use the icon of the second connection application stored locally on the second terminal device to display the connection notification; if the second connection application is not found, the second connection service manager can obtain the icon and other related information of the first connection application by searching for 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 to display the connection notification.
[0172] It is understandable that when the desktop launcher controls the display of the continuation notification, the continuation notification can be displayed in the recent tasks, task bar, quick window or other interface entrance of the second terminal device, and the specific way of displaying the continuation notification is not limited by the embodiment of the present application. The continuation notification can be displayed in the form of a continuation application icon, or can be displayed by the application name, prompt or other forms, and the specific way of displaying the continuation notification is not limited by the embodiment of the present application.
[0173] The fourth stage is to obtain and load the subsequent data.
[0174] When the second terminal device receives the event that the user clicks the icon of the continuation application, in a possible implementation, if the second continuation application is not installed in the second terminal device, the second terminal device may prompt the user to install the second continuation application. The specific method of prompting the user to install the application is not limited in the embodiment of the present application. If the second continuation application is already installed in the second terminal device, or the installation of the second continuation application is completed based on the prompt, the following steps may be performed.
[0175] The second connection service manager can pull up the second connection application and instruct the second connection application to load the transition animation effect, so that the second connection application can start and load the transition animation effect, and the transition animation effect can include prompt information such as "loading...". Further, the second connection application can access the connection service by calling the registration interface of the second connection service SDK. It is understandable that the second connection application can carry information such as the package name of the second connection application when registering the connection service.
[0176] The second connection service SDK may 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 may send a request to bind the communication service to the second communication service manager. 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 message to register the connection service to the second connection service manager. After the second connection service manager is successfully registered, the registration success message may be returned to the second connection application through the second connection service SDK.
[0177] During the startup of the second continuation application, the second continuation service manager can also send request continuation data to the first continuation service manager through the session path established between the first terminal device and the second terminal device. When the first continuation service manager receives the request continuation data, it can report the request continuation data to the first continuation application through the first continuation service SDK. The first continuation application can package and encrypt related continuation data such as the continuation content, and send the continuation data to the first continuation service manager through the first continuation service SDK. The first continuation service manager can send the continuation data to the second continuation service manager through the session path established between the first terminal device and the second terminal device.
[0178] Furthermore, the second continuation service manager notifies the second continuation application of the continuation data through the second continuation service SDK. After successful registration, the second continuation application can load the continuation data and control the second terminal device to display the continuation data, and transmit information indicating the successful continuation to the first continuation application of the first terminal device, so that the first continuation application can execute processes such as exiting the page of the first continuation application.
[0179] During the execution of the stages described above, the following scenarios may occur.
[0180] Scenario 1: The first subsequent application exits normally.
[0181] Exemplarily, the first continuation application can exit after receiving the notification of successful continuation. In this scenario, the first continuation application can deregister by calling the application deregistration interface of the first continuation service SDK. The first continuation service SDK sends an application deregistration request to the first continuation service manager through the applied communication channel. After receiving the request of the first continuation service SDK, the first continuation service manager can notify the first channel service manager that the application has exited, and the first channel service manager stops the scheduled query of the first continuation application and cleans up the occupied bits in the shared memory. For example, when applying for a communication channel, the first continuation service SDK modifies the value of the third bit of the shared memory area to "1". Therefore, when cleaning, the first channel service manager modifies the value of the third bit of the shared memory area to "0", indicating that the communication channel corresponding to the third bit is not used or applied for, and can be applied for by other applications. This is conducive to efficient use of limited IPC communication resources and improving the utilization rate of communication resources.
[0182] Furthermore, the first channel service manager notifies the first connection service manager that the application is disconnected successfully. After receiving the message of successful application disconnection, the first connection service manager sends a message of successful deregistration to the first connection application through the first connection service SDK.
[0183] Scenario 2: The first subsequent application exits abnormally.
[0184] For example, the first connection application may exit abnormally due to a freeze or the user forcibly stops the application in the background task manager. In this scenario, the first channel service manager cannot successfully send a keep-alive packet to the first connection service SDK, and the first connection service SDK does not unregister with the first connection service manager, causing the first connection application to occupy the communication channel all the time. In the case of limited IPC communication resources, other applications may not be able to apply for available communication channels in time, resulting in a waste of communication resources.
[0185] In the 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 of the first connection application and clears the occupied bits in the shared memory, which helps to avoid wasting communication resources.
[0186] Scenario 3: The first connection application is started before the first connection service manager.
[0187] 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 a 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. Exemplarily, the user can manually open the computer manager to start the first connection service manager. During the startup of the first connection service manager, the first connection service manager sends a communication back-connection message on all communication channels in the shared memory that can be used to transmit the communication back-connection message.
[0188] For example, the first continuation service SDK receives a communication return connection message broadcast by the first continuation service manager on the communication channel identified by the communication ID+1. If the first continuation application has a need for application continuation across devices, the first continuation application can determine to start the registration and binding of the continuation application. The first continuation service manager maintains the data in the shared memory area in the most recent state based on the communication ID of the return communication channel.
[0189] Scenario 4: The first connection service manager exits abnormally.
[0190] The processing flow in this scenario is similar to that in scenario 3 and will not be repeated here.
[0191] Combination of the above Figure 6 The first terminal device is described as a sending end and the second terminal device is described as a receiving end. The following describes the internal interaction process of the first terminal device as a receiving end and the second terminal device as a sending end. The first terminal device may have the following Figure 3 and Figure 5 The structure shown in FIG. 1 may include the following: Figure 3 and Figure 4 The structure shown.
[0192] The premise for the first terminal device to act as a 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 the application connection process related to device self-discovery and self-organizing network.
[0193] Similar to the internal interaction when the first terminal device is the sending end, the second terminal device can execute the above-mentioned process after the second stage when it is the sending end. Figure 4 Under the hierarchical architecture, there is no cross-process communication between the second connection service SDK in the second terminal device and the second connection service manager, so the second connection service SDK does not need to apply for a communication channel in the shared memory.
[0194] 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 channel with the first communication service manager of the first terminal device. The specific process can refer to the above for Figure 6 The description is not repeated 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.
[0195] When the first terminal device is the receiving end of the application connection, the icon of the first connection application can be displayed in the task bar (or dock bar) of the first terminal device.
[0196] When the first terminal device receives the event that the user clicks on the continuation application icon, if the first continuation application has been installed in the first terminal device and the first continuation application has not been started, the first continuation service manager pulls up the first continuation application and instructs the first continuation application to load the transition animation effect. The first continuation application can then be started and load the transition animation effect.
[0197] Furthermore, the first terminal device may execute Figure 6 The initialization phase and the subsequent application registration and binding phases are similar to the process, which will not be repeated here.
[0198] During the process of starting the first connection application, the first connection service manager can request connection data from the second connection service manager through the session path established between the first terminal device and the second terminal device. Figure 6 The description is not repeated here.
[0199] 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, if the communication channel identified by the communication ID+2 among the N communication channels corresponding to the communication ID is used to transmit the connection data, the first connection service manager can send the connection data to the first connection application on the communication channel identified by the communication ID+2.
[0200] Based on the above description of the internal interaction process of the application connection, Fig. 9 As shown, the embodiment of the present application provides a method 900 for application continuity, which can be executed by a terminal device. The terminal device can have Figure 3 and Figure 5 The structure shown in the figure is not limited to this in the embodiment of the present application. The terminal device is installed with a first application and a computer manager. The terminal device corresponds to the above-mentioned first terminal device and can be used as a sending end of the application connection or as a receiving end of the application connection. Method 900 includes the following steps:
[0201] S901, in response to a user clicking on an icon of a first application, obtaining an identifier of a target bit in a shared memory, where the target bit is a bit whose value is a first preset value, and the first preset value indicates that a communication channel corresponding to the target bit is not in use.
[0202] In this step, the first application can be the above-mentioned first succession application. Exemplarily, the first preset value is "0". If the value of the first bit in the shared memory is "0", the first bit is the target bit, and the terminal device can obtain the identifier of the first bit n=1; if the value of the first bit in the shared memory is "1" and the value of the second bit is "0", the second bit is the target bit, and the terminal device can obtain the identifier of the second bit n=2.
[0203] S902, based on the identifier of the target bit, determine a communication identifier corresponding to the target bit, where the communication identifier indicates at least one communication channel used for communication between the first application and the computer manager.
[0204] Combined with the above description, after obtaining the identifier of the target bit, the terminal device 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, so that the terminal device applies for the IPC communication resources that can be used to communicate with the computer manager for the first application. The specific description of the communication channel can be found above and will not be repeated here.
[0205] S903, realizing data transmission between the first application and the computer manager based on the at least one communication channel.
[0206] In this step, the data transmission between the first application and the computer manager may include the registration and continuation service and callback, broadcast continuation notification, request continuation data, application deregistration, broadcast communication reconnection message, etc. described above.
[0207] In an embodiment of the present application, the terminal device can combine IPC communication with shared memory to flexibly allocate IPC communication resources for at least one application that accesses the connection service in the computer manager to achieve communication between the application and the connection service in the computer manager.
[0208] It should be understood that the sequence numbers of the above processes do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0209] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0210] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0211] In the several embodiments provided in the present 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 schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0212] 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 distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0213] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0214] 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 can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0215] The above is only a specific implementation of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the embodiments of the present application, which should be included in the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be based on the protection scope of the claims.
Claims
1. A data transmission method, characterized in that: Applied to a first terminal device, the first terminal device is installed with a first application and a computer manager, the method includes: In response to a user clicking on the icon of the first application, obtaining an identifier of a target bit in the shared memory, where the target bit is a bit whose value is a first preset value, where the first preset value indicates that a communication channel corresponding to the target bit is not in use; Based on the identifier of the target bit, determining a communication identifier corresponding to the target bit, wherein the communication identifier indicates at least one communication channel for communication between the first application and the computer manager; After registering for the connection service through the first communication channel of the at least one communication channel, establishing a session path with the second terminal device; The data of the first application is sent to the second terminal device through the session path.
2. The method according to claim 1, characterized in that The method further comprises: Based on obtaining the identifier of the target bit, the value of the target bit is modified from the first preset value to a second preset value, where the second preset value indicates that the communication channel corresponding to the target bit has been used.
3. The method according to claim 2, characterized in that The method further comprises: When the process of the first application exits, the value of the target bit is modified from the second preset value to the first preset value.
4. The method according to claim 3, characterized in that The method further comprises: deregistering the connection service based on a second communication channel of the at least one communication channel; Based on the deregistration of the connection service, it is determined that the process of the first application is to exit.
5. The method according to claim 4, characterized in that The method further comprises: After successfully registering the connection service, periodically query whether the process of the first application has exited.
6. The method according to claim 2, characterized in that In the case where the first application is started before the computer manager, or the process of the computer manager exits abnormally, the method further includes: Broadcasting a communication reconnection message, wherein the communication reconnection message is used to instruct the first application to connect to the computer manager; In a case where the communication reconnection message is received based on a third communication channel among the at least one communication channel, the connection service is registered through the first communication channel.
7. The method according to any one of claims 1 to 6, characterized in that The step of obtaining, in response to the user clicking on the icon of the first application, an identifier of a target bit in the shared memory includes: In response to a user clicking on the icon of the first application located on the desktop or taskbar of the first terminal device, an identifier of the target bit in the shared memory is obtained.
8. A terminal device, characterized in that: Comprising modules for executing the method as claimed in any one of claims 1 to 7.
9. A terminal device, characterized in that: include: processor and memory, wherein The memory is used to store computer programs; The processor is configured to call and execute the computer program so that the terminal device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on the terminal device, the terminal device executes the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product includes a computer program code, and when the computer program code is executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Cross-environment communication framework
CN103262057A
Cross-process communication method, device and equipment
CN110569130A
Application continuing method and device
CN114924671A
Application triggered state migration via hypervisor
US20120054409A1
