CN114584498A - Method, device, equipment, system and product for testing power on and power off of gateway equipment - Google Patents

Method, device, equipment, system and product for testing power on and power off of gateway equipment Download PDF

Info

Publication number
CN114584498A
CN114584498A CN202011387328.5A CN202011387328A CN114584498A CN 114584498 A CN114584498 A CN 114584498A CN 202011387328 A CN202011387328 A CN 202011387328A CN 114584498 A CN114584498 A CN 114584498A
Authority
CN
China
Prior art keywords
power
target gateway
test
gateway equipment
determining
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.)
Granted
Application number
CN202011387328.5A
Other languages
Chinese (zh)
Other versions
CN114584498B (en
Inventor
武宁宁
崔志兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu TD Tech Ltd
Original Assignee
Chengdu TD Tech Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chengdu TD Tech Ltd filed Critical Chengdu TD Tech Ltd
Priority to CN202011387328.5A priority Critical patent/CN114584498B/en
Publication of CN114584498A publication Critical patent/CN114584498A/en
Application granted granted Critical
Publication of CN114584498B publication Critical patent/CN114584498B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention provides a method, a device, equipment, a system and a product for testing power on and power off of gateway equipment, wherein the method comprises the following steps: acquiring test parameters for powering on and powering off the target gateway equipment; performing power-on and power-off tests on the target gateway equipment for preset test times according to the test parameters, determining the network state of the target gateway equipment after the target gateway equipment is powered on aiming at each power-on and power-off test, controlling the target gateway equipment to run a preset service, controlling the target gateway equipment to be powered off in the running process of the preset service, and determining the power-on and power-off test result of each time according to the network state and the preset service processing result; and determining the test result of the target gateway equipment according to the power-on and power-off test result of each time. The power-on and power-off test of each time can be the same as the power-on and power-off scenes in the actual use of the gateway equipment, all scenes of the actual use condition of the target gateway equipment are covered, the power-on and power-off of the target gateway equipment are comprehensively tested, and the accuracy of the power-on and power-off test of the gateway equipment is greatly improved.

Description

Method, device, equipment, system and product for testing power on and power off of gateway equipment
Technical Field
The embodiment of the invention relates to the technical field of equipment testing, in particular to a method, a device, equipment, a system and a product for testing power on and power off of gateway equipment.
Background
With the development of the internet of things, intelligent gateway equipment has become indispensable equipment. Before the intelligent gateway equipment leaves a factory, a series of function tests are carried out to verify whether the intelligent gateway equipment has problems in the normal use process, so that the quality and the safety of the intelligent gateway equipment are ensured.
When the intelligent gateway equipment is tested, the up-down electric test of the intelligent gateway equipment becomes an indispensable test for verifying whether the intelligent gateway equipment has problems in the normal use process. In the prior art, generally, after power-on and power-off test times are configured in advance, power-on and power-off operations of the test times are directly performed on intelligent gateway equipment, after the last power-on and power-off operation, whether each function of the intelligent gateway equipment is normal or not is judged, and if the function is normal, it is determined that the intelligent gateway equipment passes the power-on and power-off test.
However, the method for testing the upper and lower electric circuits of the intelligent gateway device in the prior art cannot cover all scenes of actual use conditions of the intelligent gateway device, so that the upper and lower electric tests of the intelligent gateway device are not comprehensive, and finally the upper and lower electric tests of the intelligent gateway device are not accurate enough.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment, a system and a product for testing the up and down electricity of gateway equipment, which solve the problems that the up and down electricity testing method of the gateway equipment in the prior art can not cover all scenes of the actual use condition of intelligent gateway equipment, so that the up and down electricity testing of the intelligent gateway equipment is not comprehensive, and finally the up and down electricity testing of the intelligent gateway equipment is not accurate enough.
In a first aspect, an embodiment of the present invention provides a method for testing power on and power off of a gateway device, including:
acquiring test parameters for powering on and powering off the target gateway equipment;
performing power-on and power-off tests on the target gateway equipment for preset test times according to the test parameters, determining the network state of the target gateway equipment after the target gateway equipment is powered on aiming at each power-on and power-off test, controlling the target gateway equipment to run a preset service, controlling the target gateway equipment to be powered off in the running process of the preset service, and determining the power-on and power-off test result of each time according to the network state and the processing result of the preset service;
and determining the test result of the target gateway equipment according to the power-on and power-off test result of each time.
Further, the method for determining the network state of the target gateway device after the target gateway device is powered on includes:
after the target gateway equipment is powered on, periodically sending a network test command to the target gateway equipment so that the target gateway equipment determines the network state according to the network test command;
if a network test response sent by target gateway equipment is received, determining that the network state of the target gateway equipment is normal;
and if the network test response sent by the target gateway equipment is not received in the preset time period, determining that the network state of the target gateway equipment is abnormal.
Further, the method for controlling the target gateway device to run the preset service and to control power down in the running process of the preset service includes:
and controlling an operating system Shell of the target gateway equipment to read preset data, erasing the preset data into the embedded storage solution eMMC, and controlling power off in the process of erasing the preset data into the embedded storage solution eMMC.
Further, in the method as described above, the preset data is a file greater than a preset capacity threshold.
Further, the method for determining the power-on and power-off test result of each time according to the network state and the preset service processing result includes:
if the network state is normal and the preset service is successfully processed in the power-on and power-off test of a certain time, determining that the power-on and power-off test of the time passes;
and if the network state is abnormal and/or the preset service processing fails in the previous and next electrical test, determining that the previous and next electrical test fails.
Further, the method as described above, the determining a test result of the target gateway device according to each power-on and power-off test result includes:
if the power-on and power-off tests pass each time, determining that the target gateway equipment passes the test;
and if the upper and lower electric tests fail once in each upper and lower electric test, determining that the target gateway equipment fails in the test.
In a second aspect, an embodiment of the present invention provides a gateway device power on/off test apparatus, including:
the acquisition module is used for acquiring test parameters for powering on and powering off the target gateway equipment;
the testing module is used for carrying out power-on and power-off testing on the target gateway equipment for preset testing times according to the testing parameters, determining the network state of the target gateway equipment after the target gateway equipment is powered on aiming at each power-on and power-off testing, controlling the target gateway equipment to run a preset service, controlling the target gateway equipment to be powered off in the running process of the preset service, and determining the power-on and power-off testing result of each time according to the network state and the processing result of the preset service;
and the determining module is used for determining the test result of the target gateway equipment according to the test result of each power-on and power-off test.
Further, the apparatus and the test module described above, when determining the network state of the target gateway device after the target gateway device is powered on, are specifically configured to:
after the target gateway equipment is powered on, periodically sending a network test command to the target gateway equipment so that the target gateway equipment determines the network state according to the network test command; if a network test response sent by the target gateway equipment is received, determining that the network state of the target gateway equipment is normal; and if the network test response sent by the target gateway equipment is not received in the preset time period, determining that the network state of the target gateway equipment is abnormal.
Further, the apparatus and the test module described above are specifically configured to, when controlling the target gateway device to operate the preset service and controlling the power down in the preset service operation process:
and controlling an operating system Shell of the target gateway equipment to read preset data, erasing the preset data into the embedded storage solution eMMC, and controlling power down in the process of erasing the preset data into the embedded storage solution eMMC.
Further, in the apparatus as described above, the preset data is a file greater than a preset capacity threshold.
Further, the apparatus and the test module as described above are specifically configured to, when determining the power-on and power-off test result each time according to the network status and the preset service processing result:
if the network state is normal and the preset service processing is successful in the power-on and power-off test of a certain time, determining that the power-on and power-off test of the time passes; and if the network state is abnormal and/or the preset service processing fails in the previous and next electrical tests, determining that the previous and next electrical tests fail.
Further, the apparatus as described above, the determining module is specifically configured to:
if the power-on and power-off tests pass each time, determining that the target gateway equipment passes the test; and if the upper and lower electric tests fail once in each upper and lower electric test, determining that the target gateway equipment fails in the test.
Further, the apparatus as described above, the obtaining module is specifically configured to:
displaying a preset operation interface; and receiving the power-on and power-off test parameters configured by the user through a preset operation interface.
Further, the apparatus as described above, the test module, is further configured to: and the control process power supply powers on the target gateway equipment.
Correspondingly, the test module is specifically configured to, when controlling to power down in the preset service operation process:
and controlling the program-controlled power supply to power off the target gateway equipment in the running process of the preset service.
In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor, a memory;
the memory stores computer-executable instructions;
execution of the computer-executable instructions stored by the memory by the at least one processor causes the at least one processor to perform the method of any one of the first aspects.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the method according to any one of the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program that, when executed by a processor, implements the method of any one of the first aspect.
In a sixth aspect, an embodiment of the present invention provides a system for testing power on and power off of gateway equipment, including: a programmable power supply, a target gateway device and an electronic device as described in the third aspect;
and the electronic equipment is connected with the target gateway equipment through the programmable power supply.
Further, the system as described above, further comprising: a router;
and the electronic equipment is in communication connection with the target gateway equipment through the router.
The embodiment of the invention provides a method, a device, equipment, a system and a product for testing power-on and power-off of gateway equipment, wherein the method comprises the steps of obtaining test parameters for power-on and power-off of target gateway equipment; performing power-on and power-off tests on the target gateway equipment for preset test times according to the test parameters, determining the network state of the target gateway equipment after the target gateway equipment is powered on aiming at each power-on and power-off test, controlling the target gateway equipment to run a preset service, controlling the target gateway equipment to be powered off in the running process of the preset service, and determining the power-on and power-off test result of each time according to the network state and the preset service processing result; and determining the test result of the target gateway equipment according to the power-on and power-off test result of each time. The target gateway equipment is tested in software and hardware every time the target gateway equipment is tested in power-on and power-off. In terms of software, the network status of the target gateway device is tested. In the aspect of hardware, whether the gateway equipment is influenced after instant power failure when the gateway equipment runs a preset service is tested. And then can make every electric test all the same with the gateway equipment in-service electric scene from top to bottom, cover all scenes of intelligent gateway equipment in-service use condition, go on the comprehensive test to the target gateway equipment electricity from top to bottom, improve the accuracy of the electric test from top to bottom of gateway equipment greatly.
It should be understood that what is described in the summary above is not intended to limit key or critical features of embodiments of the invention, nor is it intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is an architecture diagram of a power-on and power-off test system of a gateway device according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for testing power on and power off of a gateway device according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for power-on and power-off testing of a gateway device according to another embodiment of the present invention;
fig. 4 is a schematic diagram of a preset operation interface in the power-on and power-off testing method for the gateway device according to the embodiment of the present invention;
fig. 5 is a schematic structural diagram of a power-on and power-off testing apparatus of a gateway device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and the embodiments of the present invention are illustrative only and are not intended to limit the scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, and in the above-described drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For a clear understanding of the technical solutions of the present application, a detailed description of the prior art solutions is first provided.
In the prior art, when the intelligent gateway device is subjected to power-on and power-off tests, generally, the power-on and power-off tests are performed on the intelligent gateway device after the power-on and power-off tests are configured in advance, the power-on and power-off operations are performed on the intelligent gateway device for the times of tests, after the last power-on and power-off operation, whether each function of the intelligent gateway device is normal or not is judged, and if the function is normal, the intelligent gateway device is determined to pass the power-on and power-off tests. And after each power-on and power-off operation, the real-time state of the intelligent gateway equipment cannot be detected. And more complicated situations can be faced when the intelligent gateway device is actually used. For example, in use, it is found that all modules of the gateway device are not necessarily completely started after being powered on and started up, especially the most important network gateway function. And when the special service is operated after being powered on, the power is instantly lost, which may cause the abnormal state of the gateway equipment after the next or future startup. These exceptions may be gateway device software problems or hardware problems. Therefore, the up-down electric test method of the intelligent gateway device in the prior art cannot cover all scenes of actual use conditions of the intelligent gateway device, so that the up-down electric test of the intelligent gateway device is not comprehensive, and finally the up-down electric test of the intelligent gateway device is not accurate enough.
However, aiming at the problems in the prior art, the inventor creatively finds that, in order to fully cover all scenes of the gateway device in the actual use process, the tests in the software aspect and the hardware aspect are required to be tested when the gateway device is subjected to the power-on and power-off tests every time. In terms of software, all modules are ensured to be completely started after the gateway equipment is powered on and started, and the function of the network gateway is ensured. In the aspect of hardware, whether the gateway equipment is influenced after instant power failure when the gateway equipment runs a special service is tested. And then can make every electric test all the same with the upper and lower electric scene of gateway equipment in-service use, cover all scenes of intelligent gateway equipment in-service use condition, go on the comprehensive test to intelligent gateway equipment upper and lower electricity, improve the accuracy of intelligent gateway equipment's upper and lower electric test greatly.
Therefore, the inventor proposes a technical scheme of the embodiment of the invention based on the above creative discovery. The network architecture corresponding to the method for testing power on and power off of the gateway device provided by the embodiment of the invention is introduced below.
Fig. 1 is an architecture diagram of a gateway device power on/off test system according to an embodiment of the present invention, and as shown in fig. 1, the gateway device power on/off test system according to the embodiment includes: the system comprises an electronic device 1, a programmable power supply 2, a router 3 and a target gateway device 4. The electronic device 1 is connected with the target gateway device 4 through the programmable power supply 2. Alternatively, the electronic device 1 and the programmable power supply 2 may be connected by a GPIB. The electronic device 1 is communicatively connected to a target gateway device 4 via a router 3. The electronic device 1 is loaded with a gateway device power-on and power-off testing device, and can provide a preset operation interface for a user. The electronic device 1 may receive the power-on and power-off test parameters configured by the user through the preset operation interface. And the electronic equipment 1 performs the power-on and power-off test of the preset test times on the target gateway equipment according to the test parameters. In each power-on and power-off test, firstly, the electronic device 1 controls the programmable power supply 2 to power on the target gateway device 3, determines the network state of the target gateway device 4 after the target gateway device 4 is powered on, controls the target gateway device 4 to operate a preset service, controls the programmable power supply to power off the target gateway device 4 in the operation process of the preset service, determines the power-on and power-off test result of each time according to the network state and the preset service processing result, and finally determines the test result of the target gateway device 4 according to the power-on and power-off test result of each time.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Example one
Fig. 2 is a flowchart of a method for testing power on and power off of a gateway device according to an embodiment of the present invention, and as shown in fig. 2, an execution main body of the embodiment is a gateway device power on and power off testing apparatus, which may be integrated in an electronic device, where the electronic device may be a computer, a server, or other devices with independent computing and processing capabilities. The method for testing the power on and power off of the gateway device provided by this embodiment includes the following steps.
Step 101, obtaining test parameters for powering on and powering off the target gateway device.
The target gateway device is a gateway device to be tested, such as an intelligent camera, a vehicle-mounted station or other gateway devices.
In this embodiment, the power-on and power-off test parameters of the target gateway device may be stored in the local preset area in advance, and the power-on and power-off test parameters of the target gateway device may be obtained from the preset area.
Or in this embodiment, the gateway device power-on and power-off testing apparatus may provide a preset operation interface for the electronic device, and obtain the testing parameters for the target gateway device to power on and power off through the preset operation interface.
In this embodiment, the test parameters may include: and presetting the test times, the IP address and the test port number of the target gateway equipment. And the address and channel identification corresponding to the GPIB of the programmed power supply can be further included.
102, performing power-on and power-off tests on the target gateway equipment for preset test times according to the test parameters, determining the network state of the target gateway equipment after the target gateway equipment is powered on aiming at each power-on and power-off test, controlling the target gateway equipment to run a preset service, controlling the target gateway equipment to be powered off in the running process of the preset service, and determining the power-on and power-off test result of each time according to the network state and the preset service processing result.
In this embodiment, the target gateway device is determined according to the IP address and the test port number of the target gateway device in the test parameters, and the target gateway device is subjected to power-on and power-off tests according to the preset test times in the test parameters.
When the target gateway is subjected to power-on and power-off tests every time, the electronic equipment is connected with the program-controlled power supply according to the address and the channel identification corresponding to the GPIB of the program-controlled power supply, and the program-controlled power supply is controlled to power on the target gateway equipment, so that the target gateway equipment is started. After the target gateway equipment is started, testing the network state of the target gateway equipment to determine whether the network gateway function can be realized after the target gateway equipment is started. And then controlling the target gateway equipment to run a preset service, wherein the preset service is executed by the hardware of the target gateway equipment, and controlling the programmable power supply to perform power-down operation on the target gateway equipment in the process of running the preset service. And finally, determining the result of each power-on and power-off test according to the network state of each power-on and power-off test and the preset service processing result.
And 103, determining the test result of the target gateway equipment according to the power-on and power-off test result of each time.
In this embodiment, each power-on and power-off test result can indicate the actual power-on and power-off situation of the target gateway device in the actual use process, so that the test result of the target gateway device is determined according to each power-on and power-off test result. If a preset threshold value can be set, comparing the times of passing the test of the up and down electric test results with the preset threshold value, and if the times of passing the test of the up and down electric test results are greater than the preset threshold value, determining that the target gateway device passes the test. Otherwise, determining that the target gateway device fails the test.
Or in order to ensure that the target gateway device does not have an abnormal problem in the actual use process, when the test result of the target gateway device is determined according to the power-on and power-off test result of each time, if the power-on and power-off test result of one time fails, the test result of the target gateway device is determined to be failed. Otherwise, if all the upper and lower electrical test results pass, determining that the test result of the target gateway device passes.
In the method for testing power on and power off of the gateway device provided by this embodiment, a test parameter for performing power on and power off on a target gateway device is obtained; performing power-on and power-off tests on the target gateway equipment for preset test times according to the test parameters, determining the network state of the target gateway equipment after the target gateway equipment is powered on aiming at each power-on and power-off test, controlling the target gateway equipment to run a preset service, controlling the target gateway equipment to be powered off in the running process of the preset service, and determining the power-on and power-off test result of each time according to the network state and the preset service processing result; and determining the test result of the target gateway equipment according to the power-on and power-off test result of each time. The gateway equipment is tested in software and hardware every time the gateway equipment is tested in power-on and power-off. In terms of software, the network status of the target gateway device is tested. In the aspect of hardware, whether the gateway equipment is influenced after instant power failure when the gateway equipment runs a preset service is tested. Therefore, the power-on and power-off scenes in each time of power-on and power-off test are the same as those of the power-on and power-off scenes in the actual use of the gateway equipment, all scenes of the actual use condition of the target gateway equipment are covered, the power-on and power-off of the target gateway equipment are comprehensively tested, and the accuracy of the power-on and power-off test of the gateway equipment is greatly improved.
Example two
Fig. 3 is a flowchart of a method for testing power on and power off of a gateway device according to another embodiment of the present invention, and as shown in fig. 3, the method for testing power on and power off of a gateway device according to this embodiment is further detailed in steps 101 to 103 on the basis of the method for testing power on and power off of a gateway device according to the first embodiment of the present invention, and then the method for testing power on and power off of a gateway device according to this embodiment includes the following steps.
Step 201, displaying a preset operation interface, and receiving a power-on and power-off test parameter configured by a user through the preset operation interface.
In this embodiment, when the electronic device is used to perform the power-on and power-off test on the target gateway device, firstly, a preset operation interface may be displayed on the display, as shown in fig. 4, in the operation interface, the test parameters configurable by the user may include: the IP address and test port number of the target gateway device, as in fig. 4, the IP address is: 192.168.0.31. the test port number is 23. The test parameters may further include: and (4) logging in a user name and a password of the target gateway operating system Shell. As in fig. 4, the user name is: root. The test parameters may also include addresses and channel identifications corresponding to GPIBs of the programmable power supplies. As in fig. 4, GPIB corresponds to an address: GPIBO, 5, INSTR. The channel identification is: 1. and after the user clicks the start chart, receiving the power-on and power-off test parameters configured by the user, and carrying out power-on and power-off test on the target gateway equipment for preset test times according to the test parameters.
Step 202, performing power-on and power-off tests on the target gateway device for preset test times according to the test parameters, controlling the programmable power supply to power on the target gateway device for each power-on and power-off test, determining the network state of the target gateway device after the target gateway device is powered on, controlling the target gateway device to operate a preset service, controlling the programmable power supply to power off the target gateway device in the operation process of the preset service, and determining the power-on and power-off test result for each time according to the network state and the preset service processing result.
In this embodiment, for each power-on and power-off test, a connection is first established with the program-controlled power supply through an address and a channel identifier corresponding to the GPIB of the program-controlled power supply, and the program-controlled power supply is controlled to power on the target gateway device. Wherein, the power supply time delay of the programmable power supply is less than 100ms, and the precision is less than 0.1V.
Optionally, in this embodiment, in step 202, when the network state of the target gateway device is determined after the target gateway device is powered on, specifically, steps 2021 to 2023 are included.
Step 2021, after the target gateway device is powered on, periodically sending a network test command to the target gateway device, so that the target gateway device determines the network state according to the network test command.
Specifically, in this embodiment, a network test command is periodically sent to the target gateway device, where the network test command is a Ping command, so as to determine a network state of the target gateway device, that is, whether the target gateway device is Ping-enabled. And after the target gateway equipment receives the network test command, detecting the network state of the target gateway equipment.
In this embodiment, the transmission cycle is not limited.
Step 2022, if the network test response sent by the target gateway device is received, it is determined that the network state of the target gateway device is normal.
Step 2023, if the network test response sent by the target gateway device is not received in the preset time period, it is determined that the network state of the target gateway device is abnormal.
In this embodiment, if the target gateway device detects that the network state of the target gateway device is normal, a network test response is sent to the electronic device, and if the electronic device receives the network test response, it is determined that the network state of the target gateway device is normal. If the target gateway device does not send a network test response to the electronic device all the time after the electronic device periodically sends a network test command to the target gateway device, the network state of the target gateway device is abnormal, and if the target gateway device is in a state that Ping is not conducted all the time, the electronic device determines that the network state of the target gateway device is abnormal.
The specific value of the preset time period is not limited, and may be configured in advance.
Optionally, in this embodiment, in step 202, the target gateway device is controlled to run a preset service, and power down is controlled in the running process of the preset service, which includes the following scheme.
And controlling an operating system Shell of the target gateway equipment to read preset data, erasing the preset data into the embedded storage solution eMMC, and controlling power down in the process of erasing the preset data into the embedded storage solution eMMC.
The preset data is files with the volume larger than a preset volume threshold value. For example, the preset capacity threshold may be 3G.
In this embodiment, after the network function test of the target gateway device is completed, the hardware function of the target gateway device is tested, and because the hardware of each target gateway device generally executes a service during the erasing and writing of the eMMC, the flash power failure is performed during the erasing and writing of the eMMC, so as to test the hardware function of the target gateway device.
Specifically, the operating system Shell of the target gateway device is firstly logged in through a preconfigured user name and password. And controlling the Shell to read a preset file larger than a preset capacity threshold from an SD card or an external storage device of the target gateway device, and erasing the preset file larger than the preset capacity threshold into the eMMC after the preset file larger than the preset capacity threshold is read. Because the preset file larger than the preset capacity threshold value is larger, the process of erasing the eMMC has a certain time, the control process power supply carries out power-down operation on the target gateway equipment at a certain moment in the erasing process of the eMMC, and whether the erased data are reserved in the eMMC after power-down is judged so as to test the hardware function of the target gateway equipment.
In this embodiment, when the target gateway device is controlled to run the preset service and power off is performed in the running process of the preset service, the operating system Shell of the target gateway device is controlled to read the preset data, erase the preset data into the embedded storage solution eMMC, and control power off in the process of erasing the preset data into the embedded storage solution eMMC, where the preset data is a file with a capacity greater than a preset capacity threshold. The process of eMMC erasing and writing data can be longer, and then the power-down operation of the target gateway equipment can be accurately completed in the process of eMMC erasing and writing data.
Optionally, in this embodiment, in step 202, when determining the result of each power-on and power-off test according to the network state and the preset service processing result, steps 2024 to 2025 are specifically included.
Step 2024, if it is determined that the network state is normal and the predetermined service processing is successful in the previous and next power tests, it is determined that the previous and next power tests pass.
Step 2025, if it is determined that the network status is abnormal and/or the predetermined service processing fails in the previous and next power-on tests, it is determined that the previous and next power-on tests fail.
In this embodiment, as shown in fig. 4, when the power-on and power-off test is performed each time, log data of the target gateway device is obtained, and the log data generated at each time point when the power-on and power-off test is performed each time can be displayed on the operation interface for the user to view.
The log data may include data such as whether the network status is normal or not, whether the eMMC is successfully erased or not, and the like.
Specifically, in this embodiment, if it is determined that the network state is normal and the preset service processing is successful in the previous and next power-on tests, it indicates that the network function and the hardware function of the target gateway device are normal in the previous and next power-on tests, and it is determined that the previous and next power-on tests pass. Otherwise, if it is determined that the network state is abnormal and/or the preset service processing fails in the power-on and power-off test of a certain time, it indicates that the network function and/or the hardware function of the target gateway device are abnormal in the power-on and power-off test of the time, and it is determined that the power-on and power-off test of the time fails.
And 203, if the power-on and power-off tests pass each time, determining that the target gateway equipment passes the test.
And 204, if the upper and lower electric tests fail once in each upper and lower electric test, determining that the target gateway device fails in the test.
In this embodiment, in order to ensure that the target gateway device does not have an abnormal problem in the actual use process, after the power-on and power-off test result of each time is obtained, whether the power-on and power-off test of each time is passed or not is judged, and if the power-on and power-off test of each time is passed, it is determined that the target gateway device passes the test. Otherwise, if the upper and lower electrical tests fail in each upper and lower electrical test, determining that the target gateway device fails in the test. The target gateway device needs to be debugged again.
According to the method for testing the gateway device with the power on and the power off, when the test result of the target gateway device is determined according to the test result of the power on and the power off each time, if the power on and the power off each time pass, it is determined that the target gateway device passes the test, and if the power on and the power off each time do not pass in the power on and the power off each time, it is determined that the target gateway device fails in the test, so that the risk that the target gateway device has an abnormal problem in the actual use process can be effectively reduced.
EXAMPLE III
Fig. 5 is a schematic structural diagram of a gateway device power-on and power-off testing apparatus according to an embodiment of the present invention, and as shown in fig. 5, a gateway device power-on and power-off testing apparatus 30 according to this embodiment includes: an acquisition module 31, a test module 32, and a determination module 33.
The obtaining module 31 is configured to obtain a test parameter for powering on and powering off a target gateway device. The testing module 32 is configured to perform power-on and power-off tests on the target gateway device for preset testing times according to the testing parameters, determine a network state of the target gateway device after the target gateway device is powered on for each power-on and power-off test, control the target gateway device to run a preset service, control the target gateway device to power off in a preset service running process, and determine a power-on and power-off test result for each time according to the network state and a preset service processing result. And the determining module 33 is configured to determine a test result of the target gateway device according to each power-on and power-off test result.
The power-on and power-off test apparatus for gateway devices provided in this embodiment may execute the technical solution of the method embodiment shown in fig. 2, and the implementation principle and the technical effect are similar, which are not described herein again.
Optionally, when determining the network state of the target gateway device after the target gateway device is powered on, the test module 32 is specifically configured to:
after the target gateway equipment is powered on, periodically sending a network test command to the target gateway equipment so that the target gateway equipment determines the network state according to the network test command; if a network test response sent by the target gateway equipment is received, determining that the network state of the target gateway equipment is normal; and if the network test response sent by the target gateway equipment is not received in the preset time period, determining that the network state of the target gateway equipment is abnormal.
Optionally, the test module 32 is specifically configured to, when the control target gateway device runs a preset service and controls power down in a running process of the preset service:
and controlling an operating system Shell of the target gateway equipment to read preset data, erasing the preset data into the embedded storage solution eMMC, and controlling power down in the process of erasing the preset data into the embedded storage solution eMMC.
The preset data is files with the volume larger than a preset volume threshold value.
Optionally, the test module 32, when determining the test result of each power-on and power-off test according to the network state and the preset service processing result, is specifically configured to:
if the network state is normal and the preset service processing is successful in the power-on and power-off test of a certain time, determining that the power-on and power-off test of the time passes; and if the network state is abnormal and/or the preset service processing fails in the previous and next electrical tests, determining that the previous and next electrical tests fail.
Optionally, the determining module 33 is specifically configured to:
if the power-on and power-off tests pass each time, determining that the target gateway equipment passes the test; and if the upper and lower electric tests fail once in each upper and lower electric test, determining that the target gateway equipment fails in the test.
Optionally, the obtaining module 31 is specifically configured to:
displaying a preset operation interface; and receiving the power-on and power-off test parameters configured by the user through a preset operation interface.
A test module 32, further configured to: and the control process power supply powers on the target gateway equipment.
Correspondingly, when controlling to power off in the preset service operation process, the test module 32 is specifically configured to:
and controlling the program-controlled power supply to power off the target gateway equipment in the running process of the preset service.
The power-on and power-off test apparatus for gateway devices provided in this embodiment may execute the technical solution of the method embodiment shown in fig. 3, and the implementation principle and the technical effect are similar, which are not described herein again.
EXAMPLE five
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 6, the electronic device 40 includes: at least one processor 41, memory 42;
the memory 42 stores computer-executable instructions.
At least one processor 41 executes the computer-executable instructions stored in the memory, so that the at least one processor executes the computer-executable instructions to implement the method for testing the gateway device according to any one of the first embodiment or the second embodiment of the present invention. The related description may be understood by referring to the related description and effect corresponding to the steps in fig. 2 to fig. 3, and redundant description is not repeated here.
In this embodiment, the electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, mainframes, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices.
In the present embodiment, the memory 42 and the processor 41 are connected by a bus 53.
The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for testing the power on and off of the gateway device provided in any one of the first embodiment and the second embodiment of the present invention.
The embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for testing power on and off of the gateway device provided in any one of the first embodiment and the second embodiment is implemented.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware form, and can also be realized in a form of hardware and a software functional module.
Program code for implementing the methods of the present invention may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions/acts specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Further, while operations are depicted in a particular order, this should be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in multiple implementations separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (14)

1. A gateway device power-on and power-off test method is characterized by comprising the following steps:
acquiring test parameters for powering on and powering off the target gateway equipment;
performing power-on and power-off tests on the target gateway equipment for preset test times according to the test parameters, determining the network state of the target gateway equipment after the target gateway equipment is powered on aiming at each power-on and power-off test, controlling the target gateway equipment to run a preset service, controlling the target gateway equipment to be powered off in the running process of the preset service, and determining the power-on and power-off test result of each time according to the network state and the processing result of the preset service;
and determining the test result of the target gateway equipment according to the power-on and power-off test result of each time.
2. The method of claim 1, wherein determining the network status of the target gateway device after powering up the target gateway device comprises:
after the target gateway equipment is powered on, periodically sending a network test command to the target gateway equipment so that the target gateway equipment determines the network state according to the network test command;
if a network test response sent by target gateway equipment is received, determining that the network state of the target gateway equipment is normal;
and if the network test response sent by the target gateway equipment is not received in the preset time period, determining that the network state of the target gateway equipment is abnormal.
3. The method according to claim 1, wherein the controlling the target gateway device to run a preset service, and controlling power down in a running process of the preset service comprises:
and controlling an operating system Shell of the target gateway equipment to read preset data, erasing the preset data into the embedded storage solution eMMC, and controlling power off in the process of erasing the preset data into the embedded storage solution eMMC.
4. The method of claim 3, wherein the predetermined data is a file greater than a predetermined capacity threshold.
5. The method of claim 1, wherein the determining the result of each power-on and power-off test according to the network status and the preset service processing result comprises:
if the network state is normal and the preset service is successfully processed in a certain power-on and power-off test, determining that the power-on and power-off test passes;
and if the network state is abnormal and/or the preset service processing fails in the previous and next electrical test, determining that the previous and next electrical test fails.
6. The method of claim 1, wherein determining the test result of the target gateway device according to each power-on and power-off test result comprises:
if the power-on and power-off tests pass each time, determining that the target gateway equipment passes the test;
and if the upper and lower electric tests fail once in each upper and lower electric test, determining that the target gateway equipment fails in the test.
7. The method according to any one of claims 1 to 6, wherein the obtaining of the test parameters for powering on and powering off the target gateway device comprises:
displaying a preset operation interface;
and receiving the power-on and power-off test parameters configured by the user through a preset operation interface.
8. The method according to any one of claims 1 to 6, wherein before determining the network status of the target gateway device after the target gateway device is powered on, the method further comprises:
a control process power supply powers on the target gateway equipment;
correspondingly, the controlling power down in the preset service operation process comprises the following steps:
and controlling the program control power supply to power off the target gateway equipment in the preset service operation process.
9. The utility model provides a gateway equipment power-on and power-off testing arrangement which characterized in that includes:
the acquisition module is used for acquiring test parameters for powering on and powering off the target gateway equipment;
the testing module is used for carrying out power-on and power-off testing on the target gateway equipment for preset testing times according to the testing parameters, determining the network state of the target gateway equipment after the target gateway equipment is powered on aiming at each power-on and power-off testing, controlling the target gateway equipment to run a preset service, controlling the target gateway equipment to be powered off in the running process of the preset service, and determining the power-on and power-off testing result of each time according to the network state and the processing result of the preset service;
and the determining module is used for determining the test result of the target gateway equipment according to the test result of each power-on and power-off test.
10. An electronic device, comprising: at least one processor, a memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of any one of claims 1-8.
11. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program is executed by a processor to implement the method according to any of claims 1-8.
12. A computer program product comprising a computer program, characterized in that the computer program realizes the method of any of claims 1-8 when executed by a processor.
13. The utility model provides a gateway equipment power-on and power-off test system which characterized in that includes: a programmable power supply, a target gateway device and the electronic device of claim 10;
and the electronic equipment is connected with the target gateway equipment through the programmable power supply.
14. The system of claim 13, further comprising: a router;
and the electronic equipment is in communication connection with the target gateway equipment through the router.
CN202011387328.5A 2020-12-01 2020-12-01 Gateway equipment power-on and power-off test method, device, equipment, system and product Active CN114584498B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011387328.5A CN114584498B (en) 2020-12-01 2020-12-01 Gateway equipment power-on and power-off test method, device, equipment, system and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011387328.5A CN114584498B (en) 2020-12-01 2020-12-01 Gateway equipment power-on and power-off test method, device, equipment, system and product

Publications (2)

Publication Number Publication Date
CN114584498A true CN114584498A (en) 2022-06-03
CN114584498B CN114584498B (en) 2023-08-15

Family

ID=81767442

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011387328.5A Active CN114584498B (en) 2020-12-01 2020-12-01 Gateway equipment power-on and power-off test method, device, equipment, system and product

Country Status (1)

Country Link
CN (1) CN114584498B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115529253A (en) * 2022-08-29 2022-12-27 阿里巴巴(中国)有限公司 Data center interconnection equipment testing method and system, electronic equipment and storage medium
CN115547396A (en) * 2022-11-30 2022-12-30 合肥康芯威存储技术有限公司 Test method and device for eMMC

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160149919A1 (en) * 2014-11-26 2016-05-26 The Travelers Indemnity Company Targeted user access control system
CN107562037A (en) * 2017-08-25 2018-01-09 北京新能源汽车股份有限公司 A kind of control method and equipment of vehicle power-on and power-off
CN109656764A (en) * 2018-12-18 2019-04-19 郑州云海信息技术有限公司 A kind of method and system of the independent electric control up and down of automatic verifying hard disk
CN109684146A (en) * 2018-12-28 2019-04-26 北京旷视科技有限公司 Upper and lower electric test method, device, system and processing equipment
CN109917218A (en) * 2019-04-30 2019-06-21 深圳开立生物医疗科技股份有限公司 Power-on and power-off test macro, method and the electrical equipment of electrical equipment
CN110224885A (en) * 2019-05-31 2019-09-10 东软集团股份有限公司 Alarm method, device, storage medium and the electronic equipment of monitoring of tools
CN110430096A (en) * 2019-08-06 2019-11-08 深圳市同维通信技术有限公司 A kind of gateway test method and equipment
CN110427289A (en) * 2019-07-31 2019-11-08 东莞记忆存储科技有限公司 The method and device that automatic test SSD power down influences data consistency
CN110502376A (en) * 2019-07-18 2019-11-26 苏州浪潮智能科技有限公司 A kind of hard disk electric test method and device up and down
CN110569158A (en) * 2019-08-30 2019-12-13 东莞记忆存储科技有限公司 method and device for testing abnormal power failure in SSD random scene and computer equipment
US20200004665A1 (en) * 2018-06-29 2020-01-02 International Business Machines Corporation Unit test framework for testing code in a gateway service
CN111983545A (en) * 2020-08-24 2020-11-24 安徽南瑞中天电力电子有限公司 Testing method and testing device for communication module of intelligent electric energy meter

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160149919A1 (en) * 2014-11-26 2016-05-26 The Travelers Indemnity Company Targeted user access control system
CN107562037A (en) * 2017-08-25 2018-01-09 北京新能源汽车股份有限公司 A kind of control method and equipment of vehicle power-on and power-off
US20200004665A1 (en) * 2018-06-29 2020-01-02 International Business Machines Corporation Unit test framework for testing code in a gateway service
CN109656764A (en) * 2018-12-18 2019-04-19 郑州云海信息技术有限公司 A kind of method and system of the independent electric control up and down of automatic verifying hard disk
CN109684146A (en) * 2018-12-28 2019-04-26 北京旷视科技有限公司 Upper and lower electric test method, device, system and processing equipment
CN109917218A (en) * 2019-04-30 2019-06-21 深圳开立生物医疗科技股份有限公司 Power-on and power-off test macro, method and the electrical equipment of electrical equipment
CN110224885A (en) * 2019-05-31 2019-09-10 东软集团股份有限公司 Alarm method, device, storage medium and the electronic equipment of monitoring of tools
CN110502376A (en) * 2019-07-18 2019-11-26 苏州浪潮智能科技有限公司 A kind of hard disk electric test method and device up and down
CN110427289A (en) * 2019-07-31 2019-11-08 东莞记忆存储科技有限公司 The method and device that automatic test SSD power down influences data consistency
CN110430096A (en) * 2019-08-06 2019-11-08 深圳市同维通信技术有限公司 A kind of gateway test method and equipment
CN110569158A (en) * 2019-08-30 2019-12-13 东莞记忆存储科技有限公司 method and device for testing abnormal power failure in SSD random scene and computer equipment
CN111983545A (en) * 2020-08-24 2020-11-24 安徽南瑞中天电力电子有限公司 Testing method and testing device for communication module of intelligent electric energy meter

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115529253A (en) * 2022-08-29 2022-12-27 阿里巴巴(中国)有限公司 Data center interconnection equipment testing method and system, electronic equipment and storage medium
CN115547396A (en) * 2022-11-30 2022-12-30 合肥康芯威存储技术有限公司 Test method and device for eMMC

Also Published As

Publication number Publication date
CN114584498B (en) 2023-08-15

Similar Documents

Publication Publication Date Title
CN106771972B (en) Automatic testing device, system and method for POS machine mainboard
CN114584498B (en) Gateway equipment power-on and power-off test method, device, equipment, system and product
CN101377749B (en) Method, programmable logic device, system and apparatus for checking memory data
CN104866418A (en) Automatic testing method and system
CN107070747A (en) A kind of method of the automatic test network interface card network connection stability under network card binding pattern
CN113960391A (en) Abnormal power failure testing device and method for storage medium
CN113225760A (en) Network testing method and equipment
CN112948189A (en) Margin test method, margin test system and related device
CN112015587B (en) Method and device for enhancing reliability of operating system
CN110459260B (en) Automatic test switching device, method and system
CN109376045B (en) Automatic verification device and verification method for BIOS (basic input output System) parameters
CN116257397A (en) Pressure testing method, pressure testing device, storage medium and pressure testing equipment
CN116185737A (en) DC abnormal power failure detection method and device based on notebook computer and computer equipment
CN111812445B (en) Intelligent capacitor error correction method and device, computer equipment and storage medium
CN114496053A (en) Data anomaly detection method, device and equipment and computer readable storage medium
CN112445670B (en) eMMC test method and device
CN105279080B (en) Terminal power failure test method and device
CN114461458A (en) Server memory test method, system, terminal and storage medium
CN102411527B (en) Detecting method for image-processing chip, developing plate and detecting system
CN107015827B (en) Embedded system and method for automatically operating third-party extension program thereof
CN111752782A (en) Stability testing method, system, device and storage medium
CN114116034B (en) Distributed brushing method and device
CN117079702B (en) NVMe solid state disk temperature cycle read-write power failure test method and device
CN114827330A (en) Test system and test method
TW201409226A (en) System and method for controlling motherboard for functional test

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
GR01 Patent grant
GR01 Patent grant