Summary of the invention
The object of the invention is to overcome deficiency in existing product, a kind of earplug arrival reminding system and control method thereof are provided.
In order to achieve the above object, the present invention is achieved by the following technical solutions:
A kind of earplug arrival reminding system of the present invention, it comprises earplug body, data connecting line, mobile terminal, it also comprises position sensing module, audio alert module, communication interface module, MCU module and definite value configuration module;
Described position sensing module is the miniature Big Dipper or GPS device, described position sensing module and the electrical connection of described MCU module;
Described audio alert module is the device of micro buzzer-phone device or the fixing music of loop play, described audio alert module and the electrical connection of MCU module;
Described communication interface module is USB port, one end of described USB port and the electrical connection of described MCU module, and the other end of described USB port is electrically connected with described definite value configuration module;
Described MCU module is single-chip microcomputer or DSP or embedding controller, and described MCU module is single-chip microcomputer or DSP or embedding controller, and described definite value configuration module is connected with MCU module communication by communication interface module.
As preferably, position sensor module is uploaded longitude and latitude position data by RS232TTL level to described MCU module.
As preferably, described audio alert module is driven by described MCU module high level, and described audio alert module is discharged and returned by described MCU module low level.
A kind of control method of earplug arrival reminding system, comprise that the judgement of MCU module arrival reminding drives data communication, the definite value configuration module workflow of workflow, described definite value configuration module and described MCU module, first carry out definite value configuration module workflow, and then carry out the data communication of definite value configuration module and described MCU module, finally carry out again the judgement of MCU module arrival reminding and drive workflow.
As preferably, described MCU module arrival reminding judgement drives workflow as follows:
(1) read arrive at a station website longitude and latitude definite value Setlatitude and the Setlongitude that in MCU module, store;
(2) receive real-time numerical value of N owlatitude and the Nowlongitude that described position sensor transmits;
(3) more real-time numerical value of N owlatitude and definite value Setlatitude, relatively the difference absolute number of Nowlongitude and Setlongitude;
(4) judge both difference absolute number, if if the difference absolute number that in real time the difference absolute number of numerical value of N owlatitude and definite value Setlatitude is less than 200 meters or Nowlongitude and Setlongitude is less than 200 meters, MCU module output high level drives described audio alert module, remind party, otherwise MCU module does not drive audio alert module.
As preferably, the data communication of definite value configuration module and described MCU module comprises: CRC effect, header are confirmed, the judgement of longitude and latitude numerical value validity, correct message pre-stored and correct message loopback be to described definite value configuration module;
As preferably, definite value configuration module workflow comprises following implementation step:
(1) several times API (application programming interface) calls and obtains public bus network site name along the line and corresponding longitude and latitude;
(2) be transferred to and remind website longitude and latitude definite value to MCU module by described communication interface module;
(3) described MCU module passback is arrived at a station website longitude and latitude definite value to described definite value configuration module;
(4) on described definite value configuration module interface, show that " configuration, name of station, passback " neatly indicates, configure-ack.
As preferably, after definite value configuration module configure-ack, described earplug body works alone after disengaging data connecting line and mobile terminal.
Beneficial effect of the present invention is as follows: earplug body cost of the present invention is very low, and is to work alone, and after needn't worrying to fall asleep, goes adrift; Common sound-insulating member is replaced with to the wearable equipment after digital intelligent,
Make party in taking advantage of a city bus, taking advantage of a high ferro process, can both feel at ease to narrow meeting youngster, can avoid again the worry going past one's station, the working clan who gos out early and the scholar that goes to school also can use this earplug arrival reminding system and control method thereof, the working clan who gos out early and the scholar that goes to school are had to using value especially, therefore the present invention is applied widely, uses convenient.
Detailed description of the invention
For further understanding summary of the invention of the present invention, feature and function, hereby exemplify following examples, and coordinate accompanying drawing to be described in detail as follows:
As shown in Figure 1, be provided with power lights 3, running indicator 4, power switch 5 and alarm switch 6 in earplug body 1, earplug body 1 upper bottom portion is also provided with and supports installing hole 7. Power lights 3 is driven by the electric power loop of common input/output module 13, and running indicator 4 replaces low and high level by pin of common input/output module and drives, and power switch 5 is by party's manual-lock, and alarm switch 6 is by party's manual-lock. Between described left earplug body 1 and right earplug body 1, by being connected flexible cord 2 correlative connections, connect flexible cord and maintain by supporting installing hole 7. Connection flexible cord 2 is only used to earplug body and is convenient to lay, carries, searches.
As shown in Figure 2, a kind of earplug arrival reminding system, it also comprises position sensing module 8, audio alert module 9, communication interface module 10, MCU module 11 and definite value configuration module 12, common input/output module.
Position sensing module 8 is Chinese Big Dipper module, can be also GPS module. If WGL20 is a high-performance GPS module, use the embedded SIRFstarIVTM chip solution based on SIRFawareTM technology. Serial data TTL output, a GPS all data per second.
Audio alert module 9 is the device of micro buzzer-phone device or the fixing music of loop play, the fixing device one end of music of micro buzzer-phone part or loop play and a pin of MCU module 11 are connected, and the device other end of the fixing music of micro buzzer-phone device or loop play is connected with GND (power supply ground); In the time that the pin of MCU module 11 correspondences is high level, audio alert module is played sound by drive actions. In the time that pin corresponding to MCU module is low level, audio alert module is released to return parks sound.
Communication interface module 10 is USB port, preferentially selects Android data-interface standard. One end of USB port and described MCU module 11 are electrically connected, the namely smart mobile phone electrical connection of the other end of USB port and mobile terminal. The USB port of communication interface module 10 can also be earplug body charging.
MCU module 11 is that single-chip microcomputer can be also DSP (digital signal processor), can also be the embedded controller of ARM9 series. MCU module 11 is nucleus modules of the present invention, drives or data communication by the electrical connection between hard circuit and each module or low and high level, and MCU module 11 itself is programmable control module simultaneously, is realized and being controlled by operating software code.
Definite value configuration module 12 is application for the namely interior operation of smart mobile phone of mobile terminal. Utilize the supporting communication interface of mobile terminal, connected by communication interface module 10 by conventional data connection, be connected with 11 communications of MCU module thereby realize definite value configuration module 12.
Common input/output module 13 is utilized and is specified pin to be connected with running indicator 4, power lights 3, power switch 5, alarm switch 6. The each pin of common input/output module 13 is managed by the application software of MCU module 11, control output or be high level or be low level.
As shown in Figure 3, definite value configuration module 12 comprises with the data communication of described MCU module 11: CRC effect, header confirmation, the judgement of longitude and latitude numerical value validity, correct message pre-stored and correct message loopback are to described definite value configuration module.
Concrete data communication step is as follows:
A, MCU module 11 reports are received data and do CRC effect. If correctly carry out step B, otherwise passback error code set-point configuration module 12.
B, MCU module 11 judge that header data is six bytes of eb90eb90eb90, if six bytes of eb90eb90eb90, otherwise passback error code set-point configuration module 12.
C, judge that the function code of data is 0X01 value or 0X2A, read all parameters from EPPROM configuration parameter district if function code is 0X01, composition message returns to definite value configuration module, if function code is 0X2A, carries out step D.
D, longitude and latitude data validity judge, if longitude and latitude data are invalid, return error code set-point configuration module 12, memory space (FLASH or EEPROM) is not lost in the power down that definite value parameter is returned to definite value configuration module 12 when effective and be stored in MCU module 11 when longitude and latitude data are legal.
MCU module 11 is nucleus modules of the present invention's a kind of earplug arrival reminding system and control method thereof, works alone. The judgement of MCU module arrival reminding drives workflow as follows:
(1) first allow miniature lithium battery to MCU module for power supply by earplug body power switch unlatching work, then the each universal I/O port of MCU module initialization, serial port and USB mouth communications parameter;
(2) be stored in from definite value the device (EEPROM or FLASH) that power down do not lose and read arrive at a station website longitude and latitude parameter assignment Setlatitude and Setlongitude, wherein Setlatitude is longitude definite value, and Setlongitude is latitude definite value;
(3) receive real-time numerical value of N owlatitude and the Nowlongitude that described position sensor transmits,
Wherein Nowlatitude is real-time longitude numerical value, and Nowlongitude is real-time latitude numerical value;
(4) the difference absolute number of more real-time numerical value of N owlatitude and definite value Setlatitude, relatively the difference absolute number of Nowlongitude and Setlongitude;
(5) judge both difference absolute number, if the difference absolute number that in real time the difference absolute number of numerical value of N owlatitude and definite value Setlatitude is less than 200 meters or Nowlongitude and Setlongitude is less than 200 meters, MCU module 11 is exported high level and is driven described audio alert module, remind party, otherwise MCU module 11 does not drive audio alert module.
(6) every one second by allowing pin corresponding to running indicator be that high level is realized the bright of running indicator, every one second by allowing pin corresponding to running indicator be that low level realizes running indicator and extinguishes.
As shown in Figure 4, Figure 5, Figure 6 and Figure 7, definite value configuration module is a concrete application in smart mobile phone. Definite value configuration module workflow comprises following implementation step:
Party clicks [input frame] function key, in the concrete main viewing area input of application interface " urban public bus lines numeral or train motor-car high ferro train number ". Definite value configuration module, in the situation that not needing party to participate in, is realized automatically by application software:
1) API Calls for the first time: mutual with State Post Bureau information platform inquiry, obtain postcode corresponding to city title;
2) API Calls for the second time: utilize license number (as 17 tunnels, Hangzhou) mutual with local public transport information platform inquiry, obtain public transport number, starting and terminal point and along way station name Chinese list, as Hangzhou 17 bus on the way 23 site names;
3) API Calls for the third time: utilize with extract each along way station call the roll be called object with Chinese geography information network inquiry mutual or with Baidu map web site inquiry alternately, obtain the longitude and latitude of each site name.
By above three steps, at definite value configuration module internal construction a database.
Database list the first field is postcode, and database list the second field is license number, and database list subsequent words section is longitude and latitude;
These field combination get up to form the message content of data communication between definite value configuration module and MCU module.
Fig. 5 has provided for the second time after API Calls, the bus site name list along the line showing in the main viewing area of concrete application interface. Party moves up and down viewing area can browse all stop websites of this bus.
The each site name of Fig. 6 is all hot zone, and party rests on hot zone and surpasses 2 seconds and above before website, can automatically show and beat hook mark, if party is in the time having the website hot zone stop of beating hook mark and surpass more than 2 seconds, this dozen of hook marks will disappear. Get off at BB website as Fig. 6 party's preparation, now party's manual operation stops more than 2 seconds at BB website hot zone, occurs beating hook mark.
Party manually clicks [pre-configured] function key, and definite value configuration module automatically tissue, by the content message of " postcode, license number, BB website longitude and latitude " combination, is transferred to MCU module by definite value configuration module.
Party waits for (in 2 seconds) a little while, and Fig. 7 appears in the main viewing area of the concrete application interface of definite value configuration module, now shows that " configuration, name of station, passback " neatly indicates; This shows that definite value configuration is correct, and party manually clicks [configure-ack] function key, completes data communication whole process between definite value configuration module and MCU module.
Party manually clicks after [pre-configured] function key, and the main viewing area of the concrete application interface of definite value configuration module does not also occur that after 5 seconds Fig. 7 neatly indicates and rests on Fig. 6 interface always, and Communications failure, needs party to return to Fig. 4 interface.
Compared with prior art, its difference is in the present invention:
1) the supporting supporting earphone of earphone, music player and the supporting earphone of smart mobile phone on seat on simultaneous interpretation earphone, aircraft, its starting point and target are to listen to the true sound of pure tone. But its object of earplug body of the present invention is only to the sound insulation of party's ear.
2) earplug body cost is very low, and is to work alone, and after needn't worrying to fall asleep, goes adrift. The earphone of smart mobile phone can by other people especially thief carry over connecting line and steal smart mobile phone itself.
3) indicator lamp in earplug body and action button, in smart mobile phone, the definite value of operation configuration APP interface is all simple and clear, specifically special knowledge, practical, facilitates all kinds of parties to use.
The present invention, on traditional simple function earplug software basis, allows its digital intelligent. Party can both be felt at ease to narrow in taking city bus, taking high ferro process can youngster, can avoid again the worry that goes past one's station, and the working clan who gos out early and the scholar that goes to school are had to using value especially.
Although by reference to the accompanying drawings preferred enforcement of the present invention is described above; but the present invention is not limited to above-mentioned detailed description of the invention; above-mentioned detailed description of the invention is only illustrated; be not restrictive; those of ordinary skill in the art is under inspiration of the present invention; not departing from the scope situation that aim of the present invention and claim protect, can also make many forms, within these all belong to protection domain of the present invention.