CN115080126A - Switching method and device of shared hardware, electronic equipment and storage medium - Google Patents

Switching method and device of shared hardware, electronic equipment and storage medium Download PDF

Info

Publication number
CN115080126A
CN115080126A CN202110272602.2A CN202110272602A CN115080126A CN 115080126 A CN115080126 A CN 115080126A CN 202110272602 A CN202110272602 A CN 202110272602A CN 115080126 A CN115080126 A CN 115080126A
Authority
CN
China
Prior art keywords
hardware
occupation
shared hardware
state
switching
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110272602.2A
Other languages
Chinese (zh)
Inventor
罗恒勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110272602.2A priority Critical patent/CN115080126A/en
Publication of CN115080126A publication Critical patent/CN115080126A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • G06F9/4408Boot device selection

Abstract

The application discloses a switching method and device of shared hardware, electronic equipment and a storage medium, which relate to the technical field of electronic equipment and comprise the following steps: the method comprises the steps of responding to a system switching instruction, detecting the occupation state of a first system on shared hardware, when the occupation state is occupation, removing the occupation of the first system on the shared hardware, switching an operating system of the electronic equipment from the first system to a second system, responding to the hardware occupation instruction, controlling the second system to control the shared hardware, firstly removing the occupation of the first system on the shared hardware, switching the operating system to the second operating system, and ensuring that the switched second operating system can use the shared hardware in time, thereby ensuring the normal operation of the electronic equipment and improving the user experience.

Description

Switching method and device of shared hardware, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of electronic device technologies, and in particular, to a method and an apparatus for switching shared hardware, an electronic device, and a storage medium.
Background
The dual system means that two different operating systems can be installed on the same electronic device in order to meet different operating requirements or solve software compatibility problems. Two operating systems of the electronic device need to cooperate with hardware to execute respective corresponding functions, and because the volume and the weight of the electronic device are limited, the number of the hardware devices installed on the electronic device is also limited, and how to call and distribute the hardware between the two operating systems has certain difficulty.
Disclosure of Invention
In view of the above problems, the present application provides a switching method and apparatus for shared hardware, an electronic device, and a storage medium, which can solve the above problems.
In a first aspect, an embodiment of the present application provides a switching method for shared hardware, which is applied to an electronic device, where the electronic device includes a first system, a second system, and shared hardware of the first system and the second system, and the method includes: detecting an occupation state of the shared hardware by the first system in response to a system switching instruction, wherein the system switching instruction is used for instructing the electronic equipment to switch an operating system from the first system to the second system; when the occupation state is occupation, removing the occupation of the first system on the shared hardware, and switching the operating system of the electronic equipment from the first system to the second system; and responding to a hardware occupation instruction, and controlling the second system to control the shared hardware.
In a second aspect, an embodiment of the present application provides a switching apparatus for sharing hardware, which is applied to an electronic device, where the electronic device includes a first system, a second system, and hardware shared by the first system and the second system, and the apparatus includes: the detection module is used for responding to a system switching instruction and detecting the occupation state of the first system on the shared hardware, wherein the system switching instruction is used for instructing the electronic equipment to switch an operating system from the first system to the second system; a release module, configured to release the occupation of the shared hardware by the first system and switch an operating system of the electronic device from the first system to the second system when the occupation state is occupation; and the occupation module is used for responding to a hardware occupation instruction and controlling the second system to control the shared hardware.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the above-described methods.
In a fourth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
The method is applied to electronic equipment, the electronic equipment comprises a first system, a second system and shared hardware of the first system and the second system, the electronic equipment responds to a system switching instruction and detects the occupation state of the first system to the shared hardware, wherein the switching instruction is used for instructing the electronic equipment to switch an operating system from the first system to the second system, when the occupation state is occupation, the occupation of the shared hardware by the first system is removed, the operating system of the electronic equipment is switched from the first system to the second system, the second system is controlled to control the shared hardware in response to the hardware occupation instruction, on one hand, after the occupation of the shared hardware by the first system is removed, the operating system is switched to the second operating system, the second operating system after switching can use the shared hardware more quickly, the second operating system can timely execute the corresponding function through shared hardware, normal work of the electronic equipment is guaranteed, and meanwhile user experience is improved.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a block diagram of an electronic device provided herein;
fig. 2 is a flowchart illustrating a switching method for shared hardware according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating a switching method for shared hardware according to another embodiment of the present application;
FIG. 4 is a flow chart illustrating a method for switching shared hardware according to another embodiment of the present application;
FIG. 5 is a flow chart illustrating a method for switching shared hardware according to still another embodiment of the present application;
FIG. 6 is a flow chart illustrating a method for switching shared hardware according to yet another embodiment of the present application;
FIG. 7 is a block diagram of a switching device sharing hardware according to an embodiment of the present application;
FIG. 8 is a block diagram of an electronic device for performing a switching method of shared hardware according to an embodiment of the present application;
fig. 9 is a storage unit for storing or carrying program codes for implementing a switching method of shared hardware according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
The dual system means that two different operating systems can be installed on the same electronic device in order to meet different operating requirements or solve software compatibility problems. Two operating systems of the electronic device need to cooperate with hardware to execute respective corresponding functions, and because the volume and the weight of the electronic device are limited, the number of the hardware devices installed on the electronic device is also limited, and how to call and distribute the hardware between the two operating systems has certain difficulty.
In view of the above technical problems, the inventors have found and proposed a method and an apparatus for switching shared hardware, an electronic device, and a storage medium, in response to a system switching instruction, and after first removing the occupation of the shared hardware by a first system, automatically switching an operating system to a second operating system, and controlling the second system to control the shared hardware, so that the functions of the electronic device are ensured, and at the same time, the user experience is improved. The specific switching method of the shared hardware is specifically described in the following embodiments.
In this embodiment, the operating system of the electronic device includes a first system and a second system. Operating systems rely on processors to perform operations.
In some embodiments, the first operating system and the second operating system respectively run in different processors, for example, referring to fig. 1, the electronic device 100 includes a processor, a controller and shared hardware 130, wherein the processor includes a first processor 111 and a second processor 112, the controller includes a first controller 121 and a second controller 122, the first processor 111 is connected to the second processor 112 and the first controller 121, the second processor 112 is connected to the second controller 122, and the shared hardware 130 is connected to the first controller 121 and the second controller 122. The first processor 111 is used to run a first system, and the second processor 112 is used to run a second system.
When the first system controls the shared hardware 130, the first processor 111 controls the first controller 121 to be connected to the shared hardware 130, and the first processor 111 may forward a control instruction of the first processor 111 through the first controller 121 to control the shared hardware 130 to execute the instruction. Similarly, when the second system controls the common hardware 130, the second processor 112 controls the second controller 122 to be connected with the common hardware 130, and the second processor 112 may forward the control instruction of the second processor 112 through the second controller 122 to control the common hardware 130 to execute the instruction. It should be noted that, in order to ensure that the shared hardware normally performs its functions, the shared hardware 130 is controlled by only one controller at a time, i.e., the shared hardware 130 is controlled by the first controller 121, or the shared hardware 130 is controlled by the second controller 122. That is, when the shared hardware 130 is mounted on the first processor 111, the first system running on the first processor 111 can normally call the shared hardware 130 to control the shared hardware 130; similarly, when the shared hardware 130 is mounted on the second processor 121, the second system running on the second processor 121 may normally call the shared hardware 130 to control the shared hardware 130. The shared hardware 130 refers to hardware that can be called by the first system or the second system, that is, both the first system and the second system can execute a certain operation by calling the shared hardware 130. The common hardware 130 may include, but is not limited to: vibrating motor, screen, loudspeaker, camera.
Fig. 2 is a schematic flow chart illustrating a switching method of shared hardware according to an embodiment of the present application, where the shared hardware is hardware controlled by the first system or the second system, and when the shared hardware is released from being occupied by the first system, the operating system is automatically switched to the second operating system, so as to improve user experience. In a specific embodiment, the switching method of the shared hardware is applied to the switching apparatus 200 of the shared hardware shown in fig. 7 and the electronic device 100 (fig. 8) configured with the switching apparatus 200 of the shared hardware. The specific process of this embodiment will be described below by taking an example that the switching method of the shared hardware is applied to an electronic device, where the electronic device includes a first system, a second system, and shared hardware of the first system and the second system, and it is understood that the electronic device applied in this embodiment may be a mobile phone, a tablet computer, a desktop computer, a notebook computer, an intelligent watch, an intelligent bracelet, and the like, which is not limited herein. As will be described in detail with respect to the flow shown in fig. 2, the method for switching shared hardware may specifically include the following steps:
step S110, responding to a system switching instruction, and detecting an occupation state of the shared hardware by the first system.
Wherein the system switching instruction is used for instructing the electronic device to switch the operating system from the first system to the second system. The system switching instruction may be obtained according to an input of a user or a preset.
In some embodiments, a user performs an input operation through an input key, and based on the input operation, a system switching instruction is generated. Optionally, the input keys comprise physical keys and virtual keys. When the input key is a physical key, the user can perform input operation in a pressing mode, a touch mode and the like on the physical key, and a system switching instruction is generated based on the input operation. The electronic equipment further comprises a touch screen, when the input keys comprise virtual keys, a user performs input operation on the virtual keys on the touch screen in a touch mode, a click mode, a sliding mode, a dragging mode, a pressing mode and the like, and a system switching instruction is generated based on the input operation.
In other embodiments, the user generates the system switching instruction based on a preset by presetting the electronic device. If the user presets to generate the system switching instruction at the preset time point, for example, the first system is incompatible with the alarm clock application software, and the second system is compatible with the alarm clock application software, so that the alarm clock application program can be installed in the second system, and the user presets to generate the system switching instruction at the preset time point of 6:00, so as to instruct the electronic device to switch the operating system from the first system to the second system at the preset time point of 6: 00.
In other embodiments, the electronic device may receive a system switching instruction sent by another electronic device, so as to implement switching of the operating system by remotely controlling the electronic device. For example, the electronic device is a smart watch, the other electronic devices are mobile phones, the mobile phones send system switching instructions to the smart watch, and the smart watch is remotely assisted to switch operating systems.
When a system switching instruction is received or generated, the occupation state of the first system to the shared hardware is detected in response to the system switching instruction, wherein the occupation state comprises occupation and non-occupation.
When the occupation state is detected to be unoccupied, the first system does not use the shared hardware, namely the first system is not connected with the shared hardware, and the operating system is directly switched from the first system to the second system.
When the occupied state is detected as occupied as shown in fig. 1, it indicates that the first system is using the shared hardware, and step S120 is executed.
Alternatively, the common hardware may include cameras, microphones, speakers, indicator lights, antennas, and the like.
Step S120, when the occupation state is occupation, removing the occupation of the shared hardware by the first system, and switching the operating system of the electronic device from the first system to the second system.
When it is detected that the occupied state is occupied, the first system first releases the occupation of the shared hardware, that is, the connection between the first controller 121 and the shared hardware 130 in fig. 1 is disconnected, so that the shared hardware is in an idle state, and the hardware resources are released, where the idle state is a state without occupation of the operating system. It can be understood that the shared hardware is in an idle state, and hardware resources are idle, so that the second system can conveniently control the shared hardware. And the operating system of the electronic equipment is switched from the first operating system to the second operating system, so that the user can use the application software and the functions on the second operating system conveniently.
For example, when the common hardware includes a speaker, the application software installed on the first system and the second system is different, e.g., the first system is not compatible with the personalized alarm clock application software, and the second system is compatible with the personalized alarm clock application software. When a user sets an alarm clock and detects that the occupied state is occupied, the occupation of the first system on the loudspeaker is removed, the microphone resource is left, the operating system is switched from the first system to the second operating system, and the user can conveniently use the personalized alarm clock application software in the second system.
And step S130, responding to a hardware occupation instruction, and controlling the second system to control the shared hardware.
Wherein the hardware seizure instruction is for requesting the second system to control the shared hardware.
In some implementations, the hardware engagement instructions are automatically generated for the electronic device. When the operating system is successfully switched to the second system, the electronic equipment generates and responds to the hardware occupation instruction to control the second system to control the shared hardware, and before the user uses the shared hardware, the second system occupies the shared hardware in advance, so that the electronic equipment can call the shared hardware in time when the user uses the hardware. For example, the shared hardware is a loudspeaker, and the second system is controlled to control the loudspeaker immediately after the second system is successfully switched according to the hardware occupation instruction. When the user plays music after switching the second system for 10 minutes, the loudspeaker can be called in time to play the music.
In other embodiments, the hardware engagement instructions are generated based on user input. When the operating system is successfully switched to the second system, when a hardware occupation instruction input by a user is detected, the hardware occupation instruction is responded, the second system is controlled to control the shared hardware, when the user needs to use the shared hardware, the second system occupies the shared hardware, and when the user does not need to use the shared hardware, the shared hardware is in an idle state, and hardware resources are made. The hardware occupation instruction can be input by a user through a touch screen of the electronic equipment, can be input by the user through physical keys of the electronic equipment, and can also be input remotely by other electronic equipment. For example, the shared hardware is a loudspeaker, when a user plays music after switching the second system for 10 minutes, a hardware occupation instruction is generated based on the music playing operation of the user on the electronic device, the second system is controlled to control the shared hardware based on the hardware occupation instruction, and the music is played through the loudspeaker after the hardware occupation.
The method for switching shared hardware provided by this embodiment is applied to an electronic device, where the electronic device includes a first system, a second system, and shared hardware of the first system and the second system, and the electronic device responds to a system switching instruction to detect an occupation state of the shared hardware by the first system, where the switching instruction is used to instruct the electronic device to switch an operating system from the first system to the second system, and when the occupation state is occupation, the occupation of the shared hardware by the first system is released, and the operating system of the electronic device is switched from the first system to the second system, and in response to the hardware occupation instruction, the second system is controlled to control the shared hardware, on one hand, after the occupation of the shared hardware by the first system is released, the operating system is switched to the second operating system, it is ensured that the switched second operating system can use the shared hardware more quickly, and it is ensured that the second operating system can execute a corresponding function through the shared hardware in time, the situation that hardware equipment cannot be used in time after system switching is avoided, so that user experience is reduced, on the other hand, a system switching instruction is responded, the automatic switching system avoids the complex process of manual operation of a user, and the user experience is further improved.
The present embodiment provides a method for switching shared hardware based on the previous embodiment, which is used to automatically switch an operating system from a second system back to a first system, and fig. 3 shows a flowchart of a method for switching shared hardware according to another embodiment of the present application, please refer to fig. 3, where the method for switching shared hardware specifically includes the following steps:
step S210, detecting an occupation state of the shared hardware by the first system in response to a system switching instruction, where the system switching instruction is used to instruct the electronic device to switch an operating system from the first system to the second system.
Step S220, when the occupation state is occupation, removing the occupation of the shared hardware by the first system, and switching the operating system of the electronic device from the first system to the second system.
And step S230, controlling the second system to control the shared hardware in response to the hardware occupation instruction.
For detailed description of steps S210 to S230, please refer to steps S110 to S130, which are not described herein again.
Step S240, when the second system finishes occupying the shared hardware, releasing the occupation of the shared hardware by the second system.
In this embodiment, the first system is used as a main system, the second system is used as an auxiliary system, and the functions of the first system are supplemented by the second system. And when the second system finishes occupying the hardware, the occupation of the second system on the shared hardware is released, and the hardware resources are made.
For example, when the hardware occupation instruction is that the loudspeaker is occupied to play the text audio for 30 minutes, and the text audio is played for 30 minutes by the loudspeaker, the hardware occupation is determined to be finished, and the hardware occupation instruction is generated and responded to remove the occupation of the loudspeaker by the second system.
Step S250, switching the operating system of the electronic device from the second system to the first system, and controlling the first system to control the common hardware.
And automatically switching the operating system of the electronic equipment from the second system to the first system, and controlling the first system to control the shared hardware so as to facilitate the first system to call the shared hardware. It can be understood that after the auxiliary system completes the auxiliary function, the main system is automatically switched to the main system, the main system includes a function with a higher frequency than that of the use of multiple users, and after the main system is switched to the auxiliary system, the user can conveniently use the common functions.
In this embodiment, in response to a system switching instruction, when it is detected that the first system controls the shared hardware, the first system releases the occupation of the shared hardware, switches the operating system to the second system, controls the second system to control the shared hardware, and automatically switches the operating system to the first system after the shared hardware is finished, and controls the first system to control the shared hardware, so as to improve user experience.
In this embodiment, on the basis of the foregoing embodiment, a method for switching shared hardware is provided, which is used to automatically switch an operating system according to a screen state of a touch screen of an electronic device, and fig. 4 shows a flowchart of a method for switching shared hardware according to another embodiment of the present application, please refer to fig. 4, where the method for switching shared hardware specifically includes the following steps:
and step S310, detecting the screen state of the touch screen.
Optionally, the screen state of the touch screen can be detected in real time; the screen status may be detected at a preset frequency, for example, at a frequency of 30 times per minute.
The screen state comprises a bright screen state and a dead screen state. The electronic device may be preset in a bright screen state, where the electronic device controls the operating system to be in the first system, and in a dead screen state, where the electronic device controls the operating system to be in the second system.
When the state of the touch screen of the electronic device changes, the operating system is switched, when the screen of the touch screen is always in the bright screen state, the operating system is still the first system, and when it is detected that the screen state is switched from the bright screen state to the off screen state, step S320 is executed.
Step S320, when it is detected that the screen state is switched from the bright screen state to the off screen state, generating the system switching instruction.
In some possible embodiments, the electronic device performs different functions in different screen states, and the different functions may be performed under different operating systems. For example, a first system is compatible with software a, but a second system is not compatible with software a, and software a runs in a bright screen state; the second system is compatible with the B software, but the first system is not compatible with the B software, and the B software runs in a screen-off state. And when the screen state is detected to be switched from the bright screen state to the off screen state, generating a system switching instruction for indicating the operating system to be switched from the first system to the second system, and running the software B through the second system.
In other possible implementations, the rate of power consumption by the first system is different from the rate of power consumption by the second system, and the rate of power consumption by the first system is greater than the rate of power consumption by the second system. More application software is installed in the first system, and a plurality of application software with higher frequency or a plurality of basic application software (such as instant messaging software, alarm clock software and the like) used by a user are installed in the second system. When the touch screen is in a bright screen state, the operating system of the electronic equipment is a first system so as to run more application software and provide multiple entertainment modes for users. When the touch screen is in a screen-off state, the operating system of the electronic device is a second system to run necessary application software, so that the power consumption of the electronic device is reduced while the basic functions are satisfied. When the screen state is detected to be switched from the bright screen state to the off screen state, a system switching instruction is generated to indicate the operating system to be switched from the first system to the second system, and a plurality of basic application software are operated through the second system.
Step S330, detecting an occupation state of the shared hardware by the first system in response to a system switching instruction, where the system switching instruction is used to instruct the electronic device to switch an operating system from the first system to the second system.
Step S340, when the occupation state is occupation, removing the occupation of the shared hardware by the first system, and switching the operating system of the electronic device from the first system to the second system.
And step S350, responding to a hardware occupation instruction, and controlling the second system to control the shared hardware.
For the detailed description of steps S330 to S350, refer to steps S110 to S130, which are not described herein again.
And step S360, detecting the screen state of the touch screen.
Similarly, the screen state of the touch screen can be detected in real time; the screen status may be detected at a preset frequency, for example, at a frequency of 30 times per minute.
Step S370, when it is detected that the screen state is switched from the screen-off state to the screen-on state, releasing the occupation of the shared hardware by the second system.
Due to the fact that the screen is preset in a bright screen state, the electronic equipment control operation system is in the first system, the electronic equipment control operation system is in the second system in a screen off state, when the screen state is detected to be switched from the screen off state to the bright screen state, the operation system needs to be switched, and before the operation system is switched, occupation of the second system on shared hardware is removed, so that hardware resources are made available, and the switched system occupies the shared hardware.
And step S380, switching the operating system of the electronic equipment from the second system to the first system.
In some embodiments, the operating system of the electronic device is switched from the second system to the first system, and when the first system needs to use the shared hardware, the first system is controlled to control the shared hardware. For example, when the instant messaging software of the first system needs to play voice, and when the user performs a play operation on the touch screen, the first system is controlled to control the loudspeaker so as to play voice through the loudspeaker.
In other embodiments, the operating system of the electronic device is switched from the second system to the first system, and the first system is controlled to control the shared hardware when the operating system is successfully switched to the first system.
In the method for switching shared hardware provided in the embodiment, the screen state of the touch screen is detected, where the screen state includes a bright screen state and a dead screen state, when a change in the screen state is detected, that is, when the screen state is detected to be switched from the bright screen state to the dead screen state, a system switching instruction is generated, then the system switching instruction is responded, occupation of the shared hardware by the first system is released, the operating system is switched from the first operating system to the second operating system, the screen state of the touch screen is detected continuously, when a change in the screen state is detected again, that is, when the screen state is detected to be switched from the dead screen state to the bright screen state, occupation of the shared hardware by the second system is released, the operating system of the electronic device is switched from the second system to the first system, in the embodiment, the operating system is automatically switched by the change in the screen state of the touch screen of the electronic device, the complicated process of manual switching of the user is avoided, and the user experience is improved.
In this embodiment, on the basis of the foregoing embodiment, a method for switching shared hardware is provided, and is used to control switching of an operating system according to a remaining power of an electronic device and a power consumption rate of the operating system, and fig. 5 shows a flowchart of a method for switching shared hardware according to still another embodiment of the present application, please refer to fig. 5, where the method for switching shared hardware specifically includes the following steps:
and S410, responding to a system switching instruction, and acquiring the current residual electric quantity of the electronic equipment.
The current remaining capacity is a remaining capacity of a battery of the electronic device, and may be displayed on a touch screen of the electronic device, for example, the current remaining capacity may be displayed as 80% or 20%.
Step S420, when the current remaining power is less than a preset power, obtaining a power consumption rate of the first system, and obtaining a power consumption rate of the second system.
The preset electric quantity may be preset, for example, the preset electric quantity may be 10%, 20%, or the like.
When the current remaining power is greater than the preset power, it indicates that the power in the electronic device is sufficient, and after the occupation state of the first system on the shared hardware is detected, step S440-step S450 are executed.
And when the current residual electric quantity is smaller than the preset electric quantity, acquiring the electric quantity loss rate of the first system and the electric quantity loss rate of the second system, and selecting the system with the low electric quantity loss rate to operate in the two systems.
Step S430, when the power consumption rate of the first system is greater than the power consumption rate of the second system, detecting an occupied state of the first system on the shared hardware.
When the power consumption rate of the first system is smaller than that of the second system, the power consumption rate of the first system is lower, the first system is continuously used, and the first system continuously occupies the shared hardware.
And when the electric quantity loss rate of the first system is greater than that of the second system, the electric quantity loss rate of the second system is lower, and the occupation state of the first system on the shared hardware is detected before the operating system is switched. If the occupation state is occupation, the operation system of the electronic equipment is switched from the first system to the second system after the occupation of the shared hardware by the first system is removed; and if the occupied state is unoccupied, directly switching the operating system of the electronic equipment from the first system to the second system.
Step S440, when the occupation state is occupation, removing the occupation of the shared hardware by the first system, and switching the operating system of the electronic device from the first system to the second system.
And step S450, responding to a hardware occupation instruction, and controlling the second system to control the shared hardware.
For detailed description of steps S440 to S450, please refer to steps S120 to S130, which are not described herein again.
In this embodiment, the operating system of the electronic device is switched from the first system to the second system, a system switching instruction is responded, the current remaining power of the electronic device is obtained, when the current remaining power is less than the preset power, the power loss rate of the first system is obtained, the power loss rate of the second system is obtained, and when the power loss rate of the first system is greater than the power loss rate of the second system, the operating system is switched.
Optionally, fig. 6 shows a schematic flow chart of a switching method for shared hardware according to still another embodiment of the present application, please refer to fig. 6, where the switching method for shared hardware specifically includes the following steps:
when the electronic equipment receives a first unlocking password in a screen locking state, the electronic equipment is controlled to set an operating system as the first system. Or when the electronic equipment receives a second unlocking password in the screen locking state, controlling the electronic equipment to set the operating system as the second system.
When the user inputs the first unlocking password, the following steps are performed.
Step S510, detecting an occupation state of the shared hardware by the first system in response to a system switching instruction, where the system switching instruction is used to instruct the electronic device to switch an operating system from the first system to the second system.
Step S520, when the occupation state is occupation, removing the occupation of the shared hardware by the first system, and switching the operating system of the electronic device from the first system to the second system.
For the detailed description of steps S510 to S520, refer to steps S110 to S120, which are not described herein again.
Step S530, obtaining the current time.
Alternatively, the electronic device may obtain a current time local to the electronic device, and the current time may be displayed on a touch screen of the electronic device. The electronic device may also obtain the current time from the server. For example, the current time may be 9: 00.
And when the current time does not meet the preset time, continuously acquiring the current time.
And step S540, when the current time meets a preset time, generating the hardware occupation instruction.
The preset time is preset time for the second system to control the shared hardware.
When the current time meets the preset time, it can be understood that the current time reaches the preset time, for example, the preset time is 6:00, and when the current time is 6:00, the current time reaches the preset time, and a hardware occupation instruction is generated.
For example, the shared hardware is a loudspeaker, the user sets a 6:00 reminder on the electronic device, and when the current time reaches 6:00, a hardware occupation instruction is generated to control the second system to control the loudspeaker to play the reminder.
And step S550, responding to the hardware occupation instruction, and controlling the second system to control the shared hardware.
For detailed description of step S550, please refer to step S130, which is not described herein again.
In this embodiment, when the current time meets the preset time, the hardware occupation instruction is automatically generated and responded, and the second system is controlled to control the shared hardware, so that the user operation is simplified, and the user experience is improved.
To implement the foregoing method class embodiments, this embodiment provides a hardware-sharing switching apparatus, fig. 7 shows a block diagram of the hardware-sharing switching apparatus provided in an embodiment of the present application, please refer to fig. 7, where the hardware-sharing switching apparatus 200 is applied to an electronic device, the electronic device includes a first system, a second system, and hardware sharing between the first system and the second system, and the hardware-sharing switching apparatus 200 includes: a detection module 210, a release module 220, and an occupancy module 230.
A detecting module 210, configured to detect an occupation state of the shared hardware by the first system in response to a system switching instruction, where the system switching instruction is used to instruct the electronic device to switch an operating system from the first system to the second system.
A removing module 220, configured to remove the occupation of the shared hardware by the first system and switch the operating system of the electronic device from the first system to the second system when the occupation state is occupation.
And an occupation module 230, configured to control the second system to control the shared hardware in response to a hardware occupation instruction.
Optionally, the hardware-shared switching apparatus 200 further includes: the device comprises a first screen state detection module and a screen-off switching module.
The first screen state detection module is used for detecting the screen state of the touch screen, wherein the screen state comprises a screen on state and a screen off state.
A screen-off switching module for generating the system switching instruction when the screen state is switched from the bright screen state to the screen-off state,
optionally, the hardware-shared switching apparatus 200 further includes: the system comprises a second screen state detection module, a bright screen switching module and a system switching module.
And the second screen state detection module is used for detecting the screen state of the touch screen.
And the bright screen switching module is used for releasing the occupation of the second system on the shared hardware when the screen state is detected to be switched from the screen-off state to the bright screen state.
And the system switching module is used for switching the operating system of the electronic equipment from the second system to the first system.
Optionally, the detection module 210 includes: the system comprises a current remaining power detection submodule, a power consumption rate acquisition submodule and a hardware occupation detection submodule.
And the current residual electric quantity detection submodule is used for responding to a system switching instruction and acquiring the current residual electric quantity of the electronic equipment.
And the electric quantity loss rate acquisition submodule is used for acquiring the electric quantity loss rate of the first system and acquiring the electric quantity loss rate of the second system when the current residual electric quantity is smaller than the preset electric quantity.
And the hardware occupancy detection submodule is used for detecting the occupancy state of the first system on the shared hardware when the electric quantity loss rate of the first system is greater than the electric quantity loss rate of the second system.
Optionally, the hardware-shared switching apparatus 200 further includes: the device comprises a current time acquisition module and a hardware occupation instruction generation module.
And the current time acquisition module is used for acquiring the current time.
And a hardware occupation instruction generation module, configured to generate the hardware occupation instruction when the current time meets a preset time, where the preset time is a preset time for controlling the shared hardware by the second system.
Optionally, the hardware-shared switching apparatus 200 further includes: the device comprises a first unlocking module and a second unlocking module.
The first unlocking module is used for controlling the electronic equipment to set an operating system as the first system when the electronic equipment receives a first unlocking password in a screen locking state; or
A second unlocking module, configured to control the electronic device to set an operating system as the second system when the electronic device receives a second unlocking password in a screen locking state,
optionally, the hardware-shared switching apparatus 200 further includes: an occupation ending module and an occupation controlling module.
And the occupation ending module is used for releasing the occupation of the second system on the shared hardware when the second system finishes occupying the shared hardware.
And the control occupation module is used for switching the operating system of the electronic equipment from the second system to the first system and controlling the first system to control the shared hardware.
Optionally, the electronic device comprises at least a smart watch, and the common hardware comprises at least a microphone.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Fig. 8 is a block diagram of an electronic device for executing a switching method of shared hardware according to an embodiment of the present application, and please refer to fig. 8, which shows a block diagram of an electronic device 100 according to an embodiment of the present application. The electronic device 100 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 140, and one or more applications, wherein the one or more applications may be stored in the memory 140 and configured to be executed by the one or more processors 110, the one or more programs configured to perform the methods as described in the foregoing method embodiments.
Processor 110 may include one or more processing cores, among other things. The processor 110 connects various parts throughout the electronic device 100 using various interfaces and lines, and performs various functions of the electronic device 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 140 and calling data stored in the memory 140. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content to be displayed; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 140 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 140 may be used to store instructions, programs, code sets, or instruction sets. The memory 140 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The data storage area may also store data created by the electronic device 100 during use (e.g., phone book, audio-video data, chat log data), and the like.
Fig. 9 is a storage unit for storing or carrying program codes for implementing a switching method of shared hardware according to an embodiment of the present application, please refer to fig. 9, which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 300 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 300 includes a non-volatile computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 310 may be compressed, for example, in a suitable form.
In summary, the present application provides a method, an apparatus, an electronic device, and a storage medium for switching shared hardware, where the method is applied to an electronic device, the electronic device includes a first system, a second system, and shared hardware of the first system and the second system, the electronic device responds to a system switching instruction, detects an occupation state of the shared hardware by the first system, where the switching instruction is used to instruct the electronic device to switch an operating system from the first system to the second system, and when the occupation state is occupied, the occupation of the shared hardware by the first system is removed, and the operating system of the electronic device is switched from the first system to the second system, and in response to the hardware occupation instruction, the second system is controlled to control the shared hardware, on one hand, after the occupation of the shared hardware by the first system is removed, the operating system is switched to the second operating system, so as to ensure that the switched second operating system can use the shared hardware more quickly, the second operating system can timely execute corresponding functions through shared hardware, the situation that hardware equipment cannot be used timely after system switching is avoided, user experience is reduced, on the other hand, system switching instructions are responded, the automatic switching system avoids the complex process of manual operation of a user, and user experience is further improved.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (11)

1. A switching method of shared hardware is applied to an electronic device, wherein the electronic device comprises a first system, a second system and shared hardware of the first system and the second system, and the method comprises the following steps:
detecting an occupation state of the first system on the shared hardware in response to a system switching instruction, wherein the system switching instruction is used for instructing the electronic equipment to switch an operating system from the first system to the second system;
when the occupation state is occupation, removing the occupation of the first system on the shared hardware, and switching the operating system of the electronic equipment from the first system to the second system;
and responding to a hardware occupation instruction, and controlling the second system to control the shared hardware.
2. The method of claim 1, wherein the electronic device further comprises a touch screen, and wherein, before detecting the occupation status of the shared hardware by the first system in response to the system switching instruction, further comprises:
detecting screen states of the touch screen, wherein the screen states comprise a bright screen state and a dead screen state;
and when the screen state is detected to be switched from the bright screen state to the off screen state, generating the system switching instruction.
3. The method of claim 2, wherein after controlling the second system to control the common hardware in response to the hardware seizure command, the method further comprises:
detecting a screen state of the touch screen;
when the screen state is detected to be switched from the screen-off state to the screen-on state, the occupation of the second system on the shared hardware is removed;
switching an operating system of the electronic device from the second system to the first system.
4. The method of claim 1, wherein detecting the occupancy state of the shared hardware by the first system in response to a system switch command comprises:
responding to a system switching instruction, and acquiring the current residual electric quantity of the electronic equipment;
when the current residual electric quantity is smaller than a preset electric quantity, acquiring the electric quantity loss rate of the first system and acquiring the electric quantity loss rate of the second system;
and when the power consumption rate of the first system is larger than that of the second system, detecting the occupation state of the first system on the shared hardware.
5. The method of claim 1, wherein before controlling the second system to control the shared hardware in response to the hardware busy instruction, further comprising:
acquiring current time;
and when the current time meets a preset time, generating the hardware occupation instruction, wherein the preset time is preset time for the second system to occupy the shared hardware.
6. The method of claim 1, further comprising:
when the electronic equipment receives a first unlocking password in a screen locking state, controlling the electronic equipment to set an operating system as the first system; or
And when the electronic equipment receives a second unlocking password in the screen locking state, controlling the electronic equipment to set an operating system as the second system.
7. The method of claim 1, wherein after controlling the second system to control the shared hardware in response to the hardware busy instruction, further comprising:
when the second system finishes occupying the shared hardware, the second system releases the occupation of the shared hardware;
and switching the operating system of the electronic equipment from the second system to the first system, and controlling the first system to control the shared hardware.
8. The method of any of claims 1-7, wherein the electronic device comprises at least a smart watch and the common hardware comprises at least a microphone.
9. A switching device of common hardware is applied to an electronic device, the electronic device includes a first system, a second system and the common hardware of the first system and the second system, the device includes:
the detection module is used for responding to a system switching instruction and detecting the occupation state of the first system on the shared hardware, wherein the system switching instruction is used for instructing the electronic equipment to switch an operating system from the first system to the second system;
a release module, configured to release the occupation of the shared hardware by the first system and switch an operating system of the electronic device from the first system to the second system when the occupation state is occupation;
and the occupation module is used for responding to a hardware occupation instruction and controlling the second system to control the shared hardware.
10. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-8.
11. A computer-readable storage medium, characterized in that a program code is stored in the computer-readable storage medium, the program code being
A processor may be invoked to perform a method according to any one of claims 1 to 8.
CN202110272602.2A 2021-03-12 2021-03-12 Switching method and device of shared hardware, electronic equipment and storage medium Pending CN115080126A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110272602.2A CN115080126A (en) 2021-03-12 2021-03-12 Switching method and device of shared hardware, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110272602.2A CN115080126A (en) 2021-03-12 2021-03-12 Switching method and device of shared hardware, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115080126A true CN115080126A (en) 2022-09-20

Family

ID=83241711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110272602.2A Pending CN115080126A (en) 2021-03-12 2021-03-12 Switching method and device of shared hardware, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115080126A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115562765A (en) * 2022-12-05 2023-01-03 北京小米移动软件有限公司 Control method and device of positioning assembly, electronic equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685338A (en) * 2008-09-27 2010-03-31 联想(北京)有限公司 Method of saving system resources of notebook computer and notebook computer
WO2010111932A1 (en) * 2009-03-31 2010-10-07 联想(北京)有限公司 Apparatus for processing multiple hardware systems data and method for inputting information thereof
CN102081553A (en) * 2009-12-01 2011-06-01 联想(北京)有限公司 Portable equipment task processing method and device as well as portable equipment
US20140115308A1 (en) * 2011-05-30 2014-04-24 Beijing Lenovo Software Ltd. Control method, control device and computer system
CN104156644A (en) * 2014-07-30 2014-11-19 宇龙计算机通信科技(深圳)有限公司 Multisystem entering method and device and terminal
CN104516760A (en) * 2014-12-12 2015-04-15 华为技术有限公司 Operating system hot-switching method and device and mobile terminal
CN104572285A (en) * 2015-01-29 2015-04-29 深圳酷派技术有限公司 Terminal, and screen projection method and screen projection device for terminal
US20150339158A1 (en) * 2014-05-22 2015-11-26 Oracle International Corporation Dynamic Co-Scheduling of Hardware Contexts for Parallel Runtime Systems on Shared Machines
CN105608347A (en) * 2015-07-29 2016-05-25 宇龙计算机通信科技(深圳)有限公司 Operation system switching method, operation system switching device and terminal
CN106681817A (en) * 2016-12-27 2017-05-17 宇龙计算机通信科技(深圳)有限公司 Terminal control method and terminal

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685338A (en) * 2008-09-27 2010-03-31 联想(北京)有限公司 Method of saving system resources of notebook computer and notebook computer
WO2010111932A1 (en) * 2009-03-31 2010-10-07 联想(北京)有限公司 Apparatus for processing multiple hardware systems data and method for inputting information thereof
CN102081553A (en) * 2009-12-01 2011-06-01 联想(北京)有限公司 Portable equipment task processing method and device as well as portable equipment
US20140115308A1 (en) * 2011-05-30 2014-04-24 Beijing Lenovo Software Ltd. Control method, control device and computer system
US20150339158A1 (en) * 2014-05-22 2015-11-26 Oracle International Corporation Dynamic Co-Scheduling of Hardware Contexts for Parallel Runtime Systems on Shared Machines
CN104156644A (en) * 2014-07-30 2014-11-19 宇龙计算机通信科技(深圳)有限公司 Multisystem entering method and device and terminal
CN104516760A (en) * 2014-12-12 2015-04-15 华为技术有限公司 Operating system hot-switching method and device and mobile terminal
CN104572285A (en) * 2015-01-29 2015-04-29 深圳酷派技术有限公司 Terminal, and screen projection method and screen projection device for terminal
CN105608347A (en) * 2015-07-29 2016-05-25 宇龙计算机通信科技(深圳)有限公司 Operation system switching method, operation system switching device and terminal
CN106681817A (en) * 2016-12-27 2017-05-17 宇龙计算机通信科技(深圳)有限公司 Terminal control method and terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115562765A (en) * 2022-12-05 2023-01-03 北京小米移动软件有限公司 Control method and device of positioning assembly, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110459221B (en) Method and device for multi-device cooperative voice interaction
EP3547715B1 (en) Method and apparatus for reducing continuous-wakeup delay of bluetooth loudspeaker, and bluetooth loudspeaker
CN107783803B (en) System optimization method and device of intelligent terminal, storage medium and intelligent terminal
CN109525012B (en) Charging device, charging control method, charging control system, and storage medium
CN110784858A (en) Bluetooth device control method and device, electronic device and storage medium
EP3591924B1 (en) Control method, device, storage medium, and electronic apparatus for broadcast sending
CN110703944B (en) Touch data processing method and device, terminal and storage medium
CN105575390A (en) Voice control method and device
CN110687820A (en) Control method and device of intelligent household equipment, terminal equipment and storage medium
EP3591949B1 (en) Broadcast message queuing method and device, and terminal
CN109032732B (en) Notification display method and device, storage medium and electronic equipment
US20230367537A1 (en) Screen-projection displaying method, apparatus, mobile terminal, and program product
CN115080126A (en) Switching method and device of shared hardware, electronic equipment and storage medium
CN103648001A (en) Switching method and apparatus
US9904262B2 (en) Systems and methods for dynamic operation of electronic devices based on detection of one or more events
CN106954191A (en) Broadcast transmission method, device and terminal device
CN110519346A (en) A kind of method, terminal, server and the computer readable storage medium of data switching
CN107729136B (en) Processing priority configuration method and device based on FPGA
CN110989816A (en) Application processing method and device and storage medium
CN115665671A (en) Audio data sharing method and device, electronic equipment and storage medium
CN112954760B (en) Bluetooth equipment connection method and device and electronic equipment
CN113271385B (en) Call forwarding method
CN106850458A (en) Broadcast the message method, device and the terminal queued up
CN114023054A (en) Device management method, device, electronic device and computer storage medium
CN112596883A (en) Application switching method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination