The content of the invention
It is an object of the present invention to provide a kind of new solution of the data processing for game paddle.
According to the first aspect of the invention, there is provided a kind of data processing method for game paddle, it is characterised in that
Game paddle includes acceleration transducer and magnetometer, and the data processing method includes:
Judge whether move using the user of the game paddle, in this way, then:
Obtain acceleration transducer described in the moving process collection acceleration information and the magnetometer collection
Magnetic field data;
The current course angle of the user is calculated according to the acceleration information and the magnetic field data;
According to the current course angle and default step-length, the moving displacement of the user is obtained;
The motion track of the user is obtained according to the initial position of the user and the moving displacement, and described in display
Motion track.
Optionally, it is described to judge also to include before whether moving using the user of the game paddle:
In the initial moving process of the user, one group of initial acceleration number of degrees of the acceleration transducer collection are obtained
According to;
One group of initial acceleration angle value is calculated to initial acceleration degrees of data described in every group;
The user moving period is determined according to one group of initial acceleration angle value;
The difference between the initial acceleration angle value of initial acceleration angle value maximum in each cycle and minimum is calculated, as change
Change value;
Calculate the quantity of the initial acceleration angle value in each cycle;
Change threshold is determined according to all changing values, according to all quantity quantification threshold values.
Optionally, the step for judging whether to be moved using the user of the game paddle is included:
Obtain the acceleration transducer and be used as in the acceleration information that last time movement gathers afterwards and judge acceleration information;
Judgement acceleration magnitude is calculated according to the judgement acceleration information;
It is more than or equal to the data threshold and the judgement acceleration magnitude and minimum of maximum in the quantity of the judgement acceleration
The difference judged between acceleration magnitude be more than or equal to the amplitude threshold in the case of, judge user movement.
Optionally, the current course angle bag of the user is calculated according to the acceleration information and the magnetic field data
Include:
The course angle at corresponding moment is calculated in the acceleration information and magnetic field data gathered according to synchronization;
Calculate being averaged for all course angles and be worth to the current course angle.
Optionally, each acceleration information includes the first component of acceleration of corresponding three reference axis, second
Component of acceleration and the 3rd component of acceleration, each magnetic field data include the first magnetic field of corresponding three reference axis
Component, the second magnetic-field component and the 3rd magnetic-field component;The acceleration information and magnetic field data meter gathered according to synchronization
Calculating the course angle for obtaining corresponding to the moment includes:
According to first component of acceleration, the angle of pitch for corresponding to the moment is calculated;
According to second component of acceleration and the 3rd component of acceleration, the roll angle for corresponding to the moment is calculated;
According to first magnetic-field component, second magnetic-field component, the 3rd magnetic-field component, the angle of pitch and the institute
State the course angle that the corresponding moment is calculated in roll angle.
According to the second aspect of the invention, there is provided a kind of data processing equipment for game paddle, game paddle bag
Acceleration transducer and magnetometer are included, the data processing equipment includes:
Mobile determination module, for judging whether the user using the game paddle moves;
First acquisition module, in the case of being in the result of determination of the mobile determination module, obtain the shifting
The acceleration information of the acceleration transducer collection and the magnetic field data of magnetometer collection during dynamic;
Course angle computing module, for calculating the current of the user according to the acceleration information and the magnetic field data
Course angle;
Displacement computing module, for according to the current course angle and default step-length, obtaining the mobile position of the user
Move;
Track record module, the shifting of the user is obtained for the initial position according to the user and the moving displacement
Dynamic rail mark, and show the motion track.
Optionally, the data processing equipment also includes:
Second acquisition module, in the initial moving process of the user, obtaining the acceleration transducer collection
One group of initial acceleration degrees of data;
First computing module, for one group of initial acceleration angle value to be calculated to initial acceleration degrees of data described in every group;
Period determination module, for determining the user moving period according to one group of initial acceleration angle value;
Second computing module, for calculating the difference in each cycle between the maximum and minimum value of initial acceleration angle value
Value, as changing value;Calculate the quantity of the initial acceleration angle value in each cycle;
Threshold determination module, for determining change threshold according to all changes, according to all quantity quantification threshold values.
Optionally, the mobile determination module includes:
Judge acquiring unit, make for obtaining the acceleration transducer in the acceleration information that last time movement gathers afterwards
To judge acceleration information;
Computing unit is judged, for judgement acceleration magnitude to be calculated according to the judgement acceleration information;
Mobile identifying unit, for being more than or equal to the data threshold and maximum in the quantity of the judgement acceleration
In the case of judging that the difference between acceleration magnitude and the judgement acceleration magnitude of minimum is more than or equal to the amplitude threshold, institute is judged
State user's movement.
Optionally, the course angle computing module includes:
Course angle computing unit, acceleration information and magnetic field data for being gathered according to synchronization are calculated correspondingly
The course angle at moment;
Current course angle computing unit, the current course angle is worth to for calculating being averaged for all course angles.
Optionally, each acceleration information includes the first component of acceleration of corresponding three reference axis, second
Component of acceleration and the 3rd component of acceleration, each magnetic field data include the first magnetic field of corresponding three reference axis
Component, the second magnetic-field component and the 3rd magnetic-field component;The course angle computing unit includes:
Angle of pitch computation subunit, for according to first component of acceleration, calculating the angle of pitch for corresponding to the moment;
Roll angle computation subunit, for according to second component of acceleration and the 3rd component of acceleration, calculating
Go out the roll angle at corresponding moment;
Course angle computation subunit, for according to first magnetic-field component, second magnetic-field component, the 3rd magnetic
The course angle at corresponding moment is calculated in field component, the angle of pitch and the roll angle.
According to the third aspect of the invention we, there is provided a kind of game paddle, including it is described according to a second aspect of the present invention
Data processing equipment.
According to the fourth aspect of the invention, there is provided a kind of game paddle, including processor and memory, the memory
For store instruction, it is described instruct for control the processor to be operated with perform it is described according to a first aspect of the present invention
Data processing method.
The beneficial effect of the present invention is, passes through the data processing method of the present invention, it is possible to which recording user makes
With the motion track during game paddle so that game paddle can depart from head-mounted display use, lift Consumer's Experience.
By referring to the drawings to the present invention exemplary embodiment detailed description, further feature of the invention and its
Advantage will be made apparent from.
Embodiment
The various exemplary embodiments of the present invention are described in detail now with reference to accompanying drawing.It should be noted that:Unless have in addition
Body illustrates that the unlimited system of part and the positioned opposite of step, numerical expression and the numerical value otherwise illustrated in these embodiments is originally
The scope of invention.
The description only actually at least one exemplary embodiment is illustrative to be never used as to the present invention below
And its application or any restrictions that use.
It may be not discussed in detail for technology, method and apparatus known to person of ordinary skill in the relevant, but suitable
In the case of, the technology, method and apparatus should be considered as part for specification.
In shown here and discussion all examples, any occurrence should be construed as merely exemplary, without
It is as limitation.Therefore, other examples of exemplary embodiment can have different values.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain Xiang Yi
It is defined, then it need not be further discussed in subsequent accompanying drawing in individual accompanying drawing.
In order to solve the problems, such as movement locus that game paddle present in prior art can not record user, there is provided one
Data processing method of the kind for game paddle.Wherein, game paddle includes acceleration transducer and magnetometer.Acceleration sensing
Device can gather the acceleration information of game paddle according to setpoint frequency, and magnetometer can gather game paddle according to setpoint frequency
The magnetic field data of place environment.The frequency acquisition of acceleration information and magnetic field data, collection moment and relative coordinate axle all same,
And it is three-dimensional data.
Fig. 1 is the flow chart according to a kind of a kind of embodiment of data processing method for game paddle of the invention.
According to Fig. 1, the data processing method comprises the following steps:
Step S110, judge whether move using the user of the game paddle, in this way, then perform step S120, if not,
Continue executing with step S110.Wherein, the movement in step S110 can refer to that user has walked a step.
In one particular embodiment of the present invention, before step S110 is performed, the data processing method is also included such as
Step S210~S250 shown in Fig. 2.
Step S210, in the initial moving process of user, obtain the initial acceleration degrees of data of acceleration transducer collection.
The acceleration information of acceleration transducer collection for example can be adding for corresponding three reference axis for being orthogonal to a bit
Velocity component, such as three reference axis are respectively X-axis, Y-axis and Z axis, and the component of acceleration of corresponding X-axis, Y-axis and Z axis is respectively
Gx、GyAnd Gz.So, initial acceleration degrees of data for example can be (Gx0, Gy0, Gz0)。
Step S220, all initial acceleration degrees of data are calculated corresponding to initial acceleration angle value.
Acceleration magnitude can be equal to the quadratic sum of three components of acceleration.Specifically, initial acceleration angle value is G0,
Further, after acceleration magnitude is calculated, processing can be filtered to these acceleration magnitudes so that this
A little acceleration magnitudes are more smooth.
Step S230, the moving period of user is determined according to the initial acceleration angle value.
Fourier transformation is carried out to the acceleration magnitude handled after filtering, it becomes possible to the moving period of user is determined, it is mobile
Cycle is specifically as follows the cycle that user makes a move.
Step S240, the difference of acceleration magnitude maxima and minima in each moving period is calculated, as changing value;Calculate
The quantity of acceleration magnitude in each moving period.
Step S250, change threshold is determined according to all changing values, according to all quantity quantification threshold values.
Specifically, can be using the minimum value of all changes value as change threshold, using minimum number as amount threshold.
In another specific embodiment of the present invention, change threshold and amount threshold can rule of thumb be preset
Alright, it is not necessary to perform above-mentioned steps S210~S250.
On this basis, the specific steps for performing step S110 can include step S111~S114.
Step S111, obtain acceleration transducer and be used as judgement acceleration in the acceleration information that last time movement gathers afterwards
Data.
Specifically, specifically referred to after last time movement after preceding once judgement user's movement.
Step S112, judgement acceleration magnitude is calculated according to judgement acceleration information.
Step S113, judge that acceleration magnitude and the minimum difference judged between acceleration magnitude are more than or equal to change threshold maximum
In the case that value and the quantity of judgement acceleration magnitude are more than or equal to amount threshold, user's movement is judged.
In another specific embodiment of the present invention, step 113 can also be to judging that acceleration magnitude is filtered place
Fourier transformation processing is carried out after reason again, between the maximum judgement acceleration magnitude and minimum judgement acceleration magnitude after calculating processing
Difference is judging that changing value is more than or equal to change threshold and judges that the quantity of acceleration magnitude is more than or equal to as changing value is judged
In the case of amount threshold, user's movement is judged.
After detecting that user moves the first step, during whether detection user moves second step, it will not adopt
The acceleration information obtained during moving the first step with user.If obtained during whether detection user moves second step
The quantity of the judgement acceleration information taken is less than amount threshold, first can be calculated according to the judgement acceleration information got
Judge acceleration magnitude, after the quantity until judging acceleration information exceedes amount threshold, then calculate these and judge acceleration magnitude
Maximum and the difference of minimum value whether be more than change threshold, in this way, then judge that user moves second step, if not, after
Continuous obtain judges acceleration information.
On this basis, judge that acceleration information can be after detecting that user moves the first step and not examine also
Measure all acceleration informations gathered in the case that user moves second step.
Step S120, obtain the acceleration information that acceleration transducer gathers in moving process and the magnetic that magnetometer gathers
Field data.
Step S130, the current course angle of user is calculated according to acceleration information and magnetic field data.
For example, the component of acceleration for corresponding three reference axis of acceleration information that at a time accelerometer measures obtain
Respectively Gx1、Gy1、Gz1, the magnetic-field component for corresponding three reference axis of magnetic field data that magnetometer measures obtain is respectively Mx1、My1、
Mz1.In the embodiment of the present invention, to should the angle of pitch, roll angle and the course angle at moment be denoted as respectively as α, β, γ.
Based on following equation one, can be calculated to should the moment angle of pitch α.
Wherein, g is acceleration of gravity.
Based on following equation two, can be calculated to should the moment roll angle β.
Based on following equation three, can be calculated to should the moment course angle γ.
Because in the above-mentioned moving process of user, acceleration transducer acquires N number of acceleration information, and magnetometer is simultaneously
Acquire N number of magnetic field data.Therefore, performing step S130 method can include:The acceleration number of degrees gathered according to synchronization
According to the course angle that the corresponding moment is calculated with magnetic field data;Being averaged for all course angles is calculated again is worth to current course angle.
Step S140, according to current course angle and default step-length, obtain the moving displacement of user.
Moving displacement can be vectorIts size is equal to default step-length, and direction is determined by current course angle.Wherein, preset
Step-length can be rule of thumb set in advance, such as can be 75cm.
Step S150, the motion track of user is obtained according to the initial position of user and moving displacement, and show the movement
Track.Wherein, the position before initial position is specially user's movement.
Further, the current location of user can be calculated according to initial position and moving displacement, that is, after moving
Position.When user moves and moved a step next time, the current location is using as the initial position in moving process next time.
So, the data processing method of the present invention is passed through, it is possible to record user during using game paddle
Motion track so that game paddle can depart from head-mounted display use, lift Consumer's Experience.
Corresponding with the above method, present invention also offers a kind of data processing equipment for game paddle.Fig. 3 is
According to a kind of a kind of frame principle figure of implementation structure of data processing equipment for game paddle of the invention.
According to Fig. 3, the data processing equipment includes mobile determination module 310, the first acquisition module 320, course angle
Computing module 330, displacement computing module 340 and track record module 350.
Above-mentioned mobile determination module 310 is used to judge whether move using the user of game paddle.
Above-mentioned first acquisition module 320 is used to, in the case where the result of determination of mobile determination module is to be, obtain movement
During acceleration transducer gather acceleration information and magnetometer collection magnetic field data.
Above-mentioned course angle computing module 330 is used for the current course that user is calculated according to acceleration information and magnetic field data
Angle.
Above-mentioned displacement computing module 340 is used for according to current course angle and default step-length, obtains the moving displacement of user.
Above-mentioned track record module 350 is used to obtain the moving rail of user according to the initial position and moving displacement of user
Mark, and show motion track.
In one particular embodiment of the present invention, as shown in figure 4, the data processing equipment also includes the second acquisition module
210th, the first computing module 220, period determination module 230, the second computing module 240 and threshold determination module 250.This second is obtained
Modulus block 210 is used in the initial moving process of user, obtains one group of initial acceleration degrees of data of acceleration transducer collection;
First computing module 220 is used to one group of initial acceleration angle value be calculated to every group of initial acceleration degrees of data;The cycle determines
Module 230 is used to determine user moving period according to one group of initial acceleration angle value;Second computing module 240 is each for calculating
Difference in cycle between the maximum and minimum value of initial acceleration angle value, as changing value;Calculate initial in each cycle
The quantity of acceleration magnitude;The threshold determination module 250 is used to determine change threshold according to all changes, true according to all quantity
Determine amount threshold.
On this basis, as shown in figure 4, mobile determination module 310 includes determining whether acquiring unit 311, judges computing unit
312 and mobile identifying unit 313.The judgement acquiring unit 311 is used to obtain acceleration transducer collection after last time movement
Acceleration information as judge acceleration information;The judgement computing unit 312 is used to be calculated according to judgement acceleration information
To judgement acceleration magnitude;The movement identifying unit 313 is used to be more than or equal to data threshold and maximum in the quantity for judging acceleration
Judge acceleration magnitude and minimum judge acceleration magnitude between difference be more than or equal to amplitude threshold in the case of, judge user
It is mobile.
Further, as shown in figure 4, course angle computing module 330 includes course angle computing unit 331 and current course angle
Computing unit 332, the course angle computing unit 331 is used for the acceleration information gathered according to synchronization and magnetic field data calculates
Obtain the course angle at corresponding moment;The current course angle computing unit 332 be used for calculate all course angles be averaged be worth to work as
Preceding course angle.
On this basis, each acceleration information adds including correspondingly the first component of acceleration of three reference axis, second
Velocity component and the 3rd component of acceleration, each magnetic field data include the first magnetic-field component of corresponding three reference axis, second
Magnetic-field component and the 3rd magnetic-field component;Course angle computing unit 332 includes angle of pitch computation subunit, roll angle computation subunit
With course angle computation subunit, the angle of pitch computation subunit is used for according to the first component of acceleration, calculates the corresponding moment
The angle of pitch;The roll angle computation subunit is used for according to the second component of acceleration and the 3rd component of acceleration, calculate to it is corresponding when
The roll angle at quarter;The course angle computation subunit be used for according to the first magnetic-field component, the second magnetic-field component, the 3rd magnetic-field component,
The course angle at corresponding moment is calculated in the angle of pitch and roll angle.
Present invention also offers a kind of game paddle, and on the one hand, the game paddle includes being used in previous embodiment
The data processing equipment of game paddle.
Fig. 5 is the frame principle figure according to a kind of implementation structure of the game paddle of another aspect of the present invention.
According to Fig. 5, the game paddle 500 includes memory 501 and processor 502, and the memory 501 is used to store
Instruction, the instruction are operated for control processor 502 to perform the above-mentioned data processing method for game paddle;The trip
Play handle also includes acceleration transducer and magnetometer.
The processor 502 is such as can be central processor CPU, Micro-processor MCV.The memory 501 for example including
ROM (read-only storage), RAM (random access memory), the nonvolatile memory etc. of hard disk.
In addition, according to Fig. 5, the game paddle 500 also includes interface arrangement 503, input unit 504, display
Device 505, communicator 506, loudspeaker 507, microphone 508 etc..Although figure 5 illustrates multiple devices, this
Invention game paddle can only relate to partial devices therein, for example, processor 501, memory 502, display device 505 etc..
Above-mentioned communicator 506 can for example carry out wired or wireless communication.
Above-mentioned interface arrangement 503 is such as including earphone jack, USB interface.
Above-mentioned input unit 504 is such as can include touch-screen, button.
Above-mentioned display device 505 is, for example, LCDs, touch display screen etc..
The various embodiments described above primary focus describes the difference with other embodiment, but those skilled in the art should be clear
Chu, the various embodiments described above can be used alone or be combined with each other as needed.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Point cross-reference, what each embodiment stressed is the difference with other embodiment, but people in the art
Member is it should be understood that the various embodiments described above can be used alone or be combined with each other as needed.In addition, for device
For embodiment, because it is corresponding with embodiment of the method, so describing fairly simple, related part is implemented referring to method
The explanation of the corresponding part of example.System embodiment described above is only schematical, wherein as separating component
The module of explanation can be or may not be physically separate.
The present invention can be device, method and/or computer program product.Computer program product can include computer
Readable storage medium storing program for executing, containing for making processor realize the computer-readable program instructions of various aspects of the invention.
Computer-readable recording medium can keep and store to perform the tangible of the instruction that uses of equipment by instruction
Equipment.Computer-readable recording medium for example can be-- but be not limited to-- storage device electric, magnetic storage apparatus, optical storage
Equipment, electromagnetism storage device, semiconductor memory apparatus or above-mentioned any appropriate combination.Computer-readable recording medium
More specifically example (non exhaustive list) includes:Portable computer diskette, hard disk, random access memory (RAM), read-only deposit
It is reservoir (ROM), erasable programmable read only memory (EPROM or flash memory), static RAM (SRAM), portable
Compact disk read-only storage (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanical coding equipment, for example thereon
It is stored with punch card or groove internal projection structure and the above-mentioned any appropriate combination of instruction.Calculating used herein above
Machine readable storage medium storing program for executing is not construed as instantaneous signal in itself, the electromagnetic wave of such as radio wave or other Free propagations, leads to
Cross the electromagnetic wave (for example, the light pulse for passing through fiber optic cables) of waveguide or the propagation of other transmission mediums or transmitted by electric wire
Electric signal.
Computer-readable program instructions as described herein can be downloaded to from computer-readable recording medium it is each calculate/
Processing equipment, or outer computer or outer is downloaded to by network, such as internet, LAN, wide area network and/or wireless network
Portion's storage device.Network can include copper transmission cable, optical fiber is transmitted, is wirelessly transferred, router, fire wall, interchanger, gateway
Computer and/or Edge Server.Adapter or network interface in each calculating/processing equipment receive from network to be counted
Calculation machine readable program instructions, and the computer-readable program instructions are forwarded, for the meter being stored in each calculating/processing equipment
In calculation machine readable storage medium storing program for executing.
For perform the computer program instructions that operate of the present invention can be assembly instruction, instruction set architecture (ISA) instruction,
Machine instruction, machine-dependent instructions, microcode, firmware instructions, condition setup data or with one or more programming languages
The source code or object code that any combination is write, programming language of the programming language including object-oriented-such as
Smalltalk, C++ etc., and conventional procedural programming languages-such as " C " language or similar programming language.Computer
Readable program instructions fully can on the user computer perform, partly perform on the user computer, be only as one
Vertical software kit performs, part performs or completely in remote computer on the remote computer on the user computer for part
Or performed on server.In the situation of remote computer is related to, remote computer can pass through network-bag of any kind
LAN (LAN) or wide area network (WAN)-be connected to subscriber computer are included, or, it may be connected to outer computer (such as profit
Pass through Internet connection with ISP).In certain embodiments, by using computer-readable program instructions
Status information carry out personalized customization electronic circuit, such as PLD, field programmable gate array (FPGA) or can
Programmed logic array (PLA) (PLA), the electronic circuit can perform computer-readable program instructions, so as to realize each side of the present invention
Face.
Referring herein to method, apparatus (system) and computer program product according to embodiments of the present invention flow chart and/
Or block diagram describes various aspects of the invention.It should be appreciated that each square frame and flow chart of flow chart and/or block diagram and/
Or in block diagram each square frame combination, can be realized by computer-readable program instructions.
These computer-readable program instructions can be supplied to all-purpose computer, special-purpose computer or other programmable datas
The processor of processing unit, so as to produce a kind of machine so that these instructions are passing through computer or other programmable datas
During the computing device of processing unit, work(specified in one or more of implementation process figure and/or block diagram square frame is generated
The device of energy/action.These computer-readable program instructions can also be stored in a computer-readable storage medium, these refer to
Order causes computer, programmable data processing unit and/or other equipment to work in a specific way, so as to be stored with instruction
Computer-readable medium then includes a manufacture, and it is included in one or more of implementation process figure and/or block diagram square frame
The instruction of the various aspects of defined function/action.
Computer-readable program instructions can also be loaded into computer, other programmable data processing units or other
In equipment so that series of operation steps is performed on computer, other programmable data processing units or miscellaneous equipment, with production
Raw computer implemented process, so that performed on computer, other programmable data processing units or miscellaneous equipment
Instruct function/action specified in one or more of implementation process figure and/or block diagram square frame.
Flow chart and block diagram in accompanying drawing show system, method and the computer journey of multiple embodiments according to the present invention
Architectural framework in the cards, function and the operation of sequence product.At this point, each square frame in flow chart or block diagram can generation
One module of table, program segment or a part for instruction, the module, program segment or a part for instruction include one or more use
In the executable instruction of logic function as defined in realization.At some as the function of in the realization replaced, being marked in square frame
Can be with different from the order marked in accompanying drawing generation.For example, two continuous square frames can essentially be held substantially in parallel
OK, they can also be performed in the opposite order sometimes, and this is depending on involved function.It is also noted that block diagram and/or
The combination of each square frame and block diagram in flow chart and/or the square frame in flow chart, function or dynamic as defined in performing can be used
The special hardware based system made is realized, or can be realized with the combination of specialized hardware and computer instruction.It is right
It is well known that, realized for those skilled in the art by hardware mode, realized by software mode and by software and
It is all of equal value that the mode of combination of hardware, which is realized,.
It is described above various embodiments of the present invention, described above is exemplary, and non-exclusive, and
It is not limited to disclosed each embodiment.In the case of without departing from the scope and spirit of illustrated each embodiment, for this skill
Many modifications and changes will be apparent from for the those of ordinary skill in art field.The selection of term used herein, purport
The principle of each embodiment, practical application or technological improvement to the technology in market are best being explained, or is leading this technology
Other those of ordinary skill in domain are understood that each embodiment disclosed herein.The scope of the present invention is limited by appended claims
It is fixed.