Information processing method, electronic device, and computer-readable storage medium

By prioritizing the distribution of system configuration information based on process level, the problem of excessive load caused by system configuration changes was solved, achieving efficient allocation of system resources and improved user experience.

CN122173257APending Publication Date: 2026-06-09HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-12-06
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

When the system configuration of an electronic device changes, a large number of application processes respond to the system configuration change, leading to a rapid increase in system load, insufficient resource supply, and a negative impact on user experience.

Method used

The dispatch mechanism is determined based on the process level of the application process. System configuration information is dispatched to higher-level processes first, while dispatching to lower-level processes is postponed or delayed. By setting blocking dispatch status and resuming dispatch mechanism, the number of processes responding to system configuration changes in a short period of time is reduced.

Benefits of technology

It reduced system load, increased system resource supply capacity, and improved user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173257A_ABST
    Figure CN122173257A_ABST
Patent Text Reader

Abstract

The application discloses an information processing method, an electronic device and a computer readable storage medium, relates to the technical field of intelligent terminals, and aims to solve the problem of high system load when the system configuration of the electronic device changes. The information processing method comprises the following steps: in response to the system configuration change, updating the system configuration information. When it is determined that the changed system configuration attribute in the system configuration information is a target system configuration attribute and the process level of the current application process meets a first priority condition, the system configuration information is dispatched to the current application process. The target system configuration attribute is a system configuration attribute that affects the display of the foreground interface. When the system configuration of the electronic device changes and the changed system configuration attribute is the target system configuration attribute, the system configuration information is dispatched to the application process that meets the first priority condition, thereby reducing the number of application processes that respond to the system configuration change in a short period of time, and the system load is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart terminal technology, specifically to an information processing method, an electronic device, and a computer-readable storage medium. Background Technology

[0002] During the lifecycle of an application process, system configuration information may change, such as screen orientation rotation, dark mode switching, language switching, font switching, and screen switching when the device is folded. When an electronic device detects a system configuration change, it dispatches the system configuration information to all application processes. After receiving the system configuration information, the application processes apply it to their process context, thereby loading application resources and refreshing the application interface. However, when a large number of application processes are responding to system configuration changes, the system load can be rapidly increased within a short period, potentially causing application processes to compete for system resources. This can lead to insufficient system resource supply for some services, thus affecting the user experience. Summary of the Invention

[0003] In view of this, embodiments of this application provide an information processing method, an electronic device, and a computer-readable storage medium, aiming to solve the problem of high system load when the system configuration of an electronic device changes.

[0004] The first aspect of this application provides an information processing method, which includes: updating system configuration information in response to a system configuration change. When it is determined that a changed system configuration attribute in the system configuration information is a target system configuration attribute, and the process level of the current application process meets a first priority condition, system configuration information is dispatched to the current application process. The target system configuration attribute is a system configuration attribute that affects the display of the foreground interface.

[0005] The system configuration information includes system configuration attributes, such as Mobile Country Code (mcc), Mobile Network Code (mnc), Font Scale (fontScale), Screen Layout Type (screenLayout), Touchscreen Type (touchscreen), Keyboard Type (keyboard), Keyboard Display Status (keyboardHidden), Navigation Button Type (navigation), Navigation Button Display Status (navigationHidden), Screen Orientation, Screen Color Mode (colorMode), Display Mode (uiMode), Screen Width (screenWidthDp), Screen Height (screenHeightDp), Minimum Screen Width (smallestScreenWidthDp), Screen Density (densityDpi), Serial Number (assetsSeq), Window Basic Information (windowConfiguration), Font Weight (fontWeightAdjustment), and Language List (mLocaleList).

[0006] In this embodiment, when the system configuration of an electronic device changes and the changed system configuration attribute is the target system configuration attribute, system configuration information is dispatched to the application process that meets the first priority condition, thereby reducing the number of application processes responding to system configuration changes in a short period of time, and thus reducing the system load.

[0007] In one embodiment, the method further includes: when it is determined that the changed system configuration attribute in the system configuration information is the target system configuration attribute, and the process level of the current application process meets the second priority condition, adding the current application process to the priority process list, pausing the dispatch of system configuration information, and setting the dispatch status of the current application process to the blocked dispatch status.

[0008] In this embodiment, when the system configuration of an electronic device changes and the changed system configuration attribute is the target system configuration attribute, for application processes that meet the second priority condition, they are added to the priority process list, so that when the scenario meets the resumption dispatch condition, system configuration information is resumed to them.

[0009] In another embodiment, the process level of the current application process satisfying the first priority condition includes: the process state value of the current application process is less than or equal to the foreground level process state value. Furthermore, when the process state value of the current application process is the resident level process state value, the current application process is a target resident level process.

[0010] The target persistent-level processes include the System process, SystemUI process, and desktop process. The foreground-level process state value corresponds to the process state value corresponding to the PROCESS_STATE_BOUND_TOP attribute in the process state attributes. The persistent-level process state value corresponds to the process state value corresponding to the PROCESS_STATE_PERSISTENT attribute in the process state attributes.

[0011] In this embodiment, the process state value of the application process is used to characterize the process level, and the process state value corresponds to the process state attribute.

[0012] In another embodiment, the process level of the current application process satisfies the second priority condition as follows: the process state value of the current application process is greater than the foreground level process state value and less than the cache level process state value. Alternatively, when the process state value of the current application process is the resident level process state value, the current application process is not the target resident level process.

[0013] Among them, the cache-level process status value is the process status value corresponding to the PROCESS_STATE_CACHED_ACTIVITY attribute.

[0014] In another embodiment, the method further includes: when it is determined that the animation playback is complete, traversing the priority process list; switching the dispatch state of the application processes in the priority process list to an unblocked dispatch state; and dispatching system configuration information to the application processes in the priority process list.

[0015] In this embodiment, the completion of animation playback is used as the scenario to trigger the recovery dispatch mechanism. Once it is determined that the animation playback is complete, system configuration information is dispatched to application processes in the priority process list.

[0016] In another embodiment, the method further includes: when a window is determined to be drawn, traversing the foreground process list; when the application process corresponding to the window is determined to be in the foreground process list, deleting the application process corresponding to the window from the foreground process list; when the foreground process list is determined to be empty and the application process corresponding to the window is in a blocked dispatch state, switching the dispatch state of the application process corresponding to the window to a non-blocked dispatch state, and dispatching system configuration information to the application process corresponding to the window.

[0017] In this embodiment, the scenario where the foreground windows have been drawn is used as the trigger for the resumption dispatch mechanism. Once it is determined that all foreground windows have been drawn and the application process corresponding to the window is in a blocked dispatch state, the dispatch of system configuration information to the application process resumes.

[0018] In another embodiment, the method further includes: obtaining process state information of the current application process, the process state information being used to indicate the process level of the current application process. When it is determined that the current application process is in a blocked dispatch state and the process level of the current application process meets the first priority condition, the dispatch state of the current application process is switched to an unblocked dispatch state, and system configuration information is dispatched to the current application process.

[0019] In this embodiment, the process level of an application process in a blocked dispatch state is determined to be raised to the highest level by checking whether its process level meets the first priority condition. Once it is determined that the application process's process level has been raised to the highest level, system configuration information dispatch to the application process resumes.

[0020] In another embodiment, the target system configuration attributes include font scale, screen orientation, screen color mode, display mode, screen width (screenWidthDp), screen height (screenHeightDp), font weight (fontWeightAdjustment), and language list (mLocaleList).

[0021] In another embodiment, the method further includes: when it is determined that the changed system configuration attribute in the system configuration information is the target system configuration attribute, and the process level of the current application process meets the third priority condition, suspending the dispatch of system configuration information and setting the dispatch status of the current application process to the blocked dispatch status.

[0022] In another embodiment, the process level of the current application process satisfies the third priority condition, which includes: the process state value of the current application process is greater than or equal to the cache level process state value.

[0023] In this embodiment, application processes are categorized into three levels: application processes meeting the first priority condition are considered the highest-level processes, those meeting the second priority condition are considered higher-level processes, and those meeting the third priority condition are considered lower-level processes. For the highest-level processes, system configuration information is dispatched first. For higher-level processes, the dispatch of system configuration information is temporarily suspended, but the dispatch of system configuration information will be guaranteed in the subsequent resumption dispatch mechanism. For lower-level processes, the dispatch of system configuration information is temporarily suspended, and the dispatch of system configuration information may not be required in the subsequent resumption dispatch mechanism.

[0024] A second aspect of this application provides an electronic device including a memory and a processor, which implements the information processing method provided in the first aspect when the processor executes computer instructions stored in the memory.

[0025] A third aspect of this application provides a computer-readable storage medium storing computer instructions thereon, which, when executed by a processor, implements the information processing method provided in the first aspect.

[0026] A fourth aspect of this application provides a computer program product including computer instructions, which implement the information processing method provided in the first aspect when the processor executes the computer instructions.

[0027] It is understood that the beneficial effects of the electronic device provided in the second aspect of the embodiments of this application, the computer-readable storage medium provided in the third aspect, and the computer program product provided in the fourth aspect are substantially the same as the beneficial effects of the information processing method provided in the first aspect, and will not be repeated here. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of the software structure of an electronic device provided as an example.

[0029] Figure 2 This is an example of a mobile phone screen rotation scenario.

[0030] Figure 3 This is a sequence diagram of an example information processing method.

[0031] Figure 4 It is a table showing the mapping between Procstate properties and Procstate values ​​provided in the example.

[0032] Figure 5 This is a sequence diagram of another example of an information processing method.

[0033] Figure 6 This is a sequence diagram of another example of an information processing method.

[0034] Figure 7 This is a sequence diagram of another example of an information processing method.

[0035] Figure 8 This is a sequence diagram of another example of an information processing method.

[0036] Figure 9 This is a sequence diagram of another example of an information processing method.

[0037] Figure 10 This is a flowchart illustrating an example of an information processing method.

[0038] Figure 11 This is a schematic diagram of the hardware structure of an electronic device provided as an example. Detailed Implementation

[0039] It should be noted that in the embodiments of this application, "multiple" refers to two or more. The terms "first," "second," "third," "fourth," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence. The methods disclosed in the embodiments of this application, or the methods shown in the flowcharts, include one or more steps for implementing the method. Without departing from the scope of the claims, the execution order of multiple steps can be interchanged, and some steps can also be deleted.

[0040] In this application embodiment, the electronic device includes, but is not limited to, smartphones, tablets, handheld computers, laptops, intelligent robots, drones, mobile internet devices (MIDs), virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, Session Initiation Protocol (SIP) phones, Wireless Local Loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to a wireless modem, in-vehicle devices, wearable devices, terminal devices in 5G networks, or Public Land Mobile (PLT) networks. Terminal devices in a network (PLMN).

[0041] The software system of the electronic device is described in detail below.

[0042] The software system of electronic devices can adopt a layered architecture. A layered architecture divides the software into several layers, each with a clear role and function, and the layers communicate with each other through software interfaces. Taking the Android system as an example... Figure 1As shown, the software system of an electronic device is divided into four layers, from top to bottom: Application (APP) layer, Framework (FWK) layer, Android Runtime and system library, and Kernel layer.

[0043] The application layer comprises a suite of application packages. These application packages include, but are not limited to, calling, SMS, camera, gallery, browser, maps, music, and video.

[0044] The framework layer provides application programming interfaces (APIs) and programming frameworks for various apps in the application layer. The framework layer includes the activity manager, window manager, and application manager.

[0045] The Activity Manager Service (AMS) provides the Activity Management Service, which manages the activities of an application process throughout its lifecycle. The Activity Management Service includes, but is not limited to, service management, broadcast management, content provider management, memory management, and process management.

[0046] The Activity Manager includes Activity, Service, Broadcast, and ContentProvider components. The Activity component displays the user interface and handles user interactions. The Service component executes long-running background tasks. The Broadcast component receives and processes broadcast messages. The ContentProvider component shares data between different apps.

[0047] The window manager provides window management services (WMS), which manage the windows of an application process throughout its lifecycle. Window management services include, but are not limited to, configuration management, window model tree management, basic window management, typical window management, and multi-window management. Typical window management includes, but is not limited to, input method management, wallpaper management, lock screen management, and inset window management.

[0048] The window manager consists of the window management core (WM core) and the window management shell (WM shell).

[0049] WM Core is the core component of the window manager, handling core tasks such as window creation, destruction, movement, resizing, and stacking order. WM Core includes the Activity Task Manager Service (AMTS) component, the Root Window Container component, and the Window Process Controller component. The AMTS component handles user input events (such as touch, click, or key presses) and system events (such as window closing, minimizing, or maximizing). The Root Window Container component is the root node of all windows, managing the layout and hierarchy of all windows. The Window Process Controller component controls the application processes associated with windows.

[0050] The WM shell provides an interactive interface for users. It includes a Transition component, which manages animation transitions between windows.

[0051] The application manager encompasses the application processes of various apps. It provides an application management service, which manages the lifecycle of application processes. This service includes, but is not limited to, resource management, application framework management, view framework management, and UI rendering management.

[0052] The Android Runtime is used for scheduling and management of the Android system. The Android Runtime consists of core libraries and a Virtual Machine (VM). The core libraries contain various functionalities. The VM provides a runtime environment for various applications at the application layer and various programming frameworks at the framework layer.

[0053] The system library includes, but is not limited to, a graphics engine, a surfaceflinger, and a media library. The graphics engine is used for 2D or 3D graphics rendering. Surfaceflinger is used for image rendering and layer processing. The media library supports various encoding formats for audio, video, and image files, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0054] The kernel layer is used to execute various application functions and data processing. The kernel layer includes processor drivers, sensor drivers, and display drivers. Processor drivers control the processor to implement various processing algorithms. Sensor drivers control the sensors to collect various data. Display drivers control the display screen to show the application interface.

[0055] In the aforementioned software system, when an electronic device launches an app, it creates an application process corresponding to the app through the application manager and loads an activity through the activity manager. An activity is used to display the application interface and handle user interaction logic. Loading an activity refers to the process from launching the activity to the completion of its lifecycle. When loading an activity, the electronic device creates a window object for the activity through the window manager. The window object assists the activity in managing the view of the application interface.

[0056] The window manager creates window objects based on system configuration information, which includes system configuration attributes. For example, system configuration attributes include: Mobile Country Code (mcc), Mobile Network Code (mnc), Font Scale (fontScale), Screen Layout Type (screenLayout), Touchscreen Type (touchscreen), Keyboard Type (keyboard, such as a hard keyboard or soft keyboard), Keyboard Display Status (keyboardHidden), Navigation Button Type (navigation, such as a scroll ball or arrow keys), Navigation Button Display Status (navigationHidden), Screen Orientation, Screen Color Mode (colorMode), Display Mode (uiMode, such as in-car mode, dock mode, or night mode), Screen Width (screenWidthDp), Screen Height (screenHeightDp), Minimum Screen Width (smallestScreenWidthDp), Screen Density (densityDpi), Serial Number (assetsSeq), Window Basic Information (windowConfiguration), Font Weight (fontWeightAdjustment), and Language List (mLocaleList).

[0057] During the application process's lifecycle, system configuration information may change, such as screen orientation rotation, dark mode switching, language switching, font switching, and screen switching when the screen is folded. When the window manager detects a system configuration change, it updates the system configuration information and dispatches it to all virtual machine processes and the window objects corresponding to those virtual machine processes. After receiving the system configuration information, the virtual machine process applies it to its process context (ProcessContext), thereby loading application resources and refreshing the application interface. After receiving the system configuration information, the window object updates its system configuration attributes, such as adjusting the screen size and orientation. Taking the scenario of rotating a mobile phone screen as an example, ... Figure 2 As shown, when a user rotates the screen orientation from portrait to landscape while playing a video on the phone, a system configuration change is triggered, and the size and orientation of the video playback interface change accordingly.

[0058] In this embodiment, based on the runtime environment, application processes include native processes and virtual machine processes. Native processes run on the Linux kernel. Virtual machine processes run within the Android Runtime virtual machine. Based on function and purpose, application processes include system processes, foreground processes, and background processes. System processes are created and managed by the operating system and are used to perform system-level tasks. Foreground processes interact with the user. Background processes perform auxiliary tasks in the background without interacting with the user. Auxiliary tasks include, but are not limited to, data synchronization, file downloading, and timing.

[0059] During the process of the window manager distributing system configuration information, if a large number of application processes are responding to system configuration changes, the system load can increase rapidly within a short period. This may cause application processes to compete for system resources, resulting in insufficient system resource supply for some services and thus affecting the user experience. For example, insufficient CPU resource supply during the foreground interface rendering process, animation process, or background music playback process may cause slow loading of the foreground interface, stuttering of animations, or stuttering of background music playback.

[0060] Based on this, embodiments of this application provide an information processing method that determines a dispatch mechanism according to the process level of the application process, dispatches system configuration information to application processes with higher process levels, thereby reducing the number of application processes responding to system configuration changes and thus reducing system load.

[0061] The following section describes information processing methods in conjunction with the software systems of electronic devices.

[0062] For example, such as Figure 3 As shown, the information processing method includes the following steps:

[0063] S101. When the AMTS component of WM core determines that the system configuration has changed, it updates the system configuration information.

[0064] In this embodiment, the AMTS component determines whether the system configuration has changed by monitoring data collected by sensors. When the AMTS component detects a change in the sensor data, it determines that the system configuration has changed. The AMTS component then updates the system configuration information by calling the updateConfiguration method.

[0065] For example, when a user rotates the screen of an electronic device, the AMTS component detects a change in the data from the gyroscope sensor, calculates the screen orientation change data based on the gyroscope sensor data, and then updates the system configuration information based on the screen orientation change data.

[0066] S102, the AMTS component traverses all virtual machine processes and sends system configuration information to the WindowProcess Controller component corresponding to each virtual machine process.

[0067] S103, The Window Process Controller component determines whether the current virtual machine process's process state (Procstate) value is greater than or equal to the cache-level process state value.

[0068] If yes, proceed to step S104; otherwise, proceed to step S105.

[0069] In this embodiment, if the process state value of the current virtual machine process is greater than or equal to the cache-level process state value, it indicates that the process level of the virtual machine process is low. If the process state value of the current virtual machine process is less than the cache-level process state value, it indicates that the process level of the virtual machine process is high.

[0070] The Procstate value of a virtual machine process corresponds to the Procstate attribute, which is determined by the Activity, Service, Broadcast, or ContentProvider components of the Activity Manager. The Procstate value reflects the process level, and its magnitude is negatively correlated with the process level. The cache-level process state value corresponds to the Procstate value of the PROCESS_STATE_CACHED_ACTIVITY attribute. When the Procstate attribute of a virtual machine process is PROCESS_STATE_CACHED_ACTIVITY, it indicates that the virtual machine process is a process that has cached Activities.

[0071] For example, such as Figure 4 As shown, the Procstate attribute includes the PROCESS_STATE_CACHED_ACTIVITY attribute. The Procstate value corresponding to the PROCESS_STATE_CACHED_ACTIVITY attribute is 16, which means the cache-level process state value is 16.

[0072] S104 The Window Process Controller component pauses the dispatch of system configuration information and sets the dispatch status of the current virtual machine process to blocked dispatch status.

[0073] In this embodiment, the virtual machine process's attributes include a pause dispatch flag. The pause dispatch flag identifies the virtual machine process's dispatch state, reflecting whether system configuration information is being dispatched to the virtual machine process. The virtual machine process's dispatch state includes a blocked dispatch state and a non-blocked dispatch state. For example, when the pause dispatch flag is "true", it indicates that the virtual machine process is in a blocked dispatch state. When the pause dispatch flag is "false", it indicates that the virtual machine process is in a non-blocked dispatch state.

[0074] S105. The Window Process Controller component dispatches system configuration information to the ActivityThread of the current virtual machine process.

[0075] In this embodiment, the Window Process Controller component dispatches system configuration information by calling the scheduleTransaction method.

[0076] It is understood that in this embodiment, the dispatch mechanism is determined based on the process level of the virtual machine process. Whether to postpone the dispatch of system configuration information is determined by checking whether the ProcState value of the virtual machine process is greater than or equal to the cache-level process state value. By postponing the dispatch of system configuration information to virtual machine processes with lower process levels, the number of application processes responding to system configuration changes within a short period is reduced, thereby lowering the system load.

[0077] For virtual machine processes that have temporarily suspended the dispatch of system configuration information, the dispatch of system configuration information can be resumed once their process level is elevated. The following is based on... Figure 3 The distribution mechanism shown is described in detail, and the distribution mechanism is restored.

[0078] For example, such as Figure 5 As shown, the information processing method includes the following steps:

[0079] S201. The OamAdjuster component of the Activity Manager sends the process status information of the current virtual machine process to the Window Process Controller component.

[0080] In this embodiment, the OamAdjuster component is used to manage the priority, hierarchy, and resource allocation of windows. The OamAdjuster component sends the process state information of the current virtual machine process by calling the setReportedProcState method, and the process state information includes the ProcState value.

[0081] S202, The Window Process Controller component determines whether the current virtual machine process is in a blocked dispatch state.

[0082] If yes, proceed to step S203; otherwise, end. End means not continuing with subsequent steps.

[0083] In this embodiment, if the current virtual machine process is in a blocked dispatch state, it indicates that system configuration information has not been dispatched to the current virtual machine process. If the current virtual machine process is in a non-blocked dispatch state, it indicates that system configuration information has been dispatched to the current virtual machine process.

[0084] S203, The Window Process Controller component determines whether the ProcState value of the current virtual machine process is less than the cache-level process state value.

[0085] If yes, proceed to steps S204-S205; otherwise, end.

[0086] S204, The Window Process Controller component switches the dispatch state of the current virtual machine process to an unblocked dispatch state.

[0087] S205, The Window Process Controller component dispatches system configuration information to the Activity Thread of the current virtual machine process.

[0088] In this embodiment, the process level of a virtual machine process is determined to be raised to a higher level by checking whether the ProcState value of the virtual machine process in the blocked dispatch state is less than the cache-level process state value. When it is determined that the process level of the virtual machine process has been raised to a higher level, the dispatch of system configuration information to the virtual machine process is resumed.

[0089] In the above embodiments, using cache-level process status values ​​as the basis for determining process priority reduces the number of application processes responding to system configuration changes within a short period. However, the large number of virtual machine processes with higher process priorities still results in a relatively high system load. To further reduce system load, another dispatch mechanism is described below.

[0090] For example, such as Figure 6 As shown, the information processing method includes the following steps:

[0091] S301. When the AMTS component of WM core determines that the system configuration has changed, it updates the system configuration information.

[0092] S302, the AMTS component traverses all virtual machine processes and sends system configuration information to the WindowProcess Controller component corresponding to each virtual machine process.

[0093] S303, the Window Process Controller component determines the system configuration attribute that has changed in the system configuration information as the target system configuration attribute.

[0094] In this embodiment, the target system configuration attributes are those that affect the display of the front-end interface, i.e., the system configuration attributes that the user can intuitively perceive through the front-end interface. For example, the target system configuration attributes include font scale, screen orientation, screen color mode, display mode, screen width (screenWidthDp), screen height (screenHeightDp), font weight (fontWeightAdjustment), and language list (mLocaleList).

[0095] The Window Process Controller component determines whether a changed system configuration attribute in the system configuration information is a target system configuration attribute based on the target system configuration attribute list, which stores all target system configuration attributes.

[0096] When the Window Process Controller component determines that the system configuration property that has changed in the system configuration information is the target system configuration property, it executes step S304.

[0097] When the Window Process Controller component determines that a changed system configuration property in the system configuration information is not the target system configuration property, it executes... Figure 3 The distribution mechanism is shown.

[0098] S304, the Window Process Controller component determines whether the process level of the current virtual machine process meets the first priority condition.

[0099] If yes, proceed to step S305; otherwise, proceed to step S306.

[0100] In this embodiment, the process level of a virtual machine process satisfying the first priority condition includes: the ProcState value of the virtual machine process is less than or equal to the foreground level process state value, and the virtual machine process is a target persistent level process when the ProcState value of the virtual machine process is a persistent level process. The target persistent level processes include the SystemUI process, the System process, and the desktop process.

[0101] The foreground-level process state value corresponds to the Procstate value in the Procstate attribute. When the virtual machine process's Procstate attribute is PROCESS_STATE_BOUND_TOP, it indicates that the virtual machine process is a process bound to a foreground Activity.

[0102] The state value of a resident process is the same as the Procstate value corresponding to the PROCESS_STATE_PERSISTENT attribute in the Procstate property. When the Procstate attribute of a virtual machine process is PROCESS_STATE_PERSISTENT, it indicates that the virtual machine process is a continuously running process.

[0103] For example, see also Figure 4The Procstate attribute includes the PROCESS_STATE_PERSISTENT and PROCESS_STATE_BOUND_TOP attributes. A Procstate value of 0 corresponds to the PROCESS_STATE_PERSISTENT attribute, indicating a resident process state of 0. A Procstate value of 3 corresponds to the PROCESS_STATE_BOUND_TOP attribute, indicating a foreground process state of 3.

[0104] S305, the Window Process Controller component dispatches system configuration information to the Activity Thread of the current virtual machine process.

[0105] S306, The Window Process Controller component determines whether the process level of the current virtual machine process meets the second priority condition.

[0106] If yes, proceed to steps S307-S309; ​​otherwise, proceed to step S309.

[0107] In this embodiment, the process level of the virtual machine process satisfies the second priority condition as follows: the Procstate value of the virtual machine process is greater than the foreground level process state value and less than the cache level process state value, or the virtual machine process is not the target resident level process when the Procstate value of the virtual machine process is the resident level process state value.

[0108] S307, the Window Process Controller component sends a delay dispatch message to the AMTS component.

[0109] The "Delay Dispatch" message is used to notify users to temporarily delay the dispatch of system configuration information to the current virtual machine process.

[0110] In response to the delayed dispatch message, the S308 and AMTS components add the current virtual machine process to the priority process list.

[0111] In this embodiment, the priority process list is used to store virtual machine processes that meet the second priority condition.

[0112] S309, the Window Process Controller component pauses the dispatch of system configuration information and sets the dispatch status of the current virtual machine process to blocked dispatch status.

[0113] In this embodiment, the dispatch mechanism is determined based on the changed system configuration attributes and process levels in the system configuration information. When the changed system configuration attribute in the system configuration information is the target system configuration attribute, the virtual machine processes are divided into three levels based on a first priority condition and a second priority condition. Virtual machine processes that meet the first priority condition are the highest-level processes, virtual machine processes that meet the second priority condition are higher-level processes, and all other virtual machine processes are lower-level processes. For the highest-level processes, system configuration information is dispatched first. For higher-level processes, the dispatch of system configuration information is temporarily suspended, but the dispatch of system configuration information is guaranteed to be provided to them in the subsequent recovery dispatch mechanism. For lower-level processes, the dispatch of system configuration information is temporarily suspended, but the dispatch of system configuration information may not be provided to them in the subsequent recovery dispatch mechanism. Since the number of highest-level processes is relatively small, the number of application processes responding to system configuration changes in a short period of time is further reduced, thereby significantly reducing the system load.

[0114] For virtual machine processes that temporarily delay the dispatch of system configuration information, failure to dispatch system configuration information to higher-level processes for an extended period may cause foreground process lag. To ensure that system configuration information is dispatched to higher-level processes, the following is based on... Figure 6 The distribution mechanism shown is described in detail, and the distribution mechanism is restored.

[0115] For example, such as Figure 7 As shown, the information processing method includes the following steps:

[0116] S401 and WMS confirm that the animation playback is complete.

[0117] In this embodiment, when WMS receives a motion effect playback completion message from WM shell, it determines that the motion effect playback on the foreground interface is complete. The motion effect playback completion message is used to notify the foreground interface that the motion effect playback is complete.

[0118] S402 and WMS send a motion effect playback completion message to the ATMS component.

[0119] In response to the animation playback completion message, the S403 and ATMS components traverse the priority process list and send a recovery dispatch message to the Window Process Controller component corresponding to each virtual machine process in the priority process list.

[0120] The recovery dispatch message is used to notify the system of the recovery dispatch configuration information.

[0121] S404, the Window Process Controller component switches the dispatch state of the current virtual machine process to an unblocked dispatch state.

[0122] In this embodiment, the current virtual machine process is the process that has completed the animation playback.

[0123] S405, the Window Process Controller component dispatches system configuration information to the Activity Thread of the current virtual machine process.

[0124] In this embodiment, the completion of animation playback is used as the scenario to trigger the recovery dispatch mechanism. Once it is determined that the animation playback is complete, system configuration information is dispatched to virtual machine processes in the priority process list.

[0125] It is understandable that the scenario that triggers the recovery distribution mechanism is not limited to the scenario where the animation playback is completed. The recovery distribution mechanism in another scenario is described in detail below.

[0126] For example, such as Figure 8 As shown, the information processing method includes the following steps:

[0127] S501, WMS confirms that a window has been drawn.

[0128] In this embodiment, when WMS receives a window drawing complete message from the virtual machine process, it determines that the window drawing is complete. The window drawing complete message is used to notify that the window drawing is finished.

[0129] S502, WMS sends a window drawing completion message to the ATMS component.

[0130] In response to the window drawing completion message, the S503 and ATMS components traverse the foreground process list to determine whether the virtual machine process corresponding to the window is in the foreground process list.

[0131] If yes, proceed to steps S504-S505; otherwise, end.

[0132] In this embodiment, the foreground process list is used to store foreground processes. If the virtual machine process corresponding to the window is in the foreground process list, it indicates that it is a foreground process.

[0133] S504, the ATMS component removes the virtual machine process corresponding to the window from the foreground process list.

[0134] The S505 and ATMS components determine whether the foreground process list is empty.

[0135] If yes, proceed to steps S506-S507; otherwise, end.

[0136] In this embodiment, if the foreground process list is empty, it indicates that all foreground windows have been drawn.

[0137] S506, the ATMS component sends a recovery dispatch message to the Window Process Controller component corresponding to the current virtual machine process.

[0138] In this embodiment, the current virtual machine process is the process that has completed the window drawing, that is, the virtual machine process corresponding to the window.

[0139] The S507 Window Process Controller component determines whether the current virtual machine process is in a blocked dispatch state.

[0140] If yes, proceed to steps S508-S509; otherwise, end.

[0141] In this embodiment, if the current virtual machine process is a foreground process and it is in a blocked dispatch state, it indicates that it is a virtual machine process that meets the second priority condition.

[0142] The S508 Window Process Controller component switches the dispatch state of the current virtual machine process to an unblocked dispatch state.

[0143] S509, the Window Process Controller component dispatches system configuration information to the Activity Thread of the current virtual machine process.

[0144] In this embodiment, the scenario where the foreground windows have been drawn is used as the scenario that triggers the resumption dispatch mechanism. When it is determined that all foreground windows have been drawn and the virtual machine process corresponding to the window is in a blocked dispatch state, the dispatch of system configuration information to the virtual machine process corresponding to the window is resumed.

[0145] It is understandable that the scenarios that trigger the recovery dispatch mechanism can also include process-level promotion scenarios. The recovery dispatch mechanism under process-level promotion scenarios is described in detail below.

[0146] For example, such as Figure 9 As shown, the information processing method includes the following steps:

[0147] The S601 and OamAdjuster components send the process status information of the current virtual machine process to the Window Process Controller component.

[0148] S602, the Window Process Controller component determines whether the current virtual machine process is in a blocked dispatch state.

[0149] If yes, proceed to step S603; otherwise, end.

[0150] The S603 Window Process Controller component determines whether the process level of the current virtual machine process meets the first priority condition.

[0151] If yes, proceed to steps S604-S605; otherwise, end.

[0152] The S604 Window Process Controller component switches the dispatch state of the current virtual machine process to an unblocked dispatch state.

[0153] S605, the Window Process Controller component dispatches system configuration information to the Activity Thread of the current virtual machine process.

[0154] In this embodiment, the process level of a virtual machine process in a blocked dispatch state is determined to be raised to the highest level by checking whether its process level meets the first priority condition. Once it is determined that the virtual machine process's process level has been raised to the highest level, the dispatch of system configuration information to the virtual machine process resumes.

[0155] The above provides a detailed explanation of information processing methods in conjunction with the software system of electronic devices. The following section describes in detail the process of applying information processing methods to electronic devices.

[0156] For example, such as Figure 10 As shown, the information processing method includes the following steps:

[0157] S701, In response to changes in system configuration, update system configuration information.

[0158] S702. Determine whether the system configuration attributes that have changed in the system configuration information are the target system configuration attributes.

[0159] If yes, proceed to step S703; otherwise, proceed to step S704.

[0160] S703. Determine whether the process level of the current application process meets the first priority condition.

[0161] If yes, proceed to step S705; otherwise, proceed to step S706.

[0162] In this embodiment, the application process's process level satisfying the first priority condition includes: the application process's ProcState value is less than or equal to the foreground level process state value, and the application process is a target persistent level process when the application process's ProcState value is a persistent level process state value. The target persistent level processes include the SystemUI process, the System process, and the desktop process.

[0163] S704. Determine whether the ProcState value of the current application process is less than the cache-level process state value.

[0164] If yes, proceed to step S705; otherwise, proceed to step S708.

[0165] S705: Dispatch system configuration information to the current application process.

[0166] S706. Determine whether the process level of the current application process meets the second priority condition.

[0167] If yes, proceed to steps S707-S708; otherwise, proceed to step S708.

[0168] In this embodiment, the application process's process level satisfying the second priority condition includes: the application process's Procstate value is greater than the foreground level process state value and less than the cache level process state value, or the application process is not the target persistent level process when the application process's Procstate value is the persistent level process state value.

[0169] S707. Add the current application process to the priority process list.

[0170] S708, Pause the dispatch of system configuration information and set the dispatch status of the current application process to blocked dispatch status.

[0171] In this embodiment, the dispatch mechanism is determined based on the changed system configuration attributes and process level in the system configuration information. Application processes are categorized into three levels based on a first priority condition and a second priority condition. Application processes meeting the first priority condition are considered highest-level processes, those meeting the second priority condition are considered higher-level processes, and all other application processes are considered lower-level processes. For highest-level processes, system configuration information is dispatched first. For higher-level processes, the dispatch of system configuration information is temporarily suspended, but the dispatch of system configuration information is guaranteed to be provided to them in a subsequent resumption dispatch mechanism. For lower-level processes, the dispatch of system configuration information is temporarily suspended, but the dispatch of system configuration information may not be provided to them in a subsequent resumption dispatch mechanism. This reduces the number of application processes responding to system configuration changes within a short period, thereby reducing system load.

[0172] The hardware structure of the electronic device is described in detail below.

[0173] like Figure 11As shown, the electronic device includes 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, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, 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.

[0174] Processor 110 is used to execute the various functions or steps performed by the electronic device in the above embodiments. Processor 110 includes a Central Processing Unit (CPU) and a Graphics Processing Unit (GPU). The CPU is used to handle control logic and serial computing tasks. The GPU is used to handle image algorithm logic and parallel computing tasks. In some embodiments, processor 110 also includes a Neural-network Processing Unit (NPU), an Application Processor (AP), an Image Signal Processor (ISP), a Digital Signal Processor (DSP), a modem processor, and a video codec.

[0175] The external memory interface 120 is used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to perform data storage functions.

[0176] Internal memory 121 stores executable program code, including instructions. Processor 110 executes the various functions or steps performed by the electronic device in the above embodiments by running the instructions stored in internal memory 121. Internal memory 121 includes a program storage area and a data storage area. The program storage area may store the operating system, at least one application required for a function, etc. The data storage area may store data created during the use of the electronic device. 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 device, and Universal Flash Storage (UFS), etc.

[0177] The sensor module 180 includes, but is not limited to, pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and bone conduction sensors.

[0178] Display screen 194 is used to display an interface. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), a light-emitting diode (LED), or an organic light-emitting diode (OLED), etc.

[0179] If the display screen 194 integrates a touch sensor, then the display screen 140 can be referred to as a touch screen. The touch sensor can also be called a "touch panel." That is, the display screen 194 may include a display panel and a touch panel. The touch sensor is used to detect touch operations applied to or near it. After detecting a touch operation, it triggers the driver of the kernel layer of the electronic device to periodically scan the touch parameters generated by the touch operation. Then, the driver of the kernel layer sends the touch parameters to the relevant modules in the upper layer so that the relevant modules can determine the touch event corresponding to the touch parameters.

[0180] Electronic devices can achieve display functions through GPUs, displays, and APs.

[0181] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements.

[0182] The functions or steps performed by the electronic device in the above embodiments can also be applied to chips, computer-readable storage media, or computer program products.

[0183] The chip includes a processor and an interface circuit, with the processor and interface circuit electrically connected. The interface circuit can read computer instructions stored in the memory and send the computer instructions to the processor. When the processor executes the computer instructions, it implements the various functions or steps performed by the electronic device in the above embodiments.

[0184] The computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the various functions or steps performed by the electronic device in the above embodiments.

[0185] Computer-readable storage media include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer-readable storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer.

[0186] The computer program product includes computer instructions, which, when executed by a processor, implement the various functions or steps performed by the electronic device in the above embodiments.

[0187] The embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of this application.

Claims

1. An information processing method applied to electronic devices, characterized in that, The method includes: In response to changes in system configuration, update system configuration information; When it is determined that the changed system configuration attribute in the system configuration information is the target system configuration attribute, and the process level of the current application process meets the first priority condition, the system configuration information is dispatched to the current application process; the target system configuration attribute is the system configuration attribute that affects the display of the foreground interface.

2. The information processing method as described in claim 1, characterized in that, The method further includes: When it is determined that the changed system configuration attribute in the system configuration information is the target system configuration attribute, and the process level of the current application process meets the second priority condition, the current application process is added to the priority process list, the dispatch of the system configuration information is paused, and the dispatch status of the current application process is set to the blocked dispatch status.

3. The information processing method as described in claim 1, characterized in that, The process level of the current application process that meets the first priority condition includes: The process state value of the current application process is less than or equal to the foreground level process state value; and when the process state value of the current application process is the resident level process state value, the current application process is the target resident level process. The target persistent-level processes include the System process, the SystemUI process, and the desktop process; the foreground-level process status value is the process status value corresponding to the PROCESS_STATE_BOUND_TOP attribute in the process status attributes; and the persistent-level process status value is the process status value corresponding to the PROCESS_STATE_PERSISTENT attribute in the process status attributes.

4. The information processing method as described in claim 2, characterized in that, The process level of the current application process that meets the second priority condition includes: The process state value of the current application process is greater than the foreground level process state value and less than the cache level process state value; or, when the process state value of the current application process is the resident level process state value, the current application process is not the target resident level process. The target persistent-level processes include the System process, the SystemUI process, and the desktop process; the foreground-level process status value is the process status value corresponding to the PROCESS_STATE_BOUND_TOP attribute in the process status attributes; the cache-level process status value is the process status value corresponding to the PROCESS_STATE_CACHED_ACTIVITY attribute; and the persistent-level process status value is the process status value corresponding to the PROCESS_STATE_PERSISTENT attribute.

5. The information processing method as described in claim 2 or 4, characterized in that, The method further includes: Once the animation playback is complete, iterate through the priority process list; The dispatch status of the application processes in the priority process list is switched to an unblocked dispatch status, and the system configuration information is dispatched to the application processes in the priority process list.

6. The information processing method as described in claim 2 or 4, characterized in that, The method further includes: Once a window is confirmed to be drawn, iterate through the list of foreground processes. When it is determined that the application process corresponding to the window is in the foreground process list, the application process is deleted from the foreground process list. When it is determined that the foreground process list is empty and the application process is in the blocked dispatch state, the dispatch state of the application process is switched to the unblocked dispatch state, and the system configuration information is dispatched to the application process.

7. The information processing method as described in claim 2 or 4, characterized in that, The method further includes: Obtain the process status information of the current application process, wherein the process status information is used to indicate the process level of the current application process; When it is determined that the current application process is in the blocked dispatch state and the process level of the current application process meets the first priority condition, the dispatch state of the current application process is switched to the non-blocked dispatch state, and the system configuration information is dispatched to the current application process.

8. The information processing method as described in claim 1 or 2, characterized in that, The target system configuration attributes include font size, screen orientation, screen color mode, display mode, screen width, screen height, font weight, and language list.

9. The information processing method as described in claim 2 or 4, characterized in that, The method further includes: When it is determined that the changed system configuration attribute in the system configuration information is the target system configuration attribute, and the process level of the current application process meets the third priority condition, the dispatch of the system configuration information is suspended, and the dispatch status of the current application process is set to blocked dispatch status.

10. The information processing method as described in claim 9, characterized in that, The process level of the current application process that meets the third priority condition includes: The process state value of the current application process is greater than or equal to the cache-level process state value; The cache-level process status value is the process status value corresponding to the PROCESS_STATE_CACHED_ACTIVITY attribute.

11. An electronic device, characterized in that, It includes a memory and a processor, which implements the information processing method as described in any one of claims 1-10 when the processor executes computer instructions stored in the memory.

12. A computer-readable storage medium, characterized in that, It stores computer instructions, which, when executed by the processor, implement the information processing method as described in any one of claims 1-10.