A kind of communication data method for uploading and a kind of communication data delivery methodTechnical field
The present invention relates to communication data transfer fields, logical in particular to a kind of communication data method for uploading and one kindLetter data delivery method.
Background technique
On Vehicles Collected from Market, radio-frequency card identification is supported also to support a variety of identifications such as fingerprint recognition, recognition of face in one simultaneouslyAccess-control card reader terminal, data-interface is 4 bus interface+serial ports (such as RS485, RS232) or 4 bus interface+netMouthful.
Not only equipment cost is higher for above scheme, and with the increase of interface directly result in installation and maintenance work amount andInstallation and maintenance difficulty increases, and will lead to engineering material expense, labour cost rising, while also adding the event of access control systemBarrier point.From commercial affairs, technology and environmentally friendly level, disadvantage mentioned above should all be improved, but the implementation due to designer to productSituation, which is not known about, causes interface communication technology vacancy.
Summary of the invention
The present invention provides a kind of communication data method for uploading and a kind of communication data delivery method.
The present invention is implemented as follows: provide a kind of communication data method for uploading, for establishing the next equipment to upperThe data communication of equipment, wherein data, packet are uploaded from the next equipment to upper equipment by the first data line and the second data lineIt includes:
By from the next equipment to upper tables of equipment to send communication data the first data line and the second data line levelIt drags down simultaneously, to start communication data upload;
By controlling the level conditions of the first data line and the second data line, so that bottom is set in same time intervalIt is standby to upper equipment sending logic position " 0 " or " 1 ";
After communication data is sent completely, the level of the first data line and the second data line is dragged down simultaneously again, under terminatingCommunication data transfer of the position equipment to upper equipment.
Further, in preferred embodiments of the present invention, if the first data line of control is drawn in same time intervalLow, the second data line is kept, then the next equipment is to upper equipment sending logic position 0;In another same time interval, control theOne data line is kept, the second data line drags down, then the next equipment is to upper equipment sending logic position 1.
The present invention is implemented as follows: a kind of communication data delivery method is provided, for establishing upper equipment to bottomThe data communication of equipment, wherein data are sent from upper equipment to the next equipment by third data line, comprising:
By the third data line from upper equipment to the next tables of equipment to transmission communication data in first time intervalLevel drags down, and is issued with starting communication data;
Made in the second time interval and third time interval by control, the level of third data line, which is in, drags down shapeState, and make upper equipment to the next equipment sending logic position " 0 " or " 1 ";
Communication data is completed after sending, and drags down the level of third data line in the 4th time interval, terminates upper setThe standby communication data transfer to the next equipment.
Wherein, the duration of first time interval, the second time interval, third time interval and the 4th time interval is set asFirst time interval=the 4th time interval > second time interval > third time interval.
Wherein, the duration of first time interval, the second time interval, third time interval and the 4th time interval is set asFirst time interval=four time intervals > third time interval > the second time interval.
Wherein, first time interval when flank speed, the second time interval, third time interval and the 4th time intervalSetting value are as follows: first time interval=four time intervals=200us, the second time interval=third time interval * 3=30us。
Be different from the prior art, the present invention provides a kind of communication data method for uploading, for establish the next equipment toThe data communication of position equipment, wherein data are uploaded from the next equipment to upper equipment by the first data line and the second data line,Include: by from the next equipment to upper tables of equipment to send communication data the first data line and the second data line level simultaneouslyIt drags down, to start communication data upload;By controlling the level of the first data line and the second data line in same time intervalSituation, so that the next equipment is to upper equipment sending logic position " 0 " or " 1 ";After communication data is sent completely, again by the first numberIt is dragged down simultaneously according to the level of line and the second data line, terminates communication data transfer of the next equipment to upper equipment.By this hairIt is bright, the data transmission of custom protocol, nothing can be carried out in the case where not influencing existing access-control card reader transmission Wiegand dataBy being that all obviously there is ease for use, flexibly using the card reader product developed of the present invention to the transformation of existing access control system or new clothesProperty, reliability and the feature of environmental protection.
Detailed description of the invention
It, below will be to use required in embodiment in order to illustrate more clearly of the technical solution of embodiment of the present inventionAttached drawing be briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not to be seen asIt is the restriction to range, it for those of ordinary skill in the art, without creative efforts, can be with rootOther relevant attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of flow diagram of communication data method for uploading provided by the invention.
Fig. 2 is a kind of flow diagram of communication data delivery method provided by the invention.
Fig. 3 is the hardware configuration that a kind of communication data method for uploading and communication data delivery method provided by the invention are related toSchematic diagram.
Fig. 4 is the time diagram that slave computer sends data in a kind of communication data method for uploading provided by the invention.
Fig. 5 is the time diagram that host computer sends data in a kind of communication data delivery method provided by the invention.
Specific embodiment
To keep the purposes, technical schemes and advantages of embodiment of the present invention clearer, implement below in conjunction with the present inventionThe technical solution in embodiment of the present invention is clearly and completely described in attached drawing in mode, it is clear that described realityThe mode of applying is some embodiments of the invention, rather than whole embodiments.Based on the embodiment in the present invention, abilityDomain those of ordinary skill every other embodiment obtained without creative efforts, belongs to the present inventionThe range of protection.Therefore, the detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit below and is wantedThe scope of the present invention of protection is sought, but is merely representative of selected embodiment of the invention.Based on the embodiment in the present invention,Every other embodiment obtained by those of ordinary skill in the art without making creative efforts belongs to thisInvent the range of protection.
Shown in referring to Fig.1, the present invention provides a kind of communication data method for uploading, set for establishing the next equipment to upperStandby data communication, wherein data, packet are uploaded from the next equipment to upper equipment by the first data line and the second data lineIt includes:
By from the next equipment to upper tables of equipment to send communication data the first data line and the second data line levelIt drags down simultaneously, to start communication data upload;
By controlling the level conditions of the first data line and the second data line, so that bottom is set in same time intervalIt is standby to upper equipment sending logic position " 0 " or " 1 ";
After communication data is sent completely, the level of the first data line and the second data line is dragged down simultaneously again, under terminatingCommunication data transfer of the position equipment to upper equipment.
Further, in preferred embodiments of the present invention, if the first data line of control is drawn in same time intervalLow, the second data line is kept, then the next equipment is to upper equipment sending logic position 0;In another same time interval, control theOne data line is kept, the second data line drags down, then the next equipment is to upper equipment sending logic position 1.
Referring to Fig.2, the present invention provides a kind of communication data delivery method, for establishing upper equipment to the next equipmentData communication, wherein data are sent from upper equipment to the next equipment by third data line, comprising:
By the third data line from upper equipment to the next tables of equipment to transmission communication data in first time intervalLevel drags down, and is issued with starting communication data;
Made in the second time interval and third time interval by control, the level of third data line, which is in, drags down shapeState, and make upper equipment to the next equipment sending logic position " 0 " or " 1 ";
Communication data is completed after sending, and drags down the level of third data line in the 4th time interval, terminates upper setThe standby communication data transfer to the next equipment.
Wherein, the duration of first time interval, the second time interval, third time interval and the 4th time interval is set asFirst time interval=the 4th time interval > second time interval > third time interval.
Wherein, first time interval when flank speed, the second time interval, third time interval and the 4th time intervalSetting value are as follows: first time interval=four time intervals=200us, the second time interval=third time interval * 3=30us。
The next equipment of the invention is illustrated by taking access-control card reader as an example.As shown in figure 3, Data0 and Data1 is gate inhibitionCard reader to host computer send data data line, Data2 be access-control card reader receive host computer data data line, above 3Root data line is the data line of unidirectional data transmission.Data transmission of the invention is solved using the communication mode of Hd3bAccess-control card reader and host computer carry out custom protocol sending and receiving data in the case where not increasing additional communication interface.It is this logicalLetter method can equally be well applied to other three bus communication scenes.In the present invention, each frame data of Hd3b agreement transmission,By enabling signal, terminated by end signal.
When slave computer (such as access-control card reader) sends a frame data to host computer, Data0 and Data1 are first dragged down simultaneouslyStarting transmission is carried out, data are then sent by Data0 and Data1, Data0 is drawn high after dragging down Data0 for a period of time again and then sends outLogical bit 0 is sent, draws high the then sending logic position 1 Data1 after dragging down Data1 for a period of time again.After data have been sent, again simultaneouslyDragging down Data0 and Data1 terminates this transmission, to complete the transmission of a frame data.Slave computer sends data time sequence figure such as Fig. 4It is shown.
When host computer sends a frame data to slave computer (such as access-control card reader), after Data2 is first dragged down the t1 timeIt draws high and carries out starting transmission, then continue through Data2 and send data, draw high then sending logic after Data0 is dragged down the t2 timePosition 0, draws high then sending logic position 1 after Data0 is dragged down the t3 time.After data have been sent, Data2, which is dragged down the t4 time, to be terminatedThis transmission, to complete the transmission of a frame data.The relationship of ordinary circumstance t1~t4 are as follows: t1=t4 > t2 > t3, wherein t2 andT3 can be exchanged with each other in the case where consensus.It is as shown in Figure 5 that host computer sends data time sequence figure.
Be different from the prior art, the present invention provides a kind of communication data method for uploading, for establish the next equipment toThe data communication of position equipment, wherein data are uploaded from the next equipment to upper equipment by the first data line and the second data line,Include: by from the next equipment to upper tables of equipment to send communication data the first data line and the second data line level simultaneouslyIt drags down, to start communication data upload;By controlling the level of the first data line and the second data line in same time intervalSituation, so that the next equipment is to upper equipment sending logic position " 0 " or " 1 ";After communication data is sent completely, again by the first numberIt is dragged down simultaneously according to the level of line and the second data line, terminates communication data transfer of the next equipment to upper equipment.By this hairIt is bright, the data transmission of custom protocol, nothing can be carried out in the case where not influencing existing access-control card reader transmission Wiegand dataBy being that all obviously there is ease for use, flexibly using the card reader product developed of the present invention to the transformation of existing access control system or new clothesProperty, reliability and the feature of environmental protection.
The technical effect and embodiment 1 of device provided by the embodiment of the present invention, realization principle and generation are identical, for letterIt describes, the present embodiment does not refer to place, can refer to corresponding contents in embodiment 1.
The foregoing is merely the preferred embodiment of the present invention, are not intended to restrict the invention, for this fieldFor technical staff, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made anyModification, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.