CN115221454A - Data processing method, processing device, electronic equipment and storage medium - Google Patents

Data processing method, processing device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115221454A
CN115221454A CN202210867894.9A CN202210867894A CN115221454A CN 115221454 A CN115221454 A CN 115221454A CN 202210867894 A CN202210867894 A CN 202210867894A CN 115221454 A CN115221454 A CN 115221454A
Authority
CN
China
Prior art keywords
air pressure
pressure data
data
processing mode
numerical value
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.)
Pending
Application number
CN202210867894.9A
Other languages
Chinese (zh)
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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202210867894.9A priority Critical patent/CN115221454A/en
Publication of CN115221454A publication Critical patent/CN115221454A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C5/00Measuring height; Measuring distances transverse to line of sight; Levelling between separated points; Surveyors' levels
    • G01C5/06Measuring height; Measuring distances transverse to line of sight; Levelling between separated points; Surveyors' levels by using barometric means
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01LMEASURING FORCE, STRESS, TORQUE, WORK, MECHANICAL POWER, MECHANICAL EFFICIENCY, OR FLUID PRESSURE
    • G01L27/00Testing or calibrating of apparatus for measuring fluid pressure
    • G01L27/002Calibrating, i.e. establishing true relation between transducer output value and value to be measured, zeroing, linearising or span error determination

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Algebra (AREA)
  • Pure & Applied Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Measuring Fluid Pressure (AREA)

Abstract

The application discloses a data processing method, a processing device, electronic equipment and a storage medium, and belongs to the technical field of electronic equipment. The processing method comprises the following steps: acquiring first air pressure data, wherein the first air pressure data is acquired by an air pressure sensor at the current moment; determining a corresponding data processing mode according to the first air pressure data, the second air pressure data and the third air pressure data, wherein the second air pressure data is historical air pressure data acquired by the sensor at the previous moment of the current moment, and the third air pressure data is air pressure data obtained after the second air pressure data is processed; and processing the third air pressure data based on the data processing mode to obtain processed target air pressure data.

Description

Data processing method, processing device, electronic equipment and storage medium
Technical Field
The present application relates to the field of electronic device technologies, and in particular, to a data processing method, a processing apparatus, an electronic device, and a storage medium.
Background
In the related art, altitude detection of electronic devices such as mobile phones depends on readings of barometric pressure sensors, and the altitude is determined based on barometric pressure values collected by the barometric pressure sensors. Because the existing mobile phone has certain air tightness in order to meet the requirements of water resistance and dust resistance, when the mobile phone is extruded by external force to cause deformation, air inside the mobile phone can not be discharged in time, and therefore air pressure inside the mobile phone is suddenly changed.
The conventional method for sudden change of air pressure in the prior art is to perform low-pass filtering on the readings of the air pressure sensor, but the low-pass filtering has the problems of data delay and data distortion, so that the readings of the air pressure sensor after the low-pass filtering are inaccurate.
Disclosure of Invention
An object of the embodiments of the present application is to provide a data processing method, a processing apparatus, an electronic device, and a storage medium, which can solve the problem of inaccurate reading of an air pressure sensor.
In a first aspect, an embodiment of the present application provides a data processing method, which is applied to an electronic device, where the electronic device includes an air pressure sensor, and the processing method includes:
acquiring first air pressure data, wherein the first air pressure data is acquired by an air pressure sensor at the current moment;
determining a corresponding data processing mode according to the first air pressure data, the second air pressure data and the third air pressure data, wherein the second air pressure data is historical air pressure data acquired by the sensor at the previous moment of the current moment, and the third air pressure data is air pressure data obtained after the second air pressure data is processed;
and processing the third air pressure data based on the data processing mode to obtain processed target air pressure data.
In a second aspect, an embodiment of the present application provides a data processing apparatus, which is applied to an electronic device, where the electronic device includes an air pressure sensor, and the processing apparatus includes:
the acquisition module is used for acquiring first air pressure data, and the first air pressure data is the air pressure data acquired by the air pressure sensor at the current moment;
the determining module is used for determining a corresponding data processing mode according to the first air pressure data, the second air pressure data and the third air pressure data, wherein the second air pressure data is historical air pressure data acquired by the sensor at a moment before the current moment, and the third air pressure data is air pressure data obtained after the second air pressure data is processed;
and the processing module is used for processing the third air pressure data based on the data processing mode to obtain the processed target air pressure data.
In a third aspect, embodiments of the present application provide an electronic device, including a processor and a memory, where the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, embodiments of the present application provide a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the steps of the method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product, stored in a storage medium, which is executed by at least one processor to implement a method as in the first aspect.
In the embodiment of the application, based on the air pressure data detected at the current moment and the air pressure data detected at a moment before the current moment, the change trend of the air pressure data in the recent time period is judged, whether sudden air pressure change caused by external force extrusion and the like exists is judged based on the change trend, and based on the judgment result, a proper data processing mode is determined, the air pressure data is processed, the influence of the sudden air pressure change caused by the external force extrusion on the reading of the air pressure sensor can be inhibited, the problem of inaccurate reading of the air pressure sensor is solved, and the measurement accuracy of the altitude of the electronic device is improved.
Drawings
FIG. 1 shows a flow diagram of a data processing method according to an embodiment of the application;
FIG. 2 is a schematic diagram illustrating data changes in a data processing method according to an embodiment of the present application;
FIG. 3 is a diagram illustrating the effect of processing barometric pressure data according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating changes in internal air pressure upon receipt of a squeeze by an electronic device according to an embodiment of the present application;
FIG. 5 shows a block diagram of a data processing apparatus according to an embodiment of the present application;
FIG. 6 shows a block diagram of an electronic device according to an embodiment of the application;
fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application are capable of operation in sequences other than those illustrated or described herein, and that the terms "first," "second," etc. are generally used in a generic sense and do not limit the number of terms, e.g., a first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/", and generally means that the former and latter related objects are in an "or" relationship.
The embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
In some embodiments of the present application, a data processing method is provided, which is applied to an electronic device, where the electronic device includes an air pressure sensor, and fig. 1 shows a flowchart of the data processing method according to an embodiment of the present application, and as shown in fig. 1, the method includes:
102, acquiring first air pressure data, wherein the first air pressure data is acquired by an air pressure sensor at the current moment;
104, determining a corresponding data processing mode according to the first air pressure data, the second air pressure data and the third air pressure data;
in step 104, the second air pressure data is historical air pressure data acquired by the sensor at a time before the current time, and the third air pressure data is air pressure data obtained by processing the second air pressure data;
and 106, processing the third air pressure data based on the data processing mode to obtain processed target air pressure data.
In the embodiment of the application, the electronic equipment such as the mobile phone acquires the air pressure data through the built-in air pressure sensor, and the calculation and the measurement of the altitude can be realized through the air pressure data, so that the electronic equipment has the function of measuring the current altitude.
Wherein, for satisfying waterproof dirt-proof needs, electronic equipment such as cell-phone all has good gas tightness generally, between its inner space and the outside, except the balancing hole that is used for balanced inside and outside atmospheric pressure of cell-phone of independent design, other positions all keep sealed, and in order to satisfy waterproof demand, still be provided with waterproof ventilative membrane in the balancing hole.
Because the aperture of the balance hole can not be designed to be large and the ventilation efficiency is limited, when the mobile phone body, such as a screen, a battery cover and the like, is extruded by external force, the screen and the battery cover can deform to a certain extent, so that the space inside the mobile phone is reduced, and the internal air pressure is increased. The reading of the air pressure sensor will then change abruptly.
In order to reduce the influence of the sudden change on the air pressure detection and the altitude measurement, when the current air pressure data, namely the first data, detected by the air pressure sensor in real time is obtained, historical reading data of the air pressure sensor at the previous moment of the current moment and air pressure data obtained after filtering the historical reading data, namely the second air pressure data and third air pressure data, are further obtained, wherein the third air pressure data is based on a determined data processing mode, proper processing is carried out on the second air pressure data, and therefore data after the influence of an external force on an image is removed.
The reading change trend of the air pressure sensor is judged based on the first air pressure data, the second air pressure data and the third air pressure data, so that whether sudden change occurs in the reading data of the air pressure sensor is judged, when the air pressure suddenly changes, an appropriate data processing mode is selected based on the characteristics of the air pressure change to process the air pressure data, fig. 2 shows a data change schematic diagram of the data processing method according to the embodiment of the application, fig. 3 shows an air pressure data processing effect diagram according to the embodiment of the application, and as shown in fig. 2 and fig. 3, the embodiment of the application can inhibit the influence of the sudden change of the air pressure caused by external force extrusion on the reading of the air pressure sensor, solve the problem that the reading of the air pressure sensor is inaccurate, and improve the measurement accuracy of the altitude of the electronic device.
In some embodiments of the present application, determining a corresponding data processing manner according to the first air pressure data, the second air pressure data, and the third air pressure data includes:
determining a first numerical value according to the difference value of the first air pressure data and the third air pressure data;
determining a second value according to the difference value of the first air pressure data and the second air pressure data;
and determining a data processing mode according to the first numerical value and the second numerical value.
In the embodiment of the application, the reading change trend of the air pressure sensor is judged based on the first air pressure data, the second air pressure data and the third air pressure data, so that whether the reading data of the air pressure sensor generates sudden change or not is judged.
Specifically, high-pressure air inside the mobile phone can be exhausted to the external environment through the balance hole, fig. 4 shows a schematic diagram of internal air pressure change when the electronic device receives extrusion according to the embodiment of the application, and as shown in fig. 4, in the process that the mobile phone is extruded to balance the internal air pressure and the external air pressure, the internal air pressure of the mobile phone can be suddenly increased and then decreased.
The data _ source is used for expressing the reading of the original air pressure value collected by the air pressure sensor, wherein the first air pressure data _ source n Is the reading of the original air pressure value collected by the air pressure sensor at the current time, namely the first air pressure data, data _ source n-1 And the historical air pressure value reading acquired by the air pressure sensor at the time before the current time is the second air pressure data.
The processed air pressure data, specifically the air pressure data after the influence caused by the sudden change of the air pressure due to the external force extrusion is suppressed, is expressed by data _ dest, so that the air pressure data is closer to the actual air pressure data compared with the original air pressure value reading. Wherein, data _ dest n-1 Is to data _ source n-1 That is, the third air pressure data after the second air pressure data is processed.
According to the first air pressure data _ source n And third air pressure data _ dest n-1 Determines a first value, denoted as date1, i.e. there is date1= data _ source n -data_dest n-1 . The first value date1 is used for measuring the variation of the air pressure in unit time, and whether the air pressure has sudden change can be judged according to the first value.
According to the first air pressure data _ source n And second air pressure data _ source n-1 Determines a second value, denoted as date2, i.e. there is date2= data _ source n -data_source n-1 . The second numerical value date2 is used to measure the trend of the air pressure change, wherein date2 indicates an upward trend of the air pressure when it is an integer, and indicates a downward trend of the air pressure when date2 is a negative number.
Whether sudden change occurs in the air pressure reading and the change trend can be accurately judged based on the comparison results of the first numerical value date1, the second numerical value date2 and the preset first threshold, the data processing mode is determined according to the judgment results, the current air pressure reading is processed, the influence of sudden change of the air pressure on the reading of the air pressure sensor caused by external force extrusion can be inhibited, the problem that the reading of the air pressure sensor is inaccurate is solved, and the measurement accuracy of the altitude of the electronic equipment is improved.
In some embodiments of the present application, determining the data processing manner according to the first value and the second value includes:
when the first numerical value is larger than a first threshold value and the second numerical value is larger than 0, determining that the data processing mode is a first processing mode;
determining the data processing mode as a second processing mode under the condition that the first numerical value is smaller than or equal to the inverse number of the first threshold value and the second numerical value is smaller than 0;
wherein, the first processing mode comprises: processing the third air pressure data according to a first preset variable corresponding to the first processing mode so as to enable the target air pressure data to increase linearly based on the first preset variable;
the second processing mode comprises the following steps: processing the third air pressure data according to a second preset variable corresponding to the second processing mode so as to enable the target air pressure data to be linearly reduced based on the second preset variable;
the first preset variation and the second preset variation are both constants.
In the embodiment of the present application, based on the first value date1 being greater than the first threshold, it can be determined that the increment of the air pressure reading in the unit time exceeds the set threshold, and it is determined that the read air pressure reading has a sudden change. If the second value date2 is greater than 0 at this time, the air pressure is in a rising state, and at this time, the data processing mode is determined to adopt a linear tracking of the rising of the actual air pressure according to a set first preset variation amount deta _ up, that is, the rising of the air pressure in the current time period is set to deta _ up, specifically, the rising of the air pressure reading is deta _ up in each preset time unit (from the previous time to the current time), so that sudden change of the air pressure is suppressed.
The method specifically comprises the following steps: when the beta 1 is satisfied>a and deta2>0, the processed third air pressure data _ dest n =data_dest n-1 +deta_up。
Where a is a first threshold, the first threshold a and the first preset variation amount deta _ up may be empirically set values, and exemplarily, the first threshold may be 2.5m/s and the first preset variation amount may be 1m/s, with the altitude change rate as a unit of the first threshold and the first preset variation amount.
Since the deta _ up is constant, when the deta1 is satisfied>a and deta2>0, the processed third air pressure data _ dest n Is the amount of linear increase in air pressure data relative to the last time instant.
Based on the opposite number of the first numerical value date1 being smaller than the first threshold, it can be determined that the decrement of the air pressure reading per unit time exceeds the set threshold, and it can be determined that the read air pressure reading has a sudden change. If the second value date2 is smaller than 0 at this time, the air pressure is in a descending state, and at this time, the data processing mode is determined to be that the ascending of the actual air pressure is linearly tracked according to the set second preset variation amount deta _ down, that is, the descending amount of the air pressure in the current time period is set to be deta _ down, specifically, the descending amount of the air pressure reading is deta _ down in each preset time unit (from the previous time to the current time), so that the sudden change of the air pressure is inhibited.
The method specifically comprises the following steps: when the amount of deta1 < -a and deta2 are satisfied>0, data _ dest n =data_dest n-1 -deta_down。
The second preset variation amount deta _ down may be a value set empirically, and may be 1m/s, for example, with the altitude change rate as a unit of the second preset variation amount.
Since deta _ down is constant, when deta1 < -a and deta2 are satisfied>0, the third air pressure data _ dest after processing n Is the amount of linear decrease relative to the air pressure data at the previous time.
The atmospheric pressure data are processed through the first processing mode or the second processing mode, the sudden change of the reading caused by sudden reduction of the atmospheric pressure due to external force extrusion can be restrained, the detection precision of the atmospheric pressure data is improved, and the accuracy of altitude measurement of the electronic equipment is improved.
In some embodiments of the present application, determining the data processing manner according to the first value and the second value includes:
determining the data processing mode as a third processing mode under the condition that the first numerical value is larger than the first threshold value and the second numerical value is smaller than or equal to 0;
determining the data processing mode as a fourth processing mode under the condition that the first numerical value is smaller than or equal to the inverse number of the first threshold value and the second numerical value is larger than or equal to 0;
wherein, the third processing mode comprises: processing the third air pressure data according to a first preset function corresponding to the third processing mode so as to enable the target air pressure data to increase in a nonlinear mode based on the first preset function;
the fourth processing mode comprises the following steps: processing the third air pressure data according to a second preset function corresponding to the fourth processing mode so as to enable the target air pressure data to be nonlinearly reduced based on the second preset function;
the first preset function and the second preset function are both curve function first preset functions.
In the embodiment of the present application, based on the first numerical value date1 being greater than the first threshold, it can be determined that the increase amount of the air pressure reading in the unit time exceeds the set threshold, and it is determined that the read air pressure reading has a sudden change. If the second value date2 is less than or equal to 0, the air pressure is in a decreasing state, and in order to prevent the linear tracking from causing excessive increment, a quadratic curve fitting mode of linear tracking rising is adopted to process the air pressure data (the nonlinear tracking is distinguished by the same change amount of each data relative to the linear tracking, and the nonlinear tracking is in a curve shape and is similar to a quadratic function).
The method specifically comprises the following steps:
when the deta1 > a and the deta2 is less than or equal to 0, the data _ dest n =data_dest n-1 +Conic_fitting_up;
Wherein, the configured _ fitting _ up is a first preset function, and the first preset function can be a quadratic curve fitting nonlinear ascending function, the first preset function, configured _ fixing _ up, can be empirically set as a three-segment piecewise function, and exemplarily, the first preset function, configured _ fixing _ up, is:
Figure BDA0003760148230000081
that is, when the absolute value of the deta2 is equal to or greater than 0.16m/s, the value of Conic _ fixing _ up is 0m/s, when the absolute value of the deta2 is less than 0.16m/s and greater than 0.1m/s, the value of Conic _ fixing _ up is 0.1m/s, and when the absolute value of the deta2 is less than 0.1m/s, the value of Conic _ fixing _ up is 0.1m/s.
Since the Conic _ fitting _ up is a fitted curve function, when the deca 1 > a and the deca 2 is less than or equal to 0, the processed third air pressure data _ dest n Is the amount of non-linear increase relative to the barometric pressure data at the previous time.
Determining the data processing mode as a fourth processing mode under the condition that the first numerical value is smaller than the inverse number of the first threshold value and the second numerical value is greater than or equal to 0; and
based on the data processing mode, processing the first air pressure data to obtain processed target air pressure data, including:
determining a second preset function according to the absolute value of the second numerical value;
and determining target air pressure data according to the difference between the third air pressure data and the second preset function.
In the embodiment of the present application, based on the opposite number of the first numerical value date1 being smaller than the first threshold, it can be determined that the decrease amount of the air pressure reading in unit time exceeds the set threshold, and it is determined that the read air pressure reading has a sudden change. If the second value date2 is greater than or equal to 0, the air pressure is in an increasing state, and in order to prevent the decrease due to the linear tracking from being excessive, the air pressure data is processed by adopting a quadratic curve fitting mode of linear tracking decrease.
The method specifically comprises the following steps:
when the deta1 is less than-a and the deta2 is more than or equal to 0, the data _ dest n =data_dest n-1 -Conic_fitting_down;
Wherein, conic _ fitting _ Down is a first predetermined function, which may be a quadratic curve fitting nonlinear rising function, the first preset function, config _ fixing _ down, may be empirically set as a three-segment piecewise function, and is exemplarily:
Figure BDA0003760148230000091
that is, when the absolute value of the deta2 is 0.16m/s or more, the value of Conic _ fixing _ Down is 0m/s, when the absolute value of the deta2 is less than 0.16m/s and more than 0.1m/s, the value of Conic _ fixing _ Down is 0.1m/s, and when the absolute value of eta2 is less than 0.1m/s, the value of Conic _ fixing _ Down is 0.1m/s.
Since the Conic _ fitting _ down is a fitted curve function, when the deca 1 is less than-a and the deca 2 is more than or equal to 0, the processed third air pressure data _ dest n Is the amount of non-linear decrease relative to the air pressure data at the previous time.
The atmospheric pressure data are processed through the third processing mode or the fourth processing mode, the sudden reading change caused by the sudden reduction of the atmospheric pressure due to external force extrusion can be restrained, the detection precision of the atmospheric pressure data is improved, and the altitude measurement accuracy of the electronic equipment is improved.
In some embodiments of the present application, after the first air pressure data is processed based on a data processing manner to obtain processed target air pressure data, the processing method further includes:
and replacing the processed target air pressure data with the third air pressure data under the condition that the absolute value of the difference value between the processed target air pressure data and the third air pressure data is larger than a second threshold value.
In the embodiment of the application, the data _ source is used for representing the reading of the original air pressure value collected by the air pressure sensor, wherein the first air pressure data _ source n The original air pressure value reading collected by the air pressure sensor at the current time.
The data _ dest represents the processed air pressure data, specifically the air pressure data which inhibits the influence caused by air pressure mutation due to external force extrusion, therefore, the air pressure data is closer to the actual air pressure data compared with the original air pressure value reading. Wherein, data _ dest n For the target air pressure data after processing the second air pressure data, data_dest n-1 Is the third air pressure data after processing the second air pressure data.
Calculating the difference value between the target air pressure data and the third air pressure data to obtain a third numerical value, which is marked as deta3, and then:
deta3=data_dest n -data_dest n-1
and determining an absolute value abs (deta 3) of the third numerical value deta3, and if abs (deta 3) is greater than the second threshold b, that is, abs (deta 3) > b is satisfied, determining that other abnormality occurs in the air pressure, which may be caused by slight squeezing or due to external reasons such as temperature and humidity of the mobile phone. And according to the basic principle that the air pressure slowly changes, exception is eliminated, and the target air pressure data processed at the moment is limited to be kept unchanged from the processed air pressure data at the previous moment. Namely replacing the target air pressure data with third air pressure data:
data_dest n =data_dest n-1
whether other abnormal conditions of the air pressure occur is judged based on the comparison result of the absolute value of the difference value of the processed target air pressure data and the third air pressure data and the second threshold, and the reading data of the sensor when the air pressure is abnormal is provided, so that the air pressure detection precision of the electronic equipment can be improved, and the reliability of altitude measurement can be improved.
In some embodiments of the present application, a data processing apparatus is provided, which is applied to an electronic device, where the electronic device includes an air pressure sensor, fig. 5 shows a block diagram of a data processing apparatus according to an embodiment of the present application, and as shown in fig. 5, a data processing apparatus 500 includes:
an obtaining module 502, configured to obtain first air pressure data, where the first air pressure data is air pressure data acquired by an air pressure sensor at a current time;
the determining module 504 is configured to determine a corresponding data processing manner according to the first air pressure data, the second air pressure data, and the third air pressure data, where the second air pressure data is historical air pressure data acquired by the sensor at a time previous to the current time, and the third air pressure data is air pressure data obtained by processing the second air pressure data;
the processing module 506 is configured to process the third air pressure data based on the data processing manner to obtain processed target air pressure data.
In the embodiment of the application, based on the air pressure data detected at the current moment and the air pressure data detected at a moment before the current moment, the change trend of the air pressure data in the recent time period is judged, whether sudden air pressure change caused by external force extrusion and the like exists is judged based on the change trend, and based on the judgment result, a proper data processing mode is determined, the air pressure data is processed, the influence of the sudden air pressure change caused by the external force extrusion on the reading of the air pressure sensor can be inhibited, the problem of inaccurate reading of the air pressure sensor is solved, and the measurement accuracy of the altitude of the electronic device is improved.
In some embodiments of the present application, the determining module is further configured to:
determining a first numerical value according to the difference value of the first air pressure data and the third air pressure data;
determining a second value according to the difference value of the first air pressure data and the second air pressure data;
and determining a data processing mode according to the first numerical value and the second numerical value.
In the embodiment of the application, based on the comparison result of the first numerical value date1, the second numerical value date2 and the preset first threshold, whether sudden change occurs in the air pressure reading and the change trend can be accurately judged, the data processing mode is determined according to the judgment result, the current air pressure reading is processed, the influence of the sudden change of the air pressure on the reading of the air pressure sensor caused by external force extrusion can be inhibited, the problem of inaccurate reading of the air pressure sensor is solved, and the measurement accuracy of the altitude of the electronic device is improved.
In some embodiments of the present application, the determining module is further configured to:
when the first numerical value is larger than a first threshold value and the second numerical value is larger than 0, determining that the data processing mode is a first processing mode;
determining the data processing mode as a second processing mode under the condition that the first numerical value is smaller than or equal to the inverse number of the first threshold value and the second numerical value is smaller than 0;
wherein, the first processing mode comprises the following steps: processing the third air pressure data according to a first preset variable corresponding to the first processing mode so as to enable the target air pressure data to increase linearly based on the first preset variable;
the second processing mode comprises the following steps: processing the third air pressure data according to a second preset variable corresponding to the second processing mode so as to enable the target air pressure data to be linearly reduced based on the second preset variable;
the first preset variation and the second preset variation are both constants.
In the embodiment of the application, the atmospheric pressure data is processed through the first processing mode or the second processing mode, so that the sudden change of the reading caused by sudden rise of the atmospheric pressure due to external force extrusion can be inhibited, the detection precision of the atmospheric pressure data is improved, and the accuracy of altitude measurement of the electronic equipment is improved.
In some embodiments of the present application, the determining module is further configured to:
determining the data processing mode as a third processing mode under the condition that the first numerical value is larger than the first threshold value and the second numerical value is smaller than or equal to 0;
determining the data processing mode as a fourth processing mode under the condition that the first numerical value is smaller than or equal to the inverse number of the first threshold value and the second numerical value is larger than or equal to 0;
wherein the third processing mode comprises: processing the third air pressure data according to a first preset function corresponding to the third processing mode so as to enable the target air pressure data to increase in a nonlinear mode based on the first preset function;
the fourth processing mode comprises the following steps: processing the third air pressure data according to a second preset function corresponding to the fourth processing mode so as to enable the target air pressure data to be nonlinearly reduced based on the second preset function;
the first preset function and the second preset function are both curve functions.
In the embodiment of the application, the air pressure data is processed through the third processing mode or the fourth processing mode, so that the sudden change of the reading caused by the sudden rise of the air pressure due to the extrusion of the external force can be inhibited, the detection precision of the air pressure data is improved, and the altitude measurement accuracy of the electronic equipment is improved.
In some embodiments of the present application, the processing device further comprises:
and the replacing module is used for replacing the processed target air pressure data with the third air pressure data under the condition that the absolute value of the difference value between the processed target air pressure data and the third air pressure data is smaller than a second threshold value.
In the embodiment of the application, whether other abnormal conditions of the air pressure occur is judged based on the comparison result of the absolute value of the difference value between the processed target air pressure data and the third air pressure data and the second threshold, and the reading data of the sensor when the air pressure is abnormal is provided, so that the air pressure detection precision of the electronic equipment can be improved, and the reliability of altitude measurement can be improved.
The data processing apparatus in the embodiments of the present application may be an electronic device, and may also be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be a device other than a terminal. The electronic Device may be, for example, a Mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and may also be a server, a Network Attached Storage (Network Attached Storage, NAS), a personal computer (NAS), a Television (TV), an assistant, a teller machine, a self-service machine, and the like, and the embodiments of the present application are not limited in particular.
The data processing apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android operating system (Android), an iOS operating system, or other possible operating systems, which is not specifically limited in the embodiments of the present application.
The data processing apparatus provided in this embodiment of the present application can implement each process implemented in the foregoing method embodiment, and is not described here again to avoid repetition.
Optionally, an electronic device is further provided in an embodiment of the present application, fig. 6 shows a block diagram of a structure of the electronic device according to the embodiment of the present application, and as shown in fig. 6, the electronic device 600 includes a processor 602, a memory 604, and a program or an instruction stored in the memory 604 and executable on the processor 602, and when the program or the instruction is executed by the processor 602, the processes of the foregoing method embodiments are implemented, and the same technical effect can be achieved, and details are not repeated here to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic device and the non-mobile electronic device described above.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
Those skilled in the art will appreciate that the electronic device 700 may also include a power supply (e.g., a battery) for powering the various components, and the power supply may be logically coupled to the processor 710 via a power management system, such that the functions of managing charging, discharging, and power consumption may be performed via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 710 is configured to obtain first air pressure data, where the first air pressure data is air pressure data acquired by an air pressure sensor at a current time;
determining a corresponding data processing mode according to the first air pressure data, the second air pressure data and the third air pressure data, wherein the second air pressure data is historical air pressure data acquired by the sensor at the previous moment of the current moment, and the third air pressure data is air pressure data obtained after the second air pressure data is processed;
and processing the third air pressure data based on the data processing mode to obtain processed target air pressure data.
In the embodiment of the application, based on the air pressure data detected at the current moment and the air pressure data detected at a moment before the current moment, the change trend of the air pressure data in the recent time period is judged, whether sudden air pressure change caused by external force extrusion and the like exists is judged based on the change trend, and based on the judgment result, a proper data processing mode is determined, the air pressure data is processed, the influence of the sudden air pressure change caused by the external force extrusion on the reading of the air pressure sensor can be inhibited, the problem of inaccurate reading of the air pressure sensor is solved, and the measurement accuracy of the altitude of the electronic device is improved.
Optionally, the processor 710 is further configured to determine a first value according to a difference between the first air pressure data and the third air pressure data;
determining a second value according to the difference value of the first air pressure data and the second air pressure data;
and determining a data processing mode according to the first numerical value and the second numerical value.
In the embodiment of the application, based on the comparison result of the first numerical value date1, the second numerical value date2 and the preset first threshold, whether sudden change occurs in the air pressure reading and the change trend can be accurately judged, the data processing mode is determined according to the judgment result, the current air pressure reading is processed, the influence of the sudden change in the air pressure on the reading of the air pressure sensor caused by external force extrusion can be inhibited, the problem that the reading of the air pressure sensor is inaccurate is solved, and the measurement accuracy of the altitude of the electronic device is improved.
Optionally, the processor 710 is further configured to determine that the data processing manner is the first processing manner when the first value is greater than the first threshold and the second value is greater than 0;
determining the data processing mode as a second processing mode under the condition that the first numerical value is smaller than or equal to the inverse number of the first threshold value and the second numerical value is smaller than 0;
wherein, the first processing mode comprises the following steps: processing the third air pressure data according to a first preset variable corresponding to the first processing mode so as to enable the target air pressure data to increase linearly based on the first preset variable;
the second processing mode comprises the following steps: processing the third air pressure data according to a second preset variable corresponding to the second processing mode so as to enable the target air pressure data to be linearly reduced based on the second preset variable;
the first preset variation and the second preset variation are both constants.
In the embodiment of the application, the atmospheric pressure data is processed through the first processing mode or the second processing mode, so that the sudden change of the reading caused by the sudden rise of the atmospheric pressure due to the extrusion of the external force can be inhibited, the detection precision of the atmospheric pressure data is improved, and the altitude measurement accuracy of the electronic equipment is improved.
Optionally, the processor 710 is further configured to determine that the data processing manner is a third processing manner when the first value is greater than the first threshold and the second value is less than or equal to 0;
determining the data processing mode as a fourth processing mode under the condition that the first numerical value is less than or equal to the inverse number of the first threshold value and the second numerical value is greater than or equal to 0;
wherein the third processing mode comprises: processing the third air pressure data according to a first preset function corresponding to the third processing mode so as to enable the target air pressure data to increase in a nonlinear mode based on the first preset function;
the fourth processing mode comprises the following steps: processing the third air pressure data according to a second preset function corresponding to the fourth processing mode so as to enable the target air pressure data to be reduced in a nonlinear mode based on the second preset function;
the first preset function and the second preset function are both curve functions.
In the embodiment of the application, the air pressure data is processed through the third processing mode or the fourth processing mode, so that the sudden change of the reading caused by the sudden rise of the air pressure due to the extrusion of the external force can be inhibited, the detection precision of the air pressure data is improved, and the altitude measurement accuracy of the electronic equipment is improved.
Optionally, the processor 710 is further configured to replace the processed target air pressure data with the third air pressure data if an absolute value of a difference between the processed target air pressure data and the third air pressure data is smaller than a second threshold.
In the embodiment of the application, whether other abnormal conditions of the air pressure occur is judged based on the comparison result of the absolute value of the difference value between the processed target air pressure data and the third air pressure data and the second threshold, and the reading data of the sensor when the air pressure is abnormal is provided, so that the air pressure detection precision of the electronic equipment can be improved, and the reliability of altitude measurement can be improved.
It should be understood that in the embodiment of the present application, the input Unit 704 may include a Graphics Processing Unit (GPU) 7041 and a microphone 7042, and the Graphics Processing Unit 7041 processes image data of still pictures or videos obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also referred to as a touch screen. The touch panel 7071 may include two portions, a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The memory 709 may be used to store software programs as well as various data. The memory 709 may mainly include a first storage area for storing a program or an instruction and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or an instruction (such as a sound playing function, an image playing function, and the like) required by at least one function, and the like. Further, the memory 709 may include volatile memory or nonvolatile memory, or the memory 709 may include both volatile and nonvolatile memory. The non-volatile memory may be a Read-only memory (ROM), a programmable Read-only memory (PROM), an erasable programmable Read-only memory (erasabprom, EPROM), an electrically erasable programmable Read-only memory (EEPROM), or a flash memory. The volatile Memory may be a Random Access Memory (RAM), a Static Random Access Memory (Static RAM, SRAM), a Dynamic Random Access Memory (Dynamic RAM, DRAM), a Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, ddr SDRAM), an Enhanced Synchronous SDRAM (ESDRAM), a Synchronous DRAM (SLDRAM), and a Direct Memory bus RAM (DRRAM). The memory 709 in embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
Processor 710 may include one or more processing units; optionally, the processor 710 integrates an application processor, which mainly handles operations related to the operating system, user interface, application programs, etc., and a modem processor, which mainly handles wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into processor 710.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements the processes of the foregoing method embodiments, and can achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device in the above embodiment. Readable storage media, including computer-readable storage media, such as computer Read-Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, etc.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement the processes of the foregoing method embodiment, and the same technical effects can be achieved.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
Embodiments of the present application provide a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the processes of the foregoing method embodiments, and achieve the same technical effects, and in order to avoid repetition, details are not described here again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of another like element in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method of the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the present embodiments are not limited to those precise embodiments, which are intended to be illustrative rather than restrictive, and that various changes and modifications may be effected therein by one skilled in the art without departing from the scope of the appended claims.

Claims (12)

1. A data processing method is applied to an electronic device, and is characterized in that the electronic device comprises an air pressure sensor, and the processing method comprises the following steps:
acquiring first air pressure data, wherein the first air pressure data is acquired by an air pressure sensor at the current moment;
determining a corresponding data processing mode according to the first air pressure data, the second air pressure data and the third air pressure data, wherein the second air pressure data is historical air pressure data acquired by the sensor at a time before the current time, and the third air pressure data is air pressure data obtained after the second air pressure data is processed;
and processing the third air pressure data based on the data processing mode to obtain processed target air pressure data.
2. The data processing method of claim 1, wherein determining the corresponding data processing mode according to the first air pressure data, the second air pressure data and the third air pressure data comprises:
determining a first numerical value according to the difference value of the first air pressure data and the third air pressure data;
determining a second value according to the difference value of the first air pressure data and the second air pressure data;
and determining the data processing mode according to the first numerical value and the second numerical value.
3. The data processing method of claim 2, wherein the determining the data processing mode according to the first numerical value and the second numerical value comprises:
when the first numerical value is larger than a first threshold value and the second numerical value is larger than 0, determining that the data processing mode is a first processing mode;
determining the data processing mode to be a second processing mode when the first numerical value is smaller than or equal to the inverse number of the first threshold and the second numerical value is smaller than 0;
wherein the first processing mode comprises the following steps: processing the third air pressure data according to a first preset variation corresponding to the first processing mode so as to enable the target air pressure data to increase linearly according to the first preset variation;
the second processing mode comprises the following steps: processing the third air pressure data according to a second preset variable corresponding to the second processing mode, so that the target air pressure data is linearly reduced according to the second preset variable;
wherein the first preset variation and the second preset variation are both constants.
4. The data processing method of claim 2, wherein the determining the data processing mode according to the first numerical value and the second numerical value comprises:
determining the data processing mode to be a third processing mode under the condition that the first numerical value is larger than a first threshold value and the second numerical value is smaller than or equal to 0;
determining the data processing mode to be a fourth processing mode when the first numerical value is smaller than or equal to the inverse number of the first threshold value and the second numerical value is larger than or equal to 0;
wherein the third processing mode comprises: processing the third air pressure data according to a first preset function corresponding to the third processing mode so as to enable the target air pressure data to increase in a nonlinear mode according to the first preset function;
the fourth processing mode comprises the following steps: processing the third air pressure data according to a second preset function corresponding to the fourth processing mode, so that the target air pressure data is reduced in a nonlinear mode according to the second preset function;
wherein the first preset function and the second preset function are both curve functions.
5. The data processing method according to any one of claims 2 to 4, wherein after the third air pressure data is processed based on the data processing manner to obtain processed target air pressure data, the processing method further includes:
and replacing the processed target air pressure data with the third air pressure data under the condition that the absolute value of the difference value between the processed target air pressure data and the third air pressure data is larger than a second threshold value.
6. A data processing device applied to an electronic device, wherein the electronic device comprises an air pressure sensor, the processing device comprises:
the acquisition module is used for acquiring first air pressure data, wherein the first air pressure data is acquired by the air pressure sensor at the current moment;
the determining module is used for determining a corresponding data processing mode according to the first air pressure data, the second air pressure data and the third air pressure data, wherein the second air pressure data is historical air pressure data acquired by the sensor at a moment before the current moment, and the third air pressure data is air pressure data obtained after the second air pressure data is processed;
and the processing module is used for processing the third air pressure data based on the data processing mode to obtain processed target air pressure data.
7. The data processing apparatus of claim 6, wherein the determining module is further configured to:
determining a first numerical value according to the difference value of the first air pressure data and the third air pressure data;
determining a second value according to the difference value of the first air pressure data and the second air pressure data;
and determining the data processing mode according to the first numerical value and the second numerical value.
8. The data processing apparatus of claim 7, wherein the determining module is further configured to:
determining the data processing mode to be a first processing mode under the condition that the first numerical value is larger than a first threshold value and the second numerical value is larger than 0;
determining the data processing mode to be a second processing mode when the first numerical value is smaller than or equal to the inverse number of the first threshold and the second numerical value is smaller than 0;
wherein the first processing mode comprises the following steps: processing the third air pressure data according to a first preset variation corresponding to the first processing mode so as to enable the target air pressure data to increase linearly according to the first preset variation;
the second processing mode comprises the following steps: processing the third air pressure data according to a second preset variable corresponding to the second processing mode, so that the target air pressure data is linearly reduced according to the second preset variable;
the first preset variation and the second preset variation are both constants.
9. The data processing apparatus of claim 7, wherein the determining module is further configured to:
determining the data processing mode to be a third processing mode under the condition that the first numerical value is larger than a first threshold value and the second numerical value is smaller than or equal to 0;
determining the data processing mode to be a fourth processing mode when the first numerical value is smaller than or equal to the inverse number of the first threshold value and the second numerical value is larger than or equal to 0;
wherein the third processing mode comprises:
processing the third air pressure data according to a first preset function corresponding to the third processing mode so as to enable the target air pressure data to increase in a nonlinear mode according to the first preset function;
the fourth processing mode comprises the following steps: processing the third air pressure data according to a second preset function corresponding to the fourth processing mode, so that the target air pressure data is reduced in a nonlinear mode according to the second preset function;
the first preset function and the second preset function are both curve functions.
10. The data processing apparatus according to any one of claims 6 to 9, further comprising:
and the replacing module is used for replacing the processed target air pressure data with the third air pressure data under the condition that the absolute value of the difference value between the processed target air pressure data and the third air pressure data is greater than a second threshold value.
11. An electronic device comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions when executed by the processor implementing the steps of the data processing method of any one of claims 1 to 5.
12. A readable storage medium, on which a program or instructions are stored, which, when executed by a processor, carry out the steps of the data processing method according to any one of claims 1 to 5.
CN202210867894.9A 2022-07-21 2022-07-21 Data processing method, processing device, electronic equipment and storage medium Pending CN115221454A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210867894.9A CN115221454A (en) 2022-07-21 2022-07-21 Data processing method, processing device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210867894.9A CN115221454A (en) 2022-07-21 2022-07-21 Data processing method, processing device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115221454A true CN115221454A (en) 2022-10-21

Family

ID=83614752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210867894.9A Pending CN115221454A (en) 2022-07-21 2022-07-21 Data processing method, processing device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115221454A (en)

Similar Documents

Publication Publication Date Title
CN111797293B (en) Data adjustment method, device, terminal equipment and storage medium
US20150310583A1 (en) Systems and methods for animating a view of a composite image
CN111475384B (en) Shell temperature calculation method and device, storage medium and electronic equipment
CN108898082B (en) Picture processing method, picture processing device and terminal equipment
CN108961267B (en) Picture processing method, picture processing device and terminal equipment
CN105005972A (en) Shooting distance based distortion correction method and mobile terminal
CN105022538A (en) Systems and methods for tracking baseline signals for touch detection
CN114740996A (en) Signal acquisition method and electronic equipment
US10982971B2 (en) Method and apparatus for detecting background noise of sensor
CN111473887B (en) Shell temperature acquisition method and device, storage medium and electronic equipment
CN115221454A (en) Data processing method, processing device, electronic equipment and storage medium
CN113934365A (en) Data management system, data management method, and recording medium having data management program recorded thereon
CN110809083B (en) Mobile terminal information reminding method, mobile terminal and storage medium
CN116797973A (en) Data mining method and system applied to sanitation intelligent management platform
CN108760042B (en) Optical sensor calibration method and device, mobile device, medium and electronic device
CN108932704B (en) Picture processing method, picture processing device and terminal equipment
CN116295902A (en) Method and device for detecting environmental temperature of electronic equipment
EP3929684B1 (en) Data management system, data management method, and data management program
CN115514860A (en) Dynamic frame rate compensation method, image processing circuit and electronic device
CN115355992A (en) Temperature determination method and device and electronic equipment
US20190303177A1 (en) Adaptive User Interface Based On Detection Of User Positions
US20210027434A1 (en) Systems and Methods for Leveling Images
CN114298403A (en) Method and device for predicting attention degree of work
CN112857613A (en) Method and device for determining shell temperature, storage medium and electronic equipment
CN114441848A (en) Power consumption determination method and device, electronic equipment and storage medium

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