Cross-Platform Engine Instance Reuse for Memory Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing Flutter page display method requires creating multiple Flutter engine instances when jumping between native and Flutter pages, leading to significant memory occupation and performance issues due to the need for repeated engine instantiation.
Innovation Solution
A method and apparatus that acquire and reuse a pre-constructed cross-platform engine instance from memory, eliminating the need for new engine instances by using a self-defined operation to load the target cross-platform page, thereby reducing memory usage and improving performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If a new Flutter engine instance is created each time the user jumps from a native page to a Flutter page, then the Flutter page can be loaded and displayed, but multiple Flutter engine instances are created in memory, occupying large memory and affecting user experiences
Solution Approach 1:
The patent applies preliminary action by creating the Flutter engine instance once during application initialization rather than repeatedly during page jumps. The engine instance is constructed in advance and stored in memory, so when a Flutter page needs to be loaded, the pre-created engine instance is reused instead of creating a new one each time.
Solution Approach 2:
The patent applies universality by making the single Flutter engine instance serve multiple functions - it can load different Flutter pages multiple times throughout the application's lifecycle. The engine instance becomes a shared resource that handles various page loading operations rather than being dedicated to a single page creation.
2Adaptability or versatility
If multiple Flutter engine instances are created for different Flutter pages, then each page can be loaded independently, but the number of engine instances increases, leading to poor performance and high memory consumption
Solution Approach 1:
The Flutter engine instance is created in advance during application initialization before any Flutter pages need to be loaded. This preliminary creation ensures the engine is ready and available for subsequent page loading operations without causing performance degradation from repeated instantiations.
Solution Approach 2:
Instead of creating multiple engine instances, the patent uses a single engine instance that can be referenced and used multiple times. The engine instance acts as a template or copy that can load different Flutter pages without requiring actual multiplication of the engine itself.
3Ease of operation
If a Flutter engine instance is created for each Flutter page, then the page can be displayed, but the repeated creation process increases time consumption and reduces user experience
Solution Approach 1:
The Flutter engine instance is created once during application initialization as a preliminary action. This single creation happens before any Flutter pages need to be displayed, eliminating the time-consuming repeated instantiation that would occur if a new engine were created for each page load operation.
Data Source
AI summary
The present disclosure provides a page display method and apparatus. The method includes: in response to a first trigger operation in a target application, acquiring a target cross-platform engine instance constructed in advance by a self-defined operation from a memory, where the first trigger operation is used to request a jump from a native page of the target application to a target cross-platform page; based on the target cross-platform engine instance, loading the target cross-platform page. In this case, there is only one cross-platform engine instance in the memory, reducing the occupation for the memory, optimizing the performance of the target application and improving the user experiences.


