CN115543061B - Power consumption control method and electronic equipment - Google Patents

Power consumption control method and electronic equipment Download PDF

Info

Publication number
CN115543061B
CN115543061B CN202210380841.4A CN202210380841A CN115543061B CN 115543061 B CN115543061 B CN 115543061B CN 202210380841 A CN202210380841 A CN 202210380841A CN 115543061 B CN115543061 B CN 115543061B
Authority
CN
China
Prior art keywords
electronic device
camera
frequency
event
data stream
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.)
Active
Application number
CN202210380841.4A
Other languages
Chinese (zh)
Other versions
CN115543061A (en
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.)
Honor Device Co Ltd
Original Assignee
Honor Device Co 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210380841.4A priority Critical patent/CN115543061B/en
Publication of CN115543061A publication Critical patent/CN115543061A/en
Application granted granted Critical
Publication of CN115543061B publication Critical patent/CN115543061B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/325Power saving in peripheral device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3243Power saving in microcontroller unit
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application discloses a power consumption control method and electronic equipment, which relate to the technical field of electronics and are used for optimizing the power consumption of a processor of the electronic equipment when a user shoots by using an effect algorithm on the electronic equipment such as a notebook computer and the like. The specific scheme is as follows: the event viewer acquires first event information sent by the camera service, wherein the first event information is used for indicating the electronic equipment to start the camera equipment; the electronic equipment displays a first interface, wherein the first interface comprises a first image and a first control, which correspond to a data stream shot by the camera equipment; the electronic equipment receives a first operation of a user on a first control; in response to the first operation, the event viewer acquires second event information sent by the camera service, wherein the second event information is used for indicating the electronic equipment to process a data stream shot by the camera equipment by using a preset image algorithm corresponding to the first control; the electronic device adjusts the frequency of the processor of the electronic device to a first frequency according to the first event information and the second event information.

Description

Power consumption control method and electronic equipment
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a power consumption control method and an electronic device.
Background
Currently, a notebook computer generally includes a camera device, and a user can take a picture, record a video, or perform a video conference using the camera device on the notebook computer. When the user uses the camera device on the notebook computer, the user can also process the shot image frames by using different effect algorithms, wherein the effect algorithms refer to algorithms for processing the image frames.
Disclosure of Invention
The embodiment of the application provides a power consumption control method and electronic equipment, which are used for optimizing the power consumption of a processor of the electronic equipment when a user shoots by using an effect algorithm on the electronic equipment such as a notebook computer.
In some cases, when a user processes a captured image frame using an effect algorithm on the notebook, the notebook sets the frequency of the central processor (central processing unit, CPU) of the notebook according to a default power consumption policy. However, the CPU frequency of the notebook computer is generally higher according to the default power consumption policy, which results in greater power consumption of the CPU.
In the prior art, by setting a hook function, whether a user shoots by using a camera device on a notebook computer or not is identified by using an effect algorithm. And further, under the condition that the notebook computer recognizes that a user shoots by using an effect algorithm, the notebook computer can perform corresponding power consumption adjustment.
However, the applicant found that the procedure of setting the hook function in the prior art is complicated, which results in a complex procedure in which the notebook computer recognizes whether the user uses the effect algorithm on the notebook computer to perform photographing. When the hook function is set in the notebook computer, the hook function is usually set in an operating system of the notebook computer. The addition of the hook function to the operating system of the notebook computer results in reduced security of the operating system of the notebook computer.
In a first aspect, an embodiment of the present application provides a power consumption control method, applied to an electronic device, where the electronic device may include a camera device, a camera service, and an event viewer, where the power consumption control method may include: the event viewer acquires first event information sent by the camera service, wherein the first event information is used for indicating the electronic equipment to start the camera equipment; the electronic equipment displays a first interface, wherein the first interface comprises a first image and a first control, which correspond to a data stream shot by the camera equipment; the electronic equipment receives a first operation of a user on a first control; responding to the first operation, the event viewer obtains second event information sent by the camera service, the second event information is used for indicating the electronic equipment to process a data stream shot by the camera equipment by using a preset image algorithm corresponding to the first control, the electronic equipment displays a second interface, the second interface comprises a second image corresponding to the data stream shot by the camera equipment, and the second image is an image obtained by the electronic equipment by using the preset image algorithm to process the data stream shot by the camera equipment; the electronic device adjusts the frequency of the processor of the electronic device to a first frequency according to the first event information and the second event information.
Based on the power consumption control method of the first aspect, when the electronic device starts the data stream of the camera, a data stream start event is obtained, and when the electronic device starts the effect algorithm, an effect algorithm starting event is obtained, and whether the electronic device starts the effect algorithm to shoot can be accurately identified by identifying the data stream start event and the effect algorithm starting event. When the electronic equipment is identified to start the effect algorithm to shoot, the electronic equipment can determine a corresponding power consumption adjustment strategy, and the frequency of a processor of the electronic equipment is correspondingly adjusted. And the electronic equipment can set the frequency of the processor of the electronic equipment to be smaller when the frequency of the processor of the electronic equipment is regulated according to the corresponding power consumption regulation strategy, so that the power consumption of the CPU of the notebook computer can be reduced when a user shoots by using an effect algorithm on the notebook computer.
In addition, when the electronic equipment starts the camera data stream, the event viewer included in the operating system of the electronic equipment reports a data stream start event, and when the electronic equipment starts the effect algorithm, the event viewer included in the operating system of the electronic equipment reports an effect algorithm start event, that is, the event viewer in the operating system of the electronic equipment can be utilized to determine whether the electronic equipment starts the effect algorithm, a hook function is not required to be added in the operating system of the electronic equipment, the process of identifying whether shooting is performed by using the effect algorithm by the electronic equipment can be simplified, and the safety reduction of the operating system of the electronic equipment can be avoided.
With reference to the first aspect, in one possible implementation manner, the electronic device may further include a device media foundation modification DMFT algorithm library, where the DMFT algorithm library may include a preset image algorithm, and the event viewer obtains second event information sent by the camera service, and may include: under the condition that the electronic equipment processes the data stream shot by the camera equipment by using a preset image algorithm included in the DMFT algorithm library, the camera service determines that the electronic equipment processes the data stream shot by the camera equipment by using the preset image algorithm; the camera service sends second event information to the event viewer; the event viewer obtains second event information sent by the camera service.
Based on the possible implementation manner, the electronic device can acquire the second event information sent by the camera service through the event viewer under the condition that the data stream shot by the camera device is processed by using the preset image algorithm included in the DMFT algorithm library, so that whether the electronic device starts an effect algorithm or not to shoot can be accurately identified through the second event information.
With reference to the first aspect, in one possible implementation manner, the power consumption control method may further include: the electronic equipment receives a second operation of the user on the first control; responding to the second operation, and acquiring third event information sent by the camera service by the event viewer, wherein the third event information is used for indicating the electronic equipment to stop processing the data stream shot by the camera equipment by using a preset image algorithm; and the electronic equipment adjusts the frequency of the processor of the electronic equipment from the first frequency to a second frequency according to the third event information, wherein the second frequency is smaller than the first frequency.
Based on the possible implementation manner, when the user turns off the effect algorithm, the electronic device can acquire an event that the electronic device stops using the effect algorithm to process the data stream shot by the camera device, and then can adjust the frequency of a processor of the electronic device according to the event that the electronic device stops using the effect algorithm to process the data stream shot by the camera device, and further adjust the power consumption of the electronic device.
With reference to the first aspect, in one possible implementation manner, the power consumption control method may further include: the electronic equipment receives a third operation of closing the camera equipment by a user; responding to the third operation, the event viewer obtains fourth event information sent by the camera service, wherein the fourth event information is used for indicating the electronic equipment to close the camera equipment, and the electronic equipment closes the camera equipment; and the electronic equipment adjusts the frequency of the processor of the electronic equipment from the first frequency to a third frequency according to the fourth event information, wherein the third frequency is smaller than the second frequency.
Based on the possible implementation manner, when the user turns off the camera device, the electronic device can acquire an event that the camera device of the electronic device is turned off, and then the frequency of the processor of the electronic device can be adjusted according to the event that the camera device of the electronic device is turned off, so that the power consumption of the electronic device can be adjusted.
With reference to the first aspect, in one possible implementation manner, the first event may include a first preset identifier, where the first preset identifier may be used to instruct the electronic device to turn on the camera device; the second event may include a second preset identifier, which may be used to instruct the electronic device to process the data stream captured by the camera device using a preset image algorithm; the adjusting, by the electronic device, the frequency of the processor of the electronic device to the first frequency according to the first event information and the second event information may include: and the electronic equipment adjusts the frequency of the processor of the electronic equipment to be the first frequency according to the first preset identifier and the second preset identifier.
Based on the possible implementation manner, the electronic device can be quickly determined to acquire the first event by identifying the first preset identifier indicating that the camera device of the electronic device is turned on, and the electronic device can be quickly determined to acquire the second event by identifying the second preset identifier indicating that the electronic device has used the effect algorithm to process the data stream shot by the camera device, so that the electronic device can be determined to use the effect algorithm to process the data stream shot by the camera device according to the first event and the second event, and the frequency of the processor is further adjusted.
With reference to the first aspect, in one possible implementation manner, the electronic device may store a correspondence between a scenario and a power consumption adjustment policy, and the adjusting, by the electronic device, the frequency of a processor of the electronic device to the first frequency according to the first event information and the second event information may include: the electronic equipment determines a first scene according to the first event information and the second event information; the electronic equipment determines a first power consumption adjustment strategy according to the first scene and the corresponding relation; the electronic device adjusts the frequency of the processor to a first frequency according to a first power consumption adjustment strategy.
Based on the possible implementation manner, the electronic device can determine that the scene of the electronic device is the scene of the data stream shot by the camera device processed by using the effect algorithm according to the first event and the second event, and then can determine a corresponding power consumption adjustment strategy according to the scene, and can adjust the frequency of a processor of the electronic device according to the power consumption adjustment strategy, so as to adjust the power consumption of the electronic device.
With reference to the first aspect, in one possible implementation manner, before the event viewer obtains the first event information sent by the camera service, the power consumption control method may further include: the electronic equipment receives a fourth operation of starting the camera equipment by a user; in response to the fourth operation, the electronic device starts the camera device, and the electronic device sets the frequency of the processor of the electronic device to a fourth frequency according to a default power consumption policy; the electronic equipment acquires a data stream shot by the camera equipment; wherein the first frequency may be less than the fourth frequency.
Based on the possible implementation manner, the electronic device can receive the operation that the user starts the camera device, so that the electronic device can start the camera device and acquire the data stream shot by the camera device, and the electronic device can set the frequency of the processor to be smaller than the frequency of the processor set by the electronic device according to the default power consumption strategy, so that the frequency of the processor of the electronic device can be set to be smaller, and the power consumption of the CPU of the notebook computer can be reduced when the user shoots by using the effect algorithm on the notebook computer.
With reference to the first aspect, in one possible implementation manner, the electronic device may be a computer, and the computer may include a Windows system.
Based on the possible implementation manner, when the electronic device is a computer comprising a Windows system, whether the computer starts an effect algorithm for shooting can be accurately identified by identifying a data flow starting event and an effect algorithm starting event. When the computer is identified to start the effect algorithm for shooting, the computer can determine a corresponding power consumption adjustment strategy, and the frequency of a processor of the computer is correspondingly adjusted. And the computer can set the frequency of the processor of the computer to be smaller when the frequency of the processor of the computer is regulated according to the corresponding power consumption regulation strategy, so that the power consumption of the CPU of the computer can be reduced when a user shoots by using an effect algorithm on the computer.
With reference to the first aspect, in one possible implementation manner, the DMFT algorithm library may include algorithms for denoising an image, image transformation, image analysis, image compression, image enhancement, image blurring processing, and the like, and the DMFT algorithm library may also include algorithms for filtering an image captured by a camera device, beautifying or masking a background of the image, and the like.
With reference to the first aspect, in one possible implementation manner, the adjusting, by the electronic device, the frequency of the processor from the first frequency to the second frequency according to the third event information may include: the electronic equipment determines a second scene according to the third event information; the electronic device determines a second power consumption adjustment strategy according to a second scene, wherein the second power consumption adjustment strategy comprises the step of adjusting the frequency of a processor of the electronic device to a second frequency, and the second frequency is smaller than the first frequency; the electronic device adjusts the frequency of the processor of the electronic device from the first frequency to the second frequency according to the second power consumption adjustment strategy.
Based on the possible implementation manner, the electronic device can determine that the scene of the electronic device is the scene of the data stream shot by the camera device which is processed by the electronic device by stopping using the effect algorithm, further determine a corresponding power consumption adjustment strategy according to the scene, and adjust the frequency of a processor of the electronic device according to the power consumption adjustment strategy, thereby adjusting the power consumption of the electronic device.
With reference to the first aspect, in one possible implementation manner, the adjusting, by the electronic device, the frequency of the processor from the first frequency to the third frequency according to the fourth event information may include: the electronic equipment determines a third scene according to the fourth event information; the electronic device determines a third power consumption adjustment strategy according to a third scene, wherein the third power consumption adjustment strategy comprises the steps of adjusting the frequency of a processor of the electronic device to be a third frequency, and the third frequency is smaller than the first frequency; the electronic device adjusts the frequency of the processor of the electronic device from the first frequency to a third frequency according to a third power consumption adjustment strategy.
Based on the possible implementation manner, the electronic device can determine that the scene of the electronic device is the scene of the closed camera device of the electronic device, further determine a corresponding power consumption adjustment strategy according to the scene, and adjust the frequency of the processor of the electronic device according to the power consumption adjustment strategy, thereby adjusting the power consumption of the electronic device.
In a second aspect, an embodiment of the present application provides a power consumption control apparatus, which may be applied to an electronic device, for implementing the method in the first aspect. The function of the power consumption control device can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions, for example, an acquisition module, a display module, a receiving module, a configuration module, and the like.
The acquisition module may be configured to acquire first event information sent by the camera service, where the first event information is used to instruct the electronic device to turn on the camera device.
The display module can be used for displaying a first interface, and the first interface comprises a first image corresponding to the data stream shot by the camera equipment and a first control.
And the receiving module can be used for receiving the first operation of the first control by the user.
The acquisition module is further configured to, in response to the first operation, acquire second event information sent by the camera service, where the second event information is used to instruct the electronic device to process a data stream shot by the camera device by using a preset image algorithm corresponding to the first control.
The display module is further configured to display a second interface, where the second interface includes a second image corresponding to the data stream shot by the camera device, and the second image is an image obtained by processing, by the electronic device, the data stream shot by the camera device using a preset image algorithm.
The configuration module may be configured to adjust a frequency of a processor of the electronic device to a first frequency according to the first event information and the second event information.
With reference to the second aspect, in a possible implementation manner, the obtaining module may be further configured to determine that, in a case where the electronic device processes the data stream captured by the camera device using a preset image algorithm included in the DMFT algorithm library, the electronic device processes the data stream captured by the camera device using the preset image algorithm.
The acquisition module is further configured to send second event information to the event viewer.
The acquisition module is further configured to acquire second event information sent by the camera service.
With reference to the second aspect, in a possible implementation manner, the receiving module may be further configured to receive a second operation of the first control by a user.
The acquisition module is further configured to, in response to the second operation, acquire third event information sent by the camera service, where the third event information is used to instruct the electronic device to stop processing the data stream shot by the camera device using the preset image algorithm.
The configuration module is further configured to adjust a frequency of a processor of the electronic device from a first frequency to a second frequency according to the third event information, the second frequency being smaller than the first frequency.
With reference to the second aspect, in a possible implementation manner, the receiving module may be further configured to receive a third operation of turning off the camera device by a user.
The obtaining module is further configured to obtain fourth event information sent by the camera service in response to the third operation, where the fourth event information is used to instruct the electronic device to close the camera device.
The power consumption control device may further include a shutdown module. And a closing module which can be used for closing the camera device.
The configuration module is further configured to adjust a frequency of a processor of the electronic device from the first frequency to a third frequency according to the fourth event information, the third frequency being smaller than the first frequency.
With reference to the second aspect, in one possible implementation manner, the first event may include a first preset identifier, where the first preset identifier may be used to instruct the electronic device to turn on the camera device; the second event may include a second preset identifier, which may be used to instruct the electronic device to process the data stream captured by the camera device using a preset image algorithm.
The configuration module is further configured to adjust a frequency of the processor of the electronic device to a first frequency according to the first preset identifier and the second preset identifier.
With reference to the second aspect, in a possible implementation manner, the power consumption control apparatus may further include a determining module. The determining module can be used for determining the first scene according to the first event information and the second event information.
The determining module may be further configured to determine a first power consumption adjustment policy according to the first scenario and the correspondence relation, the first power consumption adjustment policy including adjusting a frequency of a processor of the electronic device to a second frequency.
The configuration module is further configured to adjust the frequency of the processor to a first frequency according to a first power consumption adjustment policy.
With reference to the second aspect, in a possible implementation manner, the receiving module may be further configured to receive a fourth operation that a user turns on the camera device.
The power consumption control device may further include a start module. The starting module is further used for responding to the fourth operation and starting the camera device.
The configuration module may be further configured to set a frequency of a processor of the electronic device to a fourth frequency according to a default power consumption policy.
The acquisition module is also used for acquiring a data stream shot by the camera equipment; wherein, the first frequency may be smaller than the fourth frequency.
With reference to the second aspect, in one possible implementation manner, the electronic device may be a computer, and the computer may include a Windows system.
With reference to the second aspect, in one possible implementation manner, the DMFT algorithm library may include algorithms for denoising an image, image transformation, image analysis, image compression, image enhancement, image blurring processing, and the like, and the DMFT algorithm library may also include algorithms for filtering an image captured by a camera device, beautifying or masking a background of the image, and the like.
With reference to the second aspect, in a possible implementation manner, the determining module may be further configured to determine the second scenario according to the third event information.
The determining module may be further configured to determine a second power consumption adjustment policy according to a second scenario, the second power consumption adjustment policy including adjusting a frequency of a processor of the electronic device to a second frequency, the second frequency being less than the first frequency.
The configuration module is further configured to adjust a frequency of a processor of the electronic device from the first frequency to the second frequency according to a second power consumption adjustment policy.
With reference to the second aspect, in a possible implementation manner, the determining module may be further configured to determine the third scenario according to fourth event information by using the electronic device.
The determining module may be further configured to determine a third power consumption adjustment policy according to a third scenario, the third power consumption adjustment policy including adjusting a frequency of a processor of the electronic device to a third frequency, the third frequency being less than the first frequency.
The configuration module may be further configured to adjust a frequency of a processor of the electronic device from the first frequency to a third frequency according to a third power consumption adjustment policy.
In a third aspect, there is provided a power consumption control apparatus having a function of implementing the method of the first aspect described above. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
In a fourth aspect, there is provided a power consumption control apparatus including: a processor and a memory; the memory is configured to store computer-executable instructions that, when executed by the power consumption control apparatus, cause the power consumption control apparatus to perform the power consumption control method according to any one of the first aspect.
In a fifth aspect, there is provided a power consumption control apparatus including: a processor; the processor is configured to execute the power consumption control method according to any one of the first aspect above according to an instruction in the memory after being coupled to the memory and reading the instruction.
In a sixth aspect, embodiments of the present application provide a computer readable storage medium having computer program instructions stored thereon. The computer program instructions, when executed by an electronic device, cause the electronic device to implement the power consumption control method as claimed in the first aspect or any one of the possible implementations of the first aspect.
In a seventh aspect, embodiments of the present application provide a computer program product comprising computer readable code which, when run in an electronic device, causes the electronic device to implement the power consumption control method according to the first aspect or any of the possible implementations of the first aspect.
In an eighth aspect, an apparatus (e.g. the apparatus may be a system-on-a-chip) is provided, the apparatus comprising a processor configured to support a first device to implement the functions referred to in the first aspect, e.g. to obtain information of a first transmission delay corresponding to a terminal related message when transmitted between the first device and a second device. In one possible design, the apparatus further includes a memory for holding program instructions and data necessary for the first device. When the device is a chip system, the device can be formed by a chip, and can also comprise the chip and other discrete devices.
It should be appreciated that the advantages of the second to sixth aspects may be referred to in the description of the first aspect, and are not described herein.
Drawings
Fig. 1 is a schematic hardware structure of an electronic device according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a scenario of power consumption control provided by an embodiment of the present application;
FIG. 3 is a schematic flow chart of power consumption control according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a camera status probe according to an embodiment of the present application;
fig. 5 is a schematic flow chart of a power consumption control method according to an embodiment of the present application;
Fig. 6A is a schematic diagram of a display interface of an electronic device according to an embodiment of the present application;
fig. 6B is a schematic diagram of a display interface of an electronic device according to an embodiment of the present application;
fig. 7 is a second flowchart of a power consumption control method according to an embodiment of the present application;
fig. 8 is a flowchart illustrating a power consumption control method according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a power consumption control device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
Currently, a camera device (may also be referred to as a camera device) is generally included on a notebook computer, so that a user may take a picture using the camera device on the notebook computer, for example, the user may take a picture, record a video, or perform a video conference using the camera device on the notebook computer.
When a user uses a camera device on a notebook computer to take a picture, the user may also process the image taken by the camera device to obtain a final image using different effect algorithms, where an effect algorithm refers to an algorithm that processes an image frame (which may also be referred to as an image). The effect algorithm may also be referred to as an image algorithm, i.e. an algorithm used when processing an image taken by the camera device. For example, image algorithms may include algorithms for denoising images, image transformation, image analysis, image compression, image enhancement, image blurring processing, and the like. The image algorithm may also include an algorithm that performs a filter process, a beauty process, or a background process that masks an image captured by the camera device. That is, different image algorithms may implement different functions.
When a user uses a camera device on a notebook computer to shoot and uses an effect algorithm to process a shot image, the notebook computer generally sets the frequency of a CPU of the notebook computer according to a default power consumption strategy, namely a preset power consumption strategy in an operating system of the notebook computer.
However, the CPU frequency of the default power consumption policy setting is generally high, and the CPU frequency is high, which results in a larger power consumption of the CPU. And because the notebook computer uses the effect algorithm to further process the image, the load of the CPU is higher, and the power consumption is larger.
In addition, when a user uses a camera device on a notebook computer to shoot and uses an effect algorithm to process a shot image, the CPU of the notebook computer does not need to be high in frequency, and the CPU frequency of the notebook computer is high according to a default power consumption strategy, so that the CPU resource is wasted.
In the related art, a notebook computer can identify whether a user uses an effect algorithm to shoot when shooting by using camera equipment on the notebook computer by setting a hook function. And further, under the condition that the notebook computer recognizes that a user shoots by using an effect algorithm, the notebook computer can perform corresponding power consumption adjustment.
In the related art, a hook function needs to be set in a notebook computer, so that when a user shoots by using an effect algorithm on the notebook computer, the notebook computer can call the hook function first and then call the effect algorithm. That is, the notebook computer can determine whether the user uses the effect algorithm on the notebook computer to take a photograph by determining whether the hook function is called.
However, in this related art, it is necessary to provide a hook function in a notebook computer. In general, a procedure of setting a hook function is complicated, which results in a complicated procedure of recognizing whether a user uses an effect algorithm on a notebook computer to photograph. When the hook function is set in the notebook computer, the hook function is usually set in an operating system of the notebook computer. The addition of the hook function to the operating system of the notebook computer results in reduced security of the operating system of the notebook computer.
In view of the above problems, an embodiment of the present application provides a power consumption control method, which should be used in an electronic device, where the method may obtain a data stream start event when the electronic device starts a data stream of a camera (i.e. starts a camera device), and obtain an effect starting algorithm event when the electronic device starts an effect algorithm, and accurately identify whether the electronic device starts the effect algorithm to shoot by identifying the data stream start event and the effect starting algorithm event. When the electronic equipment is identified to start the effect algorithm to shoot, the electronic equipment can determine a corresponding power consumption adjustment strategy, and the frequency of a processor of the electronic equipment is correspondingly adjusted. According to the determined power consumption adjustment strategy, the electronic equipment can set the frequency of the processor of the electronic equipment to be smaller when adjusting the frequency of the processor of the electronic equipment, for example, the frequency of the processor of the electronic equipment can be set to be smaller than the frequency of the CPU corresponding to the default power consumption strategy, so that the power consumption of the CPU of the notebook computer can be reduced when a user shoots by using an effect algorithm on the notebook computer.
According to the scheme, when the electronic equipment starts the camera data stream, the event viewer included in the operating system of the electronic equipment reports a data stream starting event, and when the electronic equipment starts the effect algorithm, the event viewer included in the operating system of the electronic equipment reports the effect algorithm starting event, that is, the scheme can determine whether the electronic equipment starts the effect algorithm or not by using the event viewer in the operating system of the electronic equipment, a hook function is not required to be added in the operating system of the electronic equipment, the process of identifying whether shooting is performed by using the effect algorithm or not by the electronic equipment can be simplified, and the safety reduction of the operating system of the electronic equipment can be avoided.
The power consumption control method provided by the embodiment of the application is described below.
The power consumption control method provided by the embodiment of the application can be applied to electronic equipment. In some examples, the electronic device may be a notebook computer, tablet computer, handheld computer, PC, personal digital assistant (personal digital assistant, PDA), wearable device, or like electronic device with a camera device. The embodiment of the application does not limit the specific form of the electronic equipment.
In other examples, the electronic device may be an electronic device with a Windows system.
In other examples, the electronic device may be an electronic device that includes an event viewer, e.g., a Windows system of the electronic device may include an event viewer.
In other examples, the electronic device may include an effects algorithm customization library. The effects algorithm customization library may include a plurality of effects algorithms. For example, the effect algorithm customization library may include algorithms for denoising an image, image transformation, image analysis, image compression, image enhancement, image blurring processing, and the like, and the effect algorithm customization library may also include filtering an image captured by a camera device, beautifying or obscuring the background of the image, and the like.
In some examples, the effects algorithm custom library may be a device media base retrofit (device media foundation transform, DMFT) custom library, i.e., an image algorithm library developed according to the DMFT specification, that is, a user may develop an algorithm to process images captured by a camera according to the DMFT specification.
By way of example, taking an electronic device as a notebook computer, fig. 1 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
As shown in fig. 1, the notebook computer may include: processor 110, fan 111, external memory interface 120, internal memory 121, universal Serial Bus (USB) interface 130, charge management module 140, power management module 141, battery 142, display 150, antenna, wireless communication module 160, audio module 170, speaker (i.e., speaker) 170A, microphone 170C, headphone interface 170B, touch pad 180, keyboard 190, and camera 191, among others.
The other devices (such as the processor 110, the fan 111, the external memory interface 120, the internal memory 121, the usb interface 130, the charge management module 140, the power management module 141, the battery 142, the antenna, the wireless communication module 160, the audio module 170, the touch pad 180, the speaker 170A, the microphone 170C, the earphone interface 170B, the keyboard 190, the camera 191, etc.) except the display 150 may be disposed on the base of the notebook computer. The camera 191 may also be disposed on a frame of the display 150 of the notebook computer.
It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the notebook computer. In other embodiments, the notebook computer may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can be a neural hub and a command center of the notebook computer. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called directly from memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the connection relationship between the modules illustrated in this embodiment is only illustrative, and does not limit the structure of the notebook computer. In other embodiments, the notebook computer may also use different interfacing modes, or a combination of multiple interfacing modes in the above embodiments.
The charge management module 140 is configured to receive a charge input from a charger (e.g., a wireless charger or a wired charger) to charge the battery 142. The wireless communication function of the notebook computer can be realized by an antenna and wireless communication module 160, a modem processor, a baseband processor, and the like.
The antenna is used for transmitting and receiving electromagnetic wave signals. Each antenna in a notebook computer may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas.
In some embodiments, the antenna of the notebook computer is coupled with the wireless communication module 160 so that the notebook computer can communicate with the network and other devices through wireless communication technology. The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wi-Fi network, bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. applied to a notebook computer.
The notebook computer may implement display functions through a GPU, a display screen 150, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 150 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information. The display screen 150 is used to display images, videos, and the like.
The notebook computer can realize a photographing function through the ISP, the camera 191, the video codec, the GPU, the display screen 150, the application processor, and the like. The ISP is used to process the data fed back by the camera 191. In some embodiments, the ISP may be provided in the camera 191. The camera 191 is used to capture still images or video. In some embodiments, the notebook computer may include 1 or N cameras 191, N being a positive integer greater than 1.
The external memory interface 120 may be used to connect an external memory card, such as a MicroSD card, to extend the memory capabilities of a notebook computer. The internal memory 121 may be used to store computer-executable program code that includes instructions. The processor 110 executes various functional applications of the notebook computer and data processing by executing instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may include a storage program area and a storage data area by executing instructions stored in the internal memory 121.
The notebook computer may implement audio functions through an audio module 170, a speaker 170A, a microphone 170C, an earphone interface 170B, an application processor, and the like. Such as music playing, recording, etc.
It will be understood, of course, that the above illustration of fig. 1 is merely exemplary of the case where the electronic device is in the form of a notebook computer. If the electronic device is in the form of a handheld computer, PDA, personal computer, or other device, the electronic device may include fewer structures than those shown in fig. 1, or may include more structures than those shown in fig. 1, and is not limited thereto.
The methods in the following embodiments may be implemented in an electronic device having the above-described hardware structure. In the embodiment of the application, the electronic equipment is taken as a notebook computer as an example for schematic description.
It will be appreciated that in general, implementation of electronic device functions requires software in addition to hardware support.
For example, in conjunction with fig. 2, in order to realize a function of accurately identifying whether the electronic device has turned on the effect algorithm to perform shooting, the electronic device needs to support hardware as described above, and also needs software, such as the camera application 01 and the perception application 02.
The camera application 01 may be used to obtain a data stream sent by a camera device of the electronic device. That is, when the electronic device starts up the camera device, the camera device may acquire a data stream (e.g., data corresponding to a captured picture, data stream corresponding to a captured video, etc.). After the camera device acquires the data stream, the camera device transmits the data stream to the camera application 01, so that the camera application 01 can display the data stream transmitted by the camera device.
It should be noted that, when the user uses the camera device of the electronic device and uses the effect algorithm to perform shooting, the camera device of the electronic device may first acquire a data stream (such as data corresponding to a shot picture, a data stream corresponding to a shot video, etc.).
After the camera device of the electronic device acquires the data stream, the electronic device may process the data stream acquired by the camera device using a corresponding effect algorithm, such as denoising or beautifying the data stream acquired by the camera device.
After the electronic device acquires the processed data stream, the electronic device may send the processed data stream to the camera application 01, so that the camera application 01 may display the processed data stream using the effects algorithm.
The aware application 02 may be configured to perceive a data stream sent by the camera device of the electronic device to the camera application 01, thereby determining whether the electronic device is capturing using an effects algorithm. For example, when the user uses the camera device of the electronic device to take a picture, the camera device of the electronic device may send the acquired data stream to the camera application 01 without using the effect algorithm, and the sensing application 02 may determine that the data stream sent by the camera device of the electronic device to the camera application 01 is a data stream that is not processed by the effect algorithm, so that the sensing application 02 may determine that the electronic device does not use the effect algorithm to take a picture.
For another example, when a user uses a camera device of the electronic device and uses an effect algorithm to shoot, the electronic device uses the corresponding effect algorithm to process a data stream acquired by the camera device, so as to acquire the processed data stream. After the electronic device acquires the processed data stream, the electronic device sends the processed data stream to the camera application program 01, and the sensing application program 02 can determine that the data stream sent to the camera application program 01 by the camera device of the electronic device is the data stream processed by the effect algorithm, so that the sensing application program 02 can determine that the electronic device uses the effect algorithm to shoot.
The aware application 02 may also be configured to determine a power consumption adjustment policy of the electronic device, and adjust power consumption of the electronic device according to the determined power consumption adjustment policy (e.g., adjust power consumption of a CPU of the electronic device). For example, when the sensing application 02 determines that the electronic device uses the effect algorithm to capture, the sensing application 02 may determine that the power consumption adjustment policy of the electronic device is a power consumption adjustment policy corresponding to the effect algorithm, and adjust the power consumption of the electronic device according to the power consumption adjustment policy corresponding to the effect algorithm. When the sensing application 02 adjusts the power consumption of the electronic device according to the power consumption adjustment policy corresponding to the usage effect algorithm, the frequency of the CPU of the electronic device may be set to a smaller frequency.
For another example, when the sensing application 02 determines that the electronic device does not use the effect algorithm to perform shooting, the sensing application 02 may determine that the power consumption adjustment policy of the electronic device is a power consumption adjustment policy corresponding to the effect algorithm, and adjust the power consumption of the electronic device according to the power consumption adjustment policy corresponding to the effect algorithm.
In some examples, in order for the aware application 02 to implement the function of determining whether the electronic device is shooting using the effects algorithm, and to implement the function of determining a power consumption adjustment policy of the electronic device, and adjusting the power consumption of the electronic device according to the determined power consumption adjustment policy, the aware application 02 needs to cooperate with different functional modules in addition to the hardware support as shown in fig. 1.
For example, as shown in connection with fig. 3, the aware application 02 also requires coordination of different functional modules such as a camera status probe 03, a probe manager 04, a scene awareness module 05, a scene policy management module 06, and a CPU power consumption scheduler 07.
The camera status probe 03 may be used to obtain the status of the camera device of the electronic device. That is, the camera status probe 03 may be used to obtain events during use of the camera device of the electronic device, such as a data stream start event (i.e., an event in which the camera device of the electronic device is started and begins to send a data stream to the camera application 01), an on-effects algorithm event (i.e., an event in which the electronic device uses effects algorithms to take a photograph), and a data stream off event (i.e., an event in which the camera device of the electronic device is off and stops sending a data stream to the camera application 01).
The camera status probe 03 may also be configured to send the acquired event during use of the camera device of the electronic device to the probe manager 04.
The probe manager 04 may be configured to receive an event during use of the camera device of the electronic device sent by the camera status probe 03. The probe manager 04 may also be configured to send the received event during use of the camera device of the electronic device to the scene sensing module 05.
The scene perception module 05 may be configured to receive an event during use of a camera device of the electronic device sent by the probe manager 04.
The scene perception module 05 may be further configured to determine different scenes (such as an effect algorithm on scene, an effect algorithm off scene, or a data stream off scene) according to an event during use of the camera device of the electronic device, that is, determine whether the electronic device uses the effect algorithm to shoot, or determine whether the camera device of the electronic device is turned off.
The scene perception module 05 may be further configured to send an effect algorithm start notification to the scene policy management module 06 when it is determined that the electronic device shoots using the effect algorithm.
The scene perception module 05 may be further configured to send a data stream shutdown notification to the scene policy management module 06 when it is determined that the electronic device does not use the effect algorithm to shoot.
The scene policy management module 06 may be configured to receive a notification (such as an effect algorithm on notification, an effect algorithm off notification, or a data stream off notification) sent by the scene perception module 05.
The scene policy management module 06 may be further configured to determine a corresponding power consumption adjustment policy according to the received notification sent by the scene sensing module 05. For example, in a case where the notification received by the scene policy management module 06 and sent by the scene perception module 05 is an effect algorithm on notification (corresponding to an effect algorithm on scene), the scene policy management module 06 may determine that the power consumption adjustment policy is a power consumption adjustment policy corresponding to the use effect algorithm. In the case that the notification sent by the scene perception module 05 and received by the scene policy management module 06 is an effect algorithm closing notification (corresponding to the effect algorithm closing scene), the scene policy management module 06 may determine that the power consumption adjustment policy is a power consumption adjustment policy corresponding to the closing effect algorithm. In the case where the notification sent by the scene perception module 05 and received by the scene policy management module 06 is a data stream shutdown notification (corresponding to a data stream shutdown scene), the scene policy management module 06 may determine that the power consumption adjustment policy is a power consumption adjustment policy corresponding to the non-usage effect algorithm.
The scenario policy management module 06 may be further configured to send a corresponding power consumption adjustment policy to the CPU power consumption scheduler 07.
The CPU power consumption scheduler 07 may be configured to receive the power consumption adjustment policy sent by the scene policy management module 06.
The CPU power consumption scheduler 07 may also be configured to adjust power consumption of the electronic device (e.g., adjust power consumption of a CPU of the electronic device) according to the power consumption adjustment policy sent by the received scene policy management module 06.
It should be noted that the sensing application 02 may also include other probes for sensing other scenes. For example, as shown in connection with fig. 3, the aware application 02 may also include an application type probe 08 for sensing the type of application that the electronic device is open to determine other scenarios.
In some examples, as shown in connection with fig. 4, in order for the camera status probe 03 to implement the functionality of acquiring events during use of the camera device of the electronic device, in addition to the support of hardware as shown in fig. 1 above, coordination of the camera service 09, the camera driver 11, the camera device 12, the event viewer 13, and the camera application 01 comprised by the electronic device is required. The camera service 09 can include an effects algorithm customization library 10. The effects algorithm customization library 10 may include a plurality of effects algorithms.
For example, as shown in connection with fig. 3 and 4, the process of acquiring events (such as the above-described data stream start event, the on-effect algorithm event, and the data stream off event) during use of the camera device of the electronic device by the camera status probe 03 may include the following processes.
The process of the camera status probe 03 acquiring a data stream start event may include:
when a user needs to take a picture using the camera device of the electronic device, the user may trigger the camera application 01 on the electronic device. That is, when the camera application 01 on the electronic device receives a trigger operation by the user, the camera application 01 on the electronic device may call the camera service 09 of the electronic device. After the camera application 01 on the electronic device invokes the camera service 09 of the electronic device, the camera service 09 of the electronic device may invoke the camera driver 11 of the electronic device.
After the camera service 09 of the electronic device invokes the camera driver 11 of the electronic device, the camera driver 11 of the electronic device may invoke the camera device 12 of the electronic device. In some examples, the camera driver 11 of the electronic device may invoke the camera device 12 of the electronic device through a USB interface or MIPI interface.
After the camera driver 11 of the electronic device invokes the camera device 12 of the electronic device, the camera device 12 of the electronic device is started. After the camera device 12 of the electronic device is started, the camera device 12 of the electronic device may acquire a data stream (e.g., data corresponding to a captured picture, data stream corresponding to a captured video, etc.).
After the camera device 12 of the electronic device acquires the data stream, the camera device 12 of the electronic device may send the acquired data stream to the camera driver 11 of the electronic device.
After the camera driver 11 of the electronic device receives the data stream, the camera driver 11 of the electronic device may send the data stream to the camera service 09 of the electronic device.
After the camera service 09 of the electronic device receives the data stream, the camera service 09 of the electronic device may send the data stream to the camera application 01 of the electronic device. After the camera application 01 of the electronic device receives the data stream, the electronic device may display the received data stream.
After the camera service 09 of the electronic device receives the data stream, the camera service 09 of the electronic device may also send a data stream start event to the event viewer 13 of the electronic device. That is, the camera status probe 03 of the electronic device has acquired the data stream start event. In some examples, where the operating system of the electronic device is a Windows system, the event viewer 13 may be a Windows event viewer.
After the electronic device's event viewer 13 receives the data stream start event, the electronic device event viewer 13 may send the data stream start event to the electronic device's aware application 02. In some examples, the electronic device event viewer 13 may send a data stream start event to the probe manager 04 included in the aware application 02 of the electronic device.
The process of the camera status probe 03 acquiring the on-effect algorithm event may include:
after the user triggers the electronic device to start the camera device (i.e. the camera status probe 03 acquires the data stream start event), when the user needs to use the effect algorithm of the electronic device to shoot, the user may trigger the effect algorithm displayed by the camera application 01 on the electronic device, so as to select a corresponding effect algorithm. That is, when the camera application 01 on the electronic device receives the triggering operation of the effect algorithm by the user, the camera application 01 on the electronic device may call the camera service 09 of the electronic device, so that the camera service 09 may process the data stream sent by the camera device 12 using the corresponding effect algorithm in the effect algorithm custom library 10.
After the camera application 01 on the electronic device invokes the camera service 09 of the electronic device, the camera service 09 of the electronic device can customize the library 10 with the effect algorithm to process the data stream sent by the camera device 12 using the corresponding effect algorithm.
After the camera service 09 of the electronic device processes the data stream sent by the camera device 12 using the corresponding effect algorithm in the effect algorithm customization library 10, the camera service 09 of the electronic device may send the processed data stream to the camera application 01 of the electronic device. After the camera application 01 of the electronic device receives the processed data stream, the electronic device may display the received processed data stream.
The camera service 09 of the electronic device may also send a number on effect algorithm event to the event viewer 13 of the electronic device when the camera service 09 of the electronic device processes the data stream sent by the camera device 12 using the corresponding effect algorithm in the effect algorithm customization library 10. That is, the camera status probe 03 of the electronic device has acquired the on-effect algorithm event.
After the electronic device's event viewer 13 receives the open effect algorithm event, the electronic device event viewer 13 may send the open effect algorithm event to the electronic device's aware application 02 4. In some examples, the electronic device event viewer 13 may send an open effect algorithm event to the probe manager 04 included in the aware application 02 of the electronic device.
The process of the camera status probe 03 acquiring a data stream shutdown event may include:
after the user triggers the electronic device to shoot using the effect algorithm (i.e. the camera status probe 03 acquires the event of turning on the effect algorithm), the user may trigger the camera application 01 on the electronic device when the user needs to turn off the camera device of the electronic device. That is, when the camera application 01 on the electronic device receives a trigger operation that the user turns off the camera device of the electronic device, the camera application 01 on the electronic device may invoke the camera service 09 of the electronic device.
After the camera application 01 on the electronic device invokes the camera service 09 of the electronic device, the camera service 09 of the electronic device may invoke the camera driver 11 of the electronic device.
After the camera service 09 of the electronic device invokes the camera driver 11 of the electronic device, the camera driver 11 of the electronic device may invoke the camera device 12 of the electronic device.
After the camera driver 11 of the electronic device invokes the camera device 12 of the electronic device, the camera device 12 of the electronic device is turned off.
When the camera application 01 on the electronic device invokes the camera service 09 of the electronic device, the camera service 09 of the electronic device may also send a data stream shutdown event to the event viewer 13 of the electronic device. That is, the camera status probe 03 of the electronic device has acquired a data stream shutdown event.
After the electronic device's event viewer 13 receives the data stream shutdown event, the electronic device event viewer 13 may send the data stream shutdown event to the electronic device's aware application 02. In some examples, the electronic device event viewer 13 may send a data stream shutdown event to the probe manager 04 included in the aware application 02 of the electronic device.
After the probe manager 04 receives the data stream start event, the start effect algorithm event or the data stream close event, the probe manager 04 may send the acquired data stream start event, start effect algorithm event or data stream close event to the scene sensing module 05, so that the scene sensing module 05 may determine a corresponding scene, and further, the scene policy management module may determine a corresponding power consumption policy according to the corresponding scene.
The power consumption control method provided by the embodiment of the application is described in detail below with reference to fig. 5. Fig. 5 is a flow chart of a power consumption control method according to an embodiment of the present application. As shown in fig. 5, the power consumption control method may include S501 to S538 described below.
S501, the camera application of the electronic device receives an operation of turning on the camera device by a user.
When a user needs to use the camera device of the electronic device to shoot, the user can trigger the camera device of the electronic device to be started. That is, when the electronic device receives an operation of turning on the camera device by the user, the electronic device may turn on the camera device in response, and the operation of turning on the camera device by the user in the embodiment of the present application may be referred to as a fourth operation.
In some examples, when a user needs to take a photograph using a camera device of an electronic device, the user may trigger a camera application on the electronic device, such that the camera application of the electronic device may trigger the camera device of the electronic device to turn on. The process of triggering the camera device of the electronic device to be turned on by the camera application of the electronic device is as follows S502-S508.
In other examples, a user may initiate operation of the camera device by invoking a camera application during use of other applications of the electronic device. For example, a user may turn on the operation of the camera device while using the social application to conduct a video call. That is, the electronic device may receive an operation for turning on the camera device when the video call is made, and the application of the video call may call the camera application, that is, the camera application of the electronic device may receive an operation for the user to turn on the camera device, so that the camera application may turn on the camera device.
In other examples, the user may trigger an operation of opening a camera application of the electronic device, such as a click operation of an icon of the camera application by the user. After the user starts the camera device of the electronic device, the user can also operate the camera device of the electronic device to take a picture, and can also operate the camera device of the electronic device to record a video.
S502, in response to an operation of turning on the camera device by the user, the camera application of the electronic device sends a first notification to the camera service to instruct to turn on the camera device of the electronic device.
When a camera application of the electronic device receives an operation of turning on the camera device by a user, such as a click operation of an icon of the camera application by the user, the camera application of the electronic device may send a first notification to the camera service in response. The first notification may be used to indicate that the camera device of the electronic device is to be activated.
That is, after the camera application of the electronic device receives an operation of turning on the camera device by the user, the camera application of the electronic device may invoke the camera service, so that the camera service may send a first notification to the camera driver.
S503, the camera service of the electronic device receives the first notification.
S504, the camera service of the electronic device sends a second notification to the camera driver.
After the camera service of the electronic device receives the first notification sent by the camera application of the electronic device, the camera service of the electronic device may send a second notification to a camera driver of the electronic device to indicate that the camera device of the electronic device is activated.
That is, after the camera service of the electronic device receives the first notification sent by the camera application of the electronic device, the camera service of the electronic device may invoke the camera driver, such that the camera driver may activate the camera device of the electronic device, i.e., the camera driver may send a third notification to the camera device of the electronic device to indicate activation of the camera device of the electronic device.
S505, the camera driver of the electronic device receives the second notification.
S506, the camera driver of the electronic device sends a third notification to the camera device.
After the camera driver of the electronic device receives the second notification sent by the camera service of the electronic device, the camera driver of the electronic device may send a third notification to the camera device of the electronic device to indicate to activate the camera device of the electronic device.
That is, after the camera driver of the electronic device receives the second notification sent by the camera service of the electronic device, the camera driver of the electronic device may invoke the camera device of the electronic device so that the camera device of the electronic device may be booted.
In some examples, the camera driver of the electronic device may send the first notification to the camera device of the electronic device through a USB interface or MIPI interface. I.e. the camera driver of the electronic device may invoke the camera device of the electronic device via a USB interface or MIPI interface.
S507, the camera device of the electronic device receives a third notification.
S508, starting the camera device of the electronic device.
After the camera device of the electronic device receives the third notification sent by the camera driver of the electronic device, the camera device of the electronic device may be started.
S509, the camera device of the electronic device acquires the data stream.
After the camera device of the electronic device is turned on, the camera device of the electronic device may acquire a data stream, which may also be referred to as a camera data stream. After the camera device of the electronic device acquires the data stream, the data stream may be sent to the camera application of the electronic device, so that the camera application of the electronic device may display the data stream sent by the camera device. The process of the camera device of the electronic device transmitting the data stream to the camera application of the electronic device is as follows S510-S515.
Camera data streams, i.e. data of images taken by a camera device of an electronic device. The data of the image shot by the camera device may be data corresponding to a picture shot by the camera device when shooting, may also be data corresponding to a picture shot by the camera device when recording, or may also be data corresponding to a picture shot by the camera device when making a video call.
It should be noted that, when the camera device of the electronic device is in the preview state, the camera device also acquires the camera data stream. The camera device of the electronic device obtains the data stream when the camera device of the electronic device is started, and sends the obtained data stream to the camera application program of the electronic device, that is, the operation that the user starts the camera device is the operation that the user starts the data stream of the camera device.
In the embodiment of the application, the operation of starting the camera equipment by the user is taken as an example for schematic description when the user uses the electronic equipment to carry out video call, namely, the data stream acquired by the camera equipment of the electronic equipment is the data corresponding to the picture shot by the camera equipment of the electronic equipment when carrying out video call.
It should be noted that, after the user turns on the camera device, the user operates the camera device of the electronic device to perform a video call, and the camera device of the electronic device may continuously acquire a data stream during the video call, that is, the camera device of the electronic device may continuously send the acquired data stream to the camera application program of the electronic device.
S510, the camera device of the electronic device sends a data stream to the camera driver.
After the camera device of the electronic device acquires the data stream, the camera device of the electronic device may send the acquired data stream to a camera driver of the electronic device.
S511, the camera driver of the electronic device receives the data stream.
S512, the camera driver of the electronic device sends the data stream to the camera service.
After the camera driver of the electronic device receives the data stream sent by the camera device of the electronic device, the camera driver of the electronic device may send the received data stream to a camera service of the electronic device.
S513, the camera service of the electronic device receives the data stream.
S514, the camera service of the electronic device sends the data stream to the camera application.
After the camera service of the electronic device receives the data stream sent by the camera driver of the electronic device, the camera service of the electronic device may send the received data stream to a camera application of the electronic device.
S515, the camera application program of the electronic device receives and displays the image corresponding to the data stream.
After the camera application of the electronic device receives the data stream sent by the camera service of the electronic device, the camera application of the electronic device may display the first interface. The first interface may include an image corresponding to a data stream received by a camera application of the electronic device.
For example, taking an operation of starting the camera device by a user as an example of an operation of starting the camera device when the user uses the electronic device to perform video call, when the camera application program of the electronic device receives an operation of triggering the camera device of the electronic device to perform video call by the user, the camera application program of the electronic device starts the camera device of the electronic device by calling the camera service and the camera driver. After the camera device of the electronic device is started, the camera device of the electronic device acquires a data stream at the time of the video call (i.e., an image captured by the camera device at the time of the video call).
After the camera device of the electronic device acquires the data stream at the time of the video call, the camera device of the electronic device transmits the acquired data stream to the camera application of the electronic device through the camera driver and the camera service. After the camera application of the electronic device receives the data stream, the electronic device may display the received data stream, as shown in (a) in fig. 6A, when the electronic device performs a video call, the camera device of the electronic device may acquire an image captured during the video call, after the camera application of the electronic device receives the data stream, the electronic device may display a first interface (i.e., an interface for the video call), where the first interface may include an image corresponding to the data stream received by the camera application of the electronic device (i.e., an image captured by a camera of the electronic device).
The first interface may also include an effects algorithm control. When the user needs to use the effect algorithm to shoot, the user can trigger an effect algorithm control (which can be called as a first control in the embodiment of the application) included in the first interface. That is, when the electronic device receives a triggering operation, such as a clicking operation, of an effect algorithm control included in the first interface, the electronic device may use a corresponding effect algorithm (in the embodiment of the present application, may be referred to as a preset image algorithm, where the preset image algorithm corresponds to the first control), to process a data stream sent by the camera device to the camera application program.
In some examples, the effect algorithm control may be one or multiple, which is not limited in the embodiment of the present application. Different effect algorithm controls may correspond to different effect algorithms. For example, the effect algorithm control may include a filter option, a beauty option, an occlusion background option, a denoising option, a blurring option, and the like, where the filter option corresponds to a filter effect algorithm (i.e., when the user selects the filter option, the electronic device may filter an image captured by the camera device), the beauty Yan Xuanxiang corresponds to a beauty effect algorithm (i.e., when the user selects the beauty option, the electronic device may beautify an image captured by the camera device), the occlusion background option corresponds to an occlusion background effect algorithm (i.e., when the user selects the occlusion background option, the electronic device may occlude a background of an image captured by the camera device), the denoising option corresponds to a denoising effect algorithm (i.e., when the user selects the denoising option, the electronic device may denoise an image captured by the camera device), and the blurring option corresponds to a blurring effect algorithm (i.e., when the user selects the blurring option, the electronic device may blur an image captured by the camera device).
In some examples, the electronic device may select one effect algorithm to shoot, or the electronic device may select multiple effects to shoot at the same time, which is not limited by the embodiment of the present application.
For example, continuing to take the operation of turning on the camera device by the user, for example, as shown in (a) in fig. 6A, when the user uses the electronic device to perform a video call, the camera device of the electronic device may acquire an image captured during the video call, after the camera application of the electronic device receives the data stream, the electronic device may display a first interface (i.e., an interface for the video call), where the first interface may include the data stream received by the camera application of the electronic device (i.e., an image captured by the camera of the electronic device). The first interface may also include a plurality of effect algorithm options, such as a filter option, a beauty option, an occlusion background option, a denoising option, a blurring option. The user may select different effect algorithm options, i.e. the user may choose to process images taken by the camera of the electronic device using different effect algorithms.
It should be noted that, in the prior art, when the electronic device processes the data stream shot by the camera device using the preset image algorithm, the electronic device may set the frequency (e.g. called the fourth frequency) of the CPU according to the default power consumption policy. For example, continuing to refer to (a) in fig. 6A, while the electronic device is engaged in a video call, the electronic device may display a plurality of effect algorithm controls, such as filter options. When the electronic device receives the triggering operation of the filter option by the user, as shown in (b) in fig. 6A, the electronic device may process the data stream sent to the camera application program by using the corresponding effect algorithm, where the electronic device sets the frequency of the CPU (i.e., the fourth frequency) according to the default power consumption policy, and the fourth frequency is generally higher, which may result in greater power consumption of the CPU.
S516, the camera service of the electronic device sends a data flow starting event to the event viewer.
The camera service of the electronic device may also send a data stream start event to an event viewer of the electronic device after the camera service of the electronic device receives the data stream sent by the camera driver of the electronic device. The data stream start event, which is used to instruct the camera device of the electronic device to start sending the data stream to the camera application program of the electronic device, may be referred to as first event information in the embodiment of the present application.
In some examples, the camera service of the electronic device may include an effect algorithm customization library, such as a DMFT algorithm library, and in the case where the electronic device processes a data stream captured by the camera device using a preset image algorithm included in the DMFT algorithm library, the camera service of the electronic device sends a data stream start event to the event viewer, and the camera service of the electronic device may send the data stream start event to the event viewer through a processing port of the DMFT algorithm library.
In some examples, the data stream start event may also be referred to as data stream start information. The data flow starting event can be data with a preset format. The data flow start event may include a data flow start identification. The data flow start identifier is used for indicating the camera device of the electronic device to start sending the data flow to the camera application program of the electronic device, and in the embodiment of the application, the data flow start identifier may be called a first preset identifier. The data flow start event may also include other identifications. For example, the data flow start event may also include a data type (e.g., information), driver version (e.g., 1.X. Xxxx. Xxx), power state (e.g., AC), initialization time.
For example, the data stream start event may be: eventID 1001, type: info, driveVersion: 1.X. Xxxx. Xxx, powerStatus: AC, inittime: xxms. The data flow start event includes a data flow start identifier of EventID 1001, that is, when EventID is 1001, the data is a data flow start event. The data stream start event also includes data Type, i.e., type: info, driver version, i.e., driverVersion:1.X. Xxxx. Xxx, power state, i.e., powerStatus: AC, initialization time, i.e., initTime: xxms.
It should be noted that, after the camera service of the electronic device receives the data stream sent by the camera driver of the electronic device, the camera service of the electronic device may send the data stream start event to the event viewer of the electronic device while the camera service of the electronic device sends the data stream to the camera application of the electronic device. I.e. S514 and S516 described above may be performed simultaneously.
S517, an event viewer of the electronic device receives the data stream start event.
S518, the event viewer of the electronic device sends a data flow start event to the probe manager.
After the event viewer of the electronic device receives the data stream start event transmitted by the camera service of the electronic device, the event viewer of the electronic device may transmit the received data stream start event to the probe manager of the electronic device.
S519, the probe manager of the electronic device receives the data stream start event.
And S520, the probe manager of the electronic device sends a data flow start event to the scene sensing module.
After the probe manager of the electronic device receives the data stream start event sent by the event viewer of the electronic device, the probe manager of the electronic device may send the received data stream start event to a scene awareness module of the electronic device.
S521, a scene perception module of the electronic device receives a data stream start event.
After the scene sensing module of the electronic device receives the data stream start event sent by the probe manager of the electronic device, the scene sensing module of the electronic device may save the received data stream start event.
S522, the camera application program of the electronic device receives an operation of the user opening effect algorithm.
As described above, after the camera application of the electronic device receives the data stream sent by the camera service of the electronic device, the camera application of the electronic device may display a first interface, where the first interface may include an image corresponding to the data stream received by the camera application of the electronic device, and the first interface may further include an effect algorithm control.
When the user needs to shoot by using the effect algorithm, the user can trigger an effect algorithm control included in the first interface. That is, when the electronic device receives a triggering operation, such as a clicking operation (i.e., an operation that the user opens an effect algorithm, of an effect algorithm control included in the first interface), the electronic device may use the corresponding effect algorithm to process a data stream sent by the camera device to the camera application program. In the embodiment of the application, the triggering operation of the user on the effect algorithm control included in the first interface can be called a first operation.
For example, as shown in fig. 6B (a), when the electronic device performs a video call, the camera device of the electronic device may acquire an image captured during the video call, and after the camera application of the electronic device receives the data stream, the electronic device may display a first interface (i.e., an interface for the video call), and the first interface may include the data stream received by the camera application of the electronic device (i.e., the image captured by the camera of the electronic device). The first interface may also include a plurality of effect algorithm controls, such as a filter option, a beauty option, an occlusion background option, a denoising option, a blurring option. When the electronic device receives a triggering operation of the filter option by the user, such as a clicking operation, that is, when the electronic device receives an operation of opening an effect algorithm by the user, the electronic device may process a data stream sent to the camera application program by using the corresponding effect algorithm, that is, the electronic device may execute S523-S525 described below.
S523, in response to the operation of the user opening the effect algorithm, the camera application of the electronic device transmits a fourth notification to the camera service.
When the camera application of the electronic device receives an operation of the user-on-effect algorithm, in response, the camera application of the electronic device sends a fourth notification to the camera service. Fourth, it is known that a camera service of an electronic device may be instructed to invoke a corresponding effect algorithm to process a data stream sent by the camera device to a camera application.
That is, after the camera application of the electronic device receives an operation of turning on the camera device by the user, the camera application of the electronic device may call the camera service so that the camera service may turn on the corresponding effect algorithm.
S524, the camera service of the electronic device receives the fourth notification.
S525, a camera service starting effect algorithm of the electronic device.
After the camera service of the electronic device receives the fourth notification sent by the camera application, the camera service of the electronic device may call a corresponding effect algorithm in the effect algorithm library, and process a data stream sent by the camera device to the camera application through the corresponding effect algorithm.
S526, the camera service of the electronic device sends an effect opening algorithm event to the event viewer.
After the camera service of the electronic device receives the fourth notification sent by the camera application of the electronic device, the camera service of the electronic device may also send an open effects algorithm event to an event viewer of the electronic device. And the effect algorithm starting event is used for indicating the camera service of the electronic device to use the effect algorithm to process the data stream sent to the camera application program by the camera device. In the embodiment of the application, the event of the opening effect algorithm can be called second event information.
In some examples, the on-effect algorithm event may be a pre-formatted data. The open effect algorithm event may include an open effect algorithm identification. The startup effect algorithm identifier is used for indicating the camera service of the electronic device to use the effect algorithm to process the data stream sent to the camera application program by the camera device.
For example, the on-effects algorithm identification may be a camera state of 1, i.e., when the camera state is 1, the event is an on-effects algorithm event, and when the camera state is 0, the event is an off-effects algorithm event. The open effect algorithm event may also include other identifications. For example, the on-effects algorithm events may also include data type, driver version, sensitivity, resolution, frame rate, power mode.
For example, the on-effect algorithm event may be: eventID 1002, type: info, driver version:1.X. Xxxx. Xxx, ISO: xxx, resolution:2560x1440, frameRate:30, powerMode:4, cameraStatus:1. The startup algorithm event includes a startup algorithm identifier that is a camera state, i.e., a camera status, that is, when the camera state, i.e., the camera status, is 1, the data is a startup algorithm event. The on-effect algorithm event also includes a data Type identifier, i.e., type: info, a driver version identifier, i.e., driverVersion:1.X. Xxxx. Xxx, sensitivity, i.e., ISO: xxx, resolution, i.e., resolution:2560x1440, frame rate, i.e., frame rate:30, and power mode, i.e., powerMode:4.
It should be noted that, when the user operates to start the camera device, the camera device of the electronic device may continuously send the acquired data stream to the camera application program of the electronic device when the user uses the electronic device to perform the video call, that is, the camera service of the electronic device may continuously process the data stream sent to the camera application program by the camera device through the corresponding effect algorithm. Therefore, the camera service of the electronic device can send the event of opening the effect algorithm to the event viewer once every preset time, so that the electronic device can determine that the camera service of the electronic device continuously processes the data stream sent to the camera application program by the camera device through the corresponding effect algorithm.
In some examples, the preset time may be set according to practical situations, which is not limited by the embodiment of the present application. For example, the preset time may be 10 seconds, i.e., every 10 seconds, the camera service of the electronic device may send an on-effects algorithm event to the event viewer.
In some examples, after the camera service of the electronic device receives the fourth notification sent by the camera application of the electronic device, the camera service of the electronic device may send an open effects algorithm event to an event viewer of the electronic device while the camera service of the electronic device opens effects algorithms. I.e. S525 and S526 described above may be performed simultaneously.
S527, an event viewer of the electronic device receives the startup effect algorithm event.
S528, the event viewer of the electronic device sends an effect-on algorithm event to the probe manager.
After the event viewer of the electronic device receives the on-effects algorithm event sent by the camera service of the electronic device, the event viewer of the electronic device may send the received on-effects algorithm event to a probe manager of the electronic device.
And S529, the probe manager of the electronic device receives an effect starting algorithm event.
And S530, the probe manager of the electronic equipment sends an effect starting algorithm event to the scene sensing module.
After the probe manager of the electronic device receives the opening effect algorithm event sent by the event viewer of the electronic device, the probe manager of the electronic device may send the received opening effect algorithm event to the scene sensing module of the electronic device.
S531, the scene perception module of the electronic equipment receives the event of the starting effect algorithm.
After the scene sensing module of the electronic device receives the opening effect algorithm event sent by the probe manager of the electronic device, the scene sensing module of the electronic device can store the received opening effect algorithm event.
S532, the scene sensing module of the electronic equipment determines an effect algorithm starting scene according to the data flow starting event and the effect algorithm starting event.
When the scene sensing module of the electronic device receives the data stream starting event and the effect algorithm starting event sent by the probe manager, the scene sensing module of the electronic device can determine that the effect algorithm starts a scene, namely the scene sensing module of the electronic device can determine that the electronic device uses the effect algorithm to process the data stream sent to the camera application program by the camera device. In the embodiment of the application, the scene is opened by the effect algorithm, which can be called a first scene.
In some examples, the scene perception module of the electronic device may determine that the effect algorithm turns on the scene when the data flow start event includes a data flow start identifier and the turn-on effect algorithm event includes a turn-on effect algorithm identifier. That is, the scene perception module of the electronic device may determine the first scene when the first event includes the first identifier and the second event includes the second identifier.
S533, the scene perception module of the electronic equipment sends an effect algorithm starting notification to the scene policy management module.
After the scene sensing module of the electronic device determines that the effect algorithm starts the scene, the scene sensing module of the electronic device may send an effect algorithm start notification to the scene policy management module to instruct the electronic device to use the effect algorithm to process a data stream sent to the camera application program by the camera device, i.e. the effect algorithm starts the scene.
S534, the scene policy management module of the electronic device receives the effect algorithm starting notification.
S535, a scene policy management module of the electronic device starts a notification according to an effect algorithm to determine a first power consumption adjustment policy.
After the scene policy management module of the electronic device receives the effect algorithm starting notification sent by the scene sensing module of the electronic device, the scene policy management module of the electronic device can determine a first power consumption adjustment policy according to the effect algorithm starting notification. And the first power consumption adjustment strategy is the power consumption adjustment strategy corresponding to the electronic equipment using effect algorithm.
In the present application, a power consumption adjustment strategy is used to adjust the power consumption of an electronic device. In particular, it may be used to adjust the power consumption of a CPU on an electronic device. For example, the power consumption adjustment policy may adjust the power consumption of the CPU by adjusting relevant power consumption parameters of the CPU. For example, the power consumption parameter includes the frequency of the CPU, the energy efficiency ratio of the CPU, and the like.
In some examples, the first power consumption adjustment policy may include adjusting a frequency of a CPU of the electronic device to a first frequency. The first frequency may be less than the frequency of the CPU (i.e., the fourth frequency described above) set by the electronic device according to a default power consumption policy.
In other examples, adjusting the frequency of the CPU of the electronic device to the first frequency may include adjusting an energy efficiency ratio of the CPU of the electronic device to the first energy efficiency ratio. The energy efficiency ratio is the ratio of performance to power consumption, i.e., the energy efficiency ratio is the ratio of energy conversion efficiency. The larger the energy efficiency ratio is, the more electric energy is saved, and the corresponding frequency of the CPU of the electronic equipment is reduced. The first energy efficiency ratio may be greater than an energy efficiency ratio (e.g., referred to as a fourth energy efficiency ratio) of the CPU of the electronic device when the electronic device is at a frequency of the CPU set by a default power consumption policy.
S536, the scene policy management module of the electronic device sends a first power consumption adjustment policy to the CPU power consumption scheduler.
After the scene policy management module of the electronic device determines the first power consumption adjustment policy (i.e., the power consumption adjustment policy corresponding to the usage effect algorithm of the electronic device), the scene policy management module of the electronic device may send the first power consumption adjustment policy to the CPU power consumption scheduler, so that the CPU power consumption scheduler may adjust the power consumption of the CPU according to the first power consumption adjustment policy.
In some examples, after receiving the effect algorithm starting notification, the scene policy management module of the electronic device may determine the first power consumption adjustment policy according to a correspondence between the effect algorithm starting scene and the power consumption adjustment policy.
S537, a CPU power consumption scheduler of the electronic device receives a first power consumption adjustment strategy.
S538, the CPU power consumption scheduler of the electronic device adjusts the CPU power consumption according to the first power consumption adjustment strategy.
In some examples, when the first power consumption adjustment policy includes adjusting a frequency of a CPU of the electronic device to a first frequency, the CPU power consumption scheduler of the electronic device adjusts the CPU power consumption according to the first power consumption adjustment policy, which may include the CPU power consumption scheduler adjusting the frequency of the CPU to the first frequency. The first frequency is less than the frequency of the CPU set by the electronic device according to a default power consumption policy.
For example, continuing to combine with (B) in fig. 6B, when the electronic device performs a video call, the electronic device receives a trigger operation of the user on the filter option, and the electronic device may determine, according to a data stream start event and an effect algorithm opening event, an effect algorithm opening scene, and further determine, according to the effect algorithm opening scene, a first adjustment policy, that is, a power consumption adjustment policy corresponding to the electronic device using the effect algorithm. As shown in (B) in fig. 6B, the electronic device determines an effect algorithm on scenario, and determines a policy corresponding to the effect algorithm on scenario as a first power consumption adjustment policy, that is, a power consumption adjustment policy corresponding to the effect algorithm is used, for example, the frequency of the CUP of the electronic device is set to be a first frequency, where the first frequency is smaller than a fourth frequency (that is, when the electronic device processes a data stream sent to the camera application by the camera device using the corresponding effect algorithm, the electronic device sets a frequency of the CPU according to a default power consumption policy).
In other examples, when the first power consumption adjustment policy includes adjusting an energy efficiency ratio of a CPU of the electronic device to the first energy efficiency ratio, the CPU power consumption scheduler of the electronic device adjusts the CPU power consumption according to the first power consumption adjustment policy, which may include the CPU power consumption scheduler adjusting a parameter configuration of the CPU to thereby adjust the energy efficiency ratio of the CPU to the first energy efficiency ratio. The first energy efficiency ratio is greater than an energy efficiency ratio of a processor of the electronic device when the electronic device is at a frequency of a CPU set by a default power consumption policy.
By adopting the scheme of the application, when the electronic equipment starts the data stream of the camera (namely, the camera equipment is started), the electronic equipment can acquire the data stream starting event, and when the electronic equipment starts the effect algorithm, acquire the effect algorithm starting event, and accurately identify whether the electronic equipment starts the effect algorithm to shoot or not by identifying the data stream starting event and the effect algorithm starting event. When the electronic equipment is identified to start the effect algorithm to shoot, the electronic equipment can determine a corresponding power consumption adjustment strategy, and the frequency of a processor of the electronic equipment is correspondingly adjusted. According to the application, when the frequency of the processor of the electronic device is regulated according to the corresponding power consumption regulation strategy, the frequency of the processor of the electronic device can be set to be smaller, for example, the frequency can be set to be smaller than the frequency of the CPU corresponding to the default power consumption strategy, so that the power consumption of the CPU of the notebook computer can be reduced when a user shoots by using an effect algorithm on the notebook computer.
When the electronic equipment starts the camera data stream, the event viewer included in the operating system of the electronic equipment is used for reporting a data stream start event, and when the electronic equipment starts the effect algorithm, the event viewer included in the operating system of the electronic equipment is used for reporting the event of the effect algorithm, namely, the scheme of the application can determine whether the electronic equipment starts the effect algorithm or not by utilizing the event viewer in the operating system of the electronic equipment, and a hook function is not required to be added in the operating system of the electronic equipment, so that the process of identifying whether shooting is performed by using the effect algorithm or not by the electronic equipment can be simplified, and the security reduction of the operating system of the electronic equipment is avoided.
When the electronic device recognizes that the effect algorithm is turned on to shoot, the electronic device can determine a corresponding power consumption adjustment strategy to correspondingly adjust the frequency of the processor of the electronic device, and when the electronic device recognizes that the effect algorithm is turned off, the electronic device can also determine a corresponding power consumption adjustment strategy to correspondingly adjust the frequency of the processor of the electronic device, for example, the frequency of the processor of the electronic device is adjusted to be a smaller frequency, so that the power consumption of the processor of the electronic device can be reduced.
For example, the electronic device may identify a process of turning off the effect algorithm, and when the electronic device identifies that the effect algorithm is turned off, the electronic device may also determine a corresponding power consumption adjustment policy, and make a corresponding adjustment to the frequency of the processor of the electronic device, which may refer to S522-S538 described above.
That is, the camera application of the electronic device may receive the operation of the user shutdown effect algorithm, which in the embodiment of the present application may be referred to as a second operation. In some examples, the user's operation to close the effects algorithm may be a triggering operation of the effects algorithm control again by the user.
When the camera application of the electronic device receives an operation of the user closing effect algorithm, the camera application of the electronic device sends a notification of the closing effect algorithm to the camera service.
When the camera service of the electronic device receives the shutdown effect algorithm, the camera service of the electronic device may shutdown the corresponding effect algorithm. Meanwhile, the camera service of the electronic device may send a closing effect algorithm event to the event viewer, where in the embodiment of the present application, the closing effect algorithm event may be referred to as third event information, that is, the third event information is used to indicate that the electronic device has stopped using the effect algorithm to process the data stream shot by the camera device. After the event viewer of the electronic device receives the shutdown effect algorithm event, the event viewer of the electronic device may send the shutdown effect algorithm event to the probe manager.
After the probe manager of the electronic device receives the shutdown effect algorithm event sent by the event viewer of the electronic device, the probe manager of the electronic device may send the received shutdown effect algorithm event to a scene awareness module of the electronic device.
When the scene sensing module of the electronic device receives the event of closing the effect algorithm sent by the probe manager, the scene sensing module of the electronic device can determine that the effect algorithm closes the scene, that is, the scene sensing module of the electronic device can determine that the electronic device stops using the effect algorithm to process the data stream sent to the camera application program by the camera device. In the embodiment of the application, the scene of closing the effect algorithm may be referred to as a second scene, i.e. the second scene is used for indicating that the electronic device has stopped using the effect algorithm to process the data stream shot by the camera device.
After the scene sensing module of the electronic device determines that the effect algorithm closes the scene, the scene sensing module of the electronic device may send an effect algorithm closing notification to the scene policy management module.
After the scene policy management module of the electronic device receives the effect algorithm closing notification sent by the scene sensing module of the electronic device, the scene policy management module of the electronic device can determine a power consumption adjustment policy corresponding to the effect algorithm closing scene according to the effect algorithm closing notification, that is, the electronic device stops using the effect algorithm to process a data stream sent to the camera application program by the camera device. In the embodiment of the application, the power consumption adjustment strategy corresponding to the effect algorithm closing notification can be called a second power consumption adjustment strategy. In some examples, the second power consumption adjustment policy may include adjusting a frequency of a processor of the electronic device to a second frequency, which may be less than the first frequency (i.e., a frequency of a processor corresponding to the first power consumption adjustment policy). The second power consumption adjustment policy may also include adjusting an energy efficiency ratio of a CPU of the electronic device to a second energy efficiency ratio. The second energy efficiency ratio may be greater than the energy efficiency ratio of the CPU of the electronic device (i.e., the first energy efficiency ratio described above) when the electronic device sets the energy efficiency ratio of the CPU according to the first power consumption policy (i.e., the power consumption adjustment policy corresponding to the electronic device usage effect algorithm). For example, continuing to combine with (B) in fig. 6B, when the electronic device performs a video call, the electronic device receives a triggering operation of the user on the filter option, determines that the effect algorithm starts a scene, and determines a first adjustment policy, that is, a power consumption adjustment policy corresponding to the effect algorithm used by the electronic device. When the electronic device receives a closing operation of the filter option by the user, as shown in (c) of fig. 6B, the electronic device may stop processing the data stream photographed by the camera device using the filter algorithm. The electronic device may determine that the effect algorithm closes the scene, and determine that the policy corresponding to the effect algorithm closes the scene is a second power consumption adjustment policy, that is, the power consumption adjustment policy corresponding to the effect algorithm is stopped, for example, the frequency of the CPU of the electronic device is set to a second frequency, where the second frequency is smaller than the first frequency (that is, the frequency of the CPU corresponding to the effect algorithm opens the scene).
After the scene policy management module of the electronic device determines the power consumption adjustment policy corresponding to the effect algorithm closing scene, the scene policy management module of the electronic device can send the power consumption adjustment policy corresponding to the effect algorithm closing scene to the CPU power consumption scheduler, so that the CPU power consumption scheduler can adjust the power consumption of the CPU according to the power consumption adjustment policy corresponding to the effect algorithm closing scene.
In some examples, when the electronic device recognizes that the effect algorithm is turned on to shoot, the electronic device may determine a corresponding power consumption adjustment policy to correspondingly adjust the frequency of the processor of the electronic device, and when the electronic device turns off the camera device, the electronic device may also recognize that the camera device is turned off, and may also determine a corresponding power consumption adjustment policy to correspondingly adjust the frequency of the processor of the electronic device, for example, adjust the frequency of the processor of the electronic device to a smaller frequency, so as to reduce the power consumption of the processor of the electronic device.
Taking the example that the electronic equipment recognizes that the effect algorithm is started to shoot, the corresponding power consumption adjustment strategy is determined, and after the frequency of the processor of the electronic equipment is correspondingly adjusted, the electronic equipment turns off the camera equipment, the power consumption control method provided by the embodiment of the application is described in detail. Fig. 7 is a flow chart of a power consumption control method according to an embodiment of the present application. As shown in fig. 7, the power consumption control method may include S701 to S721 described below.
S701, the camera application of the electronic device receives an operation of turning off the camera device by the user.
When the user does not need to use the camera device of the electronic device to shoot, the user can trigger the camera device of the electronic device to be turned off. I.e. when the electronic device receives an operation by the user to turn off the camera device, the electronic device may, in response, turn off the camera device. The operation of closing the camera device by the user in the embodiment of the present application may be referred to as a third operation.
In some examples, the user may trigger a camera application on the electronic device when the user does not need to use the camera device of the electronic device to take a photograph, such that the camera application of the electronic device may trigger the camera device of the electronic device to be turned off. The camera application of the electronic device triggers the process of turning off the camera device of the electronic device as follows S702-S708.
The operation of closing the camera device by the user can trigger the operation of closing the camera application program by the electronic device for the user, and can trigger the operation of closing the video call by the electronic device for the user. In the embodiment of the application, the operation of closing the camera device by the user is taken as an example to carry out schematic description for triggering the operation of closing the video call by the electronic device by the user.
S702, in response to an operation of turning off the camera device by the user, the camera application of the electronic device sends a fifth notification to the camera service.
When the camera application of the electronic device receives an operation of closing the camera device by the user, such as an operation of closing the video call by the user triggering the electronic device, the camera application of the electronic device may send a fifth notification to the camera service in response. A fifth notification may be used to indicate that the camera device of the electronic device is turned off.
That is, after the camera application of the electronic device receives an operation of the user to turn off the camera device, the camera application of the electronic device may call the camera service, so that the camera service may send a sixth notification to the camera driver.
S703, the camera service of the electronic device receives the fifth notification.
S704, the camera service of the electronic device sends a sixth notification to the camera driver.
After the camera service of the electronic device receives the fifth notification sent by the camera application of the electronic device, the camera service of the electronic device may send a sixth notification to a camera driver of the electronic device to indicate to turn off the camera device of the electronic device.
The camera service of the electronic device may also turn off the effects algorithm after the camera service of the electronic device receives the fifth notification sent by the camera application of the electronic device.
That is, after the camera service of the electronic device receives the fifth notification sent by the camera application of the electronic device, the camera service of the electronic device may invoke the camera driver, so that the camera driver may send a seventh notification to the camera device to indicate to turn off the camera device of the electronic device.
S705, the camera driver of the electronic device receives the sixth notification.
S706, the camera driving of the electronic device sends a seventh notification to the camera device.
After the camera driver of the electronic device receives the sixth notification sent by the camera service of the electronic device, the camera driver of the electronic device may invoke the camera device of the electronic device so that the camera device of the electronic device may be turned off. That is, the camera driver of the electronic device may send a seventh notification to the camera device to indicate that the camera device of the electronic device is turned off.
S707, the camera device of the electronic device receives the seventh notification.
S708, the camera device of the electronic device is turned off.
After the camera device of the electronic device receives the seventh notification sent by the camera driver of the electronic device, the camera device of the electronic device may be turned off. After the camera device of the electronic device is turned off, the camera device of the electronic device stops sending the data stream to the camera application.
S709, the camera service of the electronic device sends a data stream closing event to the event viewer.
After the camera service of the electronic device receives the fifth notification sent by the camera application of the electronic device, the camera service of the electronic device may send a data stream shutdown event to the event viewer. A data stream shutdown event for instructing the camera device of the electronic device to shutdown, i.e. the camera device stops sending the data stream to the camera application of the electronic device. The data stream closing event in the embodiment of the present application may be referred to as fourth event information.
In some examples, the data flow shutdown event may be a pre-formatted data. The data flow shutdown event may include a data flow shutdown identification. The data stream closing identifier is used for indicating that the camera device of the electronic device is closed, that is, the camera device stops sending the data stream to the camera application program of the electronic device. The data flow shutdown event may also include other identifications. For example, a data flow shutdown event may also include a data type, driver version, service time.
For example, a data flow shutdown event may be: eventID 1003, type: info, driverVersion:1.X. Xxxx. Xxx, serviceTime:230S. The data flow closing event includes a data flow closing identifier of EventID:1003, that is, when EventID is 1003, the data is a data flow closing event. The data flow shutdown event also includes a data Type, i.e., type: info, driver version, i.e., driverVersion:1.X. Xxxx. Xxx, service time, i.e., serviceTime:230S.
After the camera service of the electronic device receives the fifth notification sent by the camera application of the electronic device, the camera service of the electronic device may send the data stream closing event to the event viewer of the electronic device, while the camera service of the electronic device sends the fifth notification to the camera driver of the electronic device. That is, the above S704 and S709 may be performed simultaneously.
S710, an event viewer of the electronic device receives the data stream closing event.
S711, an event viewer of the electronic device sends a data stream closing event to the probe manager.
After the event viewer of the electronic device receives the data stream shutdown event sent by the camera service of the electronic device, the event viewer of the electronic device may send the received data stream shutdown event to a probe manager of the electronic device.
S712, the probe manager of the electronic device receives the data flow closing event.
S713, the probe manager of the electronic device sends a data stream closing event to the scene sensing module.
After the probe manager of the electronic device receives the data stream closing event sent by the event viewer of the electronic device, the probe manager of the electronic device may send the received data stream closing event to a scene awareness module of the electronic device.
S714, a scene perception module of the electronic device receives a data stream closing event.
After the scene sensing module of the electronic device receives the data stream closing event sent by the probe manager of the electronic device, the scene sensing module of the electronic device may save the received data stream closing event.
S715, a scene sensing module of the electronic equipment determines a data flow closing scene according to the data flow closing event.
When the scene sensing module of the electronic device receives the data stream closing event sent by the probe manager, the scene sensing module of the electronic device can determine that the data stream is closed, namely the scene sensing module of the electronic device can determine that the camera device of the electronic device is closed, and the camera device stops sending the data stream to the camera application program of the electronic device. The data stream closing scene in the embodiment of the present application may be referred to as a third scene.
In some examples, the scene perception module of the electronic device may determine that the data stream is turned off when the data stream is turned off. Namely, when the fourth event information includes a third preset identifier, the scene sensing module of the electronic device may determine a third scene.
S716, the scene perception module of the electronic equipment sends a data stream closing notification to the scene policy management module.
After the scene sensing module of the electronic device determines that the data stream is closed, the scene sensing module of the electronic device may send a data stream closing notification to the scene policy management module to instruct the camera device of the electronic device to close, i.e. the data stream is closed.
S717, the scene policy management module of the electronic device receives the data stream closing notification.
S718, a scene strategy management module of the electronic equipment determines a third power consumption adjustment strategy according to the data flow closing notification.
After the scene policy management module of the electronic device receives the effect algorithm starting notification sent by the scene sensing module of the electronic device, the scene policy management module of the electronic device can determine a third power consumption adjustment policy according to the effect algorithm starting notification. And a third power consumption adjustment strategy, namely closing the corresponding power consumption adjustment strategy by the data flow of the electronic equipment.
In some examples, after receiving the data flow shutdown notification, the scene policy management module of the electronic device may determine a third power consumption adjustment policy according to a correspondence between the data flow shutdown scene and the power consumption adjustment policy.
In some examples, the third power consumption adjustment policy may include adjusting a frequency of a CPU of the electronic device to a third frequency. The third frequency may be smaller than a frequency of the CPU (i.e., the first frequency) set by the electronic device according to the first power consumption policy (i.e., the power consumption adjustment policy corresponding to the electronic device usage effect algorithm).
In other examples, the third power consumption adjustment policy may include adjusting an energy efficiency ratio of a CPU of the electronic device to a third energy efficiency ratio. The third energy efficiency ratio may be greater than the energy efficiency ratio of the CPU of the electronic device (i.e., the first energy efficiency ratio described above) when the electronic device sets the energy efficiency ratio of the CPU according to the first power consumption policy (i.e., the power consumption adjustment policy corresponding to the electronic device usage effect algorithm).
S719, the scene policy management module of the electronic equipment sends a third power consumption adjustment policy to the CPU power consumption scheduler.
After the scene policy management module of the electronic device determines the third power consumption adjustment policy (i.e., the power consumption adjustment policy corresponding to the data stream closing), the scene policy management module of the electronic device may send the third power consumption adjustment policy to the CPU power consumption scheduler, so that the CPU power consumption scheduler may adjust the power consumption of the CPU according to the third power consumption adjustment policy.
S720, a CPU power consumption scheduler of the electronic device receives a third power consumption adjustment strategy.
S721, the CPU power consumption scheduler of the electronic device adjusts the CPU power consumption according to the third power consumption adjustment strategy.
For example, continuing to combine with (B) in fig. 6B, when the electronic device performs a video call, the electronic device receives a triggering operation of the user on the filter option, determines that the effect algorithm starts a scene, and determines a first adjustment policy, that is, a power consumption adjustment policy corresponding to the effect algorithm used by the electronic device. When the electronic device receives an operation of turning off the camera device by the user, the electronic device may turn off the camera device as shown in (d) of fig. 6B. The electronic device may determine that the data flow is turned off, and determine that the policy corresponding to the data flow is a third power consumption adjustment policy, that is, the power consumption adjustment policy corresponding to the data flow is turned off, for example, the frequency of the CPU of the electronic device is set to a fourth frequency, where the fourth frequency is smaller than the second frequency (that is, the frequency of the CPU corresponding to the effect algorithm turned on scene).
By adopting the scheme of the application, when the electronic equipment closes the data stream of the camera, the electronic equipment can acquire the data stream closing event, and the electronic equipment can be accurately identified to close the camera equipment by identifying the data stream closing event. When the electronic equipment is identified to be closed, the electronic equipment can determine a corresponding power consumption adjustment strategy, and the frequency of the processor of the electronic equipment is correspondingly adjusted, so that the power consumption of the processor of the electronic equipment can be reduced. And when the electronic equipment closes the camera data stream, a data stream closing event is reported, and a hook function is not required to be added in an operating system of the electronic equipment, so that the process of the electronic equipment for identifying whether shooting is performed by using an effect algorithm can be simplified, and the safety reduction of the operating system of the electronic equipment is avoided.
For easy understanding, a power consumption control method according to an embodiment of the present application is described below with reference to fig. 8. As shown in fig. 8, the power consumption control method may include the following S801 to S808.
S801, the electronic device receives a fourth operation of turning on the camera device by the user.
In some examples, the electronic device may include a camera device, a camera service, and an event viewer.
The fourth operation may be an operation to turn on the camera device for the user. The operation of opening the camera device by the user may be the operation of opening the camera device by the user when the user uses the electronic device to make a video call. The user may also trigger an operation of opening the camera application of the electronic device for the user to open the camera device, such as a click operation of an icon of the camera application by the user.
In the embodiment of the present application, the electronic device may refer to S501 for receiving the fourth operation of turning on the camera device by the user, which is not described herein.
S802, responding to a fourth operation, the electronic equipment starts the camera equipment and acquires a first data stream.
When the electronic device receives a first operation of turning on the camera data stream by a user, the electronic device may, in response, turn on the camera device. After the electronic device turns on the camera device, the camera device of the electronic device may acquire the first data stream. The first data stream, i.e. the data of the image taken by the camera device of the electronic device.
In the embodiment of the present application, the electronic device starts the camera device and obtains the first data stream, and reference may be made to S502 to S509.
S803, the electronic device acquires a data stream starting event and displays a first interface, wherein the first interface comprises an image corresponding to the first data stream and a first control.
After the camera device of the electronic device acquires the first data stream, the electronic device may display the first interface. The first interface includes an image corresponding to the first data stream (may be referred to as a first image), that is, the electronic device may display the image corresponding to the first data stream acquired by the camera device of the electronic device, that is, the electronic device may display data of the image captured by the camera device.
The first interface may also include an effects algorithm control (which may be referred to as a first control). When the user needs to shoot by using the effect algorithm, the user can trigger an effect algorithm option included in the first interface. That is, when the electronic device receives a triggering operation, such as a clicking operation, of an effect algorithm option included in the first interface by the user, the electronic device may use a corresponding effect algorithm (may be referred to as a preset image algorithm) to process a data stream sent by the camera device to the camera application program.
In some examples, the first interface may be an interface that the electronic device displays when a user captures video using a camera device of the electronic device. The first interface may include an image captured by a camera device of the electronic device and an effects algorithm control (i.e., a first control). The first interface may also include other controls, such as a switch camera control and a stop shooting control. The first interface may also include a progress bar of the duration of the captured video.
In other examples, the first interface may be an interface displayed by the electronic device when the user is engaged in a video call using a camera device of the electronic device. The first interface may include images captured by a camera device of the electronic device, images sent by other electronic devices, and an effects algorithm control (i.e., a first control). The first interface may also include other controls, such as a switch camera control and a stop call control. The first interface may also include a duration of the video call.
After the camera device of the electronic device acquires the first data stream, the electronic device may acquire a data stream start event, which may also be referred to as the electronic device detecting the data stream start event. In some examples, the electronic device acquiring the data stream start event may be the electronic device's event viewer acquiring the data stream start event sent by the camera service, which may also be referred to as first event information. A data stream start event for instructing the electronic device to turn on the camera device. When the camera device of the electronic device is turned on, the camera device of the electronic device begins sending a data stream to a camera application of the electronic device.
In some examples, the data stream start event may include a data stream start identification, which may be used to indicate that the camera device of the electronic device has been turned on.
In the embodiment of the present application, the electronic device obtains the first event information and displays the first interface, and reference may be made to S510-S521.
S804, the electronic equipment receives a first operation of a first control by a user.
When the user needs to use the effect algorithm, the user can trigger an effect algorithm control included in the first interface of the electronic device. That is, when the electronic device receives a triggering operation (may be referred to as a first operation) of an effect algorithm control (may be referred to as a first control) included in the first interface by a user, such as a clicking operation, the electronic device may start an effect algorithm (may be referred to as a preset image algorithm), and process the first data stream using the effect algorithm.
In the embodiment of the present application, the electronic device receives the first operation of the effect algorithm control by the user, and reference may be made to S522 described above, which is not described herein.
S805, responding to a first operation, the electronic device starts an effect algorithm and acquires an event of the effect algorithm.
When the electronic device receives a triggering operation (i.e., a first operation) of an effect algorithm control included in the first interface by a user, the electronic device can start an effect algorithm and process the first data stream by using the effect algorithm. The electronic device may display a second interface, where the second interface may include a second image corresponding to the data stream captured by the camera device, that is, the second image is an image obtained by the electronic device processing the data stream captured by the camera device using a preset image algorithm corresponding to the first control.
The electronic device may acquire a start effect algorithm event (which may also be referred to as second event information) while the electronic device starts the effect algorithm. In some examples, the electronic device acquiring the startup effect algorithm event may be an event viewer of the electronic device acquiring a startup effect algorithm event sent by the camera service for instructing the camera service of the electronic device to process a data stream sent by the camera device to the camera application using the effect algorithm.
In some examples, the on-effect algorithm event may include an on-effect algorithm identification, which may be used to instruct the electronic device to process a data stream (i.e., a first data stream) captured by the camera device using the effect algorithm.
In the embodiment of the present application, the electronic device may refer to S523-S531 to start the effect algorithm and obtain the event of the effect algorithm, which is not described herein.
S806, the electronic device determines an effect algorithm starting scene according to the data stream starting event and the effect algorithm starting event.
After the electronic device acquires the data flow start event and the effect algorithm starting event, an effect algorithm starting scene can be determined according to the data flow start event and the effect algorithm starting event. The effect algorithm starts a scene, which may also be referred to as a first scene, and is used to instruct the electronic device to process the data stream acquired by the camera device using the effect algorithm.
In some examples, when the data flow start event includes a data flow start identifier (i.e., a first preset identifier), and the startup effect algorithm event includes a startup effect algorithm identifier (i.e., a second preset identifier), the electronic device determines an effect algorithm startup scene according to the data flow start event and the startup effect algorithm event, which may include the electronic device determining the effect algorithm startup scene according to the first preset identifier and the second preset identifier, and further may adjust a processor of the electronic device according to the determined effect algorithm startup scene.
In the embodiment of the present application, the electronic device determines the effect algorithm starting scene according to the data stream starting event and the starting effect algorithm event, and reference may be made to S532 above, which is not described herein.
S807, the electronic device starts a scene according to an effect algorithm, and determines a first power consumption adjustment strategy.
After the electronic device determines that the effect algorithm starts the scene, the electronic device may determine a first power consumption adjustment policy according to the effect algorithm start scene. And the first power consumption adjustment strategy is the power consumption adjustment strategy corresponding to the electronic equipment using effect algorithm.
In the embodiment of the present application, the electronic device determines the first power consumption adjustment policy according to the effect algorithm starting scene, and reference may be made to S533-S535.
S808, the electronic device adjusts the frequency of the processor to be the first frequency according to the first power consumption adjustment strategy.
After the electronic device determines the first power consumption adjustment policy, the electronic device may adjust the frequency of the processor to the first frequency, i.e., adjust the power consumption of the processor of the electronic device. The first frequency may be less than the frequency of the CPU (i.e., the fourth frequency described above) set by the electronic device according to a default power consumption policy.
In the embodiment of the present application, the electronic device adjusts the frequency of the processor to the first frequency according to the first power consumption adjustment policy, and reference may be made to S536-S538.
According to the scheme, when the electronic equipment starts the data flow of the camera (namely, the camera equipment is started), whether the electronic equipment starts an effect algorithm to shoot or not can be accurately identified by identifying the data flow starting event and the effect algorithm starting event. When the electronic equipment is identified to start the effect algorithm to shoot, a corresponding power consumption adjustment strategy can be determined, and when the frequency of the processor of the electronic equipment is adjusted, the frequency of the processor of the electronic equipment can be set to be smaller, so that the power consumption of the CPU of the notebook computer can be reduced when a user shoots by using the effect algorithm on the notebook computer.
According to the scheme, when the electronic equipment starts the camera data stream, the event viewer included in the operating system of the electronic equipment reports a data stream starting event, and when the electronic equipment starts the effect algorithm, the event viewer included in the operating system of the electronic equipment reports the effect algorithm starting event, that is, the scheme can determine whether the electronic equipment starts the effect algorithm or not by using the event viewer in the operating system of the electronic equipment, a hook function is not required to be added in the operating system of the electronic equipment, the process of identifying whether shooting is performed by using the effect algorithm or not by the electronic equipment can be simplified, and the safety reduction of the operating system of the electronic equipment can be avoided.
The embodiment of the application provides a power consumption control method which can also be applied to electronic equipment to determine a target scene in a Windows system through event information, so that a corresponding power consumption adjustment strategy is determined according to the target scene, and the power consumption of the electronic equipment can be adjusted according to the corresponding power consumption adjustment strategy.
Corresponding to the method in the foregoing embodiment, the embodiment of the present application further provides a power consumption control device. The power consumption control apparatus may be applied to an electronic device for implementing the method in the foregoing embodiment. The function of the power consumption control device can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
For example, fig. 9 shows a schematic structural diagram of a power consumption control apparatus 900, and as shown in fig. 9, the power consumption control apparatus 900 may include: an acquisition module 901, a display module 902, a receiving module 903, a configuration module 904, and the like.
The acquiring module 901 may be configured to acquire first event information sent by the camera service, where the first event information is used to instruct the electronic device to turn on the camera device.
The display module 902 may be configured to display a first interface, where the first interface includes a first image corresponding to a data stream captured by a camera device and a first control.
The receiving module 903 may be configured to receive a first operation of the first control by a user.
The obtaining module 901 may be further configured to obtain, in response to the first operation, second event information sent by the camera service, where the second event information is used to instruct the electronic device to process a data stream captured by the camera device using a preset image algorithm corresponding to the first control.
The display module 902 may be further configured to display a second interface, where the second interface includes a second image corresponding to the data stream captured by the camera device, where the second image is an image obtained by processing, by the electronic device, the data stream captured by the camera device using a preset image algorithm.
The configuration module 904 may be configured to adjust a frequency of a processor of the electronic device from a first frequency to a first frequency according to the first event information and the second event information.
In a possible implementation manner, the obtaining module 901 may be further configured to determine that, in a case where the electronic device processes the data stream captured by the camera device using the preset image algorithm included in the DMFT algorithm library, the electronic device processes the data stream captured by the camera device using the preset image algorithm.
The obtaining module 901 may be further configured to send the second event information to the event viewer.
The acquiring module 901 may be further configured to acquire second event information sent by the camera service.
In one possible implementation, the receiving module 903 may be further configured to receive a second operation of the first control by the user.
The obtaining module 901 may be further configured to obtain, in response to the second operation, third event information sent by the camera service, where the third event information is used to instruct the electronic device to stop processing the data stream shot by the camera device using a preset image algorithm.
The configuration module 904 may be further configured to adjust a frequency of a processor of the electronic device from a first frequency to a second frequency according to the third event information, where the second frequency is less than the first frequency.
In one possible implementation, the receiving module 903 may also be configured to receive a third operation by the user to turn off the camera device.
The obtaining module 901 may be further configured to obtain fourth event information sent by the camera service in response to the third operation, where the fourth event information is used to instruct the electronic device to turn off the camera device.
The power consumption control apparatus 900 may further include a shutdown module 905. A closing module 905 may be used to close the camera device.
The configuration module 904 may be further configured to adjust a frequency of a processor of the electronic device from the second frequency to a third frequency according to the fourth event information, the third frequency being less than the first frequency.
In one possible implementation manner, the first event may include a first preset identifier, where the first preset identifier may be used to instruct the electronic device to turn on the camera device; the second event may include a second preset identifier, which may be used to instruct the electronic device to process the data stream captured by the camera device using a preset image algorithm.
The configuration module 904 may be further configured to adjust a frequency of a processor of the electronic device to a first frequency according to the first preset identifier and the second preset identifier.
In one possible implementation, the power consumption control apparatus 900 may further include a determining module 906. The determining module 906 may be configured to determine the first scene based on the first event information and the second event information.
The determining module 906 may be further configured to determine a first power consumption adjustment policy according to the first scenario and the correspondence, where the first power consumption adjustment policy includes adjusting a frequency of a processor of the electronic device to a second frequency.
The configuration module 904 may be further configured to adjust the frequency of the processor to a first frequency according to a first power consumption adjustment policy.
In one possible implementation, the receiving module 903 may also be configured to receive a fourth operation that the user turns on the camera device.
The power consumption control apparatus 900 may further include a start module 907. The starting module 907 may be further configured to start the camera device in response to the fourth operation.
The configuration module 904 may also be configured to set the frequency of the processor of the electronic device to a fourth frequency according to a default power consumption policy.
The acquiring module 901 may also be configured to acquire a data stream shot by the camera device; wherein the first frequency is less than the fourth frequency.
In one possible implementation manner, the DMFT algorithm library may include algorithms for denoising an image, image transformation, image analysis, image compression, image enhancement, image blurring processing, and the like, and the DMFT algorithm library may also include algorithms for filtering an image captured by a camera device, beautifying a face, or masking a background of the image, and the like.
In one possible implementation, the determining module 906 may be further configured to determine the second scenario according to the third event information.
The determining module 906 may also be configured to determine a second power consumption adjustment policy according to a second scenario, the second power consumption adjustment policy including adjusting a frequency of a processor of the electronic device to a second frequency, the second frequency being less than the first frequency.
The configuration module 904 may be further configured to adjust a frequency of a processor of the electronic device from the first frequency to the second frequency according to a second power consumption adjustment policy.
In one possible implementation, the determining module 906 may be further configured to determine the third scenario according to the fourth event information by using the electronic device.
The determining module 906 may be further configured to determine a third power consumption adjustment policy according to a third scenario, the third power consumption adjustment policy including adjusting a frequency of a processor of the electronic device to a third frequency, the third frequency being less than the second frequency.
The configuration module 904 may be further configured to adjust a frequency of a processor of the electronic device from the first frequency to a third frequency according to a third power consumption adjustment policy.
It should be understood that the division of units or modules (hereinafter referred to as units) in the above apparatus is merely a division of logic functions, and may be fully or partially integrated into one physical entity or may be physically separated. And the units in the device can be all realized in the form of software calls through the processing element; or can be realized in hardware; it is also possible that part of the units are implemented in the form of software, which is called by the processing element, and part of the units are implemented in the form of hardware.
For example, each unit may be a processing element that is set up separately, may be implemented as integrated in a certain chip of the apparatus, or may be stored in a memory in the form of a program, and the functions of the unit may be called and executed by a certain processing element of the apparatus. Furthermore, all or part of these units may be integrated together or may be implemented independently. The processing element described herein, which may also be referred to as a processor, may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each unit above may be implemented by an integrated logic circuit of hardware in a processor element or in the form of software called by a processing element.
In one example, the units in the above apparatus may be one or more integrated circuits configured to implement the above method, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of at least two of these integrated circuit forms.
For another example, when the units in the apparatus may be implemented in the form of a scheduler of processing elements, the processing elements may be general-purpose processors, such as CPUs or other processors that may invoke programs. For another example, the units may be integrated together and implemented in the form of a system on chip SOC.
In one implementation, the above means for implementing each corresponding step in the above method may be implemented in the form of a processing element scheduler. For example, the apparatus may comprise a processing element and a storage element, the processing element invoking a program stored in the storage element to perform the method described in the above method embodiments. The memory element may be a memory element on the same chip as the processing element, i.e. an on-chip memory element.
In another implementation, the program for performing the above method may be on a memory element on a different chip than the processing element, i.e. an off-chip memory element. At this point, the processing element invokes or loads a program from the off-chip storage element onto the on-chip storage element to invoke and execute the method described in the method embodiments above.
For example, embodiments of the present application may also provide an apparatus, such as: an electronic device may include: a processor, a memory for storing instructions executable by the processor. The processor is configured to execute the above instructions, causing the electronic device to implement the power consumption control method as described in the previous embodiment. The memory may be located within the electronic device or may be located external to the electronic device. And the processor includes one or more.
In yet another implementation, the unit implementing each step in the above method may be configured as one or more processing elements, where the processing elements may be disposed on the electronic device corresponding to the above, and the processing elements may be integrated circuits, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of these types of integrated circuits. These integrated circuits may be integrated together to form a chip.
For example, the embodiment of the application also provides a chip, which can be applied to the electronic equipment. The chip includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a circuit; the processor receives and executes computer instructions from the memory of the electronic device through the interface circuit to implement the methods described in the method embodiments above.
Embodiments of the present application also provide a computer readable storage medium having stored thereon computer program instructions. The computer program instructions, when executed by an electronic device, enable the electronic device to implement the power consumption control method as described above.
The embodiment of the application also provides a computer program product, which comprises computer instructions for the electronic equipment to run, and when the computer instructions run in the electronic equipment, the electronic equipment can realize the power consumption control method. From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be embodied in the form of a software product, such as: and (5) program. The software product is stored in a program product, such as a computer readable storage medium, comprising instructions for causing a device (which may be a single-chip microcomputer, chip or the like) or processor (processor) to perform all or part of the steps of the methods described in the various embodiments of the application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
For example, embodiments of the present application may also provide a computer readable storage medium having computer program instructions stored thereon. The computer program instructions, when executed by an electronic device, cause the electronic device to implement the power consumption control method as described in the foregoing method embodiments.
The foregoing is merely illustrative of specific embodiments of the present application, and the scope of the present application is not limited thereto, but any changes or substitutions within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. The power consumption control method is characterized by being applied to electronic equipment, wherein the electronic equipment comprises camera equipment, camera service, equipment media foundation reconstruction DMFT algorithm library and an event viewer, the DMFT algorithm library comprises a preset image algorithm, and the method comprises the following steps:
the event viewer obtains first event information sent by the camera service, wherein the first event information is used for indicating the electronic equipment to start the camera equipment;
the electronic equipment displays a first interface, wherein the first interface comprises a first image corresponding to a data stream shot by the camera equipment and a first control;
The electronic equipment receives a first operation of a user on the first control;
in response to the first operation, the camera service sends second event information to the event viewer through an output interface of the DMFT algorithm library when the electronic device processes a data stream shot by the camera device by using the preset image algorithm in the DMFT algorithm library; the event viewer obtains second event information sent by the camera service, the second event information is used for indicating the electronic equipment to process a data stream shot by the camera equipment by using a preset image algorithm corresponding to the first control, the electronic equipment displays a second interface, the second interface comprises a second image corresponding to the data stream shot by the camera equipment, and the second image is an image obtained by the electronic equipment by using the preset image algorithm to process the data stream shot by the camera equipment;
the electronic equipment adjusts the frequency of a processor of the electronic equipment to be a first frequency according to the first event information and the second event information; the first frequency is smaller than a fourth frequency, and the fourth frequency is the frequency of a processor of the electronic equipment when the electronic equipment starts the camera equipment.
2. The method according to claim 1, wherein the method further comprises:
the electronic equipment receives a second operation of the first control by a user;
responding to the second operation, the event viewer obtains third event information sent by the camera service, wherein the third event information is used for indicating the electronic equipment to stop processing a data stream shot by the camera equipment by using the preset image algorithm;
and the electronic equipment adjusts the frequency of a processor of the electronic equipment from the first frequency to a second frequency according to the third event information, wherein the second frequency is smaller than the first frequency.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
the electronic equipment receives a third operation of closing the camera equipment by a user;
responding to the third operation, the event viewer obtains fourth event information sent by the camera service, wherein the fourth event information is used for indicating the electronic equipment to close the camera equipment, and the electronic equipment closes the camera equipment;
and the electronic equipment adjusts the frequency of a processor of the electronic equipment from the first frequency to a third frequency according to the fourth event information, wherein the third frequency is smaller than the first frequency.
4. A method according to any of claims 1-3, characterized in that the first event information comprises a first preset identification for instructing the electronic device to turn on a camera device;
the second event information comprises a second preset identifier, and the second preset identifier is used for indicating the electronic equipment to process a data stream shot by the camera equipment by using the preset image algorithm;
the electronic device adjusts the frequency of a processor of the electronic device to a first frequency according to the first event information and the second event information, and the method comprises the following steps:
and the electronic equipment adjusts the frequency of a processor of the electronic equipment to the first frequency according to the first preset identifier and the second preset identifier.
5. The method according to any one of claims 1-4, wherein the electronic device stores a correspondence between a scenario and a power consumption adjustment policy, and wherein the electronic device adjusts a frequency of a processor of the electronic device to a first frequency according to the first event information and the second event information, including:
the electronic equipment determines a first scene according to the first event information and the second event information;
The electronic equipment determines a first power consumption adjustment strategy corresponding to a first scene according to the first scene and the corresponding relation;
and the electronic equipment adjusts the frequency of a processor of the electronic equipment to the first frequency according to the first power consumption adjustment strategy.
6. The method of any of claims 1-5, wherein before the event viewer obtains the first event information sent by the camera service, the method further comprises:
the electronic equipment receives a fourth operation of starting the camera equipment by a user;
in response to the fourth operation, the electronic device starts the camera device, and the electronic device sets the frequency of the processor of the electronic device to a fourth frequency according to a default power consumption strategy;
and the electronic equipment acquires the data stream shot by the camera equipment.
7. An electronic device comprising a processor, a memory for storing instructions executable by the processor; the processor is configured to, when executing the instructions, cause the electronic device to implement the method of any one of claims 1 to 6.
8. A computer readable storage medium having stored thereon computer program instructions; it is characterized in that the method comprises the steps of,
the computer program instructions, when executed by an electronic device, cause the electronic device to implement the method of any one of claims 1 to 6.
CN202210380841.4A 2022-04-12 2022-04-12 Power consumption control method and electronic equipment Active CN115543061B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210380841.4A CN115543061B (en) 2022-04-12 2022-04-12 Power consumption control method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210380841.4A CN115543061B (en) 2022-04-12 2022-04-12 Power consumption control method and electronic equipment

Publications (2)

Publication Number Publication Date
CN115543061A CN115543061A (en) 2022-12-30
CN115543061B true CN115543061B (en) 2023-11-07

Family

ID=84723963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210380841.4A Active CN115543061B (en) 2022-04-12 2022-04-12 Power consumption control method and electronic equipment

Country Status (1)

Country Link
CN (1) CN115543061B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117119295B (en) * 2023-10-24 2024-04-12 荣耀终端有限公司 Camera control method and electronic device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104423533A (en) * 2013-09-09 2015-03-18 联想(北京)有限公司 Processor frequency control method and electronic equipment
CN108259738A (en) * 2017-11-20 2018-07-06 优视科技有限公司 Camera control method, equipment and electronic equipment
CN109005578A (en) * 2018-08-14 2018-12-14 广东小天才科技有限公司 A kind of method and wearable device for reducing video calling power consumption
CN109151966A (en) * 2018-10-15 2019-01-04 Oppo广东移动通信有限公司 terminal control method, device, terminal device and storage medium
CN112486390A (en) * 2020-11-30 2021-03-12 维沃移动通信有限公司 Display control method and device and electronic equipment
CN113641488A (en) * 2021-07-07 2021-11-12 荣耀终端有限公司 Method and device for optimizing resources based on user use scene
CN113778663A (en) * 2021-07-28 2021-12-10 荣耀终端有限公司 Scheduling method of multi-core processor and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111543049B (en) * 2018-07-16 2021-11-05 荣耀终端有限公司 Photographing method and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104423533A (en) * 2013-09-09 2015-03-18 联想(北京)有限公司 Processor frequency control method and electronic equipment
CN108259738A (en) * 2017-11-20 2018-07-06 优视科技有限公司 Camera control method, equipment and electronic equipment
CN109005578A (en) * 2018-08-14 2018-12-14 广东小天才科技有限公司 A kind of method and wearable device for reducing video calling power consumption
CN109151966A (en) * 2018-10-15 2019-01-04 Oppo广东移动通信有限公司 terminal control method, device, terminal device and storage medium
CN112486390A (en) * 2020-11-30 2021-03-12 维沃移动通信有限公司 Display control method and device and electronic equipment
CN113641488A (en) * 2021-07-07 2021-11-12 荣耀终端有限公司 Method and device for optimizing resources based on user use scene
CN113778663A (en) * 2021-07-28 2021-12-10 荣耀终端有限公司 Scheduling method of multi-core processor and electronic equipment

Also Published As

Publication number Publication date
CN115543061A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
CN110381276B (en) Video shooting method and electronic equipment
CN113727016A (en) Shooting method and electronic equipment
WO2021057277A1 (en) Photographing method in dark light and electronic device
CN113810601B (en) Terminal image processing method and device and terminal equipment
WO2022100610A1 (en) Screen projection method and apparatus, and electronic device and computer-readable storage medium
EP3893495A1 (en) Method for selecting images based on continuous shooting and electronic device
CN114422340B (en) Log reporting method, electronic equipment and storage medium
WO2021052170A1 (en) Motor vibration control method and electronic device
CN115543061B (en) Power consumption control method and electronic equipment
CN113343193A (en) Identity verification method and device and electronic equipment
CN114205336A (en) Cross-device audio playing method, mobile terminal, electronic device and storage medium
EP4266208A1 (en) Video switching method and apparatus, storage medium, and device
CN113535284A (en) Full-screen display method and device and electronic equipment
CN112639675A (en) Method for dynamically modulating frequency of internal memory and electronic equipment
CN113497851B (en) Control display method and electronic equipment
CN111800581B (en) Image generation method, image generation device, storage medium, and electronic apparatus
US20230350631A1 (en) Projection display method and electronic device
CN113436576A (en) OLED display screen dimming method and device applied to two-dimensional code scanning
CN115412678B (en) Exposure processing method and device and electronic equipment
CN111935705A (en) Data service management method and device, computer readable medium and terminal equipment
CN111885768B (en) Method, electronic device and system for adjusting light source
CN111294905B (en) Image processing method, image processing device, storage medium and electronic apparatus
WO2024041006A1 (en) Method for controlling frame rate of camera, and electronic device
CN114520870B (en) Display method and terminal
CN116717486B (en) Method and device for adjusting rotation speed of fan, electronic equipment and readable storage medium

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
GR01 Patent grant
GR01 Patent grant