Starting method and electronic equipment
Through the collaborative startup method and message passing mechanism of multi-core processors, the startup time of the image processing subsystem of electronic devices is optimized, solving the problem of long cold startup time, improving user experience and ensuring security.
Patent Information
- Application Number
- CN202310216352.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-08-30
AI Technical Summary
In battery-powered electronic devices, the image processing subsystem has a long cold start time, which affects the user experience.
Using the collaborative startup method of multi-core processors, the master core and the slave core cooperate to complete the image loading and startup of multiple operating systems, optimize the startup process through message passing, process business parameter configuration in parallel, and reduce user waiting time.
It shortens the startup time of electronic devices, improves user experience, saves power consumption from the core, and ensures the security of user privacy data.
Smart Images

Figure CN118567722A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a startup method and an electronic device. Background Art
[0002] In some battery-powered electronic devices, in order to extend the battery life, the subsystems that implement certain business functions in the electronic device are usually placed in a power-off state. For example, in an electronic door lock equipped with a visual function, the image processing subsystem is usually placed in a power-off state and started when triggered by an external event. The size of the startup time will directly affect the user experience. Therefore, how to start the relevant business functions in the electronic device has become a problem worth studying. Summary of the invention
[0003] The present application provides a startup method and an electronic device, which can reduce the startup time corresponding to the business functions in the electronic device and improve the user experience.
[0004] In a first aspect, an embodiment of the present application provides a startup method, which is applied to an electronic device including a multi-core processor, the method comprising: a master core sends a first message to a slave core, the first message is used to trigger the image loading of a first operating system and the image loading of a second operating system; the slave core sends a second message to the master core, the second message is used to indicate that the image loading of the first operating system is complete; the master core starts the first operating system according to the second message, and during the startup of the first operating system, receives a third message from the slave core; wherein the third message is used to indicate that the image loading of the second operating system is complete; after starting the first operating system, the master core starts the second operating system according to the third message.
[0005] In the above design, multiple cores collaborate to implement the image loading and startup of multiple operating systems involved in the startup process. While the main core is starting the first operating system, the slave core loads the second operating system. This design can shorten the startup time and reduce the user's waiting time, thereby improving the user experience.
[0006] In a possible design, the first message is also used to trigger the image loading of the service parameter configuration program, and the service parameter configuration program is used to configure the service parameters of the electronic device. Such a design can be applied to the scenario where the startup of the service function in the electronic device requires the initialization configuration of the service parameters.
[0007] In a possible design, the slave core sends a fourth message to the master core, and the fourth message is used to indicate that the image loading of the business parameter configuration program is complete; the master core starts the business parameter configuration program according to the fourth message, and receives the second message from the slave core during the process of starting the business parameter configuration program. Based on such a design, the slave core completes loading the first operating system during the process of starting the business parameter configuration program. Such a design can shorten the startup time, reduce the user's waiting time, and thus improve the user experience.
[0008] In a possible design, after sending the second message, the slave core performs image loading and startup of the business parameter configuration program; after starting the business parameter configuration program, the slave core sends the third message to the master core. Based on such a design, when the master core is starting the first operating system, the slave core completes image loading and startup of the business parameter configuration program. Such a design can shorten the startup time, reduce the user's waiting time, and thus improve the user experience.
[0009] In one possible design, the electronic device further includes a camera and an ambient light sensor, the ambient light sensor acquires the ambient light parameters of the image captured by the camera, and the business parameter configuration program is used to configure the exposure parameters of the image captured by the camera according to the ambient light parameters. For example, the business parameter configuration program is used to configure the first exposure parameter having a mapping relationship with the ambient light parameter as the exposure parameter of the image captured by the camera. Such a design eliminates the need to converge the captured image of the camera each time, can reduce the configuration time of the exposure parameters, reduce the waiting time of the user, and thus improve the user experience.
[0010] In a possible design, the slave core enters a dormant state after sending the third message; the master core wakes up the slave core in the process of starting the second operating system, and instructs the slave core to participate in the startup of the second operating system. Based on such a design, the power consumption of the slave core can be saved, and the slave core can be prevented from being in a powered-on state without being perceived by the master core, which can easily destroy the design logic of the master core scheduling (controlling) the slave core. The master core controls the power-on of the slave core, which can ensure that the slave core participates in the startup of the second operating system in a timely manner, thereby increasing the parallel strength.
[0011] In one possible design, the first operating system is used to provide a trusted execution environment TEE, for example, the first operating system can also be called TEE OS; the second operating system is used to provide a rich execution environment REE, for example, the second operating system can also be called REE OS. According to the above design, TEE OS is started first and then REE OS is started, which meets security requirements and can ensure the normal operation of electronic devices and the security of user privacy data.
[0012] In a second aspect, an embodiment of the present application provides an electronic device, comprising a multi-core processor; wherein the master core is used to send a first message to the slave core, wherein the first message is used to trigger image loading of a first operating system and image loading of a second operating system; the slave core is used to send a second message to the master core, wherein the second message is used to indicate that image loading of the first operating system is complete;
[0013] The master core is further used to: start the first operating system according to the second message, and receive a third message from the slave core during the process of starting the first operating system; the third message is used to indicate that the image loading of the second operating system is complete; after starting the first operating system, start the second operating system according to the third message.
[0014] In a possible design, the first message is also used to trigger the image loading of a service parameter configuration program, and the service parameter configuration program is used to configure the service parameters of the electronic device.
[0015] In one possible design, the slave core is also used to send a fourth message to the master core, and the fourth message is used to indicate that the image loading of the business parameter configuration program is complete; the master core is also used to start the business parameter configuration program according to the fourth message, and receive the second message from the slave core during the process of starting the business parameter configuration program.
[0016] In a possible design, the slave core is further used to: after sending the second message, image load and start the business parameter configuration program; after starting the business parameter configuration program, send the third message to the master core.
[0017] In one possible design, the electronic device also includes a camera and an ambient light sensor; the camera is used to capture images; the ambient light sensor is used to obtain ambient light parameters when the camera captures images, and the business parameter configuration program is used to configure exposure parameters of the images captured by the camera according to the ambient light parameters.
[0018] In one possible design, the slave core is further used to enter a sleep state after sending the third message; the master core is further used to wake up the slave core during the process of starting the second operating system and instruct the slave core to participate in the startup of the second operating system.
[0019] In one possible design, the first operating system is used to provide a trusted execution environment TEE, and the second operating system is used to provide a rich execution environment REE.
[0020] In one possible design, the electronic device may also include a non-volatile memory and an internal memory; wherein the non-volatile memory is used to provide an image of the first operating system, an image of the second operating system, and / or an image of the business parameter configuration program. The loading operation involved in the above design can be understood as loading the relevant image stored in the non-volatile memory into the internal memory. For example, when the slave core receives the first message, it can load the image of the first operating system and / or the image of the second operating system stored in the non-volatile memory into the internal memory.
[0021] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes computer program instructions. When the computer program instructions are executed by a computer, the computer executes the method described in the first aspect and any possible design of the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed by a computer, the computer executes the method described in the first aspect and any possible design of the first aspect.
[0023] For the effects of the solutions provided in any of the second to fourth aspects above, reference may be made to the corresponding description in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of a flow chart of an existing startup method;
[0025] Figure 2A One of the structural schematic diagrams of the electronic device provided in the embodiment of the present application;
[0026] Figure 2B One of the structural schematic diagrams of the electronic device provided in the embodiment of the present application;
[0027] Figure 3 One of the flowcharts of the startup method provided in the embodiment of the present application;
[0028] Figure 4 One of the flowcharts of the startup method provided in the embodiment of the present application;
[0029] Figure 5 One of the flowcharts of the startup method provided in the embodiment of the present application;
[0030] Figure 6 One of the flowcharts of the startup method provided in the embodiment of the present application;
[0031] Figure 7 One of the flowcharts of the startup method provided in the embodiment of the present application;
[0032] Figure 8 One of the flowcharts of the startup method provided in the embodiment of the present application;
[0033] Fig. 9 One of the flowcharts of the startup method provided in the embodiment of the present application;
[0034] Fig.10 One of the flow charts of the startup method provided in the embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0036] The at least one (item) involved in the embodiments of the present application as follows indicates one (item) or more (items). More than one (item) refers to two (items) or more than two (items). "And / or" describes the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects before and after are in an "or" relationship.
[0037] The terms "including" and "having" and any variations thereof mentioned in the following description of the embodiments of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes other steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any method or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other methods or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner.
[0038] At present, image processing functions are deployed in electronic devices such as smart door locks, video doorbells, and electronic cat eyes. For example, the image processing function is realized by an image processing subsystem, which is mainly used to realize functions such as image capture, image processing, and image presentation. Such electronic devices are usually powered by batteries. In order to extend the battery life of electronic devices, the image processing subsystem is usually placed in a power-off state and is not started until an external event is triggered. Such a startup is also called a cold start. Some examples of external events include: the appearance of a person or object in the range monitored by the camera on the electronic device, or the user actively triggers the corresponding button on the electronic device to wake up the startup process of the image processing subsystem, or the user remotely controls the electronic device to start the startup process of the image processing subsystem.
[0039] Usually, such electronic devices involve the storage of user privacy data, such as user fingerprints, user facial features, door lock passwords, etc. Considering the protection of user privacy data, trusted execution environment (TEE) and rich execution environment (REE) can be deployed in such electronic devices. TEE and REE form two independent operating systems (OS). Electronic devices can process services corresponding to user privacy data in TEE and services corresponding to non-privacy data in REE, such as obtaining the time a person or object stays in the camera's monitoring range.
[0040] In the related art, a core of a central processing unit (CPU) in an electronic device completes the startup process of an image processing subsystem, such as Figure 1 An existing startup process is illustrated, where a core in a CPU executes the following steps 1 to 6 in sequence.
[0041] Step 1, execute Bootrom. The Bootrom refers to the on-chip bootrom, which is a boot program (boot) embedded in the CPU chip, including the first code executed by the CPU after power-on reset.
[0042] The function of the Bootrom program is to realize the loading of the Bootloader, a small program that BootLoader runs before the operating system (such as the aforementioned TEE OS and REE OS) runs. This small program can be used to initialize hardware devices. The loading and startup process of the Bootloader program is divided into two stages, such as the first-level Bootloader and the second-level Bootloader. Usually, the Bootrom program can load the first-level Bootloader from the non-volatile memory, and the loading of the second-level Bootloader needs to rely on the first-level Bootloader. In other words, based on the above design, the execution result of step 1 is: the first-level Bootloader is loaded.
[0043] Step 2: Execute the first-level Bootloader. The function of the first-level Bootloader is to initialize the memory, such as double data rate (DDR) memory, and load the second-level Bootloader stored in the non-volatile memory into the DDR.
[0044] Step 3: execute the secondary Bootloader. The function of the secondary Bootloader is to load the images of TEE OS and REE OS stored in the non-volatile memory into DDR and guide the startup of TEE OS and REE OS.
[0045] Step 4: Perform security isolation configuration during the TEE OS startup process to provide a secure execution environment for services involving user privacy data. According to security requirements, REE OS can only be started after TEE OS startup is completed. That is, REE OS is started after executing step 4. The REE OS startup process can be understood by referring to step 5.
[0046] Step 5: Implement system resource configuration, driver initialization, file system mounting and other functions during the startup process of REE OS to provide an execution environment for applications related to the image processing subsystem.
[0047] Step 6, configure the parameters of the color sensor (RGB Sensor). The parameter may be an exposure parameter for capturing an image. Generally, the RGB Sensor refers to a sensor integrated in a camera. It can be understood that the camera captures an image based on the exposure parameter and provides image data for subsequent image processing.
[0048] In the above-mentioned related technologies, since the image of REE OS is relatively large, it takes a long time for the secondary bootloader to load REEOS from the storage medium. Therefore, the serial startup of TEE OS and REE OS results in a time-consuming startup process, which increases the waiting time for users. In addition, the RGB Sensor usually needs to perform exposure convergence on the multiple frames of images taken by the camera at the beginning. The unconverged multiple frames of images cannot display valid information and need to be discarded. This design results in the user having to wait for a certain amount of time to obtain valid images after the startup of TEE OS and REEOS is completed. All of these result in a poor user experience.
[0049] Based on this, an embodiment of the present application provides a startup method, in which multi-core processors collaborate to complete the startup process of business functions in an electronic device based on parallel processing, which can reduce the startup time, thereby reducing the user's waiting time and improving the user's experience.
[0050] It can be understood that the startup method provided in the embodiment of the present application can be applied to the following Figure 2A The electronic device 100 is shown, and the electronic device 100 may include a multi-core processor 110 and a storage module 120 .
[0051] The multi-core processor 110 may include a master core 111 and at least one slave core 112. For example, the multi-core processor may be a multi-core CPU. The storage module 120 includes a memory 121 and a non-volatile memory 122.
[0052] Among them, memory is also called internal memory or main memory, which is used to temporarily store the calculation data in the multi-core CPU and the data exchanged with external memory such as hard disk. The multi-core CPU can directly read the data in the memory. The data stored in the memory needs to rely on electricity to maintain. When the memory is powered off, the data in the memory will be lost. Some examples of memory include: DDR memory, random access memory (RAM), and cache memory.
[0053] Non-volatile memory (NVM) refers to a storage medium that stores data without losing it when the power is off (or disconnected). Some examples of non-volatile memory include: flash memory, programmable read-only memory (PROM), electrically alterable read-only memory (EAROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), read-only memory (ROM), hard disk drive (HDD), or solid state drive (SSD).
[0054] In addition, the electronic device 100 may also include a business function module 130, which is used to implement business functions involved in the electronic device. Taking the business function as an image processing function as an example, Figure 2B exist Figure 2A Based on FIG. 1 , the service function module 130 includes an image processing unit 131 , which can be implemented by an image signal processor (ISP). Optionally, the service function module 130 can also include a camera 132 and an ambient light sensor 133 .
[0055] In a possible implementation, the aforementioned multi-core processor and image processing unit may be integrated on a chip, which may be called a system on chip (SOC) or a system on chip. In addition, optionally, a memory may also be integrated on the chip.
[0056] Several startup methods provided in the embodiments of the present application are further described in detail below.
[0057] Method 1
[0058] like Figure 3 A startup method is shown, which can be executed by a master core and a slave core in collaboration. The method includes the following steps.
[0059] S301: The master core sends a first message to the slave core.
[0060] The first message is used to trigger the image loading of the first operating system and the image loading of the second operating system. Optionally, a program can be used to implement the image loading of the first operating system and the image loading of the second operating system, and the first message can also be understood as being used to trigger the execution of the program.
[0061] Optionally, the image of the first operating system and the image of the second operating system are stored in a non-volatile memory in the electronic device. The slave core loads the image of the first operating system and the image of the second operating system in the non-volatile memory into the memory, so as to facilitate the subsequent startup of the first operating system and the second operating system in the memory.
[0062] Exemplarily, after power-on reset, the master core can complete the initialization of the memory and the loading of the secondary Bootloader by executing Bootrom and the primary Bootloader as in the related art. The function of the secondary Bootloader is to load the image of the first operating system and the image of the second operating system into the memory. Then, the master core starts the slave core and sends a first message to the slave core. After receiving the first message, the slave core completes the loading of the image of the first operating system and the image of the second operating system by executing the secondary Bootloader.
[0063] It can be understood that according to the execution process of the secondary Bootloader, the slave core can first complete the image loading of the first operating system and then complete the image loading of the second operating system, or first complete the image loading of the second operating system and then complete the image loading of the first operating system.
[0064] Optionally, after each image loading of an operating system is completed, the slave core notifies the master core that the image loading of the operating system has been completed. The master core can start the corresponding operating system in the order of notification. In the following steps of the embodiment of the present application, the image loading of the first operating system is completed before the image loading of the second operating system is completed as an example for explanation.
[0065] S302, the slave core sends a second message to the master core.
[0066] The second message is used to indicate that the image loading of the first operating system is complete.
[0067] S303: The master core starts the first operating system according to the second message, and receives a third message from the slave core during the process of starting the first operating system.
[0068] It is understandable that the main core determines that the image loading of the first operating system is complete according to the second message, and then the main core can start the first operating system. During the process of the main core starting the first operating system, the slave core completes the image loading of the second operating system and sends the third information to the main core, and the third message is used to indicate that the image loading of the second operating system is complete.
[0069] Optionally, the slave core may automatically enter a sleep state after sending the third message, or the master core may power off the slave core after receiving the third message. Such a design may save power consumption.
[0070] S304: After starting the first operating system, the main core starts the second operating system according to the third message.
[0071] Exemplarily, the first operating system is a system that can provide a trusted execution environment TEE, and the first operating system can also be called TEE OS. The second operating system is a system that can provide a rich execution environment REE, and the second operating system can also be called REE OS. The main core starts TEE OS first and then starts REE OS, which meets security requirements.
[0072] In one possible implementation, the master core can start the second operating system by itself. In another possible implementation, the master core can also wake up the slave core to power on the slave core when starting the second operating system. The master core instructs the slave core to participate in the startup of the second operating system, and then the master core and the slave core start the REE OS together. Such a design can ensure that the slave core participates in the startup of the second operating system in a timely manner, and the startup efficiency based on the dual-core capability is higher, further reducing the startup time.
[0073] The startup method provided in the embodiment of the present application can be applied to electronic devices with image processing functions, such as Figure 4 This method is compared with the related art Figure 1 The improvement is that the steps of executing the secondary bootloader are implemented in the slave core, and starting TEE OS and loading REE OS are performed simultaneously. This design can advance the time for the master core to start TEE OS and REE OS, as well as configure the RGB Sensor, reducing the user's waiting time and improving the user experience.
[0074] Method 2
[0075] Considering that some business functions need to be configured with parameters first, such as function parameter configuration, reading of initialization data, etc., before they can be started normally. For example, the aforementioned electronic device with image processing function involves configuring the parameters of RGBSensor for the camera. In order to avoid the business parameter configuration increasing the user's waiting time, the business parameter configuration can be executed in advance, such as collaboration between multiple cores, parallel processing of business parameter configuration, and loading and starting of the aforementioned first operating system / second operating system.
[0076] like Figure 5 A startup method is shown, which can be executed by a master core and a slave core in collaboration. The method includes the following steps.
[0077] S501: The master core sends a first message to the slave core.
[0078] The first message is used to trigger the image loading of the first operating system, the image loading of the second operating system, and the image loading of the service parameter configuration program.
[0079] The service parameter configuration program is used to configure the service parameters of the electronic device. Optionally, the number of the service parameter configuration program can be one, and one service parameter configuration program can configure at least one service parameter; or the number of the service parameter configuration program can be multiple, and each of the multiple service parameter configuration programs can configure one service parameter.
[0080] In one possible design, the aforementioned one or more business parameter configuration programs can be encapsulated in a MiniOS, and the image loading and startup of one or more business parameter configuration programs can be understood as the loading and startup of the entire Mini OS. Such a design is conducive to the unified management of business parameters and improves startup efficiency. It is understandable that Mini OS can refer to a small system or lightweight system for managing and scheduling business parameter configuration programs, and Mini OS can also be replaced with other names, which is not limited in the embodiments of the present application.
[0081] Optionally, the image of the first operating system, the image of the second operating system, and the image of the business parameter configuration program (such as encapsulated in Mini OS) are stored in a non-volatile memory in the electronic device. The slave core loads the image of the first operating system, the image of the second operating system, and Mini OS in the non-volatile memory into the memory, so as to facilitate the subsequent startup of the first operating system, the second operating system, and Mini OS in the memory.
[0082] Optionally, a loader can be used to implement the image loading functions of the first operating system, the second operating system, and the business parameter configuration program, and the first message can also be understood as being used to trigger the execution of the loader. Exemplarily, after power-on reset, the main core can complete the initialization of the memory and the loading of the secondary Bootloader by executing Bootrom and the first-level Bootloader as in the related art. The function of the secondary Bootloader is to load the image of the business parameter configuration program, the image of the first operating system, and the image of the second operating system into the memory. Then, the main core starts the slave core and sends the first message to the slave core. After receiving the first message, the slave core completes the loading of the image of the business parameter configuration program, the image of the first operating system, and the image of the second operating system by executing the secondary Bootloader.
[0083] It can be understood that the slave core determines the image loading order of the business parameter configuration program (MiniOS), the first operating system, and the second operating system according to the execution process of the secondary Bootloader. Optionally, after completing the image loading of each operating system, the slave core notifies the main core that the image loading of this operating system has been completed. The main core can start the corresponding operating system in the order of notification. In the following steps of the embodiment of the present application, the image loading of the business parameter configuration program, the image loading of the first operating system, and the image loading of the second operating system are completed in sequence as an example for explanation.
[0084] S502: The slave core sends a fourth message to the master core.
[0085] The fourth message is used to indicate that the image loading of the business parameter configuration program is completed. Corresponding to the description in S501, the number of business parameter configuration programs whose image loading is completed indicated by the fourth message is one or more. One or more business parameter configuration programs can be encapsulated in a Mini OS design, which can also be understood as: the fourth message is used to indicate that the image loading of the Mini OS is completed.
[0086] S503, the master core starts the service configuration program according to the fourth message, and receives the second message from the slave core during the process of starting the service configuration program.
[0087] Corresponding to the description in S501 and S502, it can be understood that the main core starts one or more service configuration programs according to the fourth message. When one or more service parameter configuration programs are encapsulated in a Mini OS, the main core starts the service configuration program according to the fourth message, which can also be understood as: the main core starts the Mini OS according to the fourth message.
[0088] The following is a detailed description of the business parameter configuration procedure including configuring exposure parameters for camera-captured images. To further shorten the time spent in configuring exposure parameters, the embodiment of the present application provides a solution for configuring exposure parameters for camera-captured images in the following manner.
[0089] For example, a learning and training method can be used to use historical (such as before the startup process) images taken under various lighting scenes as training data or sample data, collect the corresponding ambient light parameters (such as brightness information) and exposure parameters of these images after convergence, and construct a mapping relationship table between ambient light parameters and exposure parameters. Optionally, image processing algorithm parameters involved in the corresponding image processing process can also be collected, and the mapping relationship between ambient light parameters, exposure parameters and image processing algorithm parameters can be saved in the mapping relationship table.
[0090] Among them, the ambient light sensor can provide the corresponding ambient light parameters after the image converges, the RGBSensor in the camera can provide the corresponding exposure parameters after the image converges, and the subsequent image processing unit can provide the image processing algorithm parameters. In a possible implementation, the above learning and training can be performed by the main core, for example, the main core reads the ambient light parameters under various lighting scenes from the ambient light sensor, reads the corresponding exposure parameters from the RGB Sensor, and / or reads the image processing algorithm from the image processing unit, and then the main core executes to build the aforementioned mapping relationship table. In another possible implementation, a communication interface can also be deployed in the electronic device, and the main core can control the transceiver function of the communication interface. The communication interface can send the corresponding ambient light parameters, exposure parameters, and corresponding image processing algorithm parameters after the image converges as training data to a remote management device or server. The remote management device or server builds a relationship mapping table and then sends the relationship mapping table to the communication interface of the electronic device. Optionally, the main core can control the relationship mapping table received from the outside to be stored in the aforementioned non-volatile memory, and load the relationship mapping table into the memory through the image loading of the business configuration parameter program.
[0091] Based on the above description, in the example where the business configuration parameter program is used to configure the exposure parameters of the camera shooting images, it can be understood that: the function of the business configuration parameter program includes triggering the acquisition function of the ambient light sensor, and when the main core starts the business configuration parameter program, the ambient light sensor can obtain the ambient light parameters when the camera shoots the image. The function of the business configuration parameter program also includes configuring the exposure parameters of the camera shooting images according to the ambient light parameters. For example, when the main core starts the business configuration parameter program, the ambient light parameters obtained by the ambient light sensor can be used as an input of the business configuration parameter program, and the business configuration parameter program queries the aforementioned relationship mapping table and outputs the exposure parameters corresponding to the ambient light parameters in the relationship mapping table. The exposure parameters output by the business configuration parameter program can be configured as the exposure parameters of the camera shooting images, for example, the exposure parameters output by the business configuration parameter program are written into the RGBSensor of the camera. Such a design does not require the convergence of the captured image during the startup process, which can further reduce the time of business parameter configuration, reduce the waiting time of users, and improve the user experience.
[0092] S504: The master core starts the first operating system according to the second message, and receives a third message from the slave core during the process of starting the first operating system.
[0093] This step can be understood with reference to S303, and will not be elaborated in detail in the embodiment of the present application.
[0094] S505: After starting the first operating system, the main core starts the second operating system according to the third message.
[0095] This step can be understood with reference to S304, and will not be elaborated in detail in the embodiment of the present application.
[0096] The startup method provided in the embodiment of the present application can be applied to electronic devices with image processing functions, such as Figure 6 This method is compared with the related art Figure 1 The improvements are as follows: the steps of executing the secondary Bootloader are implemented in the slave core, starting the TEE OS and loading the REE OS are performed simultaneously, and the exposure parameters are configured based on the ambient light parameters, which can reduce the user's waiting time and improve the user experience.
[0097] Method 3
[0098] When a high-speed storage medium such as an embedded multi-media card (eMMC) is used to implement the aforementioned non-volatile memory, the image loading efficiency of the first operating system, the second operating system, and the business parameter configuration program can be improved. In this design, the startup process of the business parameter configuration program can also be deployed in the slave core to achieve greater parallelism.
[0099] like Figure 7 A startup method is shown, which can be executed by a master core and a slave core in collaboration. The method includes the following steps.
[0100] S701: The master core sends a first message to the slave core.
[0101] Among them, the first message is used to trigger the image loading of the first operating system, the image loading of the second operating system, and the image loading of the business parameter configuration program. The business parameter configuration program is used to configure the business parameters of the electronic device. The storage method of the business parameter configuration program and the image can be understood by referring to the description in S501, and the embodiment of the present application will not be repeated. The difference between S701 and S501 is described in detail below.
[0102] Optionally, a program can be used to implement the image loading of the first operating system, the image loading of the second operating system, and the image loading startup function of the business parameter configuration program, and the first message can also be understood as being used to trigger the execution of the program. Exemplarily, after power-on reset, the main core can complete the initialization of the memory and the loading of the secondary Bootloader by executing the Bootrom and the first-level Bootloader as in the related art. The function of the secondary Bootloader is to load the image of the first operating system, the image of the business parameter configuration program, and the image of the second operating system into the memory, and to implement the startup of the business parameter configuration program in the memory. Then, the main core starts the slave core and sends the first message to the slave core. After the slave core receives the first message, it completes the image loading of the first operating system, the image loading and startup of the business parameter configuration program, and the image loading of the second operating system by executing the second-level Bootloader.
[0103] It can be understood that the slave core determines the order of image loading of the first operating system, image loading and startup of the business parameter configuration program, and image loading of the second operating system according to the execution process of the secondary Bootloader. Optionally, after completing the image loading of each operating system, the slave core notifies the main core that the image loading of this operating system has been completed. The main core can start the corresponding operating system in the notification order. In the following steps of the embodiment of the present application, the slave core executes the secondary Bootloader to sequentially complete the image loading of the first operating system, the image loading and startup of the business parameter configuration program, and the image loading of the second operating system.
[0104] S702, the slave core sends a second message to the master core.
[0105] This step can be understood with reference to S302, and will not be elaborated in detail in the embodiment of the present application.
[0106] S703a: The main core starts the first operating system according to the second message.
[0107] This step can be understood with reference to S303, and will not be elaborated in detail in the embodiment of the present application.
[0108] S703b, the slave core loads and starts the image of the business parameter configuration program.
[0109] S703b can be understood by referring to the number, packaging and function realization of the business parameter configuration program described in S501 to S503, except that: in S703b, the image loading and startup of the business parameter configuration program can be realized through the function of the secondary bootloader. This embodiment of the application will not be described in detail.
[0110] Furthermore, it can be understood that S703a and S703b are performed in parallel.
[0111] S704, after starting the service parameter configuration program, the slave core sends a third message to the master core.
[0112] In a possible implementation, the master core is still in the process of starting the first operating system synchronously, that is, the master core receives the third message from the slave core during the process of starting the first operating system. That is, it can be understood that S703a and S704 are parallel.
[0113] The step S704 can be understood with reference to S303, and will not be elaborated in detail in the embodiment of the present application.
[0114] S705: After starting the first operating system, the main core starts the second operating system according to the third message.
[0115] This step can be understood with reference to S304, and will not be elaborated in detail in the embodiment of the present application.
[0116] The startup method provided in the embodiment of the present application can be applied to electronic devices with image processing functions, such as Figure 8 This method is compared with the related art Figure 1 The improvement is that the steps of executing the secondary Bootloader are implemented in the slave core, starting TEE OS and loading REE OS are performed simultaneously, and starting TEE OS and loading and starting Mini OS (configuring exposure parameters) are also performed simultaneously, which can reduce the user's waiting time and improve the user experience.
[0117] Method 4
[0118] like Fig. 9 A startup method is shown, which can be executed by a master core and two slave cores in cooperation. The two slave cores are hereinafter referred to as slave core 1 and slave core 2. The method includes the following steps.
[0119] S901: The master core sends a first message to the slave core.
[0120] Among them, the first message is used to trigger the image loading of the first operating system, the image loading of the second operating system, and the image loading of the business parameter configuration program. The business parameter configuration program is used to configure the business parameters of the electronic device. The storage method of the business parameter configuration program and the image can be understood by referring to the description in S501, and the embodiment of the present application will not be repeated. The difference between S901 and S501 is described in detail below.
[0121] The number of slave cores in S901 can be multiple, such as slave core 1 and slave core 2. The master core can send a first message to slave core 1 and send a first message to slave core 2. Exemplarily, after power-on reset, the master core can complete the initialization of the memory and the loading of the secondary Bootloader by executing steps 1 and 2 in the related art, that is, executing Bootrom and the first-level Bootloader. The function of the second-level Bootloader is to load the image of the first operating system, the image of the business parameter configuration program, and the image of the second operating system into the memory, and to implement the startup of the business parameter configuration program in the memory.
[0122] Then, the master core starts slave core 1 and slave core 2, and sends a first message to slave core 1 and slave core 2. Optionally, a program may be used to implement the image loading of the first operating system, the image loading of the second operating system, and the image loading and starting function of the business parameter configuration program, and the first message may also be understood as being used to trigger the execution of the program.
[0123] After receiving the first message, slave core 1 and slave core 2 can collaboratively execute the secondary Bootloader to complete the image loading of the first operating system, the image loading and startup of the business parameter configuration program, and the image loading of the second operating system. In other words, the function of the secondary Bootloader can be implemented by multiple slave cores. For example, the secondary Bootloader is divided into two parts, recorded as secondary Bootloader-1 and secondary Bootloader-2, slave core 1 is responsible for executing secondary Bootloader-1, and slave core 2 is responsible for executing secondary Bootloader-2. Exemplarily, the functions of the secondary Bootloader-1 may include the image loading of the first operating system and the image loading of the second operating system; the functions of the secondary Bootloader-2 may include the image loading and startup of the business parameter configuration program. The execution of the secondary Bootloader-1 by slave core 1 and the execution of the secondary Bootloader-2 by slave core 2 can be parallel. Such a design can further shorten the startup time, reduce the user's waiting time, and thus improve the user experience.
[0124] It can be understood that slave core 1 determines the order of image loading of the first operating system and the image loading of the second operating system according to the execution process of the secondary Bootloader-1. Optionally, after completing the image loading of each operating system, slave core 1 notifies the main core that the image loading of this operating system has been completed. The main core can start the corresponding operating system in the notification order. In the following steps of the embodiment of the present application, it is explained by taking the slave core 1 executing the secondary Bootloader-1 to complete the image loading of the first operating system and the image loading of the second operating system in sequence as an example.
[0125] S902, slave core 1 sends a second message to the master core.
[0126] This step can be understood with reference to S302, and will not be elaborated in detail in the embodiment of the present application.
[0127] S903, slave core 2 loads and starts the image of the service parameter configuration program according to the first message.
[0128] S903 can be understood by referring to the number, packaging and function realization of the business parameter configuration programs described in S501 to S503, except that the image loading and startup of the business parameter configuration programs in S902 are realized by the function of the secondary Bootloader-2. This embodiment of the application will not be elaborated on this.
[0129] S904: The master core starts the first operating system according to the second message, and receives a third message from the slave core during the process of starting the first operating system.
[0130] This step can be understood with reference to S303, and will not be elaborated in detail in the embodiment of the present application.
[0131] It can be understood that, in the process of image loading and starting the service parameter configuration program from core 2, core 1 sends the second message and the third message, and the master core starts the first operating system. S902 and S903 can be regarded as parallel, and S903 and S904 can also be regarded as parallel, but the execution order between S902 and S904 is: execute S902 first and then execute S904.
[0132] S905: After starting the first operating system, the main core starts the second operating system according to the third message.
[0133] This step can be understood with reference to S304, and will not be elaborated in detail in the embodiment of the present application.
[0134] The startup method provided in the embodiment of the present application can be applied to electronic devices with image processing functions, such as Fig.10 This method is compared with the related art Figure 1 The improvement is that the function of the secondary Bootloader is implemented in multiple slave cores, and starting TEE OS, loading REE OS, and loading and starting Mini OS (configuring exposure parameters) are performed simultaneously, which can reduce the user's waiting time and improve the user experience.
[0135] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computer or stored in any available medium. When the computer program product is run on a computer, the computer executes the above-mentioned startup method, or a computer group executes the above-mentioned startup method.
[0136] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computer to execute the above-mentioned startup method.
[0137] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0138] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices, and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0139] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0141] In the embodiments of the present application, under the premise of no logical contradiction, the examples may reference each other, for example, the methods and / or terms between method embodiments may reference each other, for example, the functions and / or terms between device embodiments may reference each other, for example, the functions and / or terms between device examples and method examples may reference each other.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present application.
Claims
1. A startup method, characterized in that: Applied to an electronic device including a multi-core processor, the method comprises: The master core sends a first message to the slave core, where the first message is used to trigger image loading of the first operating system and image loading of the second operating system; The slave core sends a second message to the master core, where the second message is used to indicate that image loading of the first operating system is complete; The master core starts the first operating system according to the second message, and receives a third message from the slave core during the process of starting the first operating system; wherein the third message is used to indicate that the image loading of the second operating system is completed; After starting the first operating system, the main core starts the second operating system according to the third message.
2. The method according to claim 1, characterized in that The first message is also used to trigger the image loading of a service parameter configuration program, and the service parameter configuration program is used to configure the service parameters of the electronic device.
3. The method according to claim 2, characterized in that The method further comprises: The slave core sends a fourth message to the master core, where the fourth message is used to indicate that the image loading of the service parameter configuration program is completed; The master core starts the service parameter configuration program according to the fourth message, and receives the second message from the slave core during the process of starting the service parameter configuration program.
4. The method according to claim 2, characterized in that The method further comprises: After sending the second message, the slave core performs image loading and startup of the service parameter configuration program; After starting the service parameter configuration program, the slave core sends the third message to the master core.
5. The method according to any one of claims 2 to 4, characterized in that: The electronic device also includes a camera and an ambient light sensor, wherein the ambient light sensor obtains ambient light parameters of the image taken by the camera, and the business parameter configuration program is used to configure exposure parameters of the image taken by the camera according to the ambient light parameters.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The slave core enters a dormant state after sending the third message; The master core wakes up the slave core during the process of starting the second operating system, and instructs the slave core to participate in starting the second operating system.
7. The method according to any one of claims 1 to 6, characterized in that: The first operating system is used to provide a trusted execution environment TEE, and the second operating system is used to provide a rich execution environment REE.
8. An electronic device, characterized in that: including a multi-core processor; wherein, The master core is used to send a first message to the slave core, wherein the first message is used to trigger the image loading of the first operating system and the image loading of the second operating system; The slave core is used to send a second message to the master core, where the second message is used to indicate that the image loading of the first operating system is complete; The main core is also used for: booting the first operating system according to the second message, and receiving a third message from the slave core during the booting of the first operating system; the third message is used to indicate that the image loading of the second operating system is complete; After starting the first operating system, starting the second operating system according to the third message.
9. The electronic device according to claim 8, characterized in that: The first message is also used to trigger the image loading of a service parameter configuration program, and the service parameter configuration program is used to configure the service parameters of the electronic device.
10. The electronic device according to claim 9, characterized in that: The slave core is further used to send a fourth message to the master core, where the fourth message is used to indicate that the image loading of the service parameter configuration program is completed; The master core is further configured to start the service parameter configuration program according to the fourth message, and receive the second message from the slave core during the process of starting the service parameter configuration program.
11. The electronic device according to claim 9, characterized in that: The slave core is also used for: After sending the second message, loading and starting the image of the service parameter configuration program; After starting the service parameter configuration program, sending the third message to the main core.
12. The electronic device according to any one of claims 9 to 11, characterized in that: The electronic device also includes a camera and an ambient light sensor; The camera is used to capture images; The ambient light sensor is used to obtain the ambient light parameters when the camera takes an image, and the business parameter configuration program is used to configure the exposure parameters of the image taken by the camera according to the ambient light parameters.
13. The electronic device according to any one of claims 8 to 12, characterized in that: The slave core is further configured to enter a dormant state after sending the third message; The master core is further configured to wake up the slave core during the process of starting the second operating system and instruct the slave core to participate in starting the second operating system.
14. The electronic device according to any one of claims 8 to 13, characterized in that: The first operating system is used to provide a trusted execution environment TEE, and the second operating system is used to provide a rich execution environment REE.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises computer program instructions, and when the computer program instructions are executed by a computer, the computer is caused to perform the method according to any one of claims 1 to 7.
16. A computer program product, characterized in that The computer program product comprises instructions, and when the instructions are executed by a computer device, the computer device executes the method according to any one of claims 1 to 7.
Citation Information
Cited By
Mirroring service starting method oriented to operating system and electronic equipment
CN119829150A
