CN115767079A - Automatic testing method, system, device and storage medium for network camera - Google Patents
Automatic testing method, system, device and storage medium for network camera Download PDFInfo
- Publication number
- CN115767079A CN115767079A CN202211395321.7A CN202211395321A CN115767079A CN 115767079 A CN115767079 A CN 115767079A CN 202211395321 A CN202211395321 A CN 202211395321A CN 115767079 A CN115767079 A CN 115767079A
- Authority
- CN
- China
- Prior art keywords
- test
- network camera
- upper computer
- testing
- network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)
Abstract
The invention provides an automatic testing method, a system, a device and a storage medium of a network camera, wherein the method comprises the following steps: s1, an upper computer indicates a test tool kit to supply power to a network camera; s2, the upper computer receives system information sent by the network camera through the network and determines whether the camera is consistent according to the system information; if so, testing through a testing tool kit according to the flow or testing by a camera; s3, the upper computer receives test data sent by the test tool kit or the camera, analyzes the test data, judges whether a corresponding test item of the camera passes or not, and displays a test result; in the test process, the upper computer interacts with the camera through the network. By utilizing the technical scheme, full-automatic testing can be realized, a page does not need to be manually operated by a tester, the testing efficiency is improved, the operation is simple, and the learning cost is low.
Description
Technical Field
The invention relates to the technical field of camera testing, in particular to an automatic testing method, system, device and storage medium of a network camera.
Background
At present, in the same industry, the function test for the assembled camera is realized by manually operating a webpage and matching with an external test tool to individually test each function one by one. The method has the following problems:
1. the learning cost of the tester is high: the functions of the camera are more, and testers need to learn the test method of each module and use an external tool board, so that the requirement on the learning capability of the testers is high;
2. the operation is complicated, the steps are multiple, and test items are easy to omit: the camera has more functions, is tested manually, is easy to miss and cannot be detected in place completely;
3. low efficiency, high labor cost: a single computer can only test 1 camera simultaneously, so that the efficiency is low, the testing time is long, and the labor cost is high.
Disclosure of Invention
The embodiment of the invention provides an automatic testing method, system and device of a network camera and a storage medium, so as to realize full-automatic testing without manual operation of a page by a tester.
In order to achieve the above object, in one aspect, there is provided an automated testing method for a network camera, including:
s1, an upper computer sends an instruction to a test tool suite and indicates the test tool suite to supply power to a network camera connected with the test tool suite;
s2, the upper computer receives camera system information sent by the electrified network camera through a network, the system information comprises the product model of the upper computer, and the upper computer determines whether the network camera is consistent with the product model to be tested according to the received system information; if yes, testing the network camera through the testing tool kit according to the testing flow corresponding to the model of the product to be tested or testing the network camera by the network camera;
s3, the upper computer receives the test data sent by the test tool suite or the network camera, analyzes the test data sent by the test tool suite according to preset test passing conditions, judges whether a corresponding test item of the network camera passes or not, and displays a test result;
and in the test process, the upper computer interacts with the network camera through a network.
Preferably, in the automated testing method, a network server is arranged on the network camera, and the upper computer interacts with the network camera through a Common Gateway Interface (CGI) instruction; the test tool suite interacts with the upper computer through a USB protocol; the test tool suite is connected with the network camera through the input/output interface.
Preferably, in the automated testing method, the upper computer is connected to a plurality of test tool kits through a plurality of USB interfaces, each test tool kit is used to test one webcam, and the upper computer simultaneously tests different webcams through the plurality of test tool kits.
Preferably, before step S1, the automated testing method further includes:
the upper computer receives an input order number to be tested, determines the product model of the network camera to be tested and a test flow corresponding to the determined product model according to the order number, and the test flow comprises the following steps: test items and execution order of the test items.
Preferably, the automated testing method further includes: and the upper computer selects a test flow corresponding to the determined product model from the corresponding relation between the pre-stored product model and the test flow according to the determined product model of the network camera to be tested.
Preferably, the automated testing method includes, when the test item is to test a plurality of external interfaces of the network camera, performing a test by using a test kit, where performing a test includes one or more of:
the power test is carried out, wherein a test tool suite realizes power supply control on the network camera through a PSE chip, then a power value is calculated through voltage and current detection and is uploaded to an upper computer, and the upper computer judges whether the power of the network camera meets a preset power condition or not;
alarm function tests, including alarm input function test and alarm output function test, wherein alarm input function test includes: the test tool kit triggers alarm input to the network camera through the first triode switching circuit, and after the network camera obtains the change of the function state of the alarm input interface, the change result of the alarm input state is fed back to the upper computer; the alarm output function test comprises the following steps: the testing tool kit collects alarm output information of the network camera through the triode switch circuit, judges the collected alarm output information, and determines that an alarm output interface of the network camera is normal if the state changes;
DC function: the test tool kit realizes DC12V power supply through a switching circuit formed by a triode and a PMOS circuit, tests out power P by using a power monitoring IC, then sends the tested power value to an automatic test module of an upper computer, and determines that the DC functional item of the network camera passes the test when the power P is greater than a preset threshold value;
smart IR Lamp functional test: before testing, the test tool kit records a power value P0 of a Smart IR lamp through an MCU arranged on the test tool kit, and uploads the P0 to an upper computer; then, the upper computer controls the network camera to only turn on the dipped headlight, the MCU records the power value P1 of the Smart IR lamp at the moment, and the power value P1 is uploaded to the upper computer; the upper computer controls the network camera to turn off the dipped headlight and only turn on the high beam, the MCU records the power value P2 of the Smart IR lamp at the moment and uploads the P2 to the upper computer; the upper computer judges whether the value of (P1-P0) is larger than a preset low beam light power threshold value or not and whether the value of (P2-P0) is larger than a preset high beam light power threshold value or not according to the received P0, P1 and P2, and if the two judgment results are yes, the function of the Smart IR lamp is determined to be normal;
and (3) testing an RS485 functional module: the RS485 function module of the network camera receives the specific character string sent by the upper computer through the network, and sends the received specific character string to the MCU of the test tool kit so as to be analyzed by the MCU, and after the MCU is analyzed correctly, the result of the RS485 is uploaded to the upper computer.
Preferably, the automated testing method includes, when the test item is to test the internal performance of the network camera, performing the test by the network camera, where performing the test by the network camera includes one or more of the following:
SD card function test: the upper computer sends a Common Gateway Interface (CGI) instruction for SD card function test to the network camera through the network, the network camera completes the initialization and identification of the SD card after receiving the CGI instruction for SD card function test, and uploads the result to the upper computer through the network after the identification is successful;
testing real-time clock RTC function: the method comprises the steps that an RTC configuration CGI instruction is sent to a network camera by an upper computer, the network camera responds to an RTC time acquisition instruction sent by the upper computer through a network after RTC configuration is carried out according to the RTC configuration CGI instruction, and the current RTC time is uploaded to the upper computer so that the upper computer can check and judge the front RTC time and the rear RTC time;
and (3) information proofreading: the upper computer sends an information proofreading CGI instruction to the network camera, the network camera responds to the information proofreading CGI instruction to send equipment information to the upper computer, and the upper computer receives the equipment information sent by the network camera and checks the information by inquiring a preset equipment information database;
and (3) testing the resolution ratio: and the upper computer sends a CGI instruction for modifying the resolution configuration to the network camera, the network camera modifies the resolution according to the CGI instruction for modifying the resolution configuration, judges whether the modification is successful, and uploads the result to the upper computer after judging that the modification is successful.
Preferably, the automated testing method includes the steps of performing interaction with a testing tool kit and a network camera by an automated testing module arranged on an upper computer, wherein the automated testing module is implemented based on a Qt architecture, calling a database by using a QSqlDatabaser technology, performing local data configuration by using QSettings, communicating with the testing tool kit by using a qseriol port, performing project setting on an interface by using qtbleview and qstyledltemdelete, searching and/or querying the network camera by using a callback function, and starting automated testing of an asynchronous thread by using a Qt event loop mechanism in a testing process.
In another aspect, an automated testing system for a network camera is provided, which includes an upper computer and a testing tool kit for implementing any one of the automated testing methods described above.
In another aspect, an automated testing system for a network camera is provided, which is used for automated testing of the network camera, and comprises an upper computer and a testing tool kit, wherein,
the host computer includes automatic test module, and automatic test module includes:
the first processing module is used for sending an instruction to the test tool suite and indicating the test tool suite to supply power to the network camera connected with the test tool suite;
the second processing module is used for receiving camera system information sent by the network camera after being powered on through a network, wherein the system information comprises the product model of the network camera, and determining whether the network camera is consistent with the product model to be tested according to the received system information; if yes, testing the network camera through the test tool suite according to the test items or testing the network camera by the network camera according to the test flow corresponding to the model of the product to be tested;
the third processing module is used for receiving the test data sent by the test tool suite or the network camera, analyzing the test data sent by the test tool suite according to a preset test passing condition, judging whether a corresponding test item of the network camera passes or not, and displaying a test result;
the test tool kit is used for receiving the instruction sent by the automatic test module, performing corresponding operation on the network camera according to the instruction, wherein the corresponding operation comprises power supply and test, and sending test data to the automatic test module;
and in the test process, the automatic test module interacts with the network camera through a network.
Preferably, in the automatic test system, a network server is arranged on the network camera, and the upper computer interacts with the network camera through a Common Gateway Interface (CGI) instruction; the test tool suite interacts with the upper computer through a USB protocol; the test tool suite is connected with the network camera through the input and output interface.
Preferably, the automatic test system, wherein the host computer is connected with a plurality of test tool kits through a plurality of USB interfaces respectively, each test tool kit is used for testing one network camera, and the automatic test module of the host computer tests different network cameras simultaneously through a plurality of test tool kits.
Preferably, the automated testing system, wherein the testing kit comprises an MCU and one or more of the following:
the power testing module comprises a PSE chip, realizes power supply control on the network camera through the PSE chip, calculates a power value through voltage and current detection, and uploads the power value to the upper computer so as to judge whether the power of the network camera meets preset power conditions or not through the automatic testing module;
the alarm function testing module comprises an alarm input function testing module and an alarm output function testing module, wherein the alarm input function testing module is used for triggering alarm input to the network camera through the first triode switching circuit, so that after the network camera obtains the function state change of the alarm input interface, the change result of the alarm input state is fed back to the upper computer; the alarm output function testing module is used for acquiring alarm output information of the network camera through the second triode switch circuit, judging the acquired alarm output information, and determining that an alarm output interface of the network camera is normal if the state changes;
the DC functional module comprises a switching circuit formed by a triode and a PMOS circuit, is used for realizing DC12V power supply, tests power P by using a power monitoring IC, and then sends the tested power value to the automatic testing module;
the Smart IR lamp function testing module is used for recording the power value P0 of the Smart IR lamp through the MCU and uploading the P0 to the upper computer before testing; when the upper computer controls the network camera to only turn on the dipped headlight, the MCU records the power value P1 of the Smart IR lamp at the moment and uploads the P1 to the upper computer; when the upper computer controls the network camera to turn off the dipped headlight and only turn on the high beam, the MCU records the power value P2 of the Smart IR lamp at the moment and uploads the P2 to the upper computer;
and the RS485 function test module is used for receiving the specific character string sent by the RS485 function module of the network camera, analyzing the character string, and uploading the analyzed result of the RS485 to the upper computer after the MCU is correctly analyzed, wherein the specific character string sent by the RS485 function module of the network camera is sent by the automatic test module through a network.
In another aspect, an automatic testing device for a network camera is provided, which includes a memory and a processor, wherein the memory stores at least one program, and the at least one program is executed by the first processor to implement the steps executed by the upper computer in any one of the above methods.
In yet another aspect, a computer-readable storage medium is provided, wherein at least one program is stored in the storage medium, and the at least one program is executed by a processor to implement the steps executed by an upper computer in any of the above methods.
The technical scheme has the following technical effects:
the technical scheme of the embodiment of the invention adopts a mode of cooperation of the upper computer and the test tool suite, and in the test process, the upper computer and the network camera exchange information through a network such as CGI (common gateway interface) instructions, so that a tester does not need to operate pages one by one to perform manual test, and the full-automatic network camera test can be realized.
Specifically, the technical scheme of the embodiment of the invention has the following advantages:
the operation is simple, the learning cost is low: after the camera is connected to the test tool suite, the upper computer is simply operated, the test results of the functional modules can be output after waiting for a while, and a tester does not need to know specific test contents;
the test time is short: each functional module test is automatically performed through the interactive operation among the upper computer, the test tool kit and the camera, a manual operation page is not needed, and the time of an operation interface is saved;
the test efficiency is high: when the technical scheme of the embodiment of the invention is used for testing, a plurality of cameras can be accessed for testing at one time, so that the testing efficiency is greatly improved, and the working hours of testers and the number of the needed testers can be further reduced;
the test items are comprehensive: when the technical scheme of the embodiment of the invention is used for testing, the test result can be visually displayed; furthermore, each test item of the machine type can be displayed according to different machine types and automatically tested, the test items are comprehensive, and omission of the test items is avoided; and various test contents can be displayed on an upper computer interface, and the test items Pass/Fail are visually displayed.
Drawings
Fig. 1 is a schematic flow chart of an automated testing method for a network camera according to an embodiment of the present invention;
FIG. 2 is a block diagram of an automated testing system for web cameras according to an embodiment of the present invention;
FIG. 3 is a block diagram of a testing tool kit used in the automated testing method or system according to an embodiment of the present invention;
FIGS. 3A to 3I are schematic flow charts of corresponding functional modules in a test kit according to an embodiment of the present invention;
FIG. 4 is a schematic circuit diagram of a complete machine frame in the test kit according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an exemplary embodiment of an alarm module of the test kit;
FIG. 6 is a schematic circuit diagram of a DC functional module in a test kit according to an embodiment of the present invention;
FIG. 7 is a schematic circuit diagram of a DC power detection module in a test kit according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an automated testing apparatus for a network camera according to an embodiment of the present invention.
Detailed Description
To further illustrate the various embodiments, the invention provides the accompanying drawings. The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the embodiments. Those skilled in the art will appreciate still other possible embodiments and advantages of the present invention with reference to these figures. Elements in the figures are not drawn to scale and like reference numerals are generally used to indicate like elements.
The invention will now be further described with reference to the drawings and the detailed description.
The first embodiment is as follows:
fig. 1 is a flowchart illustrating an automated testing method for a network camera according to an embodiment of the present invention. Referring to fig. 1, the automated testing method of this embodiment includes the following steps:
s1, an upper computer sends an instruction to a test tool suite and indicates the test tool suite to supply power to a network camera connected with the test tool suite;
s2, the upper computer receives camera system information sent by the electrified network camera through a network, the system information comprises the product model of the upper computer, and the upper computer determines whether the network camera is consistent with the product model to be tested according to the received system information; if so, testing the network camera through the test tool kit according to the corresponding test flow and the test items or testing the network camera by the network camera;
illustratively, the system information uploaded to the upper computer by the camera according to needs can also comprise information such as the MAC address of the camera;
in one specific implementation, when the test item is to test a plurality of external interfaces of the network camera, the test is carried out through a test tool suite; when the test item is to test the internal performance of the network camera, the network camera automatically tests, and under the condition, the upper computer directly carries out information interaction with the network camera through a network;
illustratively, the test items of the external interface of the network camera include one or more of the following items: power test, alarm function test, smart IR lamp function test, RS485 function module test and the like, and DC function realization; the test items of the internal performance of the network camera include one or more of the following items: SD card function test, real-time clock RTC function test, information proofreading, resolution test and the like;
s4, the upper computer receives the test data sent by the test tool suite or the network camera, analyzes the test data sent by the test tool suite according to preset test passing conditions, judges whether a corresponding test item of the network camera passes or not, and displays a test result;
and in the test process, the upper computer interacts with the network camera through a network, including various information interactions.
Preferably, one of the test kit described above may be implemented as a test kit board, such as a PCBA (printed circuit board) test kit board.
In step S4, the test result of the test item may be visually displayed directly on the interface of the upper computer, for example, by the PASS/FAIL related label.
Preferably, a network server is arranged on the network camera, and the upper computer and the network camera interact through a Common Gateway Interface (CGI) instruction; the test tool kit interacts with the automatic test module through a USB protocol; the test tool suite is connected with the network camera through an input/output interface. Illustratively, the camera is connected with the test tool kit through a special interface tail wire of the camera, and the connection operation is simple.
Preferably, the upper computer is respectively connected with a plurality of test tool kits through a plurality of USB interfaces, each test tool kit is used for testing one network camera, and the automatic test module of the upper computer simultaneously tests different network cameras through a plurality of test tool kits. For example, by using the scheme of the embodiment of the invention, a plurality of cameras such as 4 cameras can be accessed at one time for testing, so that the testing efficiency is greatly improved, and the working hours of testers and the number of the required testers are reduced. When the test kits are implemented as test boards, a plurality of test tool boards are provided in real time for the test kit.
Preferably, before step S1, the upper computer receives an input order number to be tested, and determines a product model of the network camera to be tested and a test procedure corresponding to the product model according to the order number, where the test procedure includes: test items and execution order of the test items. In a specific implementation, the method of the embodiment of the present invention further includes: and selecting a test flow corresponding to the determined product model from the corresponding relation between the pre-stored product model and the test flow according to the determined product model of the network camera to be tested. Different test procedures can be set for different product models.
In the embodiment of the invention, the automatic testing module is used for interacting with a testing tool kit and a network camera to realize testing. The automated test module described above is illustratively implemented as a program or software. The automatic testing method of the network camera in the embodiment of the invention uses the upper computer, the testing tool kit and the camera to interact, the upper computer is used as a main control party to respectively transmit commands to the camera and the testing tool kit to complete corresponding testing contents, and the camera and the testing tool kit respectively return respective testing results to the upper computer; and the upper computer displays the result of each test item, so that the whole process does not need to be operated by personnel, and the automatic test of each function can be realized.
Preferably, the automated testing method of the embodiment of the invention can test one or more of the following functions through the interaction of the upper computer, the testing tool kit and the camera: the system comprises interface functions such as power test, alarm function, DC function, smart IR lamp function, RS485 function, SD card, RTC function, information proofreading, resolution test and the like. The specific test details of these functions are described in detail below.
Example two:
fig. 2 is a schematic diagram of an overall architecture of an automatic testing system for a network camera according to an embodiment of the present invention, where the automatic testing system is used to implement an automatic testing method according to an embodiment of the present invention. As shown in fig. 2, the overall architecture of the network camera automated testing system includes: the system comprises an upper computer, a test tool suite and a network camera to be tested. Wherein, the host computer can be realized as a PC computer. The upper computer realizes the automatic testing method of the embodiment of the invention through the automatic testing module of the network camera arranged on the upper computer. The automatic test module can be realized as upper computer software. The upper computer interacts with the camera through a network and interacts with the test tool suite through a USB interface by utilizing a USB protocol; the test tool suite is connected with the camera through the input and output interface. Illustratively, the camera is connected to the test kit via a dedicated interface tail. The network may be a network implemented by a switch.
The automated test system of this embodiment may enable testing of one or more of the following functions: the system comprises interface functions such as power test, alarm function, DC function, smart IR lamp function, RS485 function, SD card, RTC function, information proofreading, resolution test and the like.
Wherein, PC host computer: the system is mainly used for activating the camera and acquiring corresponding camera equipment information from a preset back-end database according to input order number information; the upper computer is mainly used for coordinating the camera and the test tool suite to test each function, receiving test-related data sent by the test tool suite and the camera, and analyzing the test-related data to determine whether the corresponding function of the network camera passes the test.
Test tool kit: the MCU is mainly matched with and designs each circuit module to realize the test and function trigger of the camera interface and report the result to the upper computer; in a specific implementation, a Cortex M4 MCU with a USB function is adopted, and the MCU is used for controlling each circuit to complete corresponding interface function test; the internal design framework of the test kit is shown in fig. 3.
A camera: and acquiring a Common Gateway Interface (CGI) interface command sent by an upper computer end to assist in completing the function test of each interface.
As shown in fig. 3, the test kit includes modules required for testing the functions of each interface, including: alarm function test module (alarm module for short), DC function module (or DC detection module for short), power test module namely power detection module, RS485 function test module (RS 485 module for short), USB function module, instrument external member power supply circuit, PSE power module. Further, the test kit may further include a network forwarding module for implementing network forwarding of information when needed. Further, the test kit may further include a Smart IR lamp test module for performing a Smart IR lamp functional test. The USB function module is used for realizing the USB function of the test tool kit; the kit power circuit is used to power the various circuits on the test kit.
The following describes the implementation method of each interface function test specifically:
A. and (3) power testing: the testing tool kit realizes power supply control of the camera through the PSE chip, calculates a power value through voltage and current detection, and uploads a power testing result to the upper computer through the USB, so that the upper computer judges power through an automatic testing module or software; see fig. 3A for a schematic flow diagram;
B. the alarm function is as follows: see FIG. 3B for a schematic flow diagram; which comprises the following steps:
and (4) input function testing: triggering alarm is carried out through an MOS tube switching circuit arranged on the test tool kit, such as a first MOS tube switching circuit, a triggered alarm signal is input to the camera, after the camera acquires the change of the function state of an alarm input interface of the camera, the change result of the alarm input state is fed back to the upper computer by the camera, and if the change result is sent to the upper computer through a CGI instruction;
and (3) output function testing: when the testing tool kit inputs an alarm signal to the camera, the MCU on the testing tool kit acquires information of an alarm output interface of the camera through an MOS tube switching circuit such as a second MOS tube switching circuit and judges, if the state of the output interface changes, namely the alarm output interface of the camera outputs the alarm signal, which indicates that the alarm output interface of the camera is normal, and the testing tool kit feeds back the result to an upper computer;
DC function: controlling DC12V power supply by a switching circuit formed by a triode and a PMOS circuit on a test tool kit, testing power P by using a power monitoring IC, and determining that the DC functions normally when the power value is greater than a preset power threshold value, such as greater than 3W; see fig. 3C for a schematic flow diagram;
D. smart IR Lamp function: before testing, recording the power value P0 of a Smart IR lamp on a testing tool kit by an MCU (microprogrammed control Unit); the upper computer indicates that the camera only starts the dipped headlight, after the camera only starts the dipped headlight, the MCU records the power value P1 of the Smart IR lamp at the moment, and uploads a USB data packet to the PC through a USB interface; the upper computer indicates the camera to turn off the dipped headlight and only turn on the high beam, and after the camera turns off the dipped headlight and only turns on the high beam, the MCU records the power value P2 of the Smart IR lamp at the moment and uploads the power value to the PC; in order to test the power of each stage related to the Smart IR lamp, the Smart lamp of the camera can be indicated or controlled by the upper computer through a CGI instruction without manual participation;
after receiving the power value, the PC upper computer performs the following calculation: calculating the values of (P1-P0) and (P2-P0), judging whether (P1-P0) is greater than a predetermined low beam power threshold value and judging whether (P2-P0) is greater than a predetermined high beam power threshold value; if the results of both of the above determinations are yes, i.e., both are greater than the predetermined corresponding power threshold, then it is determined that the SmartIR lamp is functioning properly; the flow chart is shown in FIG. 3D;
E. RS485 function: after receiving a specific character string for RS485 testing sent by an upper computer through a CGI instruction, the camera sends the received specific character string to an MCU (microprogrammed control unit) of a testing tool kit through an RS485 function, and after the MCU analyzes correctly, an analyzed result is uploaded to the upper computer through a USB (universal serial bus) interface; see FIG. 3E for a flow chart;
the test items from A to E are tests on external interfaces of the network cameras, and are mainly realized by the interaction of an upper computer and a test tool suite through a USB interface, wherein the upper computer is interacted with the cameras through network CGI (common gateway interface) receiving and sending instructions to assist in completing various tests; the upper computer and the test tool suite exchange information through a USB protocol;
fig. 4 is a schematic circuit diagram of a complete machine frame in a test tool kit in a network test system according to an embodiment of the invention. As shown in fig. 4, the test tool kit in this embodiment mainly includes: the device comprises an MCU, a PSE module connected with the MCU, a DC power detection module, an RS485 module, an alarm module and the like.
Fig. 5 to 7 are exemplary circuit diagrams of different functional module implementations of the tool kit under the architecture shown in fig. 4. Fig. 5 is a schematic circuit structure diagram of the alarm module. Referring to fig. 5, when the camera has an alarm output trigger, the MOS transistor circuit in the alarm module may be turned on, for example, the MOS transistor Q19 or Q20 is turned on, so that the MCU detects a level change, that is, determines that the alarm output function of the camera is normal. When the IPC camera triggers the alarm output, the pole of the MOS tube GS is conducted, and the pole D of the MOS tube GS is conducted to be changed into a low level, so that the IPC alarm output is detected to be successfully triggered.
Fig. 6 is a schematic circuit diagram of the DC functional module. As shown in fig. 6, when the DC function is needed, the transistor Q8 is turned on by the MCU outputting a high level, so that the PMOS transistor Q7 is turned on, and the DC power can be supplied to the camera. FIG. 6 functional description: when the base of the triode Q8 has a high level, the triode Q8 is conducted, so that the G electrode of the PMOS tube Q7 is 0V, the PMOS tube Q7 is conducted, and 12V is supplied to the DC port. The DC port can supply 12V DC power to the camera.
Fig. 7 is a schematic circuit diagram of a power detection module, i.e., a DC power detection module. As shown in fig. 7, when the DC function is turned on, the 12V power may flow through a resistance value of 0.2R, and the voltage and the current associated with the port corresponding to the camera may be detected by the power detection chip INA220, so as to calculate the power value of the port corresponding to the camera, thereby implementing the power detection of the camera, for example, implementing the DC12 power detection. Fig. 7 functional description: when 12V flows through the resistor R179, the voltage drop at two ends of the resistor can be measured through a device of the PSE chip U13, so that a current value is calculated; and obtaining a voltage value through IN + measurement of the PSE chip U13; the power values were obtained by I x V.
F. SD card function: after the camera receives a CGI instruction which is sent by an upper computer and used for indicating SD card testing, initialization and identification of an SD memory card, namely an SD card, are completed; after the camera successfully identifies, uploading the result to an upper computer; exemplarily, the SD card is a TF card, the upper computer sends a CGI-TF command, and the camera receives the command and then self-detects the TF card; see FIG. 3F for a flow chart;
G. RTC function: sending a CGI (common gateway interface-real time clock) configuration instruction of a real-time clock (RTC) to the camera by the upper computer, wherein the camera configures RTC time after receiving the instruction; the upper computer sends a CGI instruction for acquiring RTC time, after the camera receives the instruction, the current RTC time is uploaded to the upper computer through the CGI instruction, and the upper computer checks and judges the front RTC time and the rear RTC time; see fig. 3G for a flow chart;
H. and (3) information proofreading: sending a CGI instruction, such as a CGI-STATUS instruction, for acquiring equipment information of the camera by the upper computer, and sending the equipment information of the camera to the upper computer after the camera receives the instruction; after receiving the equipment information, the upper computer queries a preset background database and checks the preset background database with the pre-stored equipment information; see FIG. 3H for a flow chart; illustratively, the device information includes a model, an identification, or other preset information of the device;
I. and (3) testing the resolution ratio: sending a CGI instruction for modifying resolution configuration to the camera by the upper computer, modifying the resolution after the camera receives the CGI instruction for modifying the resolution configuration, automatically judging whether the modification is successful by the camera, and returning a result to the upper computer through the CGI after the modification is successful; see FIG. 3I for a flow chart;
the testing of the functions from F to I of the network camera is automatically completed by the camera after the upper computer sends an instruction to the camera through the CGI, and the result is uploaded to the upper computer through the CGI after the testing is completed.
One implementation of an automated testing module of an upper computer is described below:
in one implementation, the automated testing module of the upper computer is software implemented based on a Qt architecture. Specifically, when various functions are realized, a database storing preset data or relations is called by using a QSqlDatabaser technology, QSettings are used for local data configuration, QSeriolprort is used for communication with a test tool suite, QTbleView and QStyledItemDelegate are used for item setting on a main interface UI, and callback functions are used for searching and/or inquiring the IPC; in the testing process, an event cycle mechanism of Qt is used, a QMa object mode is used, an invokeMethod mode is used, an asynchronous thread is started for automatic testing, and a testing result is displayed on a main interface; the instruction for IPC to send http uses Qt network communication, such as: QNetworkRequest, QNetworkAccess manager, QNetworkRely and the like. In other implementations, the automated test module may be implemented based on other architectures.
In the automated testing method and the testing system of an embodiment of the present invention, one specific implementation of the IPC camera is as follows: a network server (webserver) is built in the IPC and used for processing various CGI request instructions and URL requests when needed; after receiving a CGI instruction issued by an upper computer, the IPC calls corresponding database data from other processes in a socket mode or executes corresponding processing actions; preferably, the webserver server adopts a boa software framework as a single-task Web server, and can respond to the message instruction of the upper computer faster and more safely.
The test tool suite interacts with the upper computer through a USB protocol, wherein a data packet of the used USB protocol comprises: synchronization field, PID, byte 0, byte 1, byte N, CRC, and EOP; and during interaction, checking bytes 0 to N in the data domain, and checking the frame data according to the frame header information in the data domain. The communication with the upper computer is performed through such a data protocol. The test tool suite utilizes the sub-modules to perform various function tests of IPC through bus operations such as I2C and IO.
Example three:
the embodiment of the invention also provides an automatic testing system of the network camera, which comprises an upper computer and a testing tool suite, wherein the upper computer and the testing tool suite are used for realizing the automatic testing method.
Example four:
the embodiment of the invention also provides an automatic test system of the network camera, which is used for automatically testing the network camera and comprises an upper computer and a test tool kit, wherein,
the host computer includes automatic test module, and automatic test module includes: the first processing module is used for sending an instruction to the test tool suite and indicating the test tool suite to supply power to the network camera connected with the test tool suite; the second processing module is used for receiving camera system information sent by the network camera after being powered on through a network, wherein the system information comprises the product model of the network camera, and determining whether the network camera is consistent with the product model to be tested according to the received system information; if yes, testing the network camera through the testing tool kit according to the testing flow corresponding to the model of the product to be tested or testing the network camera by the network camera; the third processing module is used for receiving the test data sent by the test tool suite or the network camera, analyzing the test data sent by the test tool suite according to a preset test passing condition, judging whether a corresponding test item of the network camera passes or not, and displaying a test result;
the test tool kit is used for receiving the instruction sent by the automatic test module, performing corresponding operation on the network camera according to the instruction, wherein the corresponding operation comprises power supply and test, and sending test data to the automatic test module;
and in the testing process, the automatic testing module interacts with the network camera through a network.
Preferably, the test kit comprises an MCU and one or more of the following connected to the MCU:
the power testing module comprises a PSE chip, realizes power supply control on the network camera through the PSE chip, calculates a power value through voltage and current detection, and uploads the power value to the upper computer so as to judge whether the power of the network camera meets preset power conditions or not through the automatic testing module;
the alarm function testing module comprises an alarm input function testing module and an alarm output function testing module, wherein the alarm input function testing module is used for triggering alarm input to the network camera through the first MOS tube switching circuit so as to feed an alarm input state change result back to the upper computer after the network camera acquires the function state change of the alarm input interface; the alarm output function testing module is used for acquiring alarm output information of the network camera through the second MOS tube switching circuit, judging the acquired alarm output information, and determining that an alarm output interface of the network camera is normal if the state changes;
the DC functional module comprises a switching circuit formed by a triode and a PMOS circuit, is used for realizing DC12V power supply, tests power P by using a power monitoring IC, and then sends the tested power value to the automatic testing module;
the Smart IR lamp function testing module is used for recording the power value P0 of the Smart IR lamp through the MCU before testing and uploading the P0 to the upper computer; when the upper computer controls the network camera to only turn on the dipped headlight, the MCU records the power value P1 of the Smart IR lamp at the moment and uploads the P1 to the upper computer; when the upper computer controls the network camera to turn off the dipped headlight and only turn on the high beam, the MCU records the power value P2 of the Smart IR lamp at the moment and uploads the P2 to the upper computer;
and the RS485 function test module is used for receiving the specific character string sent by the RS485 function module of the network camera, analyzing the character string, and uploading the analyzed result of the RS485 to the upper computer after the MCU is correctly analyzed, wherein the specific character string sent by the RS485 function module of the network camera is sent by the automatic test module through a network.
Preferably, a network server is arranged on the network camera of the automatic test system applicable to the embodiment of the invention, and the upper computer and the network camera interact through a Common Gateway Interface (CGI) instruction; the test tool suite interacts with the upper computer through a USB protocol; the test tool suite is connected with the network camera through the input/output interface.
Preferably, in this embodiment, the upper computer is connected to a plurality of test tool kits through a plurality of USB interfaces, each test tool kit is used for testing one network camera, and the automatic test module of the upper computer simultaneously tests different network cameras through a plurality of test tool kits.
Example five:
the present invention further provides an automatic testing apparatus for a network camera, as shown in fig. 8, the apparatus includes a processor 801, a memory 802, a bus 803, and a computer program stored in the memory 802 and capable of running on the processor 801, the processor 801 includes one or more processing cores, the memory 802 is connected to the processor 801 through the bus 803, the memory 802 is used for storing program instructions, and when the processor executes the computer program, the processor implements steps executed by an upper computer in any automatic testing method according to an embodiment of the present invention or implements an automatic testing module in any automatic testing method according to an embodiment of the present invention.
Further, as an executable scheme, the automatic testing apparatus of the network camera may be a computer unit, and the computer unit may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The computer unit may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that the above-described constituent structures of the computer unit are merely examples of the computer unit, and do not constitute a limitation on the computer unit, and may include more or less components than those described above, or some of the components may be combined, or different components may be included. For example, the computer unit may further include an input/output device, a network access device, a bus, and the like, which is not limited in this embodiment of the present invention.
Further, as an executable solution, the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, and the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like which is the control center for the computer unit and which is connected to various parts of the overall computer unit by various interfaces and lines.
The memory may be used to store the computer programs and/or modules, and the processor may implement the various functions of the computer unit by running or executing the computer programs and/or modules stored in the memory, as well as invoking data stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the mobile phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Example six:
the invention further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program realizes the steps executed by the upper computer in any one of the above methods according to the embodiments of the invention.
The computer unit integrated module/unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is appropriately increased or decreased as required by legislation and patent practice in the jurisdiction.
While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (15)
1. An automatic testing method for a network camera is characterized by comprising the following steps:
s1, an upper computer sends an instruction to a test tool suite to instruct the test tool suite to supply power to a network camera connected with the test tool suite;
s2, the upper computer receives camera system information sent by the electrified network camera through a network, wherein the system information comprises the product model of the upper computer, and the upper computer determines whether the network camera is consistent with the product model to be tested according to the received system information; if yes, testing the network camera through the test tool suite according to a test flow corresponding to the model of the product to be tested or testing the network camera by the network camera;
s3, the upper computer receives the test data sent by the test tool suite or the network camera, analyzes the test data sent by the test tool suite according to preset test passing conditions, judges whether the corresponding test items of the network camera pass or not, and displays a test result;
and in the test process, the upper computer interacts with the network camera through a network.
2. The automated testing method according to claim 1, wherein a web server is arranged on the network camera, and an upper computer interacts with the network camera through a Common Gateway Interface (CGI) instruction; the testing tool suite interacts with the upper computer through a USB protocol; the test tool suite is connected with the network camera through an input/output interface.
3. The automated testing method of claim 2, wherein the upper computer is connected to a plurality of testing tool kits through a plurality of USB interfaces, each testing tool kit is used for testing one network camera, and the upper computer simultaneously tests different network cameras through the plurality of testing tool kits.
4. The automated testing method of claim 1, further comprising, prior to step S1:
the upper computer receives an input order number to be tested, determines the product model of the network camera to be tested and a test flow corresponding to the determined product model according to the order number, and the test flow comprises the following steps: test items and the execution order of the test items.
5. The automated testing method of claim 4, further comprising: and the upper computer selects a test flow corresponding to the determined product model from the corresponding relationship between the pre-stored product model and the test flow according to the determined product model of the network camera to be tested.
6. The automated testing method of claim 2, wherein when the test item is a test of a plurality of external interfaces of the network camera, the test is performed by the testing tool kit, wherein the performing the test comprises one or more of the following:
the power test is carried out, the test tool kit realizes power supply control on the network camera through a PSE chip, then calculates a power value through voltage and current detection, and uploads the power value to an upper computer so as to judge whether the power of the network camera meets preset power conditions or not by the upper computer;
alarm function tests, including alarm input function test and alarm output function test, wherein alarm input function test includes: the testing tool kit triggers alarm input to the network camera through a first MOS tube switching circuit, and after the network camera obtains the change of the function state of the alarm input interface, the change result of the alarm input state is fed back to the upper computer; the alarm output function test comprises the following steps: the test tool suite acquires the alarm output information of the network camera through a second MOS tube switching circuit, judges the acquired alarm output information, and determines that an alarm output interface of the network camera is normal if the state changes;
DC function: the testing tool kit realizes DC12V power supply through a switching circuit formed by a triode and a PMOS circuit, tests out power P by using a power monitoring IC, then sends the tested power value to the automatic testing module of the upper computer, and determines that the DC functional item of the network camera passes the test when the power P is larger than a preset threshold value;
smart IR Lamp functional test: before testing, the testing tool kit records a power value P0 of a Smart IR lamp through an MCU arranged on the testing tool kit, and uploads the P0 to an upper computer; then, the upper computer controls the network camera to only turn on the dipped headlight, the MCU records the power value P1 of the Smart IR lamp at the moment, and the power value P1 is uploaded to the upper computer; the upper computer controls the network camera to turn off the dipped headlight and only turn on the high beam, the MCU records the power value P2 of the Smart IR lamp at the moment and uploads the P2 to the upper computer; the upper computer judges whether the value of (P1-P0) is larger than a preset low beam light power threshold value or not and whether the value of (P2-P0) is larger than a preset high beam light power threshold value or not according to the received P0, P1 and P2, and if the two judgment results are yes, the function of the Smart IR lamp is determined to be normal;
and (3) testing an RS485 functional module: the RS485 function module of the network camera receives a specific character string sent by the upper computer through a network, sends the received specific character string to the MCU of the test tool kit to be analyzed by the MCU, and uploads an RS485 result to the upper computer after the MCU is analyzed correctly.
7. The automated testing method according to claim 2, wherein when the test item is to test the internal performance of the network camera, the network camera performs the test by itself, wherein the self-performing the test comprises one or more of the following:
SD card function test: the upper computer sends a Common Gateway Interface (CGI) instruction for SD card function test to the network camera through a network, the network camera completes the initialization and identification of the SD card after receiving the CGI instruction for SD card function test, and uploads the result to the upper computer through the network after the identification is successful;
testing real-time clock RTC function: the method comprises the steps that an upper computer sends an RTC configuration CGI instruction to the network camera, the network camera responds to an RTC time acquisition instruction sent by the upper computer through a network after RTC configuration is carried out according to the RTC configuration CGI instruction, and the current RTC time is uploaded to the upper computer so that the upper computer can check and judge the front RTC time and the rear RTC time;
and (3) information proofreading: the upper computer sends an information proofreading CGI instruction to the network camera, the network camera responds to the information proofreading CGI instruction to send equipment information to the upper computer, and the upper computer receives the equipment information sent by the network camera and checks the information by inquiring a preset equipment information database;
and (3) testing the resolution ratio: and the network camera modifies the resolution according to the CGI instruction for modifying the resolution configuration, judges whether the modification is successful or not, and uploads the result to the upper computer after judging that the modification is successful.
8. The automated testing method of any one of claims 1 to 7, wherein the step of interacting with the test tool kit and the network camera is performed by an automated testing module provided on an upper computer, the automated testing module is implemented based on a Qt architecture, calls a database using QSqlDatabaser technology, performs local data configuration using QSettings, communicates with the test tool kit using QSerioalport, performs project setting on an interface using QTableView and QStyledtemDelegate, searches and/or queries the network camera using callback functions, and starts automated testing of asynchronous threads using an event loop mechanism of Qt during testing.
9. An automated testing system of a network camera, characterized by comprising an upper computer and a testing tool kit for implementing the automated testing method according to any one of claims 1 to 8.
10. An automatic test system of a network camera is used for automatically testing the network camera and is characterized in that the automatic test system comprises an upper computer and a test tool kit, wherein,
the host computer includes automatic test module, automatic test module includes:
the first processing module is used for sending an instruction to a test tool suite and instructing the test tool suite to supply power to a network camera connected with the test tool suite;
the second processing module is used for receiving camera system information sent by the network camera after being powered on through a network, wherein the system information comprises the product model of the network camera, and determining whether the network camera is consistent with the product model to be tested according to the received system information; if yes, testing the network camera through the test tool suite according to a test flow corresponding to the model of the product to be tested or testing the network camera by the network camera;
the third processing module is used for receiving the test data sent by the test tool suite or the network camera, analyzing the test data sent by the test tool suite according to a preset test passing condition, judging whether a corresponding test item of the network camera passes or not, and displaying a test result;
the test tool kit is used for receiving the instruction sent by the automatic test module, performing corresponding operation on the network camera according to the instruction, wherein the corresponding operation comprises power supply and test, and sending test data to the automatic test module;
and in the testing process, the automatic testing module interacts with the network camera through a network.
11. The automated testing system of claim 10, wherein a web server is disposed on the webcam, and the upper computer interacts with the webcam through a Common Gateway Interface (CGI) instruction; the testing tool suite interacts with the upper computer through a USB protocol; the test tool suite is connected with the network camera through an input/output interface.
12. The automated testing system of claim 11, wherein the upper computer is connected to a plurality of test tool kits through a plurality of USB interfaces, each test tool kit is used for testing one webcam, and the automated testing module of the upper computer simultaneously tests different webcams through the plurality of test tool kits.
13. The automated test system of claim 11, wherein the test kit comprises an MCU and one or more of the following connected to the MCU:
the power testing module comprises a PSE chip, the power supply control of the network camera is realized through the PSE chip, then a power value is calculated through voltage and current detection, the power value is uploaded to an upper computer, and the automatic testing module judges whether the power of the network camera meets a preset power condition;
the alarm function testing module comprises an alarm input function testing module and an alarm output function testing module, wherein the alarm input function testing module is used for triggering alarm input to the network camera through a first triode switching circuit so as to feed an alarm input state change result back to the upper computer after the network camera acquires the function state change of the alarm input interface; the alarm output function testing module is used for acquiring alarm output information of the network camera through a second triode switch circuit, judging the acquired alarm output information, and determining that an alarm output interface of the network camera is normal if the state changes;
the DC functional module comprises a switching circuit formed by a triode and a PMOS circuit, is used for realizing DC12V power supply, tests power P by using a power monitoring IC, and then sends the tested power value to the automatic testing module;
the Smart IR lamp function testing module is used for recording the power value P0 of the Smart IR lamp through the MCU and uploading the P0 to the upper computer before testing; when the upper computer controls the network camera to only turn on the dipped headlight, the MCU records the power value P1 of the Smart IR lamp at the moment and uploads the P1 to the upper computer; when the upper computer controls the network camera to turn off the dipped headlight and only turn on the high beam, the MCU records the power value P2 of the Smart IR lamp at the moment and uploads the P2 to the upper computer;
and the RS485 function test module is used for receiving the specific character string sent by the RS485 function module of the network camera, analyzing the character string, and uploading the analyzed result of the RS485 to an upper computer after the MCU is analyzed correctly, wherein the specific character string sent by the RS485 function module of the network camera is sent by the automatic test module through a network.
14. An automated testing device for a network camera, comprising a memory and a processor, wherein the memory stores at least one program, and the at least one program is executed by the first processor to implement the steps executed by the upper computer in the method according to any one of claims 1 to 8.
15. A computer-readable storage medium, having stored thereon at least one program for execution by a processor to perform the steps of the method of any one of claims 1 to 8 performed by an upper computer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211395321.7A CN115767079A (en) | 2022-11-09 | 2022-11-09 | Automatic testing method, system, device and storage medium for network camera |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211395321.7A CN115767079A (en) | 2022-11-09 | 2022-11-09 | Automatic testing method, system, device and storage medium for network camera |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115767079A true CN115767079A (en) | 2023-03-07 |
Family
ID=85368375
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211395321.7A Pending CN115767079A (en) | 2022-11-09 | 2022-11-09 | Automatic testing method, system, device and storage medium for network camera |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115767079A (en) |
-
2022
- 2022-11-09 CN CN202211395321.7A patent/CN115767079A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108307021B (en) | Parallel following test equipment, cloud real machine and method for mobile terminal | |
CN107656856B (en) | CPLD-based system state display method and device | |
US11080844B2 (en) | System and method for testing an electronic device | |
CN110708214B (en) | Service data display method, device, equipment and computer readable storage medium | |
CN112737886A (en) | Tool testing method and system | |
CN114578790B (en) | Unmanned aerial vehicle flight control automatic test method, system, equipment and medium | |
CN112730406A (en) | Product testing method, system and readable storage medium | |
CN112286825A (en) | Screen testing method and device for intelligent cabin and electronic equipment | |
CN112799693B (en) | Burning method of collector and controller, upper computer and storage medium | |
CN115767079A (en) | Automatic testing method, system, device and storage medium for network camera | |
CN106598793B (en) | Test system and test method based on BIOS serial port log data | |
CN111610427A (en) | Finished product testing method, circuit board testing method and device | |
US20200059798A1 (en) | Configuration method of wireless network system, configuration terminal and configuration system | |
CN216209508U (en) | Detection equipment and detection system | |
CN112441255B (en) | Automatic testing device and method for flight parameter quick-taking recording system | |
CN112783708A (en) | DTU hardware testing method, terminal and computer readable storage medium | |
CN116047259A (en) | Detection system and detection method | |
CN114264904A (en) | Full liquid crystal instrument testing method and system based on simulation and machine vision | |
CN113408475A (en) | Indication signal recognition method, indication signal recognition apparatus, and computer storage medium | |
CN103824143A (en) | Component assembly indicating system and method | |
CN106372687A (en) | Distribution network automatic detection method and system | |
CN115935876B (en) | FPGA circuit simulation method and device | |
CN109947621A (en) | A kind of method and device of server test | |
CN108226812A (en) | Self-action power detecting system | |
CN116881174B (en) | ECU application software closed-loop test method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |