Control method and apparatus for application execution, electronic device, and storage medium
By switching sensor control to the matching operating system based on conditions during application operation, the problem of power consumption and performance balance that small-core systems cannot meet is solved, achieving a balance between high-precision computing and low power consumption, and improving the stability and battery life of the application.
Patent Information
- Application Number
- CN202110511886.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-11
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2041-08-10
AI Technical Summary
In existing application operation control methods, motion and health algorithms and sensors rely on small core systems, which makes it impossible to achieve a balance between power consumption and performance, especially when the computing power is insufficient for high-frequency data processing.
By responding to application-triggered operations, the control of the sensor is switched to the matching target operating system according to the operating conditions. Sensor data is then acquired and processed under the target operating system, achieving a balance between power consumption and performance.
It enables flexible switching of sensor control according to application requirements, achieving a balance between high-precision computing and low power consumption, and improving the stability and battery life of the application.
Smart Images

Figure CN115328586B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and computer-readable storage medium for controlling the operation of an application. Background Technology
[0002] With the development of computer technology, mobile terminals are becoming increasingly diverse in function and type, including various personal computers, laptops, smartphones, tablets, and portable wearable devices. Wearable devices also offer increasingly diversified intelligent services, providing users with a wide range of feature-rich applications, such as fitness and health apps that monitor steps and speed, as well as ECG sensor testing apps.
[0003] However, in the current control methods for running applications, most motion and health algorithms and sensors rely on small core systems. Although small core systems have strong battery life, their computing power is weak and cannot meet the balance between power consumption and performance for running applications. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and computer-readable storage medium for controlling the operation of an application, which can achieve a balance between power consumption and performance during application operation.
[0005] A method for controlling the operation of an application, applied to an electronic device, the method comprising:
[0006] In response to a triggering operation on the target application, the target application is run;
[0007] Based on the operating conditions of the target application, the control of the sensor corresponding to the target application is switched to the target operating system that matches the operating conditions;
[0008] Under the target operating system, the data output by the sensor is acquired, the data is processed to obtain the corresponding processing result, and the processing result is transmitted to the target application.
[0009] A control device for running an application, the device comprising:
[0010] The execution module is used to run the target application in response to a trigger operation on the target application;
[0011] The switching module is used to switch the control of the sensor corresponding to the target application to the target operating system that matches the operating conditions, based on the operating conditions of the target application.
[0012] The acquisition module is used to acquire data output by the sensor under the target operating system.
[0013] The processing module is used to process the data, obtain the corresponding processing result, and transmit the processing result to the target application.
[0014] An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the control method for running the application described above.
[0015] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0016] The aforementioned application operation control method, apparatus, computer device, and storage medium, in response to a trigger operation on the target application, run the target application. Based on the target application's operating conditions, they switch control of the sensor corresponding to the target application to a target operating system that matches those conditions. Under the target operating system, they acquire sensor output data, process the data, obtain the corresponding processing result, and transmit the processing result back to the target application. This enables the matching of an operating system that meets the application's required operating conditions, and then automatically switches sensor control to the corresponding operating system. The data acquired by the sensor is then processed under the corresponding operating system, thereby achieving a balance between power consumption and performance during application operation.
[0017] A method for controlling the operation of an application, applied to an electronic device, the method comprising:
[0018] In response to a triggering operation on the target application, the target application is run;
[0019] Match the corresponding target operating system based on the running conditions of the target application;
[0020] The system invokes the sensors mounted on the target operating system, acquires the data output by the sensors, processes the data to obtain the corresponding processing results, and transmits the processing results to the target application.
[0021] A control device for running an application, the device comprising:
[0022] The execution module is used to run the target application in response to a trigger operation on the target application;
[0023] The matching module is used to match the corresponding target operating system based on the running conditions of the target application;
[0024] The acquisition module is used to call the sensors mounted on the target operating system and acquire the data output by the sensors;
[0025] The processing module is used to process the data, obtain the corresponding processing result, and transmit the processing result to the target application.
[0026] An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the control method for running the application described above.
[0027] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0028] The aforementioned application operation control method, apparatus, computer device, and storage medium, in response to a trigger operation on the target application, run the target application, match the corresponding target operating system according to the target application's operating conditions, invoke sensors mounted on the target operating system, acquire sensor output data, process the data, obtain the corresponding processing result, and transmit the processing result to the target application. This enables the matching of an operating system that meets the application's required operating conditions, direct invocation of sensors mounted on the target operating system to collect data, and subsequent processing of the collected data, without the need to switch sensor control, thus achieving a balance between power consumption and performance during application operation. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is an application environment diagram of the control method for running an application in one embodiment;
[0031] Figure 2 A flowchart of a control method for application execution in one embodiment;
[0032] Figure 3 This is a flowchart of a step in one embodiment where, based on the operating conditions of the target application, control of the sensor corresponding to the target application is switched to the target operating system that matches the operating conditions.
[0033] Figure 4 A flowchart of a control method for application operation in another embodiment;
[0034] Figure 5 This is a flowchart of the steps for matching the target operating system according to the running conditions of the target application in one embodiment;
[0035] Figure 6 This is a flowchart illustrating, in one embodiment, the process of switching control of the sensor to the big core system for processing;
[0036] Figure 7 This is a flowchart illustrating, in one embodiment, the process of switching control of a sensor to a small-core system for processing;
[0037] Figure 8 A structural block diagram of a control device for running an application in one embodiment;
[0038] Figure 9 This is a structural block diagram of the control device for running the application in another embodiment;
[0039] Figure 10 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0041] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client. Both the first client and the second client are clients, but they are not the same client.
[0042] Figure 1 This is a schematic diagram illustrating the application environment of a control method for running an application in one embodiment. For example... Figure 1As shown, the application environment includes an electronic device 102, which includes a first processor and a second processor. The first processor runs a first operating system, and the second processor runs a second operating system. The application environment can be an environment in which a user interacts with the electronic device 102. Responding to a user's trigger operation on a target application, the electronic device 102 runs the target application. Based on the operating conditions of the target application, the electronic device 102 switches the control of the sensor corresponding to the target application to the target operating system that matches the operating conditions. Under the target operating system, the electronic device 102 acquires data output from the sensor, processes the data, obtains the corresponding processing result, and transmits the processing result to the target application. The electronic device 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices; portable wearable devices can be smartwatches, smart bracelets, etc.
[0043] Figure 2 This is a flowchart of a control method for application execution in one embodiment. The application execution control method in this embodiment is designed to run in... Figure 1 The description will be based on an example of an electronic device. Figure 2 As shown, the control method for running the application includes steps 202 to 206.
[0044] Step 202: In response to the triggering operation on the target application, run the target application.
[0045] Electronic devices are a type of embedded computer system device, and their software architecture can be divided into system software and application software. In the software architecture of electronic devices, system software mainly consists of the operating system and middleware. Common operating systems for electronic devices include Apple's iOS, Google's Android, HP's WebOS, and Microsoft Windows. Users of different operating system terminals can download various types of applications through the application market interface on the electronic device. These applications can include system applications, desktop applications, driver applications, network applications, mobile applications, and IoT applications. Based on the function used by the user, different types of applications can also include instant messaging applications, sports and health applications, and audio-visual entertainment applications. The electronic devices in this application can include smartphones, tablets, wearable devices, etc., and wearable devices can be smartwatches, smart bracelets, etc.
[0046] Specifically, users can trigger an action to select an application on the electronic device, launch that application, and enter the corresponding display interface. For example, a user can click the icon of an ECG measurement application on the main interface of the electronic device to launch that application and enter its corresponding interface. In other words, users can run different types of applications on the electronic device and use the corresponding functions of each application through trigger actions. It is understood that the ways users can launch applications through trigger actions include, but are not limited to, clicking; voice commands, gestures, and other methods can also be used. As long as the application can be launched, the trigger method is not limited. Furthermore, the electronic device is equipped with sensors, which may include sensors with multiple functions, such as motion sensors. The electronic device can use motion sensors to monitor the user's current state.
[0047] Let's take a smart bracelet as an example. A smart bracelet can run at least two operating systems, and these two operating systems share the same screen. That is, a smart bracelet includes at least two processors, each running one operating system. Assume the smart bracelet includes a first processor and a second processor. The first processor can be a central processing unit (CPU), and the second processor can be a microcontroller unit (MCU). The first processor runs the first operating system, and the second processor runs the second operating system. The power consumption of the smart bracelet running the first operating system is greater than that of running the second operating system. The at least two operating systems can include Android, Linux, and RTOS (Real-Time Operating System). Android and Linux offer rich functionality and high performance, but also have high power consumption. RTOS offers simpler functionality and lower power consumption. The smart bracelet can respond to user actions on the screen that trigger a target application, running the corresponding target application. The target application is the application the user selects from multiple applications with different functions that they currently need. A trigger action refers to a user performing a series of actions such as a preset gesture, click, or long press to activate a corresponding event. Developers can pre-configure different trigger operations for different applications' control panels. For example, clicking the application icon can launch the application, while double-clicking it can exit the current application. Users can launch the ECG measurement application by clicking its icon; the smart bracelet will then run the application in response to the user's trigger action.
[0048] Step 204: Based on the operating conditions of the target application, switch the control of the sensor corresponding to the target application to the target operating system that matches the operating conditions.
[0049] In response to a user's triggering operation on a target application, the electronic device runs the corresponding target application. Based on the operating conditions of the target application, the electronic device can switch the control of the sensor corresponding to the target application to a target operating system that matches the operating conditions. The operating conditions refer to the pre-set operating conditions according to the application's operating environment. Operating conditions can include hardware and software operating conditions required for the application to run. For example, operating conditions can be power-related or performance-related. Performance-related operating conditions can be high-precision algorithm operating conditions where the algorithm accuracy is higher than a precision threshold, while power-related operating conditions can be low-power operating conditions where the power consumption is lower than a power consumption threshold. The electronic device in this application includes at least two operating systems, namely a dual-core dual-system architecture (MCU system and Android system). The operating conditions of the target application are used to match the operating system that meets the current application's operating conditions from the dual-core dual-system architecture. Furthermore, at least two operating systems share the same screen on the electronic device, with one processor running one operating system. Only one processor can have control of the sensor at any given time. Only the operating system that has control of the sensor can acquire the data output by the sensor. To achieve a balance between power consumption and performance during application operation, there is a hardware switch that allows the electronic device to switch the sensor's connection to either the first or second operating system. Taking a first operating system as the big core system and a second operating system as the little core system as an example, if an electronic device needs to switch the control of a sensor to the big core system that matches the running conditions of the target application for data processing, the electronic device will operate the switch through the big core system driver to connect the sensor to the big core system. It can be understood that when the electronic device responds to a user's trigger operation to run the target application, the sensor control can be set by default to the low-power little core system.
[0050] Specifically, let's take a smart bracelet as an example. A smart bracelet includes a first processor and a second processor. The first processor runs a first operating system, and the second processor runs a second operating system. The power consumption of the smart bracelet running the first operating system is greater than the power consumption of running the second operating system. In response to a user's trigger operation on a target application (a running app), after the running app is launched, the smart bracelet can switch control of the built-in sensors corresponding to the running app to the second operating system, which matches the low-power processing capability, based on the running app's operating conditions. It's understood that when an electronic device runs three or more operating systems, the power consumption of each operating system can be compared, and then the operating systems can be sorted from highest to lowest power consumption or vice versa. Finally, the target operating system can be matched according to the power consumption required by the running app's operating conditions.
[0051] Step 206: Under the target operating system, acquire the data output by the sensor, process the data to obtain the corresponding processing result, and transmit the processing result to the target application.
[0052] Based on the operating conditions of the target application, the electronic device switches control of the sensors corresponding to the target application to the target operating system that matches the operating conditions. Under the target operating system, it acquires the data output from the sensors, processes the data, obtains the corresponding processing results, and transmits the processing results back to the target application. A sensor (transducer / sensor) is a detection device that senses the measured information and transforms it into electrical signals or other required forms of information output according to a certain rule to meet the requirements of information transmission, processing, storage, display, recording, and control. Sensors can include various types, such as gyroscopes. Electronic devices can have built-in gyroscopes to acquire corresponding detection information, such as detecting the user's step count or speed. The processing result refers to the result obtained after processing the sensor output data using the matched target operating system according to the operating conditions of the target application.
[0053] Let's take a smart bracelet as an example. A smart bracelet can run at least two operating systems simultaneously. Typically, the more feature-rich and powerful operating system consumes more power. Assume the smart bracelet includes a first processor and a second processor. The first processor runs the first operating system, and the second processor runs the second operating system. The power consumption of the smart bracelet running the first operating system is greater than that of running the second operating system. In this embodiment, the first operating system is assumed to be Android (a big-core system), and the second operating system is an RTOS (a small-core system). The smart bracelet responds to the user's trigger operation on the target application (ECG measurement app). After the ECG measurement app is launched, the smart bracelet, based on the app's operating conditions (assuming the app requires high-precision processing capabilities), switches control of the built-in sensors corresponding to the ECG measurement app to the first operating system matched to high-precision processing capabilities. Specifically, the smart bracelet switches control of the built-in sensors corresponding to the ECG measurement app to the Android operating system, which performs high-precision calculations on the sensor output data under the Android operating system, obtains the corresponding calculation results, and transmits the results to the ECG measurement app for display. The application can set the sensor sampling rate. Large-core systems have strong computing power and can therefore set higher sampling rates. Small-core systems have weaker computing power; if the sensor data output frequency is too high, the small-core system will not be able to handle it. Large-core systems have strong computing power, more memory, and more code space; therefore, when the sensor data output frequency is higher, the large-core system can quickly process more complex calculations.
[0054] In traditional application control methods, most motion and health algorithms and sensors rely on small-core systems. While small-core systems have strong battery life, their computing power is weak, thus they cannot process the high-frequency data output from sensors, limiting the accuracy of application algorithms. Large-core systems have stronger computing power and can process more sensor data, but their weaker battery life makes it impossible to achieve a balance between power consumption and performance for application operation.
[0055] The application execution control method in this embodiment runs the target application in response to a trigger operation. Based on the target application's operating conditions, it switches control of the sensor corresponding to the target application to a target operating system that matches those conditions. Under the target operating system, it acquires data output from the sensor, processes the data, obtains the corresponding processing result, and transmits the result back to the target application. This allows for matching the operating system that meets the application's requirements to the desired operating conditions, flexibly switching sensor control based on the characteristics of different operating systems, thereby achieving a balance between power consumption and performance during application execution.
[0056] In one embodiment, such as Figure 3 As shown, the target operating system is either a first operating system or a second operating system. The power consumption of the electronic device running the first operating system is greater than that running the second operating system, and the computing power of the electronic device in the first operating system is greater than that in the second operating system. The step of switching the control of the sensor corresponding to the target application to the target operating system that matches the operating conditions, based on the operating conditions of the target application, includes:
[0057] Step 302: When the target application is running under the condition that the algorithm accuracy is higher than the accuracy threshold, the control of the sensor corresponding to the target application is switched to the first operating system.
[0058] Step 304: When the target application is running under conditions where the algorithm accuracy is lower than or equal to the accuracy threshold, the control of the sensor corresponding to the target application is switched to the second operating system.
[0059] In response to a user's trigger operation on a target application, the electronic device runs the corresponding target application. Based on the running conditions of the target application, the electronic device switches control of the sensor corresponding to the target application to a target operating system that matches the running conditions. Specifically, when the target application's algorithm accuracy is higher than a precision threshold, the electronic device switches control of the sensor corresponding to the target application to a first operating system. When the target application's algorithm accuracy is lower than or equal to the precision threshold, the electronic device switches control of the sensor corresponding to the target application to a second operating system. The target operating system is either the first or second operating system. The power consumption of the electronic device running the first operating system is greater than that running the second operating system, and the computing power of the electronic device in the first operating system is greater than that in the second operating system. It is understood that the dual-core, dual-system architecture of the electronic device in this embodiment is based on a hardware architecture with two processor chips. Each processor runs an independent operating system, and the two operating systems interact with each other to complete the functions of the hardware device. In the dual-core, dual-system architecture of the electronic device, the first operating system is a large-core system, and the second operating system is a small-core system. The large-core system is the main processor system in the dual-system architecture and generally includes operating systems such as Android and Linux. Small-core systems are slave processor systems in a dual-system architecture, typically including RTOS or FreeRTOS operating systems. The primary and secondary operating systems can communicate via a dual-core communication mechanism. This mechanism is a method of data exchange between the two operating systems.
[0060] Let's take a smart bracelet as an example. A smart bracelet can run at least two operating systems simultaneously. Typically, the more feature-rich and powerful operating system consumes more power. Assume the smart bracelet includes a first processor and a second processor. The first processor runs the first operating system, and the second processor runs the second operating system. In this dual-core, dual-system architecture, the first operating system is a high-performance (large-core) system, and the second operating system is a low-performance (small-core) system. The power consumption of the smart bracelet running the first operating system is greater than that of running the second operating system, and the computing power of the smart bracelet running the first operating system is greater than that of the second operating system.
[0061] For example, when a user launches a running app by clicking its icon, the smart bracelet responds to the user's action and runs the app. Based on the app's operating conditions (assuming low-power processing capabilities), the smart bracelet switches control of the built-in sensors corresponding to the app to a second operating system (a small-core system) that matches the low-power processing capabilities. Once the small-core system gains control of the sensors, it can acquire data from the sensors via buses such as I2C (Inter-Integrated Circuit) and SPI (Serial Peripheral Interface) and perform calculations. When a user launches the ECG measurement application by clicking its icon, the smart bracelet responds and runs the application. Based on the app's operating conditions (assuming high-precision processing power), the smart bracelet switches control of the built-in sensors corresponding to the app to the primary operating system (the high-core system) that matches the high-precision processing capabilities. In other words, if the app requires high algorithm accuracy, it can obtain sensor control through the sensor control interface provided by the high-core system. For applications with lower algorithm accuracy and low power consumption requirements, both the algorithm and sensors can be hosted on the low-core system. For applications with high algorithm accuracy and relatively low power consumption requirements, both the algorithm and sensors can be hosted on the high-core system. For example, during ECG sensing testing, sensor control can be switched to the high-core system. The high-core system has strong computing power, can acquire and process more sensor data, and the calculation results will be more accurate. For algorithms that don't require particularly high precision, such as those testing steps or rate, sensor control can be switched to a smaller core system, which consumes less power. Therefore, by flexibly switching sensor control, the accuracy of ECG measurement algorithms can be effectively improved, allowing users to obtain more precise health parameters while also achieving a balance between power consumption and performance.
[0062] In one embodiment, the method further includes, under a first operating system, a step of responding to a triggering operation to close the target application, specifically including:
[0063] Under the first operating system, in response to a trigger operation that closes the target application, the sensor is turned off, and control of the sensor is switched from the first operating system to the second operating system.
[0064] In response to a user's trigger operation on a target application, the electronic device runs the corresponding target application. Based on the application's operating conditions, the electronic device switches control of the sensor corresponding to the target application to a target operating system that matches those conditions. Specifically, when the target application's algorithm accuracy exceeds a certain threshold, the electronic device switches control of the sensor to a first operating system. Under the first operating system, the sensor output data is acquired, processed, and the corresponding processing result is obtained. This result is then transmitted to the target application, which displays the computational result. Furthermore, after viewing the computational result displayed by the target application, the user can close the target application through a trigger operation. That is, when the user finishes using the target application, under the first operating system, in response to the user's trigger operation to close the target application, the sensor is turned off, and control of the sensor is switched from the first operating system to a second operating system. In other words, when exiting the app, the electronic device automatically switches control to the small-core system through the sensor control interface.
[0065] For example, when a user launches an ECG measurement application by clicking its icon, the smart bracelet responds to this action. After the application runs, the smart bracelet, based on the app's operating conditions (assuming high-precision processing capabilities), switches control of the built-in sensor corresponding to the app to a first operating system (large-core system) that matches these capabilities. Under this first operating system, the bracelet acquires and processes the sensor output data, obtaining the corresponding results, which are then transmitted to the ECG measurement app for display. After viewing the displayed results, the user can close the app. That is, after using the app, the first operating system, responding to the user's action to close the app, shuts down the sensor and switches control to a second operating system. The reason for switching control of the sensor back to the small core system is that the small core system is more energy-efficient, and the small core system also needs to use the sensor. By utilizing the low power consumption capability of the small core system, ECG measurement sensor data can be acquired and processed for a long time. Although it cannot process data with a very high output frequency, it can meet the low power consumption requirements.
[0066] Because the power consumption of the first operating system on a smart bracelet is greater than that of the second operating system, in order to achieve a balance between power consumption and performance when applications are running, the electronic device switches sensor control to the lower-power operating system (i.e., the second operating system) when the user closes an application requiring high-precision processing capabilities. This avoids the problem of high power consumption caused by constantly running a high-power operating system, reducing power consumption and extending the battery life of the electronic device. Thus, high-precision calculations are performed under the large-core system, while low-power calculations are performed under the small-core system, achieving a balance between high algorithm accuracy and low system power consumption.
[0067] In one embodiment, the step of acquiring sensor output data under the target operating system includes:
[0068] Under the first operating system, acquire the data output by the sensor at the first sampling rate.
[0069] Under the second operating system, data from the sensor output is acquired at a second sampling rate, which is lower than the first sampling rate.
[0070] Based on the operating conditions of the target application, the electronic device switches control of the sensor corresponding to the target application to the target operating system that matches the operating conditions. Under the target operating system, it acquires data output from the sensor, processes the data, obtains the corresponding processing result, and transmits the processing result to the target application. Specifically, under the first operating system, it acquires data from the sensor output at a first sampling rate. Under the second operating system, it acquires data from the sensor output at a second sampling rate, where the second sampling rate is lower than the first sampling rate. That is, the second operating system (small core system) has weaker computing power, while the first operating system (large core system) has stronger computing power. When the sensor data output frequency is very high (e.g., 200+ Hz), the small core system cannot handle the high-frequency data output from the sensor, which can easily lead to data loss and even stability issues. Because the large core system has strong computing power, it can quickly and accurately process more data. Therefore, by utilizing a dual-core, dual-system (MCU system, Android system) architecture—that is, by leveraging the high-precision computing power of the large core system to acquire and process data at the maximum output frequency supported by the sensor—more accurate calculation results can be obtained.
[0071] In one embodiment, the method further includes the step of transmitting the acquired sensor data to a second operating system via a first operating system, comprising:
[0072] If the sensor is under the control of the first operating system, and a request to acquire sensor data initiated by the second operating system is detected, then the acquired sensor data is transmitted to the second operating system through the first operating system.
[0073] In response to a user's triggering operation on a target application, the electronic device runs the corresponding target application. Based on the application's operating conditions, the electronic device switches control of the sensor corresponding to the target application to a target operating system that matches those conditions. Specifically, when the target application's operating condition is that the algorithm accuracy is higher than a precision threshold, the electronic device switches control of the sensor corresponding to the target application to a first operating system. Under the first operating system, the sensor output data is acquired, the first processor processes the data to obtain the corresponding processing result, and transmits the processing result to the target application, which then displays the calculation result.
[0074] Furthermore, if sensor control is under the first operating system and a data acquisition request initiated by the second operating system is detected, the acquired sensor data is transmitted to the second operating system via the first operating system. That is, when the large-core system has control of the sensor, if the small-core system also needs sensor data, dual-core communication technology can be used to transmit the sensor data back to the small-core system. Dual-core communication technology uses the SPI protocol for reliable data transmission between the large-core and small-core systems. Sensor control switching technology is based on dual-core communication technology to switch sensor control between the large-core and small-core systems. Since the dual-core communication mechanism requires stable and fast data transmission, a data link can be established between the first and second processors. The first and second processors can then send data packets to each other through this data link to achieve information exchange. Therefore, based on dual-core communication technology and sensor control switching technology, stable and fast transmission of sensor data can be achieved, effectively improving the stability of application operation.
[0075] Figure 4 This is a flowchart of a control method for application execution in another embodiment. The control method for application execution in this embodiment is designed to run in... Figure 1 The description will be based on an example of an electronic device. Figure 4 As shown, the control method for running the application includes steps 402 to 406.
[0076] Step 402: In response to the triggering operation on the target application, run the target application.
[0077] Step 404: Match the corresponding target operating system based on the running conditions of the target application.
[0078] Step 406: Call the sensor mounted on the target operating system, obtain the data output by the sensor, process the data, obtain the corresponding processing result, and transmit the processing result to the target application.
[0079] The user triggers an operation to select an application with a specific function on the electronic device, launches the application, and enters the corresponding display interface. In other words, the electronic device responds to the user's trigger operation on the target application. After the target application runs, the electronic device matches the corresponding target operating system based on the application's operating conditions, calls the sensors mounted on the target operating system, acquires the sensor output data, processes the data, obtains the corresponding processing result, and transmits the processing result back to the target application. Here, the sensors mounted on the target operating system refer to a set of detection devices (sensors) configured for the target operating system. The electronic device includes a first processor and a second processor. The first processor can be a low-power processor, and the second processor can be a high-power processor. That is, the first processor is a small-core processor, and the second processor is a large-core processor. It can be understood that the first processor is a small-core processor, and the first operating system implements fewer functions. Storing the runtime content of applications with high algorithmic accuracy requirements is cumbersome, and recording and processing the corresponding data would increase the burden on the first processor. Therefore, the electronic device needs to match the corresponding target operating system based on the target application's operating conditions. The first processor runs the first operating system, and the second processor runs the second operating system. Accordingly, the second operating system can implement more functions than the first operating system. For example, when the second operating system is running, it can detect body temperature, heart rate, and display pages with high resolution; when the first operating system is running, it can perform fewer functions, such as time display and dial display. The first processor is, for example, an MCU (Microcontroller Unit). The second operating system can be Android (including operating systems deeply developed based on Android), iOS (including operating systems deeply developed based on iOS), or other operating systems; the first operating system can be a real-time operating system (RTOS), Linux, or other operating systems. In the dual-system architecture of electronic devices, the first operating system is a large-core system, and the second operating system is a small-core system, with each operating system configured with a corresponding set of sensors.
[0080] For example, two sets of motion and health sensors are pre-configured in an electronic device. One set, sensor A, is mounted on a high-core system, and the other, sensor B, is mounted on a low-core system. When the electronic device matches the target operating system (which requires high-precision computation) to the high-core system based on the operating conditions of the target application (ECG sensor testing app), it activates sensor A mounted on the high-core system. This means sensor A is then acquired, and higher-frequency data from its output is obtained. High-precision computation is performed on this data to obtain the corresponding results, which are then transmitted to the ECG sensor testing app for display. After viewing the results, the user can close the app by triggering a shutdown. That is, after the user finishes using the ECG sensor testing app, sensor A is shut down in response to the user's shutdown command within the high-core operating system. When the electronic device matches the target operating system (a small-core system) to the operating conditions of the target application (a fitness and health app) (low power consumption and algorithm accuracy below or equal to the accuracy threshold), it calls sensor B mounted on the small-core system. This means activating sensor B, acquiring low-frequency data from its output, performing calculations on the data, obtaining the results, and transmitting them to the fitness and health app for display. After viewing the results, the user can close the app by triggering a shutdown. In other words, after using the app, sensor B is shut down in response to the user's shutdown command. This allows the large-core and small-core systems to each use a separate set of sensors, eliminating the need for sensor control switching and ensuring mutual independence. This achieves a balance between power consumption and performance during application operation.
[0081] In one embodiment, such as Figure 5 As shown, the target operating system is either a first operating system or a second operating system. The power consumption of the electronic device running the first operating system is greater than that running the second operating system, and the computing power of the electronic device running the first operating system is greater than that running the second operating system. The steps for matching the corresponding target operating system according to the running conditions of the target application include:
[0082] Step 502: Under the condition that the target application's running conditions are such that the algorithm accuracy is higher than the accuracy threshold, the first operating system is matched and obtained.
[0083] Step 504: If the target application's running conditions are such that the algorithm's accuracy is lower than or equal to the accuracy threshold, a second operating system is obtained through matching.
[0084] The electronic device responds to a user's trigger operation on a target application. After running the target application, the electronic device matches the corresponding target operating system based on the running conditions of the target application. Specifically, if the target application's running condition is that the algorithm precision is higher than a precision threshold, the electronic device matches a first operating system. If the target application's running condition is that the algorithm precision is lower than or equal to the precision threshold, the electronic device matches a second operating system. In this embodiment, the target operating system is either the first or the second operating system. The power consumption of the electronic device running the first operating system is greater than that of running the second operating system, and the computing power of the electronic device running the first operating system is greater than that running the second operating system. When the electronic device detects that the target application's running condition is that the algorithm precision is higher than the precision threshold, it matches the first operating system. This means that the first operating system has strong computing power, larger memory and code space, and therefore can perform more, more complex, and faster calculations. In other words, the first operating system can provide rich functionality and has strong performance, but it consumes more power. When the electronic device detects that the target application's running condition is that the algorithm precision is lower than or equal to the precision threshold, it matches the second operating system. This means that the second operating system has weaker computing power, lower power consumption, can provide simpler functions, and consumes less power. This allows for a balance between high algorithm accuracy and low system power consumption by matching the operating system to the application's required operating conditions. This means that high-precision calculations are performed on large-core systems and low-power calculations are performed on small-core systems, based on the characteristics of different operating systems.
[0085] In one embodiment, a smart bracelet is used as an example for illustration. The smart bracelet has built-in sensors. The smart bracelet in this embodiment includes at least two operating systems, i.e., a dual-core dual-system architecture. It is assumed that the smart bracelet includes a first processor and a second processor. The first processor runs the Android operating system, and the second processor runs the RTOS operating system. The power consumption of the smart bracelet running the Android operating system is greater than that running the RTOS operating system, and the computing power of the smart bracelet running the Android operating system is higher than that running the RTOS operating system.
[0086] like Figure 6The diagram illustrates the flowchart for switching sensor control to the high-performance processing (HPS) system. The user activates the wearable smart bracelet, entering the Android system. The user launches the ECG measurement application by clicking its icon. Responding to this activation, the smart bracelet runs the ECG measurement application. Assuming the app requires high-precision processing capabilities, the smart bracelet switches control of the built-in sensor corresponding to the app to the Android operating system (HPS system), which matches the high-precision processing capabilities. Under the Android operating system, the sensor is activated, acquiring higher-frequency data. High-precision calculations are performed on this data to obtain the results, which are then transmitted to the ECG measurement app for display. After viewing the results, the user can close the app. Upon completion, the Android operating system shuts down the sensor and switches control from the Android operating system to the RTOS operating system. When a user closes an application that requires high-precision computing power, the electronic device switches sensor control to a lower-power operating system (i.e., an RTOS), thereby achieving a balance between power consumption and performance when the application is running.
[0087] like Figure 7The diagram illustrates the flowchart for switching sensor control to a small-core system for processing. The user turns on the wearable smart bracelet, entering the Android system. The user launches the running app by clicking its icon. Responding to this, the smart bracelet runs the app. Assuming the app operates under low-power processing conditions with minimal algorithm requirements, the smart bracelet switches control of the built-in sensor corresponding to the running app to a low-power RTOS (small-core system). Under the RTOS, the sensor is activated, acquiring low-frequency data. The data is processed to obtain the results, which are then transmitted to the running app for display. After viewing the results, the user can close the app by triggering a shutdown. Upon completion of the app, the RTOS shuts down the sensor. Since the running app can operate under a low-power RTOS operating system, there is no need to switch sensor control. The smart bracelet runs on a low-power RTOS operating system by default to achieve a balance between power consumption and performance for the application.
[0088] It should be understood that, although Figure 1-7 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1-7 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0089] Figure 8 A structural block diagram of a control device for running an application in one embodiment. Figure 8 As shown, a control device for running an application is provided, including: a running module 802, a switching module 804, an acquisition module 806, and a processing module 808, wherein:
[0090] Run module 802 is used to run the target application in response to a trigger operation on the target application.
[0091] The switching module 804 is used to switch the control of the sensor corresponding to the target application to the target operating system that matches the operating conditions, based on the operating conditions of the target application.
[0092] The acquisition module 806 is used to acquire data output by the sensor under the target operating system.
[0093] The processing module 808 is used to process the data, obtain the corresponding processing results, and transmit the processing results to the target application.
[0094] In one embodiment, the switching module is further configured to switch the control of the sensor corresponding to the target application to the first operating system when the algorithm accuracy is higher than the accuracy threshold under the operating conditions of the target application; and to switch the control of the sensor corresponding to the target application to the second operating system when the algorithm accuracy is lower than or equal to the accuracy threshold under the operating conditions of the target application.
[0095] In one embodiment, the switching module is further configured to, under the first operating system, in response to a trigger operation that closes the target application, turn off the sensor and switch control of the sensor from the first operating system to the second operating system.
[0096] In one embodiment, the acquisition module is further configured to acquire data output by the sensor at a first sampling rate under a first operating system; and acquire data output by the sensor at a second sampling rate, where the second sampling rate is lower than the first sampling rate, under a second operating system.
[0097] In one embodiment, the device further includes a detection module.
[0098] The detection module is used to transmit the acquired sensor data to the second operating system if the sensor is under the control of the first operating system and a request to acquire sensor data initiated by the second operating system is detected.
[0099] Figure 9 A structural block diagram of a control device for running an application in another embodiment. (See diagram below.) Figure 9 As shown, a control device for running an application is provided, comprising: a running module 902, a matching module 904, an acquisition module 906, and a processing module 908, wherein:
[0100] Run module 902 is used to run the target application in response to a trigger operation on the target application.
[0101] Matching module 904 is used to match the corresponding target operating system based on the running conditions of the target application.
[0102] The acquisition module 906 is used to call the sensors mounted on the target operating system and acquire the data output by the sensors.
[0103] The processing module 908 is used to process the data, obtain the corresponding processing results, and transmit the processing results to the target application.
[0104] In one embodiment, the matching module is further configured to match a first operating system when the target application's running conditions are such that the algorithm accuracy is higher than the accuracy threshold, and to match a second operating system when the target application's running conditions are such that the algorithm accuracy is lower than or equal to the accuracy threshold.
[0105] The division of the various modules in the control device for running the above application is only for illustrative purposes. In other embodiments, the control device for running the application can be divided into different modules as needed to complete all or part of the functions of the control device for running the above application.
[0106] Specific limitations regarding the control device for application execution can be found in the limitations on the control methods for application execution described above, and will not be repeated here. Each module in the aforementioned control device for application execution can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independent of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.
[0107] Figure 10 This is a schematic diagram of the internal structure of an electronic device in one embodiment. For example... Figure 10 As shown, the electronic device includes a processor and a memory connected via a system bus. The processor provides computing and control capabilities to support the operation of the entire electronic device. The memory may include non-volatile storage media and internal memory. The non-volatile storage media stores an operating system and computer programs. The computer programs can be executed by the processor to implement a control method for running an application provided in the following embodiments. The internal memory provides a cached runtime environment for the operating system computer programs in the non-volatile storage media. The electronic device can be any terminal device such as a mobile phone, tablet computer, PDA (Personal Digital Assistant), POS (Point of Sales), in-vehicle computer, wearable device, etc.
[0108] The various modules in the control device for running the application provided in this application embodiment can be implemented in the form of a computer program. This computer program can run on a terminal or server. The program modules constituted by this computer program can be stored in the memory of an electronic device. When this computer program is executed by a processor, it implements the steps of the method described in the embodiments of this application.
[0109] This application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, cause the processors to perform the steps of a control method for running an application.
[0110] A computer program product containing instructions that, when run on a computer, causes the computer to execute a control method for running an application.
[0111] Any references to memory, storage, databases, or other media used in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).
[0112] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for controlling the operation of an application, characterized in that, Applied to electronic devices, the method includes: In response to a triggering operation on the target application, the target application is run; Based on the operating conditions of the target application, the control of the sensor corresponding to the target application is switched to a target operating system that matches the operating conditions. The target operating system is either a first operating system or a second operating system, and the power consumption of the electronic device running the first operating system is greater than the power consumption of running the second operating system. The step of switching the control of the sensor corresponding to the target application to a target operating system that matches the operating conditions includes: when the operating conditions of the target application are that the algorithm accuracy is higher than a precision threshold, switching the control of the sensor corresponding to the target application to the first operating system; and when the operating conditions of the target application are that the algorithm accuracy is lower than or equal to the precision threshold, switching the control of the sensor corresponding to the target application to the second operating system. Under the target operating system, the data output by the sensor is acquired, the data is processed to obtain the corresponding processing result, and the processing result is transmitted to the target application.
2. The method according to claim 1, characterized in that, The electronic device has a higher computing power on the first operating system than on the second operating system.
3. The method according to claim 1, characterized in that, The method further includes: Under the first operating system, in response to a trigger operation to close the target application, the sensor is turned off, and control of the sensor is switched from the first operating system to the second operating system.
4. The method according to claim 1, characterized in that, The step of acquiring the data output by the sensor under the target operating system includes: Under the first operating system, the data output by the sensor and collected at a first sampling rate is acquired; Under the second operating system, data output by the sensor and collected at a second sampling rate is acquired; the second sampling rate is lower than the first sampling rate.
5. The method according to claim 1, characterized in that, The method further includes: If the sensor is under the control of the first operating system, and a request to acquire sensor data initiated by the second operating system is detected, then the acquired sensor data is transmitted to the second operating system through the first operating system.
6. A method for controlling the operation of an application, characterized in that, Applied to electronic devices, the method includes: In response to a triggering operation on the target application, the target application is run; The target operating system is matched according to the running conditions of the target application; the target operating system is a first operating system or a second operating system; the power consumption of the electronic device running the first operating system is greater than the power consumption of running the second operating system; The system invokes the sensors mounted on the target operating system, acquires the data output by the sensors, processes the data to obtain the corresponding processing results, and transmits the processing results to the target application. The step of matching the corresponding target operating system based on the running conditions of the target application includes: matching the first operating system when the running conditions of the target application are that the algorithm accuracy is higher than the accuracy threshold; and matching the second operating system when the running conditions of the target application are that the algorithm accuracy is lower than or equal to the accuracy threshold.
7. The method according to claim 6, characterized in that, The electronic device has a higher computing power on the first operating system than on the second operating system.
8. A control device for running an application, characterized in that, The device includes: The execution module is used to run the target application in response to a trigger operation on the target application; A switching module is configured to switch the control of a sensor corresponding to the target application to a target operating system that matches the operating conditions, based on the operating conditions of the target application. The target operating system is either a first operating system or a second operating system, and the power consumption of the electronic device running the first operating system is greater than the power consumption of running the second operating system. The switching module is further configured to switch the control of the sensor corresponding to the target application to the first operating system when the algorithm accuracy is higher than a precision threshold, and to switch the control of the sensor corresponding to the target application to the second operating system when the algorithm accuracy is lower than or equal to the precision threshold. The acquisition module is used to acquire data output by the sensor under the target operating system. The processing module is used to process the data, obtain the corresponding processing result, and transmit the processing result to the target application.
9. A control device for running an application, characterized in that, The device includes: The execution module is used to run the target application in response to a trigger operation on the target application; A matching module is used to match a corresponding target operating system based on the running conditions of the target application; the target operating system is a first operating system or a second operating system; the power consumption of the electronic device running the first operating system is greater than the power consumption of running the second operating system; the matching module is also used to match the first operating system when the running conditions of the target application are that the algorithm accuracy is higher than the accuracy threshold; and to match the second operating system when the running conditions of the target application are that the algorithm accuracy is lower than or equal to the accuracy threshold. The acquisition module is used to call the sensors mounted on the target operating system and acquire the data output by the sensors; The processing module is used to process the data, obtain the corresponding processing result, and transmit the processing result to the target application.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, it causes the processor to perform the steps of the control method for running the application as described in any one of claims 1 to 7.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
12. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Dual-system architecture with fast recovery and switching of operating system
CN105793821A
Low-power wearable devices and methods for switching and communication among multiple operating systems and application management methods thereof
US20150365892A1
Electronic device and method for controlling same
US20180329715A1