Design optimization method based on rapid cold and hot start application function of swan Mongolian system
By building a flexibly configurable direct access point to functions in the HarmonyOS system, the problems of limited card interface adaptation and low cold start efficiency have been solved, enabling application functions to start quickly in cold and warm mode, and improving user operation efficiency and personalized configuration capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INSPUR ZHUOSHU BIG DATA IND DEV CO LTD
- Filing Date
- 2026-01-09
- Publication Date
- 2026-04-17
AI Technical Summary
The card interface of applications in the existing HarmonyOS system is not well adapted, and the fixed icon format cannot meet the user's personalized information display needs. The cold start response efficiency is low, and traditional shortcuts are only suitable for warm starts and cannot achieve fast cold starts.
By building a flexibly configurable function access point in the HarmonyOS system, configuring shortcut configuration files and routing information, and utilizing the HarmonyOS system's listening method to store shortcut jump identifiers during cold and warm starts, quick application startup can be achieved.
It achieves fast startup with a cold start response time of ≤800ms and a warm start response time of ≤300ms, supports personalized function configuration for multiple scenarios, improves user operation efficiency, and shortens the information acquisition path.
Smart Images

Figure CN121879865A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a design optimization method for the fast cold and warm start application function based on the HarmonyOS system. Background Technology
[0002] With the widespread adoption of smart terminal devices and the continuous expansion of application functions, the complexity of user interfaces is increasing exponentially. In existing technologies, HarmonyOS application shortcuts utilize a "card" format to launch applications: Form Kit (a card development framework) provides a development framework and API for embedding application information into system entry points such as the desktop and lock screen. It allows users to extract important information or frequently used operations within the application onto service cards, which are then added to the desktop for convenient information display and direct service access. However, the card interface has limited adaptability: the fixed icon format struggles to meet users' personalized information display needs. Another method for HarmonyOS application shortcuts is static shortcuts, which are links created within the system that provide quick access to applications or specific functions. These shortcuts typically appear above the application icon with an icon and corresponding text when long-pressed, allowing users to quickly launch the corresponding application component. Using shortcuts improves efficiency, saving time searching for and opening components; it also allows for personalized customization, creating multiple shortcuts to suit individual workflows and operational preferences. However, this method is only suitable for hot starts; cold starts do not yield the desired results. Summary of the Invention
[0003] To address the above technical issues, this invention provides a design optimization method for fast cold and warm start application functions based on the HarmonyOS system. By constructing a flexibly configurable function access point at the operating system level, users can quickly launch specific function modules within the application with just one click, regardless of whether the application is in a cold or warm start state.
[0004] The technical solution of this invention is: The design and optimization method for the HarmonyOS system's fast cold and warm start application function first configures the shortcut configuration file `shortcuts_config.json` in the ` / resources / base / profile / ` directory of the Entry module. Next, the routing information for the corresponding shortcut pages is added to the `main_pages.json` file in the `resources / base / profile` directory. Simultaneously, in the `module.json5` configuration file, the `resource` property value is set to `$profile:shortcuts_config` in the `metadata` section under the `abilities` tag, thus specifying the application's shortcut configuration file and using the `shortcuts` configuration in the `shortcuts_config.json` file.
[0005] Then, the method for navigating to the specified page is defined in the EntryAbility.ets file. Specifically, a shortcut flag is stored in the onCreate() function during a cold start and in the onNewWant() function during a warm start. Subsequently, since this invention implements main page navigation, the shortcut flag is monitored in the main interface index.ets. Ultimately, the goal of quick application launch is achieved.
[0006] Furthermore, Specifically, the following steps are included: S101: Configure the shortcut configuration file shortcuts_config.json in the / resources / base / profile / directory of the Entry module. The shortcut tag values in the shortcuts_config.json file are in array form, which contains shortcutId, label, icon, and the want sub-tag. The shortcutId is used to identify the unique ID of the shortcut, the label is used to carry the text description information of the shortcut displayed to the user interface, the icon is used to specify the shortcut icon, and the parameters in the want tag are used to specify the custom data carried when the user launches the shortcut.
[0007] S102: Add the routing information for the corresponding shortcut page to the main_pages.json file under the resources / base / profile directory, and set the resource attribute value to $profile:shortcuts_config in the metadata under the capabilities tag in the module.json5 configuration file; and use @Entry to decorate the page component when creating the shortcut page. S103: Define a method to jump to a specified page in the EntryAbility.ets file. Store the shortcut identifier in the onCreate() function during cold start and in the onNewWant() function during hot start. Each time the application is launched via shortcut, assign a value to shortCutKey in the parameters of the want object. Use the listening method provided by HarmonyOS to store the shortcut's relevant information in the EntryAbility.ets file. Call the defined jump method in the onNewWant() or onCreate() function and pass want as a parameter.
[0008] S104: On the main interface, use @StorageProp(key) to listen for the quick launch identifier and launch the application quickly. The quick launch identifier is stored as a key-value pair in the onNewWant() or onCreate() function. The storage operation is completed through AppStorage.setOrCreate(). Use @StorageProp(key) to decorate the variable in the component to establish one-way data synchronization with the property corresponding to the key in AppStorage, and perform local initialization on the variable decorated by @StorageProp(key). Finally, jump to the specified function according to the given key value.
[0009] in, The shortcuts_config.json file is specifically used to centrally define the detailed configurations of application shortcuts.
[0010] The shortcuts generated by configuring the metadata field in the module.json5 configuration file can only jump to specific UIAbility, and cannot directly jump to non-entry pages. Moreover, an application can configure a maximum of four shortcuts.
[0011] AppStorage is a singleton object created when an application starts, providing a centralized storage center for application state data. Its properties can be accessed through unique key string values.
[0012] The @StorageProp(key) method allows modification of variables locally, but local modifications are not synchronized back to AppStorage. However, changes to properties of a given key in AppStorage are synchronized to @StorageProp and overwrite local modifications.
[0013] The beneficial effects of this invention are To address the dual technical bottlenecks of the HarmonyOS application ecosystem, namely the monotonous interface of service cards and low cold start response efficiency, a three-in-one intelligent startup architecture of "configuration-scheduling-response" is constructed. This architecture optimizes performance by achieving a cold start response time of ≤800ms and a warm start response time of ≤300ms. At the same time, it supports developers to customize personalized function configurations for multiple scenarios. Ultimately, it breaks through the limitations of traditional technologies, improves user operation efficiency, shortens the information acquisition path, and builds an open and compatible system-level application entry ecosystem. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of the workflow of the present invention. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0016] This invention proposes a design optimization method for the rapid cold and hot start application function based on the HarmonyOS system. The specific steps are as follows: The shortcuts_config.json file, located in the / resources / base / profile / directory of the S101Entry module, configures shortcuts. When configuring application shortcuts, shortcuts are chosen as the core configuration carrier. The shortcut tag value is presented in array form, which contains four key sub-tags: shortcutId, label, icon, and wants. Each sub-tag undertakes different and important configuration functions.
[0017] First, in the ` / resources / base / profile / ` directory of your project, you need to create a dedicated file named `shortcuts_config.json`. This file will be used to centrally define the detailed configurations for application shortcuts. Within the `shortcuts_config.json` file, the sub-tags perform the following functions: shortcutId: This tag is used to accurately identify the unique ID of a shortcut, just like a unique "identity number" assigned to each shortcut, ensuring that the system can accurately identify and call it.
[0018] The label is primarily responsible for displaying the text description of the shortcut on the user interface. This text content can intuitively convey the function and purpose of the shortcut to the user, greatly facilitating the user's quick understanding and selection.
[0019] icon: It bears the important responsibility of specifying shortcut icons. Carefully selected or designed icons can help users quickly locate and identify the target among many shortcuts in a more intuitive and visual way, enhancing the convenience and efficiency of user interaction.
[0020] `wants`: This tag defines a set of target `wants` information, among which the `parameters` parameter is particularly crucial. Through the `parameters` parameter, developers can flexibly specify custom data carried when a user launches the shortcut. This feature allows the shortcut to perform differentiated operation flows based on different custom data when launching specific application functions, significantly improving the flexibility and personalization of application function calls.
[0021] S102 adds the routing information for the corresponding shortcut page to the main_pages.json file, and sets the resource attribute value to $profile:shortcuts_config in the metadata section under the capabilities tag in the module.json5 configuration file. In the system, configuring the metadata field in the module.json5 configuration file can generate shortcuts, which act as links to quickly access applications or specific functions. These shortcuts differ significantly from cards: they only allow navigation to specific UIAbility pages, cannot directly navigate to non-entry pages, and an application can configure a maximum of four shortcuts. To create a shortcut page and configure its routing information, you need to complete the following steps in sequence: Page creation: Begin creating the corresponding shortcut page. During this process, be sure to use @Entry to decorate the page components to meet the system's specific requirements for shortcut page components. Route Configuration: After creating the page, add the route information corresponding to the created shortcut page to the main_pages.json file in the resources / base / profile directory. This step allows the system to accurately identify and redirect to the corresponding shortcut page, thus achieving full functionality configuration for the shortcut.
[0022] The S103EntryAbility.ets file defines methods for jumping to a specified page: for cold starts, a shortcut identifier is stored in the onCreate() function, and for warm starts, the shortcut identifier is stored in the onNewWant() function.
[0023] When a user launches an application via a shortcut, a value is assigned to `shortCutKey` each time. This value resides in the `parameters` property of the `want` object. The `want` object is a crucial information carrier passed by the HarmonyOS system during application launch or interaction, and its `parameters` property stores additional custom parameters. We can utilize the listening methods provided by HarmonyOS to store shortcut-related information in the `EntryAbility.ets` file. Specifically, the listening methods continuously monitor relevant events during application launch. Once a shortcut launch is detected, the value of `shortCutKey` is extracted from the `parameters` property of the `want` object and stored in a suitable data structure, such as a global variable or a specific storage class instance. The advantage of this is that this crucial information can be easily retrieved during subsequent page navigation operations, providing a basis for accurate navigation.
[0024] When configuring shortcuts, we can specify custom data to be used when launching a shortcut via the `parameters` parameter. This feature provides developers with great flexibility, allowing them to personalize settings according to different business needs and user scenarios. For example, setting `shortCutKey: "HousePage"` makes `shortCutKey` a key identifier for determining which shortcut the user is using. Different `shortCutKey` values can correspond to different pages or functions, and developers can freely combine and configure them according to actual needs. For example, in addition to "HousePage", we can also set "WorkPage" for work-related pages, "ShopPage" for shopping-related pages, and so on. In this way, when a user selects different shortcuts, the system can react accordingly based on the value of `shortCutKey`.
[0025] In the `onNewWant()` or `onCreate()` function of the `EntryAbility.ets` file, call the defined redirect method (such as `goToSpecifyPage()`) and pass `want` as a parameter. The `onNewWant()` function is called when the application has started and receives a new `want`; the `onCreate()` function is called when the application is first created. These two functions are called at different times, and developers need to choose the appropriate function to call the redirect method based on specific business needs. The following example illustrates calling the `goToSpecifyPage()` method within the `onNewWant()` function. When the application receives a new `want`, the `onNewWant()` function is triggered, and inside this function, the `goToSpecifyPage()` method is called, passing the current `want` as a parameter. In this way, the `goToSpecifyPage()` method can retrieve the value of `shortCutKey` from `want`, thus achieving precise page redirection.
[0026] The S104 main interface uses @StorageProp(key) to listen for shortcut markers and enable quick application launch.
[0027] After completing step S103, the quick launch identifier is stored as a key-value pair in the `onNewWant()` or `onCreate()` function. For example, you can use `AppStorage.setOrCreate('openFast', 'quick_scan')` to perform the storage operation. Here, `AppStorage` is a singleton object created when the application starts. Its main function is to provide a centralized storage center for application state data, which is accessible throughout the application. During application runtime, `AppStorage` persistently retains its properties, which can be accessed through unique key string values.
[0028] After the quick launch icon is stored, the application will go through a tutorial page and then navigate to the main screen. To establish a connection between AppStorage and custom components, the `@StorageProp` decorator is needed. Specifically, `@StorageProp(key)` is used to decorate variables within the component, where `key` identifies the property in AppStorage. When the custom component initializes, it uses the property value corresponding to that `key` in AppStorage to initialize the variables decorated with `@StorageProp(key)`.
[0029] However, due to differences in the logic across different applications, it's impossible to determine whether the corresponding property was stored in the AppStorage instance before component initialization. In other words, the property corresponding to the key may not exist in AppStorage. Therefore, variables decorated with `@StorageProp(key)` need to be initialized locally.
[0030] The purpose of `@StorageProp(key)` is to establish one-way data synchronization with the property corresponding to the key in AppStorage. It allows modifications to the variable locally, but these local modifications are not synchronized back to AppStorage. Conversely, if a property with the given key changes in AppStorage, this change is synchronized to `@StorageProp`, overwriting any local modifications.
[0031] Finally, based on the given key value, the application will redirect to the specified function.
[0032] The above description is merely a preferred embodiment of the present invention and is only used to illustrate the technical solution of the present invention, and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A design and optimization method for the rapid cold and hot start application function based on the HarmonyOS system, characterized in that, Step 1) Configure the shortcut configuration file shortcuts_config.json in the / resources / base / profile / directory of the Entry module; Step 2) Add the routing information for the corresponding shortcut page to the main_pages.json file in the resources / base / profile directory. At the same time, in the module.json5 configuration file, set the resource attribute value to $profile:shortcuts_config in the metadata under the capabilities tag to specify the application's shortcut configuration file, and then use the shortcuts configuration in the shortcuts_config.json file. Step 3) Define a method to jump to a specified page in the EntryAbility.ets file. Store the quick jump flag in the onCreate() function during cold start and in the onNewWant() function during warm start. Then, listen for the quick jump flag in the main interface index.ets. Finally, achieve the goal of quick start of the application.
2. The method according to claim 1, characterized in that, The shortcuts tag values in the shortcuts_config.json file are in array form, which contains shortcutId, label, icon, and the wants sub-tag. The shortcutId is used to identify the unique ID of the shortcut, the label is used to carry the text description information of the shortcut displayed on the user interface, the icon is used to specify the shortcut icon, and the parameters in the wants tag are used to specify the custom data carried when the user launches the shortcut.
3. The method according to claim 1, characterized in that, In step 2), create a shortcut page and configure its routing information; Page creation: Create the corresponding shortcut page and decorate the page components using @Entry; Route configuration: After the page is created, add the route information corresponding to the shortcut page in the main_pages.json file under the resources / base / profile directory.
4. The method according to claim 3, characterized in that, In step 3), each time the application is launched via the shortcut, the shortCutKey in the parameters of the want object is assigned a value. The relevant information of the shortcut is stored in the EntryAbility.ets file using the listening method provided by HarmonyOS. The defined jump method is called in the onNewWant() or onCreate() function, and want is passed as a parameter.
5. The method according to claim 4, characterized in that, When configuring a shortcut, specify custom data for launching the shortcut using the parameters parameter.
6. The method according to claim 4, characterized in that, On the main interface, use `@StorageProp(key)` to listen for the quick launch identifier and launch the application quickly. The quick launch identifier is stored as a key-value pair in the `onNewWant()` or `onCreate()` function. The storage operation is completed through `AppStorage.setOrCreate()`. Use `@StorageProp(key)` to decorate the variable in the component to establish one-way data synchronization with the property corresponding to the key in `AppStorage`. The variable decorated by `@StorageProp(key)` is initialized locally. Finally, jump to the specified function according to the given key value.
7. The method according to claim 1, characterized in that, The shortcuts_config.json file is used to centrally define various detailed configurations for application shortcuts.
8. The method according to claim 1, characterized in that, The shortcuts generated by configuring the metadata field in the module.json5 configuration file can only jump to specific UIAbility, and cannot directly jump to non-entry pages. Moreover, an application can configure a maximum of four shortcuts.
9. The method according to claim 1, characterized in that, AppStorage is a singleton object created when an application starts, providing a centralized storage center for application state data. Its properties can be accessed through a unique key string value.
10. The method according to claim 6, characterized in that, The @StorageProp(key) method allows modification of variables locally, but local modifications are not synchronized back to AppStorage. However, changes to properties of a given key in AppStorage are synchronized to @StorageProp and overwrite local modifications.