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

Method and terminal device for application connection Download PDF

Info

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

Links

Classifications

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

Abstract

The application provides a method for application connection and terminal equipment, which are beneficial to flexibly distributing communication resources for the terminal equipment so as to realize communication between the application and connection service in a computer management home. The method comprises the following steps: responding to the operation of clicking the icon of the first application by a user, and acquiring the identification of a target bit in the shared memory, wherein the target bit is a bit with a first preset value, and the first preset value indicates that a communication channel corresponding to the target bit is not used; determining a communication identifier corresponding to the target bit based on the identifier of the target bit, the communication identifier indicating at least one communication channel for communication between the first application and the computer manager; data transmission between the first application and the computer manager is achieved based on the at least one communication channel.

Description

Method and terminal device for application connection
Technical Field
The present application relates to the field of terminals, and in particular, to a method and a terminal device for application connection.
Background
Currently, application interfacing across devices will become an important function in subsequent multi-device scenarios. The application connection may be understood as that when a user uses an application on a personal notebook (personal computer, PC), the user may connect the use state of the application in a mobile phone that meets the connection condition, and continue to use the application on the mobile phone.
For a PC in an application connection scenario, in order to achieve the requirement of synchronizing the usage state of an application to other devices, or synchronizing the usage state of an application of other devices to the PC, the PC needs to provide a connection framework and a software development kit (software development kit, SDK) externally to meet this requirement. The connection frame is a synchronous frame for providing unified application state for the application, the application needs to access the connection frame through the SDK to realize data transmission with connection service in the connection frame, and the connection service provides external service capability for the application by taking a computer manager as a support. After the start-up of the applications and computer households in the PC, the applications and computer households run in two different processes, the applications need to communicate with the continued services in the computer households through inter-process communication (inter process communication, IPC).
Therefore, how to allocate IPC communication resources for applications on the PC side to achieve communication between the applications and the connection service in the computer management home is a problem to be solved.
Disclosure of Invention
The application provides a method for application connection and terminal equipment, which are beneficial to flexibly distributing IPC communication resources for the terminal equipment so as to realize communication between the application and connection service in computer management home.
In a first aspect, a method for application connection is provided, applied to a terminal device, where the terminal device is a transmitting end or a receiving end of application connection, and the terminal device is installed with a first application and a computer manager, and the method includes: responding to the operation of clicking the icon of the first application by a user, and acquiring the identification of a target bit in the shared memory, wherein the target bit is a bit with a first preset value, and the first preset value indicates that a communication channel corresponding to the target bit is not used; determining a communication identifier corresponding to the target bit based on the identifier of the target bit, the communication identifier indicating at least one communication channel for communication between the first application and the computer manager; data transmission between the first application and the computer manager is achieved based on the at least one communication channel.
In the present application, a connection service manager (hereinafter, also simply referred to as a connection service) is integrated in the computer management home, and the first application communicates with the computer management home, including communication between the connection service SDK of the first application and the connection service in the computer management home. After the first application and the computer manager start, the connection service runs in the computer manager, and the first application is used as an independent process to access the SDK and then runs in the three-party application. Therefore, the first application needs to perform cross-process communication with the connection service in the computer management home through the connection service SDK.
In some scenarios, there may be at least one application access connection service in the hope of achieving application connection, in which case the computer manager needs to have the ability to communicate with all applications accessing the connection service through IPC. In the technical scheme provided by the application, aiming at the first application in at least one application accessing the continuous service, the terminal equipment can acquire the identification of the target bit in the shared memory, obtain the corresponding communication identification based on the identification of the target bit, and allocate at least one communication channel corresponding to the communication identification for the first application so as to enable the first application to communicate with the continuous service in the computer management home through the IPC communication resource. Therefore, by combining IPC communication with the shared memory, the terminal equipment can flexibly allocate IPC communication resources for all applications accessing the connection service, and data transmission between the applications and the computer manager in the application connection scene is realized.
With reference to the first aspect, in certain implementations of the first aspect, the method further includes: based on the acquisition of the identification of the target bit, modifying the value of the target bit from a first preset value to a second preset value, the second preset value representing that the communication channel to which the target bit corresponds has been used.
In the present application, after determining the target bit, the terminal device may modify the value of the target bit from the first preset value to the second preset value to identify that the communication channel corresponding to the target bit has been applied for or used. Therefore, after a new application is accessed to the connection service, the terminal equipment can apply for other communication channels corresponding to the bit with the first preset value for the new application, so that the flexible allocation of IPC communication resources is realized.
Optionally, the terminal device may detect values of a plurality of bits in the shared memory in response to an operation of clicking an icon of the first application by a user, and determine that a value of the plurality of bits is a target bit of the first preset value. After determining the target bit, the terminal device may obtain an identification of the target bit. And, after determining the target bit, the terminal device may modify the value of the target bit from the first preset value to the second preset value. The execution sequence of the terminal device for acquiring the identification 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.
With reference to the first aspect, in certain implementation manners of the first aspect, implementing data transmission between the first application and the computer manager based on at least one communication channel includes: based on a first communication channel of the at least one communication channel, a succession service and a callback are registered.
In the present application, each of at least one communication channel allocated by the terminal device for the first application may be used to transmit a different type of message. The first communication channel is used for the first application to register the continuing service and the callback. Therefore, the data transmission under the application connection scene is more convenient and efficient.
With reference to the first aspect, in certain implementations of the first aspect, the method further includes: and modifying the value of the target bit from the second preset value to the first preset value under the condition that the process of the first application exits.
In the application, the process exit of the first application comprises two conditions 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, and the communication channel occupied by the first application is released, so that other applications can use the communication channel corresponding to the target bit under the condition of limited IPC communication resources, and the resource utilization rate is improved.
With reference to the first aspect, in certain implementations of the first aspect, the method further includes: unregistering continued services and callbacks based on a second communication channel of the at least one communication channel; based on the deregistration of the access service and the callback, a process exit of the first application is determined.
In the application, under the condition that the first application normally exits, the terminal equipment can unregister the continuing service and the callback through the second communication channel allocated for the first application. After the continuing service in the terminal equipment receives the message of deregistering the continuing service and callback, the process of the first application can be determined to normally exit, and then the terminal equipment can release the communication channel allocated for the first application.
With reference to the first aspect, in certain implementations of the first aspect, the method further includes: after successful registration of the continuation service and the callback, the process of the first application is queried periodically whether to exit.
In the application, the terminal equipment timely monitors the state of the process of the first application by regularly inquiring whether the process of the first application exits.
The terminal device sends the keep-alive package to the first application at regular time through the computer manager, and if the process of the first application is running, the computer manager can successfully send the keep-alive package; if the process of the first application exits abnormally, the computer manager cannot successfully send the keep-alive packet. The terminal device determines whether the process of the first application has exited according to whether the computer manager successfully transmits the keep-alive packet.
With reference to the first aspect, in some implementations of the first aspect, the terminal device is a transmitting end to which the application is connected; in the event that the first application is started prior to the computer manager or the computer manager's process exits abnormally, the method further comprises: and broadcasting a communication callback message, wherein the communication callback message is used for indicating the first application to be connected with the computer manager. Registering a succession of services and callbacks based on a first communication channel of the at least one communication channel, comprising: in the event that a communication callback message is received based on a third communication channel of the at least one communication channel, a continuation service and a callback are registered based on the first communication channel.
In the application, the connection service of the computer manager can broadcast the communication back connection message in the starting process, and the first application can determine that the computer manager is started and can be normally connected after the third communication channel receives the communication back connection message. The first application may register for continued services and callbacks based on the first communication channel.
With reference to the first aspect, in some implementations of the first aspect, the terminal device is a receiving end to which the application is connected; the responding to the operation of clicking the icon of the first application by the user obtains the identification of the target bit in the shared memory, and the method comprises the following steps: and responding to the operation of clicking the icon of the first application positioned in the task bar of the terminal equipment by the user, and acquiring the identification of the target bit in the shared memory.
In the present application, as an application connection receiving end, a task bar of a terminal device may display a connection notification, and the connection notification may be displayed in the task bar in the form of an icon of a first application. In this way, the user can click on the icon of the first application in the task bar to start the first application on the terminal device serving as the receiving end, and further apply for the first application for a communication channel for communicating with the computer manager, so that the first application is connected with connection data of the first application on other devices, for example, the edited content of the memo, audio data and the like.
With reference to the first aspect, in some implementations of the first aspect, the terminal device is a transmitting end to which the application is connected; the method for obtaining the identification of the target bit in the shared memory comprises the following steps of: and responding to the operation of clicking the icon of the first application positioned on the desktop or the task bar of the terminal equipment by the user, and acquiring the identification of the target bit in the shared memory.
In the application, as a sending end of application connection, the terminal equipment can display the icon of the first application on the desktop or the task bar. After the user clicks (e.g., double-clicks) an icon of a first application in a desktop or a taskbar, the terminal device may start the first application on the terminal device as a transmitting end and perform a corresponding operation in the first application, for example, edit a memo, play music, and the like.
In a second aspect, a terminal device is provided, which includes an acquisition module and a processing module for performing the method in any one of the possible implementation manners of the first aspect.
Wherein, the acquisition module is used for: and responding to the operation of clicking the icon of the first application by a user, and acquiring the identification of a target bit in the shared memory, wherein the target bit is a bit with a first preset value, and the first preset value indicates that a communication channel corresponding to the target bit is not used. The processing module is used for: determining a communication identifier corresponding to the target bit based on the identifier of the target bit, the communication identifier indicating at least one communication channel 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.
With reference to the second aspect, in certain implementations of the second aspect, the processing module is configured to: based on the acquisition of the identification of the target bit, modifying the value of the target bit from a first preset value to a second preset value, the second preset value representing that the communication channel to which the target bit corresponds has been used.
With reference to the second aspect, in certain implementations of the second aspect, the processing module is configured to: based on a first communication channel of the at least one communication channel, a succession service and a callback are registered.
With reference to the second aspect, in certain implementations of the second aspect, the processing module is configured to: and modifying the value of the target bit from the second preset value to the first preset value under the condition that the process of the first application exits.
With reference to the second aspect, in certain implementations of the second aspect, the processing module is configured to: unregistering continued services and callbacks based on a second communication channel of the at least one communication channel; and determining that the process of the first application is exited based on the deregistration of the access service and the callback.
With reference to the second aspect, in certain implementations of the second aspect, the processing module is configured to: after successful registration of the continuation service and the callback, the process of the first application is queried periodically whether to exit.
With reference to the second aspect, in some implementations of the second aspect, the terminal device is a sender of the application connection. In the case that the first application is started before the computer manager or the process of the computer manager is abnormally exited, the processing module is used for: broadcasting a communication callback message, wherein the communication callback message is used for indicating the first application to be connected with a computer manager; and registering the continued service and the callback based on the first communication channel in case of receiving the communication callback message based on the third communication channel of the at least one communication channel.
With reference to the second aspect, in some implementations of the second aspect, the terminal device is a receiving end to which the application is connected. The processing module is used for: and responding to the operation of clicking the icon of the first application positioned in the task bar of the terminal equipment by the user, and acquiring the identification of the target bit in the shared memory.
With reference to the second aspect, in some implementations of the second aspect, the terminal device is a sender of the application connection. The processing module is used for: and responding to the operation of clicking the icon of the first application positioned on the desktop or the task bar of the terminal equipment by the user, and acquiring the identification of the target bit in the shared memory.
In a third aspect, there is provided another terminal device comprising a processor and a memory, the processor being coupled to the memory, the memory being operable to store a computer program, the processor being operable to invoke and execute the computer program in the memory to implement the method in any of the possible implementations of the first aspect.
In a fourth aspect, there is provided a processor comprising: input circuit, output circuit and processing circuit. The processing circuitry is configured to receive signals via the input circuitry and to transmit signals via the output circuitry such that the processor performs the method of any one of the possible implementations of the first aspect described above.
In a specific implementation process, the processor may be a chip, the input circuit may be an input pin, the output circuit may be an output pin, and the processing circuit may be a transistor, a gate circuit, a trigger, various logic circuits, and the like. The input signal received by the input circuit may be received and input by, for example and without limitation, a receiver, the output signal may be output by, for example and without limitation, a transmitter and transmitted by a transmitter, and the input circuit and the output circuit may be the same circuit, which functions as the input circuit and the output circuit, respectively, at different times. The application is not limited to the specific implementation of the processor and various circuits.
In a fifth aspect, a processing device is provided that includes a processor and a memory. The processor is configured to read instructions stored in the memory and to receive signals via the receiver and to transmit signals via the transmitter to perform the method of any one of the possible implementations of the first aspect.
Optionally, the processor is one or more and the memory is one or more.
Alternatively, the memory may be integrated with the processor or the memory may be separate from the processor.
In a specific implementation process, the memory may be a non-transient (non-transitory) memory, for example, a Read Only Memory (ROM), which may be integrated on the same chip as the processor, or may be separately disposed on different chips.
It should be appreciated that the related data interaction process, for example, transmitting the indication information, may be a process of outputting the indication information from the processor, and the receiving the capability information may be a process of receiving the input capability information by the processor. Specifically, the data output by the processing may be output to the transmitter, and the input data received by the processor may be from the receiver. Wherein the transmitter and receiver may be collectively referred to as a transceiver.
The processing means in the fifth aspect may be a chip, and the processor may be implemented by hardware or by software, and when implemented by hardware, the processor may be a logic circuit, an integrated circuit, or the like; when implemented in software, the processor may be a general-purpose processor, implemented by reading software code stored in a memory, which may be integrated in the processor, or may reside outside the processor, and exist separately.
In a sixth aspect, there is provided a computer program product comprising: computer program code which, when run, causes a computer to perform the method of any one of the possible implementations of the first aspect described above.
In a seventh aspect, a computer readable storage medium is provided, the computer readable storage medium storing a computer program which, when executed, causes a computer to perform the method of any one of the possible implementations of the first aspect.
Drawings
FIG. 1 is a schematic view of a scenario provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of an interface for application connectivity according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a terminal device to which the embodiment of the present application is applicable;
fig. 4 is a block diagram of a software architecture of a terminal device to which an embodiment of the present application is applicable;
FIG. 5 is a block diagram of another software architecture of a terminal device to which embodiments of the present application are applicable;
FIG. 6 is a schematic flow chart diagram of an application splicing method provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a communication principle of a shared memory according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an application communication channel according to an embodiment of the present application;
Fig. 9 is a schematic flow chart diagram of a method for applying a splice provided by an embodiment of the present application.
Detailed Description
The technical scheme of the application will be described below with reference to the accompanying drawings.
In order to facilitate the clear description of the technical solutions of the embodiments of the present application, the following briefly describes some terms and techniques involved in the embodiments of the present application:
1. and (3) a connection strategy: the connection policy is used to determine the devices that can be connected, and each application program can correspond to its own connection policy. Illustratively, the connection policy of the application may relate to one or more of the following fields:
the method comprises the steps of supporting equipment types by an application program, a connectable application package name of an Android (Android) platform, a connectable process name of a windows platform, a browser starting parameter, a minimum version number and a minimum version of a supported continuous application and the like.
The splice policy may correspond to a flag bit for identifying the status of the splice policy. For example, a flag bit of 0 may indicate that no connection is supported, a flag bit of 1 may indicate that connection is applied, and a flag bit of 3 may indicate that connection is browser. It is understood that the specific value of the flag bit may be set arbitrarily, and different states may be distinguished, which is not particularly limited in the embodiment of the present application.
2. Other terms
In embodiments of the present application, the words "first," "second," and the like are used to distinguish between identical or similar items that have substantially the same function and effect. For example, the first terminal device and the second terminal device are for distinguishing different terminal devices, and the sequence of the first terminal device and the second terminal device is not limited. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
It should be noted that, in the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
Furthermore, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, and c may represent: a, b, or c, or a and b, or a and c, or b and c, or a, b and c, wherein a, b and c can be single or multiple.
With the development of terminal technology, a user often needs to switch content among a plurality of terminal devices, for example, when the user edits content in a memo of a mobile phone, the user may want to continuously edit the content in the memo by using a tablet computer or other devices with larger screens because the mobile phone screen is smaller.
In the scenario that the mobile phone content is switched to the tablet computer, when the user wants to continue editing the memo content edited in the mobile phone before the tablet computer is switched, the user needs to find and open the memo in the tablet computer and re-edit the memo content in the mobile phone, or needs to copy the memo content in the mobile phone to the tablet computer through media, for example, copy and paste the content through media such as a chat tool or a USB flash disk, so as to switch the content in the mobile phone to the tablet computer. However, the above operation makes the content switching process between devices complicated and takes a long time.
The continuous development of terminal technology drives the possibility of interconnection and interworking between devices, and the application connection between devices becomes an important function in the subsequent multi-device scene. Application connection is understood as that when a user uses an application on the device a, the user can connect the use state of the application in the device B meeting the connection condition and continue to use the application. This approach makes content switching between devices simpler and more efficient.
Fig. 1 is a schematic view of a scenario provided in an embodiment of the present application. The scenario shows a personal notebook (personal computer, PC) and a cell phone. The PC adopts a Windows system, and the mobile phone adopts an Android system. The user can use the mobile phone to connect with the content presented by the application in the PC, and can also use the PC to connect with the content presented by the application in the mobile phone.
Optionally, more terminal devices, such as a large screen, a tablet computer, etc., may be included in the scene. Illustratively, the user may utilize at least one device of a cell phone, a large screen, a tablet computer to continue the content presented by the application in the PC.
In the following, referring to fig. 2, the user edits the text using the memo on the PC, and the user wants to continue editing the text in the memo through the mobile phone.
Fig. 2 is a schematic diagram of an interface for application connection according to an embodiment of the present application.
Referring to the interface a in fig. 2, when the user opens a memo on the PC and edits the content, the PC broadcasts a connection notification to the outside, and after the mobile phone receives the connection notification, referring to the interface B in fig. 2, the mobile phone prompts the user to have a task that can be connected through a dock (or through a multitasking center), where the dock may be a fixed interface under the screen of the mobile phone, the PC, etc., and the user may place a relatively commonly used application in the dock. If the user has the requirement of changing the equipment to continue editing the content, the user can click on the connection notification on the dock of the mobile phone to open the memo on the mobile phone for application connection. Referring to the interface C in fig. 2, the content edited on the PC before continuing is displayed in the memo interface of the mobile phone, the cursor position is displayed at the position where the cursor stays on the PC before continuing, and the user can continue editing the content on the mobile phone.
It should be noted that, the PC and the mobile phone shown in fig. 2 belong to the same trust ring, and the same trust ring may be understood that the devices log in the same device account number, the distance between the devices meets a certain threshold, and bluetooth or wireless fidelity (wireless fidelity, wi-Fi) is started between the devices. The device account number can be used for device authentication when the devices are connected; bluetooth or Wi-Fi may be used for device discovery and connection between devices.
When the user uses the PC to edit in the memo, the mobile phones belonging to the same trust ring can prompt the user to be capable of carrying out application connection. When the user triggers the mobile phone to confirm that the application is continued, the memo data in the PC can be acquired and loaded by the memo in the mobile phone, so that the user can continuously edit the memo content on the mobile phone, thereby providing a continuing service for the user, reducing the operation complexity of the user when the user continues the cross-equipment application, and improving the user experience.
A scenario similar to fig. 2 may also include: continuing the opened portable document format (portable document format, PDF) on the mobile phone to the tablet computer for continuous display; or continuing the video played on the tablet personal computer to the mobile phone for continuous playing; or continuing the music played on the PC to the mobile phone to continue playing, and the like.
For a PC in an application connection scenario, in order to achieve the requirement of synchronizing the usage state of an application to other devices, or synchronizing the usage state of an application of other devices to the PC, the PC needs to provide a connection framework and a software development kit (software development kit, SDK) externally to meet this requirement. The connection frame is a synchronous frame for providing unified application state for the application, and the application needs to access the connection frame through the SDK to realize data transmission with connection service in the connection frame. The connection service provides external service capability for the application based on the computer manager.
It should be appreciated that after the application and the continuation service in the PC are started, the application and the continuation service are in two different processes, so the application needs to communicate with the continuation service through inter-process communication (inter process communication, IPC).
However, if multiple applications access the connection framework at the same time, the connection framework depends on the computer manager to communicate with the connection service, so that excessive IPC communication resources are occupied. The connection framework integrated in the computer management home of the PC is limited in IPC communication resources provided for applications, and how to flexibly allocate IPC communication resources to a plurality of applications is a problem to be solved under the condition of excessive access applications.
In the embodiment of the application, the connection application is used as the generic term of the application with the connection function, and the types of the connection application can include: editing class applications (or referred to as document applications/office class applications), browsing class applications, audiovisual entertainment class applications (or referred to as multimedia play applications), and the like. It should be understood that applications that occupy IPC communication resources of a computer manager are not all continuous applications, for example, there are also some security protection applications, engine applications, etc. that also occupy IPC communication resources of a computer manager.
In view of this, an embodiment of the present application provides an application connection method, where when a plurality of applications access a connection framework at the same time, depending on a computer manager of a PC to communicate with a connection service, the PC may apply for each application an address in a shared memory, allocate a communication resource for each application based on the applied address of the shared memory, and the application may access the connection service based on the communication resource and perform data transmission with the connection service.
Fig. 3 is a schematic structural diagram of a terminal device to which the embodiment of the present application is applicable.
The terminal device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity 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.
It will be appreciated that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the application, the terminal device may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the connection relationship between the modules illustrated in the embodiment of the present application is only illustrative, and does not limit the structure of the terminal device. In other embodiments of the present application, the terminal device may also use different interfacing manners in the foregoing embodiments, or a combination of multiple interfacing manners.
The terminal device implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The terminal device may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to realize expansion of the memory capability of the terminal device. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer-executable program code that includes instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the terminal device (such as audio data, phonebook, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the terminal device and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor. For example, the application splicing method of the embodiment of the present application may be performed.
The terminal equipment of the application can be used as a transmitting end and a receiving end. The software system of the terminal device can adopt a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture or a cloud architecture. Fig. 4 of the embodiment of the present application illustrates a software structure of a terminal device according to the embodiment of the present application by taking an Android system with a layered architecture as an example.
As shown in fig. 4, the layered architecture divides the software into several layers, each with a clear role and division of work. The layers are in data transmission and communication through a software interface. In some embodiments, the Android system is divided into five layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun rows (Android run) and system libraries, a hardware abstraction layer (hardware abstract layer, HAL), and a kernel layer, respectively.
The application layer may include a series of application packages. As shown in FIG. 4, the application package may include three-party applications, a succession service SDK, bluetooth, wi-Fi, memo, video, game, and the like. For example, in the embodiment of the present application, in the application layer, the connection application may access the connection service SDK, the connection application may be a system application in the terminal device, or may be a three-party application, or may be a system application or a three-party application.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in fig. 4, the application framework layer may include a connection service manager, a communication service manager, an authentication service manager, a notification manager, a window manager, a resource manager, a content provider, a view system, and the like. Wherein the manager may also be referred to as a module in some application scenarios.
The connection service manager can be responsible for the management of connection tasks, provides continuous service for connection applications, and is the core of the connection framework. For example, in the embodiment of the present application, the connection service manager may be responsible for access of the connection application, authentication of the connection application, icon management of the connection application, and transmission of connection data between devices.
The communication service manager can be used for realizing data transmission among devices, for example, in the embodiment of the application, the communication service manager can realize security authentication and account authentication of the same account device, self discovery and self networking of the device, data transmission among devices, access of communication service and the like.
The authentication service manager may be responsible for verifying the validity of the application, for example, in the embodiment of the present application, after the authentication service manager passes the verification, the application may be allowed to access the connection service.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in a status bar, giving out a prompt tone, vibrating a terminal device, flashing an indicator light, etc. For example, in the embodiment of the present application, when the terminal device receives the connection notification, the notification manager may display the connection notification in the task bar.
The window manager is used for managing window programs. The window manager may obtain the display screen size, determine if there is a status bar, lock screen, touch screen, drag screen, intercept screen, etc.
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The content provider is used for realizing the function of data sharing among different application programs, allowing one program to access the data in the other program, and simultaneously ensuring the safety of the accessed data.
The view system may be responsible for interface rendering and event handling for the application. For example, in the embodiment of the present application, the view system may be used to process event processing after the user clicks the notification icon of the connection application.
Android runtimes include core libraries and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: media Libraries (Media Libraries), function Libraries (Function Libraries) graphics processing Libraries (e.g., openGL ES), etc.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The function library provides multiple service API interfaces for the developer, and is convenient for the developer to integrate and realize various functions quickly.
Graphics processing libraries are used to implement graphics drawing, image rendering, compositing, and layer processing, among others.
The hardware abstraction layer is a layer of abstracted structure between the kernel layer and the Android run. The hardware abstraction layer may be a package for hardware drivers that provides a unified interface for the invocation of upper layer applications. The hardware abstraction layer may include a bluetooth module, a Wi-Fi module, a hardware configuration module, and the like. For example, in the embodiment of the application, the Bluetooth module and the Wi-Fi module in the hardware abstraction layer can shield 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 mode of the hardware driver of the kernel layer.
The kernel layer is a layer between hardware and software. The kernel layer may include a display driver, a camera driver, an audio driver, a bluetooth driver, a Wi-Fi driver, a central processor driver, and the like. For example, in the embodiment of the application, the communication service manager can connect between devices through related modules such as Bluetooth drive and Wi-Fi drive, so as to realize the discovery and the ad hoc network of the devices.
It can be understood that, as shown in fig. 5, the sending end or the receiving end of the embodiment of the present application may also adopt a Windows system, and the layered architecture of the Windows system is different from that of the Android system and is mainly divided into a user state and a kernel state, where the user state may include a user application program process, a system process, a service process, and the like; kernel states may include kernel and device driver layers, as well as hardware abstraction layers, etc.
The user application process may execute a series of applications. The specific executable application program type may be the same as the application program type in the application program layer in the Android system, and will not be described herein.
The system process and the service process can comprise a connection service manager, a communication service manager, an authentication service manager, a system process, a notification manager, a window manager and the like, and can provide corresponding services for the execution of the user application program process. The processes of the connection service manager, the communication service manager, the authentication service manager and the like, which are specifically related to the embodiments of the present application, can be referred to the description of the related manager in Android, and are not described herein again.
In addition, the system process and the service process can also comprise a channel management server, wherein the channel management server is used for managing the communication channels of the application program, including timing inquiry of the communication channels, release of the communication channels and the like.
The kernel layer and the device driver layer may include a bluetooth driver, a Wi-Fi driver, a display driver, etc., and the hardware abstraction layer may include a bluetooth module, a Wi-Fi module, a hardware configuration module, etc. The specific function modules can be referred to the relevant description in Android, and are not described herein. The following illustrates the transmission flow of the connection data in the layered framework of the Windows system in combination with the scenario that the connection notification display is performed in the application connection process between the terminal devices.
As shown in fig. 5, in the application layer of the transmitting end, the application is initialized by accessing the connection service SDK. The connection service SDK applies for an address of the shared memory for the application program, and determines a communication Identification (ID) of the application program. So that the continued service SDK may return an initialization success to the application. After determining the communication ID of the application, the application may implement data transmission with the connection service by accessing the connection service SDK. The connection service SDK may send a request for binding the connection service and registering the connection service for the application to the connection service manager on the communication channel indicated by the communication ID, thereby implementing connection application registration and bound data transmission between the application layer and the application framework layer.
In the application framework layer, the connection service manager can complete the binding of the communication service through signaling transmission and data transmission with the communication service manager. The connection service manager may also perform binding authentication services and application authentication with the authentication service manager.
After the continuing application is successfully registered, 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 discovery and the self-networking of the equipment, and realize the session connection and the message transmission among the terminal equipment, the transmission of continuing content and the like through Bluetooth drivers and Wi-Fi drivers in the kernel layer and the equipment driving layer.
After the receiving end receives the continuous related data transmitted by the transmitting end based on the kernel layer and the device driving layer, the data can be transmitted to a related module in the hardware abstraction layer. In the application program framework layer of the receiving end, the communication service manager can acquire the transmitted connection data through an interface provided in the hardware abstraction layer, and perform signaling transmission and data transmission with the connection service manager. After receiving the data related to the connection, the connection service manager can perform binding authentication service and application authentication with the authentication service manager. Further, the connection service manager may instruct the desktop initiator to display the connection notification in the form of an icon.
The interaction process between the modules will be described in detail below in connection with a system implementing a cross-device application connectivity approach. The following embodiments may be combined with each other or implemented independently, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 6 is a schematic flow chart of an application connection method according to an embodiment of the present application. The system for implementing the inter-device application connection method may include a first terminal device and a second terminal device, where the first terminal device may be used as a transmitting end and have the structures shown in fig. 3 and fig. 5, and the second terminal device may be used as a receiving end and have the structures shown in fig. 3 and fig. 4. Each of the first terminal device and the second terminal device may include each functional module for implementing a connection service, for example, may include a connection service SDK, a connection service manager, a communication service manager, an authentication service manager, and the like.
The first terminal device in the embodiment of the application may be a device adopting a Windows system, such as a PC, and the second terminal device may be a device adopting an Android system, such as a mobile phone, a tablet computer, and the like.
For convenience of description, the connection application of the first terminal device will be referred to as a first connection application, the connection service SDK of the first terminal device will be referred to as a first connection service SDK, the connection service manager of the first terminal device will be referred to as a first connection service manager, the channel service manager of the first terminal device will be referred to as a first channel service manager, the communication service manager of the first terminal device will be referred to as a first communication service manager, and the authentication service manager of the first terminal device will be referred to as a first authentication service manager.
The connection application of the second terminal device is called a second connection application, the connection service SDK of the second terminal device is called a second connection service SDK, the connection service manager of the second terminal device is called a second connection service manager, the communication service manager of the second terminal device is called a second communication service manager, and the authentication service manager of the second terminal device is called a second authentication service manager.
The implementation process of the application connection method of the embodiment of the application can be divided into four stages, wherein the first stage is the initialization of connection application, the second stage is the registration and binding of connection application, the third stage is the display of connection notification, and the fourth stage is the acquisition and loading of connection data. The stages are described separately below in connection with fig. 6.
And (5) a first stage, namely initializing.
The first connection service manager of the first terminal device operates in the computer manager, and the application operates in the three-party application after being accessed to the connection service SDK as an independent process, so that the first connection service manager needs to communicate with the first connection application in a cross-process manner. When the first connection application of the first terminal device monitors some user actions, the first connection application may call an initialization interface of the first connection service SDK to apply for a communication channel that may be used for inter-process communication between the first connection application and the first connection service manager. After applying for the communication channel, the first connection application may receive a message returned by the first connection service SDK that the initialization was successful.
The user behavior may be that the user clicks an icon of the first connection application to start the first connection application, or may be that the user performs operations such as editing in the first connection application, or may perform operations such as video playing, music playing, or other media playing by clicking a play button in the first connection application, where the monitored user behavior may be customized by the connection application.
When the first terminal device is a transmitting end of application connection, an icon of the first connection application may be displayed on a desktop or a task bar (or referred to as a dock bar) of the first terminal device.
After receiving the initialization request, the first connection service SDK may read the shared memory and determine bits in the shared memory that are not applied for. The communication principle of the shared memory will be described with reference to fig. 7.
Fig. 7 is a schematic diagram of a communication principle of a shared memory according to an embodiment of the present application. As shown in fig. 7, shared memory is one way of inter-process communication, allowing multiple processes to access the same block of memory. Both process a and process B have their own process control block (process control block, PCB) and address space (address space) and have a page table corresponding to them, responsible for mapping the virtual address of the process to the physical address, managed by a memory management unit (memory management unit, MMU). Two different virtual addresses are mapped to the same region of physical space through page tables, and the region pointed to by the two different virtual addresses is the shared memory.
When the process a and the process B map the virtual address to the physical address through the page table, there is a common memory area, i.e. shared memory, in the physical address, and this memory can be seen by the process a and the process B at the same time. Such a process performs a write operation and another process performs a read operation to achieve inter-process communication.
Fig. 8 is a schematic diagram of an application communication channel according to an embodiment of the present application. When the first continuous service SDK determines bits which are not applied in the shared memory, the values of the bits in the shared memory are sequentially read, the value of each bit is a first preset value or a second preset value, the communication channel corresponding to the bit with the value of the first preset value is not applied or is not used, and the communication channel corresponding to the bit with the value of the second preset value is applied or is used. Illustratively, the first preset value may be "0" and the second preset value may be "1".
As indicated by a in fig. 8, the value "1" of the first bit and the second bit in the shared memory area indicates that the communication channels corresponding to these two bits have been occupied by application a and application B.
As shown in b in fig. 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 of the shared memory area is "0", so the first connection service SDK may determine that the third bit is the target bit, and return the identification n of the bit slot, that is, return the identification of the third bit slot, to the first connection service SDK. Wherein the bit null represents a bit having a value of "0".
Illustratively, the first bit has an identification n of 1, the second bit has an identification n of 2, the third bit has an identification n of 3, and so on.
After the first tandem service SDK detects that the value of the third bit is "0", and determines that the third bit is the target bit, the first tandem service SDK may modify the value of the target bit to "1" to indicate that the communication channel corresponding to the target bit has been applied for or used.
After receiving the identifier N of the bit slot, the first connection service SDK calculates a communication ID according to the identifier N of the bit slot, for example, communication id=m+n×n, where M, N is a preset value, and the value of N indicates the number of types of messages supported by the applied communication channel.
It should be understood that the communication ID calculated by the first connection service SDK is an initial communication ID, and that all communication channels identified by N consecutive communication IDs starting from the initial communication ID may be used by the first connection service SDK, where N is a preset value. That is, the first connection service SDK may determine a plurality of communication channels according to the calculated communication IDs, where the plurality of communication channels is N, and each communication channel supports transmission of a message type, for example: registering continued service and callback messages, deregistering continued service and callback messages, broadcasting continued notification messages, communicating back-connected messages, and the like.
The communication ID is exemplified below with n=3, m=0.
For example, the service SDK of application a reads the shared memory, detects that the value of the first bit in the shared memory area is "0", and the identifier n=1 of the first bit, so that the identifier of the bit slot returned by the shared memory to the service SDK of application a is the identifier n=1 of the first bit. The connection service SDK of the application a calculates a communication ID of 3 according to the communication id=m+n×n, where the communication ID of 3 corresponds to three communication channels, and the communication IDs of the three communication channels are 3, 4, and 5, respectively.
For example, the service SDK of application B reads the shared memory, detects that the value of the second bit in the shared memory area is "0", and the identifier n=2 of the second bit, so that the identifier of the bit slot returned by the shared memory to the service SDK of application a is the identifier n=2 of the second bit. The connection service SDK of the application B calculates a communication ID of 6 according to the communication id=m+n×n, where the communication ID of 6 corresponds to three communication channels, and the communication IDs of the three communication channels are 6, 7, and 8, respectively.
Similarly, the connection service SDK of the first connection application (application C) calculates a communication ID of 9 according to the communication id=m+n×n, the communication ID of 9 corresponds to three communication channels, and the communication IDs of the three communication channels are 9, 10, and 11, respectively.
It will be appreciated that transmitted on each of the plurality of communication channels to which each application applies is a predefined message type, e.g. the communication channel identified by communication id+1 is used to transmit communication callback messages, i.e. in the above example application a may receive communication callback messages over the communication channel identified by communication ID 4, application B may receive communication callback messages over the communication channel identified by communication ID 7, application C may receive communication callback messages over the communication channel identified by communication ID 10.
After the first connection application receives the message of successful initialization, the first connection application can interact with the first connection service manager in the applied communication channel so as to execute the subsequent application connection flow.
And in the second stage, the registration and binding of the continuous application.
The first splicing application can access the splicing service by calling a registration interface of the first splicing service SDK. It may be appreciated that the first connection application may carry information such as a packet name, a version number, etc. of the first connection application when registering for the connection service.
In a possible implementation, the first connection service SDK may perform data interaction with other function managers through the first connection service manager. The first connection service SDK may send a request for binding the connection service and registering the connection service to the first connection service manager through the communication channel identified by the communication ID 1, and after receiving the request for the first connection service SDK, the first connection service manager may interact with the first communication service manager to bind the communication service, and after successful binding, the first connection service manager may receive a message that the binding returned by the first communication service manager is successful.
After receiving the request for registering the connection service by the application of the first connection service SDK, the first connection service manager may notify the first channel service manager to mark the communication ID of the communication channel that sent the request, which indicates that the communication channel corresponding to the communication ID is used.
Further, the first connection service manager may perform binding authentication service and application authentication by invoking an interface provided by the first authentication service manager. After receiving the authentication request, the first authentication service manager can complete binding and authentication of the first continuous application through data interaction with the cloud authentication server. It can be appreciated that in the process of binding the authentication service, the cloud authentication server may obtain the user identifier (user identification, UID) according to the packet name of the first continuous application, and then perform application authentication according to the UID. After the first authentication service manager successfully authenticates the first connection application, the cloud authentication server can store application information such as icons of the first connection application and returns an authentication result to the first connection service manager.
The first connection service manager transmits the message to the first connection application after receiving the authentication result of the first connection application. The authentication result may include authentication success and authentication failure, and if the result received by the first continuing application is authentication success, the application registration is successful, and the method of continuing the application may be continuously executed; if the result received by the first continuing application is authentication failure, indicating that the application registration fails, and not continuing to execute the method of application continuing.
The first continuing service manager receives the authentication result of the first continuing application, and after the authentication result is that the authentication is successful, the first channel service manager is informed that the application is registered. The first channel service manager initiates a timing query for the state of the first subsequent application after receiving the application-registered message, and sends the timing query message to the first subsequent service SDK. Wherein the state of the first successive application includes that the process is still alive or that the process has exited. Specifically, the first channel service manager sending the timing query message to the first splicing service SDK may include: the first channel service manager sends a keep-alive packet to the first connection service SDK at regular time, if the keep-alive packet is sent successfully, the process of the first connection application is still alive, and if the keep-alive packet is not sent successfully, the process of the first connection application is exited.
After the application of the first terminal device is successfully registered, the first communication service manager and the second communication service manager can perform self-discovery and self-networking through Bluetooth or Wi-Fi, and account authentication is performed. Further, the first communication service manager may send information indicating that the second terminal device is online to the first connection service manager. For example, the information for indicating that the second terminal device is online may include information such as a device identification (device identification, devID) of the second terminal device.
After the first connection service manager receives the information sent by the first communication service manager and used for indicating that the second terminal equipment is on line, the information of the second terminal equipment can be stored and managed so as to execute a flow for carrying out subsequent application connection.
And a third stage, displaying the continuous notice.
When the first connection application is successfully registered, a broadcast connection notification may be periodically sent to the first connection service manager. The broadcast connection notification may carry information such as a packet name, a connection policy, and a connection content summary (e.g., a header) of the first connection application. The first connectivity service manager may identify the devices that are capable of connectivity based on the connectivity policy of the first connectivity application.
For example, when the connection policy includes a device type supported by the application program, for example, the connection policy includes that the first connection application may support implementation of the connection service on the mobile phone, the tablet computer, the television, the computer, and the like, the first connection service manager may instruct the first communication service manager and the second communication service manager to establish a session path when confirming that the second terminal device is the mobile phone, the tablet computer, the television, the computer, and the like.
For example, when the connection policy is that the minimum version number or the minimum version is included, for example, the connection policy includes that the first connection application may support that the minimum version number is a or the minimum version is B, the first connection service manager may instruct the first communication service manager and the second communication service manager to establish the session path when confirming that the version number of the second connection application is greater than or equal to a or that the version of the second connection application is greater than or equal to B.
A session path may be established between the first communication service manager and the second communication service manager for application-connection related messaging and data transmission.
After the session path is established successfully, the first communication service manager can indicate that the channel is established successfully to the first connection service manager, the first connection service manager can inform the first communication service manager of the broadcast connection carrying the information such as the packet name and the connection content outline of the first connection application according to the broadcast connection notification sent by the first connection application, the first communication service manager sends the information such as the packet name and the connection content outline of the first connection application to the second communication service manager through the established session path, and the second communication service manager further reports the information such as the packet name and the connection content outline of the first connection application to the second connection service manager.
The second connection service manager may analyze the packet name of the first connection application, and carry the packet name information of the first connection application to bind and authenticate with the second authentication service manager, where the implementation of binding and authentication is similar to the authentication step in the first terminal device, and will not be described herein.
After the application authentication is successful, the second connection service manager may obtain the application icon through any possible implementation.
In one possible implementation, the second connection service manager may search whether the icon of the first connection application is locally stored in the second terminal device according to the obtained application information such as the packet name of the first connection application. If the icon of the first continuous application can be found, the second continuous service manager can inform the desktop starter to display a continuous notification by using the icon of the first continuous application; if the icon of the first continuous application is not found, the second continuous service manager can acquire related information such as the icon of the first continuous application through the cloud authentication server. Further, when the cloud authentication server sends the icon of the first connection application to the second connection service manager, the second connection service manager may store related information such as the icon of the first connection application locally in the second terminal device, and the second connection service manager may notify the desktop initiator to display a connection notification on the second terminal device.
In another possible implementation, the second connection service manager may obtain related information such as an icon of the first connection application through the cloud authentication server.
In yet another possible implementation, the second connection service manager may search for a second connection application in the second terminal device that has the same package name as the first connection application. If the second connection application can be found, the second connection service manager can inform the desktop starter to display connection notification by using the icon of the second connection application locally stored by the second terminal equipment; if the second connection application is not found, the second connection service manager may obtain related information such as an icon of the first connection application by searching application information in the local area of the second terminal device or in the cloud authentication server, and notify the desktop initiator to display a connection notification using the icon of the first connection application.
It may be understood that, when the desktop initiator controls to display the connection notification, the connection notification may be displayed in the latest task, the task bar, the shortcut window, or other interface entries of the second terminal device, and specifically, the manner of displaying the connection notification is not limited in the embodiment of the present application. The connection notification may be displayed in the form of a connection application icon, or may be displayed in the form of an application name, a prompt or other forms, and specifically, the connection notification is displayed, which is not limited in the embodiment of the present application.
And the fourth stage, acquisition and loading of continuous data.
When the second terminal device receives the event that the user clicks the connection application icon, in possible implementation, if the second terminal device is not installed with the second connection application, the second terminal device may prompt the user to install the second connection application, and the specific mode of prompting to install the application is not limited in the embodiment of the present application. If the second connection application is already installed in the second terminal device, or if the installation of the second connection application is completed based on the prompt, the following steps may be performed.
The second connection service manager may pull up the second connection application and instruct the second connection application to load the transitional animation effect, and then the second connection application may start and load the transitional action, where the transitional action may include, for example, prompt information such as "in-load …". Further, the second connection application may access the connection service by calling the registration interface of the second connection service SDK, and it may be understood that the second connection application may carry information such as a packet name of the second connection application when registering the connection service.
The second connection service SDK may send a request for binding a connection service to the second connection service manager, and the second connection service manager may send a request for binding a communication service to the second communication service manager after receiving the request for binding a connection service. After the second communication service manager is successfully bound, the second communication service manager may send a message of successful binding to the second connection service SDK through the second connection service manager. After receiving the message of successful binding, the second connection service SDK sends a message of registering connection service to the second connection service manager, and after successful registration, the second connection service manager can return the message of successful registration to the second connection application through the second connection service SDK.
In the process of starting the second connection application, the second connection service manager can also send request connection data to the first connection service manager through a session path established between the first terminal equipment and the second terminal equipment, when the first connection service manager receives the request connection data and reports the request connection data to the first connection application through the first connection service SDK, the first connection application can package and encrypt relevant connection data such as connection content and send the connection data to the first connection service manager through the first connection service SDK, and the first connection service manager can send the connection data to the second connection service manager through the session path established between the first terminal equipment and the second terminal equipment.
Further, the second connection service manager notifies the second connection application of connection data through the second connection service SDK, and after the second connection application is successfully registered, the second connection application may load the connection data and control the second terminal device to display the connection data, and transmit information for indicating that the connection is successful to the first connection application of the first terminal device, so that the first connection application may execute a procedure of exiting from a page of the first connection application, and the like.
In the course of the execution of the stages described hereinabove, there may be several scenarios as follows.
Scene one, the first continued application exits normally.
Illustratively, the first splicing application may exit after receiving the splice success notification. In this scenario, the first tandem application may unregister by invoking an application unregister interface of the first tandem service SDK. The first continuous service SDK sends a request for application de-registration to the first continuous service manager through the applied communication channel, and the first continuous service manager can inform the first channel service manager that the application is exited after receiving the request of the first continuous service SDK, and the first channel service manager stops timing inquiry of the first continuous application and cleans the occupied bit in the shared memory. For example, when the first continuing service SDK applies for the communication channel, the value of the third bit in the shared memory area is modified to "1", so that when the first continuing service SDK cleans up, the first channel service manager modifies the value of the third bit in the shared memory area to "0", which means that the communication channel corresponding to the third bit is not used or not applied for, and can be applied for use by other applications, thereby being beneficial to efficiently utilizing limited IPC communication resources and improving the utilization rate of the communication resources.
Further, the first channel service manager notifies the first connection service manager that the application disconnection is successful, and after receiving the message of the application disconnection success, the first connection service manager sends a message of the deregistration success to the first connection application through the first connection service SDK.
Scene two, the first continuing application is abnormal and exits.
Illustratively, the first continued application is blocked and exited, and the user may cause the first continued application to be abnormally exited in the event that the background task manager forcibly stops the application, or the like. Under the scene, the first channel service manager cannot successfully send the keep-alive packet to the first continuous service SDK, the first continuous service SDK is not unregistered to the first continuous service manager, so that the first continuous application always occupies a communication channel, and under the condition that the IPC communication resources are limited, other applications can not apply for the available communication channel in time, and the waste of the communication resources is caused.
In the embodiment of the application, the first channel service manager notifies the first continuous service manager that the application has been exited after determining that the timing inquiry fails. The first channel service manager stops timing inquiry of the first continuous application and cleans up occupied bits in the shared memory, which is beneficial to avoiding waste of communication resources.
Scene three, the first splicing application is started before the first splicing service manager.
The first connection application is started before the first connection service manager, i.e. the first connection application is started before the computer manager. In this scenario, the first connectivity application may apply to the communication channel, but may not be able to successfully register for the connectivity service because the first connectivity service manager has not been started or has been abnormally exited. For example, the user may manually open the computer manager to start the first connection service manager, and during the start-up of the first connection service manager, the first connection service manager sends the communication connection message on all communication channels available for transmitting the communication connection message in the shared memory.
For example, the first connection service SDK receives a communication callback message broadcasted by the first connection service manager on the communication channel identified by the communication id+1, and if the first connection application has a requirement of performing application connection across devices, the first connection application may determine to start registration and binding of the connection application, and the first connection service manager maintains the data in the shared memory area as the latest state according to the communication ID of the callback communication channel.
Scene four, the first continuing service manager exits abnormally.
The process flow in this scenario is similar to that of scenario three, and will not be described here again.
The internal interaction flow in which the first terminal device is used as the transmitting end and the second terminal device is used as the receiving end is described above in connection with fig. 6, and the internal interaction flow in which the first terminal device is used as the receiving end and the second terminal device is used as the transmitting end is described below. Wherein the first terminal device may have the structure shown in fig. 3 and 5, and the second terminal device may have the structure shown in fig. 3 and 4.
The premise of the first terminal device as the receiving end is that the computer manager of the first terminal device starts before the first connection application, so that the first terminal device can normally perform the application connection flow related to self-discovery and self-networking of the device.
Similar to the internal interaction of the first terminal device as the transmitting end, the second terminal device may execute the procedure after the second stage when the second terminal device is used as the transmitting end, and under the hierarchical architecture of fig. 4, the second connection service SDK in the second terminal device and the second connection service manager do not involve cross-process communication, so the second connection service SDK does not need to apply for a communication channel in the shared memory.
The second terminal device may open the second connection application, perform registration and binding of the connection application, broadcast connection notification, binding authentication service and application authentication, and establish a session path with the first communication service manager of the first terminal device, and the specific flow may refer to the description of fig. 6 above, which is not repeated herein. After the session path is established, the first communication service manager and the second communication service manager transmit messages through the established session path, and the messages comprise information such as packet names of the second continuous application. The first connection service manager and the first authentication service manager bind authentication service according to the packet name of the second connection application and perform application authentication. After the application authentication is successful, the first connection service manager acquires an application icon and notifies a desktop starter of the first terminal device to display a connection notification in the form of an icon.
When the first terminal device is a receiving end of the application connection, an icon of the first connection application may be displayed in a task bar (or dock bar) of the first terminal device.
When the first terminal equipment receives the event that the user clicks the connection application icon, if the first connection application is installed in the first terminal equipment and the first connection application is not started, the first connection service manager pulls up the first connection application and instructs the first connection application to load the transitional animation effect, and the first connection application can start and load the transitional animation effect.
Further, the first terminal device may perform a procedure similar to the initialization phase and the registration and binding phase of the subsequent application in fig. 6, which is not described here again.
In the process of starting the first connection application, the first connection service manager can request connection data from the second connection service manager through a session path established between the first terminal device and the second terminal device. The specific flow of requesting the following data may refer to the description of fig. 6 above, and will not be repeated here.
Further, after receiving the connection data, the first connection service manager notifies the connection data to the first connection application through the first connection service SDK on the applied communication channel for transmitting the connection data. For example, if the communication channel identified by the communication id+2 of the N communication channels corresponding to the communication ID is used to transmit the connection data, the first connection service manager may send the connection data to the first connection application on the communication channel identified by the communication id+2.
In summary, as shown in fig. 9, an embodiment of the present application provides a method 900 for application connection, where the method 900 may be performed by a terminal device, and the terminal device may have a structure as shown in fig. 3 and fig. 5, but the embodiment of the present application is not limited thereto. The terminal device is provided with a first application and a computer manager. The terminal equipment corresponds to the first terminal equipment and can be used as a transmitting end of application connection and can also be used as a receiving end of application connection. The method 900 includes the steps of:
S901, responding to the operation of clicking the icon of the first application by a user, and acquiring the identification of a target bit in the shared memory, wherein the target bit is a bit with a first preset value, and the first preset value indicates that a communication channel corresponding to the target bit is not used.
In this step, the first application may be the first continuous application, 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 may obtain the identifier 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 may obtain the identifier n=2 of the second bit.
S902, determining a communication identifier corresponding to the target bit based on the identifier of the target bit, wherein the communication identifier indicates at least one communication channel for the first application to communicate with the computer manager.
In combination with the above description, after the terminal device obtains the identifier of the target bit, the communication identifier corresponding to the target bit may be obtained by calculation based on the preset rule, where the communication identifier corresponds to at least one communication channel, so that the terminal device applies for the first application for the IPC communication resource that can be used for communication with the computer manager. The specific description of the communication channel can be found above, and will not be repeated here.
S903, realizing data transmission between the first application and the computer manager based on the at least one communication channel.
In this step, the data transfer between the first application and the computer manager may include the registration continuation service and callback described above, broadcast continuation notification, request continuation data, application de-registration, broadcast communication callback message, and the like.
In the embodiment of the application, the terminal equipment can combine IPC communication with the shared memory to flexibly allocate the IPC communication resource for at least one application accessing the connection service in the computer management home so as to realize the communication between the application and the connection service in the computer management home.
It should be understood that the sequence numbers of the above processes do not mean the order of execution, and the execution order of the processes should be determined by the functions and internal logic of the processes, and should not be construed as limiting the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system, apparatus and module may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a specific implementation of the present application, but the scope of the embodiments of the present application is not limited thereto, and any person skilled in the art may easily think about changes or substitutions within the technical scope of the embodiments of the present application, and all changes and substitutions are included in the scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (13)

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

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
CN116737404A true CN116737404A (en) 2023-09-12

Family

ID=87917427

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN116737404A (en)

Citations (7)

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

Patent Citations (7)

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

Similar Documents

Publication Publication Date Title
JP2010108295A (en) Mobile unit and switching method for application
CN109933381B (en) Kernel loading method and device
EP3779690A1 (en) Processor core scheduling method and apparatus, terminal, and storage medium
CN114968384B (en) Function calling method and device
WO2019019954A1 (en) Terminal-based method for realising multiple android systems, storage medium and terminal
TW201826102A (en) Execution of multiple applications on a device
US20230259250A1 (en) Control method and apparatus, and electronic device
CN116107922A (en) Application management method and electronic device
CN114077411A (en) Data transmission method and device
US20240111595A1 (en) Application deployment method, distributed operating system, electronic device, and storage medium
CN114327087A (en) Input event processing method and device, electronic equipment and storage medium
CN114222003A (en) Service calling method, system, device, equipment and storage medium
WO2023035834A1 (en) Wi-fi direct communication method and apparatus
JP2006277204A (en) Portable communication terminal device
CN116737404A (en) Method and terminal device for application connection
CN115278642A (en) Method for acquiring information of SIM card, electronic equipment and terminal equipment
CN114489826A (en) Chip operation method and device, storage medium and electronic equipment
US20230370420A1 (en) Method for Connection Between Devices, Electronic Device, and Computer-Readable Storage Medium
CN115981576B (en) Method for sharing data, electronic device and storage medium
CN111159734A (en) Communication terminal and multi-application data inter-access processing method
CN115686338B (en) Screen splitting method and electronic equipment
CN117827043A (en) Content connection method and related device
KR100593843B1 (en) An application program management system for a mobile telecommunication terminal
CN116828588B (en) Communication method, readable medium, and electronic device
CN117827473A (en) Content connection method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination