Method for applying a joint and terminal device

By obtaining the bit identifier in the shared memory on the PC side, an IPC communication channel is allocated to the application, which solves the resource allocation problem when multiple applications access the connection framework at the same time, and realizes flexible allocation of IPC communication resources and efficient data transmission.

CN119166381BActive Publication Date: 2025-12-09HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411003271.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2025-12-09
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

How to allocate IPC communication resources for multiple applications on the PC side to enable communication between the applications and the connection service in PC Manager, especially when multiple applications access the connection framework at the same time, how to flexibly allocate limited IPC communication resources.

Method used

By obtaining the identifier of the target bit in shared memory, determining the communication identifier based on the identifier, allocating an IPC communication channel for the application, and releasing the channel when the application process exits, flexible allocation of IPC communication resources is achieved.

Benefits of technology

It improves the utilization rate of IPC communication resources and ensures convenient and efficient data transmission for multiple applications in connection scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166381B_ABST
    Figure CN119166381B_ABST
Patent Text Reader

Abstract

The application provides a method and a terminal device for application connection, which is beneficial to flexibly allocate communication resources for the terminal device to realize communication between an application and a connection service in a computer manager. The method comprises the following steps: in response to an operation of a user clicking an icon of a first application, obtaining an identification of a target bit in a shared memory, the target bit being a bit with a first preset value, the first preset value indicating that a communication channel corresponding to the target bit is not used; determining a communication identifier corresponding to the target bit based on the identification 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 realizing data transmission between the first application and the computer manager based on the at least one communication channel.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application No. 202211197093.2, filed on September 28, 2022, entitled "Method and terminal device for application continuation", the whole content of the original application is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the field of terminal, in particular to a method and terminal device for application continuation. BACKGROUND

[0003] At present, application continuation between devices will become an important function in subsequent multi-device scenarios. The application continuation can be understood as when a user uses a certain application on a personal computer (PC), the user can continue to use the application in a mobile phone that meets the continuation condition and continue to use the application on the mobile phone.

[0004] For the PC in the application continuation scenario, in order to meet the needs of synchronizing the use state of the application to other devices or synchronizing the use state of the application of other devices to the PC, the PC needs to provide a continuation framework and a software development kit (SDK) to meet this need. The continuation framework provides a unified application state synchronization framework for applications. Applications need to access the continuation framework through the SDK to realize data transmission with the continuation service in the continuation framework, and the continuation service provides external service capabilities for applications relying on the computer manager. After the application and the computer manager in the PC are started, the application and the 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 for the application on the PC side to realize communication between the application and the continuation service in the computer manager is a problem to be solved. SUMMARY

[0006] The present application provides a method and terminal device for application continuation, which is beneficial to flexibly allocate IPC communication resources for the terminal device to realize communication between the application and the continuation service in the computer manager.

[0007] In a first aspect, a method for application connection is provided. The method is applied to a terminal device, which is a sending end or a receiving end of the application connection. The terminal device is installed with a first application and a computer manager. The method comprises: in response to an operation of a user clicking an icon of the first application, obtaining an identifier of a target bit in a shared memory. The target bit is a bit with a first preset value, and the first preset value indicates that a communication channel corresponding to the target bit is not used. Based on the identifier of the target bit, a communication identifier corresponding to the target bit is determined. The communication identifier indicates at least one communication channel used for communication between the first application and the computer manager. Based on the at least one communication channel, data transmission between the first application and the computer manager is implemented.

[0008] In this application, a connection service manager (hereinafter also referred to as a connection service for short) is integrated in the computer manager. The communication between the first application and the computer manager includes communication between a connection service SDK of the first application and the connection service in the computer manager. After the first application and the computer manager are started, the connection service runs in the computer manager, and the first application runs in a third-party application after accessing the SDK as an independent process. Therefore, the first application needs to perform cross-process communication with the connection service in the computer manager through the connection service SDK.

[0009] In some scenarios, there can be at least one application accessing the connection service to implement application connection. In this scenario, the computer manager needs to have the ability to communicate with all applications accessing the connection service through IPC. In the technical solution provided in this application, for the first application in the at least one application accessing the connection service, the terminal device can obtain an identifier of a target bit in a shared memory, obtain a corresponding communication identifier based on the identifier of the target bit, allocate at least one communication channel corresponding to the communication identifier to the first application, and enable the first application to communicate with the connection service in the computer manager through an IPC communication resource. In this way, by combining the IPC communication and the shared memory, the terminal device can flexibly allocate the IPC communication resource to all applications accessing the connection service, and implement data transmission between the applications and the computer manager in the application connection scenario.

[0010] In combination with the first aspect, in some implementations of the first aspect, the method further comprises: based on the obtaining of the identifier of the target bit, modifying the value of the target bit from the first preset value to a second preset value. The second preset value indicates that the communication channel corresponding to the target bit is 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 identify that the communication channel corresponding to the target bit has been applied or has been used. In this way, when a new application accesses the continuation service, the terminal device can apply 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, the terminal device can detect the values of the plurality of bits in the shared memory in response to the operation of the user clicking the icon of the first application, and determine a target bit with the first preset value in the plurality of bits. After determining the target bit, the terminal device can obtain the identifier of the target bit. Moreover, after determining the target bit, the terminal device can modify the value of the target bit from the first preset value to the second preset value. The order of obtaining the identifier of the target bit and modifying the value of the target bit from the first preset value to the second preset value is not limited.

[0013] With reference to the first aspect, in some implementations of the first aspect, the data transmission between the first application and the computer manager is implemented based on the at least one communication channel, including: registering the continuation service and the callback based on a first communication channel in the at least one communication channel.

[0014] In the present application, each communication channel in the at least one communication channel allocated by the terminal device for the first application can be used to transmit different types of messages. The first communication channel is used for the first application to register the continuation service and the callback. In this way, the data transmission in the application continuation scenario is more convenient and efficient.

[0015] With reference to the first aspect, in some implementations of the first aspect, the method further includes: in the case where 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 of the first application exits, including two cases of 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, thereby releasing the communication channel occupied by the first application. In the case where the IPC communication resources are limited, other applications can use the communication channel corresponding to the target bit, thereby improving the resource utilization rate.

[0017] With reference to the first aspect, in some implementations of the first aspect, the method further includes: based on a second communication channel in the at least one communication channel, deregistering the continuation service and the callback; and based on the deregistration of the continuation service and the callback, determining that the process of the first application exits.

[0018] In the present application, in the case that the first application normally exits, the terminal device can deregister the connection service and the callback through the second communication channel allocated for the first application. After the connection service in the terminal device receives the message of deregistering the connection service and the callback, it can be determined that the process of the first application normally exits, and then the terminal device can release the communication channel allocated for the first application.

[0019] With reference to the first aspect, in some implementations of the first aspect, the method further includes: after successfully registering the connection service and the callback, querying whether the process of the first application exits in a timely manner.

[0020] In the present application, the terminal device queries whether the process of the first application exits in a timely manner, so as to timely monitor the state of the process of the first application.

[0021] Exemplarily, the terminal device sends a keep-alive packet to the first application in a timely manner 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 abnormally exits, the computer manager cannot successfully send the keep-alive packet. The terminal device determines whether the process of the first application has exited according to whether the computer manager successfully sends the keep-alive packet.

[0022] With reference to the first aspect, in some implementations of the first aspect, the terminal device is a sending end of the application connection; in the case that the first application starts before the computer manager or the process of the computer manager abnormally exits, the method further includes: broadcasting a communication reconnection message, the communication reconnection message being used to indicate that the first application connects the computer manager. Registering the connection service and the callback based on the first communication channel in the at least one communication channel includes: in the case that the communication reconnection message is received based on the third communication channel in the at least one communication channel, registering the connection service and the callback based on the first communication channel.

[0023] In the present application, the connection service of the computer manager can broadcast a communication reconnection message in the process of starting. After the first application receives the communication reconnection message based on the third communication channel, it can be determined that the computer manager has started and can be normally connected. Therefore, the first application can register the connection service and the callback based on the first communication channel.

[0024] With reference to the first aspect, in some implementations of the first aspect, the terminal device is a receiving end of the application connection; and the operation of acquiring the identification of the target bit in the shared memory in response to the user clicking the icon of the first application includes: the operation of acquiring the identification of the target bit in the shared memory in response to the user clicking the icon of the first application located in the task bar of the terminal device.

[0025] In the present application, as the application connection receiving end, the task bar of the terminal device can display a connection notification, and the connection notification can be displayed in the form of an icon of the first application on the task bar. In this way, the user can click the icon of the first application in the task bar to start the first application on the terminal device as the receiving end, and then apply for a communication channel for communication with the computer manager for the first application, so that the first application connects the connection data of the first application on the other device, such as the editing content of the memo, audio data, etc.

[0026] In combination with the first aspect, in some implementations of the first aspect, the terminal device is a sending end of the application connection; in response to the operation of the user clicking the icon of the first application, the identification of the target bit in the shared memory is obtained, including: in response to the operation of the user clicking the icon of the first application on the desktop or the task bar of the terminal device, the identification 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 the task bar. After the user clicks (for example, double-clicks) the icon of the first application on the desktop or the task bar, the terminal device can start the first application on the terminal device as the sending end, and perform corresponding operations in the first application, such as editing a memo, playing music, etc.

[0028] The second aspect provides a terminal device, including an obtaining module and a processing module for executing the method in any possible implementation of the first aspect.

[0029] The obtaining module is configured to: in response to the operation of the user clicking the icon of the first application, obtain the identification of the target bit in the shared memory, the target bit being a bit with a first preset value, and the first preset value indicating that the communication channel corresponding to the target bit is not used. The processing module is configured to: based on the identification of the target bit, determine the communication identification corresponding to the target bit, the communication identification indicating at least one communication channel for communication between the first application and the computer manager; and based on the at least one communication channel, realize data transmission between the first application and the computer manager.

[0030] In combination with the second aspect, in some implementations of the second aspect, the processing module is configured to: based on the obtaining of the identification of the target bit, modify the value of the target bit from the first preset value to a second preset value, and the second preset value indicating that the communication channel corresponding to the target bit is used.

[0031] In combination with the second aspect, in some implementations of the second aspect, the processing module is configured to: based on a first communication channel in the at least one communication channel, register a connection service and a callback.

[0032] With reference to the second aspect, in some implementations of the second aspect, the processing module is configured to modify the value of the target bit from the second preset value to the first preset value in a case where the process of the first application exits.

[0033] With reference to the second aspect, in some implementations of the second aspect, the processing module is configured to deregister the connection service and the callback based on a second communication channel of the at least one communication channel, and determine that the process of the first application exits based on the deregistration of the connection service and the callback.

[0034] With reference to the second aspect, in some implementations of the second aspect, the processing module is configured to query whether the process of the first application exits after the successful registration of the connection service and the callback.

[0035] With reference to the second aspect, in some implementations of the second aspect, the terminal device is a sending end of the application connection. In a case where the first application is started prior to the computer manager or the process of the computer manager abnormally exits, the processing module is configured to broadcast a communication reconnection message, the communication reconnection message being configured to instruct the first application to connect to the computer manager, and register the connection service and the callback based on a first communication channel in a case where the communication reconnection message is received based on a third communication channel of the at least one communication channel.

[0036] With reference to 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 configured to obtain the identification of the target bit in the shared memory in response to an operation of a user clicking an icon of the first application located in a task bar of the terminal device.

[0037] With reference to 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 configured to obtain the identification of the target bit in the shared memory in response to an operation of a user clicking an icon of the first application located in a desktop or a task bar of the terminal device.

[0038] In a third aspect, another terminal device is provided, including a processor and a memory, the processor being coupled with the memory, the memory being configured to store a computer program, and the processor being configured to invoke and execute the computer program in the memory to implement the method in any possible implementation manner of the first aspect.

[0039] In a fourth aspect, a processor is provided, including an input circuit, an output circuit and a processing circuit. The processing circuit is configured 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 manner of the first aspect.

[0040] In the implementation process, the processor can be a chip, the input circuit can be an input pin, the output circuit can be an output pin, and the processing circuit can be a transistor, a gate circuit, a flip-flop, and various logic circuits. The input signal received by the input circuit can be received and input by, for example but not limited to, a receiver, the output signal output by the output circuit can be output to and transmitted by, for example but not limited to, a transmitter, and the input circuit and the output circuit can be the same circuit which is used as the input circuit and the output circuit at different times. The specific implementation of the processor and various circuits is not limited in the present application.

[0041] In a fifth aspect, a processing apparatus is provided, including a processor and a memory. The processor is configured to read instructions stored in the memory, and can receive signals through a receiver and transmit signals through a transmitter to perform the method in any possible implementation manner of the first aspect.

[0042] Optionally, the processor is one or more, and the memory is one or more.

[0043] Optionally, the memory can be integrated with the processor, or the memory and the processor are separately arranged.

[0044] In the implementation process, the memory can be a non-transitory memory, for example, a read only memory (ROM), which can be integrated on the same chip with the processor, or arranged on different chips respectively. The type of the memory and the arrangement of the memory and the processor are not limited in the present application.

[0045] It should be understood that the related data interaction process, for example, the process of transmitting the indication information, can be the process of outputting the indication information from the processor, and the process of receiving the capability information can be the process of receiving the input capability information by the processor. Specifically, the processed output data can be output to the transmitter, and the input data received by the processor can come from the receiver. The transmitter and the receiver can be collectively referred to as a transceiver.

[0046] The processing apparatus in the above-mentioned fifth aspect can be a chip, and the processor can be implemented by hardware or software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor which is implemented by reading software codes stored in the memory. The memory can be integrated in the processor or exist independently.

[0047] In a sixth aspect, a computer program product is provided, which comprises computer program codes, when the computer program codes are run, causing a computer to execute the method in any possible implementation manner of the first aspect.

[0048] In a seventh aspect, a computer readable storage medium is provided, which stores a computer program, when the computer program is run, causing a computer to execute the method in any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0049] Figure 1 is a scene schematic diagram provided by an embodiment of the present application;

[0050] Figure 2 is an interface schematic diagram of application connection provided by an embodiment of the present application;

[0051] Figure 3 is a structural schematic diagram of a terminal device to which an embodiment of the present application is applicable;

[0052] Figure 4 is a software structure block diagram of a terminal device to which an embodiment of the present application is applicable;

[0053] Figure 5 is another software structure block diagram of a terminal device to which an embodiment of the present application is applicable;

[0054] Figure 6 is a schematic flow chart of an application connection method provided by an embodiment of the present application;

[0055] Figure 7 is a schematic diagram of a shared memory communication principle provided by an embodiment of the present application;

[0056] Figure 8 is a schematic diagram of an application communication channel provided by an embodiment of the present application;

[0057] Figure 9 is a schematic flow chart of a method for application connection provided by an embodiment of the present application. DETAILED DESCRIPTION

[0058] The technical solutions in the present application will be described below with reference to the drawings.

[0059] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced as follows:

[0060] 1. Connection strategy: The connection strategy is used to determine connectable devices, and each application program can correspond to a respective connection strategy. For example, the connection strategy of an application program can be related to one or more of the following fields:

[0061] For example, the application program supports the device type, the connectable application package name of the Android platform, the connectable process name of the Windows platform, the browser startup parameter, the minimum version number of the support connection application, and the minimum version.

[0062] The connection strategy can correspond to a flag bit used to identify the state of the connection strategy. For example, a flag bit of 0 can represent that connection is not supported, a flag bit of 1 can represent that application connection is supported, and a flag bit of 3 can represent that browser connection is supported. It can be understood that the specific value of the flag bit can be set arbitrarily, as long as different states can be distinguished, and the embodiments of the present application are not limited in this regard.

[0063] 2. Other terms

[0064] In the embodiments of the present application, the same items or similar items with basically the same functions and effects are distinguished by using "first", "second", and the like. For example, the first terminal device and the second terminal device are used to distinguish different terminal devices, and do not limit the order. Those skilled in the art can understand that "first", "second", and the like do not limit the number and execution order, and "first", "second", and the like do not necessarily mean different.

[0065] It should be noted that in the embodiments of the present application, the words "exemplarily" or "for example" are used to represent an example, illustration or description. Any embodiment or design scheme described as "exemplarily" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words "exemplarily" or "for example" are used to present the relevant concept in a specific manner.

[0066] In addition, "at least one" means one or more, and "multiple" means two or more. The association relationship between the associated objects is described, which means that there can be three relationships, for example, A and / or B, which means that A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or the like means any combination of these items, including single or multiple combinations. 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, and c can be single or multiple.

[0067] With the development of terminal technology, users often need to switch content among multiple terminal devices. For example, when a user edits content in a memo on a mobile phone, the user may want to continue editing the content in the memo on a tablet computer or other device with a larger screen.

[0068] In the above scenario of switching content from a mobile phone to a tablet computer, when the user wants to continue editing the memo content edited on the mobile phone before switching to the tablet computer, the user usually needs to find and open the memo on the tablet computer, re-edit the memo content on the mobile phone, or copy the memo content on the mobile phone to the tablet computer through a medium, such as a chat tool or a USB flash disk, and then paste the content to the tablet computer. However, the above operations make the content switching process between devices cumbersome and time-consuming.

[0069] The continuous development of terminal technology drives the possibility of interconnection and interworking between devices, and cross-device application continuation will become an important function in subsequent multi-device scenarios. The application continuation can be understood as follows: when a user uses an application on a device A, the user can continue using the application on a device B that meets the continuation condition. This way makes the content switching between devices more simple and efficient.

[0070] Figure 1 is a scenario schematic diagram provided by an embodiment of the present application. The scenario shows a personal computer (PC) and a mobile phone. The PC uses a Windows system, and the mobile phone uses an Android system. The user can use the mobile phone to continue the content presented by the application on the PC, or use the PC to continue the content presented by the application on the mobile phone.

[0071] Optionally, the scenario can further include more terminal devices, such as a large screen and a tablet computer. For example, the user can use at least one of the mobile phone, the large screen, and the tablet computer to continue the content presented by the application on the PC.

[0072] The following will be described in combination with Figure 2 For example, the user edits text by using a memo on the PC, and the user wants to continue editing the text in the memo by using the mobile phone.

[0073] Figure 2 is an interface schematic diagram of application continuation provided by an embodiment of the present application.

[0074] Referring to the A interface in Figure 2 When the user opens the memo on the PC and edits the content, the PC broadcasts a continuation notification to the outside, and the mobile phone receives the continuation notification, as shown in Figure 2In interface B, the phone notifies the user of available tasks via the dock (or multitasking center). The dock can be a fixed area at the bottom of the screen on a phone, PC, or other device, where users can place frequently used applications. If the user needs to switch devices to continue editing, they can tap the continuation notification on the phone's dock to open the Notes app and continue the application. See also... Figure 2 The C interface in the phone's notes app continues the content previously edited on the PC, with the cursor position showing where the cursor was on the PC before the continuation. Users can continue editing content on their phones.

[0075] It should be noted that, Figure 2 The PC and mobile phone shown belong to the same trust ring. Belonging to the same trust ring can be understood as the devices logging into the same device account, the distance between the devices meeting a certain threshold, and both devices having Bluetooth or Wireless Fidelity (Wi-Fi) enabled. Among them, the device account can be used for device authentication when the devices connect; Bluetooth or Wi-Fi can be used for device discovery and connection.

[0076] When a user edits notes on their PC, a phone belonging to the same trust ring can prompt the user to continue the application. When the user confirms the application continuation on their phone, the notes app on the phone can retrieve and load the notes data from the PC, allowing the user to continue editing the notes on their phone. This provides a continuation service, reduces the complexity of cross-device application continuation, and improves the user experience.

[0077] and Figure 2 Similar scenarios could include: continuing to display a portable document format (PDF) opened on a mobile phone on a tablet; continuing to play a video playing on a tablet on a mobile phone; or continuing to play music playing on a PC on a mobile phone.

[0078] For PCs in application continuity scenarios, to achieve the need to synchronize application usage status to other devices or vice versa, the PC needs to provide a continuity framework and a software development kit (SDK) to meet this requirement. The continuity framework provides a unified application status synchronization framework for applications. Applications need to connect to the continuity framework via the SDK to achieve data transmission with the continuity services within the framework. The continuity service, relying on PC Manager, provides external service capabilities to applications.

[0079] It should be understood that after the application and the continuation service are started, the application and the continuation service are in two different processes, and thus the application needs to communicate with the continuation service through inter process communication (IPC).

[0080] However, if multiple applications simultaneously access the continuation framework and communicate with the continuation service through the computer manager, too many IPC communication resources will be occupied. The IPC communication resources provided by the continuation framework integrated in the PC for the applications are limited, and thus how to flexibly allocate the IPC communication resources for multiple applications is a problem to be solved in the case of too many applications accessing the application.

[0081] Embodiments of the present application take the continuation application as the general term of the application with the continuation function, and the types of the continuation application can include: editing application (or document application / office application), browsing application, audio and video entertainment application (or multimedia playing application), etc. It should be understood that the applications occupying the IPC communication resources of the computer manager are not all the continuation applications, for example, some security protection applications and engine applications also occupy the IPC communication resources of the computer manager.

[0082] Therefore, embodiments of the present application provide an application continuation method, when multiple applications simultaneously access the continuation framework and communicate with the continuation service through the computer manager of the PC, the PC can apply for an address in the shared memory for each application, allocates communication resources for each application based on the applied address of the shared memory, and the application can access the continuation service and perform data transmission with the continuation service based on the communication resources.

[0083] Figure 3 is a structural schematic diagram of a terminal device to which embodiments of the present application are applicable.

[0084] The terminal device can 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 loudspeaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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, and the like.

[0085] It can be understood that the structure shown 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 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0086] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (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), and the like. Different processing units can be independent devices, or can be integrated into one or more processors.

[0087] The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching instructions and executing instructions.

[0088] The processor 110 can also include memory that stores instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The cache memory can hold instructions or data that the processor 110 has recently used or is likely to use again. If the processor 110 needs to use that instruction or data again, it can be retrieved directly from the cache memory. This avoids repeated accesses to the main memory, reducing the latency of the processor 110 and thus improving the efficiency of the system.

[0089] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can 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 can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the terminal device. In some other embodiments of the present application, the terminal device can also use different interface connection modes or combinations of multiple interface connection modes in the above embodiments.

[0091] The terminal device can realize the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can 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 the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.

[0093] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external storage card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card.

[0094] Internal memory 121 can be used to store computer executable program code, including instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the terminal device (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of the terminal device by running instructions stored in internal memory 121 and / or instructions stored in memory disposed in the processor. For example, it may execute the application continuation method of the embodiments of this application.

[0095] The terminal device of this application can function as either a sender or a receiver. The software system of the terminal device can employ a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. (This application's embodiments...) Figure 4 Taking the layered architecture of the Android system as an example, the software structure of the terminal device in the embodiments of this application is illustrated.

[0096] like Figure 4 As shown, the layered architecture divides the software into several layers, each with a clear role and function. 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: the application layer, the application framework layer, the Android runtime and system libraries, the hardware abstraction layer (HAL), and the kernel layer.

[0097] The application layer can include a series of application packages. For example... Figure 4As shown, the application package can include three-party applications, a continuation service SDK, Bluetooth, Wi-Fi, memo, video, game, and other applications. For example, in the application layer, the continuation application can access the continuation service SDK, and the continuation application can be a system application in the terminal device or a three-party application. The memo, video, game, and other applications can also be system applications or three-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 pre-defined functions.

[0099] As shown, Figure 4 The application framework layer can include a continuation 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. In some application scenarios, the managers can also be referred to as modules.

[0100] The continuation service manager can be responsible for the management of the continuation task, provide the continuation service for the continuation application, 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 the continuation application, the authentication of the continuation application, the icon management of the continuation application, and the transmission of the continuation data between devices.

[0101] The communication service manager can be used to implement the data transmission between devices. For example, in the embodiment of the present application, the communication service manager can implement the security authentication and account authentication of the same account device, the self-discovery and ad hoc network of the device, the data transmission between devices, and the access of the communication service.

[0102] The authentication service manager can be responsible for the legality verification of the application. For example, in the embodiment of the present application, the application can be allowed to access the continuation service after the authentication service manager verifies.

[0103] The notification manager enables the application program to display notification information in the status bar, and can be used to convey the message of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the download completion, message reminder, and the like. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the top status bar of the system, such as the notification of the background running application, and can also be a notification in the form of a dialogue window appearing on the screen. For example, the terminal device vibrates, the indicator light flashes, and the like. For example, in the embodiment of the present application, when the terminal device receives the continuation notification, the notification manager can display the continuation notification in the task bar.

[0104] The window manager is used to manage windows programs. The window manager can acquire the size of a display screen, determine whether there is a status bar, a lock screen, a touch screen, a drag screen, a screen capture, and the like.

[0105] The resource manager provides various resources for an application program, such as localized strings, icons, pictures, layout files, video files, and the like.

[0106] The content provider is used to implement a data sharing function between different application programs, allows one program to access data in another program, and also ensures the security of the accessed data.

[0107] The view system can be responsible for interface drawing and event processing of an application program. For example, in an embodiment of the present application, the view system can be used to process event processing after a user clicks a notification icon of a connected application.

[0108] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and management of the Android system.

[0109] The core library includes two parts: one part is a function function that needs to be called by the java language, and the other part is the core library of the Android.

[0110] The application program layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application program layer and the application framework layer into binary files. The virtual machine is used to perform functions such as management of the object life cycle, stack management, thread management, security and exception management, and garbage collection.

[0111] The system library can include multiple functional modules. For example: media libraries, function libraries, and graphics processing libraries (such as OpenGL ES).

[0112] The media library supports playback and recording of a variety of commonly used audio, video formats, and static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, and the like.

[0113] The function library provides API interfaces for various services for developers, facilitating developers to quickly integrate and implement various functions.

[0114] The graphics processing library is used to implement functions such as graphics drawing, image rendering, synthesis, and layer processing.

[0115] The hardware abstraction layer is an abstracted layer between the kernel layer and the Android runtime. The hardware abstraction layer can be a package of hardware drivers, providing a unified interface for the upper layer application to call. The hardware abstraction layer can include a Bluetooth module, a Wi-Fi module, a hardware configuration module, etc. For example, in the 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 realize the Bluetooth function and the Wi-Fi function by calling the interface without knowing the specific implementation of the kernel layer hardware driver.

[0116] The kernel layer is a layer between hardware and software. The kernel layer can include a display driver, a camera driver, an audio driver, a Bluetooth driver, a Wi-Fi driver, a central processor driver, etc. For example, in the embodiment of the present application, the communication service manager can connect between devices through the Bluetooth driver and the Wi-Fi driver and other related modules, realize self-discovery and self-networking of the device.

[0117] It can be understood that the sending end or the receiving end of the embodiment of the present application can also use a Windows system, as shown in Figure 5 Unlike the Android system, the layered architecture of the Windows system mainly includes a user state and a kernel state. The user state can include user application processes, system processes and service processes, etc. The kernel state can include a kernel and a device driver layer, and a hardware abstraction layer, etc.

[0118] The user application processes can execute a series of application programs. The specific executable application program types can be the same as the application program types in the application program layer of the Android system, which will not be described here.

[0119] The system processes and service processes can 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 the user application processes. The roles of the connection service manager, the communication service manager, the authentication service manager, etc. related to the embodiment of the present application can refer to the descriptions of the related managers in the Android, which will not be described here.

[0120] In addition, the system processes and service processes can also include a channel management server, which is used to manage the communication channels of the application programs, including the timing query of the communication channels, the release of the communication channels, etc.

[0121] The kernel layer and the device driver layer can include a Bluetooth driver, a Wi-Fi driver, a display driver, etc., and the hardware abstraction layer can include a Bluetooth module, a Wi-Fi module, a hardware configuration module, etc. The role of the specific function module can be referred to the related description in Android, which will not be described here. The transmission process of the connection data in the Windows system layered framework will be described below in combination with the scenario of the connection notification display between terminal devices in the application connection process.

[0122] As shown in FIG. 1, in the application program layer of the sending end, the application program is initialized by accessing the connection service SDK. The connection service SDK applies for the address of the shared memory for the application program and determines the communication identification (ID) of the application program. In this way, the connection service SDK can return the initialization success to the application program. After determining the communication ID of the application program, the application program can realize the data transmission with the connection service by accessing the connection service SDK. The connection service SDK can send the request of binding the connection service and the application registration of the connection service to the connection service manager on the communication channel indicated by the communication ID, thereby realizing the data transmission of the connection application registration and binding between the application program layer and the application program framework layer. Figure 5 In the application program framework layer, the connection service manager can complete the binding of the communication service by performing the signaling transmission and the data transmission with the communication service manager. The connection service manager can also bind the authentication service and the application authentication with the authentication service manager.

[0123] After the connection application registration is successful, the communication service manager can call the Bluetooth module interface and the Wi-Fi module interface provided by the hardware abstraction layer to realize the self-discovery and the ad hoc network of the device, and realize the session connection, the message transmission, and the transmission of the connection content between the terminal devices through the Bluetooth driver and the Wi-Fi driver in the kernel layer and the device driver layer.

[0124] When the receiving end receives the connection-related data transmitted by the sending end based on the kernel layer and the device driver layer, the data can be transmitted to the related module in the hardware abstraction layer. In the application program 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 the signaling transmission and the data transmission with the connection service manager. After receiving the connection-related data, the connection service manager can bind the authentication service and the application authentication with the authentication service manager. Further, the connection service manager can instruct the desktop launcher to display the connection notification in the form of an icon.

[0125]

[0126] ​The interaction process among the modules will be described in detail below in combination with the system for implementing the application continuation method. The embodiments below can be combined with each other or implemented independently, and the same or similar concepts or processes can not be described again in some embodiments.

[0127] Figure 6 is a schematic flowchart of an application continuation method provided by an embodiment of the present application. The system for implementing the application continuation method across devices can include a first terminal device and a second terminal device. The first terminal device can serve as a sending end and has a structure as shown in Figure 3 and Figure 5 The second terminal device can serve as a receiving end and has a structure as shown in Figure 3 and Figure 4 Each functional module for implementing the continuation service can be included in the first terminal device and the second terminal device, for example, the continuation service SDK, the continuation service manager, the communication service manager, and the authentication service manager.

[0128] The first terminal device of the embodiment of the present application can be a device using the Windows system, such as a PC, and the second terminal device can be a device using the Android system, such as a mobile phone, a tablet computer, and the like.

[0129] For convenience of description, the continuation application of the first terminal device is referred to as the first continuation application, the continuation service SDK of the first terminal device is referred to as the first continuation service SDK, the continuation service manager of the first terminal device is referred to as the first continuation service manager, the channel service manager of the first terminal device is referred to as the first channel service manager, the communication service manager of the first terminal device is referred to as the first communication service manager, and the authentication service manager of the first terminal device is referred to as the first authentication service manager.

[0130] The continuation application of the second terminal device is referred to as the second continuation application, the continuation service SDK of the second terminal device is referred to as the second continuation service SDK, the continuation service manager of the second terminal device is referred to as the second continuation service manager, the communication service manager of the second terminal device is referred to as the second communication service manager, and the authentication service manager of the second terminal device is referred to as 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. The stages will be introduced below. Figure 6

[0132] The first stage, initialization.

[0133] ​The first connection service manager of the first terminal device runs in the computer housekeeper, and runs in the third-party application after accessing the connection service SDK as an independent process, therefore, the first connection service manager needs to communicate with the first connection application across processes. When the first connection application of the first terminal device monitors some user behaviors, the first connection application can call the initialization interface of the first connection service SDK to apply a communication channel available for the first connection application and the first connection service manager to communicate across processes. After applying the communication channel, the first connection application can receive the message of initialization success returned by the first connection service SDK.

[0134] The user behaviors can be that the user clicks the icon of the first connection application to start the first connection application, or that the user edits in the first connection application, or that the user clicks the play button in the first connection application to play a video, music or other media, etc. The specific monitored user behaviors can be customized by the connection application, and the embodiments of the present application are not limited.

[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 the taskbar (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 bit not applied in the shared memory. The communication principle of the shared memory will be introduced below. Figure 7

[0137] Figure 7 is a schematic diagram of the communication principle of the shared memory provided by the embodiments of the present application. As shown in Figure 7 , the shared memory is one of the process communication methods, allowing multiple processes to access the same block of memory. Process A and process B both have their own process control blocks (PCB) and address spaces, and both have a corresponding page table responsible for mapping the virtual address of the process to the physical address, which is managed through the memory management unit (MMU). Two different virtual addresses are mapped to the same region in the physical space through the page table, and the region they point to is the shared memory.

[0138] When process A and process B map the virtual address to the physical address through the page table, there is a common memory region in the physical address, that is, the shared memory, which can be seen by process A and process B at the same time. Thus, one process writes and the other process reads to realize inter-process communication.

[0139] ​Figure 8 is a schematic diagram of an application communication channel provided by an embodiment of the present application. When determining that a bit in the shared memory is not applied, the first connection service SDK reads the value of each bit in the shared memory in order, each bit value being a first preset value or a second preset value, the bit value being the first preset value indicating that the communication channel corresponding to the bit is not applied or not used, and the bit value being the second preset value indicating that the communication channel corresponding to the bit is applied or used. For example, the first preset value can be "0", and the second preset value can be "1".

[0140] As shown in a of Figure 8 , the values of the first bit and the second bit in the shared memory region are "1", indicating that the communication channels corresponding to the two bits are already occupied by the application A and the application B.

[0141] As shown in b of Figure 8 , when the first connection application (application C) accesses the first connection service SDK, the first connection service SDK detects that the value of the third bit in the shared memory region is "0", so the first connection service SDK can determine that the third bit is the target bit, and return the identification n of the bit vacancy to the first connection service SDK, that is, the identification of the third bit vacancy. Wherein, the bit vacancy indicates the bit value being "0".

[0142] For example, the identification n of the first bit is 1, the identification n of the second bit is 2, the identification 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 or used.

[0144] After receiving the identification n of the bit vacancy, the first connection service SDK calculates the communication ID according to the identification n of the bit vacancy, for example, the communication ID = M + n × N, wherein M and N are preset values, and the value of N represents the number of types of messages supported by the applied communication channel.

[0145] It should be understood that the communication ID calculated by the first relay service SDK is a starting communication ID, and the communication channels identified by the N continuous communication IDs starting from the starting communication ID can be used by the first relay service SDK, where N is a preset value. That is, the first relay service SDK can determine a plurality of communication channels according to the calculated communication ID, the number of the plurality of communication channels is N, and each communication channel supports transmission of a message type, for example: a message for registering and calling the relay service, a message for deregistering and calling the relay service, a message for broadcasting a relay notification, a message for communication reconnection, and the like.

[0146] The following takes N=3 and M=0 as an example to illustrate the communication ID.

[0147] For example, the relay service SDK of application A reads the shared memory and detects that the value of the first bit in the shared memory region is “0”, and the identification n of the first bit is 1, so the identification of the bit vacancy returned by the shared memory to the relay service SDK of application A is the identification n of the first bit, that is, 1. The communication ID calculated by the relay service SDK of application A according to the communication ID=M+n*N is 3, and 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 relay service SDK of application B reads the shared memory and detects that the value of the second bit in the shared memory region is “0”, and the identification n of the second bit is 2, so the identification of the bit vacancy returned by the shared memory to the relay service SDK of application A is the identification n of the second bit, that is, 2. The communication ID calculated by the relay service SDK of application B according to the communication ID=M+n*N is 6, and 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 communication ID calculated by the relay service SDK of the first relay application (application C) according to the communication ID=M+n*N is 9, and 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 each communication channel in the plurality of communication channels applied for by each application transmits a predefined message type, for example, the communication channel identified by the communication ID+1 is used to transmit a communication reconnection message, that is, in the above example, application A can receive a communication reconnection message through the communication channel identified by the communication ID 4, application B can receive a communication reconnection message through the communication channel identified by the communication ID 7, and application C can receive a communication reconnection message through the communication channel identified by the communication ID 10.

[0151] After the first application receives the message of successful initialization, the first application can interact with the first application service manager through the applied communication channel to perform the process of subsequent application connection.

[0152] The second stage is the registration and binding of the application.

[0153] The first application can access the connection service by calling the registration interface of the first connection service SDK. It can be understood that the first application can carry the package name, version number and other information of the first application when registering the connection service.

[0154] In a possible implementation, the first connection service SDK can interact 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 the application to the first connection service manager through the communication channel identified by the communication ID 1. After receiving the request of 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 the message of successful binding returned by the first communication service manager.

[0155] After receiving the request of the first connection service SDK, the first connection service manager can 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] Further, the first connection service manager can bind the authentication service and the 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 application by interacting 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 application, and then perform the application authentication according to the UID. When the first authentication service manager authenticates the first application successfully, the cloud authentication server can store the application information such as the icon of the first application, and return the authentication result to the first connection service manager.

[0157] The first connection service manager receives the first connection application authentication result, and delivers the message to the first connection application. The authentication result can include authentication success and authentication failure. If the first connection application receives the authentication success result, it means that the application registration is successful, and the application connection method can be executed. If the first connection application receives the authentication failure result, it means that the application registration fails, and the application connection method will not be executed.

[0158] The first connection service manager receives the first connection application authentication result, and delivers the message to the first connection application. The authentication result can include authentication success and authentication failure. If the first connection application receives the authentication success result, it means that the application registration is successful, and the application connection method can be executed. If the first connection application receives the authentication failure result, it means that the application registration fails, and the application connection method will not be executed.

[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, and perform account authentication. Further, 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 can include device identification (DevID) and other information of the second terminal device.

[0160] After the first connection service manager receives the information indicating that the second terminal device is online sent by the first communication service manager, the information of the second terminal device can be stored and managed to perform subsequent application connection processes.

[0161] The third stage is the display of the connection notification.

[0162] After the first connection application is successfully registered, the first connection service manager can periodically send a broadcast connection notification. The broadcast connection notification can carry the package name of the first connection application, the connection strategy, and the connection content summary (such as the title) and other information. The first connection service manager can confirm the connectable device according to the connection strategy of the first connection application.

[0163] Exemplarily, when the connection strategy includes the device type supported by the application, for example, the first connection application can support the connection service on a mobile phone, a tablet computer, a television, a computer, etc. included in the connection strategy, the first connection service manager can instruct the first communication service manager and the second communication service manager to establish a session path when it is confirmed that the second terminal device is a mobile phone, a tablet computer, a television, a computer, etc.

[0164] Exemplarily, when the connection strategy includes the minimum version number or the minimum version, for example, the first connection application can support the minimum version number A or the minimum version B included in the connection strategy, the first connection service manager can instruct the first communication service manager and the second communication service manager to establish a session path when it is confirmed that the version number of the second connection application is greater than or equal to A, or the version of the second connection application is greater than or equal to B.

[0165] The session path can be established between the first communication service manager and the second communication service manager, so as to perform the message transmission and data transmission related to the application connection.

[0166] After the session path is successfully established, the first communication service manager can instruct the first connection service manager that the channel is successfully established. The first connection service manager can send the broadcast connection notification carrying the package name of the first connection application and the connection content summary and other information to the first communication service manager according to the broadcast connection notification sent by the first connection application. The first communication service manager sends the package name of the first connection application and the connection content summary and other information to the second communication service manager through the established session path. The second communication service manager further reports the package name of the first connection application and the connection content summary and other information to the second connection service manager.

[0167] The second connection service manager can parse the package name of the first connection application, and bind and authenticate the package name information of the first connection application with the second authentication service manager. The implementation of the binding and authentication is similar to the authentication step in the first terminal device, which will not be described here.

[0168] After the application authentication is successful, the second connection service manager can obtain the application icon through any possible implementation.

[0169] In a possible implementation, the second continuation service manager can search, according to obtained application information such as the package name of the first continuation application, whether the icon of the first continuation application is stored locally in the second terminal device. If the icon of the first continuation application can be found, the second continuation service manager can notify the desktop launcher to display the continuation notification by using the icon of the first continuation application. If the icon of the first continuation application cannot be found, the second continuation service manager can obtain the icon of the first continuation application and related information from the cloud authentication server. Further, when the cloud authentication server sends the icon of the first continuation application to the second continuation service manager, the second continuation service manager can store the icon of the first continuation application and related information locally in the second terminal device, and the second continuation service manager can notify the desktop launcher to display the continuation notification on the second terminal device.

[0170] In another possible implementation, the second continuation service manager can obtain the icon of the first continuation application and related information from the cloud authentication server.

[0171] In still another possible implementation, the second continuation service manager can search, in the second terminal device, for a second continuation application with the same package name as the first continuation application. If the second continuation application can be found, the second continuation service manager can notify the desktop launcher to display the continuation notification by using the icon of the second continuation application stored locally in the second terminal device. If the second continuation application cannot be found, the second continuation service manager can obtain the icon of the first continuation application and related information by using the above method of searching for application information locally in the second terminal device or in the cloud authentication server, and notify the desktop launcher to display the continuation notification by using the icon of the first continuation application.

[0172] It can be understood that, when the desktop launcher controls the display of the continuation notification, the continuation notification can be displayed in the recent task, the task bar, the shortcut window, or other interface entry of the second terminal device. The specific display manner of the continuation notification is not limited in the embodiments of the present application. The continuation notification can be displayed in the form of a continuation application icon, or can be displayed by using an application name, a prompt, or other forms. The specific display form of the continuation notification is not limited in the embodiments of the present application.

[0173] The fourth stage is obtaining and loading of the continuation data.

[0174] After the second terminal device receives the event of the user clicking the continuation application icon, in a possible implementation, if the second terminal device does not have the second continuation application installed, the second terminal device can prompt the user to install the second continuation application. The specific prompting manner of the application installation is not limited in the embodiments of the present application. If the second terminal device has the second continuation application installed, or the installation of the second continuation application is completed based on the prompt, the following steps can be performed.

[0175] The second connection service manager can pull up the second connection application, and instruct the second connection application to load a transition animation effect. The second connection application can start and load the transition animation effect, which can include a prompt such as “loading…” Further, the second connection application can access the connection service by calling a registration interface of the second connection service SDK. It can be understood that the second connection application can carry information such as the package name of the second connection application when registering the connection service.

[0176] The second connection service SDK can send a request to bind the connection service to the second connection service manager. The second connection service manager can send a request to bind the communication service to the second communication service manager after receiving the request to bind the connection service. When the second communication service manager binds successfully, the second communication service manager can send a message of successful binding to the second connection service SDK through the second connection service manager. The second connection service SDK sends a message of registering the connection service to the second connection service manager after receiving the message of successful binding. The second connection service manager can return the message of successful registration to the second connection application through the second connection service SDK after successful registration.

[0177] During the startup of the second connection application, the second connection service manager can also send a request for connection data to the first connection service manager through the session channel established between the first terminal device and the second terminal device. When the first connection service manager receives the request for connection data, the first connection service SDK can report the request for connection data to the first connection application. The first connection application can package and encrypt the connection content and related connection data, and send the connection data to the first connection service manager through the first connection service SDK. The first connection service manager can send the connection data to the second connection service manager through the session channel established between the first terminal device and the second terminal device.

[0178] Further, the second connection service manager notifies the second connection application of the connection data through the second connection service SDK. After successful registration, the second connection application can load the connection data and control the second terminal device to display the connection data, and pass information indicating successful connection to the first connection application of the first terminal device. In turn, the first connection application can execute processes such as exiting the page of the first connection application.

[0179] In the processes described in the foregoing stages, the following scenarios can exist.

[0180] Scenario one, the first connection application normally exits.

[0181] Exemplarily, the first connection application can exit after receiving the connection success notification. In this scenario, the first connection application can be unregistered by calling the application unregistration interface of the first connection service SDK. The first connection service SDK sends a request for application unregistration to the first connection service manager through the application communication channel, and the first connection service manager can notify the first channel service manager that the application has exited after receiving the request of the first connection service SDK. The first channel service manager stops the timing query of the first connection application and cleans up the occupation bit in the shared memory. For example, the first connection service SDK modifies the value of the third bit of the shared memory region to "1" when applying for the communication channel. Therefore, when cleaning up, the first channel service manager modifies the value of the third bit of the shared memory region to "0", indicating that the communication channel corresponding to the third bit is not used or applied, and can be used by other applications. This is conducive to efficient use of limited IPC communication resources and improves the utilization rate of communication resources.

[0182] Further, the first channel service manager notifies the first connection service manager of the application disconnection success, and the first connection service manager sends a disconnection success message to the first connection application through the first connection service SDK after receiving the application disconnection success message.

[0183] Scenario two, the first connection application exits abnormally.

[0184] Exemplarily, the first connection application may exit abnormally in the case of lagging exit, user forcibly stopping the application in the background task manager, etc. In this scenario, the first channel service manager fails to successfully send a keep-alive packet to the first connection service SDK, and the first connection service SDK does not un-register with the first connection service manager, resulting in that the first connection application always occupies the communication channel. In the case of limited IPC communication resources, other applications may not be able to apply for available communication channels in time, causing waste of communication resources.

[0185] In the embodiment of the application, the first channel service manager notifies the first connection service manager that the application has exited after determining that the timing query fails. The first channel service manager stops the timing query of the first connection application and cleans up the occupation bit in the shared memory, which is conducive to avoiding waste of communication resources.

[0186] Scenario three, the first connection application starts before the first connection service manager.

[0187] The first connection application starts before the first connection service manager, meaning the first connection application starts before the PC Manager. In this scenario, the first connection application can request a communication channel, but it may fail to successfully register for the connection service because the first connection service manager has not yet started or has exited abnormally. For example, the user can manually open the PC Manager to start the first connection service manager. During the startup process of the first connection service manager, it sends communication return messages on all communication channels in shared memory that can be used to transmit communication return messages.

[0188] For example, when the first connection service SDK receives a communication reconnection message broadcast by the first connection service manager on the communication channel identified by communication ID+1, if the first connection application has a need for application connection across devices, the first connection application can determine to start the registration and binding of the connection application. The first connection service manager maintains the data in the shared memory area as the most recent state according to the communication ID of the reconnected communication channel.

[0189] Scenario 4: The first 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] The above combination Figure 6 The internal interaction process of the first terminal device as the sender and the second terminal device as the receiver is described. The following section details the internal interaction process of the first terminal device as the receiver and the second terminal device as the sender. The first terminal device may have the following characteristics: Figure 3 and Figure 5 As shown in the diagram, the second terminal device can have the following structure: Figure 3 and Figure 4 The structure shown.

[0192] The prerequisite for the first terminal device to act as the receiving end is that the PC manager of the first terminal device must be started before the first connection application. Only in this way can the first terminal device normally carry out the application connection process related to device self-discovery and self-networking.

[0193] Similar to the internal interaction of the first terminal device as the sender, the second terminal device, when acting as the sender, can execute the processes described in stage two and beyond. Figure 4 In the hierarchical architecture, there is no cross-process communication between the second connection service SDK and the second connection service manager in the second terminal device. Therefore, the second connection service SDK does not need to request a communication channel in shared memory.

[0194] The second terminal device can open the second connection application, perform application registration and binding, broadcast connection notification, bind authentication service and application authentication, and establish a session path with the first communication service manager of the first terminal device. For specific procedures, please refer to the above text regarding... Figure 6 The description of the above will not be repeated here. After establishing a session path, the first communication service manager and the second communication service manager transmit messages through the established session path. The messages include information such as the package name of the second continuing application. The first continuing service manager and the first authentication service manager bind the authentication service based on the package name of the second continuing application and perform application authentication. After successful application authentication, the first continuing service manager obtains the application icon and notifies the desktop launcher of the first terminal device to display the continuing notification as 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 taskbar (or dock) of the first terminal device.

[0196] When the first terminal device receives an event from the user clicking the application icon, if the first application has been installed on the first terminal device but has not been started, the first application service manager will launch the first application and instruct the first application to load the transition animation effect. The first application can then start and load the transition animation effect.

[0197] Furthermore, the first terminal device can perform operations related to... Figure 6 The initialization phase and the registration and binding phase of subsequent applications are similar processes, so they will not be described in detail here.

[0198] During the initial application startup process, the first connection service manager can request connection data from the second connection service manager through the session established between the first terminal device and the second terminal device. The specific process for requesting connection data can be found in the section above. Figure 6 The description will not be repeated here.

[0199] Furthermore, 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 used for transmitting the connection data. For example, if the communication channel identified by communication ID+2 out of the N communication channels corresponding to a communication ID is used to transmit connection data, then the first connection service manager can send the connection data to the first connection application on the communication channel identified by communication ID+2.

[0200] Based on the above description of the internal interaction flow of application continuity, such as Figure 9 As shown, this application embodiment provides a method 900 for application connection. Method 900 can be executed by a terminal device, which may have, for example...Figure 3 and Figure 5 The terminal device is installed with the first application and the computer manager. The terminal device corresponds to the first terminal device, and can serve as a sending end of the application connection or a receiving end of the application connection. The method 900 includes the following steps.

[0201] S901, in response to an operation of a user clicking an icon of the first application, obtaining an identification 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 a communication channel corresponding to the target bit is not used.

[0202] In this step, the first application can be the first connection application described above. For example, 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 identification n=1 of the first bit. 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 identification n=2 of the second bit.

[0203] S902, determining a communication identification corresponding to the target bit based on the identification of the target bit, the communication identification indicating at least one communication channel used for communication between the first application and the computer manager.

[0204] In combination with the description above, after obtaining the identification of the target bit, the terminal device can calculate the communication identification corresponding to the target bit based on a preset rule. The communication identification corresponds to at least one communication channel, so that the terminal device applies for an IPC communication resource that can be used for communication with the computer manager for the first application. For a detailed description of the communication channel, refer to the description above, which 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 can include the registration connection service and callback, broadcast connection notification, request connection data, application deregistration, broadcast communication reconnection message, and the like described above.

[0207] In the embodiments of the present application, the terminal device can combine the IPC communication with the shared memory, flexibly allocate IPC communication resources for at least one application accessing the connection service in the computer manager, so as to realize communication between the application and the connection service in the computer manager.

[0208] It should be understood that the size of the sequence number of the above processes does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0209] Those skilled in the art can appreciate that the modules and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0210] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device and module can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0211] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above-described device embodiments are only schematic, for example, the division of the modules is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be indirect coupling or communication connection through some interface, device or module, which can be electrical, mechanical or other forms.

[0212] The modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical modules, that is, they can be located in one place, or can be distributed on a plurality of network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment.

[0213] In addition, each functional module in each embodiment of the present application can be integrated in one processing module, or each module can exist physically, or two or more modules can be integrated in 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 solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[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 person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be subject to 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 having a first application and a PC manager installed, the method includes: In response to the user clicking the icon of the first application, the identifier of the target bit in the shared memory is obtained. The target bit is a bit with a value of a first preset value, which indicates that the communication channel corresponding to the target bit is not in use. Based on the identifier of the target bit, a communication identifier corresponding to the target bit is determined, and the communication identifier indicates at least one communication channel between the first application and the PC Manager. After registering the connection service through the first communication channel of the at least one communication channel, a session path is established with the second terminal device; The data of the first application is sent to the second terminal device through the session channel.

2. The method according to claim 1, characterized in that, The method further includes: Based on the acquisition of the identifier of the target bit, the value of the target bit is modified from the first preset value to the second preset value, whereby 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 includes: If 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 includes: Based on the second communication channel of the at least one communication channel, the registration of the continuing service is cancelled; Based on the deregistration of the connecting service, it is determined that the process of the first application has exited.

5. The method according to claim 4, characterized in that, The method further includes: After successfully registering the connection service, periodically check whether the process of the first application has exited.

6. The method according to claim 2, characterized in that, If the first application starts before the PC Manager, or if the PC Manager process exits abnormally, the method further includes: Broadcast communication return message, the communication return message being used to instruct the first application to connect to the PC Manager; If the communication callback message is received through the third communication channel of 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 the identifier of the target bit in shared memory in response to the user clicking the icon of the first application includes: In response to a user clicking the icon of the first application located on the desktop or taskbar of the first terminal device, the identifier of the target bit in the shared memory is obtained.

8. A terminal device, characterized in that, Includes a module for performing the method as described in any one of claims 1 to 7.

9. A terminal device, characterized in that, include: Processor and memory, of which, The memory is used to store computer programs; The processor is used to invoke and execute the computer program to cause the terminal device to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on a terminal device, the terminal device performs the method as described in any one of claims 1 to 7.

11. A computer program product, characterized in that, The computer program product includes computer program code that, when run on a terminal device, causes the terminal device to implement the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Cross-environment communication framework

    CN103262057A

  • Cross-process communication method, device and equipment

    CN110569130A