CN111352604B - Screen brightness adjusting method and device and computer readable storage medium - Google Patents

Screen brightness adjusting method and device and computer readable storage medium Download PDF

Info

Publication number
CN111352604B
CN111352604B CN202010095100.2A CN202010095100A CN111352604B CN 111352604 B CN111352604 B CN 111352604B CN 202010095100 A CN202010095100 A CN 202010095100A CN 111352604 B CN111352604 B CN 111352604B
Authority
CN
China
Prior art keywords
brightness
page
adjusting
screen
electronic equipment
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
CN202010095100.2A
Other languages
Chinese (zh)
Other versions
CN111352604A (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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202010095100.2A priority Critical patent/CN111352604B/en
Publication of CN111352604A publication Critical patent/CN111352604A/en
Application granted granted Critical
Publication of CN111352604B publication Critical patent/CN111352604B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/147Digital output to display device ; Cooperation and interconnection of the display device with other functional units using display panels
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/017Gesture based interaction, e.g. based on a set of recognized hand gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Abstract

In the screen brightness adjusting method, a business page needing brightness adjustment registers brightness adjusting service to the same brightness adjusting program in electronic equipment, monitors each state of a life cycle of the business page aiming at a monitoring notice registered in the business page, and adjusts the screen brightness of the electronic equipment through the brightness adjusting program based on the monitored life cycle state. By the scheme, unified management of screen brightness adjustment is realized.

Description

Screen brightness adjusting method and device and computer readable storage medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method and an apparatus for adjusting screen brightness, and a computer-readable storage medium.
Background
With the continuous development of scientific technology, electronic technology has also been developed rapidly, and the business functions that can be realized by electronic devices are also more and more abundant. In the prior art, part of services implemented by electronic devices need to adjust screen brightness of the electronic devices, for example, when a user uses the electronic device to enter a service page containing a two-dimensional code, the screen brightness needs to be increased, and when the user leaves the service page, the screen brightness needs to be restored, and currently, each service page is self-processing to adjust the screen brightness.
Disclosure of Invention
The embodiment of the specification provides a screen brightness adjusting method, a screen brightness adjusting device and a computer readable storage medium.
In a first aspect, an embodiment of the present specification provides a screen brightness adjusting method, which is applied to an electronic device, and includes:
when any business page of the electronic equipment is triggered, registering brightness adjustment service aiming at the business page to the same brightness adjustment program in the electronic equipment, wherein the business page is a page needing to adjust screen brightness;
registering a monitoring notice aiming at the life cycle state of the service page;
and adjusting the screen brightness of the electronic equipment through the brightness adjusting program based on the monitored life cycle state of the service page.
In a second aspect, an embodiment of the present specification provides a screen brightness adjusting apparatus, which is applied to an electronic device, and includes:
the registration module is used for registering brightness adjustment service aiming at a business page to the same brightness adjustment program in the electronic equipment when any business page of the electronic equipment is triggered, wherein the business page is a page needing to adjust screen brightness;
the monitoring module is used for registering a monitoring notice aiming at the life cycle state of the service page;
and the processing module is used for adjusting the screen brightness of the electronic equipment through the brightness adjusting program based on the monitored life cycle state of the service page.
In a third aspect, an embodiment of the present specification provides a screen brightness adjusting apparatus, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor performs the steps of any one of the methods described above.
In a fourth aspect, the present specification provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of any of the above methods.
The embodiment of the specification has the following beneficial effects:
in the screen brightness adjustment method provided in the embodiment of the present specification, a business page included in any application installed on an electronic device may register a brightness adjustment service, when it is detected that the business page is triggered, the brightness adjustment service is registered with the same brightness adjustment program in the electronic device, a monitoring notification is registered for a life cycle state of the business page, and screen brightness of the electronic device is adjusted by the brightness adjustment program based on the monitored life cycle state of the business page. In the above scheme, the brightness adjustment service can be registered for any business page, and the uniform management of brightness adjustment of each business page is realized through the same brightness adjustment program.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the specification. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of a method for adjusting screen brightness according to a first aspect of an embodiment of the present disclosure;
fig. 2 is an interaction diagram of a screen brightness adjustment method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a screen brightness adjusting apparatus provided in a second aspect of an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a screen brightness adjusting device provided in a third aspect of an embodiment of the present disclosure.
Detailed Description
In order to better understand the technical solutions of the embodiments of the present specification, the technical solutions of the embodiments of the present specification are described in detail below with reference to the accompanying drawings and specific embodiments, and it should be understood that the specific features of the embodiments and examples of the present specification are detailed descriptions of the technical solutions of the embodiments of the present specification, and are not limitations of the technical solutions of the embodiments and examples of the present specification, and the technical features of the embodiments and examples of the present specification may be combined with each other without conflict.
In a first aspect, an embodiment of the present specification provides a screen brightness adjustment method, which is applied to electronic devices, such as a mobile phone and a tablet computer. In an electronic device, a plurality of applications, such as a payment bank, a WeChat, etc., are usually installed, each application may provide one or more services, and some services may require adjustment of screen brightness of the electronic device when in use, for example, the payment bank can provide a card package service and a payment service. In a specific implementation process, a user opens a card package provided by a payment bank, selects one of the membership cards, and appears a two-dimensional code page containing the membership card of the user. In the prior art, each service page needs to manage and adjust the brightness by itself, and because the brightness adjustment and management among different services have the same or similar processing logic, such as entering a service page to brighten a screen, leaving the service page to dim the screen, and the like, redundant brightness adjustment logic exists among the services.
In addition, in the prior art, the brightness of the screen can be adjusted only by the brightness adjusting interface provided by the system, and when a plurality of service pages need to adjust the brightness of the screen, the brightness adjusting interface resource of the system can be seized. For example, when the user uses the card package service of the pay bank, click the membership card therein, display the two-dimensional code page of the membership card, at this moment, the screen brightness needs to be adjusted, if the option for showing the pay code is also included on the display membership card two-dimensional code page, the user clicks the option, leave the current membership card two-dimensional code page, enter the pay code page, because the screen brightness needs to be recovered when leaving the membership card two-dimensional code page, the screen brightness needs to be adjusted when entering the pay code page, therefore, the condition of competing for adjusting the screen brightness when a plurality of continuous pages need to adjust the screen brightness can occur, thereby causing the brightness change to be uneven and influencing the user experience to be bad.
In the solution provided in the embodiment of the present specification, all the service pages that need brightness adjustment register brightness adjustment service to the same brightness adjustment program, so that the service pages that have registered the service can be managed in a unified manner, thereby avoiding contention for screen brightness adjustment among a plurality of service pages, and minimizing code redundancy related to brightness adjustment.
As shown in fig. 1, a flowchart of a brightness adjusting method provided in an embodiment of the present disclosure is provided, where the method includes the following steps:
step S11: when any business page of the electronic equipment is triggered, registering brightness adjustment service aiming at the business page to the same brightness adjustment program in the electronic equipment, wherein the business page is a page needing to adjust screen brightness;
step S12: registering a monitoring notice aiming at the life cycle state of the service page;
step S13: and adjusting the screen brightness of the electronic equipment through the brightness adjusting program based on the monitored life cycle state of the service page.
In the embodiment of the present specification, the service page is a page that needs to be adjusted in screen brightness, for example, a pay code page. The service page may be a page included in any application installed on the electronic device, for example, the service page may be a pay code page provided by a pay pal, a pay code page provided by WeChat, a membership card page of a shopping mall application, or the like. The number of service pages may be one or more.
In order to uniformly manage all the business pages which need to be subjected to brightness adjustment, the business pages are required to register brightness adjustment service with a brightness adjustment program in the electronic equipment. In a specific implementation process, a function for initiating a registration request may be written in a page initialization code of each service page, and when a service page performs an initialization operation, a brightness adjustment service registration request is initiated through the registration function. Of course, the brightness service registration request may be sent in other manners besides the write function, for example, when an operation of triggering service page display is detected, the brightness adjustment service registration request is sent, and the like, which is not limited herein.
In the embodiment of the present specification, the same brightness adjustment procedure of the electronic device may be implemented by a view control (viewcontroller) management center and a brightness service center. The view control management center can monitor the service page and initiate a brightness adjustment request, and the brightness service center is used for establishing a brightness adjustment task and adjusting the screen brightness according to the brightness adjustment request. Specifically, a brightness adjustment service registration request initiated by any business page may be sent to a view control management center in the electronic device, and after receiving the brightness adjustment service registration request, the view control management center registers a monitoring notification for a lifecycle state of the business page, so that brightness adjustment service can be performed in the current lifecycle of each business page. It should be noted that each service page is a viewcontroller instance object, a life cycle of a service page is a life cycle of the viewcontroller instance object, and states in the life cycle at least include the following states: the method comprises the following steps of initialization state (init), page loading state (View Did Load), page to be displayed state (View wild application), page displayed state (View Did application), page to be disappeared state (View wild Dispearer) and page disappeared state (View Did Dispearer). The view control management center obtains the current state of the service page through registering the monitoring notice.
According to different monitored states of the business page, the screen brightness of the electronic equipment can be correspondingly adjusted, for example, when the business page is monitored to be in a displayed state, the screen brightness is lightened, and when the business page is monitored to be in an about-to-disappear state, the screen brightness is darkened. In the embodiment of the present description, in order to make the user experience consistent, the same screen brightness adjustment mode, such as a progressive adjustment mode, may be adopted for each service page.
In the embodiment of the present specification, when the view control management center determines that the screen brightness needs to be adjusted according to the life cycle state of the service page, a brightness adjustment request may be sent to the brightness service center to request adjustment of the current screen brightness, and after receiving the request, the brightness service center creates a corresponding brightness adjustment task to adjust the screen brightness.
Therefore, according to the scheme provided by the embodiment of the specification, any business page needing brightness adjustment can register brightness adjustment service to the brightness adjustment program, so that the brightness adjustment service can uniformly manage the brightness adjustment of the registered page through the brightness adjustment program, code redundancy caused by brightness adjustment managed by each business respectively is reduced, the condition that brightness adjustment is struggled among multiple businesses is avoided, and user experience during brightness adjustment is improved.
Further, when the brightness of the screen is adjusted according to the life cycle state of the business page, the following modes can be included: when the monitored life cycle state of the business page is a page displayed state, the brightness of the screen of the electronic equipment is adjusted to be bright according to a first preset mode through the brightness adjusting program; and when the monitored life cycle state of the business page is a near-to-disappear state of the page, dimming the screen brightness of the electronic equipment according to a second preset mode through the brightness adjusting program.
In an embodiment of the present specification, the first preset mode and the second preset mode may be set according to actual needs, and in order to ensure that experiences of users are consistent, the first preset mode and the second preset mode may be a mode that is consistent in adjustment. For example, the first preset mode is a gradually brightening screen, the second preset mode is a gradually dimming screen, and the step lengths of the gradual adjustment of the first preset mode and the second preset mode are the same, or the durations of the gradual adjustment are the same. Of course, instead of the gradual adjustment, the adjustment may be a direct adjustment, such as a direct lighting of the screen or a direct dimming of the screen, which is not limited herein.
When the life cycle state of the business page is monitored to be the page display state, the business page is shown to the user, and at the moment, the brightness of the screen is adjusted to be bright in a first preset mode through the brightness adjusting program. When the life cycle state of the business page is monitored to be a state that the page is about to disappear, the business page is indicated to be about to disappear on the screen, a user cannot see the business page on the screen, and at the moment, the screen brightness is dimmed in a second preset mode through the brightness adjusting program.
In order to make the adjustment of the screen brightness more suitable for the use habit of the user, the method in the embodiment of the present specification further includes: acquiring the initial brightness of the service page; the brightness of the screen of the electronic device is adjusted according to a first preset mode through the brightness adjusting program, and the method includes the following steps: adjusting the screen brightness of the electronic equipment from the initial brightness to a target brightness according to the first preset mode, wherein the target brightness is higher than the initial brightness; the dimming of the screen brightness of the electronic equipment according to a second preset mode through the brightness adjusting program comprises the following steps: and adjusting the screen brightness of the electronic equipment from the target brightness to the initial brightness according to the second preset mode.
In this embodiment of the present specification, the initial brightness of the business page may be the screen brightness before entering the business page, or may be a default brightness. For example, when a user uses a pay bank to pay, the pay bank is opened first, at this time, a main page of the pay bank is displayed on a screen of the electronic device, and when the user clicks a pay code presentation option on the main page, the pay code page is opened. In addition, when the user uses the electronic device, the user has own use preference, the screen brightness according with own use habit can be set usually, and the brightness set by the user can be used as the initial brightness. Of course, the initial brightness may be other values, and is not limited herein.
After the initial brightness is determined, the screen brightness may be adjusted according to the initial brightness. Specifically, when the screen brightness needs to be adjusted, the screen brightness is adjusted from the initial brightness to the target brightness through the brightness adjusting program, wherein the target brightness is the brightness required by the service, and the target brightness may be the brightness customized by the user or the service, or may be default preset brightness in the brightness adjusting service; when the business page is closed, the screen brightness is dimmed from the target brightness to the initial brightness through the brightness adjusting program, so that the screen brightness is restored to the brightness which is used by the user.
Further, in the solution in this embodiment of the present specification, before the brightness of the screen of the electronic device is adjusted to be bright according to the first preset mode, the method further includes the following steps: detecting whether the window of the business page is a target window currently displayed on the screen of the electronic equipment; and if so, executing the step of adjusting the screen brightness of the electronic equipment according to a first preset mode through the brightness adjusting program.
Specifically, in this embodiment, dimming the screen brightness needs to satisfy two conditions simultaneously: and monitoring that the life cycle state of the business page is a displayed state, and taking the window of the business page as a target window. The target window is a main window (keywindow) currently displayed on the screen, when the two conditions are met, the view control management center initiates a brightness adjustment request to the brightness service center to request to light the screen, and after receiving the request, the brightness service center executes a brightness adjustment task to adjust the screen brightness from the initial brightness to the target brightness.
Since a user often involves a switching operation of a foreground and a background when using an electronic device, for example, a page a of an application 1 currently displayed by the electronic device is displayed, that is, the application 1 runs on the foreground of the electronic device, when the user needs to use the application 2, the application 1 can be switched to the background of the electronic device by pressing a home key of the electronic device or by sliding a preset gesture, and then the application 2 is opened, so that a page b of the application 2 is displayed on a screen, at this time, the application 2 runs on the foreground, and the page a of the application 1 is suspended. Similarly, when the user wants to return to the page a of the previous application 1, the user can press the home key again or switch the application 2 to the background by a preset sliding gesture, reselect the application 1, return the application 1 to the foreground, and display the page a on the screen again.
In the embodiment of the present specification, when performing foreground and background switching on a business page in which a brightness adjustment service is registered, the brightness of a screen may be adjusted in the following manner: if the business page is detected to be switched from the background to the foreground of the electronic equipment, the brightness of the screen of the electronic equipment is adjusted to be bright according to a first preset mode through the brightness adjusting program; and if the business page is detected to be switched from the foreground to the background of the electronic equipment, dimming the screen brightness of the electronic equipment according to a second preset mode through the brightness adjusting program.
In the embodiment of the description, if a service page is displayed on a screen of an electronic device, if it is detected that a user presses a home key or the user executes a preset sliding gesture, it indicates that the service page is switched from a foreground to a background; if the business page is currently in a suspended state, if the fact that the user presses the home key or executes a preset sliding gesture is detected, and the business page is selected, it is indicated that the business page is switched from the background to the foreground. The service page is switched to the background, which indicates that the service page is no longer displayed on the screen of the electronic device, and at this time, the brightness of the screen needs to be dimmed, and the dimming brightness can be dimmed by adopting the second preset mode. When the service page is switched to the foreground, the service page is indicated to be displayed on the screen of the electronic device again, and at this time, the brightness of the screen needs to be adjusted to be bright, and the brightness of the bright screen can be adjusted to be bright by adopting the first preset mode. By adopting the first preset mode and the second preset mode for adjustment, the brightness adjustment mode during switching of the foreground and the background can be ensured to be consistent with the brightness adjustment mode when the business page is displayed or is about to disappear, and the user experience is better.
In addition, the method in the embodiment of the present specification further includes: when the life cycle state of the business page is monitored to be a page disappeared state, determining whether the next page to be displayed needs to execute brightness adjustment service; if so, terminating the brightness adjusting service of the business page through the brightness adjusting program, and adjusting the screen brightness of the electronic equipment based on the monitored life cycle state of the next page.
When the monitored lifecycle state of the service page is a page disappeared state, it indicates that the service page disappeared, and the page disappeared may be caused by closing the service page, may be caused by entering a next page, or may be caused by hiding the service page. When the business page is displayed, if a new page needs to be displayed, the new page may be a page registered with the brightness adjustment service or a page not registered with the brightness adjustment service. For the pages which do not register the brightness adjusting service, the brightness of the screen is dimmed by the brightness adjusting program only after the business page disappears. For example, if the service page is a membership card two-dimensional code display page including a payment option, the payment option is clicked, and the payment code page is displayed, and if the payment code page is also a page in which the brightness adjustment service is registered, the next page of the service page also needs to execute the brightness adjustment service. Therefore, when the screen brightness needs to be adjusted for all the continuous pages, the next page may be displayed when the brightness adjustment for the previous page is not completed yet, and at this time, the brightness adjustment for the previous page may be terminated and the brightness adjustment for the next page may be started.
In a specific implementation process, when the next page of the business page needs to execute brightness adjustment service, when the lifecycle state of the next page is monitored to be the displayed state, the brightness adjustment of the business page is terminated, the current screen brightness is recorded, the recorded current screen brightness is taken as the starting brightness, and the screen brightness is adjusted to be the target brightness corresponding to the next page. For example, a service page is a page 1, a next page needing to execute brightness adjustment service is a page 2, the initial brightness of the service page is A1, when the life cycle state of the service page is that the page disappears, the screen brightness is gradually dimmed, when the screen brightness is adjusted to A2 and is not adjusted to the initial brightness A1, and when the life cycle state of the next page is monitored to be a displayed state, the dimming brightness operation corresponding to the page 1 is terminated, and the screen brightness of the electronic device is brightened by taking the A2 as an initial value. Therefore, the preemption of the screen brightness adjustment can be effectively prevented when a plurality of pages need to be subjected to the brightness adjustment, and the uniform processing of the screen brightness is realized.
In the embodiment of the present specification, when adjusting the screen brightness, the following manner may be adopted: creating a brightness adjusting task corresponding to the life cycle state of the service page through the brightness adjusting program; and adjusting the screen brightness based on the brightness adjusting task, and destroying the brightness adjusting task after the screen brightness adjustment is finished.
Specifically, the view control management center initiates a corresponding brightness adjustment request to the brightness service center according to the monitored life cycle state of the business page, for example, when the life cycle state of the business page is monitored to be a page already displayed state, the request for increasing the screen brightness is initiated, and when the life cycle state of the business page is monitored to be a page disappearing state, the request for decreasing the screen brightness is initiated. The brightness service center establishes a corresponding brightness adjusting task when receiving a brightness adjusting request, for example, the brightness service center establishes a task of adjusting the screen brightness when receiving a request of adjusting the screen brightness, and establishes a task of dimming the screen brightness when receiving a request of dimming the screen brightness. The brightness adjustment task may include a brightness adjustment mode (e.g., a gradual adjustment mode), a starting brightness of the brightness adjustment, and a final brightness. When the screen brightness is adjusted from the initial brightness to the final brightness according to the brightness adjusting task, the brightness adjustment is finished, and the brightness adjusting task is automatically destroyed at the moment.
Further, when the monitored life cycle state of the service page is page destruction, that is, when the viewcontroller instance object corresponding to the service page is destroyed, all related events of the service page are destroyed, and the monitoring of the life cycle state of the service page is cancelled.
To better explain the brightness adjusting method provided in the embodiments of the present specification, please refer to fig. 2, which is a schematic diagram of a brightness adjusting method provided in the embodiments of the present specification. In fig. 2, the screen brightness of the electronic device is adjusted through interaction of the service end, the view control management center (ViewController management center), and the brightness service center. The service end may be a service provided by any application installed in the electronic device.
Firstly, a service page of a service end executes initialization, and a registration request of a brightness adjustment service is initiated in the process of executing the initialization. The VieWController management center records initial brightness after receiving the registration request, and registers a monitoring notice aiming at the life cycle state of the service page so as to monitor the appearance and disappearance notices of the service page; the initial brightness may be the display brightness of the last page of the service page, or may be a preset default brightness. And further, determining whether the window of the service page is a keywindow, if so, initiating a brightness adjusting task, and if not, marking the service page as waiting for brightness adjustment. And for the business page of which the window is not keywindow, the ViewController management center receives the system notification, determines whether the business page appears, if so, initiates a brightness adjustment task, if not, further determines whether the business page needs to be destroyed, if so, namely, the business page is destroyed, the brightness adjustment is finished, and if not, namely, the business page is not destroyed, whether the brightness adjustment task needs to be initiated is detected again. It should be noted that, when it is detected that the service page is destroyed, if the brightness adjustment task needs to be executed, the brightness adjustment task is executed first, and then the destruction of the brightness adjustment task is performed. The brightness service center determines whether the received brightness adjustment task is to lighten a screen or not after receiving the initiated brightness adjustment task, if so, the task is started, the brightness is gradually lightened, if not, the brightness is gradually lightened, after the brightness adjustment task is completed, the brightness adjustment is finished, and the brightness adjustment service of the business page is cancelled, namely all relevant events of the business page are destroyed, such as the monitoring notice of the life cycle state of the business page is cancelled.
To sum up, the brightness adjustment method provided in the embodiments of the present specification performs brightness adjustment service registration through all pages that need to be brightness adjusted, thereby implementing unified management on screen brightness adjustment, avoiding a situation that brightness adjustment is contended for each other among multiple pages, ensuring optimal user experience of brightness adjustment, and closing up brightness adjustment in a unified manner, and reducing code redundancy to the lowest.
In a second aspect, based on the same inventive concept, an embodiment of the present disclosure provides a brightness adjustment apparatus applied to an electronic device, please refer to fig. 3, where the apparatus includes:
a registration module 31, configured to register, when any service page of the electronic device is triggered, a brightness adjustment service for the service page to a same brightness adjustment program in the electronic device, where the service page is a page whose screen brightness needs to be adjusted;
a monitoring module 32, configured to register a monitoring notification for a life cycle state of the service page;
and the processing module 33 is configured to adjust the screen brightness of the electronic device through the brightness adjustment program based on the monitored life cycle state of the service page.
In an alternative implementation, the processing module 33 is configured to:
when the monitored life cycle state of the business page is a page display state, the brightness of the screen of the electronic equipment is adjusted to be bright according to a first preset mode through the brightness adjusting program;
and when the monitored life cycle state of the business page is a page disappearing state, dimming the screen brightness of the electronic equipment according to a second preset mode through the brightness adjusting program.
In an alternative implementation, the apparatus further includes:
the acquisition module is used for acquiring the initial brightness of the service page;
the processing module 33 is configured to: adjusting the screen brightness of the electronic equipment from the initial brightness to a target brightness according to the first preset mode, wherein the target brightness is higher than the initial brightness;
the processing module 33 is configured to: and adjusting the screen brightness of the electronic equipment from the target brightness to the initial brightness according to the second preset mode.
In an alternative implementation, the apparatus further includes:
the window detection module is used for detecting whether the window of the business page is a target window currently displayed on the screen of the electronic equipment;
and the execution module is used for executing the step of brightening the screen brightness of the electronic equipment according to a first preset mode through the brightness adjusting program when the window of the business page is the target window.
In an alternative implementation, the apparatus further includes:
the first adjusting module is used for adjusting the screen brightness of the electronic equipment according to a first preset mode through the brightness adjusting program if the business page is detected to be switched from the background to the foreground of the electronic equipment;
and the second adjusting module is used for dimming the screen brightness of the electronic equipment according to a second preset mode through the brightness adjusting program if the business page is detected to be switched from the foreground to the background of the electronic equipment.
In an alternative implementation, the apparatus further includes:
the determining module is used for determining whether the next page to be displayed needs to execute brightness adjustment service when the life cycle state of the business page is monitored to be a page disappearance state;
and the third adjusting module is used for terminating the brightness adjusting service of the business page through the brightness adjusting program when the next page needs to execute the brightness adjusting service, and adjusting the screen brightness of the electronic equipment based on the monitored life cycle state of the next page.
In an alternative implementation, the processing module 33 is configured to:
creating a brightness adjusting task corresponding to the life cycle state of the service page through the brightness adjusting program;
and adjusting the screen brightness based on the brightness adjusting task, and destroying the brightness adjusting task after the screen brightness adjustment is finished.
With regard to the above-mentioned apparatus, the specific functions of the respective modules have been described in detail in the embodiments of the brightness adjustment method provided in the embodiments of the present specification, and will not be elaborated herein.
In a third aspect, based on the same inventive concept as the brightness adjusting method in the foregoing embodiment, an embodiment of this specification further provides a brightness adjusting apparatus, as shown in fig. 4, including a memory 404, a processor 402, and a computer program stored on the memory 404 and executable on the processor 402, where the processor 402 executes the program to implement the steps of any one of the brightness adjusting methods described above.
Where in fig. 4 a bus architecture (represented by bus 400) is shown, bus 400 may include any number of interconnected buses and bridges, and bus 400 links together various circuits including one or more processors, represented by processor 402, and memory, represented by memory 404. The bus 400 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 406 provides an interface between the bus 400 and the receiver 401 and transmitter 403. The receiver 401 and the transmitter 403 may be the same element, i.e., a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 402 is responsible for managing the bus 400 and general processing, and the memory 404 may be used for storing data used by the processor 402 in performing operations.
In a fourth aspect, based on the inventive concept based on the brightness adjustment method in the foregoing embodiments, the present specification further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of any one of the foregoing brightness adjustment method based methods.
The description has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present specification have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all changes and modifications that fall within the scope of the specification.
It will be apparent to those skilled in the art that various changes and modifications can be made in the present specification without departing from the spirit and scope of the specification. Thus, if such modifications and variations of the present specification fall within the scope of the claims of the present specification and their equivalents, the specification is intended to include such modifications and variations.

Claims (16)

1. A screen brightness adjusting method is applied to electronic equipment and comprises the following steps:
when any business page of the electronic equipment is triggered, registering brightness adjustment service aiming at the business page to the same brightness adjustment program in the electronic equipment, wherein the business page is a page needing to adjust screen brightness;
registering a monitoring notice aiming at the life cycle state of the service page;
adjusting the screen brightness of the electronic equipment through the brightness adjusting program based on the monitored life cycle state of the business page;
wherein the lifecycle states include the following states: the method comprises the following steps of initialization state, page loading state, page showing-soon state, page showing state, page disappearing state and page disappearing state.
2. The method of claim 1, wherein adjusting, by the brightness adjustment program, the screen brightness of the electronic device based on the monitored lifecycle state of the business page comprises:
when the monitored life cycle state of the business page is a page display state, the brightness of the screen of the electronic equipment is adjusted to be bright according to a first preset mode through the brightness adjusting program;
and when the monitored life cycle state of the business page is a page disappearing state, dimming the screen brightness of the electronic equipment according to a second preset mode through the brightness adjusting program.
3. The method of claim 2, further comprising: acquiring the initial brightness of the service page;
the brightness of the screen of the electronic device is adjusted according to a first preset mode through the brightness adjusting program, and the method includes the following steps: adjusting the screen brightness of the electronic equipment from the initial brightness to a target brightness according to the first preset mode, wherein the target brightness is higher than the initial brightness;
the dimming of the screen brightness of the electronic equipment according to a second preset mode through the brightness adjusting program comprises the following steps: and adjusting the screen brightness of the electronic equipment from the target brightness to the initial brightness according to the second preset mode.
4. The method of claim 2, before the brightness of the screen of the electronic device is adjusted by the brightness adjustment program in a first preset manner, the method further comprising:
detecting whether the window of the business page is a target window currently displayed on the screen of the electronic equipment;
and if so, executing the step of adjusting the screen brightness of the electronic equipment according to a first preset mode through the brightness adjusting program.
5. The method of claim 1, after said registering a brightness adjustment service for the business page with the same brightness adjustment program in the electronic device, further comprising:
if the business page is detected to be switched from the background to the foreground of the electronic equipment, the brightness of the screen of the electronic equipment is adjusted to be bright according to a first preset mode through the brightness adjusting program;
and if the business page is detected to be switched from the foreground to the background of the electronic equipment, dimming the screen brightness of the electronic equipment according to a second preset mode through the brightness adjusting program.
6. The method of claim 1, further comprising:
when the life cycle state of the business page is monitored to be a page disappeared state, determining whether the next page to be displayed needs to execute brightness adjustment service;
if so, terminating the brightness adjusting service of the business page through the brightness adjusting program, and adjusting the screen brightness of the electronic equipment based on the monitored life cycle state of the next page.
7. The method of claim 1, wherein adjusting, by the brightness adjustment program, the screen brightness of the electronic device based on the monitored lifecycle state of the business page comprises:
creating a brightness adjusting task corresponding to the life cycle state of the service page through the brightness adjusting program;
and adjusting the screen brightness based on the brightness adjusting task, and destroying the brightness adjusting task after the screen brightness adjustment is finished.
8. A screen brightness adjusting device is applied to electronic equipment, and the device comprises:
the registration module is used for registering brightness adjustment service aiming at the business page to the same brightness adjustment program in the electronic equipment when any business page of the electronic equipment is triggered, wherein the business page is a page needing to adjust screen brightness;
the monitoring module is used for registering a monitoring notice aiming at the life cycle state of the service page;
the processing module is used for adjusting the screen brightness of the electronic equipment through the brightness adjusting program based on the monitored life cycle state of the business page;
wherein the lifecycle states include the following states: an initialization state, a page loading state, a page upcoming showing state, a page already shown state, a page upcoming disappearing state, and a page already disappearing state.
9. The apparatus of claim 8, the processing module to:
when the monitored life cycle state of the business page is a page display state, the brightness of the screen of the electronic equipment is adjusted to be bright according to a first preset mode through the brightness adjusting program;
and when the monitored life cycle state of the business page is a near-to-disappear state of the page, dimming the screen brightness of the electronic equipment according to a second preset mode through the brightness adjusting program.
10. The apparatus of claim 9, the apparatus further comprising:
the acquisition module is used for acquiring the initial brightness of the business page;
the processing module is used for: adjusting the screen brightness of the electronic equipment from the initial brightness to a target brightness according to the first preset mode, wherein the target brightness is higher than the initial brightness;
the processing module is used for: and adjusting the screen brightness of the electronic equipment from the target brightness to the initial brightness according to the second preset mode.
11. The apparatus of claim 9, the apparatus further comprising:
the window detection module is used for detecting whether the window of the business page is a target window currently displayed on the screen of the electronic equipment;
and the execution module is used for executing the step of brightening the screen brightness of the electronic equipment according to a first preset mode through the brightness adjusting program when the window of the business page is the target window.
12. The apparatus of claim 8, the apparatus further comprising:
the first adjusting module is used for adjusting the screen brightness of the electronic equipment according to a first preset mode through the brightness adjusting program if the business page is detected to be switched from the background to the foreground of the electronic equipment;
and the second adjusting module is used for dimming the screen brightness of the electronic equipment according to a second preset mode through the brightness adjusting program if the business page is detected to be switched from the foreground to the background of the electronic equipment.
13. The apparatus of claim 8, the apparatus further comprising:
the determining module is used for determining whether the next page to be displayed needs to execute brightness adjustment service when the life cycle state of the business page is monitored to be a page disappeared state;
and the third adjusting module is used for terminating the brightness adjusting service of the business page through the brightness adjusting program when the next page needs to execute the brightness adjusting service, and adjusting the screen brightness of the electronic equipment based on the monitored life cycle state of the next page.
14. The apparatus of claim 8, the processing module to:
creating a brightness adjusting task corresponding to the life cycle state of the service page through the brightness adjusting program;
and adjusting the screen brightness based on the brightness adjusting task, and destroying the brightness adjusting task after the screen brightness adjustment is finished.
15. A screen brightness adjustment device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any one of claims 1 to 7 when executing the program.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202010095100.2A 2020-02-13 2020-02-13 Screen brightness adjusting method and device and computer readable storage medium Active CN111352604B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010095100.2A CN111352604B (en) 2020-02-13 2020-02-13 Screen brightness adjusting method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010095100.2A CN111352604B (en) 2020-02-13 2020-02-13 Screen brightness adjusting method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111352604A CN111352604A (en) 2020-06-30
CN111352604B true CN111352604B (en) 2022-11-15

Family

ID=71195733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010095100.2A Active CN111352604B (en) 2020-02-13 2020-02-13 Screen brightness adjusting method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111352604B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017032013A1 (en) * 2015-08-27 2017-03-02 广东欧珀移动通信有限公司 Screen control method and user terminal
CN110211549A (en) * 2019-04-25 2019-09-06 深圳市泰衡诺科技有限公司 A kind of screen brightness regulation method, device, terminal and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101906415B1 (en) * 2012-07-11 2018-10-10 엘지전자 주식회사 Mobile terminal and control method for mobile terminal
US20160004345A1 (en) * 2014-07-03 2016-01-07 Kobo Inc. Varying a touchscreen display attribute in response to user input
CN105575360A (en) * 2014-10-11 2016-05-11 阿里巴巴集团控股有限公司 Screen brightness adjusting method, screen brightness adjusting device and intelligent electronic equipment
CN105657569A (en) * 2015-11-25 2016-06-08 乐视网信息技术(北京)股份有限公司 Non-dazzling video application implementation method and system
CN106855934A (en) * 2015-12-09 2017-06-16 阿里巴巴集团控股有限公司 The display methods and device of the barcode scanning page
CN106453892B (en) * 2016-10-11 2019-08-02 武汉斗鱼网络科技有限公司 The Android screen adjusted based on luminance dynamic is always on and energy-saving control method and system
CN106681638B (en) * 2016-12-16 2019-07-23 Oppo广东移动通信有限公司 A kind of touch screen control method, device and mobile terminal
CN108040360B (en) * 2017-12-05 2020-12-11 北京小米移动软件有限公司 Method and device for controlling screen display
CN110880303A (en) * 2019-12-09 2020-03-13 Oppo广东移动通信有限公司 Backlight brightness adjusting method and system, storage medium and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017032013A1 (en) * 2015-08-27 2017-03-02 广东欧珀移动通信有限公司 Screen control method and user terminal
CN110211549A (en) * 2019-04-25 2019-09-06 深圳市泰衡诺科技有限公司 A kind of screen brightness regulation method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN111352604A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
CN109857551B (en) Service resource scheduling method and device based on cloud computing and electronic equipment
US10203739B2 (en) Electronic device for controlling power and method therefor
CN109716736B (en) Application data sharing and decision service platform
CN105744008B (en) Smart home platform, method for updating system and device applied to the platform
EP3516850B1 (en) Systems and methods for sharing application data between isolated applications executing on one or more application platforms
CN103050108A (en) Screen backlight dynamic adjustment method and user terminal
CN103218307B (en) Internal storage management system and EMS memory management process
US20150261567A1 (en) Task migration method and apparatus
US20220058772A1 (en) Image Processing Method and Device
CN111309216B (en) List page display method and device, computer equipment and storage medium
CN112463535A (en) Multi-cluster exception handling method and device
CN116107922A (en) Application management method and electronic device
CN106603125B (en) Method and device for data interaction with Bluetooth equipment
CN111078348A (en) Interface management method, device, equipment and storage medium
CN111352604B (en) Screen brightness adjusting method and device and computer readable storage medium
CN111770008B (en) Control method, control device, computing equipment and medium
CN106940658B (en) Task processing method and device based on thread pool
CN110751560B (en) Transaction processing method and device, electronic equipment and readable storage medium
CN112328197A (en) Multi-screen display method and device and storage medium
CN112579247A (en) Method and device for determining task state
CN113900741B (en) Service processing method and device based on plug-in, computer equipment and medium
CN111768572B (en) Display control method and device for cash register equipment, medium and electronic equipment
CN112416584B (en) Process communication method and device, storage medium and mobile terminal
WO2024051247A1 (en) Application sharing method and system, electronic device, and storage medium
CN110365734B (en) Request processing method and device when server-side interface is abnormal

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