Face recognition equipment tail line interface testing method
Technical Field
The invention relates to the technical field of testing, in particular to a tail interface testing method of face recognition equipment.
Background
Face recognition is a biological recognition technology for carrying out identity recognition based on facial feature information of people, and face recognition equipment is mainly applied to personnel identity verification occasions, such as an entrance guard machine, a gate machine, a verification terminal and the like. As shown in fig. 1, the face recognition device includes a host 100 and a tail interface 200, where the tail interface 200 is connected to the host 100 through an extension cable 300, and as a typical application, the tail interface includes a power interface 201, a wiegand interface 202, a network cable interface 203, a relay output and RS485 interface 204, and a USB interface 205. When the face recognition device leaves the factory to be tested, each tail interface needs to be tested so as to ensure that all tail interfaces can be communicated with a host and data transmission can be completed.
The prior art test method for the tail line interfaces of the face recognition equipment is to connect the interfaces one by one for data transmission, and has the defects of complex test program and low test efficiency.
Therefore, how to improve and simplify the testing procedure of the tail line interface and how to improve the testing efficiency when the face recognition device is subjected to factory testing becomes a technical problem to be solved urgently.
Disclosure of Invention
In order to solve the above problems, the present invention provides a method for testing a tail interface of a face recognition device to solve the above problems.
To this end, the embodiment of the invention discloses a method for testing a tail interface of face recognition equipment, the face recognition equipment comprises a host and a tail interface which are connected, the tail interface comprises a power port, a wiegand interface and a relay output interface, and the method comprises the following steps:
connecting a power supply to the power supply port;
respectively connecting two data ends of the wiegand interface to two ends of the relay output interface;
setting an I/O port connected with one data end of the wiegand interface in the host as a data sending end, and setting an I/O port connected with the other data end of the wiegand interface as a data receiving end;
setting a relay in the host to be conducted;
the host sends a first test signal through the data sending end, and receives a second test signal through the data receiving end;
and the host judges whether the first test signal is the same as the second test signal, and if so, the host indicates that the data end of the wiegand interface and the relay output interface are normal.
Optionally, the connecting the two data ends of the wiegand interface to the two ends of the relay output interface respectively specifically includes: connecting the DATA0 DATA end of the wiegand interface with the positive end of the relay output interface, and connecting the DATA1 DATA end of the wiegand interface with the negative end of the relay output interface;
the step of setting an I/O port connected with one data end of the wiegand interface in the host as a data sending end, and the step of setting an I/O port connected with the other data end of the wiegand interface as a data receiving end specifically comprises the following steps: and setting an I/O port connected with the DATA0 DATA end of the wiegand interface as a DATA sending end and an I/O port connected with the DATA1 DATA end of the wiegand interface as a DATA receiving end in the host.
Optionally, the connecting the two data ends of the wiegand interface to the two ends of the relay output interface respectively specifically includes: connecting the DATA1 DATA end of the wiegand interface with the positive end of the relay output interface, and connecting the DATA0 DATA end of the wiegand interface with the negative end of the relay output interface;
the step of setting an I/O port connected with one data end of the wiegand interface in the host as a data sending end, and the step of setting an I/O port connected with the other data end of the wiegand interface as a data receiving end specifically comprises the following steps: and setting an I/O port connected with a DATA1 DATA end of the wiegand interface as a DATA sending end and an I/O port connected with a DATA0 DATA end of the wiegand interface as a DATA receiving end in the host.
Optionally, the first test signal and the second test signal are both level signals.
Optionally, the first test signal and the second test signal are both data signals.
Optionally, the tail line interface further includes an RS485 interface, and the testing method further includes the following steps:
connecting the RS485 interface with the data end of an RS485 nixie tube, connecting the power end of the wiegand interface with the power end of the RS485 nixie tube, and connecting the grounding end of the wiegand interface with the grounding end of the RS485 nixie tube;
the host sends a third test signal to the RS485 nixie tube through the RS485 interface;
the host receives a fourth test signal returned by the RS485 nixie tube through the RS485 interface;
and if the host receives the correct fourth test signal, the power end, the grounding end and the RS485 interface of the wiegand interface are all normal.
Optionally, the third test signal and the fourth test signal are both data signals.
Optionally, the tail line interface further includes a USB interface, and the testing method further includes the following steps:
inserting a USB flash disk into the USB interface;
the host reads USB flash disk data through the USB interface;
if the host reads the correct data, the USB interface is normal.
Optionally, the tail line interface further includes a network cable interface, and the testing method further includes the following steps:
connecting the network cable interface to a router through a network cable;
the host PING IP address of the router;
if the host can pass PING, the network interface is indicated to be normal.
The invention has the beneficial effects that:
the embodiment of the invention can test the data end of the wiegand interface and the relay output interface simultaneously only through the connection of the wires and the receiving and transmitting of the data, does not need to use independent equipment to test the wiegand interface or the relay output interface, simplifies the testing means and improves the testing efficiency. The embodiment of the invention also provides a rapid test method for the RS485 interface, the USB interface and the network cable interface, and the test efficiency for the tail line interface of the face recognition device is effectively improved.
Drawings
Fig. 1 is a schematic structural diagram of a face recognition device in the prior art;
fig. 2 is a schematic diagram of a host and tail interface of a face recognition device according to an embodiment of the present invention;
fig. 3 is a flowchart of a test method according to an embodiment of the present invention for testing a wiegand interface and a relay output interface;
fig. 4 is a schematic diagram of a test of a wiegand interface and a relay output interface according to an embodiment of the present invention;
fig. 5 is a flowchart of a test method according to an embodiment of the present invention for testing an RS485 interface;
FIG. 6 is a flowchart of a testing method for testing a USB interface according to an embodiment of the present invention;
fig. 7 is a flowchart of a test method for testing a network cable interface according to an embodiment of the present invention.
Detailed Description
In order to more clearly and completely describe the technical scheme of the invention, the invention is further described below with reference to the accompanying drawings.
Examples
The invention provides an embodiment of a tail interface testing method of face recognition equipment. Referring to fig. 2, the face recognition device includes a host 100 and a tail interface 200 connected, the tail interface including a power port 201, a wiegand interface 202, and a relay output interface 203, see fig. 3. The test method comprises the following steps:
s101: connecting a power supply to the power supply port;
s102: two data ends of the wiegand interface are respectively connected to two ends of the relay output interface;
s103: an I/O port connected with one data end of the wiegand interface is arranged in a host as a data sending end, and an I/O port connected with the other data end of the wiegand interface is arranged as a data receiving end;
s104: setting a relay in a host to conduct;
s105: the host computer sends a first test signal through the data sending end, and receives a second test signal through the data receiving end;
s106: the host determines whether the first test signal is the same as the second test signal, and if so, the data end of the wiegand interface and the relay output interface 203 are both normal.
In practical application, the data signal communication of the wiegand interface is realized by the host controlling the I/0 port to send or receive the high-low level, so the host can flexibly set the receiving and sending states of the two data ends of the wiegand interface and the sent data.
Fig. 4 shows an example schematic diagram of the host 100 testing the wiegand interface 202 and the relay output interface 203 simultaneously. In the host 100, the I/O terminal P1 of the control unit is connected to the control terminal of the relay unit, and two output terminals of the relay unit are respectively connected to the positive terminal out+ and the negative terminal OUT-of the relay output interface 203, and the I/O terminal P2 and the I/O terminal P3 of the control unit are respectively connected to the DATA0 DATA terminal and the DATA1 DATA terminal of the wiegand interface 202. When the wiegand interface 202 is connected with the output interface of the breaker by a wire and the relay unit is turned on by outputting a control signal through the I/O terminal P1 of the control unit in the host 100, the I/O terminal P2 and the I/O terminal P3 corresponding to the control unit are communicated through the relay unit, the relay output interface 203 and the wiegand interface 202, so that in this case, it is only necessary to test whether the I/O terminal P2 and the I/O terminal P3 can correctly transmit and receive signals or data, and it can be determined whether the physical connection between the I/O terminal of the host control unit, the relay unit and the relay output interface 203 and the wiegand interface is clear. According to the embodiment of the invention, a wiegand interface or a breaker output interface is not required to be tested by using independent equipment, so that the testing means is simplified, and the testing efficiency is improved.
In an alternative embodiment, step S102 is specifically: connecting a DATA0 DATA end of the wiegand interface with a positive end OUT+ of the relay output interface, and connecting a DATA1 DATA end of the wiegand interface with a negative end OUT-of the relay output interface;
the step S103 specifically includes: an I/O port connected with a DATA0 DATA end of the wiegand interface is arranged in the host as a DATA sending end, and an I/O port connected with a DATA1 DATA end of the wiegand interface is arranged as a DATA receiving end.
In an alternative embodiment, step S102 is specifically: connecting a DATA1 DATA end of the wiegand interface with a positive end OUT+ of the relay output interface, and connecting a DATA0 DATA end of the wiegand interface with a negative end OUT-of the relay output interface;
the step S103 specifically includes: an I/O port connected with a DATA1 DATA end of the wiegand interface is arranged in the host as a DATA sending end, and an I/O port connected with a DATA0 DATA end of the wiegand interface is arranged as a DATA receiving end.
In an alternative embodiment, the first test signal and the second test signal are both level signals.
In an alternative embodiment, the first test signal and the second test signal are both data signals.
In an alternative embodiment, referring to fig. 2, the tail interface 200 further includes an RS485 interface 204, referring to fig. 5, the test method further includes the steps of:
s201: connecting an RS485 interface with the data end of an RS485 nixie tube, connecting the power end of a wiegand interface with the power end of the RS485 nixie tube, and connecting the ground end of the wiegand interface with the ground end of the RS485 nixie tube;
s202: the host sends a third test signal to the RS485 nixie tube through an RS485 interface;
s203: the host receives a fourth test signal returned by the RS485 nixie tube through an RS485 interface;
s204: if the host receives the correct fourth test signal, the power end, the grounding end and the RS485 interface of the wiegand interface are all normal.
In the embodiment of the invention, the RS485 data code is a universal nixie tube device with an RS485 data interface, and the wiring terminal comprises a power end, a grounding end, an RS485A data end and an RS485B data end. In the embodiment of the invention, the power end and the ground end of the wiegand interface 202 are used for supplying power to the RS485 data code, the power end and the ground end of the wiegand interface 202 are respectively connected with the power end and the ground end inside the host 100, and the RS485 data code displays data received through an RS485 bus according to a built-in communication protocol and returns the data to the RS485 bus. As an example, the host 100 sends data "001" to the RS485 nixie tube through the RS485 interface 204, the RS485 nixie tube returns data "Y", and if the host 100 receives data "Y" through the RS485 interface 204, it indicates that the power end, the ground end and the RS485 interface 204 of the wiegand interface 202 are all normal.
In an alternative embodiment, the third test signal and the fourth test signal are both data signals.
In an alternative embodiment, referring to fig. 2, the tail interface 200 further includes a USB interface 205, referring to fig. 6, the test method further includes the steps of:
s301: inserting the USB flash disk into the USB interface;
s302: the host reads the USB flash disk data through a USB interface;
s303: if the host reads the correct data, the USB interface is normal.
In an alternative embodiment, referring to fig. 2, tail interface 200 further includes a network cable interface 206, referring to fig. 7, the test method further includes the steps of:
s401: connecting a network cable interface to a router through a network cable;
s402: an IP address of the host PING router;
s403: if the host can pass PING, the network interface is normal.
It will be appreciated by those skilled in the art that implementing all or part of the above-described embodiment method may be implemented by a computer program to instruct related hardware, and the program may be stored in a computer readable storage medium, and the program may include the above-described embodiment method when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random-access memory (RAM), a hard disk, a U-disk, or a FLASH.
Of course, the present invention can be implemented in various other embodiments, and based on this embodiment, those skilled in the art can obtain other embodiments without any inventive effort, which fall within the scope of the present invention.