Invention content
The purpose of the present invention can be realized by following technical measures:
First aspect present invention provides a kind of batch processing method of sensing data, and this method includes:
Sensing data is continuously acquired within first time with the first sampling rate;
Data compression process is carried out to obtained current sensor data to obtain corresponding compressed data, according to the compression number
According to the corresponding position designation date of compressive state generation, gained compressed data and gained position designation date are stored respectively to first and deposited
Reservoir is arranged with being formed in the first memory by compressed data according to the first data that the time sequencing for reaching input port arranges
And the position instruction row that position designation date one-to-one with compressed data is formed;
Data reconstruction is carried out successively to each compressed data that the first data arrange according to institute's rheme instruction row and number will be reconstructed
According to being transmitted to application processor successively.
Preferably, this method further includes following steps:
The analog signal of sensor is converted into digital signal to form sensing data.
Preferably, the data compression process includes:
By high-order Processing for removing is carried out less than or equal to the sensing data of first threshold to form compressed data;Or
It will be greater than the sensing data of first threshold divided by the first scalar carry out data and reduces to form compressed data.
Preferably, the compressive state includes the confined state of corresponding data reduction process and corresponding high-order Processing for removing
Non-compressed state, institute's rheme designation date include be used to indicate confined state the first designation date and be used to indicate it is non-depressed
Second designation date of contracting state.
Preferably, the data reconstruction includes:
When the corresponding position designation date of compressed data is the first designation date, compressed data is multiplied by the first scalar;When
When the corresponding position designation date of compressed data is the second designation date, using compressed data as reconstruct data.
Second aspect of the present invention provides a kind of batch processing device of sensing data, including:
Data comparator, for current sensor data and first threshold to be compared to obtain the first comparison result;
Data compressor, for being obtained according to the first comparison result to current sensor data progress data compression process
It is arranged by the first data that compressed data is formed;
Position indicator, for being generated according to the compressive state of each compressed data in the first data row with compressed data one by one
The position instruction row that corresponding position designation date is formed, institute's rheme designation date are used to indicate the compressive state of compressed data;And
Data reconstruction device, the compressed data for being arranged according to institute's rheme instruction row the first data carry out data reconstruction successively
Data are reconstructed to obtain.
Preferably, which further includes:
Analog-digital converter, for the analog signal of sensor to be converted to digital signal to form sensing data.
A kind of portable electronic device of third aspect present invention, including:
At least one sensor;
One GNSS signal receiver for being used to obtain position location;
For caching the first memory of sensing data;
For being handled sensing data and being triggered according to handling result the application processor of application affairs;
For carrying out the data batch processing device of batch processing to sensing data, for performing following process:
Sensing data is continuously acquired within first time with the first sampling rate;
Data compression process is carried out to obtained current sensor data to obtain corresponding compressed data, according to the compression number
According to the corresponding position designation date of compressive state generation, gained compressed data and gained position designation date are stored respectively to first and deposited
Reservoir is arranged with being formed in the first memory by compressed data according to the first data that the time sequencing for reaching input port arranges
And the position instruction row that position designation date one-to-one with compressed data is formed;
Data reconstruction is carried out successively to each compressed data that the first data arrange according to institute's rheme instruction row and number will be reconstructed
According to being transmitted to application processor successively.
Preferably, which further includes:
For showing the display device of application affairs.
Fourth aspect present invention provides a kind of storage medium, which contains program, and described program is in quilt
The batch processing method of above-mentioned sensing data is realized during execution.
The batch processing method of sensor of the invention data first arranges the sensing data of multiple data samples composition and carries out
Compression processing is cached again, and the compressive state of row designation date is indicated by position, facilitates data reconstruction, is disappeared reducing electric energy
The situation of memory constraints is alleviated on the basis of consumption, without carrying out data displacement, without setting flag position, accelerates processing speed
Degree.
Specific embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, below in conjunction with the accompanying drawings and specific implementation
Example is described in further detail the present invention.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention,
It is not intended to limit the present invention.
It is below for embodiments of the present invention and specifically real in order to make the narration of this disclosure more detailed with complete
It applies example and proposes illustrative description;But this not implements or the unique forms with the specific embodiment of the invention.Embodiment
In cover multiple specific embodiments feature and to construction with operate these specific embodiments method and step it is suitable with it
Sequence.However, it can also reach identical or impartial function and sequence of steps using other specific embodiments.
<Embodiment of the method>
Fig. 1 illustrates one embodiment of the batch processing method of sensor of the invention data, batch of the sensing data
Processing method includes the following steps:
S1 continuously acquires sensing data with the first sampling rate within first time;
S2 carries out obtained current sensor data data compression process to obtain corresponding compressed data, according to the pressure
The corresponding position designation date of compressive state generation of contracting data stores gained compressed data and gained position designation date respectively to the
One memory, to form the first number arranged by compressed data according to the time sequencing for reaching input port in the first memory
The position formed according to row and position designation date one-to-one with compressed data indicates row;
S3 carries out data reconstruction to each compressed data that the first data arrange according to this instruction row and will reconstruct number successively
According to being transmitted to application processor successively.
It should be noted that above-mentioned sensor includes one or more of accelerometer, gyroscope or magnetometer.
It should be noted that the sensing data in the present embodiment is preferably numerical data, that is to say, that in the present embodiment
Sensing data be sensor initial numberical data, the reading of representative sensor.
It should be noted that in the present embodiment, (a setting threshold is not above when sensor data readings are smaller
Value), without carrying out data compression, the change to data coding method may be pertained only to, does not have change data value, this specification is
Convenient for being described collectively, this process is also referred to as to a kind of mode of data compression process.
It should be noted that when carrying out data acquisition to sensor, when can collect first according to the first sampling rate
Interior all the sensors data, often collect a sensing data, it are compressed immediately and is given birth to according to compressive state
Into position designation date, gained current compression data and present bit designation date are stored, with passing through during first time,
The first data row and position instruction row are formd in the first memory, and the first data row are suitable according to the time for reaching input port
The corresponding compressed data of ordered pair sensing data is ranked up and is formed, and position instruction row are and the one-to-one position of compressed data
What designation date was formed, position instruction row put in order and putting in order of arranging of the first data is consistent.For example, according to every 1/
The primary frequency of 10 seconds acquisition accelerometer datas, all accelerometer datas acquired in 5 minutes is acquired successively, one
3000 accelerometer datas are shared, this 3000 acceleration informations are compressed and deposited successively according to the time sequencing of acquisition
Storage.
As a preferred embodiment of the present embodiment, in step s 2, which includes:
By high-order Processing for removing is carried out less than or equal to the sensing data of first threshold to form compressed data;Or
It will be greater than the sensing data of first threshold divided by the first scalar carry out data and reduces to form compressed data.
As a preferred embodiment of the present embodiment, in step s 2, which is reduced including corresponding data
The non-compressed state of the confined state of process and corresponding high-order Processing for removing, position designation date include being used to indicate by compression shape
First designation date of state and the second designation date for being used to indicate non-compressed state.
As a preferred embodiment of the present embodiment, in step s3, which includes:
When the corresponding position designation date of compressed data is the first designation date, compressed data is multiplied by the first scalar;When
When the corresponding position designation date of compressed data is the second designation date, using compressed data as reconstruct data.
Fig. 2 illustrates one embodiment of the batch processing method of sensor of the invention data, embodiment shown in Fig. 1
On the basis of, the present embodiment further includes following steps before step S1:
The analog signal of sensor is converted to digital signal to form sensing data by S0.
Specifically, in a preferred embodiment, step S0 can be held by the analog-digital converter in sensor processor
Row.
It is below that 8 bit digitals are by 16 bit digitals (i.e. initial data is 16 bit digital), compressed data of sensing data
The above process is described in detail in example.
The given processor of one or more sensors processor as sensor chip component part includes a mould
Number (A/D) converter, for providing the amplitude of the continuous part of the numerical data representative sensor signal of its output.Namely
It says, the amplitude of the continuous part of the digital data form representative sensor signal of sensing data.Such as:If one or more
The given processor of a sensor processor is configured that accelerometer can be used to obtain sensing data in every 1/10 second, then modulus
Converter can sample the sensor signal in analog acceleration signal and generate digital sensing corresponding with sensor information
Device data.Sensing data is accelerometer readings, and starts to be digitized as 16 bit digital (data types by analog-digital converter
For short [int], between the integer value ranging from 32,767 to -32,768 of such data).Such as:If one or more passes
The given processor of sensor processor be configured can use accelerometer acquisition given time sensing data (such as:5 points
Clock), it does not need to application processor and is converted into active state, then may determine that a batch of instruction accelerometer readings time series passes
Sensor data.For three-dimensional accelerometer, the size of data of a collection of sensing data is about 18K.
It please referring to shown in Fig. 3, Fig. 3 illustrates a data packet, each data packet is cached in first memory,
The arrangement of compressed data that can be formed after overcompression with indication sensor data.The data packet includes a position instruction row and one
A first data row, wherein, position instruction row are also known as bit field head or bit sequence, and position instruction row include 0 and 1 two data class
Type, i.e., one is the first designation date, another is the second designation date, for example, the first designation date is 1, the second indicated number
According to being 0, it is, 1 compressed data for representing corresponding sensor represents the compression of corresponding sensor as confined state, 0
Data are non-compressed state.It is of course also possible to so that the first designation date is 0, the second designation date is 1.First data are classified as
Data field, the byte sequence represented including a belt sensor data sequence value.
According to the characteristic of sensor, one or more sensings such as accelerometer, gyroscope, compass and magnetometer sensor
There may be the sensor signals of different amplitudes corresponding from mankind's activity for device.Such as:Movement shape is waited when a people is in walk
During state, the acceleration signal reading that accelerometer is potentially based on synthesis judges an acceleration amplitude, and usually acceleration width
The output picture of value is sine wave.
When the mankind remain static, the amplitude of sensor signal may change, therefore pass in a small range at any time
The order of magnitude of sensor data is digitized by analog-digital converter in the range of small value, such as:X-axis, y-axis and z-axis gyroscope readings (number
According to grade) it is 17,13 and 17, x-axis, y-axis and z-axis magnetometer readings (amplitude) they are -98,120 and 45.In such examples, it senses
The order of magnitude of device data less than the first threshold values (such as:+/-128).Therefore, 16 are used for original sensor data, can pass through
The process of elimination is inferred to use less position and (refers to unpacked data).The process of elimination is that the least-significant byte of given integer value includes
The order of magnitude of sensing data, most-significant byte data are ignored.As shown in Fig. 2, preceding 2 " 0 " of position instruction row (bit field head point) are aobvious
The compressive state for showing preceding 2 sensor compressed datas of the first data row (data field part) is uncompressed, due to its most-significant byte
It is eliminated, which represented by 8 level sensor data, is represented by 16 original sensor datas.
When the mankind are in mobile status, the amplitude of sensor signal may in this way pass at any time in a wide range of interior variation
The order of magnitude of sensor data is digitized by analog-digital converter in the range of big value.Such as:X-axis, y-axis and z-axis gyro sensors
Device reading (order of magnitude) is 10482, -4077 and -31038, and Magnetic Sensor reading (amplitude) is -163,130 and -171.Show herein
In example, the amplitude of sensing data be more than the first threshold values (such as:+/-128).In this way, 16 can for original sensor data
It can be compressed (data referred to as compressed) by the process of data reduction.The process that data reduce compression is as follows:Sensing data
The order of magnitude divided by first scalar (such as:128th, 256), except later as a result, or the quotient of two integers can be considered as passing
The compressed data of sensor, and be included in 8.As shown in Fig. 2, the 3rd to the 6th use in bit field head point " 1 " instruction.This
The third of display data domain part, the four, the 5th and the 6th data are compressed by the first scalar, can pass through 8 in this way
Level sensor data are represented rather than are represented by 16 original sensor datas.
When position, instruction row may be compressed in itself, the data compression scheme of description may realize 1.7~1.9 compression ratios,
Because sensing data array bit instruction row are relevant to usually than sparse.Such as:This compression may be the letter of huffman coding
Simple form formula.If compression still works, position instruction row should be mainly made of null byte.These null bytes may pass through single position
It represents.
In step s3, it indicates that the information in row (bit field head) is identified in the first data row (data field) using position to be compressed
Or uncompressed sensing data, it can accelerate and simplify the reconstruct of sensing data in this way.Such as:As shown in Fig. 2, in bit field
The first two position with " 0 " indicate.This illustrates that the first two sensing data of data field is uncompressed, and can directly judge corresponding pressure
Contracting data are sensing data.As shown in Fig. 2, the third of data field, the four, the 5th and the 6th data are compressed, can lead to
It crosses and is multiplied by first scalar by the determining sensing data of compressed data reconstruct.
It should be noted that it can only store one group of first data for caching the first memory of sensor compressed data
Row and position instruction row, carry out the acquisition of next round data and batch process again after this group of data transmission to application processor.With
Multigroup first data row and position instruction row can also be stored simultaneously in the first memory of caching sensor compressed data.
<Device embodiment>
Correspondingly, the embodiment of the present invention additionally provides a kind of batch processing device 100 of sensing data, is used to implement above-mentioned
Sensing data batch processing method, please refer to shown in Fig. 4, which includes:Data comparator 10, data compressor
20th, position indicator 30 and data reconstructor 40, wherein, data comparator 10 be used for by current sensor data and first threshold into
Row compares to obtain the first comparison result;Data compressor 20 is used to carry out current sensor data according to the first comparison result
Data compression process is arranged with obtaining by the first data that compressed data is formed;Position indicator 30 is used for each in being arranged according to the first data
The position instruction that the compressive state generation of a compressed data is formed with the one-to-one position designation date of compressed data arranges, position indicated number
According to the compressive state for being used to indicate compressed data;Data reconstruction device 40 is used to be indicated to arrange the compression for arranging the first data according to this
Data carry out data reconstruction to obtain reconstruct data successively.
Further, in one preferred embodiment of the present embodiment, which further includes analog-digital converter 50, uses
In the analog signal of sensor is converted to digital signal to form sensing data.
The batch processing device 100 of the sensing data of the present embodiment can be software service merely, or software and hardware
With reference to device.The batch processing device 100 and first memory of the sensing data of the present embodiment may be directly applied to sense
In device processor, memory of the first memory as sensor processor will be built in the software module of the device 100 of the present embodiment
In processing chip.Data comparator 10, data compressor 20 and position indicator 30, which combine, can perform above method reality
Apply the step S2 of example;Data reconstruction device can perform the step S3 of above method embodiment.Analog-digital converter 50 can perform
State the step S0 of embodiment of the method.
In device embodiment, which includes corresponding data and reduces the confined state of process and correspond to high-order eliminate
The non-compressed state of processing, position designation date include being used to indicate the first designation date of confined state and be used to indicate non-depressed
Second designation date of contracting state.
Accordingly, as a preferred embodiment, data compressor 20 further comprises the first compression unit and second
Compression unit, wherein, the first compression unit carries out high-order Processing for removing for that will be less than or equal to the sensing data of first threshold
To form compressed data;Second compression unit is used to will be greater than the sensing data of first threshold divided by the first scalar carries out data
It reduces to form compressed data.Data reconstruction device 40 is when carrying out data reconstruction, when the corresponding position designation date of compressed data is
During the first designation date, compressed data is multiplied by the first scalar;When the corresponding position designation date of compressed data is the second indicated number
According to when, using compressed data as reconstruct data.
It should be noted that for device class embodiment, since it is basicly similar to embodiment of the method, so description
It is fairly simple, the relevent part can refer to the partial explaination of embodiments of method, herein without repeating one by one.
<Apparatus embodiments>
The embodiment of the present invention additionally provides a kind of portable electronic device, please refers to shown in Fig. 5, the portable electronic device
Including:At least one sensor, a GNSS signal receiver, first memory, application processor and data batch processing device,
Wherein, for obtaining portable electronic device position location, first memory is used to cache sensor number GNSS signal receiver
According to the step of data batch processing device is by performing above method embodiment carries out batch processing to sensing data, using processing
Device is used to handle sensing data and triggers application affairs according to handling result.
Specifically, data batch processing device is used to perform following process:
Sensing data is continuously acquired within first time with the first sampling rate;
Data compression process is carried out to obtained current sensor data to obtain corresponding compressed data, according to the compression number
According to the corresponding position designation date of compressive state generation, gained compressed data and gained position designation date are stored respectively to first and deposited
Reservoir is arranged with being formed in the first memory by compressed data according to the first data that the time sequencing for reaching input port arranges
And the position instruction row that position designation date one-to-one with compressed data is formed;
It indicates to arrange according to this and data reconstruction is carried out successively to each compressed data that the first data arrange and data will be reconstructed
It is transmitted to application processor successively.
It should be noted that above-mentioned data batch processing device can also be real by the way of in above device embodiment
It is existing, it is therefore intended that the step of implementation method embodiment.
The initial data that sensor acquires whithin a period of time is cached to first after the processing of data batch processing device and is deposited
Reservoir is handled by being transmitted to application processor after data reconstruction, and application processor can be according to the data of sensor
Activity recognition is carried out, then navigation feature and/or other functions are realized in the position location that GNSS receiver is coordinated to obtain.
Further, the portable electronic device of the present embodiment further includes the display device for showing application affairs, with
And second memory, second memory can store the program of behavior recognizer, the program of location determination algorithm and map number
According to, the program of the recognizer in second memory and the program of location determination algorithm when executed, realize Activity recognition and
Location determination, wherein, the realization of Activity recognition is based on sensing data, what the realization of location determination was obtained based on GNSS receiver
Position location.
Further, the portable electronic device of the present embodiment further includes what is be all connected with sensor and fifo queue
Sensor processor, above-mentioned data batch processing device are built in the sensor processor.Sensor processor can be with biography
Sensor is arranged in a one-to-one correspondence, and a sensor processor can also be only set, for example, a sensor special processor.Such as:
The given processor of one or more sensors processor is probably as the processor of an accelerometer chip part.One or
Multiple sensor processors are configured that quickly active state can be converted to from inactive or standby mode than application processor,
When periodically obtaining sensing data using one or more sensors, sensor processor can be made to consume less put down in this way
Equal power.
Specifically, it can be accelerometer, gyroscope, magnetometer, air pressure that at least one of the present embodiment sensor, which is,
Meter or similar sensor.Application processor can be microprocessor, digital signal processor, multi-core processor or similar process
Device.
The present embodiment take formula electronic equipment may be a smart phone, it is laptop computer, desktop computer, wearable
Equipment or other types of equipment.
Further, first memory and second memory can be any kind of memory, such as:Random access memory
The volatile memories or read-only such as device (RAM), dynamic random access memory (DRAM) and static RAM (SRAM)
The nonvolatile storages such as memory (ROM), flash memory, magnetism or CD or compact disk read-only memory (CD-ROM), these
Memory temporarily or permanently stores data or instruction in equipment room.Such as:One or more sensors processor can be coupled to
First memory.In another example:Application processor can be coupled to second memory.In this example, application processor can pass through
Data are stored in second memory from one or more sensors processor request data.
Shown in Fig. 5, first memory can include one or more first in first out (FIFO) queues, can also include one
Or multiple location determination algorithms and an Activity recognition algorithm.Each queue in one or more fifo queues can be with
The mode of one group of read-write pointer, data storage and control logic set performs.Such as:Data storage may be DRAM, SRAM, touch
Send out device or any other suitable storage form, control logic may specify the one or more sensors processor (to be optionally
Primary application program processor) how read/write is stored to data.First memory for caching sensor compressed data can be only
One group of first data row and position instruction row are stored to one or more first in first out (FIFO) queues, treat that this group of data transmission extremely should
With the acquisition of next round data and batch process are carried out after processor again.For caching the first memory of sensor compressed data
Multigroup first data row and position instruction row can also be stored simultaneously to one or more fifo queues.
Specifically, one or more sensors processor can use one or more sensors are per second to obtain data one
Acquisition data one secondary, per minute are inferior.However, one or more sensors processor is possibly used for obtaining number at different intervals
According to.Such as:One or more sensors processor is configured that accelerometer can be used to obtain sensing data one in every 1/10 second
It is secondary and primary using every 1/12 second acquisition sensing data of a gyroscope.When sensing data is determined, one or more
A sensor processor can also be configured to will be in sensing data storage to the fifo queue of first memory.
First memory may store one or more location determination algorithms to determine the position of portable electronic device.This
GNSS receiver in embodiment can also be built-in with the processor of oneself.Such as:Location determination algorithm include position, speed,
Time (PVT) Processing Algorithm is stored as software instruction and is built in the execution of the processor in GNSS receiver.When
When GNSS receiver receives signal from one or more satellites, processor may be determined portable using PVT Processing Algorithms
The position of electronic equipment.Such as:Pedestrian navigation algorithm is stored as software instruction and by the processor in GNSS receiver
It performs.The processor of GNSS receiver may use pedestrian navigation algorithm and using based on GNSS location result and reckoning result
The kalman filter of combination determines the displacement of known location.Second memory can store one or more location determination algorithms
When, main application program processor can be selected to perform the position to determine portable electronic device.
When it is in mobile status to judge, first memory can store an Activity recognition algorithm to judge that the mankind live
Dynamic information (such as:Walking, running, bicycle or other activities).In one embodiment, it is analyzed using probabilistic graphical models
The feature vector of time-domain, so as to judge the one or more and relevant state of mankind's activity.In another embodiment, it is based on
The feature vector of Fast Fourier Transform (FFT) model analysis frequency domain and judge one or more with the relevant shape of mankind's activity
State.Alternatively, when second memory can store behavior recognizer, application processor may perform to judge one or more
With the relevant state of mankind's activity.
In Fig. 5 examples, second memory can also store map datum for navigation.Based on PVT Processing Algorithms or
The location information that pedestrian navigation algorithm determines, portable electronic device, which may be called and/or be adjusted as needed, is based on position
Application.Such as:Application processor can be performed shows navigation information on foreground to be based on location information by display device.
Such as:Application processor can be performed shows cartographic information on the display apparatus to be based on location information.
<Storage medium embodiment>
The embodiment of the present invention additionally provides a kind of storage medium, which contains program, which is being held
The batch processing method of the sensing data of any of the above-described is realized during row.
It should be noted that storage medium can be read-only memory, can store static information and instruction in the present embodiment
Static storage device, random access memory or the dynamic memory of information and instruction can be stored or electricity can
Erasable programmable read-only memory, CD-ROM or other optical disc storages, optical disc storage, magnetic disk storage medium or other magnetic are deposited
Store up equipment.
It should be noted that the program in the present embodiment can be write by any combinations of one or more of programming languages,
Programming language including object-oriented such as JAVA, Smalltalk, C++ or similar programming language, further includes traditional process
Programming language, such as " C " programming language or similar programming language.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention
All any modification, equivalent and improvement made within refreshing and principle etc., should all be included in the protection scope of the present invention.