Specific embodiment
In order to which technical problems, technical solutions and advantageous effects to be solved by the present invention are more clearly understood, below in conjunction with
Accompanying drawings and embodiments, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only used
To explain the present invention, it is not intended to limit the present invention.
Fig. 1 is the schematic diagram for the system that mobile terminal provided in an embodiment of the present invention and attendance recorder are constituted, for the ease of saying
Bright, only the parts related to this embodiment are shown.
As shown in Figure 1, the system includes mobile terminal 11 and attendance recorder 12.Wherein, mobile terminal 11 can be notebook
Computer, tablet computer or mobile phone etc. have the terminal device of network access facility.
The embodiment of the invention provides a kind of transmission method of data, Fig. 2 is the biography of data provided in an embodiment of the present invention
The flow chart of transmission method, as shown in Fig. 2, this method specifically includes following steps S210 to step S240.
Step S210, mobile terminal receive attendance data.
Attendance data is to edit and input mobile terminal by user, and editor's attendance data needs specified permission, therefore only
There is the mobile terminal for having logged in particular account number to can receive the attendance data of user's input.The mobile terminal can be mobile phone, put down
The equipment that plate computer and laptop etc. have mobile office ability.
Step S220, mobile terminal judge whether to establish connection with attendance recorder.
According to current communication mechanism, as long as mobile terminal and attendance recorder are in connection status, then receiving attendance number
According to mobile terminal the attendance data can be sent to attendance recorder automatically.Attendance recorder is since storage capacity is weak, once it receives new
Attendance data, pervious attendance data will be covered, but mobile terminal is possible to by user misoperation, it is therefore possible to connect
The attendance data of mistake is received, in order to avoid the attendance data of mistake is sent to attendance recorder, it is thus necessary to determine that mobile terminal and examine
The connection status of diligent machine, and different operations is set according to different connection status.
Specifically, can judge the connection status of mobile terminal and attendance recorder by way of monitoring.Fig. 3 is the present embodiment
The flow chart of the connection status judgment method of offer.As shown in figure 3, method includes the following steps:
Step S310, mobile terminal read attendance recorder IP address and attendance recorder port numbers.
Mobile terminal reads corresponding IP address and port numbers by being based on current network condition.If on mobile terminal
The IP and port numbers for storing attendance recorder, then directly read the IP address and port numbers of storage;If it is not, reading user at that time
Input the IP and port numbers of attendance recorder.
Step S320, mobile terminal binding attendance recorder IP address and attendance recorder port numbers.
Whether step S330, mobile terminal are monitored according to attendance recorder IP address and attendance recorder port numbers and are connect with attendance recorder.
By binding, whether real-time monitoring has information to be transmitted by the IP address or port.
Step S230, mobile terminal send attendance data to attendance recorder when determining and attendance recorder establishes connection.
Mobile terminal and attendance interconnection plane, are normal connection status.
In a kind of simple and efficient implementation, attendance data can be sent to attendance recorder.
In another preferred implementation, attendance data can be sent in the following manner.Fig. 4 is the embodiment of the present invention
The flow chart of the transmission attendance data of offer, as shown, this method comprises:
Step S410 receives the judgement message from attendance recorder, judges the attendance that message is sent for indicating mobile terminal
Whether data and the attendance data that attendance recorder stores are consistent.
Can directly whether consistent by comparing content check data, the spies such as version number or modification time can also be passed through
Sign.
Step S420, when the attendance data that mobile terminal is sent is consistent with the attendance data that attendance recorder stores, by attendance
Data are sent to attendance recorder.
Step S430 is initiated when the attendance data for attendance data and the attendance recorder storage that mobile terminal is sent is inconsistent
The inquiry of attendance data to attendance recorder whether is sent, and after receiving confirmation message, attendance data is sent to attendance recorder.
The mechanism of inquiry can prevent maloperation from accidentally being sent out, when user clicks really after mobile terminal is issued and inquired
Recognize, attendance data can be just sent to attendance recorder by mobile terminal.
In order to determine the safety in attendance data source, after attendance data is sent to attendance recorder by mobile terminal, attendance recorder
It can determine whether to store the attendance data again after judging administrator's identity.That is, firstly, attendance recorder judgement movement
Whether terminal has opened administrator right;Then, attendance recorder caches attendance after determining that mobile terminal has opened administrator right
Data.
In order to confirm that attendance data format is errorless, attendance recorder can store the attendance data after verifying format again.That is, examining
Whether diligent machine verification attendance data meets the requirements;Attendance recorder caches attendance data after completing verification.
Step S240, mobile terminal are determining that refusal sends attendance data when not establishing connection with attendance recorder.
This step can be to avoid being written into new attendance data for mobile terminal under networking situation, therefore mobile terminal is not
In the case where connecting with attendance recorder, the attendance data that family is edited on mobile terminals, which can be used, to be transmitted.Preferably, mobile
Terminal is determining that refusal sends attendance data when not establishing connection with attendance recorder.
The embodiment of the present invention executes corresponding behaviour by the judgement to network connection situation under heterogeneous networks connection
Make, avoids influence of the network condition to attendance data, so that it is consistent so that the mobile terminal of user and attendance recorder is maintained data,
It ensure that the accuracy of attendance management.
The embodiment of the invention also provides a kind of transmitting device of data, Fig. 5 is data provided in an embodiment of the present invention
The structural block diagram of transmitting device, as shown in figure 5, the device includes receiving unit 510, judging unit 520, the first execution unit
530 and second execution unit 540.
Receiving unit 510 is for receiving attendance data.
First judging unit 520 is for judging whether to establish connection with attendance recorder.
First execution unit 530 is used to send attendance data to attendance recorder when determining and attendance recorder establishes connection.
Second execution unit 540 is used to determine that refusal sends attendance data when not establishing connection with attendance recorder.
Preferably, the first judging unit 520 includes: read module, for reading attendance recorder IP address and attendance recorder port
Number;Binding module, for binding attendance recorder IP address and attendance recorder port numbers;Module is monitored, for according to attendance recorder IP address
It monitors and whether connect with attendance recorder with attendance recorder port numbers.
Preferably, the first execution unit 530 includes: receiving module, for receiving the judgement message from attendance recorder, is judged
Whether the attendance data that message is used to indicate that attendance data and attendance recorder that mobile terminal is sent store is consistent;First sends mould
Attendance data is sent to by block when the attendance data for sending when mobile terminal is consistent with the attendance data that attendance recorder stores
Attendance recorder;Second sending module, the attendance data that attendance data and attendance recorder for sending when mobile terminal store are inconsistent
When, initiate whether send the inquiry of attendance data to attendance recorder, and after receiving confirmation message, attendance data is sent to and is examined
Diligent machine.
Preferably, the device further include: second judgment unit, for judging whether mobile terminal has opened administrator's power
Limit;First cache unit caches attendance data for attendance recorder after determining that mobile terminal has opened administrator right.
Preferably, the device further include: verification unit, for verifying whether attendance data meets the requirements;Second caching is single
Member, for caching attendance data after completing verification.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
Can unit division progress for example, in practical application, can according to need and by above-mentioned function distribution by different functions
Unit is completed, i.e., the internal structure of device is divided into different functional unit or module, with complete it is described above whole or
Person's partial function.Each functional unit in embodiment can integrate in one processing unit, and it is independent to be also possible to each unit
It is physically present, can also be integrated in one unit with two or more units, above-mentioned integrated unit both can be using hard
The form of part is realized, can also be realized in the form of software functional units.In addition, the specific name of each functional unit is also
For the ease of mutually distinguishing, the protection scope being not intended to limit this application.The specific work process of unit in above-mentioned apparatus, can
With with reference to the corresponding process in aforementioned device embodiment, details are not described herein.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Described function can be realized using different device to each specific application, but this realization is it is not considered that exceed
The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device and device can pass through others
Mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of module or unit, only
For a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine
Or it is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed phase
Coupling or direct-coupling or communication connection between mutually can be through some interfaces, the INDIRECT COUPLING or communication of device or unit
Connection can be electrical property, mechanical or other forms.
Unit may or may not be physically separated as illustrated by the separation member, shown as a unit
Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple networks
On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
It, can if integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product
To be stored in a computer readable storage medium.Based on this understanding, the technical solution essence of the embodiment of the present invention
On all or part of the part that contributes to existing technology or the technical solution can be with the shape of software product in other words
Formula embodies, which is stored in a storage medium, including some instructions are used so that a calculating
It is real that machine equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the present invention
Apply all or part of the steps of each embodiment device of example.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only storage
Device (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or light
The various media that can store program code such as disk.
The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to the foregoing embodiments
Invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each implementation
Technical solution documented by example is modified or equivalent replacement of some of the technical features;And these modification or
Replacement, the spirit and scope of each embodiment technical solution of the embodiment of the present invention that it does not separate the essence of the corresponding technical solution.
The above is merely preferred embodiments of the present invention, be not intended to limit the invention, it is all in spirit of the invention and
Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within principle.