Device control method, device and storage medium
Patent Information
- Application Number
- CN202380055867.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-11-18
- Filing Date
- 2023-08-15
- Publication Date
- 2025-03-11
AI Technical Summary
Looking at electronic device screens for long periods of time can cause eye fatigue and potential vision damage, especially in low-light environments where users have difficulty quickly accessing designated applications and adjusting lighting to reduce screen reflections.
Provide a device control method and device that automatically displays the interface of a specified application and adjusts the lighting mode by detecting the positional relationship between the electronic device and the lighting device and the ambient light brightness to ensure balanced light, including detecting whether the electronic device is in an unlocked state. Access lighting enclosures and automatically turn on lighting in low-light environments to reduce screen reflections.
Effective eye protection, improve screen content browsing experience, reduce screen reflection, ensure light balance, and improve users' browsing efficiency in low-light environments.
Smart Images

Figure CN119605158A_ABST
Abstract
Description
Device control method, device and storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on November 18, 2022, with application number 202211451120.4 and application name “Device Control Method, Device and Storage Medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of electronic technology, and in particular to a device control method, device, and storage medium. Background Art
[0003] With the advancement of electronic technology, electronic devices such as mobile phones, tablets, and laptops have become an integral part of people's daily lives. Currently, users can browse content using electronic devices. For example, with the widespread adoption of online education, students can use electronic devices to take online courses, browse course content, and learn relevant knowledge. The frequency and duration of electronic device use are increasing. However, prolonged screen time can cause eye fatigue and discomfort, and over time, this can affect vision.
[0004] Summary of the Invention
[0005] This application provides a device control method, device, and storage medium that can effectively protect eyesight and improve the viewing experience of screen content. The technical solution is as follows:
[0006] In a first aspect, a device control method is provided. In this method, in response to an unlocked electronic device entering a lighting device enclosure from outside, or in response to an electronic device within the lighting device enclosure changing from a locked screen state to an unlocked state, the electronic device displays the application interface of a designated application and obtains the current state of the lighting device. When the lighting device is turned on and in a first lighting mode, the electronic device controls the lighting device to switch from the first lighting mode to a second lighting mode that matches the designated application.
[0007] The designated application can be used for content browsing. For example, the designated application can be an application for browsing text content or video content. For example, the designated application can be an application for learning. Of course, the designated application can also be other applications capable of content browsing, and this application does not limit this to a specific application.
[0008] The first lighting mode is different from the second lighting mode. In some embodiments, the difference between the first lighting mode and the second lighting mode is reflected in a different lighting brightness distribution between the first lighting mode and the second lighting mode, that is, the brightness distribution of the lighting area of the lighting device in the first lighting mode is different from the brightness distribution of the lighting area of the lighting device in the second lighting mode.
[0009] As an example, the first lighting mode is suitable for viewing diffusely reflective objects such as books. In this case, optionally, in the first lighting mode, the brightness of the lighting area of the lighting device is uniform, that is, the brightness of the lighting area of the lighting device is evenly distributed.
[0010] As an example, the second lighting mode is a lighting mode suitable for viewing items that will produce mirror reflections, such as the screen of a viewing device. In this application, the second lighting mode is a lighting mode suitable for browsing the screen content of an electronic device. The second lighting mode matches the specified application, which means that the second lighting mode is a lighting mode suitable for use when browsing the content in the specified application in the electronic device. In this case, optionally, in the second lighting mode, the brightness of the central position of the lighting area of the lighting device is lower than the brightness of other positions. In this way, the second lighting mode lowers the central brightness to supplement the surrounding light, thereby helping to reduce the screen reflection of the electronic device and ensure balanced light to protect the eyes. Of course, in the second lighting mode, the lighting area of the lighting device can also be other brightness distribution forms, as long as the second lighting mode is suitable for browsing the screen content of the electronic device.
[0011] The "fence" described in this application is an area fence, a virtual boundary enclosed by a virtual fence that defines a specific area. The "fence" described in this application refers to the fence of a lighting device. The fence of a lighting device is used to define the area surrounding the lighting device. For example, the area defined by the fence of the lighting device can be a circular area centered on the lighting device and with a preset distance as the radius. Alternatively, the area defined by the fence of the lighting device can be a rectangular area centered on the lighting device and with a certain length and width. Of course, the area defined by the fence of the lighting device can also be an area of other shapes, as long as it is the area surrounding the lighting device.
[0012] If an electronic device in an unlocked state enters the fence of a lighting device from outside, it means that the electronic device gradually approaches the lighting device until it is near the lighting device while in the unlocked state. In this case, the user is likely to use a specified application in the electronic device to browse content under the illumination of the lighting device, so the electronic device can automatically display the application interface of the specified application.
[0013] If an electronic device within the fence of a lighting device changes from a locked state to an unlocked state, it means that the screen of the electronic device was unlocked when the electronic device was near the lighting device. In this case, the user is likely to use a specified application in the electronic device to browse content under the illumination of the lighting device, so the electronic device can automatically display the application interface of the specified application.
[0014] In this application, when an electronic device is near a lighting device, it can automatically display the interface of a designated application within the electronic device, preventing the user from being distracted by other applications. Furthermore, when the designated application is running, the lighting device can be automatically controlled to a second lighting mode when it is turned on, reducing glare from the electronic device's screen and ensuring balanced lighting, thereby effectively protecting the eyes and improving the viewing experience of screen content.
[0015] Optionally, the operation of the electronic device displaying the application interface of the specified application may be: if the specified application is not started, the electronic device starts the specified application to display the application interface of the specified application.
[0016] In this case, the electronic device does not launch the designated application before it is near the lighting device. For example, a user moves the electronic device closer to the lighting device without launching the designated application until the electronic device is near the lighting device. Once the electronic device is near the lighting device, the designated application automatically launches and displays its interface. At this point, the designated application is running, allowing the user to quickly browse content using the designated application, improving the user experience.
[0017] Optionally, the operation of the electronic device displaying the application interface of the specified application may be: if the specified application has been started and is in the background running state, the electronic device switches the specified application to the foreground running state to display the application interface of the specified application.
[0018] In this case, the electronic device has already launched the designated application before being placed near the lighting device. For example, after opening the designated application on the electronic device, the user switches the designated application to background operation. The user then moves the electronic device closer to the lighting device until the electronic device is near the lighting device. While the designated application is running in the background while the electronic device is near the lighting device, the electronic device can automatically switch the designated application to the foreground to display the designated application's interface, allowing the user to quickly browse content using the designated application, thereby improving the user experience.
[0019] Furthermore, after the electronic device obtains the current status of the lighting device, it can also perform the following operations: when the lighting device is turned off, the electronic device detects the brightness of the ambient light; if the detected brightness of the ambient light is less than or equal to the preset brightness, the electronic device controls the lighting device to turn on and controls the lighting device to be in the second lighting mode.
[0020] In this application, when the lighting device is turned off, the electronic device can detect the ambient light brightness to determine whether there is a need to use the lighting device for illumination. If the ambient light brightness is less than or equal to the preset brightness, it means that the ambient light brightness is low, which means that the lighting device is currently needed for illumination. The electronic device can then automatically control the lighting device to turn on and control the lighting device to be in the second lighting mode. In this way, while supplementing the required light, the screen reflection of the electronic device can be reduced, making the light balanced, thereby effectively protecting the eyes and improving the screen content browsing experience.
[0021] Optionally, the electronic device detects the ambient light brightness while running a specified application; if the detected ambient light brightness is less than or equal to the preset brightness, the electronic device displays a reminder message when it determines that the electronic device is not within the fence of the lighting device, and the reminder message is used to remind the user to move to the lighting device.
[0022] In this application, when a user is browsing content using a designated application in an electronic device, the user can be promptly reminded to move to a lighting device for browsing when the environment becomes dark, in order to protect eyesight and improve the browsing experience.
[0023] Optionally, the electronic device receives a broadcast message that carries a lighting device identifier. In this case, if the electronic device changes from a locked state to an unlocked state, the electronic device detects whether the electronic device is within a fence of lighting devices identified by the lighting device identifier in the most recently received broadcast message. If the electronic device is within the fence of lighting devices identified by the lighting device identifier in the most recently received broadcast message, the electronic device displays an application interface of a specified application and obtains the current state of the lighting device.
[0024] In this application, if the electronic device changes from a locked state to an unlocked state, it means that the user is about to start using the electronic device. Therefore, in this case, the electronic device can determine whether it is within the fence of the lighting device based on the latest received broadcast message, so as to execute the corresponding processing flow accordingly, such as displaying the application interface of the specified application, and controlling the lighting device and other processes.
[0025] Optionally, if the electronic device changes from a mobile state to a stationary state, the electronic device detects whether the electronic device is located within the fence of the lighting device identified by the lighting device identifier in the most recently received broadcast message.
[0026] In the present application, when the electronic device is in a mobile state, the distance between the electronic device and the lighting device is constantly changing, and the user is unlikely to be using the electronic device at this time. Therefore, in this case, the electronic device may not detect whether the electronic device is located within the fence of the lighting device, thereby saving processing resources. When the electronic device changes from a mobile state to a stationary state, the distance between the electronic device and the lighting device is likely to have stabilized, and the user may also start using the electronic device at this time. Therefore, in this case, the electronic device can determine whether the electronic device is located within the fence of the lighting device in order to perform subsequent control operations accordingly. While the electronic device is in a stationary state, the distance between the electronic device and the lighting device is usually fixed. Therefore, in this case, the electronic device no longer needs to detect whether the electronic device is located within the fence of the lighting device, thereby saving processing resources.
[0027] In a second aspect, a device control apparatus is provided, which has the function of implementing the device control method of the first aspect. The device control apparatus includes at least one module, and the at least one module is used to implement the device control method of the first aspect.
[0028] In a third aspect, a device control device is provided. The device control device includes a processor and a memory, wherein the memory is configured to store a program that supports the device control device in executing the device control method provided in the first aspect, as well as data used to implement the device control method described in the first aspect. The processor is configured to execute the program stored in the memory. The device control device may also include a communication bus that establishes a connection between the processor and the memory.
[0029] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the device control method described in the first aspect.
[0030] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the device control method described in the first aspect.
[0031] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0033] FIG2 is a block diagram of a software system of an electronic device provided in an embodiment of the present application;
[0034] FIG3 is a schematic diagram of a device control system provided in an embodiment of the present application;
[0035] FIG4 is a schematic diagram of a lighting mode of a desk lamp provided in an embodiment of the present application;
[0036] FIG5 is a flow chart of a device control method provided in an embodiment of the present application;
[0037] FIG6 is a schematic diagram of a fence provided in an embodiment of the present application;
[0038] FIG7 is a block diagram of a software system of a tablet computer and a desk lamp provided in an embodiment of the present application;
[0039] FIG8 is a schematic diagram of a control interface of a desk lamp plug-in provided in an embodiment of the present application;
[0040] FIG9 is a schematic diagram of a process of registering a device fence service provided in an embodiment of the present application;
[0041] FIG10 is a flowchart of another device control method provided in an embodiment of the present application;
[0042] FIG11 is a schematic diagram of a first reminder message provided in an embodiment of the present application;
[0043] FIG12 is a schematic diagram of a second reminder message provided in an embodiment of the present application;
[0044] FIG13 is a schematic diagram of a third reminder message provided in an embodiment of the present application;
[0045] FIG14 is a flowchart of another device control method provided in an embodiment of the present application;
[0046] FIG15 is a flowchart of another device control method provided in an embodiment of the present application;
[0047] FIG16 is a schematic diagram of a fourth reminder message provided in an embodiment of the present application;
[0048] FIG17 is a schematic diagram of a fifth reminder message provided in an embodiment of the present application;
[0049] FIG18 is a schematic structural diagram of a device control apparatus provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0051] It should be understood that the “multiple” mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, words such as “first” and “second” are used to distinguish between identical or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as “first” and “second” do not limit the quantity and execution order, and words such as “first” and “second” do not necessarily limit them to be different.
[0052] The phrases "one embodiment" or "some embodiments" described in this application mean that the specific features, structures, or characteristics described in that embodiment are included in one or more embodiments of the application. Thus, the phrases "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" that appear in different places in this application do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. In addition, the terms "including," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0053] The electronic device involved in the embodiments of the present application is described below.
[0054] FIG1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Referring to FIG1 , the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0055] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0056] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0057] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0058] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0059] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device 100 via the power management module 141.
[0060] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0061] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0062] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0063] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0064] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 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 modify display information.
[0065] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0066] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0067] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created by the electronic device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0068] The electronic device 100 can implement audio functions, such as music playback and recording, through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D and the application processor.
[0069] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0070] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is an integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0071] Next, the software system of the electronic device 100 will be described.
[0072] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the present application, the software system of the electronic device 100 is exemplarily described by taking the Android system of the layered architecture as an example.
[0073] Figure 2 is a block diagram of a software system for an electronic device 100 provided in an embodiment of the present application. Referring to Figure 2 , the layered architecture divides the software into several layers, each with distinct roles and divisions of labor. Layers communicate with each other via software interfaces. In some embodiments, the Android system includes an application layer, an application framework layer, an Android runtime, a system layer, and a kernel layer.
[0074] The application layer can include a series of applications. As shown in Figure 2, the applications can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, short message and other applications.
[0075] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes several predefined functions. As shown in Figure 2, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and so on. The window manager manages window programs. It can obtain the display screen size, determine whether a status bar is present, lock the screen, and take screenshots. The content provider stores and retrieves data and makes it accessible to applications. This data may include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and the phone book. The view system includes visual controls, such as those that display text and images. The view system is used to construct the application's display interface. The display interface may consist of one or more views, such as a view that displays a text message notification icon, a view that displays text, and a view that displays images. The telephony manager provides communication functions for electronic device 100, such as managing call status (including connected and ended calls). The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, and video files. The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads, message reminders, and so on. The Notification Manager can also display notifications in the form of icons or scrolling text in the top status bar of the system, such as notifications from applications running in the background. The Notification Manager can also display notifications in the form of dialog windows on the screen, such as text messages in the status bar, beeps, vibrates electronic devices, flashes indicator lights, and so on.
[0076] The Android runtime consists of core libraries and a virtual machine (VM). The Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one for Java-based functions and the other for the Android core library. The application layer and application framework layer run in the VM. The VM executes Java files from the application layer and application framework layer as binary files. The VM is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0077] The system library can include multiple functional modules, such as: surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc. The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.
[0078] The kernel layer is the layer between hardware and software. The kernel layer includes display drivers, camera drivers, audio drivers, sensor drivers, etc.
[0079] The application scenarios provided by the embodiments of the present application are described below.
[0080] With the advancement of electronic technology, electronic devices such as mobile phones, tablets, and laptops have become an integral part of people's daily lives. Users can browse content using electronic devices. For example, with the rise in online education, students can use electronic devices to take online courses, browse course content, and learn relevant knowledge. The frequency and duration of electronic device use are increasing. However, prolonged screen time can cause eye fatigue and discomfort, potentially affecting vision over time. The health risks of screens to children's eyes are a growing concern, especially for growing children.
[0081] Currently, users often use desk lamps when using electronic devices in dimly lit environments. However, when the desk lamp's light shines on the screen of the electronic device, the screen, acting as a mirror, reflects the light, resulting in a "dazzling" reflection. In this case, the localized light on the screen is too bright, causing eye discomfort. Therefore, how to protect the eyes when viewing the screen content of electronic devices under a desk lamp is a key issue that users need to pay attention to.
[0082] The following describes the system architecture involved in the embodiments of the present application.
[0083] Figure 3 is a schematic diagram of a device control system provided in an embodiment of the present application. Referring to Figure 3, the device control system includes: an electronic device 301 and a lighting device 302. The electronic device 301 and the lighting device 302 can communicate via a wireless or wired connection.
[0084] The electronic device 301 may be a device with a screen. For example, the electronic device 301 may be a mobile phone, a tablet computer, etc., and this embodiment of the present application does not limit this exclusively. A designated application (application, APP) may be installed in the electronic device 301, and the designated application may be used for content browsing. For example, the designated application may be an application for browsing text content or video content. For example, the designated application may be an application for learning. Of course, the designated application may also be other applications that can browse content, and this embodiment of the present application does not limit this exclusively.
[0085] The lighting device 302 is a device for lighting. For example, the lighting device 302 may be a table lamp, a floor lamp, etc., but this embodiment of the present application does not limit this. In the embodiment of the present application, the lighting device 302 may have multiple lighting modes. Optionally, the lighting mode of the lighting device 302 may include a first lighting mode and a second lighting mode.
[0086] The first lighting mode and the second lighting mode are described below:
[0087] The first lighting mode is different from the second lighting mode. In some embodiments, the difference between the first lighting mode and the second lighting mode is reflected in the difference in lighting brightness distribution between the first lighting mode and the second lighting mode, that is, the brightness distribution of the lighting area of the lighting device 302 in the first lighting mode is different from the brightness distribution of the lighting area of the lighting device 302 in the second lighting mode.
[0088] As an example, the first lighting mode is suitable for viewing diffusely reflective objects such as books. In this case, optionally, in the first lighting mode, the brightness of the lighting area of the lighting device 302 is uniform, that is, the brightness of the lighting area of the lighting device 302 is evenly distributed.
[0089] As an example, the second lighting mode is a lighting mode suitable for viewing items such as device screens that produce mirror reflections. In the embodiment of the present application, the second lighting mode is a lighting mode suitable for browsing the screen content of the electronic device 301. Optionally, the second lighting mode is a lighting mode that matches a specified application, that is, the second lighting mode is a lighting mode suitable for use when browsing the content in a specified application in the electronic device 301. In this case, optionally, in the second lighting mode, the brightness of the central position of the lighting area of the lighting device 302 is lower than the brightness of other positions. In this way, the second lighting mode lowers the central brightness to supplement the surrounding light, thereby helping to reduce the screen reflection of the electronic device 301 and ensuring balanced light for eye protection. Of course, in the second lighting mode, the lighting area of the lighting device 302 can also have other brightness distribution forms, as long as the second lighting mode is suitable for browsing the screen content of the electronic device 301.
[0090] For example, as shown in FIG4 , the desk lamp provided in the embodiment of the present application may have two lighting modes. One lighting mode (i.e., the first lighting mode) is a book reading mode, which is suitable for reading books under a desk lamp. As shown in FIG4 (a), under this lighting mode, the light of the desk lamp is evenly distributed and has consistent brightness, which can provide the light required for reading. The other lighting mode (i.e., the second lighting mode) is a screen reading mode, which is suitable for browsing the content of the device screen under a desk lamp. As shown in FIG4 (b), under this lighting mode, the light brightness in the center of the lighting area of the desk lamp is darker, and the light brightness on both sides is brighter, thereby reducing screen reflections, supplementing the required light on both sides, and reducing contrast glare, so that the light is balanced and can protect the eyes.
[0091] However, when browsing content on electronic device 301, users often forget to turn on lighting device 302 in a dark environment, or even if they do turn on lighting device 302, they may forget to adjust lighting device 302 to the second lighting mode. In addition, since electronic device 301 generally has many applications, how to quickly access a specific application for content browsing is also a problem.
[0092] For example, tablets are widely used in online education scenarios. On the one hand, too many applications installed on a tablet can hinder users from quickly entering the learning state. On the other hand, when the environment darkens, the lights may not be turned on in time, and using the tablet in dim light can affect vision. Alternatively, forgetting to adjust the desk lamp to screen reading mode when studying with a tablet under a desk lamp can also affect vision. In this case, how to quickly get users into the learning state and protect their eyes are key issues that need to be addressed.
[0093] To this end, an embodiment of the present application provides a device control method that can automatically display the application interface of a specified application (such as a specific application for learning) in the electronic device 301 when the electronic device 301 is close to the lighting device 302 (such as a desk lamp, floor lamp, etc.) so that the user is not disturbed by other applications. In addition, during the operation of the specified application, when the lighting device 302 is turned on (i.e., the light is turned on), the lighting device 302 can be automatically controlled to a second lighting mode to reduce the screen reflection of the electronic device 301, so that the light is balanced, thereby effectively protecting the eyes and improving the screen content browsing experience. During the operation of the specified application, when the lighting device 302 is turned off (i.e., the light is turned off), the lighting device 302 can be automatically controlled to turn on and control the lighting device 302 to the second lighting mode when the ambient light brightness is low. In this way, when the required light is supplemented, the screen reflection of the electronic device 301 is reduced, so that the light is balanced, thereby effectively protecting the eyes and improving the screen content browsing experience.
[0094] Optionally, in an embodiment of the present application, at least one of the electronic device 301 and the lighting device 302 is movable. For example, the electronic device 301 may be a portable device that can be carried and moved by a user, while the lighting device 302 may be relatively fixed in one location. Alternatively, the electronic device 301 may be relatively fixed in one location, while the lighting device 302 is movable, such as the lighting device 302 can be carried and moved by a user. Alternatively, the electronic device 301 may be a portable device that can be carried and moved by a user, while the lighting device 302 is also movable, such as the lighting device 302 can also be carried and moved by a user.
[0095] As an example, in a dimly lit environment, a user can carry electronic device 301 and move it to lighting device 302. Alternatively, a user can carry lighting device 302 and move it to electronic device 301. Alternatively, one user can carry electronic device 301 and move it to lighting device 302, while another user carries lighting device 302 and moves it to electronic device 301. After electronic device 301 is near lighting device 302, electronic device 301 can automatically display the application interface of a specified application and automatically control lighting device 302 to the second lighting mode, so that the user can quickly start browsing content through the specified application under balanced eye-friendly lighting, thereby improving the user experience.
[0096] In some embodiments, as shown in FIG3 , the electronic device 301 can be stably placed on the base 302a of the lighting device 302 and can rest against the support base 302b of the lighting device 302. The placement of the electronic device 301 on the base 302a of the lighting device 302 can be achieved by relying on a groove 302c or a support mechanism (not shown) on the base 302a of the lighting device 302, and this embodiment of the application is not limited thereto.
[0097] The device control method provided in the embodiment of the present application is explained in detail below.
[0098] FIG5 is a flow chart of a device control method provided in an embodiment of the present application. Referring to FIG5 , the method includes the following steps:
[0099] Step 501: The electronic device detects that the electronic device is within the enclosure of the lighting device.
[0100] The "fence" described in the embodiments of this application is an area fence, a virtual boundary enclosed by a virtual fence that defines a specific area. The "fence" described in the embodiments of this application refers to the fence of a lighting device. The fence of a lighting device is used to define the area around the lighting device.
[0101] For example, as shown in FIG6 , the area defined by the fence of the lighting device can be a circular area 600 centered on the lighting device and having a preset distance as a radius. The preset distance can be set in advance, and the preset distance can be set to be smaller. For example, the preset distance can be 30 cm, 35 cm, etc., and this embodiment of the present application does not limit this to a single value. Alternatively, the area defined by the fence of the lighting device can be a rectangular area centered on the lighting device and having a certain length and width. Of course, the area defined by the fence of the lighting device can also be an area of other shapes, as long as it is an area around the lighting device.
[0102] In this case, if the electronic device detects that the electronic device is within the enclosure of the lighting device, it means that the electronic device is close to the lighting device. If the electronic device detects that the electronic device is not within the enclosure of the lighting device, it means that the electronic device is far away from the lighting device.
[0103] In some embodiments, the lighting device may send a broadcast message. After receiving the broadcast message, the electronic device may detect whether the electronic device is within the enclosure of the lighting device that sent the broadcast message.
[0104] The lighting device may continue to send broadcast messages after being powered on, such as periodically. That is, the lighting device may continue to send broadcast messages when it is powered on (i.e., the light is on) or off (i.e., the light is off).
[0105] For example, the broadcast message may be a Bluetooth broadcast message. Of course, the broadcast message may also be other broadcast messages that can be used for ranging, and the embodiments of the present application do not make the sole limitation to this.
[0106] The broadcast message may carry the lighting device identification. Optionally, the broadcast message may also carry the transmission power of the broadcast message.
[0107] The lighting device identifier is used to uniquely identify the lighting device. For example, the lighting device identifier can be a combination of the lighting device serial number and the media access control (MAC) address, or the lighting device identifier can be the lighting device's product serial number. Of course, the lighting device identifier can also be other information that can identify the lighting device, and this embodiment of the application is not limited to this.
[0108] For example, the message format of the broadcast message may include a device number field, which may include the number of the lighting device, and the source address of the broadcast message may include the MAC address of the lighting device. In this way, the recipient of the broadcast message can combine the number and MAC address of the lighting device into a lighting device identification.
[0109] After receiving the broadcast message, the electronic device can detect whether the electronic device is located within the fence of the lighting device that sent the broadcast message (that is, the lighting device identified by the lighting device identifier in the broadcast message).
[0110] As an example, after receiving a broadcast message, an electronic device can detect the signal strength of the broadcast message and then determine the distance between the electronic device and the lighting device identified by the lighting device identifier in the broadcast message based on the signal strength of the broadcast message. If the distance between the lighting device and the electronic device is less than or equal to a preset distance, the electronic device is located within the lighting device's enclosure. If the distance between the lighting device and the electronic device is greater than the preset distance, the electronic device is not located within the lighting device's enclosure.
[0111] For example, the signal strength of the broadcast message may be a received signal strength indication (RSSI) value of the broadcast message.
[0112] Optionally, the operation of the electronic device determining the distance between the lighting device identified by the lighting device identifier in the broadcast message and the electronic device based on the signal strength of the broadcast message may be: the electronic device determines the distance based on the transmission power of the broadcast message and the signal strength of the broadcast message, and the determined distance is the distance between the electronic device and the lighting device identified by the lighting device identifier in the broadcast message.
[0113] Among them, the operation of an electronic device determining the distance based on the transmission power of the broadcast message and the signal strength of the broadcast message is similar to the operation of a device in the related technology determining the distance between the device and the sender of a received message based on the transmission power of the message and the signal strength of the message. The embodiments of the present application will not elaborate on this in detail.
[0114] In one case, each time the electronic device receives a broadcast message, the electronic device detects whether the electronic device is located within the fence of the lighting device identified by the lighting device identifier in the broadcast message.
[0115] In another scenario, when the electronic device changes from a mobile state to a stationary state, the electronic device detects whether the electronic device is within the perimeter of the lighting device identified by the lighting device identifier in the most recently received broadcast message. However, when the electronic device is continuously in a mobile state or continuously in a stationary state, the electronic device does not detect whether the electronic device is within the perimeter of the lighting device identified by the lighting device identifier in the received broadcast message.
[0116] When an electronic device is in a mobile state, the distance between the electronic device and the lighting device is constantly changing, and the user is unlikely to be using the electronic device at this time. Therefore, in this case, the electronic device does not need to detect whether the electronic device is within the fence of the lighting device, which can save processing resources. When the electronic device changes from a mobile state to a stationary state, the distance between the electronic device and the lighting device is likely to have stabilized, and the user may also start using the electronic device at this time. Therefore, in this case, the electronic device can determine whether the electronic device is within the fence of the lighting device in order to perform subsequent control operations accordingly. When the electronic device is in a stationary state, the distance between the electronic device and the lighting device is usually fixed. Therefore, in this case, the electronic device no longer needs to detect whether the electronic device is within the fence of the lighting device, which can save processing resources.
[0117] In the above two cases, each time the electronic device detects whether it is within the fence of the lighting device, it can know whether it is currently within the fence of the lighting device. In this case, if the electronic device detects that it is within the fence of the lighting device this time, but it was not within the fence of the lighting device last time, it means that the electronic device entered the fence of the lighting device from outside the fence of the lighting device. If the electronic device detects that it is not within the fence of the lighting device this time, but it was within the fence of the lighting device last time, it means that the electronic device left the fence of the lighting device and went outside the fence of the lighting device. If the electronic device detects that it is not within the fence of the lighting device both this time and the last time, it means that the electronic device has always been outside the fence of the lighting device. If the electronic device detects that it is within the fence of the lighting device both this time and the last time, it means that the electronic device has always been within the fence of the lighting device.
[0118] If the electronic device is within the enclosure of the lighting device, it means that the electronic device is close to the lighting device. In this case, the user is likely to use a designated application on the electronic device to browse content under the illumination of the lighting device. Therefore, it can be determined whether the designated application on the electronic device is activated.
[0119] Step 502: The electronic device detects whether a specified application has been started.
[0120] The designated application can be used for content browsing. For example, the designated application can be an application for browsing text content or video content. For example, the designated application can be an application for learning. Of course, the designated application can also be other applications capable of content browsing, and this embodiment of the application is not limited to this.
[0121] If the specified application is not started, the electronic device can continue to execute the following step 503; if the specified application is started and is running in the background, the electronic device can continue to execute the following step 504; if the specified application is started and is running in the foreground, the electronic device can continue to execute the following step 505.
[0122] Optionally, when the electronic device is within the enclosure of the lighting device, it can continue to detect whether the specified application has been launched in two cases.
[0123] In one scenario, in response to an unlocked electronic device entering the fence of a lighting device from outside, the electronic device may detect whether a designated application has been launched. That is, if the electronic device determines that the electronic device is unlocked when entering the fence of the lighting device from outside, the electronic device may continue to detect whether the designated application has been launched.
[0124] That is, when the electronic device is in an unlocked state, if it gradually approaches the lighting device until it is near the lighting device, it means that the user is likely to use a specified application in the electronic device to browse content under the illumination of the lighting device, and therefore it can continue to determine whether the specified application in the electronic device has been started.
[0125] In another scenario, in response to an electronic device located within the perimeter of the lighting device changing from a locked screen state to an unlocked state, the electronic device may detect whether a designated application has been launched. That is, if the electronic device determines that the electronic device is located within the perimeter of the lighting device when the lock screen state changes to an unlocked state, the electronic device may continue to detect whether the designated application has been launched.
[0126] In this case, if the electronic device changes from a locked state to an unlocked state, the electronic device can detect whether it is located within the fence of the lighting device. Specifically, the electronic device can detect whether it is located within the fence of the lighting device identified by the lighting device identifier in the latest received broadcast message. If the electronic device is located within the fence of the lighting device identified by the lighting device identifier in the latest received broadcast message, the electronic device can continue to detect whether the specified application has been started.
[0127] That is, when the electronic device is located near a lighting device, if the screen of the electronic device is unlocked, it means that the user is likely to use a specified application in the electronic device to browse content under the illumination of the lighting device, and therefore it is possible to continue to determine whether the specified application in the electronic device has been started.
[0128] Step 503 : If the designated application is not started, the electronic device starts the designated application to display the application interface of the designated application, and then executes step 505 .
[0129] In this case, the electronic device does not launch the designated application before it is near the lighting device. For example, a user moves the electronic device closer to the lighting device without launching the designated application until the electronic device is near the lighting device. Once the electronic device is near the lighting device, the designated application automatically launches and displays its interface. At this point, the designated application is running, allowing the user to quickly browse content using the designated application, improving the user experience.
[0130] Optionally, before launching a designated application, the electronic device may first notify the user that the designated application is about to be automatically launched. This notification may be displayed on the electronic device as a reminder message to remind the user that the designated application is about to be launched. Alternatively, this notification may be played as an audio reminder on the electronic device, such as a technologically-inspired audio clip, to remind the user to prepare to browse the designated application.
[0131] Step 504 : If the designated application has been started and is in the background running state, the electronic device switches the designated application to the foreground running state to display the application interface of the designated application, and then executes step 505 .
[0132] In this case, the electronic device has already launched the designated application before being placed near the lighting device. For example, after opening the designated application on the electronic device, the user switches the designated application to background operation. The user then moves the electronic device closer to the lighting device until the electronic device is near the lighting device. While the designated application is running in the background while the electronic device is near the lighting device, the electronic device can automatically switch the designated application to the foreground to display the designated application's interface, allowing the user to quickly browse content using the designated application, thereby improving the user experience.
[0133] Optionally, before switching a designated application to the foreground, the electronic device may first notify the user that the designated application will automatically run in the foreground. This notification may be displayed on the electronic device as a reminder message to remind the user that the designated application is about to run in the foreground. Alternatively, this notification may be played as an audio reminder on the electronic device, such as a technologically-inspired audio clip, to remind the user to prepare to browse the designated application.
[0134] Furthermore, after step 502 , if the designated application has been started and is in the foreground running state, it means that the electronic device has displayed the application interface of the designated application, and the electronic device can then continue to execute step 505 .
[0135] In this case, the electronic device has already launched the designated application before being located near the lighting device. For example, after the user launches the designated application on the electronic device, the designated application remains in the foreground, i.e., the electronic device continuously displays the designated application's interface. The user moves the electronic device closer to the lighting device until the electronic device is located near the lighting device. If the designated application is in the foreground and displays the designated application's interface while the electronic device is located near the lighting device, the electronic device may proceed to step 505.
[0136] Step 505: The electronic device obtains the current state of the lighting device.
[0137] Through steps 501 to 504, the electronic device can determine that it is within the fence of the lighting device and that the electronic device has displayed the application interface of the specified application. In this case, the electronic device can obtain the current status of the lighting device and control the lighting device accordingly to provide the user with a better browsing experience.
[0138] The current state of the lighting device may include whether the lighting device is currently on (i.e., the light is on) or off (i.e., the light is off). Furthermore, if the lighting device is currently on, the current state of the lighting device may also include the current lighting mode of the lighting device. Optionally, the lighting mode of the lighting device may include a first lighting mode and a second lighting mode. The first lighting mode and the second lighting mode have been described in the embodiment of FIG. 3 above and will not be further described in this embodiment of the present application.
[0139] If the lighting device is turned on, the electronic device continues to execute the following step 506; if the lighting device is turned off, the electronic device continues to execute the following step 507.
[0140] Step 506: If the lighting device is turned on and is in the first lighting mode, the electronic device controls the lighting device to switch from the first lighting mode to the second lighting mode.
[0141] If the lighting device is turned on, it means that the user currently needs to use the lighting device for lighting. Therefore, the electronic device can automatically switch the lighting device to the second lighting mode when the lighting device is in the first lighting mode. This can reduce the screen reflection of the electronic device and make the light balanced, thereby effectively protecting the eyes and improving the screen content browsing experience.
[0142] Further, after step 505, if the lighting device is turned on and is in the second lighting mode, the electronic device may end the process.
[0143] Since the lighting device is turned on and in the second lighting mode, the lighting device's lighting can already meet the light requirements for browsing the screen content of the electronic device, and therefore no other operations are required at this time, and the process ends.
[0144] Step 507: If the lighting device is turned off, the electronic device detects the ambient light brightness; if the detected ambient light brightness is less than or equal to the preset brightness, the electronic device controls the lighting device to turn on and control the lighting device to be in the second lighting mode.
[0145] The preset brightness can be set in advance, and the preset brightness can be set to a lower value. In this case, if the ambient light brightness is less than or equal to the preset brightness, it means that the ambient light brightness is low, that is, the environment is dark. If the ambient light brightness is greater than the preset brightness, it means that the ambient light brightness is high, that is, the environment is bright.
[0146] When the lighting device is turned off, the electronic device can detect the ambient light brightness to determine whether there is a current need to use the lighting device for lighting.
[0147] If the ambient light brightness is less than or equal to the preset brightness, it means that the ambient light brightness is low, which means that lighting equipment is currently needed for lighting. The electronic device can automatically control the lighting equipment to turn on and control the lighting equipment to be in the second lighting mode. In this way, while supplementing the required light, the screen reflection of the electronic device can be reduced, the light is balanced, thereby effectively protecting the eyes and improving the screen content browsing experience.
[0148] If the ambient light brightness is greater than the preset brightness, it means that the ambient light brightness is high, which means that there is no need to use lighting equipment for lighting at present. The electronic device does not need to perform other operations and can end the process.
[0149] Furthermore, the electronic device may continue to detect the ambient light brightness while running a designated application program, for example, may periodically detect the ambient light brightness.
[0150] If the electronic device detects that the ambient light brightness is greater than the preset brightness while running a specified application, no other operations are performed and the electronic device continues to monitor the ambient light brightness.
[0151] If the electronic device detects that the ambient light brightness is less than or equal to the preset brightness while running a specified application, the electronic device detects whether it is within the fence of the lighting device. Specifically, the electronic device can detect whether it is within the fence of the lighting device identified by the lighting device identifier in the most recently received broadcast message. If the electronic device detects that it is within the fence of the lighting device, the electronic device obtains the current status of the lighting device; if the lighting device is turned on and is in the second lighting mode, the electronic device does not perform other operations and ends the process; if the lighting device is turned on and is in the first lighting mode, the electronic device switches the lighting device from the first lighting mode to the second lighting mode to reduce screen reflections on the electronic device, balance the light, effectively protect the eyes, and improve the screen content browsing experience; if the lighting device is turned off, the electronic device controls the lighting device to turn on and control the lighting device to be in the second lighting mode to reduce screen reflections on the electronic device while supplementing the required light, balance the light, and effectively protect the eyes, and improve the screen content browsing experience. If the electronic device detects that it is not within the enclosure of the lighting device, it will display a reminder message to move to the lighting device. This can promptly remind the user to move to the lighting device when browsing content using a designated application on the electronic device in dimming conditions, thereby protecting eyesight and improving the browsing experience. Furthermore, the electronic device can also send this reminder message to a designated user account, so that the user corresponding to the designated user account can promptly be informed that the user of the electronic device is browsing the screen content of the electronic device in a dark environment and can take appropriate measures.
[0152] It should be noted that, through the above-mentioned device control method, the embodiment of the present application can realize at least the following three scenarios. The following three scenarios can be realized separately or in combination with each other, and the embodiment of the present application does not limit this.
[0153] In the first scenario, the electronic device can automatically launch a specified application when it is located near a lighting device.
[0154] Specifically, a user brings an electronic device closer to a lighting device. After the electronic device is near the lighting device, if the user turns on and unlocks the screen of the electronic device, the electronic device can automatically launch a specified application to display the application interface of the specified application. Alternatively, a user brings an electronic device closer to a lighting device with the screen turned on and unlocked. After the electronic device is near the lighting device, the electronic device can automatically launch a specified application to display the application interface of the specified application.
[0155] For example, a user brings a tablet computer close to a desk lamp, and then places the tablet computer and the desk lamp on a table. Alternatively, if the base of the desk lamp has a stand, the user places the tablet computer on the stand, so that the tablet computer is near the desk lamp. The user then turns on the tablet computer, and the tablet computer automatically launches a specific application for learning and displays the corresponding application interface, allowing the user to quickly enter a learning state.
[0156] In the second scenario, when the electronic device is located near the lighting device, the electronic device can automatically adjust the lighting device to the second lighting mode when the lighting device is turned on.
[0157] Specifically, after the user carries the electronic device and moves it near the lighting device, the user turns on the lighting device, then lights up and unlocks the screen of the electronic device, and browses content using a designated application in the electronic device, the electronic device can automatically adjust the lighting device to the second lighting mode.
[0158] For example, if a user turns on a desk lamp and then uses a specific application on a tablet computer to study under the desk lamp, the tablet computer can automatically adjust the desk lamp to the second lighting mode. This allows the tablet computer and desk lamp to be linked in mode, ensuring a comfortable eye environment for the tablet computer.
[0159] In a third scenario, when the electronic device is located near a lighting device, when the lighting device is turned off and the environment is dark, the electronic device can automatically turn on the lighting device and control the lighting device to be in the second lighting mode.
[0160] Specifically, when a user browses content using a designated application on an electronic device and the surrounding environment gradually darkens, the electronic device can automatically control the lighting device to turn on and switch to the second lighting mode if there is a lighting device nearby. If there is no lighting device nearby, the electronic device can display a reminder message to remind the user to browse the screen content of the electronic device by going to the lighting device.
[0161] For example, when a user uses a specific application on a tablet computer to study, and as time goes by, the surrounding environment gradually becomes darker, the tablet computer can automatically turn on the desk lamp if there is a desk lamp nearby and control the desk lamp to be in the second lighting mode, that is, the light can be automatically turned on in dim light to protect the eyes. If there is no desk lamp nearby, the tablet computer can remind the user to study under the desk lamp.
[0162] It should be noted that the device control method in the embodiments of the present application is an automatic control function. As an example, a setting button for this automatic control function may be present in the electronic device. The user can choose to turn this setting button on or off. If the user turns on this setting button, the electronic device can automatically display the application interface of the specified application and automatically control the lighting device according to the device control method provided in the embodiments of the present application. If the user turns off this setting button, the electronic device does not automatically display the application interface of the specified application or automatically control the lighting device. Instead, the user manually displays the application interface of the specified application and manually controls the lighting device in the electronic device.
[0163] In an embodiment of the present application, when an electronic device is located near a lighting device, it can automatically display the application interface of a designated application in the electronic device so that the user is not disturbed by other applications. Furthermore, when the designated application is running, the lighting device can be automatically controlled to be in a second lighting mode when it is turned on, so as to reduce the screen reflection of the electronic device and make the light balanced, thereby effectively protecting the eyes and improving the browsing experience of the screen content. When the designated application is running, when the lighting device is turned off, the lighting device can be automatically controlled to be turned on and controlled to be in the second lighting mode when the ambient light brightness is low. In this way, the required light can be supplemented while reducing the screen reflection of the electronic device and making the light balanced, thereby effectively protecting the eyes and improving the browsing experience of the screen content.
[0164] In some embodiments, the device control method described above can be implemented by relevant modules in the software system of the electronic device. The device control method described above is exemplified below by taking the electronic device as a tablet computer, the lighting device as a desk lamp, and the second lighting mode as a screen reading mode as an example.
[0165] FIG7 is a block diagram of a software system of a tablet computer and a desk lamp provided in an embodiment of the present application.
[0166] 7 , the software system of the tablet computer includes an application layer and an application framework layer.
[0167] The application layer includes designated applications and smart space applications, and the application framework layer includes pre-built services.
[0168] The designated application can be used for content browsing. For example, the designated application can be an application for browsing text content or video content. For example, the designated application can be an application for learning. Of course, the designated application can also be other applications capable of content browsing, and this embodiment of the application is not limited to this.
[0169] The smart space application is an application for managing various smart devices, in which plug-ins for controlling various smart devices can be set. In the embodiment of the present application, a desk lamp plug-in for controlling the desk lamp can be set. Optionally, the desk lamp plug-in can be a native plug-in. For example, the desk lamp plug-in may include a fifth-generation hypertext markup language 5 (HTML5) card (i.e., H5 card), a web page view (also called Webview), a JS Bridge, a background logic unit, a situational awareness service (also called an Awareness software development kit (SDK)), etc. Among them, JS Bridge is used to provide JavaScript with an interface for calling Native functions. The background logic unit is the main unit for implementing the method flow in the embodiment of the present application. The background logic unit can start a specified application and can also control the desk lamp through the first communication module. Optionally, the background logic unit can be implemented using Java language.
[0170] The pre-installed service includes a middle platform, a distance detection module, a motion detection module and a first communication module.
[0171] The middle platform can run continuously when the tablet computer is turned on. For example, the middle platform can be an artificial intelligence (AI) middle platform. A device fence service is set in the middle platform. For example, the device fence service includes an enter fence event and a leave fence event. The "fence" described in the embodiment of the present application is a regional fence, which is a virtual boundary surrounded by a virtual fence. This virtual boundary defines a specific area. The "fence" described in the embodiment of the present application refers to the fence of the desk lamp. For example, as shown in Figure 6, the area defined by the "fence" in the embodiment of the present application can be a circular area 600 with the desk lamp as the center and a preset distance as the radius. If the tablet computer enters the area near the desk lamp, for example, if the tablet computer enters the circular area 600 with the desk lamp as the center and a preset distance as the radius, the enter fence event in the device fence service will be triggered; and if the tablet computer leaves the area near the desk lamp, for example, if the tablet computer leaves the circular area 600 with the desk lamp as the center and a preset distance as the radius, the leave fence event in the device fence service will be triggered. It should be noted that in this embodiment of the present application, the enter fence event is used to indicate that the tablet computer has entered the fence of the desk lamp, that is, the tablet computer has entered the area near the desk lamp. The leave fence event is used to indicate that the tablet computer has left the fence of the desk lamp, that is, the tablet computer has left the area near the desk lamp.
[0172] The distance detection module is used to detect the distance between the tablet computer and the desk lamp, that is, to detect whether the tablet computer is located within the fence of the desk lamp. For example, the distance detection module can be a nearby module, which can be used to sense nearby devices. Optionally, the distance detection module can determine the distance between itself and the desk lamp based on the broadcast message when receiving the broadcast message sent by the desk lamp. For example, the broadcast message can be a Bluetooth broadcast message. Of course, the broadcast message can also be other broadcast messages that can be used for ranging, and the embodiments of the present application do not make a sole limitation on this.
[0173] The motion detection module can detect whether the tablet computer is currently in a stationary state or in a mobile state. For example, the motion detection module can be a service for a mobile sensing development platform (MSDP). In one possible scenario, when the motion detection module detects that the tablet computer has changed from a mobile state to a stationary state, it can trigger the distance detection module through the middle platform to detect the distance between the tablet computer and the desk lamp. Optionally, the motion detection module and the middle platform can transmit information through static broadcast or pending intent.
[0174] The first communication module is a module for communicating with the desk lamp. The desk lamp plug-in can obtain the status of the desk lamp and control the desk lamp through the first communication module.
[0175] 7 , the software system of the desk lamp includes a broadcast service, a desk lamp service, and a second communication module.
[0176] The broadcast service is used to send broadcast messages. The broadcast service can continue to send broadcast messages while the desk lamp is powered on, for example, periodically. That is, the broadcast service can continue to send broadcast messages while the desk lamp is powered on, regardless of whether the desk lamp is turned on or off. For example, the broadcast message can be a Bluetooth broadcast message. Of course, the broadcast message can also be other broadcast messages that can be used for ranging, and this embodiment of the application is not limited to this.
[0177] The desk lamp service is a service for controlling desk lamps. In the embodiment of the present application, the desk lamp service can control the desk lamp to be turned on or off, and can also adjust the lighting mode of the desk lamp.
[0178] In one case, the desk lamp service may control the desk lamp in response to a user operating a button of the desk lamp.
[0179] In another case, when the desk lamp service receives a control message sent by the tablet computer, it may control the desk lamp in response to the control message.
[0180] As an example, the control message may be a control message automatically generated by the background logic unit of the desk lamp plug-in in the smart space application of the tablet computer based on the distance between the tablet computer and the desk lamp, the status of the desk lamp, the ambient light brightness, etc.
[0181] As another example, the control message may be a corresponding control message generated by a desk lamp plug-in in a smart space application of a tablet computer according to the user's operation in the control interface of the desk lamp plug-in.
[0182] For example, as shown in FIG8 , the tablet computer displays a control interface 801 of the desk lamp plug-in. The control interface 801 may include a variety of control options, such as control options for book reading mode, screen reading mode, and drawing mode. If the user clicks on the control option for screen reading mode in the control interface 801, the desk lamp plug-in may generate a corresponding control message, which is used to instruct the adjustment of the lighting mode of the desk lamp to the screen reading mode. Afterwards, the desk lamp plug-in may send the control message to the desk lamp. After receiving the control message, the desk lamp service in the desk lamp may control whether the desk lamp is in screen reading mode.
[0183] The second communication module is a module for communicating with the tablet computer. For example, the desk lamp can receive control messages sent by the tablet computer through the second communication module.
[0184] The device control method provided in the embodiment of the present application is exemplarily described below in conjunction with the software system described in the embodiment of FIG. 7 above.
[0185] Before executing the device control method provided in the embodiments of the present application, you can do two preparatory tasks:
[0186] On the one hand, technicians can preset the application name of the specified application in the desk lamp plug-in.
[0187] Optionally, when developing a desk lamp plug-in, a technician may preset an application name of a designated application in the desk lamp plug-in, so that subsequent desk lamp plug-ins can start the designated application according to the application name.
[0188] On the other hand, users can install the desk lamp plug-in in the smart space application on the tablet.
[0189] Optionally, the user can open the Smart Space application on the tablet computer, and then bind the desk lamp they want to use in the Smart Space application. In one possible scenario, after successfully binding the desk lamp in the Smart Space application, the Smart Space application can automatically download and install the desk lamp plug-in corresponding to the desk lamp. In another possible scenario, after successfully binding the desk lamp in the Smart Space application, the device name of the desk lamp will be added to the device list in the Smart Space application. After the user clicks on the device name of the desk lamp in the device list, the Smart Space application can download and install the desk lamp plug-in corresponding to the desk lamp. The desk lamp plug-in can be used to control the desk lamp, and the desk lamp plug-in can obtain the basic information of the desk lamp, such as the desk lamp logo and product serial number of the corresponding desk lamp. Optionally, the desk lamp plug-in can be displayed in the application interface of the Smart Space application in the form of a card.
[0190] After completing the above preparations, the desk lamp plug-in can register the device fence service with the middle platform, as follows:
[0191] FIG9 is a schematic diagram of a process for registering a device fence service provided by an embodiment of the present application. Referring to FIG9 , the process may include the following steps 901 to 903:
[0192] Step 901: The smart space application starts the desk lamp plug-in for the first time.
[0193] After installing the desk lamp plug-in in the Smart Space app, users can activate the desk lamp plug-in in the Smart Space app. For example, users can click the desk lamp plug-in card in the Smart Space app interface to activate the desk lamp plug-in in the Smart Space app.
[0194] If the desk lamp plug-in is started for the first time, for example, if the user clicks on the card of the desk lamp plug-in for the first time in the application interface of the smart space application, the desk lamp plug-in can register the device fence service to the middle platform through the smart space application. The specific process includes the following steps 902 and 903.
[0195] Step 902: The desk lamp plug-in sends a registration instruction to the smart space application. The registration instruction is used to instruct the smart space application to register the device fence service.
[0196] Optionally, the desk lamp plug-in can register the device fence service through a cross-process access service (also called an Android Interface Definition Language (AIDL) service).
[0197] Step 903: After receiving the registration instruction, the smart space application registers the device fence service with the middle platform.
[0198] Optionally, the smart space application can register the device fence service by accessing the service across processes.
[0199] It is important to note that the Smart Space app can be pre-bound to the middle platform. In this way, the Smart Space app can register the device fence service with the middle platform and call the device fence service. Optionally, the Smart Space app and the middle platform can communicate information through static broadcasts or pending intents.
[0200] Another point to note is that when registering the device fence service, the desk lamp plug-in can provide the middle platform with information such as the desk lamp identification, fence range (for example, a preset distance in the embodiment of this application), so that the registered device fence service can be triggered when the tablet computer enters or leaves the fence range of the desk lamp identified by the desk lamp identification. Optionally, when registering the device fence service, the desk lamp plug-in can also provide the smart space application with the association between the desk lamp identification and the product serial number, so that the subsequent smart space application can accurately determine the desk lamp with the corresponding product serial number based on the desk lamp identification.
[0201] The desk lamp identifier is used to uniquely identify the desk lamp. The desk lamp identifier can be the number or MAC address of the desk lamp, or a combination of the number and MAC address of the desk lamp. Of course, the desk lamp identifier can also be other information that can be used to identify the desk lamp. This embodiment of the present application does not make a sole limitation on this.
[0202] After completing the above operations, you can start executing the device control method provided in the embodiment of the present application, as described below:
[0203] FIG10 is a flow chart of a device control method provided in an embodiment of the present application. Referring to FIG10 , the method includes the following steps:
[0204] Step 1001: The desk lamp sends a broadcast message.
[0205] The desk lamp can continue to send broadcast messages after being powered on. In an embodiment of the present application, the desk lamp can continue to send broadcast messages when it is powered on or off. For example, the broadcast service in the desk lamp can periodically send broadcast messages.
[0206] For example, the broadcast message may be a Bluetooth broadcast message. Of course, the broadcast message may also be other broadcast messages that can be used for ranging, and the embodiments of the present application do not make the sole limitation to this.
[0207] The broadcast message may carry the lamp identification. For example, the broadcast message format may include a device number field, which may include the lamp number, and the source address of the broadcast message may include the lamp's MAC address. In this way, the receiver of the broadcast message can combine the lamp number and MAC address as the lamp identification.
[0208] Optionally, the broadcast message may also carry the transmission power of the broadcast message.
[0209] Step 1002: The receiving module in the tablet computer receives the broadcast message sent by the desk lamp.
[0210] When a user brings a tablet computer close to a desk lamp, the receiving module in the tablet computer can receive the broadcast message sent by the desk lamp.
[0211] Optionally, after receiving the broadcast message, the receiving module may detect the signal strength of the broadcast message. For example, the signal strength of the broadcast message may be an RSSI value of the broadcast message.
[0212] Step 1003: The receiving module sends the broadcast message to the middle station.
[0213] Optionally, the receiving module may send both the broadcast message and the signal strength of the broadcast message to the middle station.
[0214] Step 1004: The middle station detects whether the fence has been entered based on the broadcast message.
[0215] It should be noted that in the embodiment of Figure 9 above, the desk lamp plug-in provides a desk lamp identification when registering the device fence service in the middle station, so after the middle station receives the broadcast message sent by the receiving module, it can first check whether the desk lamp identification carried in the broadcast message is the same as the desk lamp identification used during registration; if they are the same, the middle station processes the broadcast message, that is, detects whether it enters the fence based on the broadcast message; if they are different, the middle station does not process the broadcast message, that is, discards the broadcast message.
[0216] The middle platform detects whether the tablet computer enters the fence based on the broadcast message, that is, detects whether the tablet computer enters the fence of the desk lamp identified by the desk lamp identifier carried in the broadcast message.
[0217] Optionally, the operation of the middle station detecting whether the fence has been entered based on the broadcast message can be as follows: the middle station calls the distance detection module to determine the distance between the table lamp identified by the table lamp identifier carried in the broadcast message and the tablet computer based on the signal strength of the broadcast message. If the distance is greater than a preset distance, it is determined that the fence has not been entered. If the distance is less than or equal to the preset distance, it is determined that the fence is currently inside. If the distance between the table lamp identified by the table lamp identifier and the tablet computer was greater than the preset distance last time it was detected, it is determined that the fence has been entered. If the distance between the table lamp identified by the table lamp identifier and the tablet computer was less than or equal to the preset distance last time it was detected, it is determined that the fence is continuously inside.
[0218] Optionally, the operation of the middle station calling the distance detection module to determine the distance between the desk lamp identified by the desk lamp identifier carried in the broadcast message and the tablet computer based on the signal strength of the broadcast message can be: the tablet computer calls the distance detection module to determine the distance between the desk lamp identified by the desk lamp identifier carried in the broadcast message and the tablet computer based on the transmission power of the broadcast message and the signal strength of the broadcast message.
[0219] As an example, every time the middle station receives a broadcast message, it detects whether it has entered the fence based on the broadcast message.
[0220] As another example, after receiving the motion state change information sent by the motion detection module, the middle station detects whether the fence has been entered based on the latest received broadcast message. If the middle station does not receive the motion state change information sent by the motion detection module, it may not detect whether the fence has been entered based on the received broadcast message.
[0221] The motion state change information is used to indicate that the tablet computer changes from a moving state to a stationary state.
[0222] When the tablet is in a mobile state, the distance between the tablet and the desk lamp is constantly changing, and the user is unlikely to be using the tablet at this time. Therefore, in this case, the middle platform does not need to detect whether it has entered the fence, which can save processing resources. When the tablet changes from a mobile state to a stationary state, the distance between the tablet and the desk lamp is likely to have stabilized, and the user may also start using the tablet at this time. Therefore, in this case, the middle platform can detect whether it has entered the fence so that subsequent control operations can be performed when entering the fence. While the tablet is in a stationary state, the distance between the tablet and the desk lamp is usually fixed. Therefore, in this case, the middle platform no longer needs to detect whether it has entered the fence, which can save processing resources.
[0223] If the middle station detects that the device has not entered the fence or the middle station detects that the device is still inside the fence, the middle station ends the process and continues to receive broadcast messages. If the middle station detects that the device has entered the fence, the process continues to execute step 1005.
[0224] Step 1005: If the middle platform detects entering the fence, the middle platform sends a first message to the smart space application.
[0225] If the middle platform detects that the tablet has entered a fence, it can trigger an entry fence event in the device fence service to send a first message to the smart space application. The first message carries a lamp identifier and indicates that the tablet has entered the fence of the lamp identified by the lamp identifier.
[0226] Optionally, after receiving the first message, the smart space application can obtain the corresponding product serial number based on the desk lamp identifier carried in the first message and from the association relationship between the desk lamp identifier and the product serial number. The obtained product serial number is the product serial number of the desk lamp identified by the desk lamp identifier carried in the first message.
[0227] Step 1006: The smart space application starts the background logic unit in the desk lamp plug-in.
[0228] Optionally, the smart space application can start (also called pull up) the background logic unit in the desk lamp plug-in through a callback, and the product serial number can be carried in the startup parameters of the background logic unit to indicate that the tablet computer is located near the desk lamp corresponding to the product serial number.
[0229] Optionally, the desk lamp plug-in may execute the following steps 1007 to 1010 when the tablet computer is in an unlocked state.
[0230] Step 1007: The desk lamp plug-in sends a notification to remind the user that a designated application is about to be launched.
[0231] Before launching a designated application, the background logic unit in the desk lamp plug-in can first notify the user that the designated application is about to be automatically launched. On the one hand, this notification reminder can be displayed on the tablet to remind the user that the designated application is about to be launched. On the other hand, this notification reminder can also be played on the tablet as a reminder audio, such as a technological audio clip, to remind the user to prepare to browse the designated application.
[0232] For example, as shown in FIG11 , the desk lamp plug-in may display a reminder message 1101 in the pull-down notification bar of the tablet computer to remind the user that a designated application (ie, the XX application shown in FIG11 ) is about to be automatically started.
[0233] Step 1008: The desk lamp plug-in starts a specified application.
[0234] Optionally, the background logic unit in the desk lamp plug-in can start (also called launch) a specified application through the Intent mechanism. After the desk lamp plug-in starts the specified application, the tablet computer will display the application interface of the specified application.
[0235] Optionally, after the designated application is started by the desk lamp plug-in, a reminder message may be displayed in its application interface to remind the user that the designated application is automatically started.
[0236] For example, as shown in FIG12 , the designated application may display a reminder message 1201 in its application interface to remind the user that the designated application is automatically started.
[0237] Step 1009: The desk lamp plug-in obtains the current status of the desk lamp.
[0238] Optionally, the background logic unit in the desk lamp plug-in can send a status query message to the desk lamp through the first communication module to request to query the current status of the desk lamp. After the desk lamp service in the desk lamp receives the status query message through the second communication module, it can send status information to the tablet computer through the second communication module. The background logic unit in the desk lamp plug-in can receive the status information through the first communication module. The background logic unit in the desk lamp plug-in determines the current status of the desk lamp based on the status information.
[0239] Step 1010: When the desk lamp is turned on and is not in the screen reading mode, the desk lamp plug-in adjusts the desk lamp to be in the screen reading mode.
[0240] Optionally, the background logic unit in the desk lamp plug-in can send a control message to the desk lamp through the first communication module to request that the desk lamp be adjusted to screen reading mode. After receiving the control message through the second communication module, the desk lamp service in the desk lamp can adjust the desk lamp to screen reading mode.
[0241] In this case, the desk lamp plug-in can issue a notification reminder to remind the user that the desk lamp has been automatically adjusted to screen reading mode. For example, as shown in Figure 13 (a), the desk lamp plug-in can display a reminder message 1301 in the drop-down notification bar of the tablet computer to remind the user that the desk lamp has been automatically adjusted to screen reading mode. Alternatively, as shown in Figure 13 (b), if the user clicks to enter the desk lamp plug-in in the smart space application, the desk lamp plug-in can display a reminder message 1302 in the control interface of the desk lamp plug-in to remind the user that the desk lamp has been automatically adjusted to screen reading mode.
[0242] In an embodiment of the present application, when a tablet computer is near a desk lamp, the current state of the desk lamp can be detected. When the desk lamp is turned on but not in screen reading mode, the desk lamp is automatically adjusted to screen reading mode. In this way, the screen reflection of the tablet computer can be reduced, and the light can be balanced, thereby effectively protecting the eyes and improving the user's browsing experience when browsing the tablet computer screen content. When the desk lamp is turned off, other processes can be performed, which will be specifically explained in conjunction with the embodiment of Figure 14 below.
[0243] FIG14 is a flow chart of a device control method provided in an embodiment of the present application. Referring to FIG14 , the method includes the following steps:
[0244] Step 1401: The desk lamp sends a broadcast message.
[0245] Step 1402: The receiving module in the tablet computer receives the broadcast message sent by the desk lamp.
[0246] Step 1403: The receiving module sends the broadcast message to the middle station.
[0247] Step 1404: The middle station detects whether it has entered the fence based on the broadcast message.
[0248] If the middle station detects that the device has not entered the fence, the middle station ends the process and continues to receive broadcast messages. If the middle station detects that the device has entered the fence, the process continues to execute the following step 1405.
[0249] Step 1405: If the middle platform detects entering the fence, the middle platform sends a first message to the smart space application.
[0250] Step 1406: The smart space application starts the background logic unit in the desk lamp plug-in.
[0251] Step 1407: The desk lamp plug-in sends a notification to remind the user that the specified application is about to be launched.
[0252] Step 1408: The desk lamp plug-in starts the specified application.
[0253] Step 1409: The desk lamp plug-in obtains the current status of the desk lamp.
[0254] It should be noted that the above steps 1401 to 1409 can refer to steps 1001 to 1009 in the embodiment of Figure 10 above, and will not be repeated in this embodiment of the present application.
[0255] Step 1410: When the desk lamp is turned off, the desk lamp plug-in detects the brightness of the ambient light.
[0256] Optionally, the tablet computer may be provided with an ambient light sensor, and the background logic unit in the desk lamp plug-in may call the ambient light sensor to detect the brightness of the ambient light.
[0257] Step 1411: When the ambient light brightness is low, the desk lamp plug-in controls the desk lamp to be turned on and the desk lamp is in screen reading mode.
[0258] Optionally, when the ambient light brightness is less than or equal to a preset brightness, the background logic unit in the desk lamp plug-in can send a control message to the desk lamp via the first communication module, requesting that the desk lamp be turned on and placed in screen reading mode. Upon receiving the control message via the second communication module, the desk lamp service in the desk lamp can turn on the desk lamp and control the desk lamp to be in screen reading mode.
[0259] In an embodiment of the present application, the current status of the desk lamp can be detected when the tablet is placed near the desk lamp. If the desk lamp is off, the desk lamp can be automatically turned on and put into screen reading mode when the ambient light is low. This can reduce the tablet screen reflection while supplementing the required light, making the light balanced, thereby effectively protecting the eyes and improving the screen content browsing experience.
[0260] It should be noted that in the embodiment of Figure 10 and the embodiment of Figure 14 above, the desk lamp plug-in can automatically launch a specified application. Alternatively, the user can manually launch a specified application in the tablet computer. In this case, in some embodiments, the specified application can also detect the ambient light brightness during operation and control the desk lamp based on the ambient light brightness, as described below:
[0261] FIG15 is a flow chart of a device control method provided in an embodiment of the present application. Referring to FIG15 , the method includes the following steps:
[0262] Step 1501: Designate an application to detect ambient light brightness.
[0263] The designated application can continuously detect the ambient light brightness during operation, for example, it can periodically detect the ambient light brightness. Optionally, the tablet computer can be provided with an ambient light sensor. The designated application can call the ambient light sensor to detect the ambient light brightness.
[0264] It should be noted that in some cases, the background program of the desk lamp plug-in or the background program of the smart space application is likely to be manually closed by the user or actively closed by the tablet computer. Therefore, in the embodiment of the present application, during the operation of the specified application, the ambient light brightness may not be detected by the desk lamp plug-in or the smart space application, but by the specified application. This ensures that the ambient light brightness can be continuously obtained to execute the corresponding control process accordingly.
[0265] If the ambient light brightness is greater than the preset brightness, the designated application does not perform other operations and continues to monitor the ambient light brightness.
[0266] Step 1502: If the ambient light brightness is less than or equal to the preset brightness, the designated application sends a second message to the smart space application. The second message is used to notify the smart space application that the current ambient light brightness is low.
[0267] In this case, the designated application can also perform a notification reminder to remind the user that the current environment is dark. For example, as shown in Figure 16, the designated application can display a reminder message 1601 in its application interface to remind the user that the current environment is dark.
[0268] Step 1503: The smart space application starts the background logic unit in the desk lamp plug-in.
[0269] Optionally, the smart space application can start (also called pull up) the background logic unit in the desk lamp plug-in through a callback, and the startup parameters of the background logic unit can carry a second message to indicate that the current ambient light brightness is low.
[0270] In this case, the desk lamp plug-in can perform a notification reminder to remind the user that the current environment is dark. For example, as shown in Figure 17, the desk lamp plug-in can display a reminder message 1701 in the pull-down notification bar of the tablet computer to remind the user that the current environment is dark.
[0271] Step 1504: The desk lamp plug-in obtains the current status of the desk lamp.
[0272] Optionally, the background logic unit in the desk lamp plug-in can send a status query message to the desk lamp through the first communication module to request to query the current status of the desk lamp. After the desk lamp service in the desk lamp receives the status query message through the second communication module, it can send status information to the tablet computer through the second communication module. The background logic unit in the desk lamp plug-in can receive the status information through the first communication module. The background logic unit in the desk lamp plug-in determines the current status of the desk lamp based on the status information.
[0273] Step 1505: When the desk lamp is turned off, the desk lamp plug-in controls the desk lamp to be turned on and the desk lamp is in screen reading mode.
[0274] Optionally, the backend logic unit in the desk lamp plug-in can send a control message to the desk lamp via the first communication module to request that the desk lamp be turned on and placed in screen reading mode. Upon receiving the control message via the second communication module, the desk lamp service in the desk lamp can turn on the desk lamp and adjust it to screen reading mode.
[0275] In an embodiment of the present application, the ambient light brightness can be continuously detected while a designated application is running on the tablet. When the ambient light brightness is low, the current status of a desk lamp near the tablet can be detected. If the desk lamp is off, the desk lamp can be automatically turned on and placed in screen reading mode. This can reduce glare on the tablet screen while providing the required light, resulting in balanced lighting, effectively protecting the eyes and improving the user's browsing experience when viewing the tablet screen.
[0276] Figure 18 is a schematic diagram of the structure of a device control apparatus provided in an embodiment of the present application. This apparatus can be implemented as part or all of a computer device using software, hardware, or a combination of both. The computer device can be the electronic device described in the embodiments of Figures 1 and 2 above. Referring to Figure 18 , the apparatus includes an acquisition module 1801 and a control module 1802.
[0277] Acquisition module 1801 is configured to, in response to an electronic device in an unlocked state entering the fence of the lighting device from outside, or in response to an electronic device located within the fence of the lighting device changing from a locked state to an unlocked state, display an application interface of a specified application and acquire the current state of the lighting device;
[0278] The control module 1802 is used to control the lighting device to switch from the first lighting mode to the second lighting mode matching the specified application when the lighting device is turned on and in the first lighting mode; wherein the lighting brightness distribution of the first lighting mode and the second lighting mode is different.
[0279] Optionally, in the second lighting mode, the brightness of a central position of the lighting area of the lighting device is lower than the brightness of other positions.
[0280] Optionally, the acquisition module 1801 is used to:
[0281] If the specified application is not started, the specified application is started to display the application interface of the specified application.
[0282] Optionally, the acquisition module 1801 is used to:
[0283] If the specified application has been started and is in the background running state, the specified application is switched to the foreground running state to display the application interface of the specified application.
[0284] Optionally, the device further comprises:
[0285] The first detection module is used to detect the brightness of the ambient light when the lighting device is turned off;
[0286] The control module 1802 is configured to control the lighting device to turn on and be in a second lighting mode if the detected ambient light brightness is less than or equal to a preset brightness.
[0287] Optionally, the device further comprises:
[0288] A first detection module is used to detect the brightness of the ambient light during the operation of a specified application program;
[0289] The display module is used to display a reminder message if the detected ambient light brightness is less than or equal to the preset brightness and it is determined that the electronic device is not located within the fence of the lighting device. The reminder message is used to remind the user to move to the lighting device.
[0290] Optionally, the device further comprises:
[0291] A receiving module, configured to receive a broadcast message carrying a lighting device identification;
[0292] The acquisition module 1801 is used to:
[0293] If the electronic device changes from a locked screen state to an unlocked state, detecting whether the electronic device is located within a fence of a lighting device identified by a lighting device identifier in a most recently received broadcast message;
[0294] If the electronic device is located within the fence of the lighting device identified by the lighting device identifier in the most recently received broadcast message, the application interface of the specified application is displayed and the current status of the lighting device is obtained.
[0295] Optionally, the device further comprises:
[0296] The second detection module is configured to detect whether the electronic device is located within a fence of the lighting device identified by the lighting device identifier in the most recently received broadcast message if the electronic device changes from a mobile state to a stationary state.
[0297] In an embodiment of the present application, when an electronic device is located near a lighting device, the application interface of a designated application in the electronic device can be automatically displayed to prevent the user from being disturbed by other applications. Furthermore, when the designated application is running, the lighting device can be automatically controlled to be in a second lighting mode when it is turned on, so as to reduce the screen reflection of the electronic device and make the light balanced, thereby effectively protecting the eyes and improving the browsing experience of the screen content. When the designated application is running, when the lighting device is turned off, the lighting device can be automatically controlled to be turned on and controlled to be in the second lighting mode when the ambient light brightness is low. In this way, the screen reflection of the electronic device can be reduced while supplementing the required light, making the light balanced, thereby effectively protecting the eyes and improving the browsing experience of the screen content.
[0298] It should be noted that: when the device control device provided in the above embodiment controls the lighting equipment, the division of the above-mentioned functional modules is only used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0299] The functional units and modules in the above embodiments may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The above integrated units may be implemented in the form of hardware or software functional units. In addition, the specific names of the functional units and modules are only for the purpose of distinguishing them from each other and are not intended to limit the scope of protection of the embodiments of this application.
[0300] The device control apparatus and device control method embodiments provided in the above embodiments belong to the same concept. The specific working processes and technical effects brought about by the units and modules in the above embodiments can be found in the method embodiment part and will not be repeated here.
[0301] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (such as a coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0302] The above are optional embodiments provided for this application and are not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the technical scope disclosed in this application should be included in the scope of protection of this application.
Claims
1. A device control method, characterized in that: The method comprises: In response to an electronic device in an unlocked state entering the fence of the lighting device from outside, or in response to the electronic device located within the fence of the lighting device changing from a locked state to an unlocked state, the electronic device displays an application interface of a specified application and obtains the current state of the lighting device; When the lighting device is turned on and in a first lighting mode, the electronic device controls the lighting device to switch from the first lighting mode to a second lighting mode matching the designated application; The first lighting mode and the second lighting mode have different lighting brightness distributions.
2. The method according to claim 1, wherein In the second lighting mode, the brightness of a central position of the lighting area of the lighting device is lower than the brightness of other positions.
3. The method according to claim 1 or 2, wherein: The electronic device displays an application interface of a specified application, including: If the designated application is not started, the electronic device starts the designated application to display an application interface of the designated application.
4. The method according to claim 1 or 2, wherein: The electronic device displays an application interface of a specified application, including: If the designated application has been started and is in a background running state, the electronic device switches the designated application to a foreground running state to display an application interface of the designated application.
5. The method according to any one of claims 1 to 4, characterized in that: After the electronic device displays the application interface of the designated application and obtains the current state of the lighting device, the electronic device further includes: When the lighting device is turned off, the electronic device detects the brightness of the ambient light; If the detected ambient light brightness is less than or equal to a preset brightness, the electronic device controls the lighting device to turn on and controls the lighting device to be in the second lighting mode.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The electronic device detects the ambient light brightness during the process of running the designated application; If the detected ambient light brightness is less than or equal to the preset brightness, the electronic device will display a reminder message when it is determined that the electronic device is not located within the fence of the lighting device, and the reminder message is used to remind the user to move to the lighting device.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The electronic device receives a broadcast message, where the broadcast message carries a lighting device identifier; In response to the electronic device located within the fence of the lighting device changing from a locked state to an unlocked state, the electronic device displays an application interface of a specified application and obtains the current state of the lighting device, including: If the electronic device changes from a locked state to an unlocked state, the electronic device detects whether the electronic device is located within a fence of a lighting device identified by a lighting device identifier in the most recently received broadcast message; If the electronic device is located within the fence of the lighting device identified by the lighting device identifier in the most recently received broadcast message, the electronic device displays the application interface of the designated application and obtains the current status of the lighting device.
8. The method according to claim 7, wherein The method further comprises: If the electronic device changes from a mobile state to a stationary state, the electronic device detects whether the electronic device is located within the fence of the lighting device identified by the lighting device identifier in the most recently received broadcast message.
9. A computer device, characterized in that: The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method according to any one of claims 1 to 8 when executed by the processor.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 8.