CN111506352B - Method and device for judging closing of notebook computer, computer and storage medium - Google Patents

Method and device for judging closing of notebook computer, computer and storage medium Download PDF

Info

Publication number
CN111506352B
CN111506352B CN202010303736.1A CN202010303736A CN111506352B CN 111506352 B CN111506352 B CN 111506352B CN 202010303736 A CN202010303736 A CN 202010303736A CN 111506352 B CN111506352 B CN 111506352B
Authority
CN
China
Prior art keywords
notebook computer
image
threshold value
light intensity
smaller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010303736.1A
Other languages
Chinese (zh)
Other versions
CN111506352A (en
Inventor
陈庆甲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Wingtech Information Technology Co Ltd
Original Assignee
Shanghai Wingtech Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Wingtech Information Technology Co Ltd filed Critical Shanghai Wingtech Information Technology Co Ltd
Priority to CN202010303736.1A priority Critical patent/CN111506352B/en
Publication of CN111506352A publication Critical patent/CN111506352A/en
Application granted granted Critical
Publication of CN111506352B publication Critical patent/CN111506352B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/002Specific input/output arrangements not covered by G06F3/01 - G06F3/16
    • G06F3/005Input arrangements through a video camera
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/0304Detection arrangements using opto-electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/442Shutdown

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • User Interface Of Digital Computer (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention discloses a method and a device for judging the closing of a cover of a notebook computer, a computer and a storage medium. The judging method for the closing cover of the notebook computer comprises the following steps: when the light sensor of the notebook computer detects that the ambient light intensity is smaller than a first threshold value, controlling the camera of the notebook computer to shoot a first image; judging whether the first image is matched with a preset image or not; and if the first image is matched with the preset image, judging that the notebook computer is in a closed cover state. The embodiment of the invention realizes accurate judgment of the closing cover of the notebook computer, saves the space of the notebook computer and reduces the cost of the notebook computer.

Description

Method and device for judging closing of notebook computer, computer and storage medium
Technical Field
The embodiment of the invention relates to a computer technology, in particular to a method and a device for judging the closing of a notebook computer, a computer and a storage medium.
Background
Along with the increasing popularity of notebook computers, the convenience and the electricity saving performance of the notebook computers are paid attention to by the majority of users, and especially, the application scenes of locking screens, sleeping, shutting down and the like of the computers are very common due to the fact that the users use the midway covers.
The main implementation method of closing the cover to enable the computer to enter the screen locking, sleeping, shutdown and other states is that a magnet and a magnetic switch which are precisely matched are respectively arranged on an upper cover and a base of the notebook computer, when the magnetic switch detects that the magnetic flux is greater than a certain threshold value according to the Hall effect principle, the notebook computer is judged to be in the cover closing state, and then an operating system is informed to enter the screen locking, sleeping, shutdown and other states.
However, if there is a foreign magnet near the magnetic switch, this may result in misjudgment as closing the cover, resulting in unexpected screen locking, sleeping and shutdown, and the magnetic flux threshold range of the magnetic switch is wider, resulting in larger angle deviation of judging the closing of the upper cover, which affects the normal use and experience of the user.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a computer and a storage medium for judging the closing of a notebook computer so as to accurately judge the closing of the notebook computer.
To achieve the object, an embodiment of the present invention provides a method for determining a closing cover of a notebook computer, where the method includes:
when the light sensor of the notebook computer detects that the ambient light intensity is smaller than a first threshold value, controlling the camera of the notebook computer to shoot a first image;
judging whether the first image is matched with a preset image or not;
and if the first image is matched with the preset image, the notebook computer is in a closed cover state.
Further, when the light sensor of the notebook computer detects that the ambient light intensity is less than the first threshold, controlling the camera of the notebook computer to capture the first image includes:
and when the light sensor of the notebook computer detects that the ambient light intensity is smaller than a first threshold value and/or when the infrared distance sensor of the notebook computer detects that the distance between the display screen and the keyboard surface of the notebook computer is smaller than a second threshold value, controlling the camera of the notebook computer to shoot a first image.
Further, after the notebook computer is judged to be in the closed state, the method includes:
acquiring the time when the ambient light intensity detected by the light sensor is smaller than the first threshold value;
judging whether the time when the ambient light intensity detected by the light sensor is smaller than the first threshold value is longer than a first preset time or not;
if the time that the ambient light intensity detected by the light sensor is smaller than the first threshold value is longer than the first preset time, controlling the notebook computer to enter a dormant state;
if the time that the ambient light intensity detected by the light sensor is smaller than the first threshold value is not longer than the first preset time, judging whether the ambient light intensity detected by the light sensor is smaller than the first threshold value in the second preset time;
if the ambient light intensity detected by the light sensor is smaller than the first threshold value within the second preset time, controlling a camera of the notebook computer to shoot a second image, and judging whether the second image is consistent with the preset image;
and if the second image is matched with the preset image, controlling the notebook computer to enter a shutdown process.
Further, the controlling the notebook computer to enter a shutdown process includes:
controlling the notebook computer to pop up a first window for a user to select whether to turn off;
and receiving a first operation instruction of a user to control the notebook computer to be powered off, or receiving a second operation instruction of the user to control the notebook computer not to be powered off and close the first window.
Further, the first operation instruction includes not performing any operation within a third preset time, clicking a left mouse button of the notebook computer, clicking a first key of the notebook computer and clicking a first option in the first window through a mouse, and the second operation instruction includes clicking a right mouse button of the notebook computer, clicking a second key of the notebook computer and clicking a second option in the first window through the mouse.
Further, the first image is a two-dimensional code or a bar code.
Further, the shooting angle of the camera of the notebook computer can be adjusted.
In one aspect, an embodiment of the present invention further provides a device for determining a cover closing of a notebook computer, where the device includes:
the detection judging module is used for detecting the ambient light intensity around the notebook computer and judging whether the ambient light intensity is smaller than a first threshold value or not;
the shooting control module is used for controlling a camera of the notebook computer to shoot a first image when the environmental light intensity is smaller than the first threshold value;
the image judging module is used for judging whether the first image is matched with a preset image or not;
and the state judging module is used for judging that the notebook computer is in a closed state when the first image is matched with the preset image.
On the other hand, the embodiment of the invention also provides a notebook computer, which comprises: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the judging method provided by any embodiment of the invention.
In yet another aspect, an embodiment of the present invention further provides a computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a determination method as provided in any embodiment of the present invention.
According to the embodiment of the invention, when the light sensor of the notebook computer detects that the ambient light intensity is smaller than the first threshold value, the camera of the notebook computer is controlled to shoot a first image; judging whether the first image is matched with a preset image or not; if the cover is closed, the problem that the magnet and the magnetic switch are used for judging that the cover is easy to misjudge and the deviation of the cover closing angle is large is solved, and the effects of accurately judging the cover closing of the notebook computer, saving the space of the notebook computer and reducing the cost of the notebook computer are achieved.
Drawings
Fig. 1 is a flowchart of a method for determining whether a notebook computer is closed according to an embodiment of the present invention;
fig. 2 is a flow chart of a method for judging whether a notebook computer is covered according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device for determining whether a notebook computer is closed according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a notebook computer according to a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are for purposes of illustration and not of limitation. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts steps as a sequential process, many of the steps may be implemented in parallel, concurrently, or with other steps. Furthermore, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Furthermore, the terms "first," "second," and the like, may be used herein to describe various directions, acts, steps, or elements, etc., but these directions, acts, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. For example, a first module may be referred to as a second module, and similarly, a second module may be referred to as a first module, without departing from the scope of the present application. Both the first module and the second module are modules, but they are not the same module. The terms "first," "second," and the like, are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more of the described features. In the description of the embodiments of the present invention, the meaning of "plurality" is at least two, for example, two, three, etc., unless explicitly defined otherwise.
Example 1
As shown in fig. 1, a first embodiment of the present invention provides a method for determining a cover closing of a notebook computer, where the method includes:
s110, when the light sensor of the notebook computer detects that the ambient light intensity is smaller than a first threshold value, controlling the camera of the notebook computer to shoot a first image.
In this embodiment, the light sensor and the camera of the notebook computer may be disposed adjacently above the display screen of the notebook computer, the first image may be disposed on the keyboard surface of the notebook computer, and when the notebook computer is closed, the positions of the first image and the camera just overlap and correspond, and the first image may be a two-dimensional code, a bar code or any other image.
S120, judging whether the first image is matched with a preset image.
S130, if the first image is matched with the preset image, the notebook computer is in a closed state.
In this embodiment, after the camera of the notebook captures the first image, a similarity determination algorithm may be performed on the first image and a preset image by using a processing unit of the notebook computer, where the similarity determination algorithm may be a SIFT-invariant feature transform (Scale-invariant feature transform) algorithm, an SSIM (structural similarity index, structural similarity) algorithm, etc., which is not limited in this embodiment of the present invention, if the similarity between the first image and the preset image is greater than a third threshold, it is determined that the first image matches the preset image, and it is determined that the current state of the notebook computer is a closed state. In addition, by shooting the first image and judging whether the first image is matched with the preset image or not, even when the environmental light intensity changes, the notebook computer cannot judge that the notebook computer is in a closed cover state because the first image matched with the preset image is not shot, and the accuracy of closed cover judgment is further improved.
According to the embodiment of the invention, when the light sensor of the notebook computer detects that the ambient light intensity is smaller than the first threshold value, the camera of the notebook computer is controlled to shoot a first image; judging whether the first image is consistent with a preset image or not; if the first image is matched with the preset image, the notebook computer is judged to be in a closed state, so that the problems that misjudgment is easy to occur when the magnet and the magnetic switch are used for judging the closed state and the deviation of the closed angle is large are solved, the accurate judgment of the closed state of the notebook computer is realized, the space of the notebook computer is saved, and the cost of the notebook computer is reduced.
Example two
As shown in fig. 2, a second embodiment of the present invention provides a method for determining a cover closing of a notebook computer, which is further optimized based on the first embodiment of the present invention, and the method includes:
and S210, controlling a camera of the notebook computer to shoot a first image when the light sensor of the notebook computer detects that the ambient light intensity is smaller than a first threshold value and/or when the infrared distance sensor of the notebook computer detects that the distance between a display screen and a keyboard surface of the notebook computer is smaller than a second threshold value.
S220, judging whether the first image is matched with the preset image or not.
S230, if the first image is matched with the preset image, the notebook computer is in a closed state.
In this embodiment, the light sensor may be replaced by an infrared distance sensor, and when the infrared distance sensor of the notebook computer detects that the distance between the display screen and the keyboard surface of the notebook computer is smaller than the second threshold, the camera of the notebook computer is controlled to capture the first image. In addition, an infrared distance sensor can be added on the basis of the light sensor, and when the light sensor of the notebook computer detects that the ambient light intensity is smaller than a first threshold value and the infrared distance sensor detects that the distance between a display screen and a keyboard surface of the notebook computer is smaller than a second threshold value, a camera of the notebook computer is controlled to shoot a first image so as to assist in detecting the closing state of the notebook computer and accurately control the time point of shooting by the camera.
S240, acquiring time when the ambient light intensity detected by the light sensor is smaller than a first threshold value.
S250, judging whether the time when the ambient light intensity detected by the light sensor is smaller than a first threshold value is longer than a first preset time.
In this embodiment, after the notebook computer is determined to be in the closed state, whether the time when the ambient light intensity detected by the light sensor is less than the first threshold is greater than a first preset time or not may be further determined, that is, whether the notebook computer is turned on again within the first preset time is determined, and optionally, the first preset time is 5 seconds. If the time when the ambient light intensity detected by the light sensor is less than the first threshold is greater than the first preset time, step S260 is executed, and if the time when the ambient light intensity detected by the light sensor is less than the first threshold is not greater than the first preset time, step S270 is executed.
S260, controlling the notebook computer to enter a dormant state.
If the time that the light intensity of the environment detected by the light sensor is smaller than the first threshold value is longer than the first preset time, namely within 5 seconds, the notebook computer is not opened again, which means that the user does not use the notebook computer temporarily, the notebook computer can be controlled to enter a sleep state to ensure the cruising duration. The method ends until the user reuses the notebook computer.
S270, judging whether the light sensor detects that the ambient light intensity is smaller than a first threshold value in a second preset time.
And S271, if the ambient light intensity detected by the light sensor is smaller than a first threshold value within a second preset time, controlling a camera of the notebook computer to shoot a second image, and judging whether the second image is consistent with the preset image.
And S272, if the second image is matched with the preset image, controlling the notebook computer to pop up the first window for the user to select whether to shut down or not.
S273, receiving a first operation instruction of the user to control the notebook computer to be powered off, or receiving a second operation instruction of the user to control the notebook computer not to be powered off and close the first window.
In this embodiment, if the time that the light sensor detects that the ambient light intensity is less than the first threshold is less than the first preset time, that is, within 5 seconds, the notebook computer is turned on again, which indicates that the user may want to continue to use the notebook computer or want to perform other operations, for example, the shutdown operations in steps S271-S273, then it is determined whether the light sensor detects that the ambient light intensity is less than the first threshold in the second preset time, that is, it is determined whether the user wants to perform the secondary closing operation to start executing the shutdown operation.
If the light sensor detects that the ambient light intensity is not less than the first threshold value within the second preset time, it is indicated that the user may want to continue to use the notebook computer, and if the light sensor detects that the ambient light intensity is less than the first threshold value within the second preset time, the steps S210-S230 are repeatedly executed. If the second image shot for the second time is not matched with the preset image, the user is possibly misoperation, no action is executed, if the second image shot for the second time is still matched with the preset image, the notebook computer is controlled to pop up a first window for the user to select whether to shutdown or not, the first operation instruction of the user is received to control the notebook computer to shutdown, or the second operation instruction of the user is received to control the notebook computer to not shutdown and to close the first window.
The first window may display text content of "whether to confirm shutdown", the first operation instruction includes not performing any operation within a third preset time, clicking a left mouse button of the notebook computer, clicking a first key of the notebook computer, and clicking a first option in the first window through the mouse, the third preset time may be 3 seconds, the first key may be a "SPACE" key or an "ENTER" key on the notebook computer, and the first option may be a "yes" option in the first window. The second operation instruction includes clicking a right mouse button of the notebook computer, clicking a second key of the notebook computer, and clicking a second option in the first window through the mouse, wherein the second key may be an "ESC" key on the notebook computer, and the second option may be a "NO" option in the first window.
It should be further noted that, the shooting angle of the camera can be adjusted, optionally, when the angle of closing the display screen and the keyboard surface of the notebook computer is smaller than 45 degrees, the camera can shoot the first image which can be matched with the preset image, and at the moment, the user can easily observe the content of the first window and perform corresponding operation on the notebook computer. Preferably, the first preset time, the second preset time and the first threshold value can all enable the user to modify the first preset time, the second preset time and the first threshold value in the notebook computer according to own preference.
For example, if the user wants to quickly shut down, the user only needs to close the notebook computer to 45 degrees, then re-open the notebook computer within a first preset time, and finally completely close the notebook computer within a second preset time, and the notebook computer will automatically shut down within a third preset time.
According to the embodiment of the invention, the time when the ambient light intensity detected by the light sensor is smaller than the first threshold value is acquired; judging whether the time when the ambient light intensity detected by the light sensor is smaller than the first threshold value is longer than a first preset time or not; if the time that the ambient light intensity detected by the light sensor is smaller than the first threshold value is longer than the first preset time, controlling the notebook computer to enter a dormant state; if the time that the ambient light intensity detected by the light sensor is smaller than the first threshold value is not longer than the first preset time, judging whether the ambient light intensity detected by the light sensor is smaller than the first threshold value in the second preset time; if the ambient light intensity detected by the light sensor is smaller than the first threshold value within the second preset time, controlling a camera of the notebook computer to shoot a second image, and judging whether the second image is consistent with the preset image; if the second image is matched with the preset image, the notebook computer is controlled to enter a shutdown process, the problem that the control is not intelligent enough after the notebook computer is closed is solved, and the effect of intelligently controlling the notebook computer after the notebook computer is closed is achieved.
Example III
As shown in fig. 3, a third embodiment of the present invention provides a device 100 for determining whether a cover of a notebook computer is closed, where the device 100 for determining whether a cover of a notebook computer is closed provided in the third embodiment of the present invention can execute the method for determining whether a cover of a notebook computer is closed provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. The judging device 100 includes a detection judging module 200, a photographing control module 300, an image judging module 400, and a status judging module 500.
Specifically, the detection and judgment module 200 is configured to detect an environmental light intensity around the notebook computer, and judge whether the environmental light intensity is less than a first threshold; the shooting control module 300 is used for controlling a camera of the notebook computer to shoot a first image when the environmental light intensity is smaller than a first threshold value; the image judging module 400 is configured to judge whether the first image matches with a preset image; the state judging module 500 is configured to judge that the notebook computer is in a closed state when the first image matches with the preset image.
In this embodiment, the detection and judgment module 200 is further configured to detect an environmental light intensity around the notebook computer, and judge whether the environmental light intensity is less than a first threshold value and/or a distance between a display screen and a keyboard surface of the notebook computer, and judge whether the environmental light intensity is less than the first threshold value and/or judge whether a distance between the display screen and the keyboard surface of the notebook computer is less than a second threshold value. The shooting control module 300 is configured to control a camera of the notebook computer to shoot a first image when the environmental light intensity is less than a first threshold value and/or when the infrared distance sensor of the notebook computer detects that the distance between the display screen and the keyboard surface of the notebook computer is less than a second threshold value. Preferably, the first image is a two-dimensional code or a bar code. The shooting angle of the camera of the notebook computer can be adjusted.
Further, the judging device 100 further includes a secondary judging module 600, where the secondary judging module 600 is configured to obtain a time when the ambient light intensity detected by the light sensor is less than a first threshold; judging whether the time when the ambient light intensity detected by the light sensor is smaller than a first threshold value is longer than a first preset time or not; if the time that the ambient light intensity detected by the light sensor is smaller than the first threshold value is longer than the first preset time, controlling the notebook computer to enter a dormant state; if the time that the ambient light intensity detected by the light sensor is smaller than the first threshold value is not longer than the first preset time, judging whether the ambient light intensity detected by the light sensor is smaller than the first threshold value in the second preset time; if the ambient light intensity detected by the light sensor is smaller than a first threshold value in a second preset time, controlling a camera of the notebook computer to shoot a second image, and judging whether the second image is consistent with the preset image or not; and if the second image is matched with the preset image, controlling the notebook computer to enter a shutdown process.
The secondary judging module 600 is specifically further configured to control the notebook computer to pop up the first window for the user to select whether to shut down; and receiving a first operation instruction of a user to control the notebook computer to be powered off, or receiving a second operation instruction of the user to control the notebook computer not to be powered off and close the first window. The first operation instruction comprises not performing any operation in a third preset time, clicking a left mouse button of the notebook computer, clicking a first key of the notebook computer and clicking a first option in the first window through the mouse, and the second operation instruction comprises clicking a right mouse button of the notebook computer, clicking a second key of the notebook computer and clicking a second option in the first window through the mouse.
The detection and judgment module 200 is used for detecting the ambient light intensity around the notebook computer and judging whether the ambient light intensity is smaller than a first threshold value; the shooting control module 300 is used for controlling a camera of the notebook computer to shoot a first image when the environmental light intensity is smaller than a first threshold value; the image judging module 400 is configured to judge whether the first image matches with a preset image; the state judging module 500 is used for judging that the notebook computer is in a closed state when the first image is matched with the preset image, so that the problems that misjudgment is easy to occur when the cover is closed and the deviation of the angle of the cover is large when the cover is judged by using the magnet and the magnetic switch are solved, the accurate cover closing judgment of the notebook computer is realized, the space of the notebook computer is saved, and the cost of the notebook computer is reduced.
Example IV
Fig. 4 is a schematic structural diagram of a notebook computer according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary notebook computer 12 suitable for use in implementing embodiments of the present invention. The notebook computer 12 shown in fig. 4 is merely an example, and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
As shown in FIG. 4, the notebook computer 12 is in the form of a general purpose computing device. Components of notebook computer 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Notebook computer 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by notebook computer 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The notebook computer 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard disk drive"). Although not shown in fig. 4, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The notebook computer 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the notebook computer 12, and/or any devices (e.g., network card, modem, etc.) that enable the notebook computer 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Moreover, the notebook computer 12 may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the notebook computer 12 via the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with the notebook computer 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing the judgment method provided by the embodiment of the present invention:
when the light sensor of the notebook computer detects that the ambient light intensity is smaller than a first threshold value, controlling a camera of the notebook computer to shoot a first image;
judging whether the first image is consistent with a preset image or not;
if the first image is matched with the preset image, the notebook computer is in a closed cover state.
According to the embodiment of the invention, when the light sensor of the notebook computer detects that the ambient light intensity is smaller than the first threshold value, the camera of the notebook computer is controlled to shoot a first image; judging whether the first image is consistent with a preset image or not; if the first image is matched with the preset image, the notebook computer is judged to be in a closed state, so that the problems that misjudgment is easy to occur when the magnet and the magnetic switch are used for judging the closed state and the deviation of the closed angle is large are solved, the accurate judgment of the closed state of the notebook computer is realized, the space of the notebook computer is saved, and the cost of the notebook computer is reduced.
Example five
The fifth embodiment of the present invention further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the judging method as provided in all the embodiments of the present invention:
when the light sensor of the notebook computer detects that the ambient light intensity is smaller than a first threshold value, controlling a camera of the notebook computer to shoot a first image;
judging whether the first image is consistent with a preset image or not;
if the first image is matched with the preset image, the notebook computer is in a closed cover state.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
According to the embodiment of the invention, when the light sensor of the notebook computer detects that the ambient light intensity is smaller than the first threshold value, the camera of the notebook computer is controlled to shoot a first image; judging whether the first image is consistent with a preset image or not; if the first image is matched with the preset image, the notebook computer is judged to be in a closed state, so that the problems that misjudgment is easy to occur when the magnet and the magnetic switch are used for judging the closed state and the deviation of the closed angle is large are solved, the accurate judgment of the closed state of the notebook computer is realized, the space of the notebook computer is saved, and the cost of the notebook computer is reduced.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the invention, the scope of which is determined by the scope of the appended claims.

Claims (9)

1. A method for judging the closing of a notebook computer is characterized by comprising the following steps:
when the light sensor of the notebook computer detects that the ambient light intensity is smaller than a first threshold value, controlling the camera of the notebook computer to shoot a first image;
judging whether the first image is matched with a preset image or not;
if the first image is matched with the preset image, the notebook computer is in a cover closing state;
after judging that the notebook computer is in a closed state, the method comprises the following steps:
acquiring the time when the ambient light intensity detected by the light sensor is smaller than the first threshold value;
judging whether the time when the ambient light intensity detected by the light sensor is smaller than the first threshold value is longer than a first preset time or not;
if the time that the ambient light intensity detected by the light sensor is smaller than the first threshold value is longer than the first preset time, controlling the notebook computer to enter a dormant state;
if the time that the ambient light intensity detected by the light sensor is smaller than the first threshold value is not longer than the first preset time, judging whether the ambient light intensity detected by the light sensor is smaller than the first threshold value in the second preset time;
if the ambient light intensity detected by the light sensor is smaller than the first threshold value within the second preset time, controlling a camera of the notebook computer to shoot a second image, and judging whether the second image is consistent with the preset image;
and if the second image is matched with the preset image, controlling the notebook computer to enter a shutdown process.
2. The method according to claim 1, wherein when the light sensor of the notebook computer detects that the ambient light intensity is less than the first threshold value, controlling the camera of the notebook computer to capture the first image comprises:
and when the light sensor of the notebook computer detects that the ambient light intensity is smaller than a first threshold value and/or when the infrared distance sensor of the notebook computer detects that the distance between the display screen and the keyboard surface of the notebook computer is smaller than a second threshold value, controlling the camera of the notebook computer to shoot a first image.
3. The method according to claim 1, wherein controlling the notebook computer to enter a shutdown process comprises:
controlling the notebook computer to pop up a first window for a user to select whether to turn off;
and receiving a first operation instruction of a user to control the notebook computer to be powered off, or receiving a second operation instruction of the user to control the notebook computer not to be powered off and close the first window.
4. The method according to claim 3, wherein the first operation instruction includes not performing any operation within a third preset time, clicking a left mouse button of the notebook computer, clicking a first button of the notebook computer, and clicking a first option in the first window through a mouse, and the second operation instruction includes clicking a right mouse button of the notebook computer, clicking a second button of the notebook computer, and clicking a second option in the first window through a mouse.
5. The method according to claim 1, wherein the first image is a two-dimensional code or a bar code.
6. The method according to claim 1, wherein a shooting angle of a camera of the notebook computer is adjustable.
7. The device for judging the closing of the notebook computer is characterized by comprising the following components:
the detection judging module is used for detecting the ambient light intensity around the notebook computer and judging whether the ambient light intensity is smaller than a first threshold value or not;
the shooting control module is used for controlling a camera of the notebook computer to shoot a first image when the environmental light intensity is smaller than the first threshold value;
the image judging module is used for judging whether the first image is matched with a preset image or not;
the state judging module is used for judging that the notebook computer is in a closed state when the first image is matched with a preset image;
the judging device for the closing cover of the notebook computer further comprises a secondary judging module;
the secondary judging module is used for:
acquiring the time when the ambient light intensity detected by the light sensor is smaller than the first threshold value;
judging whether the time when the ambient light intensity detected by the light sensor is smaller than the first threshold value is longer than a first preset time or not;
if the time that the ambient light intensity detected by the light sensor is smaller than the first threshold value is longer than the first preset time, controlling the notebook computer to enter a dormant state;
if the time that the ambient light intensity detected by the light sensor is smaller than the first threshold value is not longer than the first preset time, judging whether the ambient light intensity detected by the light sensor is smaller than the first threshold value in the second preset time;
if the ambient light intensity detected by the light sensor is smaller than the first threshold value within the second preset time, controlling a camera of the notebook computer to shoot a second image, and judging whether the second image is consistent with the preset image;
and if the second image is matched with the preset image, controlling the notebook computer to enter a shutdown process.
8. A notebook computer, the notebook computer comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of determining as recited in any one of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the judgment method according to any one of claims 1-6.
CN202010303736.1A 2020-04-17 2020-04-17 Method and device for judging closing of notebook computer, computer and storage medium Active CN111506352B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010303736.1A CN111506352B (en) 2020-04-17 2020-04-17 Method and device for judging closing of notebook computer, computer and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010303736.1A CN111506352B (en) 2020-04-17 2020-04-17 Method and device for judging closing of notebook computer, computer and storage medium

Publications (2)

Publication Number Publication Date
CN111506352A CN111506352A (en) 2020-08-07
CN111506352B true CN111506352B (en) 2024-01-26

Family

ID=71876183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010303736.1A Active CN111506352B (en) 2020-04-17 2020-04-17 Method and device for judging closing of notebook computer, computer and storage medium

Country Status (1)

Country Link
CN (1) CN111506352B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105844182A (en) * 2016-03-16 2016-08-10 合肥联宝信息技术有限公司 Screen locking method and device of notebook computer and the notebook computer
CN206584252U (en) * 2016-08-23 2017-10-24 合肥联宝信息技术有限公司 Notebook computer

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI446131B (en) * 2011-05-04 2014-07-21 Univ Nat Cheng Kung Brightness adjusting method and system with photographic device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105844182A (en) * 2016-03-16 2016-08-10 合肥联宝信息技术有限公司 Screen locking method and device of notebook computer and the notebook computer
CN206584252U (en) * 2016-08-23 2017-10-24 合肥联宝信息技术有限公司 Notebook computer

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
笔记本电脑外设总动员;电脑数码采购周刊(06);全文 *

Also Published As

Publication number Publication date
CN111506352A (en) 2020-08-07

Similar Documents

Publication Publication Date Title
CN109240576B (en) Image processing method and device in game, electronic device and storage medium
US9921744B2 (en) Text input method in touch screen terminal and apparatus therefor
US20170185461A1 (en) Fast switching method, device and terminal of dual system
US20150277571A1 (en) User interface to capture a partial screen display responsive to a user gesture
US20110219340A1 (en) System and method for point, select and transfer hand gesture based user interface
US20120154307A1 (en) Image display control apparatus and image display control method
EP2984542B1 (en) Portable device using passive sensor for initiating touchless gesture control
US9152316B2 (en) Electronic device, controlling method thereof, and non-transitory storage medium
US20130154947A1 (en) Determining a preferred screen orientation based on known hand positions
US10055813B2 (en) Electronic device and operation method thereof
CN103165069A (en) Display control device and control method for display control device
CN110062287B (en) Target object control method and device, storage medium and electronic equipment
US20140152583A1 (en) Optimistic placement of user interface elements on a touch screen
US20210250516A1 (en) Lens cover-based image capture device operation
CN110471610A (en) Terminal control method, device, terminal and storage medium
US20160048665A1 (en) Unlocking an electronic device
US20140380032A1 (en) Electronic device, method for controlling electronic device, and program
US10740874B2 (en) Apparatus, method and computer program product for oriented input operations
US20160291702A1 (en) Auxiliary input device of electronic device and method of executing function thereof
CN109857298B (en) Application starting method, device, equipment and storage medium
CN111506352B (en) Method and device for judging closing of notebook computer, computer and storage medium
CN111045776B (en) Display switching method and device, folding terminal and storage medium
CN110248023B (en) Intelligent terminal control method, device, equipment and medium
CN110636222B (en) Photographing control method and device, terminal equipment and storage medium
CN109510896B (en) Proximity sensor selection method and device, storage medium and electronic device

Legal Events

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