CN111064845A - State detection method and device, electronic equipment and storage medium - Google Patents

State detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111064845A
CN111064845A CN201911275535.9A CN201911275535A CN111064845A CN 111064845 A CN111064845 A CN 111064845A CN 201911275535 A CN201911275535 A CN 201911275535A CN 111064845 A CN111064845 A CN 111064845A
Authority
CN
China
Prior art keywords
acceleration
current
acceleration process
electronic equipment
previous
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.)
Granted
Application number
CN201911275535.9A
Other languages
Chinese (zh)
Other versions
CN111064845B (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201911275535.9A priority Critical patent/CN111064845B/en
Publication of CN111064845A publication Critical patent/CN111064845A/en
Application granted granted Critical
Publication of CN111064845B publication Critical patent/CN111064845B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions

Landscapes

  • Engineering & Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a state detection method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring the acceleration direction of the current acceleration process of the electronic equipment; judging whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process; and if the acceleration direction of the current acceleration process is different from the acceleration direction of the previous acceleration process, determining the running direction of the electronic equipment according to the acceleration direction of the current acceleration process and the acceleration direction of the previous acceleration process. This application is through obtaining the acceleration direction of electronic equipment at the current acceleration process, compares with the acceleration direction of the acceleration process of the previous time the acceleration direction of the current acceleration process is inequality with the acceleration direction of the acceleration process of the previous time, through comparing with the acceleration process of the previous time, can get rid of the situation of the judgement mistake that the judgement of the single acceleration process probably appears, and then carries out accurate definite to the traffic direction of electronic equipment.

Description

State detection method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of electronic device control technologies, and in particular, to a state detection method and apparatus, an electronic device, and a storage medium.
Background
Along with the popularization of intelligent equipment, intelligent electronic equipment has become a necessary article for daily life, when the intelligent electronic equipment enters various environments along with a user, for example, when the intelligent electronic equipment enters environments such as an elevator, a basement and the like, corresponding signal intensity and the like can be changed, in order to carry out corresponding control operation according to the change of the parameters, the state of the electronic equipment needs to be accurately determined, and the state detection of the existing electronic equipment is not accurate enough.
Disclosure of Invention
An object of the present application is to provide a state detection method, device, electronic device and storage medium to improve the above technical problems.
In a first aspect, an embodiment of the present application provides a state detection method, which is applied to an electronic device, and the method includes: acquiring the acceleration direction of the current acceleration process of the electronic equipment; judging whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process; and if the acceleration direction of the current acceleration process is different from the acceleration direction of the previous acceleration process, determining the running direction of the electronic equipment according to the acceleration direction of the current acceleration process and the acceleration direction of the previous acceleration process.
In a second aspect, an embodiment of the present application provides a state detection apparatus, which is applied to an electronic device, and includes an acquisition module, a determination module, and a state determination module, where the acquisition module is configured to acquire an acceleration direction of a current acceleration process of the electronic device, the determination module is configured to determine whether the acceleration direction of the current acceleration process is the same as an acceleration direction of a previous acceleration process, and the state determination module is configured to determine whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, where the memory is coupled with the processor; the memory stores instructions that, when executed by the processor, cause the processor to perform the state detection method described above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium. The computer readable storage medium has program code stored therein, which can be invoked by a processor to perform the above-described state detection method.
The application provides a state detection method, a state detection device, an electronic device and a storage medium, through obtaining the acceleration direction of the electronic device in the current acceleration process, compare with the acceleration direction of the previous acceleration process and judge that the acceleration direction of the current acceleration process is different from the acceleration direction of the previous acceleration process, through comparing with the previous acceleration process, the situation of judgment error that the judgment of the single acceleration process may appear can be got rid of, and then the running direction of the electronic device is accurately determined.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic view of an electronic device shown in the present application;
FIG. 2 is a flow chart of a method for detecting status according to an embodiment of the present application;
FIG. 3 is a flow chart of yet another status detection method provided by an embodiment of the present application;
FIG. 4 is a flow chart of yet another status detection method provided by an embodiment of the present application;
fig. 5 is a block diagram of a state detection apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of an acquisition module according to an embodiment of the present application;
FIG. 7 is a block diagram of a state determination module according to an embodiment of the present application;
FIG. 8 is a block diagram of an electronic device provided by an embodiment of the present application;
fig. 9 is a block diagram of a storage medium according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As shown in fig. 1, a current electronic device 100 includes a housing and a display 101, wherein the display 101 is mounted on the housing and is used for human-computer interaction and display. The display Screen 101 may be, for example, a Touch Screen (Touch Screen), which is an inductive display device capable of receiving input signals such as a Touch, the display Screen 101 is mounted on the housing and can be used for a user to perform a Touch operation, and the display Screen 101 may be a foldable display Screen or a non-foldable display Screen. In some embodiments, the electronic device may include one or more display screens 101, in which case the display screen 101 may include at least one touch screen, and the display screen 101 may be an LCD screen, an LED screen, or an OLED screen. The electronic device 100 may be, for example, a mobile terminal such as a mobile phone, a tablet computer, a smart watch, and a smart wearable device.
Referring to fig. 1, the electronic device 100 further includes a processor 102 and a bus connecting the touch screen and the processor 102, wherein the processor 102 is used for connecting various peripherals to control the peripheral device. It can be understood that the electronic device 100 may further include one or more of various functional devices such as a camera module, a fingerprint module, a microphone, a speaker, and a receiver as a peripheral device. The electronic device may further be provided with various sensors, such as an infrared sensor, a distance sensor, and the like, wherein an optical sensor may be further disposed below the display screen, for obtaining the current display brightness parameter of the display screen 101.
The electronic device 100 may further include one or more physical keys 104, and such physical keys 104 are used for receiving pressing operations of a user to execute preset functions. The physical keys 104 may be, for example, various physical keys such as a switch key, a volume + or-key, a reset key, a root key, etc. The physical keys 104 may be disposed on edges of the electronic device housing, such as upper, lower, and side edges, etc. The physical keys may be pressed individually to enable the electronic device to execute corresponding functions, or may be pressed in combination to enable the electronic device to execute corresponding operations, such as pressing an on/off key and a volume + key at the same time.
The electronic device 100 may be provided with a motion sensor for detecting a motion state of the electronic device, and the motion sensor may include an acceleration sensor, a gravity sensor, and the like, where the acceleration sensor is a sensor capable of measuring acceleration, and the gravity sensor may perform conversion from a change of gravity to an electrical signal, so as to determine an acceleration caused by gravity, that is, a gravitational acceleration. When an acceleration sensor or a gravity sensor is applied, a coordinate system of a body is generally adopted, that is, a coordinate system taking three directions of the length, width and height of the body as an X axis, a Y axis and a Z axis, and since there is a possibility that the position, the flip angle and the like of the electronic device itself may change, a large error exists in the state detection of the electronic device by using data of the coordinate system of the body, and particularly, the position change of the Z axis of the electronic device in a world coordinate system cannot be accurately determined.
Accordingly, the inventors of the present application propose a state detection method, apparatus, electronic device, and storage medium of the present application.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, in an embodiment of the present invention, a status detection method is provided, which is applied to an electronic device, for example, the electronic device 100 shown in fig. 1, and the method may include the following steps:
step S110: and acquiring the acceleration direction of the current acceleration process of the electronic equipment.
The acceleration process means that the electronic device is in a motion process with an acceleration, i.e. an acceleration greater than 0. I.e. the current acceleration of the electronic device is larger than 0. It is understood that an acceleration process refers to a process in which the acceleration direction continuously faces the same direction until the acceleration of the electronic device drops to 0 or the acceleration direction changes. Wherein the acceleration of the electronic device refers to the acceleration generated by the resultant force of all directions to which the electronic device is subjected.
The current acceleration process refers to an acceleration motion process in which the electronic device is currently located, and the acceleration direction refers to the direction of acceleration.
The acquisition of the acceleration direction of the current acceleration process of the electronic device may be performed, for example, as follows: the method comprises the steps of acquiring real-time acquisition data of an acceleration sensor in the electronic equipment, and acquiring current acceleration data, wherein the acceleration data comprises an acceleration direction, the starting time of an acceleration process, the ending time of the acceleration process and the like. Or in some embodiments, the acceleration direction of the current acceleration process may also be acquired by a direction sensor of the electronic device.
The acceleration data obtained by the acceleration sensor may be data of a coordinate system of the body, that is, data of the body with the transverse direction, the longitudinal direction and the vertical direction as the X axis, the Y axis and the Z axis, respectively. As an embodiment, the acceleration data expressed in the fuselage coordinate system and the acceleration direction may be converted into acceleration data characterized by a world coordinate system, which is a coordinate system having a Z-axis direction oriented toward the geocentric direction.
In some embodiments, after each acquisition of the acceleration direction of the current rush procedure, the acceleration direction and the corresponding acceleration procedure record are stored. In some embodiments, only the acceleration data of the current acceleration process may be stored and updated when the acceleration data of the acceleration process is next acquired.
Step S120: and judging whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process. The previous acceleration process refers to an acceleration process that is one time before the current acceleration process. And executing corresponding operation by comparing the acceleration direction of the current acceleration process with that of the previous acceleration process. If the acceleration direction of the current acceleration process is not the same as the acceleration direction of the previous acceleration process, step S130 is performed.
When the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process, it indicates that the current acceleration process and the previous acceleration process may be the same acceleration process, and there may be an error in data acquisition of the electronic device, at this time, the current acceleration process and the previous acceleration process may be merged, and the end time of the current acceleration process is updated to the end time of the previous acceleration process.
Step S130: and determining the running direction of the electronic equipment according to the acceleration direction of the current acceleration process and the acceleration direction of the previous acceleration process.
And determining the running direction of the electronic equipment from the acceleration direction of the current acceleration process and the acceleration direction of the previous acceleration process. The operation direction of the electronic device may refer to: the direction of travel of the Z axis in the world coordinate system is, for example, vertically upward or vertically downward.
The manner of determining the operation direction of the electronic device may be:
for example, when the electronic equipment enters an elevator or the like along with a user, the electronic equipment correspondingly rises or falls along with the rising or falling of the elevator. During operation of the elevator, which is usually accelerated at start-up and then enters a smooth operation state or directly enters a deceleration state, the elevator experiences a first acceleration in the direction of the operation direction and then experiences a deceleration, which is actually an acceleration in the opposite direction of the operation direction, and the acceleration direction of the elevator deviates from the operation direction, so that the manner of determining the operation direction of the electronic device at this time can be determined according to the following manner:
the acceleration direction of the current acceleration process is downward, the acceleration direction of the current acceleration process is upward, the running direction of the elevator is downward, and the running direction of the electronic equipment is downward.
The acceleration direction of the current acceleration process is upward, the acceleration direction of the current acceleration process is downward, the running direction of the elevator is upward, and the running direction of the electronic equipment is upward.
In some other embodiments, the electronic device may be located in other environments, for example, the electronic device is located in a running subway, and the acceleration direction in the acceleration data of the electronic device may be the acceleration direction of the X-axis or the Y-axis in the world coordinate system, and the running mode of the electronic device may be determined as follows: and determining the running direction of the current electronic equipment according to the acceleration direction of the previous acceleration process of the electronic equipment.
The state detection method described above may be used to perform corresponding operations by accurately determining the state of the electronic device, and the corresponding operations include, but are not limited to, unlocking the electronic device, powering off/on the electronic device, turning on a silent mode for the electronic device, and the like, as an example.
When the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process in step S120, step S140 may be performed. Step S140: and updating the end time of the previous acceleration process. Specifically, the end time of the previous acceleration process may be updated to the end time of the current acceleration process. That is, the current acceleration process and the previous acceleration process are actually one acceleration process.
In the state detection method provided in this embodiment, by comparing and judging the acceleration direction of the current acceleration process of the electronic device with the acceleration direction of the previous acceleration process, it is determined whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process, and only when the acceleration direction of the current acceleration process is different from the acceleration direction of the previous acceleration process, the operation direction of the electronic device is determined according to the acceleration direction of the acceleration process and the acceleration direction of the previous acceleration process. When the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process, it can be determined that an error exists in the detection of the current electronic equipment on the acceleration process, so that the situation is excluded from the state detection of the electronic equipment, and the accuracy of the state detection is further improved.
Referring to fig. 3, another embodiment of the present application provides a status detection method applied to an electronic device, where the method includes the following steps:
step 210: and acquiring the acceleration state of the electronic equipment, and determining the current acceleration direction according to the acceleration state.
In some embodiments, acquiring the acceleration state of the electronic device refers to acquiring acceleration data collected by an acceleration sensor in the electronic device, and determining the current acceleration direction according to the collected acceleration data. As an embodiment, determining the acceleration direction may be performed as follows:
acquiring an acceleration Z-axis numerical value of the electronic equipment in a world coordinate system; if the absolute value of the difference value between the acceleration Z-axis numerical value and the gravity acceleration is greater than the acceleration threshold value, and the acceleration Z-axis numerical value is greater than the gravity acceleration, determining that the acceleration direction of the electronic equipment is vertically upward; if the absolute value of the difference value between the acceleration Z-axis numerical value and the gravity acceleration is larger than the acceleration threshold value and the acceleration Z-axis numerical value is smaller than the gravity acceleration, determining that the acceleration direction of the electronic equipment is vertical downward; and if the absolute value of the difference value between the acceleration Z-axis numerical value and the gravity acceleration is smaller than the acceleration threshold value, determining that the electronic equipment is in a stable state. The steady state refers to a state that the current electronic equipment is in a static state or a constant-speed running state. The speed threshold may be, for example, 0.2-0.3, such as 0.3, 0.2, 0.35, 0.25, etc.
At any one time, acceleration data may be obtained, and when N × M up-acceleration states occur consecutively from a certain time, it is known that a steady state or down-acceleration state occurs at a certain time, and it can be determined that an effective up-acceleration process is currently being experienced. When N × M downward acceleration states occur consecutively from a certain time, it is known that a steady state or an upward acceleration state occurs at a certain time, and it can be determined that an effective downward acceleration process is currently performed. Wherein, N is the sampling frequency of the acceleration sensor, and M is the duration of the acceleration process. In some embodiments, the sensor may experience errors in data acquisition, such as when N occurs consecutively1*M1In the upward acceleration state, a downward acceleration state is collected, and then N is collected2*M2An up-acceleration state, where the mid-acquisition down-acceleration state may be an error, may be deleted, by M1+M2As the duration of an effective upward acceleration process.
It can be understood that the gravity acceleration g varies with geographic coordinates (longitude and latitude), and there is a certain difference. For example, in some locations, the acceleration of gravity may be equal to 9.8m/S2While in other locations the acceleration of gravity may be greater or less than 9.8m/S2Thus, therefore, it isWhen the comparison and determination are performed, the longitude and latitude coordinates where the electronic device is located and the gravitational acceleration corresponding to the current longitude and latitude coordinates may be obtained first, and the acceleration direction of the electronic device may be determined based on the obtained gravitational acceleration value.
Step S220: and when the electronic equipment enters a steady state or a reverse acceleration state, setting the moment when the electronic equipment enters the steady state or the reverse acceleration state as the end time of the acceleration state.
When the electronic equipment enters a steady state or a reverse acceleration state from an acceleration state, the current acceleration process is finished, and therefore the end time of the acceleration process is marked or updated at the moment so as to accurately determine the acceleration duration and the end time of the current acceleration process, and the subsequent judgment of the acceleration direction is facilitated.
It is understood that step S210 and step S220 may be performed synchronously, or step S220 may be performed after step S210 is performed.
Step S230: and judging whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process. When not identical, step S240 is executed.
Step S240: and determining the running direction of the electronic equipment to be the same as the acceleration direction of the previous acceleration process.
In the process of running the elevator, the electronic equipment correspondingly rises or falls along with the rising or falling of the elevator when the elevator runs. During operation of the elevator, which is usually started, the elevator accelerates and then enters a stationary operating state or directly enters a deceleration state, in which the elevator experiences a first acceleration in the direction of travel and then a deceleration, which is in fact an acceleration in the opposite direction of travel, the acceleration direction of which deviates from the direction of travel. Therefore, by determining that the running direction of the electronic device is the same as the acceleration direction of the previous acceleration process, that is, the previous acceleration process experienced by the electronic device is the running direction of the electronic device, the acceleration direction of the current acceleration process indicates that the electronic device is doing deceleration movement.
Step S250: and executing a preset operation according to the running direction of the electronic equipment.
Wherein, the executing the predetermined operation may be: and executing a preset signal searching strategy according to the running direction of the electronic equipment.
When a user enters an elevator, the located radio frequency signal may be shielded or weakened by an elevator car, the radio frequency signal received by the electronic device is weakened at the moment, and when the strength of the signal is weakened, the electronic device generally increases the search strength of the radio frequency signal at the moment, so that the power consumption is increased. After the running direction of the electronic equipment is accurately determined, the current environment of the elevator is determined, and then a targeted signal search strategy can be determined according to the running direction of the electronic equipment.
For example, in some embodiments, when the electronic device enters the current acceleration process from the previous acceleration process, and the acceleration direction of the current acceleration process is opposite to the acceleration direction of the previous acceleration process, it indicates that the elevator is about to stop, and then the signal search is started, so that the problem that the power consumption is greatly increased because the electronic device starts to perform the signal search when detecting that the signal is weakened is avoided, and the power consumption of the electronic device is saved. Further, the signal search may also be started when the electronic device detects the end of the current acceleration process after entering the current acceleration process from the previous acceleration process. At this time, the power consumption of the electronic device can be further reduced.
It will be appreciated that in other embodiments, the predetermined operation may be other operations, such as: the predetermined operation may also be an operation of turning off the display screen, turning down the brightness of the display screen, or the like when it is detected that the electronic device enters the current acceleration process from the previous acceleration process, and the acceleration direction of the current acceleration process is opposite to the acceleration direction of the previous acceleration process.
When the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process in step S230, step S260 may be performed. Step S260: and updating the end time of the previous acceleration process.
In the state detection method provided in this embodiment, by comparing and judging the acceleration direction of the current acceleration process of the electronic device with the acceleration direction of the previous acceleration process, it is determined whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process, and only when the acceleration direction of the current acceleration process is different from the acceleration direction of the previous acceleration process, the operation direction of the electronic device is determined according to the acceleration direction of the acceleration process and the acceleration direction of the previous acceleration process. When the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process, it can be determined that an error exists in the detection of the current electronic equipment on the acceleration process, so that the situation is excluded from the state detection of the electronic equipment, and the accuracy of the state detection is further improved. Meanwhile, the running direction of the electronic equipment is determined, so that the preset operation is accurately executed, the power consumption is reduced, and the user experience is improved.
Referring to fig. 4, the present embodiment provides a state detection method applied to an electronic device, where the method may include the following steps:
step S310: and acquiring the acceleration direction of the current acceleration process of the electronic equipment.
As an embodiment, when the acceleration direction of the current acceleration process of the electronic device is acquired, the start time and the end time of the current acceleration process may be acquired together.
Step S320: and judging whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process. If not, go to step S330.
Step S330: and acquiring the time interval between the end time of the current acceleration process and the end time of the previous acceleration process.
In step S310, the end time of the current acceleration process is acquired from the acceleration data acquired by the current acceleration process. And determining the time interval between the current acceleration process and the previous acceleration process according to the end time of the current acceleration process and the end time of the previous acceleration process. In some embodiments, the time interval between the end time of the current acceleration process and the end time of the previous acceleration process may characterize the duration of the current acceleration process.
If the time interval is less than or equal to the time threshold, step S340 is performed, and if the time interval is greater than the time threshold, step S350 is performed.
When the time interval is less than or equal to the time threshold, it indicates that the time difference between the current acceleration process and the previous acceleration process is short, indicating that the current acceleration process and the previous acceleration process belong to two acceleration processes of the same trip. For the convenience of understanding, when the elevator runs, the elevator accelerates for the first time, then enters a stable state, and then enters a first deceleration, and the end time of the first acceleration and the end time of the first deceleration are the sum of the acceleration time in the stable state and the acceleration time in the first deceleration. Of course, in some embodiments, there is no plateau and therefore the time interval is not too long. Therefore, the operation environment and the operation mode of the electronic equipment can be accurately judged by judging the duration of the time interval.
If the time interval process, such as the time interval exceeds the time threshold, indicates that the current acceleration process and the previous acceleration process may not be in the same elevator trip or the starting time of the current acceleration process and the ending time of the previous acceleration process have a deviation, if the judgment of the running direction of the electronic device is performed based on the two acceleration processes that are not in the same elevator trip, an inaccurate judgment situation may occur.
It is understood that the time threshold may be a preset value, and the time threshold may be set to 100s-150s, for example, and as an embodiment, the time threshold may be 120s, for example. The time interval may be obtained by a difference between the end time of the current acceleration process and the end time of the previous acceleration process. In some embodiments, the current universal time may be obtained in real time, the end time of the current acceleration process and the end time of the previous acceleration process may be both characterized by the universal time, and the time interval may be determined according to the universal time. In some embodiments, the end time of the current acceleration process and the end time of the previous acceleration process may also be determined by the internal time of the system itself.
Step S340: and determining the running direction of the electronic equipment to be the same as the acceleration direction of the previous acceleration process.
Step S350: and determining that the running direction of the electronic equipment is the same as the acceleration direction of the previous acceleration process, and updating the end time of the previous acceleration process to be the current moment.
When the time interval is larger than the time threshold, the ending time of the previous acceleration process is updated to be the current moment, so that the error of the current acceleration process is eliminated, and the misjudgment of the running state of the electronic equipment is further avoided.
When the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process in step S320, step S360 may be performed. Step S360: and updating the end time of the previous acceleration process.
In the state detection method provided by this embodiment, the time interval between the end time of the current acceleration process and the end time of the previous acceleration process is determined, and the length of the time interval is used for determining, so that the situation that the two acceleration processes belong to two different trips can be eliminated, the accuracy of determining the operation direction of the electronic device is further improved, and a reliable basis is provided for performing a predetermined operation on the electronic device subsequently.
Referring to fig. 5, an embodiment of the present application further provides a status detection apparatus 400, which is applied to an electronic device, and the status detection apparatus 400 includes an obtaining module 410, a determining module 420, and a status determining module 430.
The obtaining module 410 is configured to obtain an acceleration direction of a current acceleration process of the electronic device. In some embodiments, the obtaining module 410 is further configured to obtain the start time and the end time of the current acceleration process at the same time. And in some embodiments, the acquisition module 410 may also update the start time and the end time of the acceleration process.
In some embodiments, referring to fig. 6, the obtaining module 410 includes a state obtaining module 411 and a time obtaining module 412, where the state obtaining module 411 is configured to obtain an acceleration state of the electronic device, and determine a current acceleration direction according to the acceleration state. The status acquisition module 411 may, for example, operate as follows: acquiring an acceleration Z-axis numerical value of the electronic equipment in a world coordinate system; if the absolute value of the difference value between the acceleration Z-axis numerical value and the gravity acceleration is greater than the acceleration threshold value, and the acceleration Z-axis numerical value is greater than the gravity acceleration, determining that the acceleration direction of the electronic equipment is vertically upward; if the absolute value of the difference value between the acceleration Z-axis numerical value and the gravity acceleration is larger than the acceleration threshold value and the acceleration Z-axis numerical value is smaller than the gravity acceleration, determining that the acceleration direction of the electronic equipment is vertical downward; and if the absolute value of the difference value between the acceleration Z-axis numerical value and the gravity acceleration is smaller than the acceleration threshold value, determining that the electronic equipment is in a stable state.
The time obtaining module 412 is configured to, when the electronic device enters the steady state or the reverse acceleration state, set a time when the electronic device enters the steady state or the reverse acceleration state as an end time of the acceleration state.
The determining module 420 is configured to determine whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process.
The state determining module 430 is configured to determine the operation direction of the electronic device according to the acceleration direction of the current acceleration process and the acceleration direction of the previous acceleration process when the acceleration direction of the current acceleration process is different from the acceleration direction of the previous acceleration process.
In some embodiments, the state determination module 430 may determine that the running direction of the electronic device is the same direction as the acceleration direction of the previous acceleration process. In some embodiments, referring to fig. 7, the state determination module 430 includes a time interval determination module 431 and a direction determination module 432, wherein the time interval determination module 431 is configured to obtain a time interval between the end time of the current acceleration process and the end time of the previous acceleration process. The direction determining module 432 is configured to determine, when the time interval is smaller than or equal to the time threshold, that the running direction of the electronic device is the same as the acceleration direction of the previous acceleration process. Meanwhile, in some embodiments, the direction determining module 432 is configured to determine, when the time interval is greater than the time threshold, that the running direction of the electronic device is the same direction as the acceleration direction of the previous acceleration process, and update the end time of the previous acceleration process to be the current time.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or modules may be in an electrical, mechanical or other form.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Referring to fig. 8, based on the above state detection method and apparatus, another electronic device 300 capable of executing the control method of the electronic device is provided in the embodiment of the present application. The electronic device 300 includes one or more processors 302 (only one shown), a memory 304, an acceleration sensor 306, a radio frequency module 308, and a touch screen 312, which are coupled to each other. The memory 304 stores programs that can execute the content of the foregoing embodiments, and the processor 302 can execute the programs stored in the memory 304.
Processor 302 may include one or more processing cores, among others. The processor 302 interfaces with various components throughout the electronic device 100 using various interfaces and circuitry to perform various functions of the electronic device 100 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 304 and invoking data stored in the memory 304. Alternatively, the processor 302 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 302 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 302, but may be implemented by a communication chip.
The Memory 304 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 304 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 304 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The data storage area may also store data created by the electronic device 300 during use (e.g., phone book, audio-video data, chat log data), etc.
The acceleration sensor 306 is used to collect acceleration data of the electronic device 300, wherein the acceleration data comprises an acceleration direction and optionally a start time and an end time of an acceleration process. The number of the acceleration sensors 306 may be one or more, and may be disposed inside the housing of the electronic device 300, and the acceleration sensors 306 may be electrically connected to the processor 302 to send the acquired acceleration data to the processor 302 for processing.
The touch screen 312 may be an LCD screen, an LED screen, an OLED screen, or other display screens, and the touch screen 312 may be used for touch input. The electronic device 300 may further be provided with one or more shortcut buttons, which are coupled to the housing of the electronic device 300 and may be connected to the processor 302 through the control circuit.
The rf module 308 is used for receiving and transmitting rf signals of the electronic device 300, and in some embodiments, the rf module may include one or more rf antennas, where the rf antennas may be 3G, 4G, 5G, and the like, and may also be a GPS antenna, a WiFi antenna, an anti-interference antenna, and the like. The rf module 308 may be disposed inside the electronic device 300, or may be combined with a housing of the electronic device 300. In one embodiment, the rf module 308 may adjust the rf power to enhance the reception rate of the rf signal according to the current rf signal strength. For example, the rf module 308 may increase the rf power in an environment with weak rf signal strength. The RF module 308 is electrically connected to the processor 302 and can be controlled by the processor 302 to increase or decrease RF power.
It should be understood that the electronic device 300 in this embodiment may be a mobile phone or smart phone (e.g., iPhone (TM) based, Android (TM) based phone), a portable game device (e.g., Nintendo DS (TM), PlayStationPortable (TM), Game Advance (TM), iPhone (TM)), a laptop, a PDA, a portable Internet device, a music player, a data storage device, etc. The electronic device 300 may also be any of a plurality of electronic devices 300, the plurality of electronic devices 300 including, but not limited to, cellular phones, smart phones, other wireless communication devices, personal digital assistants, audio players, other media players, music recorders, video recorders, cameras, other media recorders, radios, medical devices, vehicle transportation equipment, calculators, programmable remote controls, pagers, laptop computers, desktop computers, printers, netbook computers, Personal Digital Assistants (PDAs), Portable Multimedia Players (PMPs), moving Picture experts group (MPEG-1 or MPEG-2) Audio layer 3(MP3) players, portable medical devices, and digital cameras, and combinations thereof.
Referring to fig. 9, a block diagram of a computer-readable storage medium according to a sixth embodiment of the present application is shown. The computer-readable medium 800 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 to perform any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (11)

1. A state detection method applied to an electronic device includes:
acquiring the acceleration direction of the current acceleration process of the electronic equipment;
judging whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process;
and if the acceleration direction of the current acceleration process is different from the acceleration direction of the previous acceleration process, determining the running direction of the electronic equipment according to the acceleration direction of the current acceleration process and the acceleration direction of the previous acceleration process.
2. The method of claim 1, wherein determining the operation direction of the electronic device according to the acceleration direction of the current acceleration process and the acceleration direction of the previous acceleration process comprises:
and determining the running direction of the electronic equipment to be the same as the acceleration direction of the previous acceleration process.
3. The method of claim 1, wherein determining the operation direction of the electronic device according to the acceleration direction of the current acceleration process and the acceleration direction of the previous acceleration process comprises:
acquiring the time interval between the end time of the current acceleration process and the end time of the previous acceleration process;
and if the time interval is smaller than or equal to a time threshold, determining that the running direction of the electronic equipment is the same as the acceleration direction of the previous acceleration process.
4. The method of claim 3, wherein determining the operating direction of the electronic device according to the acceleration direction of the current acceleration process and the acceleration direction of the previous acceleration process further comprises:
if the time interval is larger than a time threshold, determining that the running direction of the electronic equipment is the same as the acceleration direction of the previous acceleration process, and updating the end time of the previous acceleration process to be the current time.
5. The method of any one of claims 1 to 4, wherein obtaining the acceleration direction of the current acceleration process of the electronic device comprises:
acquiring the acceleration state of the electronic equipment, and determining the current acceleration direction according to the acceleration state;
and when the electronic equipment enters a steady state or a reverse acceleration state, setting the moment when the electronic equipment enters the steady state or the reverse acceleration state as the end time of the acceleration state.
6. The method of claim 5, wherein the obtaining an acceleration state of the electronic device, and determining a current acceleration direction according to the acceleration state comprises:
acquiring an acceleration Z-axis numerical value of the electronic equipment in a world coordinate system;
if the absolute value of the difference value between the acceleration Z-axis numerical value and the gravity acceleration is greater than the acceleration threshold value, and the acceleration Z-axis numerical value is greater than the gravity acceleration, determining that the acceleration direction of the electronic equipment is vertically upward;
if the absolute value of the difference value between the acceleration Z-axis numerical value and the gravity acceleration is larger than the acceleration threshold value and the acceleration Z-axis numerical value is smaller than the gravity acceleration, determining that the acceleration direction of the electronic equipment is vertical downward;
and if the absolute value of the difference value between the acceleration Z-axis numerical value and the gravity acceleration is smaller than the acceleration threshold value, determining that the electronic equipment is in a stable state.
7. The method of claim 1, further comprising:
and executing a preset operation according to the running direction of the electronic equipment.
8. The method according to claim 7, wherein the performing a predetermined operation according to the operation direction of the electronic device comprises:
and executing a preset signal searching strategy according to the running direction of the electronic equipment.
9. A state detection device, applied to an electronic apparatus, the device comprising:
the acquisition module is used for acquiring the acceleration direction of the current acceleration process of the electronic equipment;
the judging module is used for judging whether the acceleration direction of the current acceleration process is the same as the acceleration direction of the previous acceleration process;
a state determination module: and when the acceleration direction of the current acceleration process is different from the acceleration direction of the previous acceleration process, determining the running direction of the electronic equipment according to the acceleration direction of the current acceleration process and the acceleration direction of the previous acceleration process.
10. An electronic device comprising a memory and a processor, the memory coupled to the processor; the memory stores instructions that, when executed by the processor, cause the processor to perform the method of any of claims 1-8.
11. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 8.
CN201911275535.9A 2019-12-12 2019-12-12 State detection method and device, electronic equipment and storage medium Active CN111064845B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911275535.9A CN111064845B (en) 2019-12-12 2019-12-12 State detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911275535.9A CN111064845B (en) 2019-12-12 2019-12-12 State detection method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111064845A true CN111064845A (en) 2020-04-24
CN111064845B CN111064845B (en) 2021-03-12

Family

ID=70300676

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911275535.9A Active CN111064845B (en) 2019-12-12 2019-12-12 State detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111064845B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103227866A (en) * 2013-04-25 2013-07-31 广东欧珀移动通信有限公司 Driving communication method, device and mobile terminal
US9078090B1 (en) * 2010-01-11 2015-07-07 Marvell Israel (M.I.S.L) Ltd. Method and apparatus for environment based communication control
CN105681585A (en) * 2016-03-22 2016-06-15 努比亚技术有限公司 Web searching method, and terminal
US20160306974A1 (en) * 2010-11-29 2016-10-20 Biocatch Ltd. Identification of computerized bots, and identification of automated cyber-attack modules
CN107651520A (en) * 2017-09-26 2018-02-02 广州汉林德电子科技有限公司 Detection method, system and the elevator operation recording instrument of lift car traffic direction
CN109074175A (en) * 2016-03-25 2018-12-21 夏普株式会社 Information processing unit, electronic equipment, the control method of information processing unit and control program
CN110035185A (en) * 2019-04-22 2019-07-19 联想(北京)有限公司 A kind of control method, device and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9078090B1 (en) * 2010-01-11 2015-07-07 Marvell Israel (M.I.S.L) Ltd. Method and apparatus for environment based communication control
US20160306974A1 (en) * 2010-11-29 2016-10-20 Biocatch Ltd. Identification of computerized bots, and identification of automated cyber-attack modules
CN103227866A (en) * 2013-04-25 2013-07-31 广东欧珀移动通信有限公司 Driving communication method, device and mobile terminal
CN105681585A (en) * 2016-03-22 2016-06-15 努比亚技术有限公司 Web searching method, and terminal
CN109074175A (en) * 2016-03-25 2018-12-21 夏普株式会社 Information processing unit, electronic equipment, the control method of information processing unit and control program
CN107651520A (en) * 2017-09-26 2018-02-02 广州汉林德电子科技有限公司 Detection method, system and the elevator operation recording instrument of lift car traffic direction
CN110035185A (en) * 2019-04-22 2019-07-19 联想(北京)有限公司 A kind of control method, device and electronic equipment

Also Published As

Publication number Publication date
CN111064845B (en) 2021-03-12

Similar Documents

Publication Publication Date Title
EP3567478B1 (en) Method for preloading application, storage medium, and terminal
CN104541231A (en) Method and device for preventing mistaken touch of touch screen
CN107613146B (en) Volume adjustment method and device and mobile terminal
WO2013185119A1 (en) Storing trace information
CN106445596B (en) Method and device for managing setting items
CN107329778B (en) System updating method and related product
CN107025002B (en) Terminal application control method and device and terminal
CN108076223B (en) Task switching method and device, terminal equipment and storage medium
US10324134B2 (en) Method and device for ascertaining required charging time
CN111078108A (en) Screen display method and device, storage medium and mobile terminal
CN109688611B (en) Frequency band parameter configuration method, device, terminal and storage medium
CN111064845B (en) State detection method and device, electronic equipment and storage medium
CN107930126B (en) Game reservation data processing method and device and mobile terminal
CN108710789B (en) Unlocking method and terminal equipment
CN110958352A (en) Network signal display method, device, storage medium and mobile terminal
CN110430321A (en) To method, storage medium and the mobile terminal of incoming call user's remarks
CN106547400B (en) Method, device and terminal for reporting information
CN112433694B (en) Light intensity adjusting method and device, storage medium and mobile terminal
CN112380520B (en) Screen unlocking method and device, storage medium and mobile terminal
CN111309223B (en) Application function starting method and device, storage medium and mobile terminal
CN109151154B (en) Power consumption control method and mobile terminal
CN108681467B (en) System awakening method and terminal
CN109886199B (en) Information processing method and device, vehicle and mobile terminal
CN111132282B (en) Application processor awakening method and device applied to mobile terminal
CN106850985B (en) Control method, device and the mobile terminal of mobile terminal sensor

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