Electronic device and method for controlling the electronic device
A method for adjusting a working state of an electronic device includes setting a reasonable value range of feature data of a user, and acquiring current feature data of the user from the camera device. The current feature data is compared to the reasonable value range of feature data. A working state of the electronic device is changed when the current feature data is out of the reasonable value range of feature data.
1. An electronic device comprising:
a camera device;
at least one processor coupled to the camera device;
a display device coupled to the at least one processor; and
a storage device storing one or more programs, executable by the at least one processor, to cause the at least one processor to:
set a reasonable value range of feature data of a user;
acquire current feature data of the user from the camera device;
determine whether the current feature data is within the reasonable value range; and
change a working state of the electronic device when the current feature data is out of the reasonable value range;
wherein the feature data includes pixel values of pixel points of an image of the user, a first distance from a head of the user to ground, a second distance between the camera device and the user when the user is using the electronic device.
2. The electronic device according to claim 1 , wherein the reasonable value range of feature data is set by:
recording a video of the user for a predetermined time duration by the camera device after the electronic device is activated;
acquiring the first distance, and the second distance from the camera device every second;
calculating a pixel value, an average first distance, and an average second distance; and
setting the reasonable value range of the pixel value, the first distance, and the second distance.
3. The electronic device according to claim 1 , wherein the current feature data is determined by comparing the current feature data with the reasonable value range of feature data.
4. The electronic device according to claim 1 , wherein the working state of the electronic device is changed by:
stopping or reducing an execution speed of the electronic device.