A kind of voting method and system
Technical field
The present invention relates to wireless communication field more particularly to a kind of voting methods and system.
Background technology
With the high speed development of wireless broad band technology and mobile terminal technology, a large amount of innovations Internet-based are constantly gushed
Existing, mobile Internet number of users is skyrocketed through, and electronic voting is replacing traditional ballot form, tradition ballot at leisure
Need to make, print a large amount of paperys ballot leaflets, and send with charge free work, in voting process user can because of the time,
After the factors such as place restrict, and can not carry out ballot activity participation, and polled data is collected in tradition ballot, need manually to carry out
Statistics, data volume is huge, and process is trifling, and manual intervention degree is strong, can not ensure the accuracy of voting results, therefore, is based on local
Net electronic voting method is in permeating daily life, although the existing electronic voting skill based on LAN
Although art significantly improves ballot working efficiency, reduce the input of cost of labor, and ensures the authenticity of voting results, can
It is existing based on the electronic voting method of LAN ballot equipment connection LAN all be ballot opening of device listening mode, connect
The parameter of wireless network is received, i.e. SSID and password etc. are then attached to router, just as some equipment Wi-Fi is quickly connected
Scheme is mostly the same by mobile phone connection wireless router, and intelligent terminal opens listening mode, receives the parameter of wireless network, i.e.,
SSID and password etc. are then attached to router, such as the SmartConnection of the SmartConfig of TI, MTK, wechat
AirKiss etc..Wherein, the principle of SmartConfig is:Mobile phone has connected some Wi-Fi, and SSID and close is sent by mobile phone
Code, intelligent terminal monitored data packet, although Wi-Fi module can not decrypt the data packet listened to, it is known that per number
According to information such as the source of packet, destination-mac address, data lengths.By setting a kind of encryption method, this encryption method can influence number
According to the length of packet, we are stored by the length of data packet and wants the information transmitted, and the content of data packet need not be concerned about.It will
Each character code of SSID and password, then send in sequence.By the length of change data frame, to be carried out to information
Encryption.So ballot equipment receive wireless network parameter when, these parameters can be generally encrypted so that SSID and
The UDP message packet that key is generated is more, and the probability that ballot equipment receives wireless network parameter failure increases, and some are wireless dry
It disturbs and is likely to result in packet loss phenomenon, cause configuration network entry time long, existing probability failure.
The patent of Publication No. CN206584442U discloses a kind of electronic voting system based on mobile terminal, including throws
Bill system administrative center, interchanger, super joint, master server and user's handheld terminal;Ballot system administrative center and institute
User's handheld terminal is stated to connect with the super joint respectively;Super joint is connect with the interchanger;The main service
Device is connect with the interchanger;User's handheld terminal include authenticating user identification device, radio receiving transmitting module, micro treatment module and
GPS unit;Micro treatment module is connect by radio receiving transmitting module with super joint;Authenticating user identification device connects with touch screen
It connects;The GPS unit is connect with micro treatment module.The utility model has the beneficial effects that:Using electronic voting, carry out with no paper
Operation, energy conservation and environmental protection, polling information reusability is high, reduces user and participates in cost, improves user's participation and acceptance, reduce at
This, improves working efficiency.But this method ballot system administrative center and user's handheld terminal are all to utilize first reception routing
The parameter for the wireless network that device is sent using broadcast mode, i.e. SSID and key etc. are then attached to router, and utilize broadcast
Mode agreement is proprietary protocol rather than standard agreement, and versatility is limited by protocol type, and when the connection of this broadcast mode
Between it is long be about 30-60s, success rate it is not high about 70%, need the support of multi-chip.
Invention content
The purpose of the present invention is in view of the drawbacks of the prior art, provide based on the direct-connected ballot sides quickly connected WLAN
Method enables to ballot equipment to quick connect to wireless routing device, and connection speed is fast, connects into power height.
In order to achieve the goal above, the present invention uses following technical scheme:
A kind of voting method, including step:
S1. detection carrys out the direct-connected connection request signals of WLAN that self-organizing main control end is sent out;
S2. the direct-connected connection request signals of the WLAN are responded and establish connection with the tissue main control end;
S3. the SSID and password of the wireless router that the tissue main control end is sent are received;
S4. it is established and is connected with wireless router according to the SSID of the wireless router and password;
S5. the polled data packet sent from the tissue main control end is received;
S6. user is received to be operated according to the ballot that the polled data packet carries out;
S7. the ballot is operated into generation vote information and is sent to the tissue main control end.
Further, the polled data packet includes ballot event and at least one ballot that the ballot event is arranged
Option.
Further, further include step:
Judge connect in preset time with whether the wireless router is established;
If so, prompt user has been established with wireless router and connect.
Further, further include step:
Receive the voting results data packet sent from the tissue main control end;
It parses the voting results data packet and shows voting results.
Further, further include step:
Judge whether to receive the request that the tissue main control end disconnects;
If so, disconnecting the connection with the tissue main control end.
Correspondingly, a kind of ballot system is also provided, including:
Detection module carrys out the direct-connected connection request signals of WLAN that self-organizing main control end is sent out for detecting;
First link block connects for responding the direct-connected connection request signals of the WLAN and being established with the tissue main control end
It connects;
First receiving module, SSID and password for receiving the wireless router that the tissue main control end is sent;
Second link block is connected for being established with wireless router according to the SSID and password of the wireless router;
Second receiving module, for receiving the polled data packet sent from the tissue main control end;
Vote module is operated for receiving user according to the ballot that the polled data packet carries out;
Sending module is sent to the tissue main control end for the ballot to be operated generation vote information.
Further, the polled data packet includes ballot event and at least one ballot that the ballot event is arranged
Option.
Further, further include:
Link block is judged, for judging connect in preset time with whether the wireless router is established;
Reminding module is connect for prompting user to be had been established with router;
Further, further include:
Third receiving module, for receiving the voting results data packet sent from the tissue main control end;
Display module, for parsing the voting results data packet and showing voting results.
Further, further include:
Judge to disconnect module, the request for organizing main control end to disconnect is received for judging whether;
Module is disconnected, for disconnecting the connection with the tissue main control end.
Compared with prior art, the present invention makes ballot equipment establish WLAN with main control end is organized by WLAN direct-connecting technologies
Direct-connected connection directly transmits SSID and password from tissue main control end to ballot equipment, and not by router using broadcast or
Multicast sends the mode of UDP packets and the mode of length encryption sends SSID information and password to ballot equipment, can effectively keep away
Exempt from packet loss phenomenon and parse the problem of time length, SSID and password can be sent faster so that ballot equipment can be quick
Be connected to wireless router, connection speed is fast, connect into power height, and WLAN it is direct-connected be based on standard agreement, relative to multicast,
The proprietary protocol of broadcast transmission data packet, it is versatile, it is applied widely.
Description of the drawings
Fig. 1 is a kind of voting method flow chart that embodiment one provides;
Fig. 2 is a kind of ballot system structure chart that embodiment one provides;
Fig. 3 is a kind of voting method flow chart that embodiment two provides;
Fig. 4 is a kind of ballot system structure chart that embodiment two provides.
Specific implementation mode
Following is a specific embodiment of the present invention in conjunction with the accompanying drawings, technical scheme of the present invention will be further described,
However, the present invention is not limited to these examples.
The technology of the present invention is related to the relevant technologies such as WLAN is direct-connected and Wi-Fi is quickly connected should for WLAN direct-connecting technologies
Technology can realize the direct interconnection of Wi-Fi equipment, help user by it is more simple and easily in a manner of complete printing, share,
The tasks such as synchronous and display.Due to not needing Wi-Fi routers or access point, Wi-Fi equipment can be real in any place
Now connect.A wherein station can play the role of traditional AP, referred to as Group Owner (GO), in addition one
Station is then known as Group Client (GC), and GO is connected to as connection AP.GO and GC can be not only it is one-to-one,
Can be one-to-many.The present invention is exactly that the connection method of ballot equipment and router is realized using the direct-connected functions of WLAN, is overcome
The problems such as packet loss being susceptible to by the encryption transmission SSID information and password of length, and WLAN direct-connected devices can be whenever and wherever possible
Realize and interconnect, and SSID and password can be sent faster using WLAN is direct-connected, connection speed is very fast, success rate compared with
It is high.
Embodiment one
The present embodiment provides a kind of voting methods, as shown in Figure 1, including step:
S11. detection carrys out the direct-connected connection request signals of WLAN that self-organizing main control end is sent out;
S12. the direct-connected connection request signals of the WLAN are responded and establish connection with the tissue main control end;
S13. the SSID and password of the wireless router that the tissue main control end is sent are received;
S14. it is established and is connected with wireless router according to the SSID of the wireless router and password;
S15. the polled data packet sent from the tissue main control end is received;
S16. user is received to be operated according to the ballot that the polled data packet carries out;
S17. the ballot is operated into generation vote information and is sent to the tissue main control end.
This implementation provides a kind of so as to vote that establish WLAN straight with tissue main control end for equipment using the direct-connected wireless signals of WLAN
Downlink connection after carrying out the SSID and encrypted message that self-organizing main control end is sent to reception, enables to ballot equipment quickly to connect
To wireless routing device.
Specifically, tissue main control end supports the direct-connected functions of WLAN with ballot equipment, WLAN direct-connected is by default frequency range (one
As use two kinds of frequency ranges of 2.4Hz and 5Hz) signal be attached, have connected wireless router tissue main control end open WLAN
Direct-connected function equipment of correspondingly voting also opens the direct-connected functions of WLAN, and the two establishes the direct-connected companies of WLAN by default frequency band signals
It connects, tissue main control end and ballot equipment can open the direct-connected functions of WLAN by way of hardware button triggering.
The SSID for the Wi-Fi having connected and password are sent to ballot and set by the tissue main control end for having connected wireless router
It is standby, after ballot equipment receives the SSID and password of Wi-Fi, initiate to be wirelessly connected to wireless router.
Equipment of voting sends polled data packet with tissue main control end after wireless router successful connection to ballot equipment.Specifically
, polled data packet includes ballot event and at least one polling option that the ballot event is arranged, such as event of voting
It is elected for class squad leader, polling option:Zhang San, Li Si, king five carry out ballot operation for user.
User carries out selection implementation ballot operation to polling option after ballot equipment receives polled data packet, and user throws
After ticket, the result after the ballot operation of user is generated vote information and is sent to tissue main control end by ballot equipment.
Specifically, further including step:
Judge connect in preset time with whether the wireless router is established;
If so, prompt user has been established with wireless router and connect.
After being initiated the connection to wireless router, ballot equipment can track always connection procedure and update connection equipment of voting
State, in defined time-out time (such as one minute) interior connection failure then report connection failure information, successful connection prompt
User and wireless router successful connection, avoid user from carrying out faulty operation in connection failure.
Specifically, further including step:
Receive the voting results data packet sent from the tissue main control end;
It parses the voting results data packet and shows voting results.
Check voting results for convenience of all users to vote, in the present embodiment when tissue main control end receive it is all
After the vote information that the ballot equipment voted is sent, confluence analysis is carried out to all vote informations and obtains voting results, and
Voting results are generated into polled data office and are sent to ballot equipment, ballot equipment is parsed and shown after receiving polled data packet
Voting results can facilitate all voting users that can check voting results in the ballot equipment of oneself.
Correspondingly, the present embodiment also provides a kind of ballot system, as shown in Fig. 2, including:
Detection module 11 carrys out the direct-connected connection request signals of WLAN that self-organizing main control end is sent out for detecting;
First link block 12 connects for responding the direct-connected connection request signals of the WLAN and being established with the tissue main control end
It connects;
First receiving module 13, SSID and password for receiving the wireless router that the tissue main control end is sent;
Second link block 14 connects for being established with wireless router according to the SSID and password of the wireless router
It connects;
Second receiving module 15, for receiving the polled data packet sent from the tissue main control end;
Vote module 16 is operated for receiving user according to the ballot that the polled data packet carries out;
Sending module 17 is sent to the tissue main control end for the ballot to be operated generation vote information.
Specifically, the polled data packet includes ballot event and at least one vote that the ballot event is arranged
.
Specifically, further including:
Link block is judged, for judging connect in preset time with whether the wireless router is established;
Reminding module is connect for prompting user to be had been established with router;
Specifically, further including:
Third receiving module, for receiving the voting results data packet sent from the tissue main control end;
Display module, for parsing the voting results data packet and showing voting results.
The present embodiment makes ballot equipment establish the direct-connected connections of WLAN with main control end is organized by WLAN direct-connecting technologies, by group
It knits main control end and directly transmits SSID and password to ballot equipment, and UDP packets are sent using broadcast or multicast not by router
Mode and the mode of length encryption send SSID information and password to ballot equipment, it is possible to prevente effectively from packet loss phenomenon and
The problem for parsing time length, can send SSID and password faster so that ballot equipment can quick connect to wireless routing
Device, connection speed is fast, power height is connected into, and WLAN is direct-connected based on standard agreement, relative to multicast, broadcast transmission data packet
Proprietary protocol, it is versatile, it is applied widely.
Embodiment two
The present embodiment provides a kind of voting methods, as described in Figure 3, including step:
S21. detection carrys out the direct-connected connection request signals of WLAN that self-organizing main control end is sent out;
S22. the direct-connected connection request signals of the WLAN are responded and establish connection with the tissue main control end;
S23. the SSID and password of the wireless router that the tissue main control end is sent are received;
S24. it is established and is connected with wireless router according to the SSID of the wireless router and password;
S25. the polled data packet sent from the tissue main control end is received;
S26. user is received to be operated according to the ballot that the polled data packet carries out;
S27. the ballot is operated into generation vote information and is sent to the tissue main control end;
S28. judge whether to receive the request that the tissue main control end disconnects;
S29. if so, disconnecting the connection with the tissue main control end.
What is different from the first embodiment is that further including step S28 and S29.
After poll closing, it at this moment will wish ballot equipment and main control end is organized to return to original off-state, pass through
Tissue main control end sends the request disconnected, and ballot equipment judges whether to receive the request disconnected, if so, ballot
Equipment is disconnected with tissue main control end.Further, when occur in voting process emergency case need stop ballot, or
It needs to reset polling option, or needs replacing the ballot personnel that execute, tissue main control end can first be set to ballot
Preparation send the connection of the request disconnection disconnected between the two, then retransmits connection request to corresponding ballot equipment and establish
Connection, and retransmit the polled data packet after change.
Correspondingly, the present embodiment also provides a kind of ballot system, as shown in figure 4, including:
Detection module 21 carrys out the direct-connected connection request signals of WLAN that self-organizing main control end is sent out for detecting;
First link block 22 connects for responding the direct-connected connection request signals of the WLAN and being established with the tissue main control end
It connects;
First receiving module 23, SSID and password for receiving the wireless router that the tissue main control end is sent;
Second link block 24 connects for being established with wireless router according to the SSID and password of the wireless router
It connects;
Second receiving module 25, for receiving the polled data packet sent from the tissue main control end;
Vote module 26 is operated for receiving user according to the ballot that the polled data packet carries out;
Sending module 27 is sent to the tissue main control end for the ballot to be operated generation vote information;
Judge to disconnect module 28, the request for organizing main control end to disconnect is received for judging whether;;
Module 29 is disconnected, for disconnecting the connection with the tissue main control end.
The present embodiment occurs emergency case after poll closing or in voting process and needs to stop ballot, or needs
Reset polling option, or need replacing execute ballot personnel in the case of can a key disconnect ballot equipment and tissue
Main control end promotes user experience.
Specific embodiment described herein is only an example for the spirit of the invention.Technology belonging to the present invention is led
The technical staff in domain can make various modifications or additions to the described embodiments or replace by a similar method
In generation, however, it does not deviate from the spirit of the invention or beyond the scope of the appended claims.