Test method and test equipment of set top box, set top box and readable storage medium
By using the UDP protocol to provide a keep-alive mechanism in set-top box testing, the misjudgment problem caused by disconnection of ADB tools is solved, and the accuracy and reliability of the test are improved.
Patent Information
- Application Number
- CN202310764854.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2024-12-27
AI Technical Summary
When the set-top box is disconnected, the ADB tool is disconnected, causing the test equipment to misjudgment the set-top box to be lost, reducing the accuracy of the test.
User Datagram Protocol (UDP) is used instead of ADB tool, and the connection status of the set-top box and the test device is determined by broadcasting test command messages and receiving device status messages. If no messages are received within the preset time, it is determined to be abnormal. open.
It improves the accuracy of set-top box testing, ensures that even test cases with network-off-network function can be executed normally, avoids misjudgment, and enhances the reliability of the test.
Smart Images

Figure CN119211514A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of equipment testing, and in particular to a set-top box testing method, testing equipment, a set-top box and a computer-readable storage medium. Background Art
[0002] When using a test device to test a set-top box, the test device usually uses the ADB (Android Debug Bridge) tool to connect to the set-top box through a wired network. When the set-top box runs an automated test case involving network disconnection, the set-top box will disconnect from the Internet, and the set-top box will be disconnected from the test device for a short period of time. When the set-top box is disconnected from the test device, the ADB tool will be disconnected, causing the test device to determine that the current automated test has failed due to the loss of connection with the set-top box, resulting in a misjudgment and reducing the accuracy of the set-top box test.
[0003] Therefore, in the process of set-top box testing, how to test accurately becomes an issue that needs to be solved urgently. Summary of the invention
[0004] The present invention provides a set-top box testing method, testing equipment, a set-top box and a readable storage medium, which solves the problem in the related art that when the set-top box is disconnected from the testing equipment, the ADB tool will be disconnected, so that the testing equipment determines that the current automated test fails due to the set-top box being disconnected, resulting in a misjudgment.
[0005] In a first aspect, the present invention provides a method for testing a set-top box, the method comprising:
[0006] During the test of the target set-top box, a test instruction message corresponding to the test case is broadcast to the target set-top box, and the test device establishes a physical link connection with the target set-top box based on the user datagram protocol; if a device status message sent by the target set-top box is received, it is determined that the target set-top box is normally connected to the test device, and the test result corresponding to the test case is determined according to the execution result message returned by the target set-top box based on the test instruction message; if the device status message sent by the target set-top box is not received within a preset time, it is determined that the target set-top box is abnormally disconnected from the test device, and the test result corresponding to the test case is determined to be a test failure.
[0007] In a second aspect, the present invention provides a method for testing a set-top box, the method comprising:
[0008] When receiving the test instruction message sent by the test device, the network connection status of the set-top box is obtained; a device status message is generated according to the network connection status, and the device status message is sent to the test device.
[0009] In a third aspect, the present invention further provides a testing device, the testing device comprising a memory and a processor;
[0010] The memory is used to store computer programs;
[0011] The processor is used to execute the computer program and implement the test method of the set-top box corresponding to the above-mentioned test device when executing the computer program.
[0012] In a fourth aspect, the present invention further provides a set-top box, the set-top box comprising a memory and a processor;
[0013] The memory is used to store computer programs;
[0014] The processor is used to execute the computer program and implement the above-mentioned set-top box testing method when executing the computer program.
[0015] In a fifth aspect, the present invention further provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor implements the set-top box testing method as described above.
[0016] The invention discloses a set-top box testing method, testing equipment, a set-top box and a computer-readable storage medium. The testing method comprises: in the process of testing a target set-top box, a test instruction message corresponding to a test case to be tested is broadcasted to the target set-top box, and the test equipment establishes a physical link connection with the target set-top box based on a user datagram protocol; if a device status message sent by the target set-top box is received, it is determined that the target set-top box is normally connected to the test equipment, and a test result corresponding to the test case to be tested is determined according to an execution result message returned by the target set-top box based on the test instruction message; if the device status message sent by the target set-top box is not received within a preset time, it is determined that the target set-top box is abnormally disconnected from the test equipment, and the test result corresponding to the test case to be tested is determined to be a test failure. The above-mentioned test method uses the User Datagram Protocol instead of the ADB tool as a tool for communication between the test device and the set-top box, and provides a keep-alive mechanism during the test of the set-top box. It can determine whether the set-top box and the test device are connected normally according to whether the device status message sent by the set-top box is received. Even the test cases involving the network disconnection function can be executed normally, which solves the problem of related technologies that the set-top box is misjudged as lost due to a short-term network disconnection of the set-top box, and can improve the accuracy of testing the set-top box.
[0017] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0019] Figure 1 is a structural schematic diagram of a test device provided by an embodiment of the present invention;
[0020] Figure 2 is a structural schematic diagram of a set-top box provided by an embodiment of the present invention;
[0021] Figure 3 is a schematic flow chart of a set-top box testing method provided by an embodiment of the present invention;
[0022] Figure 4 is a schematic flow chart of sub-steps of determining a target set-top box provided by an embodiment of the present invention;
[0023] Figure 5 is a schematic flow chart of another set-top box testing method provided by an embodiment of the present invention;
[0024] Figure 6 is a schematic flow chart of another set-top box testing method provided by an embodiment of the present invention;
[0025] Figure 7 is a schematic flow chart of another set-top box testing method provided by an embodiment of the present invention;
[0026] Figure 8 is a schematic flow chart of another set-top box testing method provided by an embodiment of the present invention;
[0027] Fig. 9 It is a schematic diagram of a set-top box testing method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0030] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0031] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0032] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0033] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no special meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0034] The embodiment of the present invention provides a set-top box test method, test equipment, set-top box and computer-readable storage medium. The set-top box test method can be applied to the test equipment or the set-top box, and by using the user datagram protocol instead of the ADB tool as a tool for the test equipment to communicate with the set-top box, a keep-alive mechanism is provided during the test of the set-top box, and whether the set-top box is normally connected to the test equipment can be determined according to whether the device status message sent by the set-top box is received, and even the test case involving the network disconnection function can be executed normally, which solves the problem of misjudging the set-top box disconnection due to a short-term network disconnection of the set-top box in the related art, and can improve the accuracy of the set-top box test.
[0035] Exemplarily, the test device may include a server or a terminal. The server may be a single server or a server cluster. The terminal may be an electronic device such as a tablet computer, a laptop computer, or a desktop computer.
[0036] It should be noted that the set-top box testing method provided in the embodiment of the present invention can be executed by a testing device or a set-top box. The following description will be made with the testing device and the set-top box as the execution subjects respectively.
[0037] See also Figure 1 , Figure 1 1 is a schematic diagram of a test device 10 provided by an embodiment of the present invention. The test device 10 may include a processor 1001 and a memory 1002, wherein the processor 1001 and the memory 1002 may be connected via a bus, such as an Inter-integrated Circuit (I2C) bus or any other suitable bus.
[0038] The memory 1002 may include a storage medium and an internal memory. The storage medium may store an operating system and a computer program. The computer program includes program instructions, which, when executed, may enable the processor to execute the test method corresponding to the test device described in any embodiment.
[0039] The processor 1001 is used to provide computing and control capabilities to support the operation of the entire testing device 10 .
[0040] The processor 1001 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other types of processors such as programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. A general-purpose processor may be a microprocessor, or a general-purpose processor may be any conventional processor.
[0041] In one embodiment, the processor 1001 is used to run a computer program stored in the memory 1002 to implement the following steps:
[0042] During the test of the target set-top box, the test instruction message corresponding to the test case is broadcast to the target set-top box, and the test equipment establishes a physical link connection with the target set-top box based on the user datagram protocol; if the device status message sent by the target set-top box is received, it is determined that the target set-top box is normally connected to the test equipment, and the test result corresponding to the test case is determined according to the execution result message returned by the target set-top box based on the test instruction message; if the device status message sent by the target set-top box is not received within a preset time, it is determined that the target set-top box is abnormally disconnected from the test equipment, and the test result corresponding to the test case is determined to be a test failure.
[0043] In one embodiment, the processor 1001 is further configured to implement:
[0044] The automated test request message is broadcasted through a preset port; the first set-top box that returns an idle state message according to the automated test request message is determined as the target set-top box.
[0045] In one embodiment, the processor 1001 is further configured to implement:
[0046] If it is confirmed that the target set-top box has completed executing the test instruction messages corresponding to all the test cases to be tested, a test end message is sent to the target set-top box to indicate that the current test of the target set-top box is finished, and the currently collected log information is sent to the test device.
[0047] See also Figure 2 , Figure 2 2 is a schematic diagram of the structure of a set-top box 20 provided by an embodiment of the present invention. The set-top box 20 may include a processor 2001 and a memory 2002, wherein the processor 2001 and the memory 2002 may be connected via a bus, such as an Inter-integrated Circuit (I2C) bus or any other suitable bus.
[0048] The memory 2002 may include a storage medium and an internal memory. The storage medium may store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor may execute the test method corresponding to the set-top box described in any embodiment.
[0049] Among them, the processor 2001 is used to provide computing and control capabilities to support the operation of the entire set-top box 20.
[0050] The processor 2001 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other types of processors such as programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. A general-purpose processor may be a microprocessor, or may be any conventional processor.
[0051] In one embodiment, the processor 2001 is used to run a computer program stored in the memory 2002 to implement the following steps:
[0052] When receiving the test instruction message sent by the test device, the network connection status of the set-top box is obtained; a device status message is generated according to the network connection status, and the device status message is sent to the test device.
[0053] In one embodiment, after receiving the test instruction message sent by the test device, the processor 2001 is further configured to implement:
[0054] Execute the test instruction in the test instruction message to obtain the execution result corresponding to the test instruction; encapsulate the execution result based on the data flow method to obtain the execution result message; and send the execution result message to the test device.
[0055] In one embodiment, the processor 2001 is further configured to implement:
[0056] When receiving the test end message sent by the test device, stop collecting log information, encapsulate the currently collected log information based on the data stream mode to obtain a log information message; and send the log information message to the test device.
[0057] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. The following embodiments and features of the embodiments can be combined with each other without conflict. Figure 3 , Figure 3 FIG. 1 is a schematic flow chart of a method for testing a set-top box provided by an embodiment of the present invention. Figure 3 As shown, the method for testing the set-top box includes steps S101 to S103.
[0058] Step S101: During the test of a target set-top box, a test instruction message corresponding to the test case is broadcast to the target set-top box, and a test device establishes a physical link connection with the target set-top box based on a user datagram protocol.
[0059] It should be noted that the set-top box testing method provided by the embodiment of the present invention can be applied to the set-top box testing scenario. By using the user datagram protocol instead of the ADB tool as a tool for communication between the test device and the set-top box, a keep-alive mechanism is provided during the test of the set-top box. Whether the set-top box and the test device are normally connected can be determined based on whether a device status message sent by the set-top box is received. Even test cases involving the network disconnection function can be executed normally, which solves the problem of related technologies that the set-top box is misjudged as lost due to a short-term network disconnection, and can improve the accuracy of testing the set-top box.
[0060] In some embodiments, during the test of the target set-top box, a test instruction message corresponding to the test case is broadcast to the target set-top box. The test device establishes a physical link connection with the target set-top box based on the User Datagram Protocol (UDP).
[0061] Exemplarily, the test device may encapsulate the test instruction corresponding to the test case into a message to obtain a test instruction message.
[0062] It should be noted that the UDP protocol provides a communication method that allows non-network devices to communicate normally with connected devices as long as the physical link remains connected. A physical link refers to a communication link established based on a wired connection, such as a communication link established through a network cable or other communication data cable.
[0063] In an embodiment of the present invention, the test device establishes a physical link connection with the target set-top box based on the user datagram protocol, and can replace the ADB tool as a tool for communication between the test device and the set-top box. This solves the problem in the related art that when the set-top box is disconnected from the test device, the ADB tool will be disconnected, causing the test device to determine that the current automated test has failed due to the loss of connection with the set-top box, resulting in misjudgment.
[0064] Exemplarily, during the test of the target set-top box, the test device may broadcast the test instruction message corresponding to the test case to be tested to the target set-top box in sequence based on the physical link. For example, when the test case to be tested is a startup case, the test device may send a startup instruction message to the target set-top box. For another example, when the test case to be tested is a network disconnection case, the test device may send a network disconnection instruction message to the target set-top box.
[0065] In some embodiments, when multiple set-top boxes need to be tested automatically, the test equipment can establish physical link connections with the multiple set-top boxes through a switch. Exemplarily, the test equipment can be connected to the switch through a network cable or other communication data, and the multiple set-top boxes can be connected to the switch through a network cable or other communication data.
[0066] It should be noted that in the related art, the ABD tool needs to connect the set-top box and the test equipment through a USB data cable, and this USB data cable connection method has the limitations of distance and number of connections. It is understandable that due to the limited length of the USB data cable, the set-top box can only be placed near the test equipment; and the number of USB interfaces of a test equipment is limited, and it can only be connected to a certain number of set-top boxes and execute automated use cases at the same time, thereby limiting the efficiency of automated testing. Among them, when the set-top box and the test equipment are connected through a USB data cable, the test equipment can identify the set-top box through the ABD tool, without the need to communicate and connect through the IP (Internet Protocol) address of the set-top box. The embodiment of the present invention can realize the simultaneous establishment of physical link connections between the test equipment and multiple set-top boxes by adding a switch, thereby solving the problem of low efficiency of automated testing due to the limited number of USB interfaces, greatly improving the efficiency of set-top box testing, and avoiding the opening of USB interface functions, thereby improving the security of the set-top box.
[0067] The above embodiment, by adopting the User Datagram Protocol instead of the ADB tool as the tool for communication between the test device and the set-top box, can not only solve the problem in the related art that when the set-top box and the test device are disconnected, the ADB tool will be disconnected, causing the test device to judge that the current automated test has failed due to the loss of connection with the set-top box, resulting in misjudgment, but also solve the problem that the ABD tool in the related art needs to connect the set-top box and the test device through a USB data cable, and the efficiency of the automated test is low due to the limited number of USB interfaces.
[0068] Step S102: If the device status message sent by the target set-top box is received, it is determined that the target set-top box is normally connected to the test device, and the test result corresponding to the test case is determined according to the execution result message returned by the target set-top box based on the test instruction message.
[0069] In some embodiments, after broadcasting the test instruction message corresponding to the test case to be tested to the target set-top box, if a device status message sent by the target set-top box is received, it is determined that the target set-top box is normally connected to the test device, and the test result corresponding to the test case to be tested is determined according to the execution result message returned by the target set-top box based on the test instruction message. Wherein, the device status message includes the network connection status of the target set-top box.
[0070] It should be noted that, in an embodiment of the present invention, the target set-top box can parse the test instruction message after receiving the test instruction message, and execute the test instruction obtained by parsing. Then, the corresponding execution result is encapsulated in the UDP message in a data stream mode, and the execution result message is obtained, and the execution result message is sent to the test equipment. After starting the test, the target set-top box can detect the network connection state of the target set-top box at regular time or in real time, and the network connection state and log information are encapsulated in the UDP message, and the device status message is obtained, and the device status message is then sent to the test equipment. Wherein, the network connection state refers to the network state of the target set-top box connecting the Internet. The test result can be determined according to actual conditions, and is not limited at this.
[0071] Exemplarily, if the device status message sent by the target set-top box is received within a preset time, it can be determined that the target set-top box is normally connected to the test device. At this time, the timer can be reset and the execution result message can be saved.
[0072] It should be noted that when the device status message sent by the target set-top box is received, it is determined that the target set-top box is normally connected to the test device, so that a keep-alive mechanism can be provided during the testing of the set-top box. Whether the set-top box and the test device are normally connected can be determined based on whether the device status message sent by the set-top box is received. Even if the set-top box is disconnected from the network for a short time during the test case involving the network disconnection function, it will not be judged as lost.
[0073] Step S103: If the device status message sent by the target set-top box is not received within the preset time, it is determined that the target set-top box is abnormally disconnected from the test device, and the test result corresponding to the test case is determined to be a test failure.
[0074] In some embodiments, after broadcasting the test instruction message corresponding to the test case to be tested to the target set-top box, if the device status message sent by the target set-top box is not received within a preset time, it is determined that the target set-top box is abnormally disconnected from the test device, and the test result corresponding to the test case to be tested is determined to be a test failure.
[0075] The preset time can be set according to actual conditions, and the specific value is not limited here.
[0076] For example, when the preset time is 5s, during the test of the target set-top box, the timer can be used to count the time. If the device status message sent by the target set-top box is not received every 5s, it can be determined that the target set-top box is abnormally disconnected from the test device. At this time, the test result corresponding to the test case to be tested can be determined as test failure, and the test result of the untested case can be set as test failure.
[0077] In the above embodiment, by not receiving the device status message sent by the target set-top box within the preset time, it is determined that the target set-top box is abnormally disconnected from the test device, which can improve the accuracy of judging whether the connection between the set-top box and the test device is disconnected and avoid misjudgment.
[0078] It should be noted that, in the embodiment of the present invention, before the automated test is performed, a target set-top box may be determined from a plurality of set-top boxes. How to determine the target set-top box will be described in detail below.
[0079] See also Figure 4 , Figure 4 FIG. 1 is a schematic flow chart of sub-steps of determining a target set-top box provided by an embodiment of the present invention. Figure 4 As shown, it may include step S201 and step S202.
[0080] Step S201: broadcast an automated test request message through a preset port.
[0081] Exemplarily, the test device may broadcast an automated test request message through a preset port. For example, the test device may broadcast a CFAT (Communication For Automated Test Discover) Discover (request) message to a port to query a set-top box that can currently be used for automated testing.
[0082] Step S202: The first set-top box that returns an idle state message according to the automated test request message is determined as the target set-top box.
[0083] In an embodiment of the present invention, the set-top box can monitor the port, and when receiving the CFAT Discover message, it can reply an idle state message to the test device through the port. Wherein, the idle state message can be expressed as CFAT AvaiDev. After replying the CFAT AvaiDev message, the set-top box can start collecting log data and prepare for automated testing.
[0084] Exemplarily, the test device may determine the first set-top box that returns an idle state message according to the automated test request message as the target set-top box. For example, if set-top box A is the first set-top box that returns an idle state message according to the automated test request message, set-top box A is determined as the target set-top box. If set-top box B is the second set-top box that returns an idle state message according to the automated test request message, set-top box B is determined as a candidate set-top box, and after set-top box A completes the execution of all test instruction messages corresponding to the test cases to be tested, set-top box B is determined as the target set-top box and the automated test is performed on set-top box B.
[0085] Of course, in the embodiment of the present invention, the test device can perform automated testing on multiple set-top boxes at the same time. Wherein, the test device can establish physical link connections with multiple set-top boxes at the same time through a switch. For example, the test device can perform automated testing on set-top box A, set-top box B, and set-top box C that return idle state messages according to the automated test request message, thereby improving test efficiency.
[0086] In the above embodiment, the automated test request message is broadcasted through the port, and the first set-top box that returns an idle state message according to the automated test request message is determined as the target set-top box, so that automated testing can be performed on idle or available set-top boxes, avoiding test failure caused by automated testing on unavailable set-top boxes.
[0087] See also Figure 5 , Figure 5 FIG. 1 is a schematic flow chart of another set-top box testing method provided by an embodiment of the present invention. Figure 5 As shown, it may include steps S301 to S303.
[0088] Step S301: During the test of the target set-top box, a test instruction message corresponding to the test case to be tested is broadcast to the target set-top box, and the test device establishes a physical link connection with the target set-top box based on the User Datagram Protocol.
[0089] Step S302: If the device status message sent by the target set-top box is received, it is determined that the target set-top box is normally connected to the test device, and the test result corresponding to the test case is determined according to the execution result message returned by the target set-top box based on the test instruction message.
[0090] It can be understood that step S301 and step S302 are the same as the above-mentioned step S101 and step S102, and are not described in detail here.
[0091] Step S303: If it is confirmed that the target set-top box has completed executing the test instruction messages corresponding to all the test cases to be tested, a test end message is sent to the target set-top box to indicate that the current test of the target set-top box is finished, and the currently collected log information is sent to the test device.
[0092] Exemplarily, after waiting for the target set-top box to complete executing the test instructions corresponding to all the test cases to be tested, the test device sends a test end message to the target set-top box. The test end message is used to notify the target set-top box that the current test is over and to instruct the target set-top box to stop collecting log information. The test end message can be represented as a CFAT TestEnd message.
[0093] For example, when the test device receives the execution result messages corresponding to all the test cases to be tested sent by the target set-top box, it determines that the target set-top box has completed executing the test instructions corresponding to all the test cases to be tested.
[0094] It should be noted that, when receiving the CFAT TestEnd message, the target set-top box stops collecting log information, and encapsulates the currently collected log information based on the data stream mode to obtain the log information message. Then, a log information message is sent to the test equipment, and the communication connection with the current test equipment is terminated. Wherein, the log information message can be expressed as a CFATDevLog message. After receiving the log information message sent by the target set-top box, the test equipment can decrypt and store the log information message.
[0095] In the above embodiment, by confirming that the target set-top box has completed executing the test instruction messages corresponding to all the test cases to be tested, a test end message is sent to the target set-top box, thereby indicating that the current test of the target set-top box is completed and sending the currently collected log information to the test device.
[0096] See also Figure 6 , Figure 6 FIG. 1 is a schematic flow chart of another set-top box testing method provided by an embodiment of the present invention. Figure 6 As shown, it may include step S401 and step S402.
[0097] Step S401: upon receiving a test instruction message sent by a test device, obtaining a network connection status of a set-top box.
[0098] It should be noted that in the embodiment of the invention, before receiving the test end message sent by the test device, the set-top box can periodically or in real time detect the network connection status of the set-top box, and generate a device status message according to the network connection status and send it to the test device.
[0099] In some embodiments, when the set-top box receives the test command message sent by the test device, it obtains the network connection status of the set-top box. The test command message can be expressed as CFAT TestCmd.
[0100] Exemplarily, the network connection status of the set-top box can be detected at preset time intervals, wherein the preset time interval can be set according to actual conditions, and the specific value is not limited here.
[0101] Step S402: Generate a device status message according to the network connection status, and send the device status message to the test device.
[0102] Exemplarily, after the network connection status of the set-top box is acquired, a device status message may be generated according to the network connection status, and the device status message may be sent to the test device, wherein the device status message may be expressed as CFATDevStatus.
[0103] In some embodiments, after receiving the test instruction message sent by the test device, the set-top box may return a reply message to the test device, so that the test device confirms that the set-top box has received the test instruction message. The reply message may be expressed as CFAT Reply.
[0104] In some embodiments, when the set-top box generates a device status message according to the network connection status, it can also encapsulate the network connection status and log information into a UDP message in a data stream manner to obtain the device status message.
[0105] The above embodiment obtains the network connection status of the set-top box, generates a device status message according to the network connection status, and sends the device status message to the test device, thereby providing a keep-alive mechanism during the test of the set-top box. Whether the set-top box and the test device are normally connected can be determined based on whether the device status message sent by the set-top box is received. Even if the set-top box is disconnected from the network for a short time during the test case involving the network disconnection function, it will not be judged as lost, so that the set-top box can be tested normally and output the execution result message, thereby avoiding affecting the overall operation of the automated test.
[0106] See also Figure 7 , Figure 7 FIG. 1 is a schematic flow chart of another set-top box testing method provided by an embodiment of the present invention. Figure 7 As shown, it may include steps S501 to S503.
[0107] Step S501: execute the test instruction in the test instruction message to obtain the execution result corresponding to the test instruction.
[0108] Exemplarily, after receiving the test instruction message, the set-top box may parse the test instruction message to obtain the corresponding test instruction, and then execute the test instruction to obtain the corresponding execution result. The specific process of executing the test instruction is not limited here.
[0109] Step S502: Encapsulate the execution result based on the data stream method to obtain an execution result message.
[0110] Exemplarily, after obtaining the execution result corresponding to the test instruction, the execution result can be encapsulated based on the data flow method to obtain an execution result message.
[0111] For example, the execution result can be encapsulated into a UDP message in a data stream manner to obtain an execution result message, wherein the execution result message can be expressed as CFAT TestResult.
[0112] Step S503: Send an execution result message to the test device.
[0113] Exemplarily, after generating the execution result message, the set-top box may send the execution result message to the test device, for example, based on a physical link between the set-top box and the test device, to send the execution result message to the test device.
[0114] It should be noted that after receiving the execution result message, the test device may return a response message to the set-top box, so that the set-top box confirms that the test device has received the execution result message.
[0115] In the above embodiment, the automated test of the set-top box can be realized by executing the test instruction in the test instruction message, encapsulating the execution result based on the data stream mode, and sending the obtained execution result message to the test device.
[0116] See also Figure 8 , Figure 8 FIG. 1 is a schematic flow chart of another set-top box testing method provided by an embodiment of the present invention. Figure 8 As shown, it may include step S601 and step S602.
[0117] Step S601: upon receiving a test end message sent by a test device, stop collecting log information, and encapsulate the currently collected log information based on a data stream to obtain a log information message.
[0118] In some embodiments, when the test device sends a test end message, the set-top box stops collecting log information, and encapsulates the currently collected log information based on the data stream method to obtain a log information message.
[0119] Exemplarily, when the set-top box receives the CFAT TestEnd message, it stops collecting log information and encapsulates the currently collected log information based on the data stream mode to obtain a log information message. The log information message can be represented as CFAT DevLog.
[0120] Step S602: Send a log information message to the test device.
[0121] Exemplarily, after obtaining the log information message, the set-top box may send the log information message to the test device based on the physical link between the set-top box and the test device.
[0122] In the above embodiment, by packaging the currently collected log information and sending it to the test device at the end of the test, the test device can obtain the log information of the set-top box during the entire automated test process, which can be used for subsequent analysis and improvement of the automated test.
[0123] See also Fig. 9 , Fig. 9 FIG. 1 is a schematic diagram of a set-top box testing method provided by an embodiment of the present invention. Fig. 9 As shown, the set-top box is turned on, the test equipment establishes a physical link connection with the set-top box, and starts to perform automated testing on the set-top box. In the discovery phase, when the set-top box receives the CFAT Discover message broadcast by the test equipment, it sends a control status message CFAT AvaiDev to the test equipment to prepare for automated testing.
[0124] During the test phase, when the set-top box receives the test command message CFAT TestCmd sent by the test device, it sends a reply message CFAT Reply to the test device, executes the test command in the test command message CFAT TestCmd, generates an execution result message CFAT TestResult, and sends the execution result message CFAT TestResult to the test device. When the test device receives the execution result message CFAT TestResult, it sends a reply message CFAT Reply to the set-top box. In addition, during the test phase, the set-top box can also generate a device status message CFATDevStatus according to the network connection status, and send a device status message CFAT DevStatus to the test device. When the test device receives the device status message CFAT DevStatus, it sends a reply message CFAT Reply to the set-top box.
[0125] In the end stage, when the set-top box receives the test end message CFAT TestEnd sent by the test device, it stops collecting log information and encapsulates the currently collected log information based on the data stream mode to obtain the log information message CFAT DevLog. Then, the set-top box sends the log information message CFAT DevLog to the test device.
[0126] A computer-readable storage medium is also provided in an embodiment of the present invention. The computer-readable storage medium stores a computer program. The computer program includes program instructions. The processor executes the above program instructions to implement any set-top box testing method provided in an embodiment of the present invention.
[0127] For example, the program is loaded by the processor and may execute the following steps:
[0128] During the test of the target set-top box, the test instruction message corresponding to the test case is broadcast to the target set-top box, and the test equipment establishes a physical link connection with the target set-top box based on the user datagram protocol; if the device status message sent by the target set-top box is received, it is determined that the target set-top box is normally connected to the test equipment, and the test result corresponding to the test case is determined according to the execution result message returned by the target set-top box based on the test instruction message; if the device status message sent by the target set-top box is not received within a preset time, it is determined that the target set-top box is abnormally disconnected from the test equipment, and the test result corresponding to the test case is determined to be a test failure.
[0129] For another example, when the program is loaded by the processor, the following steps may be executed:
[0130] When receiving the test instruction message sent by the test device, the network connection status of the set-top box is obtained; a device status message is generated according to the network connection status, and the device status message is sent to the test device.
[0131] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0132] In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a storable medium, and the storage medium may include a computer storage medium (or a non-temporary medium) and a communication medium (or a temporary medium). As known to those of ordinary skill in the art, the term storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0133] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the present invention is not limited thereby. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention shall be within the scope of the present invention.
Claims
1. A method for testing a set-top box, applied to a test device, the method comprising: During the test of the target set-top box, a test instruction message corresponding to the test case to be tested is broadcasted to the target set-top box, and the test device establishes a physical link connection with the target set-top box based on the user datagram protocol; If a device status message sent by the target set-top box is received, it is determined that the target set-top box is normally connected to the test device, and a test result corresponding to the test case is determined according to an execution result message returned by the target set-top box based on the test instruction message; If the device status message sent by the target set-top box is not received within the preset time, it is determined that the target set-top box is abnormally disconnected from the test device, and the test result corresponding to the test case is determined to be a test failure.
2. The method for testing a set-top box according to claim 1, characterized in that: The method further comprises: Broadcast automated test request messages through the preset port; The first set-top box that returns an idle state message according to the automated test request message is determined as the target set-top box.
3. The method for testing a set-top box according to claim 1, characterized in that: The method further comprises: If it is confirmed that the target set-top box has completed executing the test instruction messages corresponding to all the test cases to be tested, a test end message is sent to the target set-top box to indicate that the current test of the target set-top box is finished, and the currently collected log information is sent to the test device.
4. The method for testing a set-top box according to any one of claims 1 to 3, characterized in that: The device status message includes the network connection status of the target set-top box.
5. A method for testing a set-top box, applied to a set-top box, wherein the set-top box establishes a physical link connection with a test device based on a user datagram protocol, and the method comprises: Upon receiving the test instruction message sent by the test device, obtaining the network connection status of the set-top box; A device status message is generated according to the network connection status, and the device status message is sent to the test device.
6. The method for testing a set-top box according to claim 5, characterized in that: After receiving the test instruction message sent by the test device, the method further includes: Execute the test instruction in the test instruction message to obtain the execution result corresponding to the test instruction; Based on the data stream mode, the execution result is encapsulated to obtain an execution result message; Send the execution result message to the test device.
7. The method for testing a set-top box according to claim 5, characterized in that: The method further comprises: When receiving the test end message sent by the test device, stop collecting log information, and encapsulate the currently collected log information based on the data stream mode to obtain a log information message; Send the log information message to the test device.
8. A testing device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor is used to execute the program and implement the set-top box testing method according to any one of claims 1 to 4 when executing the program.
9. A set-top box, characterized in that: including a processor and a memory; The memory is used to store programs; The processor is used to execute the program and implement the set-top box testing method according to any one of claims 5 to 7 when executing the program.
10. A computer-readable storage medium for readable storage, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the set-top box testing method as described in any one of claims 1 to 4 or the set-top box testing method as described in any one of claims 5 to 7.
