Gateway test method and gateway test system
By determining the target port type in the gateway and forming a test loop, using the host computer and internal resources for testing, it solves the problems of cumbersome and high-cost existing gateway testing methods, and achieves efficient and convenient gateway testing and real-time testing after version updates. .
Patent Information
- Application Number
- CN202410877512.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-01
AI Technical Summary
Existing gateway testing methods are cumbersome and have low testing efficiency. They need to connect additional test equipment, and the test equipment needs to be upgraded simultaneously when the gateway version is updated, resulting in high costs and complicated maintenance.
A gateway testing method is proposed. By determining the target port type, a test loop is formed, and the internal resources of the host computer and the target gateway are used for testing, which reduces the test cost and complexity, simplifies the test process, and improves the test efficiency.
It realizes efficient and convenient testing of the gateway, reduces the testing cost, simplifies the testing process, is suitable for real-time testing after the gateway version is updated, and has strong applicability.
Smart Images

Figure CN118740672A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of gateway technology, and in particular to a gateway testing method and a gateway testing system. Background Art
[0002] A gateway is a device used to connect different networks or network segments. Gateways play an important role in computer networks and communication systems, enabling the forwarding and routing of data packets.
[0003] Since the gateway supports multiple communication methods and has a complex interface, and multiple intelligent algorithms are deployed in the gateway device, hardware and software tests need to be performed separately after the gateway device is assembled and offline, and the software version of the gateway device needs to be updated at the same time, making the testing process more complicated.
[0004] Traditional gateway testing requires connecting additional test equipment and deploying test programs on the test equipment, making the current gateway testing method cumbersome and the testing efficiency low. Summary of the invention
[0005] Based on this, it is necessary to provide an efficient and convenient gateway testing method and gateway testing system.
[0006] In a first aspect, the present application proposes a gateway testing method, the method comprising:
[0007] Determine a target port to be detected in a target gateway, and obtain a target port type of the target port, wherein the target port type includes one or more of a switch signal port, a transceiver signal port, or a differential signal port;
[0008] In the target gateway, a test port of the same type as the target port is determined, and a test loop is formed according to the target port and the test port;
[0009] A test is performed based on the test loop to obtain a test result, which is used to determine the working status of the target port.
[0010] In one embodiment, when the target port type is a switch signal port, a test loop is formed according to the target port and the test port, including:
[0011] In the multi-channel switch signal port, a target input port and a target output port are determined; when the target input port is the target port, the target output port is used as a test port; when the target output port is the target port, the target input port is used as a test port;
[0012] Connect one end of the target output port to the power port, and the other end to the first end of the switch element inside the target gateway; wherein the power port is connected to the built-in power supply of the target gateway;
[0013] The second end of the switch element is connected to the target input port to form a test loop.
[0014] In one embodiment, performing a test based on a test loop to obtain a test result includes:
[0015] The conduction state of the switch element is switched, and the test signal of the target input port in different conduction states is detected, and the test result is obtained according to the test signal.
[0016] In one embodiment, obtaining a test result according to a test signal includes:
[0017] When the switch element is closed, if the test signal is at a high level, it means that the target input port and the target output port are working normally;
[0018] When the switch element is disconnected, if the test signal is at a low level, it means that the target input port and the target output port are operating normally.
[0019] In one embodiment, when the target port type is a signal transmitting and receiving port, determining a test port of the same type as the target port, and forming a test loop based on the target port and the test port include:
[0020] Determine a first transmitting port and a first receiving port corresponding to the first transceiver channel, and determine a second transmitting port and a second receiving port corresponding to the second transceiver channel; when the port corresponding to the first transceiver channel is a target port, use the port corresponding to the second transceiver channel as a test port; when the port corresponding to the second transceiver channel is a target port, use the port corresponding to the first transceiver channel as a test port;
[0021] The first transmitting port is connected to the second receiving port, and the first receiving port is connected to the second transmitting port to form a test loop.
[0022] In one embodiment, performing a test based on a test loop to obtain a test result includes:
[0023] Sending a first test message at a first sending port, and comparing a message received at a second receiving port with the first test message to obtain a test result;
[0024] Alternatively, a second test message is sent at the second sending port, and the message received at the first receiving port is compared with the second test message to obtain a test result.
[0025] In one embodiment, when the target port type is a differential signal port, determining a test port of the same type as the target port, and forming a test loop based on the target port and the test port include:
[0026] Determine a first positive port and a first negative port corresponding to the first differential channel, and determine a second positive port and a second negative port corresponding to the second differential channel; when the port corresponding to the first differential channel is a target port, use the port corresponding to the second differential channel as a test port; when the port corresponding to the second differential channel is a target port, use the port corresponding to the first differential channel as a test port;
[0027] The first positive electrode port is connected to the second positive electrode port, and the first negative electrode port is connected to the second negative electrode port to form a test loop.
[0028] In one embodiment, performing a test based on a test loop to obtain a test result includes:
[0029] Sending a third test message at the first positive port, and comparing the message received at the second negative port with the third test message to obtain a test result;
[0030] Alternatively, a fourth test message is sent at the second positive port, and the message received at the first negative port is compared with the fourth test message to obtain a test result.
[0031] In one embodiment, the method further comprises:
[0032] Determine other detection ports of the target gateway, and connect the target gateway to the load corresponding to the detection port;
[0033] The host computer obtains the test data of the target gateway after connecting to the load, and determines the working status of the detection port according to the test data.
[0034] In a second aspect, the present application proposes a gateway testing system, which includes a host computer, and the host computer is used to implement testing of a target gateway according to the gateway testing method proposed in the first aspect above.
[0035] In a third aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps proposed in the first aspect when executed by a processor.
[0036] In a fourth aspect, the present application further provides a computer program product, comprising a computer program, which implements the steps proposed in the first aspect when executed by a processor.
[0037] The above-mentioned gateway testing method and gateway testing system connect the target gateway to the host computer to realize the test of the target gateway. During the test, the target port to be detected in the target gateway is first determined, and the target port type of the target port is obtained, wherein the target port type includes one or more of a switch signal port, a transceiver signal port or a differential signal port. Then in the target gateway, a test port of the same type as the target port is determined, and a test loop is formed according to the target port and the test port; finally, a test is performed based on the test loop to obtain a test result, and the test result is used to determine the working state of the target port. The present application uses a host computer to replace complex test equipment, utilizes the internal resources of the target gateway, connects the target port to be detected with the test port of the same port type in the target gateway, reduces the test cost of the target gateway, simplifies the test process of the target gateway, and thus improves the test efficiency of the target gateway. After the version of the target gateway is updated, it can also be tested in real time, and has strong applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 A schematic diagram of a flow chart of a gateway testing method according to an embodiment;
[0040] Figure 2 A target port test connection schematic diagram of an embodiment;
[0041] Figure 3 This is a schematic diagram of a target port test connection according to another embodiment. DETAILED DESCRIPTION
[0042] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0044] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first resistor may be referred to as a second resistor, and similarly, a second resistor may be referred to as a first resistor. Both the first resistor and the second resistor are resistors, but they are not the same resistor.
[0045] It can be understood that the “connection” in the following embodiments should be understood as “electrical connection”, “communication connection”, etc. if the connected circuits, modules, units, etc. have electrical signals or data transmission between each other.
[0046] It can be understood that “at least one” means one or more, “plurality” means two or more, and “at least a portion of an element” means a part or all of an element.
[0047] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.
[0048] In one embodiment, please refer to Figure 1 , a gateway testing method is proposed, the method comprising the following steps 102 to 106. Among them:
[0049] Step 102, determining a target port to be detected in a target gateway, and obtaining a target port type of the target port, wherein the target port type includes one or more of a switch signal port, a transceiver signal port, or a differential signal port.
[0050] The target gateway is the gateway that needs to be tested in this embodiment. The gateway device supports multiple communication modes and has a complex interface. Multiple algorithms are also deployed in the gateway device. After the gateway device is assembled and offline, the traditional testing method requires the target gateway to be connected to a special test device to test the complex functions of the gateway. However, when the test device tests the target gateway, it is necessary to first connect the target gateway to the test device through a fixed module. For interfaces that cannot be connected through a fixed module, it is necessary to manually connect the target gateway and the test device, which makes the operation cumbersome and complicated when testing the target gateway through the test device. At the same time, the cost of the test equipment is high, and the test equipment needs to be upgraded synchronously when the gateway version is upgraded, and the maintenance cost is high.
[0051] The present application proposes a gateway testing method that is easy to operate and low in cost. During the test, the target port to be tested and the port type of the target port are first determined. The target port here includes one or more of a switch signal port, a transceiver signal port or a differential signal port. For input / output ports or communication ports such as switch signal ports, transceiver signal ports or differential signal ports in the target gateway, the present embodiment can use the resources inside the gateway to implement the test, so as to simplify the test process of the target gateway.
[0052] Step 104: In the target gateway, determine a test port of the same type as the target port, and form a test loop based on the target port and the test port.
[0053] The port of the same type as the target port is used as the test port. According to the different port types, the target port and the test port are connected in different ways to form a test loop.
[0054] Step 106: Perform a test based on the test loop to obtain a test result, which is used to determine the working status of the target port.
[0055] This application replaces complex test equipment with a host computer, utilizes the internal resources of the target gateway, connects the target port to be tested with the test port of the same port type in the target gateway, reduces the test cost of the target gateway, simplifies the test process of the target gateway, and thus improves the test efficiency of the target gateway. It can also be tested in real time after the version of the target gateway is updated, and has strong applicability.
[0056] In an exemplary embodiment, when the target port type is a switch signal port, a test loop is formed according to the target port and the test port, including: determining a target input port and a target output port among multiple switch signal ports; when the target input port is a target port, using the target output port as a test port; when the target output port is a target port, using the target input port as a test port; connecting the target output port to a power port, and the other end of the target output port is connected to a first end of a switching element inside a target gateway; wherein the power port is connected to a built-in power supply of the target gateway; connecting the second end of the switching element to the target input port to form a test loop.
[0057] A switch signal port is a type of digital signal port, which represents a switch quantity or digital quantity signal through high and low levels. In a switch signal port, a digital input port (DI for short) is used to receive an external switch quantity or digital quantity signal. A digital output port (DO for short) is used to control the external switch state through a switch element. The target gateway generally includes multiple digital input ports and digital output ports. When testing a switch signal port, first combine one digital input port and one digital output port into a group of switch signal ports, and test the switch signal ports in the target gateway by testing each group of switch signal ports.
[0058] Exemplarily, each group of switch signal ports includes one digital input port and one digital output port. The digital input port and digital output port of the group to be detected are used as the target input port and the target output port. At this time, if the target input port needs to be used as the target port, the target output port is used as the test port, and if the target output port needs to be used as the target port, the target input port is used as the test port.
[0059] Please refer to Figure 2 The test connection diagram shown in the figure is an example of a group of digital input ports and digital output ports. Figure 2 As shown in FIG. 1 , DO and DI are the target port and the test port respectively. DO and DI are connected in series to form a test loop. Specifically, Figure 2 As shown, one end of the target output port is connected to the power port, and the other end is connected to the first end of the switch element inside the target gateway; the second end of the switch element is connected to the target input port to form a test loop. At the same time, the power port is connected to the built-in power supply of the target gateway. The built-in power supply of the target gateway can be a 5V power supply. The switch element can be a relay, a switch, or other element that can be turned on or off according to a control instruction.
[0060] In a further embodiment, testing is performed based on the test loop to obtain the test result, including: switching the conduction state of the switch element, and detecting the test signal of the target input port in different conduction states, and obtaining the test result according to the test signal.
[0061] Please continue reading Figure 2 After the switch signal ports are connected in series, since the test circuit includes a switch element, the test signal in different conduction states can be obtained by controlling the conduction state of the switch element. Then, the test result can be obtained according to the test signal.
[0062] It can be understood that the detection result at this time is the status of a group of switch signal ports. That is, if the status is determined to be normal according to the test signal, it means that both the target port and the test port are working normally; if the status is determined to be abnormal according to the test signal, it means that at least one of the target port or the test port is abnormal. For abnormal switch signal ports, more accurate testing can be achieved through cross-grouping again, such as interconnecting the ports in the switch signal port group with abnormal status with other switch signal ports with normal tests to further determine the abnormal port.
[0063] In an exemplary embodiment, a test result is obtained according to a test signal, including: when the switch element is closed, if the test signal is at a high level, it indicates that the target input port and the target output port are working normally; when the switch element is open, if the test signal is at a low level, it indicates that the target input port and the target output port are working normally.
[0064] Since the switch signal port uses high and low levels as output signals, the test signal of the target input port is obtained when the switch element is in different conduction states. When the switch element is closed, since the test loop is connected to the built-in power supply, if the test signal detected at the target input port is a high level, it means that both the target port and the test port are working normally. If the detection signal is a low level, it means that at least one of the target port or the test port is working abnormally.
[0065] Similarly, when the switch element is disconnected, since the test circuit is disconnected from the built-in power supply, if the test signal detected at the target input port is low level, it means that both the target port and the test port are working normally. If the test signal is high level, it means that at least one of the target port or the test port is working abnormally. When detecting an abnormality, the abnormal port can be further determined by adjusting the connection shape of the switch signal port.
[0066] In another embodiment, when the target port type is a transceiver signal port, a test port of the same type as the target port is determined, and a test loop is formed based on the target port and the test port, including: determining a first transmitting port and a first receiving port corresponding to a first transceiver channel, and determining a second transmitting port and a second receiving port corresponding to a second transceiver channel; when the port corresponding to the first transceiver channel is the target port, the port corresponding to the second transceiver channel is used as a test port; when the port corresponding to the second transceiver channel is the target port, the port corresponding to the first transceiver channel is used as a test port; the first transmitting port is connected to the second receiving port, and the first receiving port is connected to the second transmitting port to form a test loop.
[0067] Please refer to Figure 3The signal transceiver port can be an RS232 serial communication port, and the RS232 port enables the target gateway to achieve data transmission with external devices. The signal transceiver port includes a data transmission port and a data receiving port. When there are multiple data transmission ports or multiple data receiving ports, the multiple data transmission ports or multiple data receiving ports can send or receive data at the same time.
[0068] Taking the RS232 serial communication port as an example, the data transmission ports and data receiving ports between different channels are cross-interconnected to form a test loop. For example, the first transmission port and the first receiving port corresponding to the first transceiver channel are determined, and the second transmission port and the second receiving port corresponding to the second transceiver channel are determined, and the first transmission port is connected to the second receiving port, and the first receiving port is connected to the second transmission port to form a test loop. At this time, the ports corresponding to different transceiver channels are target ports and test ports for each other, that is, if the port corresponding to the first transceiver channel is the target port, the port corresponding to the second transceiver channel is used as the test port; if the port corresponding to the second transceiver channel is the target port, the port corresponding to the first transceiver channel is used as the test port.
[0069] In a further embodiment, testing is performed based on a test loop to obtain a test result, including: sending a first test message at a first sending port, and comparing a message received at a second receiving port with the first test message to obtain a test result; or sending a second test message at a second sending port, and comparing a message received at the first receiving port with the second test message to obtain a test result.
[0070] In this embodiment, the transceiver signal ports of different channels are cross-connected to realize the status detection of the transceiver signal ports of different channels. Based on the connection of the test loop, when detecting the first sending port or the second receiving port, a first test message can be sent at the first sending port, and a message can be received at the second receiving port. If the received message is the same as the first test message, it means that both the first sending port and the second receiving port are working normally. If the received message is different from the first test message, it means that at least one of the first sending port or the second receiving port is working abnormally. At this time, the transceiver signal port that is working abnormally can be interconnected with other transceiver signal ports that are working normally to further determine the abnormal port.
[0071] Similarly, the detection method of the first receiving port or the second sending port is substantially the same as the detection method of the first sending port or the second receiving port described above, and will not be described in detail herein.
[0072] In another embodiment, when the target port type is a differential signal port, a test port of the same type as the target port is determined, and a test loop is formed based on the target port and the test port, including: determining a first positive port and a first negative port corresponding to a first differential channel, and determining a second positive port and a second negative port corresponding to a second differential channel; when the port corresponding to the first differential channel is the target port, using the port corresponding to the second differential channel as a test port; when the port corresponding to the second differential channel is the target port, using the port corresponding to the first differential channel as a test port; connecting the first positive port and the second positive port, and connecting the first negative port and the second negative port to form a test loop.
[0073] Please continue to refer to Figure 3 , the differential signal port can be an RS485 serial communication port. The RS485 port enables the target gateway to achieve anti-interference data transmission through differential signal transmission. In the differential channel, the differential signal port includes a positive port connected to the internal power supply and a negative port connected to the ground.
[0074] Taking the RS485 serial communication port as an example, the ports between different differential channels are connected in parallel to form a test loop. For example, determine the first positive port and the first negative port corresponding to the first differential channel, and determine the second positive port and the second negative port corresponding to the second differential channel, connect the first positive port and the second positive port, and connect the first negative port and the second negative port to form a test loop. At this time, the ports of different differential channels are target ports and test ports to each other, that is, if the port corresponding to the first differential channel is the target port, the port corresponding to the second differential channel is used as the test port; if the port corresponding to the second differential channel is the target port, the port corresponding to the first differential channel is used as the test port.
[0075] In a further embodiment, testing is performed based on the test loop to obtain test results, including: sending a third test message at the first positive port, and comparing the message received at the second negative port with the third test message to obtain the test result; or sending a fourth test message at the second positive port, and comparing the message received at the first negative port with the fourth test message to obtain the test result.
[0076] This embodiment connects the positive ports of different differential channels and connects the negative ports of different differential ports to realize the status detection of the differential signal ports of different differential channels. Based on the connection of the test loop, when detecting the first positive port or the second negative port, a third test message can be sent at the first positive port, and a message can be received at the second negative port. If the received message is the same as the third test message, it means that both the first positive port and the second negative port are working normally. If the received message is different from the third test message, it means that at least one of the first positive port or the second negative port is working abnormally. When a port abnormality is detected, the differential signal port with abnormal operation can be connected in parallel with other differential signal ports that are working normally to further determine the abnormal port.
[0077] Similarly, the detection method of the first negative electrode port or the second positive electrode port is substantially the same as the detection method of the first positive electrode port or the second negative electrode port described above, and will not be described in detail herein.
[0078] In another embodiment, the method further includes: determining other detection ports of the target gateway, connecting the target gateway to a load corresponding to the detection port; obtaining test data of the target gateway after connecting to the load through a host computer, and determining a working status of the detection port according to the test data.
[0079] When testing ports other than input and output ports, the test port is directly connected to the load to replace the traditional method of connecting and testing with the test equipment, which reduces the difficulty of developing gateway test software, shortens the development cycle, simplifies the test process, improves test efficiency, and reduces test costs.
[0080] For example, when testing the USB port, insert a USB peripheral such as a USB flash drive into the USB port of the target gateway. Through data interaction between the host computer connected to the target gateway and the target gateway, the USB device tree of the target gateway is retrieved. If the connected USB peripheral is detected, it means that the USB port of the target gateway is working properly. The communication rate of the USB port is obtained through the host computer to detect whether the USB port rate meets the rate standard.
[0081] When testing the 5G port, insert the SIM card into the target gateway and screw the antenna of the target gateway into the SMA wireless port. Through the data interaction between the host computer connected to the target gateway and the target gateway, the connection status of the 5G module, the SIM card operator, the 5G signal quality and the communication rate and other network data are determined to detect the working status of the 5G port.
[0082] When testing the RJ45 interface, multiple RJ45 interfaces are set on the target gateway, one of which is set as a WAN port, supporting WAN / LAN adaptation, and used to connect the target gateway to the host computer through the WAN port during testing. The remaining RJ45 interfaces are LAN ports, supporting PoE function, and meeting the IEEE 802.3at standard. During the test, the gateway is connected to the PoE camera. If the handshake is successful, the target gateway will assign an IP address to it. The test program set in the host computer tests the physical connection status of each network port and the operating status of the corresponding RJ45 network port physical layer to realize the working status detection of the RJ45 network port.
[0083] When testing the MicroSD Card interface, after inserting the MicroSD card into the MicroSD Card interface, the connection status of the MicroSD card on the MicroSD Card interface is determined by retrieving the file mounting information through data interaction between the host computer connected to the target gateway and the target gateway, so as to realize the working status detection of the MicroSD Card interface.
[0084] In some other embodiments, when testing the target gateway, the target gateway is first connected to the host computer through the WAN interface of the target gateway and communication is established. The gateway cloud management platform is accessed through the host computer to update the software of the target gateway, and the test of the target gateway is started after the software update is completed.
[0085] During the test, the test program in the host computer must first obtain and record the current identification code and software version number of the target gateway, then start testing the port function, and record the corresponding test data and test results.
[0086] Since the software in the target gateway needs to be updated and maintained frequently, with the iteration of the software version, the test equipment also needs to be updated when the test equipment is used for testing. The test method proposed in this application does not need to be connected to additional test equipment. Based on the channel resources inside the target gateway, the test of the target gateway can be realized, and the hardware dependence is low. This application only needs to be connected to the host computer during testing, and the response is fast. Before testing using the test method of this embodiment, the software of the target gateway can also be updated, which is simple to operate and easy to implement. It also simplifies the test process of the target gateway, thereby improving the test efficiency of the target gateway and reducing the test cost. Even after the version of the target gateway is updated, it can be tested in real time, and it has strong applicability.
[0087] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0088] Based on the same inventive concept, in one embodiment, the present application also provides a gateway testing system, which includes a host computer, and the host computer implements testing of a target gateway according to the gateway testing method involved in the above embodiment.
[0089] The implementation solution provided by the gateway test system of this embodiment to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations of the gateway test system of this embodiment can refer to the limitations on the gateway test method above, which will not be repeated here.
[0090] Exemplarily, the host computer may include a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the host computer is used to provide computing and control capabilities. The memory of the host computer includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store test data. The input / output interface of the host computer is used to exchange information between the processor and the target gateway. When the computer program is executed by the processor, a gateway testing method is implemented.
[0091] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned gateway testing method are implemented.
[0092] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of the above gateway testing method when executed by a processor.
[0093] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0094] In the description of this specification, the description with reference to the terms "some embodiments", "other embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic description of the above terms does not necessarily refer to the same embodiment or example.
[0095] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0096] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A gateway testing method, characterized in that: The method comprises: Determine a target port to be detected in a target gateway, and obtain a target port type of the target port, wherein the target port type includes one or more of a switch signal port, a transceiver signal port, or a differential signal port; In the target gateway, determining a test port of the same type as the target port, and forming a test loop based on the target port and the test port; A test is performed based on the test loop to obtain a test result, and the test result is used to determine the working state of the target port.
2. The method according to claim 1, characterized in that When the target port type is the switch signal port, forming a test loop based on the target port and the test port includes: In the multi-channel switch signal port, a target input port and a target output port are determined; when the target input port is the target port, the target output port is used as the test port; when the target output port is the target port, the target input port is used as the test port; Connect one end of the target output port to the power port, and the other end to the first end of the switch element inside the target gateway; wherein the power port is connected to the built-in power supply of the target gateway; The second end of the switch element is connected to the target input port to form the test loop.
3. The method according to claim 2, characterized in that The testing based on the test loop to obtain the test result includes: The conduction state of the switch element is switched, and the test signal of the target input port in different conduction states is detected, and the test result is obtained according to the test signal.
4. The method according to claim 3, characterized in that The obtaining the test result according to the test signal comprises: When the switch element is closed, if the test signal is at a high level, it indicates that the target input port and the target output port are working normally; When the switch element is disconnected, if the test signal is at a low level, it indicates that the target input port and the target output port are operating normally.
5. The method according to claim 1, characterized in that When the target port type is the signal transceiver port, determining a test port of the same type as the target port, and forming a test loop according to the target port and the test port, comprises: Determine a first sending port and a first receiving port corresponding to a first transceiver channel, and determine a second sending port and a second receiving port corresponding to a second transceiver channel; when the port corresponding to the first transceiver channel is the target port, use the port corresponding to the second transceiver channel as the test port; when the port corresponding to the second transceiver channel is the target port, use the port corresponding to the first transceiver channel as the test port; The first transmitting port is connected to the second receiving port, and the first receiving port is connected to the second transmitting port to form the test loop.
6. The method according to claim 5, characterized in that The testing based on the test loop to obtain the test result includes: Sending a first test message at the first sending port, and comparing the message received by the second receiving port with the first test message to obtain the test result; Alternatively, a second test message is sent at the second sending port, and the message received by the first receiving port is compared with the second test message to obtain the test result.
7. The method according to claim 1, characterized in that When the target port type is the differential signal port, determining a test port of the same type as the target port, and forming a test loop according to the target port and the test port, comprises: Determine a first positive port and a first negative port corresponding to the first differential channel, and determine a second positive port and a second negative port corresponding to the second differential channel; when the port corresponding to the first differential channel is the target port, use the port corresponding to the second differential channel as the test port; when the port corresponding to the second differential channel is the target port, use the port corresponding to the first differential channel as the test port; The first positive electrode port and the second positive electrode port are connected, and the first negative electrode port and the second negative electrode port are connected to form the test loop.
8. The method according to claim 7, characterized in that The testing based on the test loop to obtain the test result includes: Sending a third test message at the first positive port, and comparing the message received by the second negative port with the third test message to obtain the test result; Alternatively, a fourth test message is sent at the second positive port, and the message received at the first negative port is compared with the fourth test message to obtain the test result.
9. The method according to claim 1, characterized in that: The method further comprises: Determine other detection ports of the target gateway, and connect the target gateway to loads corresponding to the detection ports; The test data of the target gateway after connecting to the load is obtained through the host computer, and the working state of the detection port is determined according to the test data.
10. A gateway testing system, characterized in that: The system includes a host computer, and the host computer implements testing of a target gateway according to the gateway testing method according to any one of claims 1-9.
