Task migration system and method
The task migration system simplifies task management across devices by displaying user-friendly task cards and interfaces, improving data migration efficiency and user experience through parallel transmission and flexible hardware utilization.
Patent Information
- Application Number
- US18/509319
- Authority / Receiving Office
- US · United States
- Patent Type
- Patents(United States)
- Current Assignee / Owner
- Priority Date
- 2021-11-23
- Filing Date
- 2023-11-15
- Publication Date
- 2026-12-01
- Estimated Expiration
- 2043-07-09
AI Technical Summary
Current methods for migrating tasks between devices are complex and not user-friendly, leading to a reduced user experience.
A task migration system and method that allows users to view and manage historical tasks on another device, displaying task cards and interfaces in a manner that conforms to user habits, supports parallel data transmission, and utilizes hardware capabilities flexibly.
Improves user experience by simplifying task management across devices, enhancing data migration efficiency, and ensuring seamless transitions between applications.
Smart Images

Figure US12817668-D00000_ABST
Abstract
Description
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application is a continuation of International Application No. PCT / CN2022 / 093367, filed on May 17, 2022, which claims priority to Chinese Patent Application No. 202111396815.2 filed on Nov. 23, 2021, and Chinese Patent Application No. 202110614232.6, filed on Jun. 2, 2021, and Chinese Patent Application No. 202110583391.4 filed on May 27, 2021, and Chinese Patent Application No. 202111057294.8 filed on Sep. 9, 2021, and Chinese Patent Application No. 202110611184.5 filed on Jun. 1, 2021, and Chinese Patent Application No. 202110616969.1 filed on Jun. 2, 2021, and Chinese Patent Application No. 202110615954.3 filed on Jun. 2, 2021. All of the aforementioned patent applications are hereby incorporated by reference in their entireties.TECHNICAL FIELD
[0002] This application relates to the field of terminal technologies, and in particular, to a task migration system and method.BACKGROUND
[0003] For a terminal such as a mobile phone or a tablet computer that is currently used by a user, the user usually may slide up from a bottom of a touchscreen of the terminal or tap a “multi-task” button, to enter a recent task (recent task) interface of the terminal. In the recent task interface, the user may query and manage a recently used application on the terminal and another device.
[0004] However, in a current technical solution, in a process in which a user views a task card of a remote device and migrates a task between different devices, operations are complex, and are not friendly enough to the user. Consequently, user experience is reduced.SUMMARY
[0005] This application provides a task migration system and method, so that a user can view and manage a historical task of another device on a device. This may be applied to almost all applications, without requiring an application to be adapted, meets a requirement of the user for managing and controlling a multi-device task, conforms to a use habit of the user, is friendly to the user, helps the user perform a subsequent operation, and improves user experience.
[0006] According to a first aspect, a task migration system is provided. The system includes a first terminal and a second terminal; the second terminal is configured to: run a first application; and when a first user interface of the first application is displayed, switch the first application to run in the background; and the first terminal is configured to: receive task information from the second terminal, where the task information includes information about an application run by the second terminal in the background; receive a first operation from a user; open a recent task interface based on the first operation, where the recent task interface includes a control, and the control includes an identifier of the second terminal; display, in the recent task interface in response to a second operation performed by the user on the identifier of the second terminal, at least one task card corresponding to the application run by the second terminal in the background, where the at least one task card includes a first task card corresponding to the first application; in response to a third operation performed by the user on the first task card, run the first application, and display the first user interface; and display a second user interface in response to a fourth operation performed by the user in the first user interface, where the fourth operation is a back operation, and the second user interface is a parent user interface of the first user interface.
[0007] According to the task migration system provided in the first aspect, when the first application of the second terminal is migrated to the first terminal, after the first terminal displays the first user interface of the first application and receives an operation performed by the user in the first user interface, the first terminal displays a parent interface or a sub-interface of the first user interface, instead of displaying a home screen of the first terminal device. This conforms to a use habit of the user, is friendly to the user, helps the user perform a subsequent operation, and improves user experience.
[0008] In a possible implementation of the first aspect, the first terminal is further configured to: display, in the recent task interface, a second task card corresponding to a recently run application of the first terminal; and in response to the second operation, stop displaying the second task card.
[0009] In a possible implementation of the first aspect, the second terminal is further configured to: segment an application data stream of the first application into a plurality of pieces of segment data, and determine an index table corresponding to the plurality of pieces of segment data, where the index table indicates storage paths and a sequence relationship of the plurality of pieces of segment data in a distributed file system of the second terminal; send the plurality of pieces of segment data to the first terminal in a multi-thread parallel transmission manner; and send the index table to the first terminal; and the first terminal is further configured to: restore the application data stream of the first application based on the plurality of pieces of segment data and the index table that are received; and after receiving the third operation, run the first application based on the third operation and the application data stream of the first application. In this implementation, in a process of migrating data of an application between terminals, an application data stream is segmented, an index table of segment data is established, the segment data is transmitted in parallel through a plurality of threads in the distributed file system, and an index table is transmitted to a peer terminal. The peer terminal restores application data based on the segment data and the index table that are received. In this way, a migration of an application data stream that is at least 200 KB can be supported, application data stream migration efficiency is improved, and user experience is improved.
[0010] In a possible implementation of the first aspect, the at least one task card further includes a third task card corresponding to a first-screen snapshot of a home screen of the second terminal, and at least one of a feature ability FA card, a floating window, and a floating bubble exists on the third task card; and the first terminal is further configured to display a task card of the second terminal in a single row or a plurality of rows in the recent task interface of the first terminal based on any one of landscape-mode use, portrait-mode use, unfolded-state portrait-mode use of a foldable screen, unfolded-state landscape-mode use of the foldable screen, folded-state landscape-mode use of the foldable screen, and folded-state portrait-mode use of the foldable screen of the second terminal. In this implementation, the at least one task card is displayed in a single row or a plurality of rows in the recent task interface of the first terminal based on a state of using the second terminal by the user, a state of using the first terminal by the user, and a screen size of the first terminal. This can improve task card display efficiency of the second terminal, help the user view and manage a historical task of another device on a device, and improve user experience.
[0011] In a possible implementation of the first aspect, the first terminal is further configured to: run the first application based on a hardware capability of the first terminal; or run the first application based on a hardware capability of the second terminal; or run the first application based on a hardware capability of the first terminal and a hardware capability of the second terminal. In this implementation, flexibility in using the hardware capability when the first terminal runs the first application may be improved, to ensure efficiency of running the first application by the first terminal.
[0012] According to a second aspect, a task migration method is provided. The method is applied to a first terminal, and the method includes: receiving task information from a second terminal, where the task information includes information about an application run by the second terminal in the background; receiving a first operation from a user; opening a recent task interface based on the first operation, where the recent task interface includes a control, and the control includes an identifier of the second terminal; displaying, in the recent task interface in response to a second operation performed by the user on the identifier of the second terminal, at least one task card corresponding to the application run by the second terminal in the background, where the at least one task card includes a first task card corresponding to a first application run by the second terminal in the background; in response to a third operation performed by the user on the first task card, running the first application, and displaying a first user interface of the first application; and displaying a second user interface in response to a fourth operation performed by the user in the first user interface, where the fourth operation is a back operation, and the second user interface is a parent user interface of the first user interface.
[0013] According to the task migration method provided in the second aspect, when the first application of the second terminal is migrated to the first terminal, after the first terminal displays the first user interface of the first application and receives an operation performed by the user in the first user interface, the first terminal displays a parent interface or a sub-interface of the first user interface, instead of displaying a home screen of the first terminal device. This conforms to a use habit of the user, is friendly to the user, helps the user perform a subsequent operation, and improves user experience.
[0014] In a possible implementation of the second aspect, the method further includes: displaying, in the recent task interface, a second task card corresponding to a recently run application of the first terminal.
[0015] In a possible implementation of the second aspect, the control further includes an identifier of the first terminal, and the method further includes: Before displaying the second task card in the recent task interface, the first terminal receives an operation performed by the user on the identifier of the first terminal.
[0016] In a possible implementation of the second aspect, the method further includes: Before the second operation, the first terminal displays the second task card in the recent task interface; and after the second operation, the first terminal stops displaying the second task card.
[0017] In a possible implementation of the second aspect, the method further includes: After the second operation, the first terminal continues to display the second task card in the recent task interface.
[0018] In a possible implementation of the second aspect, before the first terminal device displays the first user interface, the method further includes: receiving a task stack sent by the second terminal device, where the task stack includes a first activity record and a second activity record, where the first activity record includes interface data of the first user interface and user data of the first user interface, and the second activity record includes interface data of the second user interface and user data of the second user interface. In this implementation, the first terminal device may restore and display a once-opened user interface on the second terminal device based on the task stack.
[0019] In a possible implementation of the second aspect, the first activity record and the second activity record are stored next to each other in the task stack, the first activity record is read by the first terminal device before the second activity record, and before the first terminal device displays the first user interface, the method further includes: generating the first user interface based on the interface data of the first user interface, and storing a state of the first user interface based on the user data of the first user interface; and before the first terminal device displays the second user interface, the method further includes: generating the second user interface based on the interface data of the second user interface, and storing a state of the second user interface based on the user data of the second user interface. In this way, the first terminal device may first restore the first user interface based on information carried in the task stack, and may further store a state of using the first user interface by the user; and when the user performs a back operation, may restore the second user interface, and may further store a state of using the second user interface by the user.
[0020] In a possible implementation of the second aspect, the method further includes: receiving, in a multi-thread parallel receiving manner, a plurality of pieces of segment data sent by the second terminal, where the plurality of pieces of segment data are obtained by segmenting an application data stream of the first application; receiving an index table sent by the second terminal, where the index table indicates storage paths and a sequence relationship of the plurality of pieces of segment data in a distributed file system of the second terminal; restoring the application data stream of the first application based on the plurality of pieces of segment data and the index table that are received; and after the third operation is detected, running the first application based on the third operation and the application data stream of the first application. In this implementation, in a process of migrating data of an application between terminals, an application data stream is segmented, an index table of segment data is established, the segment data is transmitted in parallel through a plurality of threads in the distributed file system, and an index table is transmitted to a peer terminal. The peer terminal restores application data based on the segment data and the index table that are received. In this way, a migration of an application data stream that is at least 200 KB can be supported, application data stream migration efficiency is improved, and user experience is improved.
[0021] In a possible implementation of the second aspect, a data amount of each of the plurality of pieces of segment data is fixed, and / or the index table includes message header information corresponding to each of the plurality of pieces of segment data; and the message header information corresponding to each piece of segment data includes a correspondence between a segment number and a segment data path of each piece of segment data, and length information, start identifier information, and end identifier information that are of each piece of segment data.
[0022] In a possible implementation of the second aspect, the method further includes: receiving a fifth operation performed by the user, where the fifth operation is used to trigger sending of a first task instruction to the second terminal, and the first task instruction instructs the second terminal to clear the first application; sending first information to the second terminal, where the first information includes information about the first task instruction; and trying to hold a second local lock based on the first task instruction, where the second local lock is used to ensure that the first application on the second terminal executes a task instruction from only one device at a same time point, and the second local lock can be held by only one device at a same time point.
[0023] In this implementation, it is ensured that a target device (the second terminal) executes only a task instruction from one device at a same time point, to avoid a conflict between a plurality of cross-device tasks, resolve a problem of instability in a cross-device task scenario, and improve user experience.
[0024] In a possible implementation of the second aspect, the method further includes: trying to hold a first local lock of the first terminal based on the first task instruction, where the first local lock is used to ensure that the first terminal can send one task instruction to only one device at a same time point, the first local lock can be held by only one device at a same time point, and the first terminal successfully holds the first local lock. In this implementation, because the first terminal successfully holds the first local lock corresponding to the task instruction, it is proved that the first terminal does not currently send another cross-device task instruction to the second terminal, that is, the task instruction may occupy the first local lock, to ensure that task instructions sent by the first terminal to the second terminal do not conflict, and improve efficiency and a success rate of sending the task instruction.
[0025] In a possible implementation of the second aspect, the at least one task card further includes a third task card corresponding to a first-screen snapshot of a home screen of the second terminal, at least one of a feature ability FA card, a floating window, and a floating bubble exists on the third task card, and the method further includes: When the task card of the second terminal is displayed in the recent task interface of the first terminal, the first terminal displays the task card of the second terminal in a single row or a plurality of rows in the recent task interface of the first terminal based on any one of landscape-mode use, portrait-mode use, unfolded-state portrait-mode use of a foldable screen, unfolded-state landscape-mode use of the foldable screen, folded-state landscape-mode use of the foldable screen, and folded-state portrait-mode use of the foldable screen of the second terminal. In this implementation, the at least one task card is displayed in a single row or a plurality of rows in the recent task interface of the first terminal based on a state of using the second terminal by the user, a state of using the first terminal by the user, and a screen size of the first terminal. This can improve task card display efficiency of the second terminal, help the user view and manage a historical task of another device on a device, and improve user experience.
[0026] In a possible implementation of the second aspect, the method further includes: running the first application based on a hardware capability of the first terminal; or running the first application based on a hardware capability of the second terminal; or running the first application based on a hardware capability of the first terminal and a hardware capability of the second terminal. In this implementation, flexibility of running the first application by the first terminal may be improved, and efficiency of running the first application by the first terminal is ensured.
[0027] According to a third aspect, a task migration system is provided. The system includes a first terminal and a second terminal; the second terminal is configured to run a first application; and the first terminal is configured to: receive a sixth operation from a user; display a third user interface based on the sixth operation, where the third user interface includes a control, and the control includes an identifier of the second terminal; display a fourth user interface in response to a seventh operation performed by the user on the identifier of the second terminal, where the fourth user interface includes a home screen application identifier of the second terminal; and run the first application in response to an eighth operation performed by the user on an identifier of the first application in the home screen application identifier of the second terminal.
[0028] According to the task migration system provided in the third aspect, a home screen application of another device may be displayed on the first terminal, and a super home screen function may be implemented on the first terminal, so that the user operates and manages a home screen application of another terminal on the first terminal. This is friendly to the user, and improves user experience.
[0029] In a possible implementation of the third aspect, the first terminal is further configured to: receive a ninth operation performed by the user on the home screen application identifier of the second terminal, where the ninth operation includes at least one of sorting a home screen application, creating a folder, and deleting the home screen application; and display the home screen application identifier of the second terminal after the ninth operation; and the second terminal is further configured to display the home screen application identifier of the second terminal after the ninth operation. In this implementation, the user can manage a home screen application of the second terminal on the first terminal. This facilitates an operation of the user, is friendly to the user, and improves user experience.
[0030] In a possible implementation of the third aspect, the first terminal is further configured to display the first application in a floating window, in split screen, or in full screen. In this implementation, flexibility of displaying the second application by the first terminal is improved, and user experience is improved.
[0031] According to a fourth aspect, a task migration method is provided. The method is applied to a first terminal, and the method includes: receiving a sixth operation from a user; displaying a third user interface based on the sixth operation, where the third user interface includes a control, and the control includes an identifier of a second terminal; displaying a fourth user interface in response to a seventh operation performed by the user on the identifier of the second terminal, where the fourth user interface includes a home screen application identifier of the second terminal; and running a first application in response to an eighth operation performed by the user on an identifier of the first application in the home screen application identifier of the second terminal.
[0032] According to the task migration method provided in the fourth aspect, the home screen application of another device may be displayed on the first terminal, and a super home screen function may be implemented on the first terminal, so that the user operates and manages a home screen application of another terminal on the first terminal. This is friendly to the user, and improves user experience.
[0033] In a possible implementation of the fourth aspect, the method further includes: receiving a ninth operation performed by the user on the home screen application identifier of the second terminal, where the ninth operation includes at least one of sorting a home screen application, creating a folder, and deleting the home screen application; and displaying the home screen application identifier of the second terminal after the ninth operation.
[0034] In a possible implementation of the fourth aspect, the method further includes: displaying the second application in a floating window, in split screen, or in full screen.
[0035] In a possible implementation of the fourth aspect, the method further includes: displaying the home screen application identifier of the second terminal in a home screen application layout form of the second terminal; or displaying the home screen application identifier of the second terminal in a home screen application layout form of the first terminal. In this implementation, flexibility of displaying a home screen application of another terminal by the first terminal is improved, and user experience is improved.
[0036] According to a fifth aspect, a task migration system is provided. The system includes a first terminal and a second terminal, and the method includes: The first terminal displays a recent task interface. An icon and at least one task card of the second terminal are displayed in the recent task interface. When the task card of the second terminal is displayed in the recent task interface of the first terminal, the task card of the second terminal is laid out in the recent task interface of the first terminal based on a state of using the second terminal by a user. The state of using the second terminal by the user includes any one of a landscape-mode use state, a portrait-mode use state, an unfolded-state portrait-mode use state of a foldable screen, an unfolded-state landscape-mode use state of the foldable screen, a folded-state landscape-mode use state of the foldable screen, and a folded-state portrait-mode use state of the foldable screen.
[0037] According to the task migration system provided in the fifth aspect, the task card of the second terminal is displayed in a single row or a plurality of rows in the recent task interface of the first terminal based on the state of using the second terminal by the user, a state of using the first terminal by the user, and a screen size of the first terminal. This can improve task card display efficiency of the second terminal, help the user view and manage a historical task of another device on a device, and improve user experience.
[0038] For example, the first terminal or the second terminal may include a mobile phone, a large-screen device, a tablet computer, a PC, an in-vehicle infotainment system, a foldable-screen device, and the like.
[0039] In a possible implementation of the fifth aspect, when the task card of the second terminal is displayed in the recent task interface of the first terminal, the task card of the second terminal includes a task card of a first-screen snapshot of a home screen of the second terminal. In this implementation, a home screen snapshot of the second terminal may be displayed in the recent task interface of the first terminal, to facilitate viewing by the user, and improve user experience.
[0040] In a possible implementation of the fifth aspect, at least one of an FA card, a floating window, and a floating bubble exists on the task card of the first-screen snapshot of the home screen of the second terminal and / or a task card of a second-screen snapshot of the home screen of the second terminal. In this implementation, the home screen snapshot of the second terminal may display the FA card, the floating window, or the floating bubble, to flexibly display the task card of the second terminal in the recent task interface of the first terminal in different manners, and improve user experience.
[0041] In a possible implementation of the fifth aspect, the first terminal is further configured to: receive a third operation performed by the user on the FA card, the floating window, or the floating bubble; and display a first-screen interface of the home screen of the second terminal on the first terminal based on the third operation, or run the FA card, the floating window, or an application corresponding to the floating bubble on the first terminal. In this implementation, the user may perform an operation on the FA card, the floating window, or the floating bubble on the home screen snapshot of the second terminal, to quickly display or open the application on the second terminal. In this way, an operation is simple, and user experience is improved.
[0042] In a possible implementation of the fifth aspect, when the task card of the second terminal is displayed in the recent task interface of the first terminal, the task card of the second terminal includes a snapshot of a control device configured to control the second terminal. In this implementation, a task card related to the second terminal may be flexibly displayed in the recent task interface of the first terminal, to improve user experience.
[0043] In a possible implementation of the fifth aspect, the first terminal is further configured to: receive a fourth operation performed by the user on the snapshot of the control device; and display a detail interface of the control device on the first terminal based on the fourth operation, or remotely control the second terminal. In this implementation, the user may view, on the first terminal, a task card of the control device that controls the second device, and may perform an operation on the task card, to quickly control the second terminal device on the first terminal. In this way, an operation is simple, and user experience is improved.
[0044] For example, the second terminal is a large-screen device, and the control device is a remote control.
[0045] In a possible implementation of the fifth aspect, when the task card of the second terminal is displayed in the recent task interface of the first terminal, the task card of the second terminal includes a task card of a home screen application of the second terminal.
[0046] In a possible implementation of the fifth aspect, the first terminal is further configured to: receive a fifth operation performed by the user on an application on the task card of the home screen application of the second terminal; and manage the home screen application of the second terminal on the first terminal based on the fifth operation. In this implementation, the user may view a home screen application icon of the second terminal on the first terminal, and may perform an operation on the home screen application icon, to help the second terminal manage the application (sort the application, create a folder, delete the application, or the like), and quickly help, on the first terminal, the second terminal manage the application. In this way, an operation is simple, and user experience is improved.
[0047] In a possible implementation of the fifth aspect, the system further includes a lightweight device, the lightweight device includes a wearable device and a smart home device that are used by the user, and when a task card of the lightweight device is displayed in the recent task interface of the first terminal, the task card of the lightweight device includes task cards respectively corresponding to ongoing tasks of different lightweight devices. In this implementation, the task card of the lightweight device may be displayed in the recent task interface of the first terminal, to enrich types of task cards displayed in the recent task interface of the first terminal. This is friendly to the user.
[0048] For example, the lightweight device is a general term of devices such as an IOT device, the wearable device, and the smart home device. For example, the lightweight device may include a smart refrigerator, a smart air conditioner, a smart wok, a smart kitchen hood, a smart sound box, a smartwatch, and the like.
[0049] In a possible implementation of the fifth aspect, the first terminal is further configured to: receive a sixth operation performed by the user on the task card of the device; and display a detail interface of the ongoing task of the lightweight device on the first terminal based on the sixth operation, or remotely control the ongoing task of the lightweight device. In this implementation, the user may view, on the first terminal, a task card corresponding to an ongoing task of an associated lightweight device, and may perform an operation on the card corresponding to the ongoing task of the lightweight device, to remotely control the ongoing task of the lightweight device. In this way, an operation is simple, and user experience is improved.
[0050] In a possible implementation of the fifth aspect, the system further includes a third terminal, and the first terminal is further configured to: receive a seventh operation performed by the user on the task card of the lightweight device; and share the task card of the lightweight device with the third terminal based on the seventh operation; and the third terminal displays the task card of the lightweight device in a recent task interface. In this implementation, the task card of the lightweight device may be pushed to the third terminal for display, so that the user controls the ongoing task of the lightweight device on the third terminal, to improve user experience.
[0051] In a possible implementation of the fifth aspect, a first lightweight device is further configured to: display, in a display interface of the first lightweight device, a task card corresponding to an ongoing task of a second lightweight device; receive an eighth operation performed by the user on the task card corresponding to the ongoing task of the second lightweight device; and remotely control the ongoing task of the second lightweight device based on the eighth operation. In this implementation, the user may remotely control an ongoing task of another lightweight device on a lightweight device. In this way, an operation is simple, and user experience is improved.
[0052] In a possible implementation of the fifth aspect, the first lightweight device is further configured to: authenticate an identity of the user by using the first lightweight device and / or a device associated with the first lightweight device; and after authentication of the identity of the user succeeds, display a task card of the first terminal and / or the second terminal in the display interface of the first lightweight device.
[0053] According to a sixth aspect, a task migration method is provided. The method is applied to a first terminal, and the method includes: The first terminal displays a recent task interface. An icon and at least one task card of a second terminal are displayed in the recent task interface, and N devices include the first terminal and the second terminal. When the task card of the second terminal is displayed in the recent task interface of the first terminal, the task card of the second terminal is displayed in a single row or a plurality of rows in the recent task interface of the first terminal based on any one of landscape-mode use, portrait-mode use, unfolded-state portrait-mode use of a foldable screen, unfolded-state landscape-mode use of the foldable screen, folded-state landscape-mode use of the foldable screen, and folded-state portrait-mode use of the foldable screen of the second terminal.
[0054] According to the task migration method provided in the sixth aspect, the task card of the second terminal is displayed in a single row or a plurality of rows in the recent task interface of the first terminal based on a state of using the second terminal by a user, a state of using the first terminal by the user, and a screen size of the first terminal. This can improve task card display efficiency of the second terminal, help the user view and manage a historical task of another device on a device, and improve user experience.
[0055] In a possible implementation of the sixth aspect, the task card of the second terminal includes a task card of a first-screen snapshot of a home screen of the second terminal and a task card of a second-screen snapshot of the home screen of the second terminal.
[0056] In a possible implementation of the sixth aspect, at least one of a feature ability FA card, a floating window, and a floating bubble exists on the task card of the first-screen snapshot of the home screen of the second terminal and / or the task card of the second-screen snapshot of the home screen of the second terminal.
[0057] In a possible implementation of the sixth aspect, the method further includes: A task card of a lightweight device is displayed in the recent task interface of the first terminal, the task card of the lightweight device includes task cards respectively corresponding to ongoing tasks of different lightweight devices. The lightweight device includes a wearable device and a smart home device that are used by the user.
[0058] In a possible implementation of the sixth aspect, a source device corresponding to a first application is the second terminal, and in a process in which the first application is migrated to the first terminal for running, the method further includes: The first terminal determines a running state of the first application based on different modes in which the first application is migrated to the first terminal. Different modes in which the first application is migrated to the first terminal include a replication mode, a migration mode based on a window projection technology, and a migration mode based on a feature ability FA technology.
[0059] In a possible implementation of the sixth aspect, a source device corresponding to a second application is the first terminal, and in a process in which the second application is migrated to the second terminal for running, the method further includes: The first terminal releases a hardware capability that is of the first terminal and that is occupied by the second application; or the first terminal does not release a hardware capability that is of the first terminal and that is occupied by the second application.
[0060] According to a seventh aspect, a task migration method is provided. The method is applied to a first terminal, and the method includes: opening a recent task interface, where the task interface includes a first task card corresponding to a first application, and the first application is an application run by a second terminal in the background; and receiving a first operation performed by a user on the first task card, and indicating the second terminal to perform a second operation corresponding to the first operation on the first application.
[0061] According to the task migration method provided in the seventh aspect, the user of the first terminal may perform the first operation on a task card in the recent task interface, to indicate the second terminal to perform a corresponding second operation on an application corresponding to the task card, so that the user can control a recently used application of the second terminal, to improve user experience.
[0062] In a possible implementation of the seventh aspect, the receiving a first operation performed by a user on the first task card, and indicating the second terminal to perform a second operation corresponding to the first operation on the first application includes: receiving a slide-up operation performed by the user on the first task card, and indicating the second terminal to clear the first application. After the second terminal clears the first application, the first terminal stops displaying the first task card in the recent task interface.
[0063] In a possible implementation of the seventh aspect, the recent task interface further includes a first control indicating the first terminal and a second control indicating the second terminal; and the receiving a first operation performed by a user on the first task card, and indicating the second terminal to perform a second operation corresponding to the first operation on the first application includes: receiving an operation that the user drags the first task card to the first control, and indicating the second terminal to migrate the first application to the first terminal. In this case, the first terminal runs the first application.
[0064] In a possible implementation of the seventh aspect, the first terminal recently runs a second application. In the recent task interface, the user of the first terminal drags a task card of the second application to the second control, to migrate the second application to the second terminal.
[0065] In a possible implementation of the seventh aspect, the receiving a first operation performed by a user on the first task card, and indicating the second terminal to perform a second operation corresponding to the first operation on the first application includes: receiving an operation that the user drags the first task card to the second control, and indicating the second terminal to run the first application in the foreground.
[0066] According to an eighth aspect, a task migration method is provided. The method includes: A first terminal obtains a to-be-transmitted application data stream; the first terminal segments the application data stream into a plurality of pieces of segment data, and determines an index table corresponding to the plurality of pieces of segment data, where the index table indicates storage paths and a sequence relationship of the plurality of pieces of segment data in a distributed file system of the first terminal; the first terminal sends the plurality of pieces of segment data to a second terminal in a multi-thread parallel transmission manner; and the first terminal sends the index table to the second terminal.
[0067] According to the task migration method provided in the eighth aspect, in a process of migrating data of an application between terminals, an application data stream is segmented, an index table of segment data is established, the segment data is transmitted in parallel through a plurality of threads in the distributed file system, and an index table is transmitted to a peer terminal. The peer terminal restores application data based on the segment data and the index table that are received. In this way, a migration of an application data stream that is at least 200 KB can be supported, application data stream migration efficiency is improved, and user experience is improved.
[0068] In a possible implementation of the eighth aspect, that the first terminal segments the application data stream into a plurality of pieces of segment data includes: The first terminal determines a quantity of segments based on a total quantity of threads included in a thread pool of the first terminal; and the first terminal segments the application data stream into the plurality of pieces of segment data based on the quantity of segments.
[0069] For example, it may be determined that the total quantity of threads included in the thread pool of the first terminal is the quantity of segments. In other words, the quantity of segments may be the same as the total quantity of threads included in the thread pool. Alternatively, the quantity of segments may be determined based on the total quantity of threads included in the thread pool. In other words, the quantity of segments may be different from the total quantity of threads included in the thread pool.
[0070] For example, if the total quantity of threads included in the thread pool may be two times of a core quantity of a CPU of the first terminal, the quantity of segments is also two times of the core quantity of the CPU of the first terminal.
[0071] In a possible implementation of the eighth aspect, if a value of a byte stream is greater than or equal to 200 KB, the first terminal segments the application data stream into the plurality of pieces of data. If a size of a byte stream is less than 200 KB, the first terminal sends the byte stream to the second terminal by writing the byte stream into a parcel for RPC transmission.
[0072] In a possible implementation of the eighth aspect, a data amount of each of the plurality of pieces of segment data is fixed. In this solution, the plurality of pieces of segment data are sent in parallel through a plurality of threads, instead of being sent in series. The plurality of pieces of segment data may be separately sent, instead of sending the plurality of pieces of segment data as a whole. A peer device may restore data based on only received partial segment data, or a peer device may restore data based on all received segment data. In other words, the segment data is sent in a parallel stream transmission manner. In this way, data transmission efficiency can be greatly improved.
[0073] In a possible implementation of the eighth aspect, the index table includes message header information corresponding to each of the plurality of pieces of segment data. In this solution, the message header information corresponding to each piece of segment data includes a correspondence between a segment number and a segment data path of each piece of segment data, and length information, start identifier information, and end identifier information that are of each piece of segment data. Information or content indicated by the message header field of the segment data is located in the index table instead of the segment data.
[0074] In a possible implementation of the eighth aspect, that the first terminal sends the index table to the second terminal includes: The first terminal sends the index table to the second terminal by writing the index table into a parcel for an RPC. In other words, the index table is transmitted in an RPC manner. The first terminal stores data of the index table by using an intent, and then writes the intent into the parcel for transmission.
[0075] In a possible implementation of the eighth aspect, the index table may also be transmitted in a same manner as the segment data. For example, the index table may be segmented based on the quantity of segments, to obtain segment index table data, the segment index table data is stored in the distributed file system, a segment number of each piece of segment index table data and an index of a segment index table data path may be established, and the index table is sent to the second terminal by transmitting segment index data in parallel through a plurality of threads.
[0076] In a possible implementation of the eighth aspect, a data amount of the to-be-transmitted application data stream is greater than or equal to 200 KB.
[0077] In a possible implementation of the eighth aspect, the application data stream includes at least one of a data stream of a document editing application, a data stream of an audio application, a data stream of a video application, or a data stream of a recently run application of the first terminal.
[0078] For example, the data stream of the recently run application of the first terminal (that is, an application run by the first terminal in the background) may be recent task information of the first terminal.
[0079] For example, a recent task interface may be displayed on the first terminal, and the recent task interface is an interface that is in a system UI and that displays a recently run task of the terminal. When the first terminal is triggered to open the recent task interface, a display of the first terminal may display the recently run task of the terminal, or a recently run application (recent task information). The first terminal may send the data stream of the recently run application (a data stream of the recent task information) of the first terminal to the second terminal, and the user may view a recently used application of the first terminal on the second terminal, or further clear a recently used application of the second terminal of the user.
[0080] According to a ninth aspect, a task migration method is provided. The method includes: A second terminal receives, in a multi-thread parallel receiving manner, a plurality of pieces of segment data sent by a first terminal, where the plurality of pieces of segment data are obtained by segmenting a to-be-transmitted application data stream; the second terminal receives an index table sent by the first terminal, where the index table indicates storage paths and a sequence relationship of the plurality of pieces of segment data in a distributed file system of the second terminal; and the second terminal restores the application data stream based on the plurality of pieces of segment data and the index table.
[0081] According to the task migration method provided in the ninth aspect, in a process of migrating data of an application between terminals, an application data stream is segmented, an index table of segment data is established, the segment data is transmitted in parallel through a plurality of threads in the distributed file system, and an index table is transmitted to a peer terminal. The peer terminal restores application data based on the segment data and the index table that are received. In this way, a migration of an application data stream that is at least 200 KB can be supported, application data stream migration efficiency is improved, and user experience is improved.
[0082] In a possible implementation of the ninth aspect, a data amount of each of the plurality of pieces of segment data is fixed.
[0083] In a possible implementation of the ninth aspect, the index table includes message header information corresponding to each of the plurality of pieces of segment data.
[0084] In a possible implementation of the ninth aspect, the message header information corresponding to each piece of segment data includes a correspondence between a segment number and a segment data path of each piece of segment data, and length information, start identifier information, and end identifier information that are of each piece of segment data.
[0085] In a possible implementation of the ninth aspect, when the application data stream is a data stream of a document editing application, that the second terminal restores the application data stream based on the plurality of pieces of segment data and the index table includes: After receiving all the segment data, the second terminal restores the data stream of the document editing application based on the index table. In this solution, the second terminal can restore document data only after all pieces of segment data are received.
[0086] In a possible implementation of the ninth aspect, when the application data stream is a data stream of an audio application or a data stream of a video application, that the second terminal restores the application data stream based on the plurality of pieces of segment data and the index table includes: After receiving partial segment data, the second terminal restores the data stream of the audio application or the data stream of the video application based on the index table. In this solution, the second terminal can restore data before all the segment data is received, and can start to restore data of the audio or video application after receiving the partial segment data. In other words, the second electronics may simultaneously receive the segment data and restore the received segment data. After restoring the data of the audio or video application, the user may obtain a current audio or video playing progress on the second terminal, and start to continue to play.
[0087] In a possible implementation of the ninth aspect, the application data stream includes at least one of a data stream of a document editing application, a data stream of an audio application, a data stream of a video application, or a data stream of a recently run application of the first terminal.
[0088] According to a tenth aspect, a task migration system is provided. The system includes a first terminal and a second terminal, and the first terminal and the second terminal are connected through a network. The first terminal is configured to: segment a to-be-transmitted application data stream into a plurality of pieces of data, and determine an index table corresponding to the plurality of pieces of data, where the index table indicates storage paths and a sequence relationship of the plurality of pieces of segment data in a distributed file system of the first terminal; send the plurality of pieces of segment data to the second terminal in a multi-thread parallel transmission manner; and send the index table to the second terminal. The second terminal is configured to: restore the application data stream based on the plurality of pieces of segment data and the index table that are received.
[0089] According to the task migration system provided in the tenth aspect, in a process of migrating data of an application between terminals, an application data stream is segmented, an index table of segment data is established, the segment data is transmitted in parallel through a plurality of threads in the distributed file system, and an index table is transmitted to a peer terminal. The peer terminal restores application data based on the segment data and the index table that are received. In this way, a migration of an application data stream that is at least 200 KB can be supported, application data stream migration efficiency is improved, and user experience is improved.
[0090] In a possible implementation of the tenth aspect, a data amount of each of the plurality of pieces of segment data is fixed.
[0091] In a possible implementation of the tenth aspect, if a value of a byte stream is greater than or equal to 200 KB, the first terminal segments the application data stream into the plurality of pieces of data. If a size of a byte stream is less than 200 KB, the first terminal sends the byte stream to the second terminal by writing the byte stream into a parcel for RPC transmission.
[0092] In a possible implementation of the tenth aspect, the index table includes message header information corresponding to each of the plurality of pieces of segment data; and the message header information corresponding to each piece of segment data includes a correspondence between a segment number and a segment data path of each piece of segment data, and length information, start identifier information, and end identifier information that are of each piece of segment data.
[0093] In a possible implementation of the tenth aspect, the first terminal is further configured to send the index table to the second terminal by writing the index table into a parcel for a remote procedure call RPC.
[0094] In a possible implementation of the tenth aspect, the application data stream includes at least one of a data stream of a document editing application, a data stream of an audio application, a data stream of a video application, or a data stream of a recently run application (that is, an application run in the background) of the first terminal.
[0095] According to an eleventh aspect, a task migration system is provided. The system includes a first terminal and a second terminal, and a communication connection is established between the first terminal and the second terminal. The second terminal is configured to run a first application. The first terminal is configured to: receive a user interface option that is of a first user interface and that is sent by the second terminal, where the first user interface is a user interface of the first application; detect a first operation performed by a user on the user interface option of the first user interface; display the first user interface; detect a second operation performed by the user in the first user interface; and display a second user interface, where the second user interface is a user interface of the first application, and is different from the first user interface.
[0096] According to the task migration system provided in the eleventh aspect, a task migration may be performed between the first terminal and the second terminal, so that the user can execute, on the first terminal, a task on the second terminal, to improve user experience.
[0097] In a possible implementation of the eleventh aspect, the second operation is a back operation, and the second user interface is a parent user interface of the first user interface. In this way, the user may perform a same operation on the first terminal, to implement a same user interface display sequence as that on the second terminal.
[0098] In a possible implementation of the eleventh aspect, before the first terminal displays the first user interface, the first terminal is further configured to receive a task stack sent by the second terminal. The task stack includes a first activity record and a second activity record, the first activity record includes interface data of the first user interface and user data of the first user interface, and the second activity record includes interface data of the second user interface and user data of the second user interface. In this way, the first terminal may restore and display a once-opened user interface on the second terminal based on the task stack.
[0099] In a possible implementation of the eleventh aspect, the first activity record and the second activity record are stored next to each other in the task stack, the first activity record is read by the first terminal before the second activity record, and before the first terminal displays the first user interface, the first terminal is further configured to: generate the first user interface based on the interface data of the first user interface, and store a state of the first user interface based on the user data of the first user interface; and before the first terminal displays the second user interface, the first terminal is further configured to: generate the second user interface based on the interface data of the second user interface, and store a state of the second user interface based on the user data of the second user interface. In this way, the first terminal may first restore the first user interface based on information carried in the task stack, and may further store a state of using the first user interface by the user; and when the user performs a back operation, may restore the second user interface, and may further store a state of using the second user interface by the user.
[0100] In a possible implementation of the eleventh aspect, before the first terminal detects the first operation performed by the user on the user interface option of the first user interface, the first terminal is further configured to display a third user interface. The third user interface includes a control and a user interface option of a recently run application of the second terminal, the control includes an identifier of the first terminal and an identifier of the second terminal, and the user interface option of the recently run application of the second terminal includes the user interface option of the first user interface. In this way, the user can view a recently run application of the first terminal and the recently run application of the second terminal, and may tap the user interface option of the recently run application of the second terminal to display the first user interface on the first terminal.
[0101] In a possible implementation of the eleventh aspect, before the first terminal displays the third user interface, the first terminal is further configured to: detect a third operation performed by the user, where the third operation indicates the first terminal to display the third user interface; and send a second request to the second terminal, where the second request indicates the second terminal to send, to the first terminal, a user interface snapshot captured by the system when the recently run application runs in the background. In this way, consumption of traffic or power generated by synchronizing recent task information can be reduced when user experience is ensured.
[0102] In a possible implementation of the eleventh aspect, before receiving the task stack sent by the second terminal, the first terminal is further configured to send a first request to the second terminal. The first request indicates the second terminal to send the task stack to the first terminal. In this way, consumption of traffic or power generated by synchronizing recent task information can be reduced when user experience is ensured.
[0103] In a possible implementation of the eleventh aspect, before the first terminal receives the user interface option that is of the first user interface and that is sent by the second terminal, the first terminal is further configured to establish a trusted relationship with the second terminal. In this way, privacy of the user is protected, and security of this solution is increased.
[0104] In a possible implementation of the eleventh aspect, the system further includes a third terminal, and the third terminal establishes a communication connection to the first terminal. The third terminal is configured to: receive a user interface option that is of a first user interface and that is sent by the first terminal, where the first user interface is a user interface of the first application; detect the first operation performed by the user on the user interface option of the first user interface; display the first user interface; detect the second operation performed by the user in the first user interface; and display the second user interface, where the second user interface is a user interface of the first application, and is different from the first user interface. In this way, the first terminal may also perform a task migration to the third terminal in a same manner.
[0105] According to a twelfth aspect, a task migration method is provided. The method is applied to a first terminal, and the method includes: The first terminal receives a user interface option that is of a first user interface and that is sent by a second terminal. The first user interface is a user interface of a first application, and the first application is a recently run application of the second terminal. The first terminal detects a first operation performed by a user on the user interface option of the first user interface. The first terminal displays the first user interface. The first terminal detects a second operation performed by the user in the first user interface. The first terminal displays a second user interface. The second user interface is a user interface of the first application, and is different from the first user interface.
[0106] In a possible implementation of the twelfth aspect, the first operation is a back operation, and the second user interface is a parent user interface of the first user interface.
[0107] In a possible implementation of the twelfth aspect, before the first terminal displays the first user interface, the method further includes: The first terminal receives a task stack sent by the second terminal. The task stack includes a first activity record and a second activity record, the first activity record includes interface data of the first user interface and user data of the first user interface, and the second activity record includes interface data of the second user interface and user data of the second user interface.
[0108] In a possible implementation of the twelfth aspect, the first activity record and the second activity record are stored next to each other in the task stack, the first activity record is read by the first terminal before the second activity record, and before the first terminal displays the first user interface, the method further includes: The first terminal generates the first user interface based on the interface data of the first user interface, and stores a state of the first user interface based on the user data of the first user interface; and before the first terminal displays the second user interface, the method further includes: The first terminal generates the second user interface based on the interface data of the second user interface, and stores a state of the second user interface based on the user data of the second user interface.
[0109] In a possible implementation of the twelfth aspect, before the first terminal detects the first operation performed by the user on the user interface option of the first user interface, the method further includes: The first terminal displays a third user interface. The third user interface includes a control and a user interface option of the recently run application of the second terminal, the control includes an identifier of the first terminal and an identifier of the second terminal, and the user interface option of the recently run application of the second terminal includes the user interface option of the first user interface.
[0110] In a possible implementation of the twelfth aspect, before the first terminal displays the third user interface, the method further includes: The first terminal detects a third operation performed by the user. The third operation indicates the first terminal to display the third user interface. The first terminal sends a second request to the second terminal. The second request indicates the second terminal to send, to the first terminal, a user interface snapshot captured by the system when the recently run application runs in the background.
[0111] In a possible implementation of the twelfth aspect, before the task stack sent by the second terminal is received, the method further includes: The first terminal sends a first request to the second terminal. The first request indicates the second terminal to send the task stack to the first terminal.
[0112] In a possible implementation of the twelfth aspect, before the first terminal displays the first user interface, the method further includes: The first terminal establishes a trusted relationship with the second terminal.
[0113] According to a thirteenth aspect, a task migration method is provided. The method is applied to a second terminal, and the method includes: The second terminal receives a second request sent by a first terminal. The second request indicates the second terminal to send, to the first terminal, a user interface snapshot captured by the system when a recently run application runs in the background. The second terminal sends, to the first terminal, the user interface snapshot captured by the system when the recently run application runs in the background.
[0114] In a possible implementation of the thirteenth aspect, the method further includes: The second terminal receives a first request sent by the first terminal. The first request indicates the second terminal to send a task stack to the first terminal. The second terminal sends the task stack to the first terminal.
[0115] According to a fourteenth aspect, a task migration system is provided. The system includes a first terminal, a second terminal, and a third terminal, and the first terminal, the second terminal, and the third terminal are connected through a network. The first terminal is configured to: receive a first operation performed by a user, where the first operation is used to trigger sending of a first task instruction to the second terminal; send first information to the second terminal, where the first information includes information about the first task instruction; and try to hold a second local lock based on the first task instruction, where the second local lock is used to ensure that a first application on the second terminal executes only a task instruction from one device at a same time point, and the second local lock can be held by only one device at a same time point. The third terminal is configured to: receive a second operation performed by the user, where the second operation is used to trigger sending of a second task instruction to the second terminal; and send second information to the second terminal, where the second information includes information about the second task instruction; try to hold the second local lock based on the second task instruction. The second terminal is configured to execute a task instruction sent by a terminal that holds the second local lock. The first terminal or the second terminal holds the second local lock.
[0116] According to the task migration system provided in the fourteenth aspect, a local lock is created on an application of a target device, and the local lock can be held by only one another device at a same time point. If a specific device successfully holds the local lock, the application on the target device may execute a task from the device. In a period in which the device holds the local lock, the target device does not execute a task instruction sent by another device, to ensure that the target device executes only a task instruction from one device at a same time point, avoid a conflict between a plurality of cross-device tasks, resolve a problem of instability in a cross-device task scenario, and improve user experience.
[0117] In a possible implementation of the fourteenth aspect, the second local lock is used to ensure that the first application executes only a task instruction from one device at a same time point, and the second local lock can be held by only one device at a same time point. In other words, the second local lock is at an application level. A same application on the second terminal can execute only a task instruction from one device at a same time point, and cannot execute task instructions from different devices at a same time point.
[0118] In a possible implementation of the fourteenth aspect, the second local lock is used to ensure that in a second application and the first application on the second terminal, only one application executes a task instruction from a same device at a same time point. In other words, the second local lock is at a device level. The second local lock is used to ensure that the second terminal executes only a task instruction from one device at a time point or in a time period. If a device successfully holds the second local lock, it means that the second terminal may execute a task instruction sent by the device. Another device that does not hold the second local lock does not send a task instruction to the second terminal, or even if the device sends a task instruction to the second terminal, the second terminal does not execute the task instruction. In other words, the second local lock can be held by only one device at a same time point in addition to the second terminal.
[0119] In a possible implementation of the fourteenth aspect, the first terminal is further configured to try to hold a first local lock of the first terminal based on the first task instruction. The first local lock is used to ensure that the first terminal can send one task instruction to only one device at a same time point, and the first local lock can be held by only one device at a same time point. In this solution, the first local lock is used to ensure that the first terminal can send one task instruction to only one device (for example, the second terminal) at a same time point, and the first local lock may be a preemptive cross-device task lock. If the first terminal needs to send a plurality of task instructions (a multi-process or multi-thread task) to the second terminal at a same time point, when a task instruction successfully holds or preempts the first local lock, the first terminal may send the task instruction to the second terminal. If the first terminal needs to send only one task instruction to the second terminal at a same time point, the task instruction holds the first local lock. In other words, the first local lock can be held by only one cross-device task instruction on the first terminal at a same time point.
[0120] For example, when the user performs a slide-up operation in a region corresponding to a task card of a video application on the second terminal, a task instruction for clearing the video application on the second terminal is triggered. In addition, an application manager in the background of the first terminal also sends a task instruction to the second terminal. The task instruction is used to clear a music application on the second terminal or is used to run the video application on the second terminal. In this case, the two task instructions preempt the first local lock, and when a task instruction preempts the first local lock, the first terminal may send the task instruction to the second terminal.
[0121] In a possible implementation of the fourteenth aspect, the system further includes a fourth terminal. The fourth terminal is configured to: receive a third operation performed by the user, where the third operation is used to trigger sending of a third task instruction to the first terminal; send third information to the first terminal, where the third information includes information about the third task instruction; and try to hold the first local lock, where the first local lock is further used to ensure that in a process in which the first terminal and the second terminal device cooperate to execute a cross-device task instruction, the first terminal does not execute a task instruction sent by the another device, or the first terminal does not send a task instruction to another device, and the first local lock can be held by only one device at a same time point. The first terminal is further configured to not execute the third task instruction when the fourth terminal unsuccessfully holds the first local lock.
[0122] In this solution, a device lock is further set on a device that cooperates with a target device to execute a cross-device task. The device lock can be held by only one device at a same time point. In a period in which the device and the target device cooperate to execute a cross-device task, the device holds the device lock, to ensure that the device does not participate in or does not execute a cross-device task between the device and another device, that is, ensure that the device participates in only a cross-device task between the device and one device at a same time point, avoid a conflict between a plurality of cross-device tasks, resolve a problem of instability in a cross-device task scenario, and improve user experience.
[0123] In a possible implementation of the fourteenth aspect, the first terminal is further configured to: receive a fourth operation performed by the user, where the fourth operation is used to trigger sending of a fourth task instruction to the second terminal; and generate a task queue based on the first task instruction and the fourth task instruction, where a sequence of the first task instruction and the fourth task instruction in the task queue is a sequence of corresponding operations, and the first information includes information about a task instruction included in the task queue. In this solution, a local lock is created on the target device, and the local lock can be held by only one device at a same time point. When a device successfully holds a distributed task lock, the target device may receive a task queue from the device, and sequentially execute a plurality of task instructions in a sequence of the plurality of task instructions included in the task queue, to ensure that a plurality of task instructions from a same device are executed in sequence, resolve a problem of instability in a cross-device task scenario, and improve user experience.
[0124] In a possible implementation of the fourteenth aspect, the first information further includes a lock holding timeout time period of the second local lock; and the first terminal is further configured to release the second local lock after a time length of holding the second local lock by the first terminal is greater than or equal to the lock holding timeout time period.
[0125] In a possible implementation of the fourteenth aspect, after the second terminal completes execution of a task instruction included in the first information or the second information, the second terminal is further configured to send feedback information to the first terminal or the third terminal. The feedback information indicates that the second terminal has completed execution of the task instruction. The first terminal or the third terminal is further configured to release the second local lock based on the feedback information.
[0126] For example, if the task instruction in the first information is clearing a video application that is run by the second terminal in the background, after receiving the feedback information, the first terminal may send a notification to a global task center of the first terminal, to indicate the global task center to refresh a recent task interface, and the video application is not displayed in the refreshed recent task interface, or is not displayed in a recent task list corresponding to the second terminal in the recent task interface.
[0127] In a possible implementation of the fourteenth aspect, the first terminal is further configured to display, in a recent task interface of the first terminal, an identifier of an application run by the second terminal in the background. The third terminal is further configured to display, in a recent task interface of the third terminal, an identifier of an application run by the second terminal in the background. The first task instruction instructs the second terminal to clear the first application run in the background. The second task instruction instructs the second terminal to run the first application.
[0128] For example, when the user performs a slide-up operation in a region corresponding to a task card of a video application on the second terminal, a task instruction for clearing the video application on the second terminal is triggered. When a user of the third terminal makes a tap gesture in the region corresponding to the task card of the video application on the second terminal, a task instruction for running the video application on the second terminal is triggered.
[0129] In a possible implementation of the fourteenth aspect, the first terminal is further configured to display a notification message to the user in an interface of the first terminal when the first terminal unsuccessfully holds the second local lock. The notification message is used to notify the user that execution of the first task instruction fails.
[0130] In a possible implementation of the fourteenth aspect, the first task instruction instructs to send a data stream of the first application on the first terminal to the second terminal, and the third task instruction instructs the first terminal to stop running the first application. For example, a task instruction sent by the first terminal to the second terminal is: migrating a data stream of a video application on the first terminal to the second terminal. In addition, a task instruction that needs to be sent by the fourth terminal to the first terminal device is stopping running the video application on the first terminal. In this case, because the fourth terminal unsuccessfully tries to hold a device lock of the first terminal, the fourth terminal does not send a task instruction to the first terminal, or even if the fourth terminal sends a task instruction to the first terminal, the first terminal finds that the fourth terminal does not hold the device lock of the first terminal, and does not execute the task instruction.
[0131] According to a fifteenth aspect, a task migration method is provided. The method is applied to a first terminal, and the method includes: receiving a first operation performed by a user, where the first operation is used to trigger sending of a first task instruction to a second terminal; sending first information to the second terminal, where the first information includes information about the first task instruction; trying to hold a second local lock based on the first task instruction, where the second local lock is used to ensure that a first application on the second terminal executes only a task instruction from one device at a same time point, and the second local lock can be held by only one device at a same time point; and displaying a notification message to the user in a display interface, where the notification message is used to notify the user that execution of the first task instruction fails or succeeds.
[0132] According to the method provided in the fifteenth aspect, a local lock is created on an application on a target device, and the local lock can be held by only one another device at a same time point. If a specific device successfully holds the local lock, the application on the target device may execute a task from the device. In a period in which the device holds the local lock, the target device does not execute a task instruction sent by another device, to ensure that the target device executes only a task instruction from one device at a same time point, avoid a conflict between a plurality of cross-device tasks, resolve a problem of instability in a cross-device task scenario, and improve user experience.
[0133] In a possible implementation of the fifteenth aspect, the second local lock is used to ensure that the first application executes only a task instruction from one device at a same time point, and the second local lock can be held by only one device at a same time point. In other words, the second local lock is at an application level. A same application on the second terminal can execute only a task instruction from one device at a same time point, and cannot execute task instructions from different devices at a same time point.
[0134] In a possible implementation of the fifteenth aspect, the second local lock is used to ensure that in a second application and the first application on the second terminal, only one application executes a task instruction from a same device at a same time point. In other words, the second local lock is at a device level. The second local lock is used to ensure that the second terminal executes only a task instruction from one device at a time point or in a time period. If a device successfully holds the second local lock, it means that the second terminal may execute a task instruction sent by the device. Another device that does not hold the second local lock does not send a task instruction to the second terminal, or even if the device sends a task instruction to the second terminal, the second terminal does not execute the task instruction. In other words, the second local lock can be held by only one device at a same time point in addition to the second terminal.
[0135] In a possible implementation of the fifteenth aspect, the method includes: trying to hold a first local lock of the first terminal based on the first task instruction. The first local lock is used to ensure that the first terminal can send one task instruction to only one device at a same time point, and the first local lock can be held by only one device at a same time point.
[0136] In a possible implementation of the fifteenth aspect, the method further includes: receiving third information sent by a fourth terminal. The third information includes information about a third task instruction; when the first terminal holds the first local lock of the first terminal, the first terminal does not execute the third task instruction; the first local lock is used to ensure that in a process in which the first terminal and the second terminal device cooperate to execute a cross-device task instruction, the first terminal does not execute a task instruction sent by the another device, or the first terminal does not send a task instruction to another device; and the first local lock can be held by only one device at a same time point.
[0137] In a possible implementation of the fifteenth aspect, when the first terminal holds the second local lock, the first information further includes a lock holding timeout time period of the second local lock, and the method further includes: releasing the second local lock after a time length of holding the second local lock by the first terminal is greater than or equal to the lock holding timeout time period.
[0138] In a possible implementation of the fifteenth aspect, when the first terminal holds the second local lock, the method further includes: receiving feedback information sent by the second terminal, where the feedback information indicates that the second terminal has completed execution of a task instruction; and releasing the second local lock based on the feedback information.
[0139] In a possible implementation of the fifteenth aspect, the method further includes: displaying, in a recent task interface of the first terminal, an identifier of an application run by the second terminal in the background. The first task instruction instructs the second terminal to clear the first application run in the background.
[0140] In a possible implementation of the fifteenth aspect, the first task instruction instructs to send a data stream of the first application on the first terminal to the second terminal, and the third task instruction instructs the first terminal to stop running the first application. When the first terminal does not hold the second local lock, the notification message is used to notify the user that execution of the first task instruction fails.
[0141] According to a sixteenth aspect, a communication apparatus is provided. The communication apparatus includes units configured to perform steps performed by a terminal device in any one of the aspects or the possible implementations of the aspects.
[0142] According to a seventeenth aspect, a communication apparatus is provided. The communication apparatus includes at least one processor and a memory, the processor and the memory are coupled, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, steps performed by a terminal device in any one of the aspects or the possible implementations of the aspects are performed.
[0143] According to an eighteenth aspect, a communication apparatus is provided. The communication apparatus includes at least one processor and an interface circuit, and the at least one processor is configured to perform steps performed by a terminal device in any one of the aspects or the possible implementations of the aspects.
[0144] According to a nineteenth aspect, a terminal device is provided. The terminal device includes any communication apparatus provided in the sixteenth aspect, the seventeenth aspect, or the eighteenth aspect.
[0145] According to a twentieth aspect, a computer program product is provided. The computer program product includes a computer program, and when the computer program is executed by a processor, steps performed by a terminal device in any one of the aspects or the possible implementations of the aspects are performed.
[0146] According to a twenty-first aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed, steps performed by a terminal device in any one of the aspects or the possible implementations of the aspects are performed.
[0147] According to a twenty-second aspect, a chip is provided. The chip includes a processor, configured to invoke and run a computer program from a memory, so that a communication device in which a chip is installed performs steps performed by a terminal device in any one of the aspects or the possible implementations of the aspects.BRIEF DESCRIPTION OF DRAWINGS
[0148] FIG. 1 is a schematic diagram of a communication system applicable to embodiments of this application;
[0149] FIG. 2(a) to FIG. 2(c) are schematic diagrams of interfaces in which a recent task interface is displayed and a slide operation is performed in the recent task interface according to this application;
[0150] FIG. 3(a) and FIG. 3(b) each are a schematic diagram of an interface in which a touch operation is performed in a recent task interface according to this application;
[0151] FIG. 3(c) to FIG. 3(e) each are a schematic diagram of an interface in which an implementation of a recent task list of a current terminal and another terminal is displayed;
[0152] FIG. 3(f) is a schematic diagram of an interface in which an implementation of a recent task list of a current terminal and another terminal is displayed;
[0153] FIG. 3(g) to FIG. 3(i) are schematic diagrams of a manner of transmitting recent task information through a software module;
[0154] FIG. 3(j) to FIG. 3(u) are schematic diagrams of interfaces in which a first terminal initiates a trusted relationship establishment request to a second terminal;
[0155] FIG. 3(v) to FIG. 3(z) are schematic diagrams of interfaces in which a second terminal receives a trusted request from a first terminal;
[0156] FIG. 4(a) and FIG. 4(b) are schematic diagrams of interfaces in which a recently used application of another terminal is cleared;
[0157] FIG. 4(c) to FIG. 4(e) each are a schematic diagram of an interface in which an application is migrated between terminals;
[0158] FIG. 4(f) to FIG. 4(h) each are a schematic diagram of an interface in which usage time of an application on another terminal is displayed;
[0159] FIG. 4(i) is a schematic flowchart according to an embodiment of this application;
[0160] FIG. 4(j) is another schematic flowchart according to an embodiment of this application;
[0161] FIG. 4(k) and FIG. 4(l) each are a schematic flowchart of determining a layout in which a task card of another terminal is displayed in a recent task interface of a first terminal according to this application;
[0162] FIG. 5(a) to FIG. 6(e) are schematic diagrams of interfaces of different layouts in which task cards of other different terminals are displayed in a recent task interface of a first terminal according to this application;
[0163] FIG. 7(a) to FIG. 7(q) are schematic diagrams of interfaces of different content displayed on a last task card in a recent task interface of a first terminal according to this application;
[0164] FIG. 7(r) and FIG. 7(s) each are a schematic diagram of an interface in which a lightweight device displays a task card of another device according to this application;
[0165] FIG. 8(a)-1 and FIG. 8(a)-2 are a schematic flowchart of determining a display state and an application running state based on different migration modes when a task card of a remote device is started in a recent task interface of a first terminal according to this application;
[0166] FIG. 8(b)-1 and FIG. 8(b)-2 to FIG. 8(n) are schematic diagram of interfaces of running states of a first application on different devices based on different migration modes according to this application;
[0167] FIG. 8(o)-1 and FIG. 8(o)-2 to FIG. 8(p)-1 and FIG. 8(p)-2 are schematic diagrams of interfaces in which a task card is operated in a recent task interface of a first terminal to help install an application on another device according to this application;
[0168] FIG. 8(q)-1 to FIG. 8(q)-3 to FIG. 8(u)-1 to FIG. 8(u)-4 are schematic diagrams of interfaces in which different task cards are operated in a recent task interface of a first terminal to establish different display forms of a plurality of task cards according to this application;
[0169] FIG. 8(v) to FIG. 8(w) are schematic diagrams of interfaces displayed after a connection between a source device and a target device is interrupted after a task is migrated according to this application;
[0170] FIG. 9(a)-1 and FIG. 9(a)-2 to FIG. 9(v) are schematic diagrams of interfaces in which a task card is operated in a recent task interface of a first terminal to migrate the task card according to this application;
[0171] FIG. 10(a) to FIG. 10(c) are schematic diagrams of interfaces in which a target device changes from a screen-off state to display of an application after an application is migrated to the target device according to this application;
[0172] FIG. 11(a)-1 and FIG. 11(a)-2 to FIG. 11(k)-1 to FIG. 11(k)-4 are schematic diagrams of interfaces in which an application runs based on different allocation situations of a hardware capability used by the application after the application is migrated from a source device to a target device according to this application;
[0173] FIG. 12(a)-1 and FIG. 12(a)-2 are a schematic diagram of an interface in which a task card of a mobile phone is displayed in a recent task interface of an in-vehicle infotainment system according to this application;
[0174] FIG. 12(b) is a schematic diagram of an interface in which a task card of a PC device is displayed in a recent task interface of an in-vehicle infotainment system according to this application;
[0175] FIG. 12(c)-1 and FIG. 12(c)-2 are a schematic diagram of an interface in which a task card of a mobile phone is displayed in a recent task interface of a PC device according to this application;
[0176] FIG. 13A to FIG. 13C are a schematic diagram of an interface in which a task card of a first terminal is migrated to a third terminal in a recent task interface of a second terminal according to this application;
[0177] FIG. 14(a)-1 to FIG. 14(a)-3 to FIG. 14(s) are schematic diagrams of interfaces in which a super home screen is displayed on different devices according to this application;
[0178] FIG. 15(a) to FIG. 15(g) are schematic diagrams of interfaces in which a super home screen entry and a super home screen layout are displayed on different devices according to this application;
[0179] FIG. 16(a) to FIG. 16(h) are schematic diagrams of interfaces displayed by a terminal device in a process in which a terminal device temporarily sets up a super home screen according to this application;
[0180] FIG. 17 is a schematic flowchart according to an embodiment of this application;
[0181] FIG. 18 is a schematic diagram of an internal system architecture in a process in which a first terminal migrates an application data stream to a second terminal according to this application;
[0182] FIG. 19 is an example schematic flowchart according to this application;
[0183] FIG. 20 is another example schematic flowchart according to this application;
[0184] FIG. 21A and FIG. 21B are schematic diagrams of a common task migration scenario according to an embodiment of this application;
[0185] FIG. 22A to FIG. 22E are schematic diagrams of another common task migration scenario according to an embodiment of this application;
[0186] FIG. 23A to FIG. 23G are schematic diagrams of a group of user interfaces in which a task migration is performed between different terminal devices according to an embodiment of this application;
[0187] FIG. 24A to FIG. 24G are schematic diagrams of another group of user interfaces in which a task migration is performed between different terminal devices according to an embodiment of this application;
[0188] FIG. 25A and FIG. 25B are schematic diagrams of a principle of performing a task migration between different terminal devices according to an embodiment of this application;
[0189] FIG. 26 is an example schematic flowchart according to an embodiment of this application;
[0190] FIG. 27A and FIG. 27B are an example schematic flowchart according to this application;
[0191] FIG. 28 is a schematic diagram of an example interface in which a terminal prompts a user with a case in which sending or execution of a cross-device task instruction fails according to this application;
[0192] FIG. 29 is a schematic diagram of another example interface in which a terminal prompts a user with a case in which sending or execution of a cross-device task instruction fails according to this application;
[0193] FIG. 30A and FIG. 30B are another example schematic flowchart according to this application;
[0194] FIG. 31A to FIG. 31C are still another example schematic flowchart according to this application;
[0195] FIG. 32 is still another example schematic flowchart according to this application;
[0196] FIG. 33 is still another example schematic flowchart according to this application;
[0197] FIG. 34 is a block diagram of a software structure of a terminal according to this application;
[0198] FIG. 35 is a block diagram of a software structure of another terminal according to this application;
[0199] FIG. 36 is a schematic diagram of an example hardware structure of a terminal according to this application; and
[0200] FIG. 37 is a schematic diagram of a chip system according to this application.DESCRIPTION OF EMBODIMENTS
[0201] Currently, a user has more types of intelligent terminals. Therefore, many new user requirements are generated.
[0202] For example, when the user plays a video or edits a document on a mobile phone, because the mobile phone has small screen and is inconvenient to use, it may be more convenient to play a video or edit a document on a large-screen device. Therefore, a played video or an edited document on the mobile phone needs to be seamlessly migrated to another large-screen device.
[0203] For another example, a plurality of tasks are performed in parallel. For example, the user frequently shops and chats on a mobile phone simultaneously, or watches a video and chats simultaneously. In a scenario in which a plurality of tasks are performed in parallel on the mobile phone, a picture may be blocked due to the plurality of tasks. Therefore, different tasks may be respectively run in parallel on a plurality of devices used by the user, to keep the plurality of tasks to be executed continuously in parallel, and avoid a case in which a picture is blocked due to the plurality of tasks.
[0204] For still another example, sometimes a device used by the user needs to be charged, but the user wants to continue, on the device, a task whose processing is not completed. In this case, the task on the device may be continued on another device, so that the user can continue the task whose processing is not completed on the device.
[0205] In each of the foregoing scenarios, a migration (or continuation) of an application or a task to an unused device is performed.
[0206] In view of this, this application provides a task migration system and method. A task card corresponding to an ongoing or previously run application of another terminal may be displayed on a terminal used by a user, so that the user can view and manage a historical task of another device on a device. This may be applied to almost all applications, without requiring an application to be adapted. When a task card of another device is displayed, task cards of different devices may be laid out in a plurality of different manners. The user can simply perform an operation on the task card, to migrate or continue an application, and meet a requirement of the user for managing and controlling a multi-device task. In addition, a procedure of continuing an application is further simplified, an operation of the user is simplified, and user experience is improved.
[0207] The following describes a remote device task display and control method provided in this application.
[0208] It should be noted that, in embodiments of this application, “terminal device”, “electronic device”, and “terminal” all represent a same meaning, and descriptions thereof may be changed.
[0209] An Android (Android) system is used as an example. The system provides a system-level interface, to display a recently accessed task list. A user may perform an operation of clearing a recently run application or clearing all recently run applications. In this method, a local application (APP) of a terminal can be cleared. In a distributed scenario, a recently used application of another terminal needs to be further displayed and cleared.
[0210] In some example embodiments, FIG. 1 is a schematic diagram of a communication system applicable to embodiments of this application according to this application.
[0211] For example, as shown in FIG. 1, a communication system 10 may include various terminal devices (in this application, the terminal device may also be referred to as an electronic device) such as a mobile phone 101, a tablet computer 102, and a large-screen device 103. Optionally, the communication system 10 may further include a smart home device such as a smart refrigerator 104 or a smart air conditioner 105. When an intelligent terminal is a smart home device such as a smart refrigerator or an air conditioner, a recently used application may be a task that is currently executed or that is executed for several recent times by the smart home device.
[0212] Certainly, the communication system 10 may further include more terminal devices, for example, Internet of Things (IoT) devices such as a smart sound box, a vehicle-mounted device (which may also be referred to as an in-vehicle infotainment system), a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a handheld computer, a netbook, a personal digital assistant (personal digital assistant, PDA), a wearable electronic device, and a virtual reality device, which are not shown in FIG. 1.
[0213] A type of the terminal device (for example, the mobile phone 101, the tablet computer 102, or the large-screen device 103) is not specifically limited in this embodiment of this application. In some embodiments, the terminal device in this embodiment of this application may be a device such as a mobile phone, a wearable device (for example, a smart band, a smartwatch, or a headset), a tablet computer, a laptop (laptop), a handheld computer, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a cellular phone, a personal digital assistant (personal digital assistant, PDA), or an augmented reality (Augmented reality, AR)\virtual reality (virtual reality, VR) device; or may be a device such as a television, a large screen, a sound screen, a television, a refrigerator, an air conditioner, a vehicle-mounted device, a printer, or a projector. An example embodiment of the terminal device includes but is not limited to a terminal device provided with iOS®, Android®, Microsoft®, Harmony, or another operating system.
[0214] Terminals in the communication system 10 may be interconnected through a communication network.
[0215] In some example embodiments, the communication network may be a wired network or a wireless network. For example, the communication network may be a local area network (local area network, LAN), or may be a wide area network (wide area network, WAN), for example, the Internet. The communication network may be implemented based on any known network communication protocol. The network communication protocol may be various wired or wireless communication protocols such as the Ethernet, a universal serial bus (universal serial bus, USB), FireWire (FIREWIRE), a global system for mobile communications (global system for mobile communications, GSM), a general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), Bluetooth, wireless fidelity (wireless fidelity, Wi-Fi), NFC, voice over Internet protocol (voice over Internet protocol, VoIP), communication protocol supporting a network slice architecture, or any other proper communication protocol.
[0216] In other words, the terminals in the communication system 10 may form a network (that is, are networked) based on a specific communication protocol and networking policy, so that terminals in an audio system may communicate with each other.
[0217] In some example embodiments, the terminal devices in the communication system 10 may access a Wi-Fi network provided by an access point (access point, AP) such as a router, so that a Wi-Fi connection is established between the terminal devices. For another example, the terminals in the communication system 10 may log in to a same account (for example, a Huawei account), and then are interconnected through one or more servers.
[0218] A recent task interface is an interface that is in a system user interface (User Interface, UI) and that displays a recently run task of a terminal. When the terminal is triggered to open the recent task interface, a display of the terminal may display the recently run task of the terminal, or a recently run application. Optionally, for a plurality of interfaces of a same application, each of the plurality of interfaces may be displayed as an independent task in the recent task interface. For example, when the terminal opens two Word documents, if the recent task interface is entered, two task cards may be respectively used to display interfaces corresponding to the two Word documents. For ease of description, a task and an application are not specifically distinguished in this application. In addition, whether the plurality of interfaces of the application are used as one task card or a plurality of task cards is not limited in this application.
[0219] For example, after a user triggers a terminal to open a first application, the terminal returns a home screen by using a gesture or a button. In this case, the first application is switched to run in the background. When the user opens a second application and runs the second application, the user triggers the terminal to enter a recent task interface. It can be understood that, because a system function of the terminal currently runs a program corresponding to the recent task interface in the foreground, the second application is also switched to run in the background. In this case, both the first application and the second application are recently run applications, and information about the first application and the second application occurs in the recent task interface.
[0220] Information about a plurality of recently run applications is displayed in the recent task interface. Usually, an identifier and a task card corresponding to an application are displayed in the recent task interface. Optionally, the identifier of the application may be an application name or an icon (icon) of the application that is represented by using a text, the task card is a rectangular box, and a snapshot of the application exists in the box. For example, the system captures a snapshot of an interface existing when the application is switched to run in the background. The identifier and the task card of the application may be a whole. For example, the identifier is embedded into the task card as a part of the task card; or the identifier and the task card of the application are in a separated state. This is not limited in this application. When there are a plurality of recently run applications on the terminal, there are a plurality of task cards. Due to a page display or an interface setting, some task cards are completely displayed in the recent task interface, some task cards are partially displayed in the recent task interface, and some task cards may be hidden (not displayed) in RecentTasks.
[0221] In some example embodiments, as shown in FIG. 2(a), the user may make a slide-up gesture from a bottom of a screen of the terminal on the home screen of the terminal, to trigger the display of the terminal to display the recent task interface. In an actual application, the display of the terminal may be triggered, by using another gesture or in another operation manner (for example, by tapping a “multi-task” button or touching and holding a “back” button), to display the recent task interface. A manner of triggering the terminal to display the recent task interface is not limited in this application.
[0222] In some example embodiments, as shown in FIG. 2(b), the display of the terminal displays the recent task interface. In the recent task interface, a task card of the first application is completely displayed, and a task card of the second application is partially displayed. The recently run application further includes a third application, and a card of the third application is hidden in the recent task interface. In the recent task interface shown in FIG. 2(b), when the user makes a slide-up gesture on a touchscreen, the recent task interface displayed on the display of the terminal may be switched to a recent task interface shown in FIG. 2(c).
[0223] In some example embodiments, as shown in FIG. 2(c), a task card that is currently and completely displayed in the recent task interface is switched from the task card of the first application to the task card of the second application. Before switching, as shown in FIG. 2(b), the task card of the first application is completely displayed in the recent task interface, and the task card of the second application is partially displayed in the recent task interface. After switching, as shown in FIG. 2(c), the task card of the first application is partially displayed in the recent task interface, and the task card of the second application is completely displayed in the recent task interface. In addition, after switching, as shown in FIG. 2(c), the task card of the third application is changed from a hidden state to being partially displayed in the recent task interface.
[0224] As shown in FIG. 2(b) and FIG. 2(c), when a plurality of recently run tasks exist, a task card of a recently run task may be completely displayed in the recent task interface, a task card of another recently run task is partially displayed on a left side and / or a right side of the completely displayed task card of the recently run task, and the completely displayed task card and the partially displayed task card are displayed side by side. In an actual application, the task card may alternatively be displayed in the recent task interface in another manner. For example, a task card of a recently run task is completely displayed in the recent task interface, a task card of another recently run task is partially displayed on an upper side and / or a lower side of the completely displayed task card of the recently run task, and the completely displayed task card and the partially displayed task card are displayed side by side. In this embodiment of this application, a manner of displaying a task card in the recent task interface is not limited. The recent task interface may be triggered by an operation to display different task cards through switching, and a completely displayed task card exists before and / or after switching.
[0225] In the recent task interface, the user may perform different operations, to achieve different effects.
[0226] In some example embodiments, as shown in FIG. 3(a), when the user makes a tap gesture in a region outside the task card in the recent task interface, the recent task interface exits, and the display of the terminal displays the home screen.
[0227] In some example embodiments, as shown in FIG. 3(b), when the user makes a tap gesture in a region corresponding to the task card of the first application, the recent task interface exits, the display of the terminal displays an interface of the first application, and the first application is switched from being run in the background to being run in the foreground.
[0228] In FIG. 3(a) and FIG. 3(b), a response of the terminal to a gesture of the user is only used as an example. In an actual application, the response may be another response. This is not limited in this application.
[0229] In addition, in an actual application, as shown in FIG. 3(a) and FIG. 3(b), the recent task interface may further display a control or an icon that is used to clear memory space occupied by all recently run applications, for example, a Recycle bin icon in a lower part in FIG. 3(a) and FIG. 3(b). The user may close all the recently run tasks by tapping the icon. In a specific implementation, all applications or a specific application run in a floating window mode in the recent task interface may be closed in another manner. For example, the application may be further closed by using a slide-up gesture, a slide-down gesture, or in a manner of tapping a specific control in a task card (for example, a close button in a task card).
[0230] Optionally, in some embodiments of this application, when a task card is displayed, information about memory space occupied by applications respectively corresponding to some or all task cards may be further displayed. For example, a prompt box of a memory space occupied by applications corresponding to some or all task cards may be displayed above or below the task cards, or memory space occupied by applications respectively corresponding to different task cards may be displayed in a list or a table. For example, memory space occupied by an application corresponding to a task card may be xx megabytes (M), yy thousand (K) bytes (B), or the like. This is not limited in this embodiment of this application.
[0231] The foregoing describes content included in the recent task interface and a basic operation. In this application, a recent task interface of a terminal may not only display a recently run application of the terminal, but also display a recently run application of another terminal. Further, an operation may be further performed on a task card corresponding to one or some applications, to implement a cross-device migration of an application, application running, and the like.
[0232] A scenario shown in FIG. 1 is used as an example for description. A first terminal (for example, the mobile phone 101), a second terminal (for example, the tablet computer 102), a third terminal (for example, the large-screen device 103), and the like are connected through a network. When the user operates the first terminal to enter a recent task interface, the recent task interface not only displays a recently used application of the first terminal, but also displays a recently used application of the second terminal and the third terminal.
[0233] In a possible implementation, before a technical solution of this application is executed between different devices, a trusted relationship may be established between the different devices, or the different devices may be connected. For example, for a manner in which the different devices are connected, different devices may log in to a same account, are connected to a same Wi-Fi hotspot, log in to an associated account, or are established in a same network to form a local area network device group, or the like. For a manner in which the trusted relationship is established, device-level authentication may be performed between different devices in example manners shown in FIG. 3(j) to FIG. 3(z), to establish the trusted relationship. This is not limited in this application.
[0234] In some example embodiments, as shown in FIG. 3(c), the recent task interface of the first terminal is divided into a plurality of rows, a first row is used to display a task card corresponding to a recently used application of the first terminal, and a second row and a third row are respectively used to display recent task lists of devices such as the second terminal and the third terminal. In this case, the first terminal may synchronize the recent task lists of the second terminal and the third terminal in the background, or when the user opens the recent task interface of the first terminal, the first terminal is triggered to obtain the recent task list of another terminal (the second terminal and the third terminal) connected to the first terminal.
[0235] As shown in FIG. 3(c), for example, the first terminal may be a mobile phone, the second terminal may be a tablet computer, and the third terminal may be a large-screen device. An overlapping application may exist in applications run on any two devices. For example, as shown in FIG. 3(c), same applications, namely, an app 1 and an app 3 exist on the mobile phone and the tablet computer. Optionally, a progress or state of the app 1 run on the mobile phone (or an interface of the app 1 displayed on the mobile phone) may be different from a progress or a state of the app 1 run on the tablet computer (or an interface of the app 1 displayed on the tablet computer). A progress or a state of the app 3 run on the mobile phone may also be different from a progress or a state of the app 3 run on the tablet computer. A same application, namely, an app 2 exists on the mobile phone and the large-screen device. Optionally, a progress or a state of the app 2 run on the mobile phone may be different from a progress or a state of the app 2 run on the large-screen device. A same application, namely, an app 4 exists on the large-screen device and the tablet computer. Similarly, a progress or a state of the app 4 run on the large-screen device may be different from a progress or a state of the app 4 run on the tablet computer.
[0236] For another example, as shown in FIG. 3(c), the first row shows three recently run applications on the mobile phone. For example, the three applications may be three applications with top three use frequencies; or three applications with top three usage time lengths; or three recently used applications; or one application with a top use frequency, one application with longest usage time, and one recently used application in a plurality of recently run applications on the mobile phone. For another example, when the user may make a slide-up gesture in a region of any row of task card, the first terminal displays another task card of a device corresponding to the row, or when the user may make a slide-up gesture in a region outside the three rows of task cards, the first terminal displays other task cards respectively corresponding to the three devices.
[0237] In some example embodiments, identifiers of the first terminal and a plurality of terminals connected to the first terminal (for example, the plurality of terminals and the first terminal log in to a same account, are connected to a same Wi-Fi hotspot, or log in to an associated account) may be further separately displayed in the recent task interface of the first terminal. When an identifier of the first terminal or an identifier of a terminal connected to the first terminal is selected, a recent task list corresponding to the terminal is correspondingly displayed in the recent task interface. In some example embodiments, as shown in FIG. 3(d), when an identifier of a current terminal (the first terminal) is selected, a local recent task list of the first terminal is displayed in the recent task interface. In some example embodiments, as shown in FIG. 3(e), when the first terminal receives an instruction of the user, and an identifier of the second terminal is selected, a recent task list of the second terminal is displayed in the recent task interface. In this case, the first terminal may have completed synchronization of the recent task list of the second terminal and caching of this part of data in the background. When the user taps the identifier of the second terminal, the first terminal displays the recent task list of the second terminal in the recent task interface based on the cached data. Alternatively, the first terminal may not synchronize a recent task list of the second terminal in the background; instead, when the user taps the identifier of the second terminal, the first terminal obtains the recent task list of the second terminal, and displays the task list in a recent task interface corresponding to the identifier of the second terminal.
[0238] When a policy in which the first terminal obtains, in the background, a recent task list of another terminal including the second terminal is used, after the user taps to enter the recent task interface of the first terminal or tap an identifier of the another terminal in the recent task interface, because information about the recent task list of the another terminal is pre-cached, the user may load the recent task list of the another terminal in the recent task interface at a fast speed, so that the user obtains the recent task list corresponding to the another terminal more quickly, and user experience is better. However, when the user opens the recent task interface of the first terminal or taps the identifier of the another terminal in the recent task interface, synchronization of the recent task list of the another terminal is triggered, to reduce consumption of network traffic and power that are generated when the first terminal and the another terminal synchronize the recent task list, to save resources.
[0239] In some example embodiments, different synchronization policies may be used based on a state of the first terminal. For example, when the first terminal is in a state in which the first terminal is connected to wireless fidelity (Wireless Fidelity, Wi-Fi®) or a state in which power is enough, because a problem of consumption of network traffic or power does not need to be concerned, the first terminal may obtain, in the background, the recent task list of the another terminal connected to the first terminal. When the first terminal is in a state in which the first terminal is connected to a network through a cellular network or power is low, synchronization of the recent task list of the another terminal may be triggered when the user opens the recent task interface of the first terminal or taps the identifier of the another terminal in the recent task interface, to save network traffic or power.
[0240] In some example embodiments, in actual use, the user of the first terminal uses other terminals at different use frequencies, different recent task information synchronization policies may be set for terminals connected to the first terminal. For example, when the first terminal is a mobile phone, a tablet computer connected to the mobile phone through a network may have a closer relationship with the mobile phone, and a backup mobile phone that is also connected to the mobile phone may be less associated. In this case, when the user enters the recent task interface, a recent task of the tablet computer that is more associated with the mobile phone is directly displayed, and only an identifier of the backup mobile phone that is less associated with the mobile phone is displayed. When the user taps the identifier of the backup mobile phone, the first terminal is triggered to obtain a recent task of the backup mobile phone.
[0241] In some example embodiments, FIG. 3(f) is another schematic diagram of displaying a recent task list of a plurality of terminals connected to a first terminal. As shown in FIG. 3(f), a recent task of the first terminal and a recent task of the another terminal are no longer distinguished in the recent task interface of the first terminal. Instead, the recent task of the first terminal and the recent task of the another terminal are displayed in the recent task interface of the first terminal after combination and deduplication. For example, if the first terminal (that is, the current terminal) recently runs the app 1, the app 2, and the app 3, the second terminal (assumed to be a Huawei P30 mobile phone) recently runs the app 1, the app 3, and the app 4, and the third terminal (assumed to be a Huawei P40 mobile phone) recently runs the app 2, the app 4, and an app 5, the recent task interface of the first terminal displays the app 1 to the app 5 (only the app 3, the app 4, and the app are shown in the figure).
[0242] In some example embodiments, optionally, a terminal device corresponding to each application may be displayed around a task card corresponding to the application in a recent task view, to notify, to the user of the first terminal, a specific terminal device that recently uses an application displayed in the recent task view. As shown in FIG. 3(f), the identifier of the second terminal (P30) and an identifier of the third terminal (P40) are displayed around a task card of the app 4.
[0243] All applications are arranged in the recent task interface in a sequence of opening the applications. Therefore, when another terminal in a network sends information about a recently used application to the first terminal, a time point of opening the application on the terminal may be sent to the first terminal together, to more accurately arrange all recent applications in the recent task interface of the first terminal. For example, when the second terminal opens an album application at 11:26, and the third terminal opens a settings application at 11:27, the second terminal and the third terminal each send recent task information to the first terminal. The recent task information includes information about a time point at which the second terminal opens the album application and information about a time point at which the second terminal opens the settings application. After a global task center of the first terminal receives the recent task information of the second terminal and the third terminal, it may be determined that the album application is opened before the settings application. Therefore, in the recent task interface, a location of the album application is before a location of the settings application.
[0244] When the first terminal tries to synchronize the recent task list of the second terminal, for example, the user operates the first terminal to enter the recent task interface or tap the identifier of the second terminal in the recent task interface, the first terminal sends a task synchronization request to the second terminal. The task synchronization request is used to notify the second terminal to send information (recent task information) about the recently run application of the second terminal to the first terminal.
[0245] In some example embodiments, as shown in FIG. 3(g), a first terminal 1010 and a second terminal 1020 each include a global task center and a distributed scheduling subsystem. Optionally, the global task center runs at an application layer, and is configured to manage and display a recently used application of a terminal in a network; and the distributed scheduling subsystem runs at a system service layer at a lower layer, and is configured to: obtain information about a recently used application of a current terminal, and exchange recent task information with another terminal.
[0246] A distributed scheduling subsystem 1022 of the second terminal 1020 obtains recent task information of the second terminal 1020 from a local task management module 1023, and a listener (listener) of a change of the local task information is registered. The listener is configured to obtain a change of a recently used application of the second terminal. After obtaining the recent task information of the second terminal 1020, the distributed scheduling subsystem 1022 of the second terminal 1020 transmits the task information to a global task center 1011 of the first terminal 1010, so that the first terminal 1010 can display a recent task list of the second terminal 1020 in the recent task interface. In some example embodiments, as shown in FIG. 3(h) and FIG. 3(i), the distributed scheduling subsystem 1022 of the second terminal 1020 may be transmitted to the global task center 1011 of the first terminal 1010 in the following two manners.
[0247] In some example embodiments, as shown in FIG. 3(h), after receiving a task synchronization request from the first terminal 1010, the distributed scheduling subsystem 1022 of the second terminal 1020 sends the recent task information of the second terminal 1020 from the local task management module 1023 to a distributed scheduling subsystem 1012 of the first terminal 1010, and then the distributed scheduling subsystem 1012 of the first terminal 1010 sends the recent task information of the second terminal 1020 to the global task center 1011 of the first terminal 1010.
[0248] Because the distributed scheduling subsystem is located at a bottom layer, after the first terminal 1010 and the second terminal 1020 are networked, the first terminal 1010 may maintain a list of identifiers in the network. When the recent task information of the second terminal 1020 needs to be obtained, the first terminal 1010 may send the task synchronization request to the second terminal 1020 through the distributed scheduling subsystem 1012, and receive the recent task information of the distributed scheduling subsystem 1022 of the second terminal 1020, to conveniently complete synchronization of the recent task information of the second terminal 1020.
[0249] In some example embodiments, as shown in FIG. 3(i), after receiving recent task information synchronization request from the first terminal 1010, the distributed scheduling subsystem 1022 of the second terminal 1020 may send the recent task information of the second terminal 1020 from the local task management module 1023 to a global task center 1021 of the second terminal 1020, and then the global task center 1021 of the second terminal 1020 sends the recent task information to the global task center 1011 of the first terminal 1010.
[0250] When this implementation is used, the global task center is located at the application layer, and cannot directly perceive another terminal or obtain information from the another terminal. When the global task center 1021 of the second terminal 1020 needs to send information to the global task center 1011 of the first terminal 1010, the global task center 1021 of the second terminal 1020 needs to obtain an identifier of the first terminal 1010 and an identifier of the global task center. When a message including the recent task information is sent, the message carries the identifier of the first terminal 1010 and the identifier of the global task center, so that after receiving the recent task information from the second terminal 1020, the first terminal 1010 may transfer the recent task information to the global task center of the first terminal.
[0251] Optionally, when sending the recent task information to the first terminal, the second terminal may perform transmission in a plurality of formats. For example, in a possible transmission manner, a remote procedure call (Remote Procedure Call, RPC) is used. The RPC is a computer communication protocol, and the protocol allows a program of one computer to invoke a subprogram of another address space. A programmer does not need to additionally program this interaction function, like invoking a local program. The RPC is a server-client mode, and a classic implementation is a system in which information interaction is performed by sending a request-accept response.
[0252] In another possible transmission manner, the second terminal and the first terminal may jointly maintain a shared database. When the second terminal needs to send data to the first terminal, the second terminal may place to-be-sent data in the shared database. When content in the shared database changes, the first terminal may perceive the change, extract content placed by the second terminal in the shared database, and transfer the content to the global task center of the first terminal.
[0253] In still another possible transmission manner, when the second terminal needs to send data (for example, including the recent task information or a data stream of a recently run application) to the first terminal, the second terminal may segment the data stream, establish an index table of segment data, transmit the segment data in a distributed file system in parallel through a plurality of threads, and transmit the index table to the first terminal (for example, the index table is transmitted to the first terminal by being written into a parcel for RPC transmission). The first terminal restores application data based on the received segment data and the index table, to finally implement transmission of recent task information or data of a recently run application between unused devices. For a specific process of performing transmission in this manner, refer to descriptions of example embodiments shown in FIG. 18 to FIG. 20.
[0254] In yet another possible transmission manner, when the second terminal needs to send data (for example, including the recent task information or a data stream of a recently run application) to the first terminal, a local task stack restoration mechanism of the second terminal is extended to a distributed scenario, so that the first terminal and the second terminal may perform a task migration (that is, transmission of the recent task information or data of the recently run application) based on a stack migration. In this way, the first terminal may store and restore context information (Context) of the local task stack of the second terminal, so that the user can execute a task on the second terminal through a seamless hop on the first terminal, to finally implement transmission of recent task information or data of a recently run application between unused devices. For a specific process of performing transmission in this manner, refer to descriptions of example embodiments shown in FIG. 23A to FIG. 23G, FIG. 24A to FIG. 24G, FIG. 25A and FIG. 25B, and FIG. 26.
[0255] Transmitted recent task information includes a stack that records recent task information, snapshot information of a recently used application, an identifier, state information, and the like. The stack is a data structure used to record a recently used application and a sequence, and a threshold of a quantity of recently used applications recorded by a terminal is determined for a setting of the stack. When the threshold is exceeded, an application with earliest usage time is deleted from a recent task list. The state information is used to record a state of each application before a background application is exited, including window mode (window mode) information, intent information, and the like. Optionally, the window mode information indicates a display mode existing when the application runs in the foreground. For example, when a value of the window mode information is 1, it indicates that a previous display mode of the application is display in full screen. When the value of the window mode information is 101, it indicates that the display mode of the application is display in split screen. The intent information includes information required when the application is opened, for example, one or more items of the following data: a remote device ID, a package name of an application, a class name, or a clear mode. In addition, extra user data may be stored. For example, a video application may store a uniform resource identifier (Uniform Resource Identifier, URI) and progress data, to “seamlessly switch” (or referred to as a hop or a migration), on a remote device, a video that is being played by a local device.
[0256] Because the first terminal obtains state information of a recently used application of the second terminal, the user may indicate the first terminal to run the application based on the state information of the application. For example, the user directly opens an interface existing when the application enters the background on the second terminal.
[0257] Further, in a possible implementation, the state information of the application may further include a feature ability (feature ability, FA) file. Even if the application is not installed on the first terminal, the application may be directly run based on the FA file.
[0258] Optionally, in this application, the first terminal needs to obtain recent task information of another terminal in the network, and the recent task information relates to a privacy problem of the user. Therefore, before the first terminal exchanges recent task information with the second terminal, a trusted relationship may be established between the first terminal and the second terminal. In other words, the first terminal and the second terminal are bounded, or a device-level authentication relationship is established.
[0259] For ease of understanding, the following describes, by using an example in which a mobile phone A is the first terminal and a mobile phone B is the second terminal, a device-level authentication user interface provided in this embodiment of this application.
[0260] Optionally, in some example embodiments, as shown in FIG. 3(j), the user may enter an intelligent collaboration interface 701 from the settings application. The intelligent collaboration interface 701 may include a list with a name “My devices”. “My devices” includes Current terminal (that is, the mobile phone A), kiki's Matepad, and kiki's Matebook pro. Current terminal, kiki's Matepad and kiki's Matebook pro may be devices that have a same account (for example, devices that share one Huawei account). Alternatively, Current terminal, kiki's Matepad, and kiki's Matebook pro may be devices that have different accounts but are authenticated (for an authentication process, refer to the following related descriptions).
[0261] Optionally, the intelligent collaboration interface 701 may include a “Bind another device” button 702. In this embodiment of this application, binding is to establish a trusted relationship between two devices, to perform an operation such as viewing a recently used application between devices. As shown in FIG. 3(k), the mobile phone A may display a “Tap to add” button 703 and a “Scan to add” button 704 in response to an operation (for example, a tap operation) performed by the user on the “Bind another device” button 702. It should be understood that, locations, names, and shapes of elements (for example, a button, an icon, and a word) in UIs corresponding to FIG. 3(j) and FIG. 3(k) are not fixed, and may be freely combined or designed based on a requirement. For example, the button 702 in FIG. 3(j) may be replaced with the button 703 and the button 704 in FIG. 3(k).
[0262] For example, as shown in FIG. 3(l), the mobile phone A may display a “Tap to add” interface 705 in response to a tap operation performed by the user on the “Tap to add” button 703. The “Tap to add” interface 705 may display a pop-up box 706. The pop-up box 706 includes a prompt picture and prompt information. For example, the prompt information may be “Tap to add. After NFC of the mobile phone is enabled, use the back to tap an ontag label on a device”. The user can perform an operation based on the prompt information, to add a new device through “Tap”. For another example, as shown in FIG. 3(m), the mobile phone A may display a “Scan-to-add” interface 707 in response to a tap operation performed by the user on the “Scan-to-add” button 704. The “Scan-to-add” interface 707 may include a prompt picture and prompt information. The prompt information may be, for example, “Scan a two-dimensional code on a device or package”. The user can perform an operation based on the prompt information, to add a new device through “Scan”.
[0263] Optionally, in some example embodiments, if the mobile phone A does not support to add a new device through “Tap” or “Scan”, in response to an operation that the user taps the “Bind another device” button 702 in the intelligent collaboration interface 701 as shown in FIG. 3(n), the mobile phone A may display a pop-up box 708 as shown in FIG. 3(o). The pop-up box 708 includes prompt information “Please ensure that a device is enabled and is near the mobile phone”, and the pop-up box 708 may further include a device detected by the mobile phone A through a short-range communication network (for example, a Wi-Fi network or a Bluetooth network), for example, a device such as Room television, HUAWEI P30, or Matebook X pro. Each device corresponds to a “Bind” button. As shown in FIG. 3(p), prompt information 710“Wait a peer end to confirm . . . ” may be displayed below an identifier of HUAWEI P30 in response to an operation performed by the user on a “Bind” button 709 corresponding to HUAWEI P30. The pop-up box 708 may further include a “Cancel” button 711. In response to an operation that the user taps the “Cancel” button 711, the mobile phone A may return to an interface shown in FIG. 3(n).
[0264] If the peer device provides confirmation (for example, a user of the peer device agrees to establish a trusted relationship), in a possible implementation, the peer device establishes a trusted relationship with the mobile phone A in response to a confirmation instruction of the peer device, so that the mobile phone A can view recent task information of the peer device. In another possible implementation, the mobile phone A further needs to scan a two-dimensional code displayed by the peer device, to complete establishment of the trusted relationship, so as to further improve security and protect privacy. As shown in FIG. 3(q), the mobile phone A may display a “Bind a new device” interface 712, and the “Bind a new device” interface 712 may include prompt information “Scan a two-dimensional code displayed on a peer end”. The user may perform an operation based on the prompt information, to add a new device. It should be understood that, a jump relationship between different UIs is not limited in this embodiment of this application. For example, in response to an operation that the user taps the “Bind” button 709 as shown in FIG. 3(o), the mobile phone may directly display a scanning interface 712 as shown in FIG. 3(q).
[0265] If the peer device does not provide confirmation (for example, the peer device does not have a binding function, a binding timeout, or the peer device is busy, or the user of the peer device does not agree to binding), optionally, as shown in FIG. 3(r), the mobile phone A may display a pop-up box 721, to prompt the user with “Device authentication fails”. The pop-up box 721 may be hidden in response to an operation that the user taps an “OK” button 722. Alternatively, the pop-up box 721 may be hidden after a preset time period (for example, 3 s). In another possible design, as shown in FIG. 3(s), the mobile phone A may display a pop-up box 723, to prompt the user with “A peer end is busy. Please initiate binding later”. The pop-up box 723 may be hidden in response to an operation that the user taps an “OK” button 724. Alternatively, the pop-up box 723 may be hidden after a preset time period (for example, 3 s). In still another possible design, as shown in FIG. 3(t), the mobile phone A may display a pop-up box 725, to prompt the user with “A peer end refuses to trust this device, and binding fails”. The pop-up box 725 may be hidden in response to an operation that the user taps an “OK” button 726. Alternatively, the pop-up box 725 may be hidden after a preset time period (for example, 3 s). Alternatively, as shown in FIG. 3(u), the mobile phone A may display a pop-up box 727 in the interface 712, to prompt the user with “A two-dimensional code of a peer end is disabled, device authentication cannot be completed, and binding fails”. The pop-up box 727 may be hidden in response to an operation that the user taps a button 728.
[0266] It is assumed that the peer device is the mobile phone B (for example, the peer device may be HUAWEI P30). In some example embodiments, if the mobile phone B receives a binding request of the mobile phone A when displaying a home screen 730, the mobile phone B may display a pop-up box 731 as shown in FIG. 3(v). The pop-up box 731 may include prompt information 732“HUAWEI MATE30 requests to be bound to the current terminal. Are you sure you want to trust this device”. The pop-up box 731 may further include a “Distrust” button 733 and a “Trust” button 734. A countdown (for example, 14 s) may also be displayed in the “Distrust” button. If the user does not tap any button when the countdown ends, the pop-up box 731 may be automatically hidden. In response to an operation that the user taps the “Trust” button 734, the mobile phone A may perform an authentication process with the mobile phone B, so that the mobile phone A can be bound to the mobile phone B.
[0267] In some example embodiments, if the mobile phone B receives the binding request of the mobile phone A in a screen-off state or a screen-locked state, the mobile phone B may display a pop-up box 736 in a lock screen interface 735 as shown in FIG. 3(w). The pop-up box 736 may prompt the user with a case in which an intelligent collaboration application receives a device binding request at 7:30 a.m., and the device binding request may be “HUAWEI MATE30 (that is, the mobile phone A) requests to be bound to the current terminal. Are you sure you want to trust this device?”. In response to an operation that the user enters the home screen from the screen-locked state (for example, an operation of entering a password or entering a fingerprint), the pop-up box 736 in FIG. 3(w) may be replaced with a form of the pop-up box 731 in FIG. 3(v), and the user may choose to trust or distrust HUAWEI MATE30 (for example, the mobile phone A).
[0268] In some example embodiments, if the mobile phone B receives the binding request of the mobile phone A in video playing state or a game state, the mobile phone B may display a pop-up box 741 in a video interface or game interface 740 as shown in FIG. 3(x). The pop-up box 741 may prompt the user with a case in which an intelligent collaboration application receives a device binding request, and the device binding request may be “HUAWEI MATE30 requests to be bound to the current terminal. Are you sure you want to trust this device?”. In response to an operation that the user taps a drop-down control 742, as shown in FIG. 3(y), the pop-up box 741 may display more information, for example, may display a “Distrust” button 743 and a “Trust” button 744. A countdown (for example, 14 s) may also be displayed in the “Distrust” button 743. If the user does not tap any button when the countdown ends, the pop-up box 741 may be automatically hidden. In response to an operation that the user taps the “Trust” button 744, the mobile phone A may perform an authentication process with the mobile phone B.
[0269] In some example embodiments, in response to an operation that the user taps the “Trust” button, as shown in FIG. 3(z), the mobile phone B may return to the home screen 730 and display a pop-up box 750. The pop-up box 750 may include a two-dimensional code 751 generated by the mobile phone B, and may further include prompt information 752“Scan to bind. Allow HUAWEI MATE30 to be bound to the current terminal through scanning”. In this case, a user of the mobile phone A may scan, by using the mobile phone A, a two-dimensional code displayed by the mobile phone B, so that the mobile phone A is bound to the mobile phone B. The pop-up box 750 may further include a “Cancel” button 753, and the pop-up box 750 may be hidden in response to an operation that the user taps the “Cancel” button 753.
[0270] In some example embodiments, if the mobile phone A and the mobile phone B log in to a same account (for example, a Huawei account), the mobile phone A may be directly bound to the mobile phone B. For example, a “Bind” button corresponding to the mobile phone B is directly tapped on the mobile phone A, without waiting the mobile phone B to provide confirmation.
[0271] It should be noted that, mutual communication between devices may be performed based on a same network; or based on a previous trusted relationship between devices, for example, a common account, an associated account, or a binding relationship; or based on a same network and a case in which the trusted relationship is established, to implement the solution in this embodiment of this application. This is not limited in this application.
[0272] For example, the first terminal, the second terminal, and the third terminal may be networked to form a local area network device group, and a plurality of devices in the local area network device group are trusted devices. In this case, a local area network device including the first terminal, the second terminal, and the third terminal may be referred to as “super device”.
[0273] For another example, the first terminal, the second terminal, and the third terminal separately log in to a same account.
[0274] For another example, the first terminal, the second terminal, and the third terminal respectively log in to different accounts, but the three accounts are mutually trusted associated accounts, home accounts, or the like.
[0275] For still another example, at least one device in the first terminal, the second terminal, and the third terminal logs in to an account, at least one device has no account, and a device-level authentication relationship may also be established between a device with an account and a device without an account. A specific representation form in which a trusted relationship is established among the first terminal, the second terminal, and the third terminal is not limited in this application.
[0276] The recent task interface of the first terminal not only displays a recently used application of the first terminal, but also displays a recently used application of the second terminal and the third terminal. When a historical task card of another device is displayed in the recent task interface of the first terminal, identifiers of the first terminal and a plurality of terminals (including the second terminal and the third terminal) connected to the first terminal (for example, the plurality of terminals and the first terminal log in to a same account, are connected to a same Wi-Fi hotspot, or log in to an associated account) may be separately displayed in the recent task interface of the first terminal. When an identifier of the first terminal or an identifier of a terminal connected to the first terminal is selected, a recent task list corresponding to the terminal is correspondingly displayed in the recent task interface.
[0277] When a recently used application of the second terminal changes, the recent task list displayed in the recent task interface of the first terminal also needs to be updated. The following describes a method for updating a task interface of the first terminal.
[0278] For example, the user of the second terminal opens a clock application on the second terminal. In this case, for the second terminal, Clock becomes a recently used application of the second terminal. In the foregoing process, a listener of the task management module of the second terminal is registered in the distributed scheduling subsystem of the second terminal. Therefore, when the recently used application of the second terminal changes, the listener may obtain information about the change, and send the information to the distributed scheduling subsystem of the second terminal.
[0279] After obtaining information indicating that Clock becomes a recent application, a second distributed scheduling subsystem may further send the information to the distributed scheduling subsystem of the first terminal. After receiving the information, the distributed scheduling subsystem of the first terminal updates a cache of the recent task information, and notifies the global task center of the first terminal to obtain the updated recent task information. In this case, when the user of the first terminal browses the global task center of the first terminal, the user can see that the clock application is also added to the recent task list corresponding to the second terminal.
[0280] In a possible implementation, snapshot information and intent information that are related to the clock application may also be transmitted from the second terminal to the global task center of the first terminal. In the recent task interface of the first terminal, a task card corresponding to Clock displays a snapshot captured by the system when the application enters the background. In addition, when the task card corresponding to Clock is tapped, the clock application may be entered on the first terminal based on a state of using the clock application on the second terminal.
[0281] In some example embodiments, for some frequently used applications, if the application is opened on the second terminal at a high frequency, when the application is opened or enters the background each time, a location of the application in the recent task interface, snapshot information captured when the application enters the background, and intent information change. If all information related to the application needs to be transmitted from the second terminal to the first terminal, a large resource is consumed. In this case, the second terminal may obtain, through comparison each time the recent task information needs to be synchronized, information that needs to be transmitted at a current time and information that needs to be transmitted at a previous time, deduplicate, based on a deduplication algorithm, the information that needs to be transmitted, and transmit only changed recent task information to a distributed scheduling subsystem of a first device, to reduce an amount of data exchanged between the second terminal and the first terminal. For example, only task information whose field such as taskid, userid, windowmode, or displayid may be selected, and an isRunning field, or the like is not focused. For example, even if the isRunning field changes, the change is not notified or synchronized to the remote device. In this method, an amount of data that needs to be transmitted between the first device and the second device due to synchronization of the recent task information may be reduced, to save network resources.
[0282] The foregoing synchronization of the recent task information is described by using an example in which the second terminal automatically transmits the information to the first terminal in the background. In another possible implementation, when the listener of the second terminal learns that the recently used application of the second terminal changes, this part of the data is transmitted to the distributed scheduling subsystem of the second terminal. The recent task information of the second terminal may change frequently, and the user of the first terminal does not always query the recent task information of the second terminal in the recent task interface of the first terminal. Therefore, the distributed scheduling subsystem of the second terminal may temporarily not send this part of data to the first terminal. When the user of the first terminal operates the first terminal to enter the recent task interface or taps the identifier of the second terminal in the recent task interface, the global task center of the first terminal may be triggered to send a request to the distributed scheduling subsystem of the second terminal through the distributed scheduling subsystem of the first terminal, to request the second terminal to send latest recent task information to the first terminal. The second terminal executes the foregoing task information synchronization procedure, and sends currently obtained recent task information to the first terminal, so that the user of the first terminal can browse to the recent task information of the second terminal. In this case, the second terminal does not need to actively synchronize recent information to the first terminal. Instead, the recent task information is synchronized when a preset trigger condition occurs, for example, when the user of the first terminal operates the first terminal to enter the recent task interface or tap the identifier of the second terminal in the recent task interface. The user of the first terminal does not always need to learn of a recent task situation of the second terminal, and it usually does not need to take too much time to synchronize the recent task information. Therefore, when user experience is ensured, a quantity of times of synchronizing the recent task information of the first terminal and the second terminal is reduced, and an amount of data required for synchronization of the recent task information is reduced, to save network resources.
[0283] Whether the recent task information is automatically synchronized in the background or synchronization is triggered based on a preset condition may be preset by the first terminal and / or the second terminal. In other words, whether the recent task information is automatically synchronized in the background or synchronization is triggered based on the preset condition is determined after the first terminal is connected to the second terminal and this function is enabled. Alternatively, whether synchronization is automatically performed in the background or synchronization is triggered based on the preset condition may also be used as an option that may be set by the user, and the user may set, based on an actual use requirement or a state of the first terminal and / or the second terminal, a specific synchronization mode used by the first terminal and / or the second terminal.
[0284] When the user of the first terminal is using the first terminal, not only a recently used application of another terminal may be viewed in the recent task interface, but also an application run by the another terminal in the background may be cleared. For example, when the second terminal is currently playing music in the background, and the user of the first terminal expects that the second terminal can stop playing music, a music application of the second terminal may be conveniently cleared in the recent task interface of the first terminal according to the technical solution provided in this application. For example, the user of the first terminal may drag a card of the music application in the recent task list corresponding to the second terminal and slide up. After receiving an instruction of the user, the first terminal may send information about a to-be-cleared application to the distributed scheduling subsystem of the second terminal through the distributed scheduling subsystem of the first terminal. After receiving to-be-cleared task information, the distributed scheduling subsystem of the second terminal stops the music application, and sends feedback information to the distributed scheduling subsystem of the first terminal after the music application is stopped. The feedback information indicates that the music application of the second terminal is cleared. After receiving the feedback information, the distributed scheduling subsystem of the first terminal sends a notification to the global task center of the first terminal, to indicate the global task center to refresh the recent task interface. The music application is not displayed in the refreshed recent task interface, or is not displayed in the recent task list corresponding to the second terminal in the recent task interface.
[0285] When the user of the first terminal expects to clear all background applications of the second terminal, to reduce energy consumption of the second terminal and currently occupied processor and memory resources, an icon that indicates to clear all background applications may be tapped in the recent task interface. After the icon is tapped, the global task center of the first terminal sends a notification to the distributed scheduling subsystem of the second terminal through the distributed scheduling subsystem of the first terminal. The notification indicates the second terminal to clear all current background tasks. Feedback information is sent to the first terminal after clearing is completed, so that the global task center of the first terminal can refresh the recent task interface, and the user of the first terminal learns that the recently used background application of the second terminal is cleared.
[0286] A manner of clearing the recently used application of the second terminal in the recent task interface of the first terminal is used as an example for description. For example, the second terminal (P30) recently runs the app 1, the app 3, the app 4, and the app 5. As shown in FIG. 4(a), the user may view, in the recent task interface of the first terminal, the recently run application of the second terminal. For example, when the user wants to clear the app 3, the user may make a slide-up gesture on a task card corresponding to the app 3. After receiving the instruction from the user, the first terminal may indicate the second terminal to clear the app 3. After clearing the app 3, the second terminal may send feedback information to the first terminal, to indicate that the app 3 is cleared. As shown in FIG. 4(b), after receiving the feedback information, the first terminal stops displaying the app 3 in the recent task interface, and displays the app 1, the app 4, and the app 5 other than the app 3.
[0287] In another possible implementation, recently used applications of all terminals are displayed together. In this case, when the user of the first terminal operates the first terminal to enter the recent task interface, each application in the displayed recent task list is a recently used application of one or more terminals in the network. Correspondingly, when the user wants to clear an application, it may mean that the user wants to clear the application on all terminals that recently use the application. For example, when the user slides up the task card of the application to indicate to clear the application, the first terminal obtains, based on information recorded in the global task center, information indicating specific terminals in the network that run a to-be-cleared application in the background. For example, when the user wants to clear a Taobao® application, the global task center determines, based on the recorded information, that the Taobao application is run in the background of the second terminal and the third terminal. In this case, the global task center of the first terminal may send a clearing request to each of the second terminal and the third terminal through the distributed scheduling subsystem of the first terminal. The clearing request indicates each of the second terminal and the third terminal to clear the Taobao application run in the background.
[0288] After the second terminal and the third terminal each clear all background applications, feedback information may be sent to the first terminal. In a possible implementation, the global task center of the first terminal receives feedback information of the second terminal, but has not received feedback information of the third terminal. In this case, because whether the third terminal has cleared a corresponding application is not determined, a task card of the Taobao application may continue to be retained in the recent task view. Optionally, when a corresponding identifier of a terminal is displayed around the task card, because the second terminal has cleared the Taobao application in the background, the identifier of the second terminal around the Taobao application may be removed, to notify the user that the second terminal has cleared the Taobao application in the background. Optionally, after the global task center of the first terminal subsequently receives the feedback information of the third terminal, because it is determined that all terminals running the Taobao application in the background have cleared the application, information about the Taobao application may be removed in the recent task interface of the first terminal.
[0289] The foregoing describes a case in which the first terminal needs to first establish a trusted relationship between the first terminal and another terminal when obtaining the recent task information of the another terminal in the network. In some example embodiments, after the first terminal obtains permission to view and even clear a recently used application of the another terminal with which a trusted relationship is established, an application for which the first terminal can obtain the permission may be limited, to prevent malware from using the permission to execute a behavior that is unfavorable to the user. For example, it may be set that only an application such as the global task center can be authorized to obtain the permission, and corresponding operations may be performed. In this case, after receiving a clearing instruction, the distributed scheduling subsystem of the first terminal may first perform permission verification, to determine whether the clearing instruction comes from an application that is authorized to obtain the permission. If it is determined that the clearing instruction comes from an authorized application, the clearing instruction may be forwarded to a distributed scheduling subsystem of a terminal corresponding to the clearing instruction. If it is determined that the clearing instruction does not come from the authorized application, the clearing instruction is discarded.
[0290] It should be understood that, the foregoing description of a permission verification method for an application is merely an example. In some example embodiments, whether an application may be authorized to obtain permission to view and / or clear a recently used application of another terminal may be preset by the first terminal, or may be set by the user of the first terminal. Verification of whether an application that sends a clearing instruction has permission may be completed by the distributed scheduling subsystem of the first terminal, or may be completed by a distributed scheduling subsystem of the another terminal or another application on the first terminal. The foregoing manner is not limited in this application.
[0291] In some example embodiments, the first terminal not only may view or clear a recently used application of the another terminal, but also may migrate a recently used application of the another terminal to the first terminal, migrate a recently used application of the first terminal to the another terminal, or change an application run in the background to being run in the foreground.
[0292] In some example embodiments, as shown in FIG. 4(c), the user of the first terminal opens the recent task interface of the first terminal, and the recent task interface of the first terminal is an interface that displays the recent task list of the second terminal (P30). Because information about the recently used application of the second terminal is sent to the first terminal, the user may migrate an application on the second terminal to the first terminal, and open the application on the first terminal.
[0293] In some example embodiments, the user may drag a task card corresponding to the app 3 to an icon of “Current terminal”, to indicate the first terminal to run the app 3. When the first terminal is connected to both the second terminal and the third terminal (P40), as shown in FIG. 4(d), the recent task interface of the first terminal displays icons respectively corresponding to the three terminals. In this case, the first terminal not only may migrate an application on the second terminal to the first terminal, but also may drag the task card corresponding to the app 3 to an icon of “P40”, to indicate to migrate the app 3 to the third terminal.
[0294] Because the first terminal obtains state information of the recently used application of the another terminal, when an application on the second terminal is migrated to the first terminal or the third terminal, the first terminal or the third terminal may directly open an interface existing when the application enters the background for running on the second terminal. The state information of the application may further include the FA file. Even if the application is not installed on the first terminal or the third terminal, the application may be directly run based on the FA file.
[0295] In some embodiments, the first terminal may send page element information and a page resource of a to-be-shared page including an application to another device in a form of an FA file, and the another device may run the FA file by using an FA runtime module, to implement a migration of the application. The FA runtime module may convert source code into a user interface. Therefore, the FA file may be packaged and released independently, and have one or more capabilities in installation-free, off-application independent running, a cross-device UI migration, a cross-device binary migration, so that it is more convenient to share content across devices.
[0296] Optionally, migrating the application from the second terminal to the first terminal may be opening the application on the first terminal. In another possible implementation, migrating the application from the second terminal to the first terminal may be sending an interface of the application to the first terminal through projection. In this implementation, when a small amount of data is transmitted, the user of the first terminal can obtain information about an application run by the second terminal.
[0297] In some example embodiments, the user of the first terminal may further perform, in an interface of the recent task list of the second terminal, an operation such as tapping a task card corresponding to an application or dragging the task card to an icon of the second terminal in the interface, to indicate the second terminal to change the application being run in the background to being run in the foreground In response to this operation, the interface of the application may be displayed on a display of the second terminal, so that the application can be seen by the user.
[0298] In some example embodiments, as shown in FIG. 4(e), the user of the first terminal opens the recent task interface of the first terminal, and the recent task interface of the first terminal is in an interface that displays the recent task list of the first terminal (current terminal). In the interface, the user may migrate a recently run application of the first terminal to another terminal. For example, the user may drag a task card corresponding to the app 2 to the icon corresponding to the second terminal, to send state information of the app 2 to the second terminal, and run the app 2 on the second terminal.
[0299] It should be noted that, a task card corresponding to an application is dragged to an icon of a terminal, to migrate the application to the terminal. This is only an example of an operation manner. This is not limited in this application. Actually, an application migration may alternatively be indicated in another manner. For example, an operation manner in which an option of migrating an application corresponding to a task card to another terminal may occur when the task card is touched and held in the recent task interface, or the like may be set.
[0300] Descriptions are provided by using an example in which the recent task information of the another terminal is viewed in this application. Actually, in this application, not only the recently used application of the another terminal may be viewed, but also other information about an application on the another terminal may be viewed, to implement more functions.
[0301] In some example embodiments, the first terminal may further obtain usage time information and / or use time quantity information of an application on the second terminal. Usage time herein may be total usage time of an application on the second terminal, or may be a time period of using an application by the second terminal in a preset time period, for example, a time period of using the application in a day or a week. A use frequency may be a total quantity of times that the second terminal opens an application, or may be a quantity of times that the second terminal opens the application in a preset time period. Optionally, the usage time is used as an example for description. As shown in FIG. 4(f), usage time of an application corresponding to a task card may be displayed next to the task card in the recent task interface. Alternatively, as shown in FIG. 4(g), usage time of an application on the second terminal may be displayed in another interface. To help the user of the first terminal more directly learn of a use situation of the application on the second terminal, data analyzed based on a preset rule may be further displayed on the first terminal. For example, as shown in FIG. 4(h), the user of the first terminal may indicate the first terminal to analyze the application on the second terminal based on usage duration and display identifiers of several applications with longest usage time on the second terminal and corresponding usage time. Optionally, a system of the first terminal or the user of the first terminal may set a quantity of applications that need to be displayed. For example, three applications with longest usage time and usage time of the three applications may be set. In this manner, the user of the first terminal not only may learn of a recently used application of the second terminal, but also may learn of an application with most usage time or a largest use time quantity of the second terminal, to better control a state of using an application on the second terminal.
[0302] In some example embodiments, FIG. 4(i) is a schematic flowchart of an embodiment of this application.
[0303] As shown in FIG. 4(i), this embodiment includes the following steps.
[0304] S1401: A first terminal receives recent task information from a second terminal.
[0305] As described above, after the first terminal and the second terminal are connected through a network, the first terminal may receive recent task information from the second terminal. The recent task information includes information about a first application recently run by the second terminal, and the information about the first application includes an identifier of the first application.
[0306] S1402: The first terminal receives a first instruction from a user.
[0307] After the first terminal obtains the recent task information of the second terminal, the user may send, to the first terminal, the first instruction for instructing the first terminal to open a recent task interface, so that a recently used application of the second terminal can be viewed in the recent task interface.
[0308] In a possible implementation, the recent task interface of the first terminal includes at least two controls, and the at least two controls include a first control corresponding to the first terminal and a second control corresponding to the second terminal. When a corresponding control is tapped, a recently used application of a corresponding terminal may be viewed.
[0309] In another possible implementation, a recently used application of the first terminal and the recently used application of the second terminal are both displayed in the recent task interface of the first terminal, without a need to tap a control to view a recently used application of a terminal.
[0310] The two implementations are examples. A presentation form of the recent task interface is not limited in this application.
[0311] S1403: The first terminal displays the identifier of the first application in the recent task interface.
[0312] When the recent task interface is entered, a screen of the first terminal displays the identifier of the first application recently used by the second terminal.
[0313] It should be understood that, a sequence of the steps is only a possible implementation, and is not limited in this application. For example, step S1402 may be performed before step S1401. To be specific, when receiving the first instruction or a second instruction from the user, the first terminal sends, to the second terminal, a first request that is used to request the recent task information of the second terminal, and then receives the recent task information from the second terminal.
[0314] Optionally, this embodiment may further include: The first terminal may further receive an instruction from the user for clearing the first application, and send a second request to the second terminal. The second request indicates the second terminal to clear the first application. After the second terminal clears the first application, the first terminal may further receive feedback information from the second terminal. The feedback information indicates that the first application needs to be cleared.
[0315] In the recent task interface of the first terminal, the user may further drag a task card corresponding to the first application to a preset location (for example, an identifier of the first terminal in the recent task interface), so that the first terminal runs the first application based on the information that is about the first application and that is received from the second terminal.
[0316] Because the recent task information that is of the second terminal and that is obtained by the first terminal is related to a privacy problem of the user of the second terminal, before the first terminal receives the recent task information of the second terminal, a trusted relationship may be first established between the first terminal and the second terminal.
[0317] FIG. 4(j) is a schematic flowchart of another embodiment of this application.
[0318] As shown in FIG. 4(j), this embodiment includes the following steps.
[0319] S1501: A second terminal receives a first request from a first terminal, where the first request is used to request recent task information of the second terminal, and the recent task information includes a recently used application of the second terminal.
[0320] S1502: Send the recent task information to the first terminal.
[0321] Optionally, the second terminal may further receive a second request from the first terminal. The second request indicates the second terminal to clear the application in the recent task information. In response to the second request, the second terminal clears a corresponding application, and sends feedback information to the first terminal. The feedback information indicates that the application is cleared.
[0322] In another embodiment of this application, the first terminal may further receive other task information from the second terminal, for example, information about an application of the second terminal that has longest running time in a preset time period, to better learn of a use situation of an application of the second terminal.
[0323] In some example embodiments, when a recent task interface of the first terminal displays a recently used application of another terminal (in other words, displays a recent task snapshot of the another terminal, or displays a recent task card, a historical task card, or the like of the another terminal), a task card of the another terminal may be laid out in the recent task interface of the first terminal based on a frequently used state of using the another terminal. For example, the frequently used state of using the another terminal includes landscape-mode use, portrait-mode use, unfolded-state portrait-mode use of a foldable screen, unfolded-state landscape-mode use of the foldable screen, folded-state landscape-mode use of the foldable screen, folded-state portrait-mode use of the foldable screen, and the like. Alternatively, the task card of the another terminal may be laid out in the recent task interface of the first terminal based on a state of using the another terminal by a single user. Alternatively, the task card of the another terminal may be laid out in the recent task interface of the first terminal based on a screen situation (for example, a size) and a use situation (for example, landscape-mode use or portrait-mode use) of the first terminal. Alternatively, the task card, or the like of the another terminal may be laid out in the recent task interface of the first terminal based on a setting of the user for the first terminal. This is not limited in this application.
[0324] In some example embodiments, a situation of displaying and laying out a historical task card of a device A in a recent task interface of another device may be determined based on procedures shown in FIG. 4(k) and FIG. 4(l).
[0325] As shown in FIG. 4(k), if the device A is a foldable-screen device (for example, a foldable-screen mobile phone), whether a frequently used state of using the device A in a previous period of time is an unfolded state is determined; if the frequently used state of using the device A in the previous period of time is the unfolded state, whether the frequently used state of use in the period of time is unfolded-state portrait-mode use is further determined; and if the frequently used state of use in the period of time is unfolded-state portrait-mode use, the historical task card of the device A is displayed (or laid out) in the recent task interface of the another device based on an unfolded-state portrait-mode manner of the device A. If the frequently used state of use is unfolded-state landscape-mode use, the historical task card of the device A is displayed in the recent task interface of the another device based on an unfolded-state landscape-mode manner of the device A.
[0326] If the frequently used state of use is a folded state, whether the frequently used state of use is folded-state portrait-mode use in the period of time is further determined; and if the frequently used state of use is folded-state portrait-mode use in the period of time, the historical task card of the device A is displayed in the recent task interface of the another device based on a folded-state portrait-mode manner of the device A. If the frequently used state of use is folded-state landscape-mode use, the historical task card of the device A is displayed in the recent task interface of the another device based on a folded-state landscape-mode manner of the device A.
[0327] As shown in FIG. 4(l), if the device A is a non-foldable-screen device (for example, a non-foldable-screen mobile phone or tablet computer), whether a frequently used state of using the device A in a previous period of time is a portrait-mode manner is determined; and if the frequently used state of using the device A in the previous period of time is the portrait-mode manner, the historical task card of the device A is displayed in the recent task interface of the another device based on the portrait-mode manner of the device A. If the frequently used state of use is landscape-mode use, the historical task card of the device A is displayed in the recent task interface of the another device based on a landscape-mode manner of the device A.
[0328] It should be understood that, in determining steps shown in FIG. 4(k) and FIG. 4(l), any branch step may be separately performed, and determining does not need to be sequentially performed based on all steps shown in FIG. 4(k) or FIG. 4(l). In other words, in the determining steps shown in FIG. 4(k) and FIG. 4(l), any step may be an independent solution.
[0329] In some example embodiments, when a task card of a first terminal and a task card of another device are displayed on the first terminal, a user may further select a task card layout. After the user selects a layout, the first terminal may display the task card of the first terminal and the task card of the another device on the first terminal in a form of the layout selected by the user. For example, forms of layouts that may be selected by the user includes a horizontal list mode (List), a grid mode (Grid), a stack mode (Stack), a vertical list mode (Vertical list), a slim list mode (Slim list), and the like. This is not limited in this application.
[0330] The following separately provides descriptions with reference to different examples. It should be understood that, the following examples in FIG. 5(a) to FIG. 6(e) may be a part of the flowchart shown in FIG. 4(k) or FIG. 4(l), or may be independent solutions. This is not limited in this embodiment of this application.
[0331] Example 1: It is assumed that a first terminal is a tablet computer, a second terminal is another tablet computer, a third terminal is a non-foldable-screen mobile phone, and a fourth terminal is a foldable-screen mobile phone.
[0332] In some example embodiments, FIG. 5(a) is a schematic diagram of displaying a historical task card of a second terminal in a recent task interface of a first terminal (a current terminal). As shown in FIG. 5(a), a layout of the historical task card that is of the second terminal and that is displayed in the recent task interface of the first terminal is displayed as a multi-task layout based on landscape-mode use of the second terminal. In FIG. 5(a), identifiers (icon) of the first terminal and a plurality of terminals connected to the first terminal (for example, the plurality of terminals and the first terminal log in to a same account, are connected to a same Wi-Fi hotspot, or log in to an associated account) are separately displayed in the recent task interface of the first terminal. When an identifier of the first terminal or an identifier of a terminal connected to the first terminal is selected, a historical task card corresponding to the terminal is correspondingly displayed in the recent task interface. As shown in FIG. 5(a), when the first terminal receives an instruction of a user, so that an identifier of the second terminal (MatePad) is selected, the historical task card of the second terminal is displayed in the recent task interface of the first terminal. When the historical task card of the second terminal (MatePad) is displayed in the recent task interface of the first terminal (the current terminal), the historical task card of the second terminal is displayed in a single row based on landscape-mode use of the second terminal (MatePad). In this implementation, when a historical task card of a tablet computer is displayed in a recent task interface of another tablet computer, a landscape-mode historical task card of the tablet computer is displayed in a single row based on landscape-mode use of the tablet computer. This conforms to a use habit of the user for the tablet computer and a normal display rule of the tablet computer, and is friendly to the user, to improve user experience. It should be further understood that, a solution shown in FIG. 5(a) may be an independent solution.
[0333] In a possible implementation, as shown in FIG. 5(b), when a historical task card of the second terminal (MatePad) is displayed in a recent task interface of the first terminal (a current terminal), the historical task card of the second terminal may be displayed in two rows based on landscape-mode use of the second terminal (MatePad). In this implementation, when a historical task card of a tablet computer is displayed in a recent task interface of another tablet computer, the historical task card of the second terminal is displayed in two or more rows (for example, three rows) based on landscape-mode use of the tablet computer. This conforms to a use habit of the user for the tablet computer and a normal display rule of the tablet computer, and is friendly to the user, to improve user experience. It should be further understood that, a solution shown in FIG. 5(b) may be an independent solution.
[0334] In a possible implementation, FIG. 5(c) is a schematic diagram of displaying a historical task card of a third terminal (P40) in a recent task interface of a first terminal (a current terminal). As shown in FIG. 5(c), when the historical task card of the third terminal (P40) is displayed on the first terminal (the current terminal), the historical task card of the third terminal is displayed based on portrait-mode use of the third terminal (P40). In this implementation, when a historical task card of a non-foldable-screen mobile phone is displayed in a recent task interface of a tablet computer, the historical task card of the non-foldable-screen mobile phone is displayed based on portrait-mode use of the non-foldable-screen mobile phone. This conforms to a use habit of the user for the non-foldable-screen mobile phone and a normal display rule of the tablet computer, and is friendly to the user, to improve user experience. It should be further understood that, a solution shown in FIG. 5(c) may be an independent solution.
[0335] In a possible implementation, FIG. 5(d) is a schematic diagram of displaying a historical task card of a fourth terminal (Mate X2) in a recent task interface of a first terminal (a current terminal). The fourth terminal (Mate X2) is a foldable-screen device. Therefore, in a possible implementation, as shown in FIG. 5(d), when a historical task card of the fourth terminal (Mate X2) is displayed on the first terminal (the current terminal), the historical task card of the fourth terminal is displayed in a single row based on unfolded-state portrait-mode use of a foldable screen of the fourth terminal (Mate X2). Optionally, in another possible implementation, if a screen of the first terminal (the current terminal) is high, the historical task card of the fourth terminal may be displayed in a plurality of rows based on unfolded-state portrait-mode use of a foldable screen of the fourth terminal (Mate X2). In this implementation, when a historical task card of a foldable-screen mobile phone is displayed in a recent task interface of a tablet computer, the historical task card of the foldable-screen mobile phone is displayed based on unfolded-state portrait-mode use of the foldable-screen mobile phone. This conforms to a use habit of the user for the foldable-screen mobile phone and a normal display rule of the tablet computer, and is friendly to the user, to improve user experience. It should be further understood that, a solution shown in FIG. 5(d) may be an independent solution.
[0336] Example 2: It is assumed that a first terminal is a non-foldable-screen mobile phone, a second terminal is a tablet computer, and a third terminal is a foldable-screen mobile phone.
[0337] In some example embodiments, FIG. 6(a) is a schematic diagram of displaying a historical task card of a second terminal (MatePad) in a recent task interface of a first terminal (a current terminal). As shown in FIG. 6(a), when the historical task card of the second terminal (MatePad) is displayed on the first terminal (the current terminal), the historical task card of the second terminal is displayed in two rows based on landscape-mode use of the second terminal (MatePad). Optionally, when the historical task card of the second terminal (MatePad) is displayed on the first terminal (the current terminal), the historical task card of the second terminal may alternatively be displayed in one row based on landscape-mode use of the second terminal (MatePad). In this implementation, when a historical task card of a tablet computer is displayed in a recent task interface of a non-foldable-screen mobile phone, the historical task card of the tablet computer is displayed in two rows or a single row based on unfolded-state landscape-mode use of the tablet computer. This conforms to a use habit of the user for the tablet computer and a normal display rule of the foldable-screen mobile phone, and is friendly to the user, to improve user experience. It should be further understood that, a solution shown in FIG. 6(a) may be an independent solution.
[0338] In a possible implementation, FIG. 6(b) is a schematic diagram of displaying a historical task card of a third terminal (Mate X2) in a recent task interface of a first terminal. The third terminal (Mate X2) is a foldable-screen device. Therefore, in a possible implementation, as shown in FIG. 6(b), when the historical task card of the third terminal (Mate X2) is displayed on the first terminal (a current terminal), the historical task card of the third terminal is displayed in a single row based on unfolded-state portrait-mode use of the third terminal (Mate X2). Optionally, if a screen of the first terminal (the current terminal) is high, the historical task card of the third terminal may be displayed in a plurality of rows based on unfolded-state portrait-mode use of the third terminal (Mate X2).
[0339] Example 3: It is assumed that a first terminal is a non-foldable-screen mobile phone, a second terminal is a tablet computer, and a third terminal is a foldable-screen mobile phone. In addition, the first terminal is in a landscape-mode display state. In this implementation, when a historical task card of a foldable-screen mobile phone is displayed in a recent task interface of a non-foldable-screen mobile phone, the historical task card of the foldable-screen mobile phone is displayed in a single row based on unfolded-state portrait-mode use of the foldable-screen mobile phone. This conforms to a use habit of the user for the foldable-screen mobile phone and a normal display rule of the non-foldable-screen mobile phone, and is friendly to the user, to improve user experience. It should be further understood that, a solution shown in FIG. 6(b) may be an independent solution.
[0340] In some example embodiments, FIG. 6(c) is a schematic diagram of displaying a historical task card of a first terminal (for example, P40) in a recent task interface of the first terminal (a current terminal). As shown in FIG. 6(c), because the first terminal is displayed in landscape mode, the historical task card of the first terminal (the current terminal) is displayed based on landscape-mode use of the first terminal (the current terminal).
[0341] In a possible implementation, FIG. 6(d) is a schematic diagram of displaying a historical task card of a second terminal (MatePad) in a recent task interface of a first terminal (a current terminal). As shown in FIG. 6(d), because the first terminal is displayed in landscape mode, the historical task card of the second terminal (MatePad) is displayed based on landscape-mode use of the first terminal (the current terminal).
[0342] Optionally, in the implementations shown in FIG. 6(c) and FIG. 6(d), when a historical task card of a non-foldable-screen mobile phone is displayed in a recent task interface of the non-foldable-screen mobile phone, the historical task card of the non-foldable-screen mobile phone is displayed (landscape-mode use, landscape-mode display; portrait-mode use, portrait-mode display) on the non-foldable-screen mobile phone based on a state (landscape-mode display or portrait-mode display) of using the non-foldable-screen mobile phone. This adapts to different use habits of a user. A task card of the non-foldable-screen mobile phone is displayed to the user without requiring the user to switch between a landscape mode and a portrait mode, to improve user experience. It should be further understood that, solutions shown in FIG. 6(c) and FIG. 6(d) may be independent solutions.
[0343] In a possible implementation, FIG. 6(e) is a schematic diagram of displaying a historical task card of a third terminal (Mate X2) in a recent task interface of a first terminal (a current terminal). As shown in FIG. 6(e), because the first terminal is displayed in landscape mode, the historical task card of the third terminal (Mate X2) is displayed based on landscape-mode use of the first terminal (the current terminal), and the historical task card of the third terminal (Mate X2) is displayed in a single row based on unfolded-state portrait-mode use of a foldable screen. Optionally, the historical task card of the third terminal (Mate X2) may alternatively be displayed based on folded-state portrait-mode use of a foldable screen, or folded-state landscape-mode use of a foldable screen, or unfolded-state landscape-mode use. This is not limited in this application.
[0344] In the implementation shown in FIG. 6(e), when a historical task card of a foldable-screen mobile phone is displayed in a recent task interface of a non-foldable-screen mobile phone, a task card of the foldable-screen mobile phone is displayed based on a state (landscape-mode use or portrait-mode use) of using the non-foldable-screen mobile phone by the user, and based on unfolded-state portrait-mode use of a foldable screen of the foldable-screen mobile phone or folded-state portrait-mode use of a foldable screen. This adapts to different use habits of a user. A historical task card of the foldable-screen mobile phone is displayed based on a frequently used state of using the foldable-screen mobile phone by the user, without requiring the user to switch between a landscape mode and a portrait mode, to improve user experience. It should be further understood that, a solution shown in FIG. 6(e) may be an independent solution.
[0345] It should be understood that, the foregoing examples are merely examples, and should not impose any limitation on a layout of a historical task card that is of another device and that is displayed in a recent task interface of a current device in this application. In another embodiment of this application, a layout different from that in the foregoing examples may alternatively be used for display. This is not limited in this application.
[0346] In this embodiment of this application, when a historical task card of another device is displayed in a recent task interface of a first terminal (a current terminal or a local device), one or more last historical task cards of the another device may display a home screen snapshot (or a foreground home screen snapshot) of the device; or display a home screen snapshot of the device and a floating bubble; display a home screen snapshot of the device and a floating window; or display a home screen snapshot of the device. The home screen snapshot displays a task card; or displays a remote control that controls the device; or displays an ongoing (OnGoing) task of the device, or the like. The following provides descriptions with reference to specific examples.
[0347] Example 4: It is assumed that a first terminal (a current terminal) is a tablet computer. FIG. 7(a) is a schematic diagram of viewing a historical task card of a non-foldable-screen mobile phone (P40) in a recent task interface of a first terminal. As shown in FIG. 7(a), a last task card in the historical task card of the mobile phone P40 displays a home screen snapshot of the mobile phone P40, and a feature ability (feature ability, FA) card may further exist on the home screen snapshot. The FA card may be a card corresponding to an application or a task. A user may tap “FA card” on the home screen snapshot of the mobile phone P40. In a possible implementation, after the FA card is tapped, an application or a task corresponding to the FA card is displayed on a screen of the first terminal. In other words, the application or the task corresponding to the FA card is opened on the first terminal. Alternatively, in another possible implementation, after the FA card is tapped, the home screen of the mobile phone P40 is displayed on a screen of the first terminal, and the FA card is displayed on the home screen of the mobile phone P40. The user may tap the FA card, and an application or a task corresponding to the FA card is displayed on the screen of the first terminal.
[0348] Example 5: It is assumed that a first terminal (a current terminal) is a tablet computer. FIG. 7(b) is a schematic diagram of viewing a historical task card of a non-foldable-screen mobile phone (a mobile phone P40) in a recent task interface of a first terminal. As shown in FIG. 7(b), last several task cards in the historical task card of the mobile phone P40 each display a first-screen snapshot of a home screen of the mobile phone P40. When a user may make a slide-left gesture on the first-screen snapshot of the home screen of the mobile phone P40, a last task card in the recent task interface of the first terminal is switched to a second-screen snapshot of the home screen of the mobile phone P40, as shown in FIG. 7(c). Optionally, the user may tap the first-screen snapshot of the home screen or the second-screen snapshot of the home screen of the mobile phone P40, and the first-screen snapshot of the home screen or the second-screen snapshot of the home screen of the mobile phone P40 is displayed on the first terminal. The user may tap an application icon on a home screen snapshot on the first-screen snapshot or the second-screen snapshot of the home screen of the mobile phone P40, to open the application on the first terminal. Alternatively, in another possible implementation, as shown in FIG. 7(c), the user may tap a blank region on the first-screen snapshot or the second-screen snapshot of the home screen of the mobile phone P40 (a region other than an application icon on a home screen snapshot). After the user taps the blank region, a first-screen interface or a second-screen home screen of the home screen of the mobile phone P40 is displayed on a screen of the first terminal. The user may tap an application icon of the mobile phone P40 on the home screen, to open the application on the current terminal.
[0349] Example 6: It is assumed that a first terminal (a current terminal) is a tablet computer. FIG. 7(d) is a schematic diagram of viewing a historical task card of a non-foldable-screen mobile phone (for example, P40) in a recent task interface of a first terminal. As shown in FIG. 7(d), a last task card in the historical task card of the mobile phone P40 displays a home screen snapshot of the mobile phone P40, and the home screen snapshot of the mobile phone P40 displays a floating window of a task or an application. Optionally, a user may tap the floating window on the home screen snapshot of the mobile phone P40, and tap the floating window. In a possible implementation, an application or a task corresponding to the floating window is displayed on the first terminal. In other words, the application or the task corresponding to the floating window is opened on the first terminal. Alternatively, in another possible implementation, after the floating window is tapped, an interface of a home screen of P40 is displayed on the first terminal. Optionally, the floating window exists in the interface of the home screen of P40. After the user taps the floating window on the home screen of P40, the application or the task corresponding to the floating window is opened on the first terminal.
[0350] Example 7: It is assumed that a first terminal (a current terminal) is a tablet computer. FIG. 7(e) is a schematic diagram of viewing a historical task card of a non-foldable-screen mobile phone (for example, P40) in a recent task interface of a first terminal. As shown in FIG. 7(e), a last task card in the historical task card of the mobile phone P40 displays a home screen snapshot of the mobile phone P40, and the home screen snapshot of the mobile phone P40 displays a floating bubble of a task or an application. Optionally, a user may tap the floating bubble on the home screen snapshot of the mobile phone P40. In a possible implementation, after the floating bubble is tapped, the application or the task corresponding to the floating bubble is displayed (for example, displayed in full screen or in a form of the floating window) on the first terminal. In other words, the application or the task corresponding to the floating bubble is opened on the first terminal. Alternatively, in another possible implementation, after the user taps the floating bubble, a home screen of P40 is displayed on the first terminal. Optionally, the floating bubble exists in an interface of the home screen of P40. After the user taps the floating bubble on the home screen of P40, the application or the task corresponding to the floating bubble is opened on the first terminal.
[0351] Example 8: It is assumed that a first terminal (a current terminal) is a tablet computer. FIG. 7(f) is a schematic diagram of viewing a historical task card of a large-screen device (HUAWEI TV) in a recent task interface of a first terminal. As shown in FIG. 7(f), a last task card in the historical task card of the large-screen device displays a snapshot of a remote control of the large-screen device. Optionally, as shown in FIG. 7(f), a user may tap a blank region (a region outside a control button on the snapshot of the remote control) on the snapshot of the remote control of the large-screen device. After the user taps the blank region, details of the remote control of the large-screen device are displayed on the first terminal. The user may directly control the large-screen device through the remote control of the large-screen device on the first terminal. Alternatively, the user may directly tap, on the snapshot of the remote control of the large-screen device, the control button on the snapshot of the remote control, to control the large-screen device.
[0352] Example 9: It is assumed that a first terminal (a current terminal) is a mobile phone. FIG. 7(g) is a schematic diagram of viewing historical task cards of a plurality of other devices in a recent task interface of a first terminal. Optionally, an icon (icon) of one device (for example, a last device) in the plurality of devices is an icon of a device of a lightweight device type. A lightweight device is a general term of devices such as an internet of things (internet of things, IOT) device, a wearable device, and a smart home device. For example, the lightweight device may include a smart refrigerator, a smart air conditioner, a smart wok, a smart kitchen hood, a smart sound box, a smartwatch, and the like. After a user may tap an icon of “Lightweight device” in FIG. 7(g), as shown in FIG. 7(h), task cards corresponding to ongoing (OnGoing) tasks of these lightweight devices (kitchen appliances) may be displayed on one or more task cards in the recent task interface of the first terminal. When the user makes a slide-left gesture on the task card of the lightweight device in FIG. 7(h), as shown in FIG. 7(i), a task card in the recent task interface of the first terminal displays a task card of another lightweight device (for example, a portable device).
[0353] In examples shown in FIG. 7(g) to FIG. 7(i), all lightweight devices are integrated together, and all the lightweight devices are displayed by using one icon of “Lightweight device” at the top of the screen. In some other embodiments of this application, each lightweight device may alternatively correspond to a device icon of the lightweight device, and the device icon is displayed at the top of the screen. In other words, one lightweight device corresponds to one device icon. Alternatively, a lightweight device may be classified. One type of lightweight device corresponds to one icon. For example, a plurality of lightweight devices of a kitchen type correspond to one device icon, and a plurality of lightweight devices of a living room use type correspond to one device icon. Alternatively, the user may independently provide a setting, so that one or several lightweight devices jointly correspond to one device icon, or the like. This is not limited in this application.
[0354] In some example embodiments, in interfaces shown in FIG. 7(h) and FIG. 7(i), in a possible implementation, the user may perform a tap operation in a blank region on any card (that is, a region outside a control button on any card) of any lightweight device shown in FIG. 7(h) and FIG. 7(i). For example, if the user performs a tap operation in a blank region on a task card of the smart wok as shown in FIG. 7(j), an interface displayed by the first terminal is shown in FIG. 7(k). After tapping is performed, details of an ongoing task of the smart wok may be displayed in the interface of the first terminal, and the user may remotely perform task control in a detail interface.
[0355] For another example, if the user performs a tap operation in a blank region on a task card of a Huawei watch (HUAWEI WATCH GT2) as shown in FIG. 7(l), an interface displayed by the first terminal is shown in FIG. 7(m). After tapping is performed, details of an ongoing task of a music player may be displayed in the interface of the first terminal, and the user may remotely perform task control in the detail interface.
[0356] In some example embodiments, in interfaces shown in FIG. 7(h) and FIG. 7(i), in another possible implementation, the user may also perform a tap operation in a blank region on any card of any lightweight device shown in FIG. 7(i) and FIG. 7(j). After tapping is performed, details of the smart wok (that is, a lightweight device) may be displayed in the interface of the first terminal.
[0357] In some example embodiments, in interfaces shown in FIG. 7(h) and FIG. 7(i), in another possible implementation, the user may also directly perform a tap operation on a control button on a card of any lightweight device. In other words, the user directly taps a corresponding control button on the card of the lightweight device, to implement remote task control. For example, as shown in FIG. 7(n), if the user taps an “Off” button on the task card of the smart wok, the smart wok stops running.
[0358] In some example embodiments, when a task card of another lightweight device is displayed in the recent task interface of the first terminal, if a small quantity of corresponding operations are performed on a lightweight device, a standard device card may be used to display a task card of the lightweight device. For example, in FIG. 7(h) and FIG. 7(i), portable cards corresponding to the smart wok, the smart kitchen hood, the Huawei watch (HUAWEI WATCH GT2), and the smart washing machine are all standard device cards.
[0359] Optionally, in another possible implementation, when a task card of another lightweight device is displayed in the recent task interface of the first terminal, if a large quantity of corresponding operations are performed on a lightweight device, more functions may be displayed on a task card of the lightweight device. For example, it is assumed that the lightweight device is a smart wok, and a switch to a simmer, stir-fry, heat power adjustment, or visual sight of a situation of food in the smart wok can be quickly implemented. Therefore, the task card corresponding to the lightweight device may be displayed by using an immersive task card. For example, as shown in FIG. 7(o), task cards corresponding to the smart wok and the smart kitchen hood in the recent task interface of the first terminal are immersive task cards.
[0360] In some example embodiments, when a task card of another lightweight device is displayed in the recent task interface of the first terminal, the user may further drag a task card of a lightweight device to an icon of another intelligent device (for example, MatePad and Mate X2) in the recent task interface of the first terminal. Therefore, the task card of the lightweight device is displayed in a recent task interface of the another intelligent device, or is displayed on a home screen of the another intelligent device. Optionally, after the intelligent device receives information about the task card of the lightweight device, the intelligent device may further add the task card of the lightweight device to RecentTasks center of the intelligent device, or add the task card of the lightweight device to a home screen.
[0361] Example 10: It is assumed that a first terminal (a current terminal) is a mobile phone. When a recent task interface of the first terminal displays historical task cards of a plurality of other devices, one or more last task cards may display a home screen application icon of a device. For example, FIG. 7(p) is a schematic diagram of displaying a historical task card of a mobile phone P40 in a recent task interface of a first terminal. A last task card displays a home screen application icon (icon) of the mobile phone P40.
[0362] In an example shown in FIG. 7(p), in a possible implementation, a user may tap a blank region on the task card, to display, on the first terminal as shown in FIG. 7(q), the home screen application of the mobile phone P40. The user may drag an application icon in an interface shown in FIG. 7(q), to help the mobile phone P40 manage the application (for example, sort the application, create a folder, or delete the application).
[0363] In an example shown in FIG. 7(p), in another possible implementation, the user may alternatively directly perform an operation on a task card of the home screen application of the mobile phone P40. For example, an application icon is dragged on the task card of the home screen application of the mobile phone P40, to help the mobile phone P40 manage the application, without a need to first display, on the first device, the home screen application of the mobile phone P40.
[0364] In some example embodiments, in addition to a case in which a task card of another lightweight device is displayed in a recent task interface of a terminal device used by the user, there is a case in which a task card of another intelligent device (including another lightweight device and an intelligent terminal used by the user, for example, a mobile phone or a tablet computer) with a same account or an associated account may also be viewed on a lightweight device, and the task card may be further operated on the lightweight device, to remotely control the another intelligent terminal device on the lightweight device.
[0365] For example, when the user views a task card of another intelligent terminal with a same account or an associated account on a lightweight device, a sensor, a camera, a microphone, or the like of the lightweight device may be used to assist in identity authentication of the user, or a sensor, a camera, a microphone, or the like of each of the lightweight device and another nearby device (for example, a smartwatch carried by the user, or a large-screen device in a home) may be used to assist in identity authentication of the user. After identity authentication of the user succeeds, a task card of another device displayed on the lightweight device may be viewed, and an operation may be performed on the task card, to remotely control the another intelligent terminal device and another lightweight device on the lightweight device. The following provides descriptions with reference to specific examples.
[0366] Example 11: As shown in FIG. 7(r), it is assumed that a lightweight device used by a user is a smart kitchen hood. If the user taps a button “Lightweight device” on a screen of the smart kitchen hood, an ongoing (OnGoing) task card of another lightweight device with an account the same as or associated with that of the kitchen hood may be displayed on the screen of the smart kitchen hood. As shown in FIG. 7(r), after the user taps the button “Lightweight device”, displayed task cards of lightweight devices includes a task card of a smart wok and a task card of a smart washing machine. When the task card of the another lightweight device is displayed on the screen of the smart kitchen hood, the task card may be adaptively displayed based on the screen of the smart kitchen hood (that is, the task card is responsively laid out based on the screen). When the user slides the task card leftward or rightward, task cards of more lightweight devices with another account or an associated account may be viewed. Optionally, if the user may tap a blank region on a task card (a region outside a control button on the task card), detailed content of the task card is displayed in full screen or is adaptively displayed based on the screen on a display. The user may remotely perform task control in a detail interface. Alternatively, the user may directly perform a tap operation on a control button on a task card of any lightweight device. In other words, the user directly taps a corresponding control button on the card of the lightweight device, to implement remote task control.
[0367] Example 12: As shown in FIG. 7(s), it is assumed that a lightweight device used by a user is a smart kitchen hood, and the user taps a button “Lightweight device” on a screen of the smart kitchen hood. In this case, the smart kitchen hood may invoke a sensor, a camera, a microphone, or the like of each of the smart kitchen hood and another nearby device (for example, a smartwatch carried by the user or a large-screen device in a home) to assist in identity authentication of the user. After identity authentication of the user succeeds, an ongoing task card of another lightweight device with an account the same as or associated with that of the smart kitchen hood is displayed on the screen of the smart kitchen hood. Optionally, one lightweight device may correspond to one ongoing task card. The user slides the ongoing task card leftward. Last several task cards are icons of intelligent terminals with an account the same as or associated with that of the kitchen hood. For a terminal 1 and a terminal 2 as shown in FIG. 7(s), the user selects an icon of an intelligent terminal that needs to be viewed. Assuming that the intelligent terminal that needs to be viewed is the terminal 1, and the user taps an icon of “Terminal 1”, a plurality of task cards of the terminal 1 are displayed on the screen of the smart kitchen hood. Optionally, the plurality of task cards of the terminal 1 include a historical task card and a foreground task card of the terminal 1, and the foreground task card is a task card corresponding to an application that is being displayed on a screen of the terminal 1. For example, if a video is being played on the screen of the terminal 1, a task card corresponding to an application of the video is a foreground task card. Optionally, a task card corresponding to a floating window displayed on the screen of the terminal 1 may also be a foreground task card of the terminal 1, and the historical task card includes a task card corresponding to an application run by the terminal 1 in the background.
[0368] Optionally, if the user may tap a blank region on a task card, detailed content of the task card is displayed in full screen or is adaptively displayed based on the screen on a display of the smart kitchen hood. The user may remotely perform task control in a detail interface. Alternatively, the user may directly perform a tap operation on a control button on a card of any device. In other words, the user directly taps a corresponding control button on the task card of the device, to implement remote task control.
[0369] When a historical task card of another device (a remote device) is displayed in a recent task interface of a first terminal (a current terminal), a user may tap a task card on the first terminal, so that a task or an application corresponding to the task card is displayed (or run) on the first terminal. This process may be referred to as starting a task card of the remote device on the first terminal.
[0370] In some example embodiments, when the task card of the remote device is started in the recent task interface of the first terminal, the task card may be started based on a rule shown in FIG. 8(a)-1 and FIG. 8(a)-2.
[0371] It should be understood that, in determining steps shown in FIG. 8(a)-1 and FIG. 8(a)-2, any branch step may be separately performed, and determining does not need to be sequentially performed based on all steps shown in FIG. 8(a)-1 and FIG. 8(a)-2. In other words, in the determining steps shown in FIG. 8(a)-1 and FIG. 8(a)-2, any step may be an independent solution.
[0372] As shown in FIG. 8(a)-1 and FIG. 8(a)-2, if an application of the remote device is migrated to the recent task interface of the first terminal in a replication mode, in other words, a task card in the recent task interface of the first terminal is obtained from an application of the remote device in the replication mode, after the task card is started on the first terminal, the first terminal and the remote device may simultaneously display (or run) the application. In addition, states of an application displayed by the first terminal and the remote device are synchronized (for example, both the first terminal and the remote device display a same page of a same PPT file), and data of the application in the first terminal and the remote device is synchronized. When displaying the application, the first terminal and the remote device may adaptively display the application based on features of respective screens. In this application, it may be understood that, adaptive display means that in a display process, different devices may adjust, based on sizes of respective screens, sizes and layouts of an application displayed on the screens. In other words, the layout and the size of the application displayed on the screen are resizable (Resizable). For example, one of the first terminal and the remote device displays the application in full screen, and the other one of the first terminal and the remote device displays the application in non-full screen; or one of the first terminal and the remote device displays the application in landscape mode, and the other one of the first terminal and the remote device displays the application in portrait mode; or the like. The application is not pulled back when a task card of the application is tapped in a recent task interface of the remote device, or an icon of the application is tapped on a home screen of the remote device. “Pulling back the application” can be understood as performing an operation on a source device (in this example, the source device is the remote device) of the application, so that the application is migrated back to the source device. The application is not displayed in a recent task interface or a home screen of another device, or is not run on another device.
[0373] If an application of the remote device is not migrated to the recent task interface of the first terminal in the replication mode, whether the application is displayed in the recent task interface of the first terminal in a migration mode based on a window projection technology is further determined. In the migration mode based on the window projection technology, the application does not need to be installed on the first terminal. If the application is displayed in the recent task interface of the first terminal in the migration mode based on the window projection technology, whether the application supports a plurality of instances continues to be determined.
[0374] When the application supports a plurality of instances, the application may be simultaneously displayed (or run) on the first terminal and the source device (the remote device). Data of the application on the first terminal and the remote device is synchronized. When the first terminal and the remote device display the application, the first terminal and the remote device may adaptively display the application based on features of respective screens. However, states of the application displayed by the first terminal and the remote device may be not synchronized (for example, one device displays a first page of a PPT file, and the other device displays a second page of the PPT file). The application is not pulled back when a task card of the application is tapped in a recent task interface of the remote device, or an icon of the application is tapped on a home screen of the remote device.
[0375] If the application does not support a plurality of instances, the application cannot be simultaneously displayed on the first terminal and the remote device. If the application is a foreground task or a foreground application on the remote device (a task or an application that is being displayed and run in an interface of the remote device), after the application is migrated to the first terminal, the remote device automatically exits the task, and a home screen of the remote device is displayed on a screen of the remote device. The application is pulled back when a task card of the application is tapped in a recent task interface of the remote device, or an icon of the application is tapped on a home screen of the remote device.
[0376] If an application of the remote device is not displayed in the recent task interface of the first terminal in the migration mode based on the window projection technology, but instead, is displayed in the recent task interface of the first terminal in a migration mode based on an FA technology, the first terminal needs to first install the application or an FA of the application, and then a task card of the application can be displayed in the recent task interface of the first terminal only after installation is completed. After the application or the FA of the application is installed on the first terminal, data of the application on the first terminal and the remote device is synchronized. When the first terminal and the remote device display the application, the first terminal and the remote device may adaptively display the application based on features of respective screens. However, states of the application displayed by the first terminal and the remote device may be not synchronized. The application is not pulled back when a task card of the application is tapped in a recent task interface of the remote device, or an icon of the application is tapped on a home screen of the remote device.
[0377] The following provides descriptions with reference to specific examples. It should be understood that, the following examples in FIG. 8(b)-1 and FIG. 8(b)-2 to FIG. 8(n) may be a part of a flowchart shown in FIG. 8(a)-1 and FIG. 8(a)-2, or may be independent solutions. This is not limited in this application.
[0378] Example 13: It is assumed that a first terminal (a current terminal) is a tablet computer. FIG. 8(b)-1 and FIG. 8(b)-2 are a schematic diagram of viewing historical task cards of a plurality of other devices in a recent task interface of a first terminal. As shown in FIG. 8(b)-1 and FIG. 8(b)-2, it is assumed that a magazine lock screen application of a remote device (that is, a source device of a task) is displayed in the recent task interface of the first terminal in a replication mode, in other words, a task card of the magazine lock screen application in the recent task interface of the first terminal is obtained from a device P40 in the replication mode. A user taps the task card of the magazine lock screen application in the recent task interface of the first terminal. In other words, after the task card is started on the first terminal, as shown in FIG. 8(c)-1 and FIG. 8(c)-2, the first terminal and P40 may simultaneously display the magazine lock screen application. In addition, states of an application displayed by the first terminal and the remote device are synchronized, and both the first terminal and the device P40 display a picture 3 of the magazine lock application. Data of the application on the first terminal and the device P40 is synchronized. For example, if the user edits the picture 3 on the first terminal, an editing state is automatically synchronized to the device P40. When displaying the magazine lock screen application, the first terminal and the device P40 may adaptively display the magazine lock screen application based on features of respective screens (for example, P40 displays the magazine lock screen application in portrait mode, and the first terminal displays the magazine lock screen application in landscape mode). In this implementation, an application of the remote device is migrated to the first terminal device in the replication mode. The remote device and the first terminal may simultaneously display the application. States (data) of the application displayed on the two devices are synchronized. An operation performed by the user on the application on any device may be synchronized to the two devices, to facilitate an operation of the user, and improve user experience. It should be further understood that, a solution described in Example 13 may be an independent solution.
[0379] In a possible implementation, descriptions are provided in Example 14.
[0380] Example 14: It is assumed that a first terminal (a local device) is a tablet computer. FIG. 8(d)-1 and FIG. 8(d)-2 are a schematic diagram of viewing historical task cards of a plurality of other devices in a recent task interface of a first terminal. As shown in FIG. 8(d)-1 and FIG. 8(d)-2, it is assumed that a magazine lock screen application of a remote device is displayed in the recent task interface of the first terminal in a migration mode based on a window projection technology, and the magazine lock screen application supports a plurality of instances; or a magazine lock screen application of a remote device is displayed in the recent task interface of the first terminal in a migration mode based on an FA technology. In the two cases, data of the application on the first terminal and a device P40 is synchronized. A user taps a task card of the magazine lock screen application in the recent task interface of the first terminal. It is assumed that after the user taps a picture 2 on the task card of the magazine lock screen application, that is, after the task card is started on the first terminal, as shown in FIG. 8(e)-1 and FIG. 8(e)-2, the first terminal displays the picture 2 of the magazine lock screen application, and the device P40 still displays a picture 3 of the magazine lock screen application. In other words, states of the magazine lock screen application displayed by the first terminal and P40 are not synchronized, and the states of the magazine lock screen application displayed by the two devices do not affect each other. In addition, when displaying the magazine lock screen application, the first terminal and the device P40 may adaptively display the magazine lock screen application based on features of respective screens (for example, P40 displays the magazine lock screen application in portrait mode, and the first terminal displays the magazine lock screen application in landscape mode). In this implementation, an application of the remote device is displayed in the recent task interface of the first terminal in the migration mode based on the FA technology; or an application of the remote device is displayed in the recent task interface of the first terminal in the migration mode based on the window projection technology, and the application supports a plurality of instances. The remote device and the first terminal may simultaneously display the application. States (data) of the application displayed on the two devices are not synchronized, an operation performed by the user on the application on any device is independent, and states of the application displayed on the two devices do not affect each other. An operation of the user is facilitated, so that the user flexibly operates an application on different devices, to improve user experience. It should be further understood that, a solution described in Example 14 may be an independent solution.
[0381] In some example embodiments, if an application of the device P40 is displayed in the recent task interface of the first terminal in the migration mode based on the FA technology, prompt information of a source device of the application may not be displayed on the first terminal after the user starts a card of the application on the first terminal. For example, a prompt “from P40” may not be displayed on the first terminal.
[0382] In a possible implementation, descriptions are provided in Example 15.
[0383] Example 15: It is assumed that a first terminal (a current terminal) is a tablet computer. FIG. 8(f)-1 and FIG. 8(f)-2 are a diagram of an interface displayed on a first terminal after an app “Huawei video” of a remote device (P40) is started on the first terminal. A video of the app “Huawei video” of the device P40 is being played on the first terminal. It is assumed that the application “Huawei video” of the device P40 is displayed in a recent task interface of the first terminal in a migration mode based on a window projection technology, and the application “Huawei video” does not support a plurality of instances. If a user is to pull back the application on the device P40, the user may tap an icon of “Huawei video” on a home screen of the device P40; or select a task card of “Huawei video” of the device P40 in a recent task interface of the device P40, and tap the task card, to pull back the application “Huawei video”. FIG. 8(f)-1 and FIG. 8(f)-2 show a case in which the user taps the icon of “Huawei video” on the home screen of the device P40. After the user pulls back the application “Huawei video”, as shown in FIG. 8(g)-1 and FIG. 8(g)-2, the first terminal no longer plays the video of the app “Huawei video”, but instead, displays a home screen of the first terminal. The device P40 continues to play the video by continuing a state of the video previously played on the first terminal (for example, if the first terminal plays a video to a moment t of the video before the app “Huawei video” is pulled back, after the app “Huawei video” is pulled back, the device P40 continues to play the video after the moment t). In this implementation, an application of the remote device is displayed in the recent task interface of the first terminal in the migration mode based on the window projection technology, and the application does not support a plurality of instances. After the user pulls back the application on the remote device, the first terminal does not display the application, so that the user can pull back the application at any time, and an operation of the user is simple. It should be further understood that, a solution described in Example 15 may be an independent solution.
[0384] In a possible implementation, descriptions are provided in Example 16.
[0385] Example 16: It is assumed that a first terminal (a current terminal) is a tablet computer. FIG. 8(h)-1 and FIG. 8(h)-2 are a diagram of an interface displayed on a first terminal after an app “Huawei video” of a remote device (P40) is started on the first terminal. A video of the app “Huawei video” of the device P40 is being played on the first terminal. It is assumed that the application “Huawei video” of the device P40 is displayed in a recent task interface of the first terminal in a replication mode; or the application “Huawei video” of the device P40 is displayed in a recent task interface of the first terminal in a migration mode based on a window projection technology, and the application “Huawei video” supports a plurality of instances; or the application “Huawei video” of the device P40 is displayed in a recent task interface of the first terminal in a migration mode based on an FA technology. The application “Huawei video” is not pulled back when the user taps an icon of “Huawei video” on a home screen of the device P40; or selects a task card of “Huawei video” of the device P40 in a recent task interface of the device P40, and taps the task card. FIG. 8(h)-1 and FIG. 8(h)-2 show a case in which the user taps the icon of “Huawei video” on the home screen of the device P40. After the user taps the icon of “Huawei video”, as shown in FIG. 8(i)-1 and FIG. 8(i)-2, the app “Huawei video” enters a new video selection interface. When the user taps another video (assumed to be a video 2) for playing, in other words, the user initiates a new video task (the video 2) on the device P40, the new task does not affect a video (that is, the video 1) that is of the app “Huawei video” of the device P40 and that is being played on the first terminal. As shown in FIG. 8(i)-1 and FIG. 8(i)-2, the new task (the video 2) that is run by the user on the device P40 and the video (that is, the video 1) that is of the app “Huawei video” and that is migrated from the device P40 to the first terminal do not affect each other. In this implementation, an application of the remote device is displayed in the recent task interface of the first terminal in the replication mode; or an application of the remote device is displayed in the recent task interface of the first terminal in the migration mode based on the window projection technology, and the application supports a plurality of instances; or an application of the remote device is displayed in the recent task interface of the first terminal in the migration mode based on the FA technology. After the user pulls back the application on the remote device, the first terminal may continue to display the application. States of the application displayed or run on the two devices (the remote device and the first terminal) do not affect each other. The user may perform an operation on the application on any device, and the user may perform, on each of the two devices, an independent operation on the application on any one of the two devices, to meet a requirement of the user for a case in which an application simultaneously has different running states, and improve user experience. A solution described in Example 16 may be an independent solution.
[0386] In some example embodiments, if a local device is a small-screen device and a remote device is a large-screen device, after a task card of the remote device is started on the local device, an application corresponding to the task card is displayed on a screen of the local device. In a process in which the application is displayed on the local device, the application may be displayed on a display of the local device based on one of the following rules:
[0387] Rule 1: Adaptively display the application on the local device based on a screen size of the local device.
[0388] Optionally, in this embodiment of this application, if the local device is a wide-screen device and the remote device is a narrow-screen device, after the task card of the remote device is started on the local device, the application corresponding to the task card may be displayed on the display of the local device based on Rule 2.
[0389] Rule 2: Automatically display the application on the local device in a parallel horizon manner.
[0390] In this embodiment of this application, it can be understood that a parallel-horizon display manner is an application split screen function, and supports to display one application on two screens. A user may display a same application in two windows when a used terminal is in landscape mode. The user simultaneously operates and watches the two windows, and the two windows do not affect each other. For example, when the user uses chatting software when the terminal is in landscape mode, a system may enter a parallel horizon mode, and the user may easily reply to chatting information while browsing Moments or an article of an official account; or during online shopping, the user may continue to browse a list of other commodities while viewing details of a favorite commodity.
[0391] In some example embodiments, if the local device is a narrow-screen device and the remote device is a wide-screen device, after the task card of the remote device is initiated on the local device, the application corresponding to the task card may be displayed on the display of the local device based on Rule 3.
[0392] Rule 3: Automatically disable a parallel horizon manner on the local device, and adaptively display the application based on a screen size of the local device.
[0393] In some example embodiments, if the local device is a narrow-screen device and the remote device is a wide-screen device, after the task card of the remote device is started on the local device, the application corresponding to the task card may be displayed on the display of the local device based on Rule 4.
[0394] Rule 4: Display the application on the local device in full screen, and perform no switching between a landscape mode and a portrait mode, that is, display the application on the screen of the local device based on a display state of the application on the remote device.
[0395] The following provides descriptions with reference to specific examples.
[0396] In a possible implementation, descriptions are provided in Example 17.
[0397] Example 17: It is assumed that a first terminal (a local device) is a mobile phone (for example, P40), and a remote device is a tablet computer. After a task card of a magazine lock screen app of the tablet computer is started on P40, a magazine lock screen interface corresponding to the task card is displayed on a screen of P40. As shown in FIG. 8(j)-1 and FIG. 8(j)-2, the magazine lock screen interface displayed on the tablet computer is displayed in full screen, and the magazine lock screen interface is also adaptively displayed in full screen on the device P40. As shown in FIG. 8(j)-1 and FIG. 8(j)-2, if a task card of a magazine lock screen app of the device P40 is started on the tablet computer, a magazine lock screen interface corresponding to the task card is displayed in full screen on a screen of the tablet computer.
[0398] In this implementation, after an application of the remote device is migrated to the local device, the remote device and the local device each may adaptively display the application based on respective screens, to improve user experience. It should be further understood that, a solution described in Example 17 may be an independent solution.
[0399] In a possible implementation, descriptions are provided in Example 18.
[0400] Example 18: It is assumed that a first terminal (a local device) is a tablet computer, and a remote device is a mobile phone (for example, P40). The local device is a wide-screen device, and the remote device is a narrow-screen device. After a task card of a news browsing app of P40 is started on the tablet computer, a news browsing interface corresponding to the task card is displayed on a screen of the tablet computer. As shown in FIG. 8(k), the news browsing interface displayed on the tablet computer is automatically displayed in parallel horizon, and a news browsing interface displayed on a screen of P40 is displayed by automatically disabling parallel horizon, that is, in a normal display state.
[0401] As shown in FIG. 8(k), if a task card of a news browsing app of the tablet computer is started on P40, a news browsing interface corresponding to the task card is displayed on the screen of P40. A news browsing interface displayed on the tablet computer is automatically displayed in parallel horizon, and the news browsing interface displayed on the screen of P40 is displayed by automatically disabling parallel horizon, that is, in a normal display state (for example, adaptively displayed in full screen). In this implementation, after an application of the remote device is migrated to the local device, based on features of respective screens, the remote device and the local device may automatically display the application in a parallel horizon manner on a device with a wide screen, and display the application in a normal display manner on a device with a narrow screen, to display the application by fully using the features of respective screens, and improve user experience. It should be further understood that, a solution described in Example 18 may be an independent solution.
[0402] Example 19: It is assumed that a first terminal (a local device) is a mobile phone (for example, P40), and a remote device is a tablet computer. After a task card of a video-type app of the tablet computer is started on P40, a video corresponding to the task card is displayed on a screen of P40. As shown in FIG. 8(l), because a video displayed on the tablet computer is displayed in landscape mode, the video is also displayed in landscape mode on the device P40. In other words, no switching is performed between a landscape mode and a portrait mode.
[0403] As shown in FIG. 8(l), after a task card of a video-type app of the device P40 is started on the tablet computer, a video corresponding to the task card is displayed on a screen of the tablet computer. Because a video displayed on the device P40 is displayed in landscape mode, the video is also displayed in landscape mode on the tablet computer. In other words, no switching is performed between a landscape mode and a portrait mode. In this implementation, after an application of the remote device is migrated to the local device, the local device displays the application on the local device in a manner in which the remote device displays the application (the local device displays the application in landscape mode when the remote device displays the application in landscape mode, and the local device displays the application in portrait mode when the remote device displays the application in portrait mode). No switching is performed between a landscape mode and a portrait mode, so that a user feels no significant change between display states existing before and after the application is migrated. This is friendly to the user, and improves user experience. It should be further understood that, a solution described in Example 19 may be an independent solution.
[0404] In some example embodiments, if the local device is a large-screen device and the remote device is a small-screen device, after a task card of the remote device is started on the local device, an application corresponding to the task card is displayed on a screen of the local device. In a process in which the application is displayed, the application corresponding to the task card may alternatively be displayed on the screen of the local device in a form of a floating window. Further, if the local device supports adaptive display, when the application corresponding to the task card is displayed on the screen of the local device in the form of the floating window, the application corresponding to the task card may be displayed in a landscape or wide floating window; or if the local device does not support adaptive display, the application corresponding to the task card may be displayed in a portrait or narrow floating window.
[0405] In some example embodiments, if the local device is a PC device, after a task card of an application of the remote device is started on the local device, the application may be displayed in a floating window by default on the local device, for example, as shown in Example 20.
[0406] In a possible implementation, descriptions are provided in Example 20.
[0407] Example 20: As shown in FIG. 8(m), a user taps a task card corresponding to an app 2 of a device P40 in a recent task interface of a PC device, so that the task card is started on the PC device. When the app 2 is displayed on the PC device, as shown in FIG. 8(m), there may be two different forms of display in a floating window, one is display in a portrait or narrow floating window, and the other is display in a landscape or wide floating window. In this implementation, after an application of a remote device with a small screen is migrated to a local device with a large screen, the local device may display the application in a floating window, to improve screen use efficiency. It should be further understood that, a solution described in Example 20 may be an independent solution.
[0408] If the local device is a PC device, after a task card of an application of the remote device is started on the local device, when the application is displayed on the local device, optionally, a selection interface may also be set, so that the user can select display in full screen or display in a floating window. An example is shown in Example 21.
[0409] Example 21: As shown in FIG. 8(n), a user taps a task card corresponding to an app 2 of a device P40 in a recent task interface of a PC device, so that the task card is started on the PC device. When the app 2 is displayed on the PC device, as shown in FIG. 8(n), there may be two different forms of display in a floating window, one is display in full screen, and the other is display in a floating window. The user may select display in full screen or display in a floating window based on a requirement of the user. After the user taps and selects a corresponding option, the app 2 may be correspondingly displayed on the PC device based on a selection result of the user. In this implementation, after an application of a remote device with a small screen is migrated to a local device with a large screen, the local device may display the application in a floating window or in full screen, and the user may flexibly make selection. This is friendly to the user, and improves user experience. It should be further understood that, a solution described in Example 21 may be an independent solution.
[0410] In this embodiment of this application, in addition to displaying a task card of another device and a task card of the local device in a recent task interface of the local device used by the user, the user may further perform an operation on the task card in the recent task interface, so that an application corresponding to the task card is installed on the local device or the another device. The following provides descriptions with reference to specific examples.
[0411] Example 22: It is assumed that a local device (a current terminal) used by a user is a mobile phone (for example, P40). FIG. 8(o)-1 and FIG. 8(o)-2 are a schematic diagram of displaying a task card of another device in a recent task interface of P40. In an example shown in FIG. 8(o)-1 and FIG. 8(o)-2, the user views a task card of a tablet computer 1 (MatePad1) in the recent task interface of the current terminal. If the user may touch and hold a task card corresponding to an app 2 for a long period of time, a prompt box of “Download to a current terminal”, “Open in a floating window”, and “Open in split screen” may pop up. If the user taps “Download to a current terminal”, the current terminal P40 may automatically download and install the app 2. Optionally, after the app 2 is installed, the app 2 is automatically opened on the current terminal. If the user taps “Open in a floating window”, the app 2 is opened in a floating window on a screen of the current terminal P40 (that is, after the app 2 is started on the current terminal, the app 2 is displayed in a floating window). If the user taps “Open in split screen”, the app 2 is opened in split screen on the screen of the current terminal P40 (that is, after the app 2 is started on the current terminal, the app 2 is displayed in split screen).
[0412] Example 23: It is assumed that a local device (a current terminal) used by a user is a tablet computer 1 (MatePad1). FIG. 8(p)-1 and FIG. 8(p)-2 are a schematic diagram of displaying a task card of another device in a recent task interface of MatePad1. In an example shown in FIG. 8(p)-1 and FIG. 8(p)-2, the user views a task card of P40 in the recent task interface of the current terminal. The user touches and holds a task card corresponding to an app 2, and drags the task card to a location of an icon of a device Mate X2, to migrate the app 2 from the device P40 to the device Mate X2. In addition, a prompt box of “Download to Mate X2”, “Open in a floating window”, “Open in split screen”, and “Open in full screen” may further pop up on the current terminal. If the user taps “Download to Mate X2”, Mate X2 may automatically download and install the app 2. Optionally, after the app 2 is installed, Mate X2 may automatically open the app 2. If the user taps “Open in a floating window”, the app 2 is opened in a floating window on a screen of the current terminal (that is, after the app 2 is started on the current terminal, the app 2 is displayed in a floating window). If the user taps “Open in split screen”, the app 2 is opened in split screen on the screen of the current terminal (that is, after the app 2 is started on the current terminal, the app 2 is displayed in split screen). If the user taps “Open in full screen”, the app 2 is opened in full screen on the screen of the current terminal (that is, after the app 2 is started on the current terminal, the app 2 is displayed in full screen).
[0413] In some example embodiments, in a process in which a task card of another device and a task card of the local device are displayed in the recent task interface of the local device used by the user, the user may further perform an operation on a plurality of task cards of a same device, or perform an operation on task cards of different devices, to simultaneously display, in split screen on a screen of the local device or the remote device, applications respectively corresponding to the plurality of task cards; or display one task in full screen, and display the other tasks in a floating window or a floating bubble; or display each of the plurality of task cards in a floating window. The following provides descriptions with reference to specific examples.
[0414] Example 24: It is assumed that a local device (a current terminal) used by a user is a mobile phone (for example, P40). FIG. 8(q)-1 to FIG. 8(q)-3 are a schematic diagram of displaying a task card of another device in a recent task interface of P40. In an example shown in FIG. 8(q)-1 to FIG. 8(q)-3, the user views a task card of the current terminal in the recent task interface of the current terminal. The user touches and holds a task card corresponding to an app 2 of the current terminal by using a left hand, and slides the task card leftward by using a right hand, to switch to a task card corresponding to another application of the current terminal, and select the task card. It is assumed that the user selects a task card corresponding to an app 5 of the current terminal, and the user touches and holds the task card corresponding to the app 5 of the current terminal by using the right hand, and releases the task card after dragging the task card corresponding to the app 5 to overlap the task card corresponding to the app 2. In this case, the app 2 and the app 5 can be displayed in split screen on the current terminal.
[0415] In some example embodiments, when the app 2 and the app 5 are displayed on the current terminal, optionally, the app 2 is displayed in full screen, and the app 5 is displayed in a floating window; or the app 5 is displayed in full screen, and the app 2 is displayed in a floating window; or the app 2 and the app 5 each are displayed in a floating window. This is not limited in this application.
[0416] Example 25: It is assumed that a local device (a current terminal) used by a user is a mobile phone (for example, P40). FIG. 8(r)-1 to FIG. 8(r)-4 are a schematic diagram of displaying a task card of another device in a recent task interface of P40. In an example shown in FIG. 8(r)-1 to FIG. 8(r)-4, the user views a task card of the current terminal in the recent task interface of the current terminal. The user touches and holds a task card corresponding to an app 2 of the current terminal by using a left hand, and taps a device icon of MatePad1 by using a right hand, to switch to a task card corresponding to MatePad1, slide the task card corresponding to MatePad1 leftward or rightward by using the right hand, and select the task card. It is assumed that the user selects a task card corresponding to an app 4 of MatePad1, and the user touches and holds the task card corresponding to the app 4 of MatePad1 by using the right hand, and releases the task card after dragging the task card corresponding to the app 4 to overlap the task card corresponding to the app 2. In this case, the app 2 of the current terminal and the app 4 of MatePad1 can be displayed in split screen on the current terminal.
[0417] In some example embodiments, when the app 2 and the app 4 are displayed on the current terminal, optionally, the app 2 is displayed in full screen, and the app 4 is displayed in a floating window; or the app 4 is displayed in full screen, and the app 2 is displayed in a floating window; or the app 2 and the app 4 each are displayed in a floating window. This is not limited in this application.
[0418] Example 26: It is assumed that a local device (a current terminal) used by a user is a mobile phone (for example, P40). FIG. 8(s)-1 to FIG. 8(s)-3 are a schematic diagram of displaying a task card of another device in a recent task interface of P40. In an example shown in FIG. 8(s)-1 to FIG. 8(s)-3, the user views a task card of the current terminal in the recent task interface of the current terminal. The user touches and holds a task card corresponding to an app 2 of the current terminal by using a left hand, and taps a device icon of MatePad1 by using a right hand, to switch to a task card of MatePad1, slide the task card of MatePad1 leftward or rightward by using the right hand, and select the task card. It is assumed that the user selects a task card corresponding to an app 4 of MatePad1, and the user touches and holds the task card corresponding to the app 4 of MatePad1 by using the right hand. In this case, the user may slide both the task card corresponding to the app 2 and the task card corresponding to the app 4 to an icon of a target device (a mobile phone P30), and then release the task card corresponding to the app 2 and the task card corresponding to the app 4. In this case, the app 2 and the app 4 can be displayed on a screen of P30. In other words, apps corresponding to different devices are simultaneously migrated to the target device.
[0419] When the app 2 and the app 4 are displayed on the screen of P30, optionally, as shown in FIG. 8(t), the app 2 and the app 4 may be displayed in split screen; or the app 2 is displayed in full screen, and the app 4 is displayed in a floating window; or the app 4 is displayed in full screen, and the app 2 is displayed in a floating window; or the app 2 and the app 4 each are displayed in a floating window.
[0420] Optionally, in Example 26, after the user touches and holds the task card corresponding to the app 2 of the current terminal by using the left hand, the user may slide the task card leftward by using the right hand, to switch to a task card corresponding to another application of the current terminal, and select the task card. After selection is completed, the user slides both the task card corresponding to the app 2 and the task card corresponding to the another app of the current terminal to the target device, and releases the task card corresponding to the app 2 and the task card corresponding to the another app. In this case, two different apps 2 of the current terminal can be displayed on the target device.
[0421] Example 27: It is assumed that a local device (a current terminal) used by a user is a mobile phone (for example, P40). FIG. 8(u)-1 to FIG. 8(u)-4 are a schematic diagram of displaying a task card of another device in a recent task interface of P40. In an example shown in FIG. 8(u)-1 to FIG. 8(u)-4, optionally, the user touches and holds a task card corresponding to an app 2 of the current terminal by using a left hand, and taps a device icon of MatePad1 by using a right hand, to switch to a task card of MatePad1, slide the task card of MatePad1 leftward or rightward, and select the task card. It is assumed that the user selects a task card corresponding to an app 4 of MatePad1, and the user touches and holds the task card corresponding to the app 4 of MatePad1, and releases the task card after dragging the task card corresponding to the app 4 to overlap a task card corresponding to an app 2. In this case, the task card corresponding to the app 4 and the task card corresponding to the app 2 form a new task card (split-screen task card), and the new task card is displayed in the recent task interface of the current terminal. The task card includes the task card corresponding to the app 4 and the task card corresponding to the app 2.
[0422] Optionally, in Example 27, after the user touches and holds the task card corresponding to the app 2 of the current terminal by using the left hand, the user may further slide the task card leftward by using the right hand, to switch to a task card corresponding to another application of the current terminal, and select the task card. After selection is completed, the task card corresponding to the another app of the current terminal is released after being dragged to overlap the task card corresponding to the app 2. In this case, task cards corresponding to two different apps of the current terminal form a new task card, and the new task card is displayed in the recent task interface of the current terminal.
[0423] In some example embodiments, after a task (an application) crosses devices in a migration mode based on a window projection technology, and a distance between a local device (a device that displays a task card of a remote device) and the remote device (a source device of the task card) exceeds a threshold, or quality of a network between the local device and the remote device is less than a preset threshold, a communication connection between the local device and the remote device is interrupted. In this case, a “Capsule” prompt may occur on the local device, to prompt a user with a case in which the local device and the remote device are to be disconnected. In addition, the user may perform an operation (for example, a slide-up operation or a slide-down operation) on “Capsule”. After an operation is performed on the “Capsule” prompt, the “Capsule” prompt may be hidden; or the “Capsule” prompt may be automatically hidden after a preset display time length. After the “Capsule” prompt is hidden for a preset time length, if the distance between the local device and the remote device still exceeds the threshold, or the quality of the network between the local device and the remote device is still less than the preset threshold, the “Capsule” prompt may occur again. Optionally, after the “Capsule” prompt occurs again, the “Capsule” prompt may be hidden or automatically hidden through an operation of the user. In addition, a prompt of the source device (the remote device) exists on the local device.
[0424] In some example embodiments, when a task crosses devices in a migration mode based on an FA technology, if a distance between a local device and a remote device exceeds a threshold, or after quality of a network between the local device and the remote device is less than a preset threshold, a communication connection between the local device and the remote device is interrupted. In this case, optionally, a “Capsule” prompt may not occur on the local device. In other words, no “Capsule” prompt exists on the local device. In addition, an application may be independently used remotely on the local device. Optionally, no prompt of a source device (the remote device) exists on the local device.
[0425] The following provides descriptions with reference to specific examples.
[0426] Example 28: It is assumed that a first terminal (a local device) is a tablet computer. FIG. 8(v) is a diagram of an interface displayed on a first terminal after an application of a remote device (a device P40) on the first terminal is started on the first terminal. As shown in FIG. 8(v), it is assumed that a magazine lock screen application of the remote device (a source device P40 of a task) is displayed in a recent task interface of the first terminal in a migration mode based on a window projection technology. In this case, if a distance between the local device and the remote device exceeds a threshold, a “Capsule” prompt may occur on the local device, to prompt a user with “A distance from P40 is too far, and a connection is to be disconnected”. Optionally, the user may perform an operation (for example, a slide-up operation or a slide-down operation) on “Capsule”. After an operation is performed on the “Capsule” prompt, the “Capsule” prompt may be hidden; or the “Capsule” prompt may be automatically hidden after a preset display time length. In addition, a prompt “From P40” of the source device (P40) exists on the local device.
[0427] In some example embodiments, after a distance between a local device and a remote device exceeds a threshold, or quality of a network between a local device and a remote device is less than a preset threshold, or a remote device exits “super device”, or a remote device changes a login account, or the like, and a communication connection between the local device and the remote device is interrupted, an application that is of the remote device and that is started on the local device is displayed with a mask on the local device, and prompt information is displayed to the user in display of the mask, to prompt the user with “A connection is disconnected due to XXX”. If a connection disconnection factor is eliminated (for example, a network is restored, a distance becomes a safe distance again, or a login into a same account or an associated account is restored) within a preset time length, the local device is automatically reconnected to the remote device. After a reconnection succeeds, the local device exits display with a mask, and restores normal task display.
[0428] Optionally, a button is further displayed to the user on the mask, to prompt the user with “Reconnect”. The user may manually tap the button to reconnect.
[0429] Optionally, a button is further displayed to the user on the mask, to prompt the user with “Exit the application”. The user may manually tap the button. After the application is exited, a home screen of the local device is displayed. If the user does not tap the button within a preset time length (for example, 15 minutes), after the preset time length ends, the application is automatically exited, and the home screen of the local device is displayed.
[0430] If a connection disconnection factor is eliminated (for example, a network is restored, a distance becomes a safe distance again, or a login into a same account or an associated account is restored) before the user exits the application, the local device is automatically reconnected to the remote device. After a reconnection succeeds, the local device exits display with a mask, and restores normal task display.
[0431] Optionally, if a migration of the application to the local device fails due to another abnormality reason, for example, the application of the remote device is migrated to another device, display is still performed with a mask on the local device, and a button is further displayed to the user on the mask, to prompt the user with “Exit the application”.
[0432] The following provides descriptions with reference to specific examples.
[0433] Example 29: It is assumed that a first terminal (a local device) is a tablet computer. FIG. 8(w) is a diagram of an interface displayed on a first terminal after an application “Magazine lock screen” of a remote device (a device P40) on the first terminal is started on the first terminal. As shown in FIG. 8(w), if a distance between the local device and the remote device exceeds a threshold, after a communication connection between the local device and the remote device is interrupted, the application “Magazine lock screen” is displayed with a mask on the local device. In addition, prompt information is displayed to a user in display of the mask, to prompt the user with “A distance is too far, and a connection is disconnected”.
[0434] Optionally, as shown in FIG. 8(w), a button is further displayed to the user on the mask, to prompt the user with “Reconnect”. The user may manually tap the button to reconnect.
[0435] Optionally, if a connection disconnection factor is eliminated (for example, a distance becomes a safe distance again) within a preset time length, the local device is automatically reconnected to the remote device. After a reconnection succeeds, the local device exits display with a mask, and restores normal task display.
[0436] Optionally, as shown in FIG. 8(w), a button is further displayed to the user on the mask, to prompt the user with “Exit the application”. The user may manually tap the button. After the application is exited, a home screen of the local device is displayed. If the user does not tap the button within a preset time length (for example, 15 minutes), after the preset time length ends, the application is automatically exited, and the home screen of the local device is displayed.
[0437] In some example embodiments, a local device may further migrate a recently used application of another terminal to the local device, and display the application in the foreground of the local terminal; or migrate a recently used application of the local device to another terminal, and display the application in the foreground of the another terminal. Alternatively, if there are a plurality of other terminals (for example, a device B and a device C are included), the local device may further migrate a recently used application of the device B to the device C, and display the application in the foreground of the device C.
[0438] In some example embodiments, in a process in which the local device migrates a task card of a device to another device for display, a user may touch and hold a task card corresponding to the application on the local device, to hide another task card and an unavailable device icon around the local device. The unavailable device icon means that a device does not support the application. To be specific, after the application is migrated to the device, the device cannot run the application.
[0439] In some example embodiments, when a user needs to migrate an application to another device (that is, a target device) on the local device, the user may drag a task card corresponding to the application to an icon region of the target device. The local device may automatically determine the target device based on an area of an overlapping region of the task card and an icon of each device.
[0440] In some example embodiments, the user may alternatively perform different operations on the task card, to determine a target device to which the task card needs to be migrated.
[0441] The following provides descriptions with reference to specific examples.
[0442] It should be understood that, in operations such as “tap”, “drag”, and “move or slide” on a task card in the following examples and operations such as “tap”, “drag”, and “move or slide” on a task card in the foregoing examples, operations in any two or more examples may be combined into a whole solution, or operations in any one example may be a separate solution. This is not limited in this application.
[0443] For example, the operations such as “tap”, “drag”, and “move or slide” on the task card in the following examples are similar to the operations such as “tap”, “drag”, and “move or slide” on the task card in the foregoing examples (for example, examples shown in FIG. 4(c) to FIG. 4(e) and an example shown in FIG. 8(p)-1 and FIG. 8(p)-2), and an application corresponding to a task card may be run on a target device by performing an operation on the task card.
[0444] Example 30: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(a)-1 and FIG. 9(a)-2 are a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). Assuming that a user needs to migrate an app 2 of the current terminal to another device, the user may touch and hold a task card corresponding to the app 2. Assuming that MatePad2 is an unavailable device, an icon of MatePad2 may be hidden. Optionally, in this embodiment of this application, in addition to a case in which an icon of the unavailable device is hidden, the icon of the unavailable device may be displayed to the user in another manner. For example, a text prompt box may be disposed below an unavailable icon, to prompt a case in which the device is an unavailable device. Alternatively, the icon of the unavailable device may be displayed with a mask or displayed in a blurred manner. This is not limited in this application.
[0445] Example 31: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(b)-1 and FIG. 9(b)-2 is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to MatePad1. The user may touch and hold a task card corresponding to the app 2, and slide the task card upward to an icon region of MatePad1. A shorter distance between the task card and the icon region of MatePad1 leads to a smaller task card. After the task card partially overlaps the icon region of MatePad1, or a distance between the task card and the icon region of MatePad1 is less than a preset threshold, the user releases the task card. After being released, the task card may be automatically migrated to MatePad1, and is displayed in the foreground of MatePad1.
[0446] Example 32: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(c)-1 and FIG. 9(c)-2 are a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. The user may touch and hold a task card corresponding to the app 2, and slide the task card upward to an icon region of a device. If the task card overlaps an icon region of a device, it is determined that the device is a target device. For example, as shown in FIG. 9(c)-1 and FIG. 9(c)-2, after the user touches and holds the task card corresponding to the app 2, and slides the task card upward, if the task card overlaps an icon of the device MatePad1, it is determined that MatePad1 is a target device. After the user releases the task card, the task card may be automatically migrated to the target device, and displayed in the foreground of the target device.
[0447] Example 33: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(d)-1 and FIG. 9(d)-2 are a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. The user may touch and hold a task card corresponding to the app 2, and slide the task card upward to an icon region of the device. If the task card simultaneously overlaps icon regions of a plurality of devices, optionally, it may be determined that an icon of a device with a largest overlapping area is a target device. As shown in FIG. 9(d)-1 and FIG. 9(d)-2, the task card simultaneously overlaps a device icon of MatePad1 and a device icon of MatePad2, and there is a largest overlapping area of the task card and an icon of the device MatePad1, it is determined that MatePad1 is a target device. After the user releases the task card, the task card may be migrated to the target device, and displayed in the foreground of the target device.
[0448] Example 34: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(e) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. The user may touch and hold a task card corresponding to the app 2, and slide the task card upward. After a distance (that is, a distance between a location at which a finger touches a screen on a mobile phone of the user before the user slides the task card and a location at which the finger touches the screen on the mobile phone of the user after the user slides the task card) by which the user slides the task card upward is greater than or equal to a preset distance, a device directly above the task card is a target device. For example, an interface displayed when the user touches and holds the task card corresponding to the app 2 and does not slide is shown in FIG. 9(e), an interface displayed after the user slides the task card upward is shown in FIG. 9(f). If a device directly above the task card is MatePad1, it is determined that MatePad1 is a target device. After the user releases the task card, the task card may be migrated to the target device, and displayed in the foreground of the target device.
[0449] Example 35: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(g) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. The user may touch and hold a task card corresponding to the app 2, and slide the task card upward. Optionally, after a distance between a location at which a finger touches a screen on a mobile phone of the user and the top of a screen of the first terminal is less than or equal to a preset distance, a device directly above the task card is a target device. For example, an interface displayed after the user slides the task card upward is shown in FIG. 9(h). If the device directly above the task card is MatePad1, it is determined that MatePad1 is a target device. After the user releases the task card, the task card may be migrated to the target device, and displayed in the foreground of the target device.
[0450] In this embodiment of this application, in addition to a case in which a target device to which a task card needs to be migrated is determined in the foregoing manners, some preset rules may be further set. For example, the user may touch and hold a task card of another device in a recent task interface of a current terminal, and release the task card after touching and holding the task card. The task card is automatically migrated to the current terminal, and an application corresponding to the task card is displayed or run on the current terminal. Alternatively, the user may independently set a default target device. The user releases a task card after touching and holding a task card, and the task card is automatically migrated to the default target device. This is not limited in this application.
[0451] After the user selects the target device by performing an operation on the task card, in a possible implementation, the user may continue to touch and hold and drag the task card, until the task card overlaps an icon of the selected target device. In this case, the user releases the task card. The task card may be migrated to the target device, and displayed in the foreground of the target device, to complete cross-device interaction. In a possible implementation, after the user selects the target device by performing an operation on the task card, although the task card does not overlap an icon of the selected target device, the user releases the task card. The task card may still be migrated to the target device, and displayed in the foreground of the target device, to complete cross-device interaction. An example is shown in Example 36.
[0452] Example 36: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(i) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. After the user determines a target device through any one of the foregoing operations, although the task card does not overlap an icon of the selected target device, the user may release the task card. After the user releases the task card, the task card may be migrated to the target device, and displayed in the foreground of the target device. For example, FIG. 9(i) is a diagram of an interface of a target device selected by a user. The target device is MatePad1. In this case, the user releases the task card, and a displayed interface is shown in FIG. 9(j). The task card may automatically move to the icon of the target device (for example, the task card automatically flies to the icon of the target device), so that the task card is migrated to the target device. The task card may be displayed in the foreground of the target device, to implement cross-device interaction.
[0453] In some example embodiments, after the user selects the target device by performing an operation on the task card, the icon of the target device may further change correspondingly. For example, the icon of the target device may move downward a distance, or a color of the icon of the target device changes, or the like, to prompt the user with the selected target device. In addition, the user may further perform an operation on the task card, to change the selected target device. The following provides descriptions with reference to specific examples.
[0454] Example 37: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(k) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. After the user determines a target device through any one of the foregoing operations, an icon of the target device may move downward a distance. For example, as shown in FIG. 9(k), assuming that a target device selected by the user is MatePad1, a device icon of MatePad1 may move downward a distance. Alternatively, a color of the icon of the target device may become a selected-state color. As shown in FIG. 9(l), if a target device selected by the user is MatePad1, a device icon of MatePad1 becomes a filled state.
[0455] In some example embodiments, the selected target device may also be identified in another manner. For example, the selected target device may be prompted to the user in a text prompt box, or the like. This is not limited in this application.
[0456] In some example embodiments, a correspondence between a location of a task card and a target device may be further preset. After the user touches and holds the task card and drags the task card to a preset location, a target device corresponding to the region is automatically displayed to the user. As the user drags the task card to change a location, the target device changes accordingly. After determining a target device to which the task card needs to be migrated, the user may release the task card. The task card may automatically move to an icon of the target device (for example, the task card automatically flies to the icon of the target device), so that the task card is migrated to the target device. The task card may be displayed in the foreground of the target device, to implement cross-device interaction.
[0457] Example 38: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(m) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. After the user touches and holds the task card and drags the task card to change a location of the task card, a target device corresponding to the location of the task card is displayed. For example, as shown in FIG. 9(m), the user touches and holds the task card and drags the task card to change the location of the task card. A displayed target is MatePad1. If the user determines that an app 2 needs to be migrated to MatePad1, the user may release the task card. The displayed interface is shown in FIG. 9(n). Optionally, the task card may automatically move to an icon of the target device (for example, the task card automatically flies to the icon of the target device), so that the task card is migrated to the target device.
[0458] In some example embodiments, after the user selects the target device by performing an operation on the task card, the selected target device changes as the user further performs an operation on the task card, or the selected target device may be unselected. The following provides descriptions with reference to specific examples.
[0459] Example 39: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(o) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. After the user determines a target device through any one of the foregoing operations, for example, as shown in FIG. 9(o), assuming that a selected target device is MatePad1, if the user continues to drag the task card to slide leftward or rightward, the selected target device switches accordingly. As shown in FIG. 9(p), assuming that the user drags the task card to slide rightward, a changed target device is MatePad2, and a device icon of MatePad2 moves downward a distance. In this case, the user may release the task card. The task card may automatically move to an icon of the target device (MatePad2) (for example, the task card automatically flies to the icon of the target device), so that the task card is migrated to the target device.
[0460] Example 40: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(q) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. After the user determines a target device through any one of the foregoing operations, for example, as shown in FIG. 9(q), assuming that a selected target device is MatePad1, a device icon of MatePad1 may move downward a distance. Optionally, if the user continues to drag the task card and slides downward, after a sliding distance (that is, a distance between a location at which a finger touches a screen on a mobile phone of the user before the user slides the task card and a location at which the finger touches the screen on the mobile phone of the user after the user slides the task card) is greater than or equal to a preset distance, for example, as shown in FIG. 9(r), if the user releases the task card, the target device MatePad1 is unselected, a device icon of MatePad1 is restored to a previous location, the task card is restored, for display, to a state existing before the target is selected, and a migration of the task card is canceled.
[0461] Example 41: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(s) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. After the user determines a target device through any one of the foregoing operations, for example, as shown in FIG. 9(s), assuming that a selected target device is MatePad1, a device icon of MatePad1 may move downward a distance. Optionally, if the user continues to drag the task card and slides downward, after a sliding distance (that is, a distance between a location at which a finger touches a screen on a mobile phone of the user and the top of a screen of the first terminal) is greater than or equal to a preset distance, for example, as shown in FIG. 9(t), if the user releases the task card, the target device MatePad1 is unselected, a device icon of MatePad1 is restored to a previous location, the task card is restored, for display, to a state existing before the target is selected, and a migration of the task card is canceled.
[0462] In some example embodiments, in a process in which the user drags the task card to select the target device or unselect the target device, the user may further drag the task card to a left edge or a right edge of the screen. In this case, the user may continue to drag the task card leftward or rightward, so that more device icons can be displayed at the top of the screen, and the user can determine the target device from the plurality of device icons. In this embodiment of this application, optionally, the more device icons may be arranged to be displayed in one row, or may be displayed at the top of a screen of a device in a form of a radar graph. This is not limited in this application. For example, Example 42 shows a schematic diagram of an interface in which more device icons are arranged to be displayed in one row.
[0463] Example 42: It is assumed that a first terminal is a mobile phone (P40), a second terminal is a tablet computer 1 (MatePad1), and a third terminal is a tablet computer 2 (MatePad2). FIG. 9(u) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to another device. For example, as shown in FIG. 9(u), the user drags a task card and slides the task card leftward. After the task card is located on a right edge of a screen, the user continues to drag the task card rightward. A displayed interface is shown in FIG. 9(v). Another device icon (MatePad3 and Mate X2) is displayed at the top of the screen, and a plurality of device icons displayed at the top of the screen are displayed in one row. The user may continue to perform an operation on the task card, to determine the target device from the more device icons.
[0464] In some example embodiments, in a process in which a local device migrates, in a recent task interface, a task card of a device to a target device for display or running, for example, a user migrates a video of a mobile phone to a large-screen device for playing, or migrates audio of a mobile phone to a sound box for playing, if the target device is in a screen-off state, the target device may automatically turn on a screen, and after the target device turns on a screen, an application corresponding to the task card can be displayed after the user unlocks the target device; or the target device may automatically turn on a screen, unlocking is automatically triggered, and an application corresponding to the task card can be displayed after the user unlocks the target device; or the target device may automatically turn on a screen and is automatically unlocked, and an application corresponding to the task card can be displayed after the target device is unlocked. The following provides descriptions with reference to specific examples.
[0465] Example 43: It is assumed that a first terminal is a tablet computer (MatePad), a second terminal is a mobile phone (P40), and a third terminal is a foldable-screen mobile phone (Mate X2). FIG. 10(a) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to the second terminal, and the second terminal is in a screen-off state. After the user migrates a task card corresponding to the app 2 to the mobile phone (P40) in any manner in the foregoing embodiments, as shown in FIG. 10(a), the mobile phone P40 is in a screen-off state; after the mobile phone P40 receives task information, the mobile phone P40 automatically turns on a screen; after the mobile phone P40 automatically turns on the screen, the user is triggered to manually unlock the mobile phone P40; and after the user manually unlocks the mobile phone P40, the mobile phone P40 may display or run the app 2.
[0466] Example 44: It is assumed that a first terminal is a tablet computer (MatePad), a second terminal is a mobile phone (P40), and a third terminal is a foldable-screen mobile phone (Mate X2). FIG. 10(b) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to the second terminal, and the second terminal is in a screen-off state. After the user migrates a task card corresponding to the app 2 to the mobile phone (P40) in any manner in the foregoing embodiments, as shown in FIG. 10(b), the mobile phone (P40) is in a screen-off state; after the mobile phone (P40) receives task information, the mobile phone (P40) automatically turns on a screen, and triggers the user to manually unlock the mobile phone (P40); and after the user manually unlocks the mobile phone (P40), the mobile phone (P40) may display or run the app 2.
[0467] Example 45: It is assumed that a first terminal is a tablet computer (MatePad), a second terminal is a mobile phone (P40), and a third terminal is a foldable-screen mobile phone (Mate X2). FIG. 10(c) is a schematic diagram of displaying a historical task card of a second terminal and a historical task card of a third terminal in a recent task interface of a first terminal (a current terminal or a local device). It is assumed that a user needs to migrate an app 2 of the current terminal to the second terminal, and the second terminal is in a screen-off state. After the user migrates a task card corresponding to the app 2 to the mobile phone (P40) in any manner in the foregoing embodiments, as shown in FIG. 10(c), the mobile phone (P40) is in a screen-off state; after the mobile phone (P40) receives task information, the mobile phone (P40) automatically turns on a screen, and triggers automatic unlocking; and after the user manually unlocks the mobile phone (P40), the mobile phone (P40) may display or run the app 2.
[0468] In some example embodiments, in a process in which a local device migrates, in a recent task interface, a task card of a device to a target device for display or running, if the target device is in a screen-off state, in a possible implementation, different rules for triggering the target device to turn on a screen and to be unlocked may be further set based on different types of applications that need to be migrated or sensitivity levels corresponding to the applications. For example, after an application with a low sensitivity level (for example, an application such as a video playing application or an audio playing application) is migrated to a screen-off target device, the target device may automatically turn on a screen and trigger automatic unlocking, so that the application is displayed or run on the target device. For example, after an application with a high sensitivity level (for example, an application such as a document editing application or a picture playing application) is migrated to a screen-off target device, the target device may automatically turn on a screen and trigger a user to manually unlock the target device, so that the application is displayed or run on the target device.
[0469] In some example embodiments, different rules for triggering the target device to turn on a screen and to be unlocked may be further set based on different situations of the target device (for example, target devices with different security levels or security capability or different types of target devices). For example, assuming that the target device is a large-screen device, after an application is migrated to a screen-off target device, the target device may automatically turn on a screen and trigger a user to manually unlock the target device, so that the application is displayed or run on the target device. Assuming that the target device is a smart sound box, after an application is migrated to a screen-off target device, the target device may automatically turn on a screen and is automatically unlocked, so that the application is displayed or run on the target device.
[0470] In some example embodiments, in a process in which a source device migrates, in a recent task interface, a task card to a target device to run an application corresponding to the task card, for example, the application corresponding to the task card involves a hardware capability of a device, for example, including a hardware capability of a camera, a microphone, a display, and the like of the device, after the application is migrated from the source device to the target device, the application may be run on the target device by using a hardware capability of the source device or a hardware capability of the target device and based on any one of the following several rules:
[0471] Rule 1: After the source device migrates the application to the target device, the hardware capability of the target device is not used. In other words, after the application is migrated to the target device, the hardware capability of the source device continues to be used to run the application on the target device.
[0472] Rule 2: After the source device migrates the application to the target device, a part of the hardware capability of the target device is used. In other words, after the application is migrated to the target device, a part of the hardware capability of the source device and a part of the hardware capability of the target device may be simultaneously used to cooperate to complete running of the application on the target.
[0473] Rule 3: After the source device migrates the application to the target device, the hardware capability of the target device is used, and a hardware capability that is of the source device and that is occupied by the application is released. In this case, the source device may run a new application by using the hardware capability of the source device. In other words, the two devices may separately execute different tasks by using respective hardware capabilities, without affecting each other.
[0474] Rule 4: After the source device migrates the application to the target device, the hardware capability of the target device is used, and a hardware capability that is of the source device and that is occupied by the application is not released.
[0475] With reference to specific examples (for example, Example 46 to Example 48), the following describes the rules of using a hardware capability after a task is migrated.
[0476] Example 46: It is assumed that a first terminal is a tablet computer 1 (MatePad1), a second terminal is a mobile phone (P40), and a historical task card of the second terminal and a historical task card of another terminal are displayed in a recent task interface of the first terminal (a current terminal or a local device). It is assumed that a user needs to migrate a video call of the mobile phone P40 (a source device) to MatePad1 (a target device) for running. As shown in FIG. 11(a)-1 and FIG. 11(a)-2, the user may tap a task card corresponding to the video call in a recent task interface of MatePad1, and after the task card is tapped, the video call is run on MatePad1. A camera, a microphone, and a speaker of MatePad1 are invoked for the video call by default. In other words, a hardware capability of the target device is used, and a hardware capability of the mobile phone P40 is not used. Optionally, a hardware capability that is of the mobile phone P40, namely, the source device and that is occupied by the video call may be released; or a hardware capability that is of the mobile phone P40 and that is occupied by the video call is not released. If the hardware capability that is of the mobile phone P40 and that is occupie...
Claims
1. A task migration system, comprising a first terminal and a second terminal;wherein the second terminal is configured to:run a first application; andwhen a first user interface of the first application is displayed in the second terminal, switch the first application to run in the background; andwherein the first terminal is configured to:receive task information from the second terminal, wherein the task information comprises information about an application run by the second terminal in the background;receive a first user operation;open a recent task interface based on the first user operation, wherein the recent task interface comprises a control having an identifier of the second terminal;display, in the recent task interface in response to a second user operation performed on the identifier of the second terminal, at least one task card corresponding to the application run by the second terminal in the background, wherein the at least one task card comprises a first task card corresponding to the first application;receive, from the second terminal, a task stack comprises a first activity record and a second activity record, wherein the first activity record comprises interface data of the first user interface and user data of the first user interface, and the second activity record comprises interface data of a second user interface and user data of the second user interface;in response to a third user operation performed on the first task card, run the first application, and display the first user interface; anddisplay a second user interface in response to a fourth user operation performed in the first user interface, wherein the fourth user operation is a back operation, and the second user interface is a parent user interface of the first user interface.
2. The system of claim 1, wherein the first terminal is further configured to: display, in the recent task interface, a second task card corresponding to a recently run application of the first terminal; andin response to the second user operation, stop displaying the second task card.
3. The system of claim 1,wherein the second terminal is further configured to:segment an application data stream of the first application into a plurality of pieces of segment data, and determine an index table corresponding to the plurality of pieces of segment data, wherein the index table indicates storage paths and a sequence relationship of the plurality of pieces of segment data in a distributed file system of the second terminal;send the plurality of pieces of segment data to the first terminal in a multi-thread parallel transmission manner; andsend the index table to the first terminal; andwherein the first terminal is further configured to:restore the application data stream of the first application based on the plurality of pieces of segment data and the index table that are received; andafter receiving the third user operation, run the first application based on the third user operation and the application data stream of the first application.
4. The system of claim 1, whereinthe at least one task card further comprises a third task card corresponding to a first-screen snapshot of a home screen of the second terminal, and at least one of a feature ability, FA, card, a floating window, and a floating bubble exists on the third task card; andwherein the first terminal is further configured to display the at least one task card in a single row or a plurality of rows in the recent task interface of the first terminal based on any one of landscape-mode use, portrait-mode use, unfolded-state portrait-mode use of a foldable screen, unfolded-state landscape-mode use of the foldable screen, folded-state landscape-mode use of the foldable screen, and folded-state portrait-mode use of the foldable screen of the second terminal.
5. The system of claim 1, wherein the first terminal is further configured to:run the first application based on a hardware capability of the first terminal;run the first application based on a hardware capability of the second terminal; orrun the first application based on a hardware capability of the first terminal and a hardware capability of the second terminal.
6. A task migration method, comprising:receiving, by a first terminal, task information from a second terminal, wherein the task information comprises information about an application run by the second terminal in the background;receiving, by the first terminal, a first user operation;opening, by the first terminal, a recent task interface based on the first user operation, wherein the recent task interface comprises a control having an identifier of the second terminal;displaying, by the first terminal in the recent task interface in response to a second user operation performed on the identifier of the second terminal, at least one task card corresponding to the application run by the second terminal in the background, wherein the at least one task card comprises a first task card corresponding to a first application run by the second terminal in the background;receiving, by the first terminal from the second terminal, a task stack comprises a first activity record and a second activity record, wherein the first activity record comprises interface data of the first user interface and user data of the first user interface, and the second activity record comprises interface data of a second user interface and user data of the second user interface;in response to a third user operation performed on the first task card, running the first application, and displaying the first user interface of the first application; anddisplaying the second user interface in response to a fourth user operation performed in the first user interface, wherein the fourth user operation is a back operation, and the second user interface is a parent user interface of the first user interface.
7. The method of claim 6, the method further comprising:before the second user operation, displaying, by the first terminal in the recent task interface, a second task card corresponding to a recently run application of the first terminal; andafter the second user operation, stopping, by the first terminal, displaying the second task card in the recent task interface.
8. The method of claim 6, wherein the first activity record and the second activity record are stored next to each other in the task stack, the first activity record is read by the first terminal before the second activity record, and before the displaying, by the first terminal, the first user interface, the method further comprises:generating, by the first terminal, the first user interface based on the interface data of the first user interface, and storing, by the first terminal, a state of the first user interface based on the user data of the first user interface;wherein before the displaying, by the first terminal, the second user interface, the method further comprises:generating, by the first terminal, the second user interface based on the interface data of the second user interface, and storing, by the first terminal, a state of the second user interface based on the user data of the second user interface.
9. The method of claim 6, the method further comprising:receiving, by the first terminal, in a multi-thread parallel receiving manner, a plurality of pieces of segment data sent by the second terminal, wherein the plurality of pieces of segment data are obtained by segmenting an application data stream of the first application;receiving, by the first terminal, an index table sent by the second terminal, wherein the index table indicates storage paths and a sequence relationship of the plurality of pieces of segment data in a distributed file system of the second terminal;restoring, by the first terminal, the application data stream of the first application based on the plurality of pieces of segment data and the index table that are received; andafter the third user operation is detected, running, by the first terminal, the first application based on the third user operation and the application data stream of the first application.
10. The method of claim 9, wherein a data amount of each of the plurality of pieces of segment data is fixed, and / or the index table comprises message header information corresponding to each of the plurality of pieces of segment data; andthe message header information corresponding to each piece of segment data comprises a correspondence between a segment number and a segment data path of each piece of segment data, and length information, start identifier information, and end identifier information that are of each piece of segment data.
11. The method of claim 6, the method further comprising:receiving, by the first terminal, a fifth user operation, wherein the fifth user operation is used to trigger sending of a first task instruction to the second terminal, and the first task instruction instructs the second terminal to clear the first application;sending, by the first terminal, first information to the second terminal, wherein the first information comprises information about the first task instruction; andtrying, by the first terminal, to hold a local lock based on the first task instruction, wherein the second local lock is used to ensure that the first application on the second terminal executes a task instruction from only one device at any given time, and the local lock can be held by only one device at a time.
12. The method of claim 6, the method further comprising:running, by the first terminal, the first application based on a hardware capability of the first terminal;running, by the first terminal, the first application based on a hardware capability of the second terminal; orrunning, by the first terminal, the first application based on a hardware capability of the first terminal and a hardware capability of the second terminal.
13. A first terminal, comprising:a non-transitory memory configured to store program instructions;a processor configured to execute the program instructions, to cause the first terminal to perform:receiving task information from a second terminal, wherein the task information comprises information about an application run by the second terminal in the background;receiving a first user operation;opening a recent task interface based on the first user operation, wherein the recent task interface comprises a control having an identifier of the second terminal;displaying, in the recent task interface in response to a second user operation on the identifier of the second terminal, at least one task card corresponding to the application run by the second terminal in the background, wherein the at least one task card comprises a first task card corresponding to a first application run by the second terminal in the background;receiving, from the second terminal, a task stack comprises a first activity record and a second activity record, wherein the first activity record comprises interface data of the first user interface and user data of the first user interface, and the second activity record comprises interface data of a second user interface and user data of the second user interface;in response to a third user operation performed on the first task card, running the first application, and displaying the first user interface of the first application; anddisplaying the second user interface in response to a fourth user operation performed in the first user interface, wherein the fourth user operation is a back operation, and the second user interface is a parent user interface of the first user interface.
14. The first terminal of claim 13, wherein the processor is further configured to execute the program instructions, to cause the first terminal to perform:displaying, in the recent task interface, a second task card corresponding to a recently run application of the first terminal; andstopping displaying the second task card in the recent task interface.
15. The first terminal of claim 13, wherein the first activity record and the second activity record are stored next to each other in the task stack, the first activity record is read by the first terminal before the second activity record, wherein the processor further configured to execute the program instruction, to cause the first terminal to perform:generating the first user interface based on the interface data of the first user interface, and storing a state of the first user interface based on the user data of the first user interface;generating the second user interface based on the interface data of the second user interface; andstoring a state of the second user interface based on the user data of the second user interface.
16. The first terminal of claim 13, wherein the processor is further configured to execute the program instructions, to cause the first terminal to perform:receiving, in a multi-thread parallel receiving manner, a plurality of pieces of segment data sent by the second terminal, wherein the plurality of pieces of segment data are obtained by segmenting an application data stream of the first application;receiving an index table sent by the second terminal, wherein the index table indicates storage paths and a sequence relationship of the plurality of pieces of segment data in a distributed file system of the second terminal;restoring the application data stream of the first application based on the plurality of pieces of segment data and the index table that are received; andafter the third user operation is detected, running the first application based on the third user operation and the application data stream of the first application.
17. The first terminal of claim 16, wherein a data amount of each of the plurality of pieces of segment data is fixed, and / or the index table comprises message header information corresponding to each of the plurality of pieces of segment data;wherein the message header information corresponding to each piece of segment data comprises a correspondence between a segment number and a segment data path of each piece of segment data, and length information, start identifier information, and end identifier information that are of each piece of segment data.
18. The first terminal of claim 13, wherein the processor is further configured to execute the program instructions, to cause the first terminal to perform:receiving a fifth user operation, wherein the fifth user operation is used to trigger sending of a first task instruction to the second terminal, and the first task instruction instructs the second terminal to clear the first application;sending first information to the second terminal, wherein the first information comprises information about the first task instruction; andtrying to hold a local lock based on the first task instruction, wherein the local lock is used to ensure that the first application on the second terminal executes a task instruction from only one device at any given time, and the second local lock can be held by only one device at a time.
Citation Information
Patent Citations
Task continuance across devices
CN105324754A
Live video transmission method, live video transmission device, and video direct broadcast system
CN105812840A
Display control method and device
CN110515576A
Synchronization method and electronic equipment
CN111031108A
Cross-device task processing interaction method, electronic device and storage medium
CN111240547A
