CN106506821B - The method and mobile terminal of reading data - Google Patents

The method and mobile terminal of reading data Download PDF

Info

Publication number
CN106506821B
CN106506821B CN201610939780.5A CN201610939780A CN106506821B CN 106506821 B CN106506821 B CN 106506821B CN 201610939780 A CN201610939780 A CN 201610939780A CN 106506821 B CN106506821 B CN 106506821B
Authority
CN
China
Prior art keywords
sensor
mobile terminal
interrupt signal
mode
data
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
CN201610939780.5A
Other languages
Chinese (zh)
Other versions
CN106506821A (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 CN201610939780.5A priority Critical patent/CN106506821B/en
Publication of CN106506821A publication Critical patent/CN106506821A/en
Application granted granted Critical
Publication of CN106506821B publication Critical patent/CN106506821B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/22Handling requests for interconnection or transfer for access to input/output bus using successive scanning, e.g. polling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/24Handling requests for interconnection or transfer for access to input/output bus using interrupt
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/12Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion

Abstract

The present invention is suitable for field of communication technology, provides the method and mobile terminal of a kind of reading data, which comprises obtain the status information of mobile terminal;When the status information is that mobile terminal is in wake-up states, the operating mode that sensor is arranged is runs mode, and the data of the sensor are read according to first time interval;When the status information be mobile terminal in a dormant state when, be arranged sensor operating mode be interruption of work mode, the data of the sensor are read according to the interrupt signal of the sensor.The present invention reduces the interrupt signal of sensor as much as possible, efficiently solves the problems, such as that interrupt signal loses and leads to sensor failure in the prior art.

Description

The method and mobile terminal of reading data
Technical field
The invention belongs to field of communication technology more particularly to the methods and mobile terminal of a kind of reading data.
Background technique
In the prior art, sensor by interrupt signal come reported data, read by response interrupt signal by mobile terminal Access evidence.When multiple and different sensor contemporaneities quickly generates a large amount of interrupt signal, mobile terminal be will be unable in time All interrupt signals are responded, interrupt signal is be easy to cause to lose.For example, integration period is 25 millis for ambient light sensor Second, it can produce within 1 second 40 interruptions.If proximity sensor also generates interrupt signal in contemporaneity, then being produced in each second Raw interrupt signal is very more.If system call unsuccessfully etc. due to, when a certain interrupt signal is not responded, accordingly Interrupt register will be unable to be cleared, and then lead to sensor failure, can not generate interrupt signal again.
Therefore, it is necessary to propose a kind of new technical solution, to solve the above technical problems.
Summary of the invention
In consideration of it, the embodiment of the invention provides a kind of method of reading data and mobile terminal, to solve the prior art The problem of middle interrupt signal loses and leads to sensor failure.
In a first aspect, providing a kind of method of reading data, which comprises
Obtain the status information of mobile terminal;
When the status information is that mobile terminal is in wake-up states, the operating mode that sensor is arranged is timer work Operation mode reads the data of the sensor according to first time interval;
When the status information be mobile terminal in a dormant state when, be arranged sensor operating mode be interruption of work Mode reads the data of the sensor according to the interrupt signal of the sensor.
Further, the first time interval is that the data of the sensor report frequency;
Before the status information for obtaining mobile terminal, the method also includes:
When sensor starting, the data that the sensor is arranged report frequency.
Further, the method also includes:
When the operating mode of the sensor is interruption of work mode, untreated interruption is removed according to predetermined manner and is believed Number.
Further, described when the operating mode of the sensor is interruption of work mode, it is removed according to predetermined manner Untreated interrupt signal includes:
When the operating mode of the sensor is interruption of work mode, the sensor is read according to the second time interval The output signal of upper interrupt pin;
Judge whether the output signal is low level, to determine whether there is untreated interrupt signal;
If the output signal is low level, the untreated interrupt signal is removed, to restore the sensor Function.
Second aspect, provides a kind of mobile terminal, and the mobile terminal includes:
Module is obtained, for obtaining the status information of mobile terminal;
First read module, for sensor to be arranged when the status information is that mobile terminal is in wake-up states Operating mode is runs mode, and the data of the sensor are read according to first time interval;
Second read module, for when the status information be mobile terminal in a dormant state when, sensor is set Operating mode is interruption of work mode, and the data of the sensor are read according to the interrupt signal of the sensor.
The third aspect, provides a kind of mobile terminal, and the mobile terminal includes:
When the operating mode of the sensor is interruption of work mode, the sensor is read according to the second time interval The output signal of upper interrupt pin;Judge whether the output signal is low level, to determine whether there is untreated interruption Signal;If the output signal is low level, the untreated interrupt signal is removed, to restore the function of the sensor Energy.
Compared with prior art, the embodiment of the present invention passes through the status information for obtaining mobile terminal, and according to the state Information is that different operating modes is arranged in sensor.When the status information is that mobile terminal is in wake-up states, then it is arranged The operating mode of sensor is runs mode, and the data of the sensor are read according to first time interval;Work as institute State status information be mobile terminal in a dormant state when, then the operating mode that sensor is arranged is interruption of work mode, and root The data of the sensor are read according to the interrupt signal of the sensor;To reduce the interruption letter of sensor as much as possible Number, it significantly reduces interrupt signal in the prior art and loses and cause the probability of sensor failure, and reduce sensor Power consumption.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with Other accompanying drawings can also be obtained according to these attached drawings.
Fig. 1 is the implementation flow chart of the method for the reading data that first embodiment of the invention provides;
Fig. 2 is the implementation flow chart of the method for the reading data that second embodiment of the invention provides;
Fig. 3 is the implementation flow chart of step S204 in the method for the reading data that second embodiment of the invention provides;
Fig. 4 is the schematic block diagram for the mobile terminal that third embodiment of the invention provides;
Fig. 5 is the schematic block diagram for the mobile terminal that fourth embodiment of the invention provides;
Fig. 6 is the schematic block diagram for the mobile terminal that fifth embodiment of the invention provides.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
The embodiment of the present invention is arranged according to the state information for sensor by obtaining the status information of mobile terminal Different operating modes.When the status information is that mobile terminal is in wake-up states, then the operating mode of sensor is set For runs mode, and read according to first time interval the data of the sensor;When the status information is movement Terminal in a dormant state when, then the operating mode that sensor is arranged is interruption of work mode, and according in the sensor Break signal reads the data of the sensor;To reduce the interrupt signal of sensor as much as possible, significantly reduce existing There is interrupt signal in technology to lose and cause the probability of sensor failure, and reduces the power consumption of sensor.The present invention is implemented Example additionally provides corresponding mobile terminal, and which will be described in detail below.
Fig. 1 shows the implementation process of the method for the reading data of first embodiment of the invention offer.
In embodiments of the present invention, the method for the reading data is applied to mobile terminal.The mobile terminal is preferably Android device, including but not limited to smart phone, tablet computer, learning machine etc..Sensing is provided on the mobile terminal Device, the sensor include but is not limited to ambient light sensor, proximity sensor etc..
Refering to fig. 1, the method for the reading data includes:
In step s101, the status information of mobile terminal is obtained.
In embodiments of the present invention, the status information of the mobile terminal includes wake-up states and dormant state.
In step s 102, when the status information is that mobile terminal is in wake-up states, the work of sensor is set Mode is runs mode, and the data of the sensor are read according to first time interval.
The embodiment of the present invention according to the status information of mobile terminal be sensor different operating modes is set, then according to Mode corresponding with the operating mode reads the data of sensor.In the prior art, whenever the data of sensor are all logical It crosses interruption and reports to mobile terminal.And in embodiments of the present invention, when the status information is that mobile terminal is in wake-up states When, runs mode is set by the operating mode of sensor first, so that sensor reports frequency according to specified data Rate is to mobile terminal reporting data, rather than while sensing variation is at once reported data by interrupt signal;Mobile terminal is then The data of the sensor are read according to the first time interval.
Optionally, the first time interval is that the data of the sensor report frequency.Before the step S101, The method can also include:
When sensor starting, the data that the sensor is arranged report frequency.
Specifically, the data of the sensor can be set when application program enables sensor in some embodiments Report frequency;In further embodiments, the sensor can also be set when mobile terminal-opening starts the sensor Data report frequency.
Illustratively, the data report frequency per second for 20 times, and the mobile terminal is then read every 50 milliseconds The data of primary transducer, to efficiently reduce the number of interrupt signal during system wake-up state.
In step s 103, when the status information be mobile terminal in a dormant state when, the work of sensor is set Mode is interruption of work mode, and the data of the sensor are read according to the interrupt signal of the sensor.
Herein, if mobile terminal in a dormant state when, the embodiment of the present invention sets the operating mode of sensor to Interruption of work mode reads the data of sensor by response interrupt signal.At this point, the data of sensor must be with interruption Mode reports;Mobile terminal reads the data of sensor by the interrupt signal of response sensor.Illustratively, when described When sensor is proximity sensor, when the proximity sensor detects that object is close or separate, trigger at once Interrupt signal is with reported data, to save the power consumption of mobile terminal to a certain extent.
In conclusion status information of the embodiment of the present invention by acquisition mobile terminal, and be according to the state information Different operating modes is arranged in sensor.When the status information is that mobile terminal is in wake-up states, then sensor is set Operating mode be runs mode, and read according to first time interval the data of the sensor;When the state Information be mobile terminal in a dormant state when, then the operating mode that sensor is arranged is interruption of work mode, and according to described The interrupt signal of sensor reads the data of the sensor;To reduce the interrupt signal number of sensor as much as possible, Interrupt signal can not be timely responded to by avoiding mobile terminal, significantly reduced interrupt signal in the prior art and lost and cause to pass The probability of sensor failure, and reduce the power consumption of sensor.
Example described in Fig. 1, which is reduced sensor by reducing the interrupt signal of sensor and lost due to interrupt signal, to fail Probability, but sensor still be possible to because interrupt signal lose and fail.Fig. 2 shows second embodiment of the invention to mention The implementation process of the method for the reading data of confession.In embodiments of the present invention, it can further remove and cause sensor failure Interrupt signal,
Referring to Fig.2, the method for the reading data includes:
In step s 201, the status information of mobile terminal is obtained.
In step S202, when the status information is that mobile terminal is in wake-up states, the work of sensor is set Mode is runs mode, and the data of the sensor are read according to first time interval.
In step S203, when the status information be mobile terminal in a dormant state when, the work of sensor is set Mode is interruption of work mode, and the data of the sensor are read according to the interrupt signal of the sensor.
Wherein, step S201 to step S203 and Fig. 1 step S101 as described in the examples are identical to step S103, specifically The narration of above-described embodiment is referred to, details are not described herein again.
Further, after step S203, the method can also include:
In step S204, when the operating mode of the sensor is interruption of work mode, removed according to predetermined manner Untreated interrupt signal.
Herein, the untreated interrupt signal refers to the interrupt signal of un-shifted terminal response.The present invention is implemented Example reads the output signal of the interrupt pin of sensor by setting timer, timing, to determine in sensor with the presence or absence of not The interrupt signal of processing.Wherein, it when the output signal is low level, indicates that interrupt pin is pulled low, needs to remove interruption Signal.
Fig. 3 shows the specific implementation stream of step S204 in the method for the reading data of second embodiment of the invention offer Journey.Refering to Fig. 3, the step S204 includes:
In step S301, when the operating mode of the sensor is interruption of work mode, according to the second time interval Read the output signal of interrupt pin on the sensor.
Herein, after sensor issues interrupt signal, the output signal of interrupt pin becomes low level;Work as mobile terminal After responding and handling the interrupt signal, the output signal of interrupt pin will revert to high level.Therefore, if interrupt signal is lost Lose and it is not processed when, the output signal of the interrupt pin can always remain as low level.
In step s 302, judge whether the output signal is low level, to determine whether there is untreated interruption Signal.
If output signal is low level, it is determined that the interrupt signal of the specified sensor triggering is untreated, executes step S303.Otherwise, it waits next cycle to arrive and reads the output signal of interrupt pin again.
In step S303, the untreated interrupt signal is removed, to restore the function of the sensor.
Herein, the embodiment of the present invention is removed interrupt signal by the clear interrupt register of read-write sensor, so that The functional rehabilitation of sensor is normal.
In conclusion the embodiment of the present invention is determined whether by the output signal of the interrupt pin of timing detection sensor There are untreated interrupt signals, if then removing the interrupt signal, to restore the function of sensor, solve the prior art The problem of middle interrupt signal loses and leads to sensor failure effectively prevents failing due to sensor is lost because interrupting.
The schematic block diagram that Fig. 4 shows the mobile terminal of third embodiment of the invention offer is only shown for ease of description Part related to the embodiment of the present invention is gone out.
In embodiments of the present invention, the mobile terminal is for realizing number described in above-mentioned Fig. 1 to Fig. 3 any embodiment According to the method for reading.The mobile terminal includes but is not limited to smart phone, tablet computer etc., is provided with sensor, institute Stating sensor includes but is not limited to ambient light sensor, proximity sensor etc..
Refering to Fig. 4, the mobile terminal includes:
Module 41 is obtained, for obtaining the status information of mobile terminal.
First read module 42, for sensor to be arranged when the status information is that mobile terminal is in wake-up states Operating mode be runs mode, the data of the sensor are read according to first time interval.
Second read module 43, for when the status information be mobile terminal in a dormant state when, be arranged sensor Operating mode be interruption of work mode, the data of the sensor are read according to the interrupt signal of the sensor.
Further, the first time interval is that the data of the sensor report frequency.
The mobile terminal further include:
Setup module 44, for when sensor starting, the data that the sensor is arranged to report frequency.
Herein, the embodiment of the present invention passes through the status information for obtaining mobile terminal, and is according to the state information biography Different operating modes is arranged in sensor.When the mobile terminal is in wake-up states, then the operating mode that sensor is arranged is Runs mode, and read according to first time interval the data of the sensor;When the mobile terminal is in suspend mode When state, then the operating mode that sensor is arranged is interruption of work mode, and the interrupt signal by responding the sensor is read The data of the sensor;To reduce the interrupt signal of sensor as much as possible, significantly reduce in the prior art The probability of sensor failure is lost and caused to break signal, and reduces the power consumption of sensor.
Further, the mobile terminal further include:
Remove module 45, for when the operating mode of the sensor be interruption of work mode when, it is clear according to predetermined manner Except untreated interrupt signal.
Further, the removing module 45 includes:
Reading unit 451, for when the operating mode of the sensor be interruption of work mode when, according between the second time Every the output signal for reading interrupt pin on the sensor.
Judging unit 452, for judging whether the output signal is low level, to determine whether there is in untreated Break signal.
Clearing cell 453 removes the untreated interrupt signal if be low level for the output signal, with Restore the function of the sensor.
Herein, after sensor issues interrupt signal, the output signal of interrupt pin becomes low level;Work as mobile terminal After responding and handling the interrupt signal, the output signal of interrupt pin will revert to high level.Therefore, if interrupt signal is lost Lose and it is not processed when, the output signal of the interrupt pin can always remain as low level.The embodiment of the present invention passes through timing The output signal of the interrupt pin of detection sensor determines whether there is untreated interrupt signal, if then remove in described Break signal, to restore the function of sensor;Optionally, the embodiment of the present invention by the clear interrupt register of read-write sensor by Interrupt signal is removed;To solve the problems, such as that interrupt signal loses and leads to sensor failure in the prior art, effectively prevents Stop due to sensor is lost because interrupting and having failed.
It should be noted that the mobile terminal in the embodiment of the present invention can be used to implement it is complete in above method embodiment The function of portion's technical solution, each functional module can be implemented according to the method in above method embodiment, specific Realization process can refer to the associated description in examples detailed above, and details are not described herein again.
It is the schematic block diagram for the mobile terminal that fourth embodiment of the invention provides referring to Fig. 5.The movement as shown in the figure Terminal may include: one or more processors 501 (one is only shown in figure), one or more input equipment 502 (in figure only Show one), one or more output equipment 503 (one is only shown in figure), memory 504.Above-mentioned processor 501, input Equipment 502, output equipment 503, memory 504 are connected by bus 506.Memory 504 for storing instruction, processor 501 For executing the instruction of the storage of memory 504.
Wherein:
The processor 501, for obtaining the status information of mobile terminal;When the status information is in for mobile terminal When wake-up states, the operating mode that the sensor in input equipment 502 is arranged is runs mode, according between first time Every the data for reading the sensor;When the status information be mobile terminal in a dormant state when, be arranged input equipment 502 In sensor operating mode be interruption of work mode, the number of the sensor is read according to the interrupt signal of the sensor According to.
Further, the first time interval is that the data of the sensor report frequency.
The processor 501 is also used to, before the status information for obtaining mobile terminal, when sensor starting, The data that the sensor is arranged report frequency.
The processor 501 is also used to, when the operating mode of the sensor is interruption of work mode, according to default side Formula removes untreated interrupt signal.
The processor 501 is also used to, when the operating mode of the sensor is interruption of work mode, when according to second Between interval read the output signal of interrupt pin on the sensor;Judge whether the output signal is low level, with determination With the presence or absence of untreated interrupt signal;If the output signal is low level, the untreated interrupt signal is removed, with Restore the function of the sensor.
It should be appreciated that in embodiments of the present invention, alleged processor 501 can be central processing unit (Central Processing Unit, CPU) and/or graphics processor (Graphic Processing Unit, GPU), it can also be in this base Other general processors, digital signal processor (Digital Signal Processor, DSP), dedicated integrated are combined on plinth Circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..
Input equipment 502 may include that Trackpad, fingerprint adopt sensor (for acquiring the finger print information and fingerprint of user Directional information), proximity sensor, ambient light sensor, microphone, communication module (such as Wi-Fi module, 2G/3G/4G network Module), physical button etc..
Output equipment 503 may include display (LCD etc.), loudspeaker etc..Wherein, display can be used for showing by user The information of input or the information etc. for being supplied to user.Display may include display panel, optionally, can use liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode (Organic Light-Emitting Diode, ) etc. OLED forms configure display panel.Further, above-mentioned touch screen can cover over the display, when touch screen detects After touch operation on it or nearby, processor 501 is sent to determine the type of touch event, is followed by subsequent processing device 501 Corresponding visual output is provided over the display according to the type of touch event.
In the specific implementation, processor 501 described in the embodiment of the present invention, input equipment 502, output equipment 503, depositing Implementation described in the embodiment of the method for reading data provided in an embodiment of the present invention can be performed in reservoir 504, herein It repeats no more.
Fig. 6 is a kind of schematic block diagram for mobile terminal that fifth embodiment of the invention provides, which can use In the method for the reading data for implementing to provide in above-described embodiment.
As shown in fig. 6, mobile terminal 1200 may include RF (Radio Frequency, radio frequency) circuit 110, include The memory 120 of one or more (one is only shown in figure) computer readable storage mediums, input unit 130, display Unit 140, voicefrequency circuit 160, transmission module 170, includes one or more than one and (only shows one in figure sensor 150 It is a) processor 180 of processing core and the equal components of power supply 190.It will be understood by those skilled in the art that shifting shown in Fig. 6 Dynamic 1200 structure of terminal does not constitute the restriction to mobile terminal 1200, may include components more more or fewer than diagram, or Person combines certain components or different component layouts.Wherein:
RF circuit 110 realizes the mutual conversion of electromagnetic wave and electric signal, thus with logical for receiving and transmitting electromagnetic wave News network or other equipment are communicated.RF circuit 110 may include various existing for executing the circuit elements of these functions Part, for example, antenna, RF transceiver, digital signal processor, encryption/deciphering chip, subscriber identity module (SIM) card, storage Device etc..RF circuit 110 can carry out communicating or by wireless with various networks such as internet, intranet, wireless network Network is communicated with other equipment.Above-mentioned wireless network may include cellular telephone networks, WLAN or Metropolitan Area Network (MAN). Various communication standards, agreement and technology, including but not limited to global system for mobile communications can be used in above-mentioned wireless network (Global System for Mobile Communication, GSM), enhanced mobile communication technology (Enhanced Data GSM Environment, EDGE), Wideband CDMA Technology (wideband code division multiple Access, W-CDMA), Code Division Multiple Access (Code division access, CDMA), time division multiple access technology (time Division multiple access, TDMA), adopting wireless fidelity technology (Wireless Fidelity, WiFi) (such as the U.S. electricity Gas and Electronic Engineering Association standard IEEE 802.11a, IEEE 802.11b, IEEE802.11g and/or IEEE 802.11n), the networking telephone (Voice over internet protocal, VoIP), worldwide interoperability for microwave accesses (Worldwide Interoperability for Microwave Access, Wi-Max), other be used for mail, Instant Messenger The agreement and any other suitable communications protocol of news and short message, or even may include that those are not developed currently yet Agreement.
Memory 120 can be used for storing software program and module, as the corresponding program instruction of method in above-described embodiment/ Module, the software program and module that processor 180 is stored in memory 120 by operation, is answered thereby executing various functions With and data processing, including obtain mobile terminal status information, according to the state information be arranged sensor Working mould Formula.Memory 120 may include high speed random access memory, may also include nonvolatile memory, as one or more magnetism is deposited Storage device, flash memory or other non-volatile solid state memories.In some instances, memory 120 can further comprise opposite In the remotely located memory of processor 180, these remote memories can pass through network connection to mobile terminal 1200.It is above-mentioned The example of network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Input unit 130 can be used for receiving the number or character information of input, and generate and user setting and function Control related keyboard, mouse, operating stick, optics or trackball signal input.Specifically, input unit 130 may include touching Sensitive surfaces 131 and other input equipments 132.Touch sensitive surface 131, also referred to as touch display screen or Trackpad are collected and are used Family on it or nearby touch operation (such as user using any suitable object or attachment such as finger, stylus in touch-sensitive table Operation on face 131 or near touch sensitive surface 131), and corresponding attachment device is driven according to preset formula.It is optional , touch sensitive surface 131 may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus detection is used The touch orientation at family, and touch operation bring signal is detected, transmit a signal to touch controller;Touch controller is from touch Touch information is received in detection device, and is converted into contact coordinate, then gives processor 180, and can receive processor 180 The order sent simultaneously is executed.Furthermore, it is possible to using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves Realize touch sensitive surface 131.In addition to touch sensitive surface 131, input unit 130 can also include other input equipments 132.Specifically, Other input equipments 132 can include but is not limited to physical keyboard, function key (such as volume control button, switch key etc.), One of trace ball, mouse, operating stick etc. are a variety of.
Display unit 140 can be used for showing information input by user or the information and mobile terminal that are supplied to user 1200 various graphical user interface, these graphical user interface can be by figure, text, icon, video and any combination thereof To constitute.Display unit 140 may include display panel 141, optionally, can use LCD (Liquid Crystal Display, liquid crystal display), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) come Configure display panel 141.Further, touch sensitive surface 131 can cover display panel 141, when touch sensitive surface 131 is detected at it On or near touch operation after, send processor 180 to determine the type of touch event, be followed by subsequent processing device 180 according to touching The type for touching event provides corresponding visual output on display panel 141.Although in Fig. 6, touch sensitive surface 131 and display surface Plate 141 is to output and input function as two independent components to realize respectively, but in some embodiments it is possible to will touch Sensitive surfaces 131 and display panel 141 integrate and realize and output and input function.
Mobile terminal 1200 may also include at least one sensor 150, for example, optical sensor, motion sensor and other Sensor.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can basis The light and shade of ambient light adjusts the brightness of display panel 141, proximity sensor can when mobile terminal 1200 is moved in one's ear, Close display panel 141 and/or backlight.As a kind of motion sensor, gravity accelerometer can detect all directions The size of upper (generally three axis) acceleration, can detect that size and the direction of gravity, can be used for detecting tilt angle when static, And application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), the Vibration identification correlation function of identification mobile phone posture Energy (such as pedometer, percussion) etc.;The gyroscope that can also configure as mobile terminal 1200, barometer, hygrometer, thermometer, The other sensors such as infrared sensor, details are not described herein.
Voicefrequency circuit 160, loudspeaker 161, the audio that microphone 162 can provide between user and mobile terminal 1200 connect Mouthful.Electric signal after the audio data received conversion can be transferred to loudspeaker 161, by loudspeaker 161 by voicefrequency circuit 160 Be converted to voice signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 162, by voicefrequency circuit 160 receive after be converted to audio data, then by after the processing of audio data output processor 180, through RF circuit 110 to be sent to ratio Such as another terminal, or audio data is exported to memory 120 to be further processed.Voicefrequency circuit 160 is also possible that Earphone jack, to provide the communication of peripheral hardware earphone Yu mobile terminal 1200.
Mobile terminal 1200 can help user send and receive e-mail, is clear by transmission module 170 (such as WiFi module) Look at webpage and access streaming video etc., it provides wireless broadband internet for user and accesses.Although Fig. 6 shows transmission mould Block 170, but it is understood that, and it is not belonging to must be configured into for mobile terminal 1200, it is can according to need completely not Change in the range of the essence of invention and omits.
Processor 180 is the control centre of mobile terminal 1200, utilizes each of various interfaces and connection whole mobile phone A part by running or execute the software program and/or module that are stored in memory 120, and calls and is stored in storage Data in device 120 execute the various functions and processing data of mobile terminal 1200, to carry out integral monitoring to mobile phone.It can Choosing, processor 180 may include one or more processing cores;Preferably, processor 180 can integrate application processor and modulation Demodulation processor, wherein the main processing operation system of application processor, user interface and application program etc., modulation /demodulation processing Device mainly handles wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 180.
Mobile terminal 1200 further includes the power supply 190 (such as battery) powered to all parts, it is preferred that power supply can lead to Cross power-supply management system and processor 180 be logically contiguous, thus by power-supply management system realize management charging, electric discharge and The functions such as power managed.Power supply 190 can also include one or more direct current or AC power source, recharging system, electricity The random components such as source fault detection circuit, power adapter or inverter, power supply status indicator.
Although being not shown, mobile terminal 1200 can also include camera, bluetooth module etc., and details are not described herein.Specifically In the present embodiment, the display unit of mobile terminal is touch-screen display, and mobile terminal further includes having memory and one Perhaps more than one program one of them or more than one program is stored in memory, and be configured to by one or The execution of more than one processor of person states one or more than one program includes the instruction for performing the following operation:
Obtain the status information of mobile terminal;
When the status information is that mobile terminal is in wake-up states, the operating mode that sensor is arranged is timer work Operation mode reads the data of the sensor according to first time interval;
When the status information be mobile terminal in a dormant state when, be arranged sensor operating mode be interruption of work Mode reads the data of the sensor according to the interrupt signal of the sensor.
Assuming that above-mentioned is the first possible embodiment, then provided based on the first possible embodiment Second of possible embodiment in, in the memory of the mobile terminal, also include instructions for performing the following operations:
The first time interval is that the data of the sensor report frequency;
Before the status information for obtaining mobile terminal, the method also includes:
When sensor starting, the data that the sensor is arranged report frequency.
In the third the possible embodiment provided based on the first or second of possible embodiment, Also include instructions for performing the following operations in the memory of the mobile terminal:
When the operating mode of the sensor is interruption of work mode, untreated interruption is removed according to predetermined manner and is believed Number.
In the 4th kind of possible embodiment provided based on the third possible embodiment, the movement Also include instructions for performing the following operations in the memory of terminal:
It is described when the operating mode of the sensor be interruption of work mode when, according to predetermined manner remove it is untreated in Break signal includes:
When the operating mode of the sensor is interruption of work mode, the sensor is read according to the second time interval The output signal of upper interrupt pin;
Judge whether the output signal is low level, to determine whether there is untreated interrupt signal;
If the output signal is low level, the untreated interrupt signal is removed, to restore the sensor Function.
The embodiment of the present invention is arranged according to the state information for sensor by obtaining the status information of mobile terminal Different operating modes.When the status information is that mobile terminal is in wake-up states, then the operating mode of sensor is set For runs mode, and read according to first time interval the data of the sensor;When the status information is movement Terminal in a dormant state when, then the operating mode that sensor is arranged is interruption of work mode, and according in the sensor Break signal reads the data of the sensor;To reduce the interrupt signal of sensor as much as possible, significantly reduce existing There is interrupt signal in technology to lose and cause the probability of sensor failure, and reduces the power consumption of sensor.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the module of foregoing description It with the specific work process of unit, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In several embodiments provided herein, it should be understood that disclosed method and mobile terminal, Ke Yitong Other modes are crossed to realize.For example, embodiments described above is only schematical, for example, the module, unit are drawn Point, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can To combine or be desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or beg for The mutual coupling, direct-coupling or communication connection of opinion can be through some interfaces, the INDIRECT COUPLING of module or unit Or communication connection, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the present invention, module can integrate in one processing unit, Can be each unit, module physically exists alone, can also be integrated in one unit with two or more units, module In.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (6)

1. a kind of method of reading data, which is characterized in that the described method includes:
When sensor starting, the data that the sensor is arranged report frequency;
Obtain the status information of mobile terminal;
When the status information is that mobile terminal is in wake-up states, the operating mode that sensor is arranged is runs mould Formula reads the detection data of the sensor according to first time interval;
When the status information be mobile terminal in a dormant state when, be arranged sensor operating mode be interruption of work mould Formula reads the data of the sensor according to the interrupt signal of the sensor;When the operating mode of the sensor is to interrupt When operating mode, untreated interrupt signal is removed according to predetermined manner.
2. the method for reading data as described in claim 1, which is characterized in that described when the operating mode of the sensor is When interruption of work mode, removing untreated interrupt signal according to predetermined manner includes:
When the operating mode of the sensor is interruption of work mode, read on the sensor according to the second time interval The output signal of disconnected pin;
Judge whether the output signal is low level, to determine whether there is untreated interrupt signal;
If the output signal is low level, the untreated interrupt signal is removed, to restore the function of the sensor.
3. a kind of mobile terminal, which is characterized in that the mobile terminal includes:
Setup module, for when sensor starting, the data that the sensor is arranged to report frequency;
Module is obtained, for obtaining the status information of mobile terminal;
First read module, for the work of sensor to be arranged when the status information is that mobile terminal is in wake-up states Mode is runs mode, and the data of the sensor are read according to first time interval;
Second read module, for when the status information be mobile terminal in a dormant state when, the work of sensor is set Mode is interruption of work mode, and the data of the sensor are read according to the interrupt signal of the sensor;
Module is removed, for not locating according to predetermined manner removing when the operating mode of the sensor is interruption of work mode The interrupt signal of reason.
4. mobile terminal as claimed in claim 3, which is characterized in that the removing module includes:
Reading unit, for being read according to the second time interval when the operating mode of the sensor is interruption of work mode The output signal of interrupt pin on the sensor;
Judging unit, for judging whether the output signal is low level, to determine whether there is untreated interrupt signal;
Clearing cell removes the untreated interrupt signal if be low level for the output signal, described in restoring The function of sensor.
5. a kind of mobile terminal, which is characterized in that the mobile terminal includes processor and sensor;
The processor, for when sensor starting, the biography to be arranged before the status information for obtaining mobile terminal The data of sensor report frequency;Obtain the status information of mobile terminal;When the status information is that mobile terminal is in wake-up shape When state, the operating mode that sensor is arranged is runs mode, and the number of the sensor is read according to first time interval According to;When the status information be mobile terminal in a dormant state when, be arranged sensor operating mode be interruption of work mode, The data of the sensor are read according to the interrupt signal of the sensor;When the operating mode of the sensor is interruption of work When mode, untreated interrupt signal is removed according to predetermined manner.
6. mobile terminal as claimed in claim 5, which is characterized in that the processor is also used to:
When the operating mode of the sensor is interruption of work mode, read on the sensor according to the second time interval The output signal of disconnected pin;Judge whether the output signal is low level, to determine whether there is untreated interrupt signal; If the output signal is low level, the untreated interrupt signal is removed, to restore the function of the sensor.
CN201610939780.5A 2016-10-24 2016-10-24 The method and mobile terminal of reading data Active CN106506821B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610939780.5A CN106506821B (en) 2016-10-24 2016-10-24 The method and mobile terminal of reading data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610939780.5A CN106506821B (en) 2016-10-24 2016-10-24 The method and mobile terminal of reading data

Publications (2)

Publication Number Publication Date
CN106506821A CN106506821A (en) 2017-03-15
CN106506821B true CN106506821B (en) 2019-10-18

Family

ID=58319222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610939780.5A Active CN106506821B (en) 2016-10-24 2016-10-24 The method and mobile terminal of reading data

Country Status (1)

Country Link
CN (1) CN106506821B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110784915B (en) 2019-10-30 2021-08-17 维沃移动通信有限公司 Power consumption control method of electronic equipment and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102346054A (en) * 2010-07-22 2012-02-08 精工爱普生株式会社 Sensing device and electronic apparatus
CN105843365A (en) * 2016-03-24 2016-08-10 广东欧珀移动通信有限公司 Sensor control method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2402271B (en) * 2003-05-27 2006-04-19 Research In Motion Ltd Method and apparatus for handling a charging state in a mobile electronic device
CN106020423A (en) * 2016-05-25 2016-10-12 努比亚技术有限公司 Screen control device and method for terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102346054A (en) * 2010-07-22 2012-02-08 精工爱普生株式会社 Sensing device and electronic apparatus
CN105843365A (en) * 2016-03-24 2016-08-10 广东欧珀移动通信有限公司 Sensor control method and device

Also Published As

Publication number Publication date
CN106506821A (en) 2017-03-15

Similar Documents

Publication Publication Date Title
US20160247484A1 (en) Method for Generating Display Frame and Terminal Device
WO2015062235A1 (en) Electronic device, battery protecting method and apparatus
WO2018045878A1 (en) Touch screen parameter adjustment method and relevant product
EP2851779A1 (en) Method, device, storage medium and terminal for displaying a virtual keyboard
CN106484555B (en) The method and mobile terminal of abnormality detection and recovery
CN104915091B (en) A kind of method and apparatus for the prompt information that Shows Status Bar
CN106101776B (en) Method, smart machine and the speaker of volume adjustment
CN106445721B (en) The method and mobile terminal of house dog fault-tolerant processing
WO2019011335A1 (en) Mobile terminal and control method therefor, and readable storage medium
CN106055455B (en) The anti-interference method and device of a kind of button
CN110022567A (en) A kind of data transmission method and user terminal
CN106817489B (en) The reminding method and mobile terminal of message
CN110691168B (en) Screen control method and device of mobile terminal and storage medium
CN106385486B (en) A kind of control method of proximity sensor, device and mobile terminal
CN106066769B (en) A kind of processing method and mobile terminal of mobile terminal
CN105100361B (en) The way of recording and device of mobile terminal
CN107979385B (en) A kind of radio-frequency front-end data processing method and mobile terminal
CN106484141B (en) The setting method and mobile terminal of threshold value
CN109687922A (en) Signal monitoring method, device, storage medium and the mobile terminal of wireless network
CN106500751B (en) The calibration method and mobile terminal of proximity sensor
CN106506821B (en) The method and mobile terminal of reading data
CN109661022A (en) Network control method, system, storage medium and mobile terminal
CN106445778B (en) The method and mobile terminal of information processing
CN105681526B (en) The method and device of incoming call sound
CN111104012B (en) Distance measuring method and device, storage medium and terminal equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523841 usha Beach Road No. 18

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant