Application circulation method and electronic equipment
By sending the calculated node tree layout information and business data to the receiving device during the application workflow, the receiving device can directly perform interface layout and rendering, which solves the problem of excessively long cold start time and achieves faster workflow speed and better user experience.
Patent Information
- Application Number
- CN202411775144.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, the cold start time of electronic devices during application flow is too long, which affects flow efficiency and user experience. In particular, the target device needs to recalculate the node tree layout information and create the node tree, resulting in a large consumption of computing resources.
The source device sends the pre-calculated node tree layout information and business data to the receiving device. The receiving device directly performs interface layout and rendering based on this information, avoiding the need to recreate the node tree and accelerating interface display by processing the main thread and the first thread in parallel.
It shortens the cold start time of application transition, improves transition speed, saves computing resources, enhances user experience, and ensures the continuity and consistency of the interface before and after transition.
Smart Images

Figure CN121957586A_ABST
Abstract
Description
An application flow method and electronic device Technical Field
[0001] This application relates to the field of terminal technology, and in particular to an application transfer method and electronic device. Background Technology
[0002] With the rapid development of terminal technology and the continuous improvement of user needs, distributed workflow technology has emerged, aiming to enable users to switch application experiences across multiple electronic devices. For example, the application workflow function allows users to quickly resume and continue their previous operations in the same application on electronic device B while operating an application on electronic device A.
[0003] Currently, there is a method for application flow. If an application on electronic device A initiates an application flow to an application on electronic device B, electronic device A sends its page state (such as current browsing progress) and business data to electronic device B. During the application's cold start process, electronic device B calculates node information and combines it with the received page state and business data to create nodes, lay out the interface, render, and display it. The entire flow process is time-consuming, affecting application flow efficiency and user experience. Summary of the Invention
[0004] This application provides an application flow method and electronic device. The source device sends node tree layout information and business data to the receiving device. The receiving device directly performs interface layout and rendering based on the calculated node tree layout information and business data to obtain and display the first flow page, thereby shortening the cold start time during application flow, accelerating the application flow speed, and improving the user experience.
[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0006] Firstly, an application transition method is provided, comprising: a connecting device receiving transition instruction information of a target application from a source device, as well as node tree layout information and business data of the source device's interface during application transition. During the cold start process of the target application, the connecting device performs interface layout and rendering based on the node tree layout information and business data to obtain a first transition interface, and displays the first transition interface.
[0007] In the above solution, the source device sends business data and pre-calculated node tree layout information to the receiving device. This node tree layout information includes the nodes on the interface during application flow, the attribute information of each node (such as the position and size of the node), and the relationships between nodes. The receiving device can directly perform interface layout and rendering based on the node tree layout information and business data to obtain and display the first flow interface. The receiving device does not need to create nodes to construct the node tree and load the page accordingly, shortening the time to obtain the first flow interface, thereby improving application flow speed and enhancing the user experience.
[0008] Meanwhile, since the connecting device directly performs interface layout and rendering based on the node tree layout information and business data, it does not need to recalculate the node tree information, thereby saving computing resources and further improving the flow speed of the target application.
[0009] In one possible implementation, the cold start process of the target application in the connecting device includes: running the main thread and the first thread in parallel. Specifically, the connecting device initializes itself through the main thread and runs the target application's code file to load the page. Simultaneously, the first thread performs interface layout and rendering based on node tree layout information and business data to obtain the first transition interface.
[0010] In this implementation, the connecting device runs the main thread and the first thread in parallel, achieving parallel processing. It eliminates the need for runtime page loading based on the target application's code files; instead, it directly uses node tree layout information and business data to perform interface layout and rendering, resulting in the first transition interface. This shortens the display time of the first transition interface, accelerates the cold start speed of the target application, and improves application transition time. Furthermore, the parallel operation of the main thread and the first thread better utilizes the parallel capabilities of the computer's processor.
[0011] In one possible implementation, if the connecting device determines that the target layout information of the nodes on the flow interface indicated by the application code file is different from the node tree layout information, it updates the interface based on the target layout information to obtain a second flow interface and displays the second flow interface.
[0012] In this implementation, since the target layout information represents the node tree layout information of the application flow interface specified by the target application, the second flow interface obtained by updating according to the target layout information can match the flow interface specified by the target application. After displaying the first flow interface, the updated second flow interface is then displayed. First, the connecting device performs layout and rendering based on the node tree layout information and business data to obtain the first flow interface; the first frame interface after the application flow is displayed as quickly as possible, i.e., the first flow interface. Second, it can be updated in a timely manner to the second flow interface that matches the target layout information. Moreover, under normal circumstances, the difference between the first and second flow interfaces is not significant, and the update process is less likely to cause sudden changes or jumps in the screen, resulting in a better user visual experience.
[0013] In one possible implementation, the connecting device updates the target layout information to obtain a second transition interface, including: the connecting device updates the node tree layout information based on the target layout information, and performs interface layout and rendering based on the updated node tree layout information to obtain the second transition interface.
[0014] In this implementation, the connecting device updates the node tree layout information and performs interface layout and rendering based on the updated node tree layout information to obtain the second transition interface. This reduces the time cost in the interface update process, can efficiently handle layout differences, and obtain the second transition interface indicated by the application code file of the target application.
[0015] In one possible implementation, the connecting device updates the target layout information to obtain a second transition interface, including: when the first node indicated by the target layout information does not exist in the node tree layout information, the connecting device renders the interface content of the child node tree where the first node is located based on the first node indicated by the target layout information, and merges the interface content of the first transition interface and the interface content of the child node tree where the first node is located to obtain the second transition interface. Alternatively, when the attribute information of the second node indicated by the target layout information is different from that of the second node in the node tree layout information, the connecting device renders the interface content corresponding to the second node based on the attribute information of the second node indicated by the target layout information, updates the interface content corresponding to the second node on the first transition interface, and obtains the second transition interface.
[0016] In this implementation, when the first node indicated by the target layout information does not exist in the node tree layout information, the connecting device renders the interface content of the child node tree containing the first node based on the first node indicated by the target layout information, and merges the interface content of the first transition interface and the child node tree containing the first node to obtain the second transition interface. That is, fine-tuning can be done on the first transition interface without re-rendering the entire interface, resulting in a faster update speed for the second transition interface. When the attribute information of the second node indicated by the target layout information differs from that of the second node in the node tree layout information, the connecting device renders the interface content corresponding to the second node based on the attribute information of the second node indicated by the target layout information, updates the interface content corresponding to the second node on the first transition interface, and obtains the second transition interface. This allows for fine-tuning on the first transition interface without re-rendering the interface, accelerating the application's cold start process.
[0017] In one possible implementation, during the page loading process where the connecting device runs the target application's code file via the main thread, the method further includes: if the node indicated by the target layout information exists in the node tree layout information, the connecting device skips the process of creating the indicated node. If the node indicated by the target layout information does not exist in the node tree layout information, the connecting device creates the indicated node via the main thread.
[0018] In this implementation, during the cold start process of the target application, if the node indicated by the target layout information exists in the node tree layout information, the connecting device skips the process of creating the indicated node. Because the connecting device skips the creation process of multiple nodes, the application's cold start time is shortened, application workflow efficiency is higher, and the connecting device's computing resources are saved.
[0019] In one possible implementation, when the node tree layout information contains a node indicated by the target layout information, the connecting device binds the node in the node tree layout information to the registration function indicated by the application code file via the main thread. When the node tree layout information does not contain a node indicated by the target layout information, the connecting device binds the created indicated node to the registration function indicated by the application code file via the main thread.
[0020] In this implementation, the main thread binds nodes in the node tree layout information that are present in the target layout information to the registration function, ensuring the correct association and invocation of the registration function and improving the interactive experience of application flow. After binding is complete, the flow interface displayed on the subsequent screen becomes interactive.
[0021] In one possible implementation, the layout information of the node tree is used to characterize the nodes on the source interface during application flow, the relationships between nodes, and the attribute information of each node. The attribute information includes the position and size of the nodes.
[0022] In this implementation, when the source interface during application transition is the first interface, the node tree layout information is the node tree layout information corresponding to that first interface. The connecting device can reconstruct the first interface of the source device during transition using the node tree layout information.
[0023] In one possible implementation, the layout information of the node tree is used to characterize multiple key nodes on the source interface during application flow, the relationships between key nodes, and the attribute information of each key node.
[0024] In this implementation, the connecting device performs layout and rendering based on multiple key nodes in the node tree layout information, thereby enabling the rapid layout, rendering, and display of a first flow interface that is consistent with the key content of the first interface (such as the main body / main framework of the interface) when the source device is flowing.
[0025] In one possible implementation, the connecting device receives flow instruction information of the target application from the source device, as well as node tree layout information and business data of the source interface during application flow, including: the connecting device receives flow instruction information of the target application from the source device, as well as node tree layout information and business data of the source interface during application flow through a distributed soft bus.
[0026] In this implementation, distributed soft bus technology is used to send the target application's flow instruction information, as well as the node tree layout information and business data of the source interface during application flow, to the connecting device, which can ensure the efficiency and security of the flow process.
[0027] Secondly, an application flow method is provided, comprising: a source device displaying a first interface of a target application; then, the source device detecting a flow operation of the target application, wherein the source interface during application flow is the first interface; subsequently, the source device sending flow instruction information of the target application, as well as node tree layout information and business data of the source interface during application flow, to the receiving device. The node tree layout information corresponds to the first interface.
[0028] In this implementation, when the source device detects a flow operation of the target application, the target application corresponds to the first interface. The source interface during application flow is the first interface. The source device sends the node tree layout information corresponding to the first interface to the receiving device, so that the receiving device can directly restore the first interface of the source device during flow based on the received node tree layout information.
[0029] Thirdly, an application flow system is provided. This system includes a source device and a receiving device. The source device is configured to display a first interface of the target application; when a flow operation of the target application is detected, the source interface during application flow is the first interface. Then, the source device sends flow instruction information of the target application, as well as node tree layout information and business data of the source interface during application flow, to the receiving device. The node tree layout information corresponds to the first interface. The receiving device is configured to receive the flow instruction information, as well as the node tree layout information and business data of the source interface during application flow. During the cold start process of the target application, the receiving device performs interface layout and rendering based on the node tree layout information and business data to obtain and display the first flow interface. The first flow interface corresponds to the first interface.
[0030] In this implementation, the source device sends business data and pre-calculated node tree layout information to the receiving device. This node tree layout information includes the nodes on the interface during application flow, the attribute information of each node (such as the position and size of the node), and the relationships between nodes. The receiving device can directly perform interface layout and rendering based on the node tree layout information and business data to obtain and display the first flow interface. The receiving device does not need to create nodes to construct the node tree and load the page accordingly, shortening the time to obtain the first flow interface, thereby improving application flow speed and enhancing the user experience.
[0031] Meanwhile, since the connecting device directly performs interface layout and rendering based on the node tree layout information and business data, it does not need to recalculate the node tree information, thereby saving computing resources and further improving the flow speed of the target application.
[0032] In addition, the first transition interface, which corresponds to the first transition interface of the source device, is displayed on the connecting device. This allows the interface of the source device to be displayed on the connecting device, ensuring continuity of the application interface before and after the transition. This guarantees a consistent experience before and after the transition, making it easier for users to continue their previous operations after the transition, resulting in a better user experience.
[0033] Moreover, most users typically expect to see the same application flow interface on the connecting device as on the source device. Therefore, displaying a first flow interface on the connecting device that corresponds to the first flow interface on the source device can improve the user's application flow experience.
[0034] Fourthly, an electronic device is provided, comprising: a processor and a memory; the memory is used to store computer execution instructions, and when the electronic device is running, the processor executes the computer execution instructions stored in the memory to cause the electronic device to perform the application flow method as described in any of the first aspects above.
[0035] Fifthly, a computer-readable storage medium is provided that stores instructions which, when executed on a computer, enable the computer to perform the application flow method of any of the first aspects described above.
[0036] In a sixth aspect, a computer program product containing instructions is provided, which, when run on an electronic device, enables the electronic device to execute the application flow method of any of the first aspects described above.
[0037] The technical effects of any of the design methods in aspects two through six can be found in the technical effects of different design methods in aspect one, and will not be repeated here. Attached Figure Description
[0038] Figure 1 is a schematic diagram of an application flow scenario;
[0039] Figure 2 is a schematic diagram of an application flow process;
[0040] Figure 3 is a flowchart illustrating an application of a flow method;
[0041] Figure 4 is a schematic diagram of the creation process of a node tree;
[0042] Figure 5 is a schematic diagram of the hardware structure of a mobile phone provided in an embodiment of this application;
[0043] Figure 6 is a schematic diagram of the software structure of a mobile phone provided in an embodiment of this application;
[0044] Figure 7 is a flowchart illustrating an application transfer method provided in an embodiment of this application;
[0045] Figure 8 is a schematic diagram of an application flow process provided in an embodiment of this application;
[0046] Figure 9 is a schematic diagram of another application flow process provided in an embodiment of this application;
[0047] Figure 10 is a comparative schematic diagram of the process of a target application completing the first frame display according to an embodiment of this application;
[0048] Figure 11 is a schematic diagram of a child node tree provided in an embodiment of this application;
[0049] Figure 12 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0051] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.
[0052] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0053] With the development of electronic technology, the variety of electronic devices is increasing. Different electronic devices can provide a good experience in suitable scenarios. When multiple electronic devices can sense each other through a distributed operating system, switching between them is possible. For example, the app streaming function allows users to transfer videos from their mobile phones to their computers for continued playback, thus obtaining a better viewing experience.
[0054] In related technologies, referring to Figure 1, a user initially edits a memo on a mobile phone (corresponding to device A). When the user wants to continue the current editing operation on a computer (corresponding to device B), the user can send an application flow instruction from the mobile phone to the computer. In response to the user's instruction, the mobile phone transfers the current relevant data of the memo (such as the current editing status, the specific content being edited, etc.) to the computer. The computer then performs interface layout and rendering based on the sent memo's current relevant data, allowing the user to continue the previous editing operation on the computer.
[0055] Figure 2 is a schematic diagram of an application flow process in related technologies. Figure 2 illustrates an application flow method from the perspective of the interaction between the source device and the connecting device (or destination device) through a distributed soft bus. The source device is the device that initiates the application flow, and the connecting device is the device to which the application flow is directed. During application transition, the source device saves the task data to be restored in the target application. This task data includes the current page state on the source device (such as current browsing progress, current operation status, etc.) and business data (such as the application page's Uniform Resource Locator (URL). The page state can include offset information of specific scrolling container components on the page, such as list items, grid layouts, waterfall layouts, and scroll containers. The offset information indicates the page's current scroll position. The business data is saved by the source device using callback interfaces (such as onContinue()). Utilizing the cross-device application interface, page stack, and business data saving and restoration mechanism provided by the distributed framework, the source device sends the task data to the receiving device via a distributed soft bus. The receiving device, through the distributed framework and distributed soft bus, obtains the page state and business data, and restores and displays the interface content after the target application transition based on the node tree layout information and business data. The business data is restored by the receiving device through specific interfaces (such as onCreate() / onNewWant()).
[0056] In the above application flow method, after the connecting device obtains the page state and business data, the process from the cold start of the target application to the display of the interface includes sequential steps such as framework initialization, page loading, and layout rendering, as detailed in Figure 3. Framework initialization includes application component (e.g., Ability) initialization, container view (e.g., Container and View) initialization, orchestration component (e.g., pipeline) initialization, and root node initialization. Page loading includes running the target application's application code file to execute the page file, generating page node tree layout information, and mounting the page node tree. Layout rendering includes layout, rendering, and display.
[0057] Referring to Figure 4, the node creation process during the cold start of the target application by the connecting device includes: the target application initializes the root node, obtaining the container node (FrameNode), and creating a stage pattern object (StagePattern) within the container node. Next, the electronic device loads the target application interface (Load APP Page), sequentially creating a stage pattern object (StagePattern) and a page pattern object (PagePattern) within the container node (FrameNode), and creating a custom node pattern object (CustomNodePattern) within the component lifecycle (@Entry, also known as the entry point) of the custom node (CustomNode). Then, the electronic device creates a subtree based on the custom node in the build function (Create SubTree in build function when Measure CustomNode), and sequentially creates a StagePattern and PagePattern in the FrameNode, a CustomNodePattern in the component lifecycle (@Entry) of the CustomNode, and a StackPattern and TextPattern in the FrameNode, etc.
[0058] The aforementioned application transition method enables the transition of the target application, including the automatic transfer of offset information of specific scrolling container components on the source device to the successor device. However, during the cold start process of the target application on the successor device, it is necessary to sequentially execute processes including framework initialization, UI loading, and UI layout and rendering. Because the successor device involves calculating node information (such as relationships between nodes, node attribute information, and other node tree layout information), creating a large number of nodes, constructing the node tree, and performing UI layout and rendering during the application cold start process, the entire application cold start process needs to be executed, resulting in a long application startup time and severely impacting the application transition experience. Furthermore, when the target application on the successor device restores its UI content, it needs to calculate the layout information of the nodes and their attributes, which not only affects the application transition performance but also consumes significant computing resources.
[0059] This application provides an application flow method applied to an application flow system. The application flow system includes a source device and a connecting device. In this method, the source device first displays a first interface of the target application; then, it detects a flow operation of the target application, with the source interface during application flow being the first interface. At this time, the source device sends flow instruction information of the target application, as well as node tree layout information and business data of the source interface during application flow, to the connecting device. The node tree layout information corresponds to the first interface. The connecting device receives the flow instruction information of the target application from the source device, as well as the node tree layout information and business data of the source interface during application flow. During the cold start process of the target application, the connecting device performs interface layout and rendering based on the received node tree layout information and business data to obtain a first flow interface, and displays the first flow interface. Since the node tree layout information corresponds to the first interface, the first flow interface displayed by the connecting device based on the node tree layout information also corresponds to the first interface.
[0060] The aforementioned node tree layout information may include the layout information of each node on the source interface during application transition, including the attribute information of each node (such as the node's position and size), and the relationships between nodes. The aforementioned business data is used to represent the specific data content corresponding to the target application during transition. For example, business data may include in-application data (such as session information, purchase history, favorites content, etc.), unread messages, or notifications. As another example, business data may include the content data on the first interface during application transition. The aforementioned first transition interface is used to represent the interface displayed on the successor device when the source device transitions the target application.
[0061] During the application workflow described above, the source device sends business data and pre-calculated node tree layout information to the receiving device. This node tree layout information includes nodes, their attribute information (such as node position and size), and the relationships between nodes. The receiving device can directly perform interface layout and rendering based on the node tree layout information and business data to obtain and display the first workflow interface. The receiving device does not need to create nodes to construct the node tree and load the page accordingly, shortening the time to obtain the first workflow interface, thereby improving application workflow speed and enhancing the user experience.
[0062] Meanwhile, since the connecting device directly performs interface layout and rendering based on the node tree layout information and business data, it does not need to recalculate the node tree information, thereby saving computing resources and further improving the flow speed of the target application.
[0063] In addition, the first transition interface, which corresponds to the first transition interface of the source device, is displayed on the connecting device. This allows the interface of the source device to be displayed on the connecting device, ensuring continuity of the application interface before and after the transition. This guarantees a consistent experience before and after the transition, making it easier for users to continue their previous operations after the transition, resulting in a better user experience.
[0064] Moreover, most users typically expect to see the same application flow interface on the connecting device as on the source device. Therefore, displaying a first flow interface on the connecting device that corresponds to the first flow interface on the source device can improve the user's application flow experience.
[0065] The source device and the connecting device in the embodiments of this application can be various types of electronic devices. For example, the electronic device can be a tablet computer, mobile phone, laptop computer, smart screen, television, in-vehicle device, netbook, personal digital assistant (PDA), wearable device, augmented reality (AR) / virtual reality (VR) device, or personal computer, etc. In some embodiments, the electronic device can be any device containing a user interface. The embodiments of this application do not impose special limitations on the specific form of the source device and the connecting device.
[0066] Figure 5 shows a schematic diagram of the hardware structure of the electronic device 100. For example, the electronic device 100 shown in Figure 5 can be a source device (such as device A shown in Figure 1) or a connection device (such as device B shown in Figure 1).
[0067] As shown in Figure 5, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a touch sensor 180B, etc.
[0068] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0069] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0070] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0071] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0072] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0073] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0074] The charging management module 140 receives charging input from a charger, which can be a wireless charger or a wired charger. The power management module 141 connects to the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc. In some embodiments, the power management module 141 and the charging management module 140 may also be housed in the same device.
[0075] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0076] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on the electronic device 100. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0077] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module.
[0078] Electronic device 100 can realize communication functions and resource acquisition functions through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc.
[0079] For example, when the electronic device 100 is the source device in the aforementioned embodiments, the source device can send the target application's flow instruction information, node tree layout information, and service data to the connecting device through modules such as antenna 1, antenna 2, mobile communication module 150, or wireless communication module 160. It can also receive application flow-related information from the connecting device.
[0080] For example, when the electronic device 100 is the connecting device in the aforementioned embodiment, the connecting device can receive the target application flow instruction information, node tree layout information and service data sent from the source device through modules such as antenna 1, antenna 2, mobile communication module 150 or wireless communication module 160, and can also send application flow related information to the source device.
[0081] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0082] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0083] The display screen 194 can display the application interface selected by the user on the electronic device 100, or the application interface transferred from other electronic devices to the current electronic device in the application transfer scenario. It can also display some function controls, function pages, etc.
[0084] For example, when the electronic device 100 is the source device in the foregoing embodiments, the display screen 194 of the source device can display the first interface of the target application, etc.
[0085] For example, when the electronic device 100 is the connecting device in the foregoing embodiments, the display screen 194 of the connecting device can display a first transition interface, or it can display a second transition interface after the interface is updated.
[0086] The electronic device 100 can implement shooting functions through an ISP, a camera 193, a video codec, a GPU, a display 194, and an application processor. The ISP is used to process the data fed back by the camera 193, and the camera 193 is used to capture still images or videos. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0087] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0088] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121.
[0089] For example, when the electronic device 100 is the source device in the aforementioned embodiments, the processor 110 can obtain node tree layout information such as nodes and attribute information of each node obtained by running the application code file by executing the instructions stored in the internal memory 121.
[0090] For example, when the electronic device 100 is the connecting device in the foregoing embodiments, the processor 110 can determine whether the node tree layout information received from the source device and the target layout information obtained by running the application code file on the connecting device match by running the instructions stored in the internal memory 121, so that the connecting device can update the interface when the target layout information created by the application code file does not match the node tree layout received from the source device.
[0091] The internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function (such as sound playback, image playback, etc.). The data storage area may store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.). Furthermore, the internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory, universal flash storage (UFS), etc.
[0092] Electronic device 100 can implement audio functions, such as music playback and recording, through the speaker, receiver, microphone, headphone jack, and application processor in audio module 170.
[0093] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110. When the electronic device 100 displays video content, the audio module 170 can synchronously play the audio content corresponding to the video content.
[0094] When implementing the application flow method in this embodiment based on the electronic device 100 shown in Figure 5, the display screen 194 of the source device displays the first interface during application flow and sends the flow instruction information of the target application to the connecting device through antenna 1, antenna 2, mobile communication module 150, or wireless communication module 160, etc., to perform application flow. Additionally, the processor 110 of the source device calculates the node tree layout information by running instructions stored in the internal memory 121, and sends the node tree layout information and service data to the connecting device through antenna 1, antenna 2, mobile communication module 150, or wireless communication module 160, etc. After obtaining the node tree layout information and service data, the connecting device runs the instructions stored in the internal memory 121 through the processor 110 to perform interface layout and rendering, obtaining the first flow interface. The display screen 194 of the connecting device displays the first flow interface. Furthermore, the processor 110 of the connecting device determines, by executing instructions stored in the internal memory 121, whether the target layout information of the nodes on the flow interface indicated by the application code file is the same as the node tree layout information received from the source device. If they are different, the interface is updated to obtain the second flow interface. The display screen 194 of the connecting device displays the second flow interface.
[0095] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0096] Figure 4 is a schematic diagram of the software structure of the electronic device 100 according to an embodiment of the present invention.
[0097] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0098] The application layer can include a series of application packages. For example, application code files and runtime environments that run these application code files. Application code files can be written in languages such as JavaScript (JS), ArkTS, Java, and C / C++, each with its own corresponding runtime environment. For example, the ArkTS runtime is used to compile and run application code files written in ArkTS in real time. As shown in Figure 4, application packages can include applications such as camera, gallery, calendar, call, navigation, WLAN, Bluetooth, music, video, and SMS.
[0099] For example, when the electronic device 100 is the source device and / or connection device in the foregoing embodiments, the application package may also include an application that supports application flow function and an application for implementing application flow function, etc.
[0100] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 4, the application framework layer may include a UI component tree, rendering pipeline, gesture recognition module, event manager, resource manager, etc.
[0101] The application framework layer is used to handle application logic. Within this layer, the UI component tree is used for the user interface (UI) declared in the system and manages the current UI state.
[0102] The rendering pipeline is used to manage the rendering process of the UI component tree.
[0103] The gesture recognition module is used to convert input information uploaded from the system library into corresponding events.
[0104] The event manager is used to manage events that occur in the application, such as click events and drag events.
[0105] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0106] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0107] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0108] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0109] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), graphics engines (e.g., SGL), meta-capability framework, distributed framework, distributed soft bus, window manager, etc., which can be used to manage application processes, provide distributed capabilities, rendering capabilities, etc.
[0110] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0111] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0112] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0113] A graphics engine is a drawing engine for drawing.
[0114] The meta-capability framework is used to manage application processes and adjust their priority and resource allocation.
[0115] Distributed frameworks are used for distributed application scheduling and distributed data management.
[0116] Distributed soft buses are used to enable data transfer across devices.
[0117] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0118] For example, when the electronic device 100 is the source device in the above embodiments, the source device can send node tree layout information and business data of the interface and send flow indication information of the target application during application flow based on the distributed framework and distributed soft bus provided by the system library.
[0119] For example, when the electronic device 100 is the connecting device in the above embodiments, the connecting device can receive the node tree layout information and business data of the interface during application flow, receive the flow instruction information of the target application, etc., based on the system library, and perform interface rendering and drawing based on the graphics engine in the system library.
[0120] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0121] When implementing the application transfer method in this embodiment based on the electronic device 100 shown in Figure 6, the source device can provide the user with transferable applications and / or applications that can implement application transfer functions based on the application layer. After the user selects to transfer the target application to the connecting device on the source device, the source device can send the node tree layout information and business data of the source interface during application transfer to the connecting device based on the distributed framework and distributed soft bus provided by the system library. After receiving the node tree layout information and business data of the source interface, the connecting device performs interface layout and rendering based on the graphics engine in the system library to obtain the first transfer interface, and displays the first transfer interface through the application layer.
[0122] The following will use a mobile phone as the source device and a laptop computer as the connecting device as an example to illustrate the application flow method provided in this application embodiment. As shown in Figure 7, the method may include the following steps S701-S705.
[0123] S701. After the source device starts the target application, it detects the flow operation of the target application.
[0124] The target application can be a system application on the source device or a third-party application (app) on the source device. This application does not limit the type of target application initiated by the source device. That is, the user on the source device can choose to transfer the system application to the receiving device to continue the previous operation, or they can choose to transfer the third-party application to the receiving device to continue the previous operation. For example, the target application can be a memo application, a document application, a chat application, a video playback application, a shopping application, or a dedicated application transfer app, etc.
[0125] After the source device launches the target application, it displays the target application's interface. When the source device detects a flow operation of the target application, the target application displays its first interface. The source device's interface during application flow is the first interface.
[0126] The first interface can be any interface of the target application. For example, if the target application is a chat application, the corresponding first interface could be an interface for viewing message notifications, an interface for viewing Moments, etc. If the target application is a video playback application, the corresponding first interface could be a playback interface, etc. If the target application is a shopping application, the corresponding first interface could be a product details page, an online shopping cart viewing interface, etc.
[0127] In some embodiments, as the source interface during application flow, the first interface may be the interface of the target application that is being viewed or operated by the user during application flow. In other embodiments, as the source interface during application flow, the first interface may be the interface most recently displayed by the target application before receiving the flow operation from the target application.
[0128] In order for application flow to proceed normally, the source device needs to establish a communication connection with the receiving device. In some embodiments, the source device and the receiving device are within the same local area network (LAN), such as connected to the same Wi-Fi LAN, or networked via Bluetooth, enabling data transmission between them. This method is generally faster and more stable. In other embodiments, the source device and the receiving device are in cross-LAN or cross-network scenarios. For example, a user operates on a target application on their home computer (using a home network) and then continues this operation on another computer in the office (using a mobile network or public Wi-Fi). In still other embodiments, the source device and the receiving device both rely on cloud services to achieve application flow.
[0129] In some embodiments, when the source device detects that a user is performing an operation to transfer a target application to the receiving device, this could be achieved by the user first establishing a communication connection between the source device and the receiving device, and then selecting to transfer the target application to the receiving device on the source device. In other embodiments, when the source device detects that a user is performing an operation to transfer a target application to the receiving device, this could also be achieved by the user first selecting to transfer the target application on the source device, and then establishing a communication connection between the source device and the receiving device.
[0130] There can be various types of flow operations (or flow instructions), which can be implemented through different applications with application flow functions. This application does not limit the application with application flow functions.
[0131] In some embodiments, the source device can use an application streaming app that provides application streaming functionality to stream a target application to a connecting device to continue previous operations. In this process, the source device first displays the target application's initial interface. After launching the application streaming app, the source device receives a streaming instruction from the target application through the application streaming app via the communication connection established between the connecting device and the source device. In this case, the initial interface is the last screen of the target application displayed by the source device before the streaming app detects the streaming operation of the target application.
[0132] In other embodiments, a user launches a target application on a source device, and the source device displays a first interface of the target application. While displaying the first interface, the user can select application flow controls, etc., within the first interface. In response to the user's selection of the application flow controls, the source device displays a list of application flow devices on the current interface. The user selects a connecting device from the list of application flow devices, and the source device receives a flow instruction from the target application. In this case, the first interface is the interface currently displayed by the target application when the source device detects the flow operation of the target application.
[0133] For example, referring to Figure 8, the Memo app on the source device that supports application flow functionality displays a first interface, where b includes an application flow control 01. In response to the user selecting the application flow control 01 on the first interface, the source device displays a list of application flow devices. The application flow device list displays one or more candidate devices for application flow, such as "Laptop 1" or "Computer 2". If the user selects the "Laptop 1" option, the source device determines that Laptop 1 is the successor device. The user's selection of "Laptop 1" can be interpreted as the source device receiving a flow instruction to transfer the current editing state within the Memo app to Laptop 1.
[0134] S702. In response to the flow operation of the target application, the source device sends the flow instruction information of the target application, as well as the node tree layout information and business data of the interface during application flow to the connecting device.
[0135] After receiving the transfer operation of the target application, the source device sends the transfer instruction information of the target application, as well as the node tree layout information and business data of the interface during the application transfer, to the receiving device.
[0136] The node tree layout information is used to represent the nodes on the source interface during application transition, the relationships between nodes, and the attribute information of each node. When the source interface during application transition is the first interface, the node tree layout information is the node tree layout information corresponding to that first interface. The first interface of the source device during transition can be reconstructed through the node tree layout information.
[0137] The attribute information in the node tree layout includes, but is not limited to, the position, size, and type of the nodes. Different nodes have different attribute information and node types. For example, a text box node has its position coordinates defined as x=50, y=100, its size defined as width 300 pixels and height 30 pixels, and its type defined as text. Another example is an image node, with its position coordinates defined as x=10, y=10, its size defined as width 50 pixels and height 50 pixels, and its type defined as image. The node tree layout information occupies relatively little memory; for example, its size can be in the kilobyte range. Business data is used to represent specific data content within the application, such as the content of the currently viewed webpage, the current operation status, and game progress.
[0138] Among them, the node tree layout information of the interface during application flow is the information calculated by the source device when displaying the first interface, including the attribute information of each node and the relationship between each node.
[0139] Therefore, during the target application flow process, the source device sends the calculated node information, node attribute information, and relationships between nodes to the receiving device. The receiving device does not need to calculate the node attribute information or create nodes, skipping the process of calculating and creating nodes when running the application code file. Thus, it can directly perform layout and rendering display in advance based on the received node tree layout information, which can save the receiving device's computing resources, shorten the application flow process, and improve the application flow speed and user flow experience.
[0140] In some embodiments, the node tree layout information includes features such as key nodes and node priorities. The position, size, and relationships between key nodes are crucial for the rapid layout and rendering of the application interface on successive devices during application flow. For example, key nodes in the node tree layout information can be navigation bar nodes (including menu buttons and the target application's title), interactive element nodes (such as buttons, text boxes, dropdown menus, etc.), etc.
[0141] In addition to sending the entire node tree layout information corresponding to the first interface to the connecting device, in some other possible implementations, after receiving the flow operation of the target application, the source device sends multiple key nodes on the interface (such as nodes corresponding to the main part / main framework of the interface), the relationships between key nodes, and the attribute information of each key node to the connecting device, thereby enabling the rapid layout, rendering, and display of the first flow interface on the connecting device that is consistent with the key content of the first interface (such as the main part / main framework of the interface) during the flow on the source device.
[0142] Alternatively, in some other possible implementations, the source device sends all node tree layout information of the first interface to the connecting device, so that the connecting device can perform layout and rendering based on multiple key nodes in the node tree layout information, thereby achieving rapid layout, rendering and display of the first flow interface on the connecting device that is consistent with the key content of the first interface when the source device is flowing.
[0143] Alternatively, in some possible implementations, the source device sorts the node tree layout information according to the node priority. Node priority indicates the order in which nodes within the application interface are laid out and rendered. For example, frequently changing nodes or nodes in the interface navigation bar have higher priority. The source device sends the node tree layout information to the receiving device, so that the receiving device, upon receiving the node tree layout information, optimizes its rendering strategy based on node priority (e.g., nodes in the main body of the interface or the user's primary visual area are rendered first) and the degree of change (e.g., frequently changing nodes use more efficient rendering algorithms), thereby improving the user experience.
[0144] After receiving the flow operation from the target application, the source device stores the node tree layout information and business data of the application's interface during the flow. The node tree layout information can be stored in a cache, database, memory, or distributed system. For example, the source device sends the target application's flow instruction information, along with the node tree layout information and business data of the application's interface during the flow, to a distributed system for storage. This distributed system provides a mechanism for saving and restoring cross-device application interfaces, page stacks, and business data, and is responsible for sending this data from the source device to the receiving device. The page stack is used to switch between pages, including returning to the previous page and page navigation.
[0145] Referring to Figure 8, when the editing interface (corresponding to the first interface) of the Memo app (corresponding to the target application) is displayed on the mobile phone (corresponding to the source device), the user's flow operation for the target application is received. The node tree layout information is the node tree layout information corresponding to this editing interface, and the business data is the specific interface content within this editing interface. The source device sends the node tree layout information and business data of the first interface to the receiving device, so that the receiving device can perform interface layout and rendering based on the node tree layout information and business data sent by the source device, creating a first flow interface corresponding to the first interface during the source flow, allowing the user to continue the previous editing operation based on this first flow interface.
[0146] In some embodiments, the source device and the receiving device communicate via a distributed soft bus. The distributed soft bus can provide mechanisms for saving and restoring application interfaces, page stacks, and business data across devices, and is responsible for sending flow instructions for the target application, as well as the node tree layout information and business data of the source interface during application flow, from the source device to the receiving device.
[0147] For example, when the source device detects that a user is transferring a target application from the source device to the receiving device, it uses distributed soft bus technology to send the transfer instruction information of the target application, as well as the node tree layout information and business data of the source interface during the application transfer, to the receiving device. Establishing data communication through the distributed soft bus ensures the efficiency and security of the transfer process.
[0148] Furthermore, the source device can also establish a communication connection with the receiving device via a local area network such as Bluetooth, Wi-Fi, or near field communication (NFC), sending the target application's flow instruction information, as well as the node tree layout information and business data of the source interface during application flow, to the receiving device. This application embodiment does not limit the method by which the source device and the receiving device establish a communication connection.
[0149] Source devices and connection devices can run on different operating systems or platforms, such as This allows for cross-platform application flow. For example, the source device is an Android operating system (e.g., device A in Figure 1), and the receiving device is a Windows operating system (e.g., device B in Figure 1). The source device is in a memo editing state. After receiving the user's flow operation, it sends the flow instruction information of the target application of the memo to the receiving device, as well as the node tree layout information and business data of the source interface during application flow, thereby achieving the purpose of application flow.
[0150] S703 The connecting device receives the flow instruction information of the target application from the source device, as well as the node tree layout information and business data of the source interface during application flow.
[0151] In some embodiments, the connecting device receives the target application flow instruction information sent by the source device via a distributed soft bus, as well as the node tree layout information and business data of the source interface during application flow, thereby accurately restoring the target application interface on the source device.
[0152] Alternatively, the connecting device can establish data communication with the source device via Bluetooth, Wi-Fi, NFC, or other methods. Based on this data communication, the source device sends the connecting device flow instruction information for the target application, as well as the node tree layout information and business data of the source interface during application flow. Based on this data communication, the connecting device receives the flow instruction information for the target application, as well as the node tree layout information and business data of the source interface during application flow, from the source device.
[0153] Alternatively, the connecting device can receive the flow instruction information of the target application from the source device based on other communication methods, and receive node tree layout information and business data based on the distributed soft bus.
[0154] This application does not limit the specific transmission methods of flow instruction information, node number layout information, and business data.
[0155] S704. During the cold start process of the target application, the connecting device performs interface layout and rendering based on the node tree layout information and business data to obtain the first flow interface and display the first flow interface.
[0156] After receiving the flow instruction information for the target application from the source device, the connecting device starts the target application. It should be noted that in the connecting device, starting the target application includes both cold start and warm start. The application flow method described in this application embodiment is applicable to the cold start process of the target application.
[0157] After receiving the flow instruction information from the target application, along with the node tree layout information and business data of the application flow interface, the connecting device uses the received node tree layout information and business data to perform interface layout and rendering during the cold start process of the target application, thus obtaining the first flow interface. This first flow interface corresponds to the first interface. The first flow interface represents the first frame of the application interface rendered by the connecting device after receiving the flow information from the source device.
[0158] In this embodiment, the connecting device does not need to calculate the nodes, their attribute information, or create nodes. It can directly perform interface layout and rendering based on the calculated node tree layout information (including the node tree layout, relationships between nodes, etc.) and business data sent by the source device. This allows for rapid acquisition of the first frame of the transition interface (which can be understood as skipping the page loading portion within the dashed box in Figure 3 and obtaining the first frame of the transition interface). The connecting device displays the first frame of the transition interface to the user, who perceives the transition as complete, thus improving application transition speed and enhancing the user's application transition experience.
[0159] Moreover, the connecting device can skip the process of calculating each node, the attribute information of each node, and creating nodes when running application code files. It can directly display the first flow interface in advance based on the received node tree layout information. In addition to improving the application flow speed and shortening the cold start time of the target application, it can also save the computing resources of the connecting device and improve the processing performance of the connecting device.
[0160] Meanwhile, the first interface is the source interface during application flow, and its node tree layout information corresponds to the first interface. Therefore, the first flow interface displayed by the connecting device based on the node tree layout information also corresponds to the first interface. Displaying the first flow interface on the connecting device side, which corresponds to the first interface during application flow on the source device, allows the interface during application flow on the connecting device to be displayed continuously. This ensures continuity of the application interface before and after the flow, guarantees a consistent user experience, and facilitates users to continue their previous operations after the flow, resulting in a better user experience.
[0161] Furthermore, most users typically expect to see the same application flow interface on the connecting device as on the source device. Therefore, displaying a first flow interface on the connecting device that corresponds to the first flow interface on the source device can improve the user's application flow experience.
[0162] The correspondence between the first flow interface and the first interface includes several situations.
[0163] In some embodiments, the content of the first transition interface and the first interface are identical. When the target application flows from the source device to the connecting device, the first transition interface displayed on the connecting device is exactly the same as the first interface on the source device.
[0164] For example, a user browses a shopping app on their mobile phone (originating device) and views a product's details page (first interface). The user then wants to continue browsing on a computer (connecting device). The user performs an operation on their phone to transfer the shopping app to the computer. The phone detects this transfer and sends the node tree layout information and business data (such as product images, links, and prices) of the product's details page to the computer. The computer receives this information and, based on the node tree layout and business data, lays out and renders the interface, displaying an interface identical to the one on the mobile phone (first transfer interface). The user can then continue browsing or make a purchase.
[0165] In one possible implementation, the size or resolution of the first streaming interface may also differ from that of the first interface because the screen size or resolution of the connecting device and the source device are different.
[0166] In other embodiments, the first transition interface corresponds to the first interface but the content is not entirely the same. The first transition interface is a portion of the content on the first interface. For example, the first transition interface may only include the main body of the first interface and may not include some secondary elements (such as interface advertisements, side navigation bars, etc.).
[0167] For example, taking a shopping app as an example, a user browses an interface (first interface) containing multiple products on a computer (source device). When the user wants to continue browsing on a mobile phone (connecting device), the smaller screen of the phone cannot fully display all the content of the interface on the computer. Therefore, the computer sends the node tree layout information and business data (such as the products the user is currently interested in) corresponding to the main part of the products in the interface to the mobile phone. The mobile phone receives and renders the interface layout based on the node tree layout information and business data, displaying the main part of the products in the interface (first transition interface), thus allowing the user to continue browsing or make a purchase on the mobile phone.
[0168] 705. After receiving the flow instruction information of the target application from the source device, the connecting device runs the application code file of the target application to load the page during the cold start process of the target application.
[0169] As mentioned earlier, after receiving the flow instruction information for the target application from the source device, the connecting device performs a cold start on the target application. During the cold start process, the application code files of the target application are run to load the page. For example, this process can correspond to the framework initialization and page loading process in Figure 3. Framework initialization is used to characterize the UI framework.
[0170] The target application's application code file can also be called application code (such as JS application code, ArkTS application code) or code file. It is used to support the cold start process of the target application and to describe the interface after the target application has transitioned.
[0171] In this embodiment, during the cold start process, the target application on the connecting device performs two processes: loading the page by running its application code file (referred to as process 1) and rendering the interface based on node tree layout information and business data to obtain the first transition interface (referred to as process 2). These two processes can be performed in parallel. Therefore, the connecting device can skip the process of running the target application's application code file in process 1 and display the first transition interface before the cold start is complete.
[0172] Simultaneously, parallel processing is achieved, eliminating the need for runtime page loading based on the target application's code files. Instead, it directly uses node tree layout information and business data to perform interface layout and rendering, resulting in the first transition interface. This shortens the display time of the first transition interface, accelerates the cold start speed of the target application, and improves application workflow time. Furthermore, the parallel execution of processes 1 and 2 allows for better utilization of the parallel capabilities of the computer's processor.
[0173] In some embodiments, processes 1 and 2 described above can be executed in parallel using different threads. For example, referring to Figure 10(b), the connecting device runs the application code file of the target application to load the page on the main thread (e.g., corresponding to the framework initialization and page loading process in Figure 3). The connecting device performs interface layout and rendering based on node tree layout information and business data to obtain the first transition interface, which is executed on the first thread (e.g., corresponding to the layout rendering process in Figure 3). The main thread and the first thread run in parallel.
[0174] After the connecting device performs interface layout and rendering based on the node tree layout information and business data, it obtains the first transition interface. This interface can be understood as a partially static interface, containing interactive and non-interactive parts. The interactive parts include interactive components that allow for sliding, dragging, and other operations on buttons, images, and text within the interface. The nodes corresponding to the interactive components on the first transition interface are not interactive before being bound to a registration function; after being bound to a registration function, they become interactive.
[0175] During the page loading process of the target application's application code file, the connecting device can bind nodes to registration functions indicated by the application code file. In one possible implementation, the registration function can be obtained by running the application code file's declaration file. The registration function represents a function that triggers specific logic to navigate to the interface when the user interacts with the control corresponding to the node. For example, the registration function could be a function that navigates to the next page after clicking an interactive control or a text search control. The registration function can be associated with a specific control and automatically called when the control is triggered. After the node is bound to the registration function, the interface displayed by the connecting device becomes interactive.
[0176] In some embodiments, the method may further include step S706:
[0177] S706, Connecting to the device update interface, displays the second workflow interface.
[0178] During the page loading process of the target application's application code file, the connecting device can also obtain the target layout information of the nodes on the flow interface indicated by the application code file. The target layout information of the nodes on the flow interface indicated by the application code file represents the node tree layout information of the application flow interface specified by the target application.
[0179] The node tree layout information sent from the source device represents the node tree layout information of the first interface displayed when the source device performs application flow. Since the first flow interface corresponding to the first interface during source flow may not be consistent with the application flow interface indicated by the target application's application code file, the node tree layout information sent from the source device and the target layout information may be the same or different. Therefore, during the page loading process of the connecting device running the target application's application code file, it can also determine whether the node tree layout information sent from the source device is the same as the target layout information. If they are different, the interface is updated to obtain the second flow interface.
[0180] Specifically, when the target layout information of the nodes on the flow interface indicated by the application code file and the received node tree layout information satisfy any one or more of the following conditions: different nodes, different attribute information of each node, and different relationships between nodes, the connecting device will perform an update process.
[0181] When determining whether the node tree layout information sent from the source device is the same as the target layout information, if the node indicated by the target layout information does not exist in the node tree layout information, the connecting device creates the indicated node through the main thread; if the node indicated by the target layout information exists in the node tree layout information, the process of creating the indicated node is skipped. During the cold start process of the target application, because the connecting device skips the creation process of multiple nodes, the cold start time of the application is shortened, the application flow efficiency is higher, and the computing resources of the connecting device can also be saved.
[0182] Furthermore, when the node tree layout information contains a node indicated by the target layout information, the connecting device binds the node in the node tree layout information to the registration function indicated by the application code file via the main thread. When the node tree layout information does not contain a node indicated by the target layout information, the main thread binds the created indicated node to the registration function indicated by the application code file. By binding the node in the node tree layout information containing the target layout information to the registration function via the main thread, the correct association and invocation of the registration function are ensured, improving the interactive experience of the application flow. After binding is completed, the flow interface displayed on the connecting screen becomes interactive.
[0183] There are several ways to update the interface of the connecting device to obtain the second transition interface.
[0184] In some embodiments, when the connecting device determines that the target layout information of the nodes on the transition interface indicated by the application code file differs from the node tree layout information received from the source device, the connecting device updates the node tree layout information based on the target layout information, and then performs interface layout and rendering based on the updated node tree layout information to obtain and display the second transition interface. By updating the node tree layout information and performing interface layout and rendering based on the updated node tree layout information to obtain the second transition interface, the time cost in the interface update process is reduced, layout differences can be handled efficiently, and the second transition interface indicated by the application code file of the target application can be obtained.
[0185] In other embodiments, when the connecting device determines that the target layout information of the nodes on the flow interface indicated by the application code file is different from the node tree layout information received from the source device, the connecting device updates the content of the first flow interface to obtain the second flow interface.
[0186] The connecting device can compare the nodes indicated by the target layout information with the nodes indicated in the node tree layout information. On the first transition interface, the content of the child node trees with the same nodes does not need to be updated. For nodes with different nodes, the content of the child node trees of that node is rendered based on the node indicated by the target layout information and the node's attribute information. When nodes are different, the content of the corresponding child node trees is rendered, and this part of the content is updated on the first transition interface. This allows for handling of missing or differing information in the node tree layout. The second transition interface updates faster, improving application transition efficiency.
[0187] When the first node indicated by the target layout information is not present in the node tree layout information, the connecting device renders the interface content of the child node tree containing the first node based on the first node indicated by the target layout information. The interface content of the first transition interface and the child node tree containing the first node are then merged to obtain the second transition interface. In other words, minor adjustments can be made to the first transition interface without re-rendering the entire interface, resulting in a faster update speed for the second transition interface.
[0188] For example, referring to Figure 11, suppose that in the application flow interface specified by the target application on the connecting device, there is a child node 2 (corresponding to the first node) used to display the user's avatar. However, this node is not included in the node tree layout information. Therefore, the connecting device will not receive this node from the source device, and thus cannot lay out and render this node. Therefore, the connecting device will render the user's avatar (the interface content of the child node tree where the first node is located) based on the node in the target layout information. Moreover, the connecting device will merge the interface content of this newly rendered child node tree (as shown in Figure 11, the first node is child node 2, and the child node tree of the first node represents the node tree formed by child node 2 as the root node in the original node tree, that is, the child node tree formed by child node 2, child node 10 and child node 11 shown in Figure 11) with the first flow interface to update and obtain a new second flow interface that includes the interface content of the child node tree where the first node is located.
[0189] When the attribute information of the second node indicated by the target layout information differs from that of the second node in the node tree layout information, the connecting device renders the interface content corresponding to the second node based on the attribute information of the second node indicated by the target layout information, and updates the interface content corresponding to the second node on the first transition interface to obtain the second transition interface. This allows for fine-tuning on the first transition interface without re-rendering the interface, thus speeding up the application's cold start process. For example, suppose there is a button node (corresponding to the second node) in the application transition interface specified by the target application on the connecting device, and its background color is blue. However, on the source device, the background color of this button is red. Therefore, the connecting device will render the button background as blue (corresponding to the interface content of the second node) based on the blue background in the target layout information, and update the button background as blue on the first transition interface to obtain a new second transition interface with a blue button background.
[0190] Normally, the difference between the first and second transition interfaces is not significant. The second transition interface is obtained by updating the first transition interface. During the update process, it is not easy to cause sudden changes or jumps in the screen, so the impact on the user's transition experience is minimal and the user's visual experience is good.
[0191] In other words, in this embodiment, when the connecting device determines that the target layout information of the nodes on the flow interface indicated by the application code file is different from the node tree layout information received from the source device, the connecting device updates the interface based on the target layout information to obtain a second flow interface and displays the second flow interface. The second flow interface represents the new application interface obtained by the connecting device after updating the first flow interface according to the target layout information. Since the target layout information represents the node tree layout information of the application flow interface specified by the target application, the second flow interface obtained by updating according to the target layout information can match the flow interface specified by the target application. After displaying the first flow interface, the updated second flow interface is displayed. First, the layout and rendering are performed based on the node tree layout information and business data to obtain the first flow interface; the first frame interface after the application flow is displayed as soon as possible, i.e., the first flow interface. Second, it can be updated to a second flow interface that matches the target layout information in a timely manner. Moreover, under normal circumstances, the difference between the first flow interface and the second flow interface is not significant, and the update process is less likely to cause sudden changes or jumps in the screen, resulting in a better user visual experience.
[0192] Furthermore, Figure 9 illustrates a schematic diagram of the application flow process of a connecting device. Referring to Figure 9, the connecting device receives node tree layout information and business data from the source device via the distributed soft bus of the distributed framework. Utilizing the application scheduling, application page, and page stack saving and restoring mechanisms provided in the distributed framework, the main thread and the first thread run in parallel. The main thread performs initialization processing, including application component initialization (e.g., initializing the virtual machine or the application code file of the target application), and loading the page by running the application code file of the target application (e.g., JavaScript, ArkTS, etc.). Simultaneously, the first thread performs interface layout and rendering based on the node tree layout information and business data received from the source device. This process includes starting the user interface (UI) engine, performing interface layout and rendering based on the obtained node tree layout information and business data, thus completing the rendering of the first frame and obtaining and displaying the first flow interface. Moreover, the main thread can obtain the target layout information by running the application code file of the target application. When the connecting device determines that the target layout information of the nodes on the transition interface indicated by the application code file is inconsistent with the node tree layout information received from the source device, it updates the interface based on the target layout information to obtain and display the second transition interface. At this point, the target application has completed its cold start, the application transition is complete, and interaction is possible.
[0193] In the application flow method described in the above embodiments of this application, the source device sends node tree layout information and business data to the connecting device. The node tree layout information includes nodes, attribute information of each node (e.g., node position and size), and relationships between nodes. The connecting device can directly perform interface layout and rendering based on the calculated node tree layout information and business data to obtain and display the first flow interface. The connecting device does not need to create nodes; it calculates node information to form the node tree layout information before displaying the flow interface. The connecting device can skip the processes of running application code files, loading pages, calculating nodes, and creating nodes, thus enabling the first frame of the first flow interface to be displayed before the cold start is complete, improving application flow speed and user experience. Furthermore, since the connecting device directly performs interface layout and rendering based on the node tree layout information and business data, it does not need to calculate the attribute information of each node and each node tree, thus saving computing resources.
[0194] Compared to related technologies where the application flow method sequentially initializes the main thread of the connecting device, runs the target application's code file, loads the page, and then performs interface layout and rendering, the application flow method provided in this application embodiment runs the main thread and the first thread in parallel. The main thread of the connecting device initializes and runs the target application's code file to load the page, while the first thread performs interface layout and rendering based on node tree layout information and business data to obtain the first flow interface. This shortens the cold start time during application flow, improves application flow speed, and enhances the user flow experience.
[0195] For example, Figure 10(a) illustrates an application flow method of the related technology. The connecting device completes the cold start of the target application, thereby realizing the first frame rendering, obtaining the flow interface and displaying it, taking approximately 700ms. This includes initialization and running the application code file, approximately 300ms; page loading, approximately 200ms; and layout and rendering, approximately 200ms. Figure 10(b) illustrates an application flow method provided by an embodiment of this application. The main thread and the first thread process in parallel. The first thread completes the first frame rendering based on the received node tree layout information, obtaining the first flow interface and displaying it, taking approximately 200ms. The first frame display time is optimized by 3 times. The main thread performs the cold start processing of the target application, including initialization, running the application code file, and page loading processing, taking approximately 500ms. The application cold start time is also greatly shortened. It can be seen that the application flow method improved by the embodiment of this application greatly shortens the display time of the first frame flow interface and the cold start time of the target application, thereby improving the application flow speed.
[0196] In one possible implementation, the application code file of the target application can be understood as the front-end, and running the application code file of the target application can be understood as front-end processing. The back-end can be understood as the UI framework in the operating system, which implements the interfaces called by the front-end and renders the corresponding UI. In the embodiments of this application, the process of rendering and displaying the interface layout based on the received node tree layout information can be back-end processing.
[0197] This application also provides an application workflow system, which includes a source device and a connection device. The source device and the connection device can be used to execute the application workflow method described in the foregoing embodiments.
[0198] In some embodiments, the source device includes a system side and an application side. After detecting the flow operation of the target application, the source device obtains the node tree layout information of the source interface through the system side and obtains the business data of the target application through the application side.
[0199] It should be noted that the above embodiments can be combined in any way as long as the solutions themselves are not contradictory.
[0200] In some solutions, multiple embodiments of this application can be combined, and the combined solution can be implemented. Optionally, some operations in the processes of each method embodiment may be combined, and / or the order of some operations may be changed. Furthermore, the execution order between the steps of each process is merely exemplary and does not constitute a limitation on the execution order between steps; other execution orders are also possible. It is not intended to indicate that the execution order is the only possible order in which these operations can be performed. Those skilled in the art will conceive of various ways to reorder the operations described herein. In addition, it should be noted that the process details involved in one embodiment of this document are similarly applicable to other embodiments, or different embodiments may be combined.
[0201] Furthermore, some steps in the method embodiments can be equivalently replaced with other possible steps. Alternatively, some steps in the method embodiments may be optional and can be deleted in certain use cases. Or, other possible steps may be added to the method embodiments.
[0202] Furthermore, the various method embodiments can be implemented individually or in combination.
[0203] It is understood that, in order to achieve the above functions, the electronic device includes hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.
[0204] This embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0205] For example, when functional modules are divided according to their respective functions, the electronic device involved in the above embodiments may include: an establishment unit, a receiving unit, a presentation unit, an activation unit, and an adjustment unit, etc. It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional descriptions of the corresponding functional modules, and will not be repeated here.
[0206] This application also provides an electronic device, as shown in FIG12, which may include one or more processors 1201, memory 1202 and communication interface 1203.
[0207] The memory 1202, communication interface 1203, and processor 1201 are coupled together. For example, the memory 1202, communication interface 1203, and processor 1201 can be coupled together via bus 1204.
[0208] The communication interface 1203 is used for data transmission with other devices. The memory 1202 stores computer program code. The computer program code includes computer instructions, which, when executed by the processor 1201, cause the electronic device to perform the display method described in this embodiment.
[0209] The processor 1201 may be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with this disclosure. The processor may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0210] Bus 1204 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 1204 can be categorized as an address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in Figure 12, but this does not indicate that there is only one bus or one type of bus.
[0211] This application also provides a computer-readable storage medium storing computer program code. When the processor executes the computer program code, the electronic device executes the relevant method steps in the above method embodiments.
[0212] This application also provides a computer program product that, when run on a computer, causes the computer to execute the relevant method steps described in the above method embodiments.
[0213] The electronic devices, computer storage media, or computer program products provided in this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0214] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0215] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0216] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0217] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0218] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to it, or all or part of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0219] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An application circulation method, characterized in that, include: Receive flow instruction information from the target application from the source device, as well as node tree layout information and business data of the source interface during application flow; during the cold start process of the target application, perform interface layout and rendering based on the node tree layout information and the business data to obtain a first flow interface; display the first flow interface.
2. The method according to claim 1, characterized in that, The cold start process includes: running the main thread and the first thread in parallel; initializing through the main thread and running the application code file of the target application to load the page; and using the first thread to perform interface layout and rendering based on the node tree layout information and the business data to obtain the first transition interface.
3. The method according to claim 2, characterized in that, The method further includes: if it is determined that the target layout information of the nodes on the flow interface indicated by the application code file is different from the node tree layout information, then the interface is updated based on the target layout information to obtain a second flow interface; and the second flow interface is displayed.
4. The method according to claim 3, characterized in that, The step of updating the target layout information to obtain the second transition interface includes: updating the node tree layout information based on the target layout information; and performing interface layout and rendering based on the updated node tree layout information to obtain the second transition interface.
5. The method according to claim 3, characterized in that, The step of updating based on the target layout information to obtain the second transition interface includes: when the first node indicated by the target layout information does not exist in the node tree layout information, rendering the interface content of the child node tree where the first node is located based on the first node indicated by the target layout information, and merging the interface content of the first transition interface and the interface content of the child node tree where the first node is located to obtain the second transition interface; or, when the attribute information of the second node indicated by the target layout information is different from that of the second node in the node tree layout information, rendering the interface content corresponding to the second node based on the attribute information of the second node indicated by the target layout information, updating the interface content corresponding to the second node on the first transition interface to obtain the second transition interface.
6. The method according to claim 4, characterized in that, During the page loading process of running the application code file of the target application through the main thread, the method further includes: when the node tree layout information contains a node indicated by the target layout information, skipping the process of creating the indicated node; when the node tree layout information does not contain a node indicated by the target layout information, creating the indicated node through the main thread.
7. The method according to claim 6, characterized in that, The method further includes: when the node tree layout information contains a node indicated by the target layout information, binding the node in the node tree layout information to the registration function indicated by the application code file through the main thread; when the node tree layout information does not contain a node indicated by the target layout information, binding the created indicated node to the registration function indicated by the application code file through the main thread.
8. The method according to any one of claims 1-7, characterized in that, The layout information of the node tree is used to characterize the nodes on the source interface during application flow, the relationships between nodes, and the attribute information of each node. The attribute information includes the position and size of the node.
9. The method according to claim 8, characterized in that, The layout information of the node tree is used to characterize multiple key nodes on the source interface during application flow, the relationships between key nodes, and the attribute information of each key node.
10. The method according to any one of claims 1-9, characterized in that, The step of receiving the flow instruction information of the target application from the source device, as well as the node tree layout information and business data of the source interface during application flow, includes: receiving the flow instruction information of the target application from the source device, as well as the node tree layout information and business data of the source interface during application flow, through a distributed soft bus.
11. An application circulation system, characterized in that, It includes a source device and a connection device; the source device is configured to display a first interface of the target application; when a flow operation of the target application is detected, the source interface during application flow is the first interface; The system sends a flow instruction message for the target application, along with node tree layout information and business data of the source interface during application flow, to the connecting device. The node tree layout information corresponds to the first interface. The connecting device is configured to receive the flow instruction message, as well as the node tree layout information and business data of the source interface during application flow. During the cold start process of the target application, the system performs interface layout and rendering based on the node tree layout information and the business data to obtain a first flow interface. The system displays the first flow interface, which corresponds to the first interface.
12. The system according to claim 11, characterized in that, The source device includes a system side and an application side; the source device is also configured to, after detecting the flow operation of the target application, obtain the node tree layout information of the source interface through the system side and obtain the business data of the target application through the application side.
13. An electronic device, characterized in that, It includes a processor and a memory; the memory is used to store code instructions; the processor is used to run the code instructions, causing the electronic device to perform the application flow method as described in any one of claims 1-10.
14. A computer storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the application flow method as described in any one of claims 1-10.
15. A computer program product, characterized in that, It includes a computer program, which, when executed by a processor, implements the application flow method as described in any one of claims 1-10.
