Set-top box testing method, test device, 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 efficiency of the test are improved.
Patent Information
- Application Number
- PCT/CN2024/100017
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-26
- Filing Date
- 2024-06-19
- Publication Date
- 2025-01-02
AI Technical Summary
During the automated testing of set-top boxes, the ADB tool will disconnect when the set-top box is disconnected from the test device, causing the test device 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 is determined by broadcasting test command messages to the set-top box and receiving device status messages. If the device status message is not received within the preset time, it is determined to be abnormally disconnected. , ensure the accuracy of the test results.
It improves the accuracy of set-top box testing, can perform test cases with network disconnection function normally, avoids misjudgment, and enhances the connection stability between the test equipment and the set-top box.
Smart Images

Figure CN2024100017_02012025_PF_FP_ABST
Abstract
Description
Set-top box testing method, testing equipment, set-top box and readable storage medium
[0001] Cross-references
[0002] The present invention claims priority to a Chinese patent application filed with the Patent Office of China on June 26, 2023, with application number 202310764854.6 and invention name “Testing method, testing equipment, set-top box and readable storage medium for set-top box”. The entire contents of the application are incorporated herein by reference. Technical Field
[0003] 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
[0004] When testing a set-top box using a test device, the device typically uses the ADB (Android Debug Bridge) tool to connect to the set-top box via a wired network. When the set-top box runs automated test cases that require a network outage, the box loses its internet connection, briefly disconnecting from the test device. When the set-top box is disconnected from the test device, the ADB tool also disconnects, causing the test device to conclude that the automated test has failed due to the set-top box's disconnection. This can lead to misjudgments and reduce the accuracy of the set-top box test.
[0005] Therefore, in the process of set-top box testing, how to test accurately becomes an issue that needs to be solved urgently.
[0006] Summary of the Invention
[0007] The present application provides a set-top box testing method, testing equipment, set-top box and 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, causing the testing equipment to determine that the current automated test has failed due to the loss of connection with the set-top box, resulting in misjudgment.
[0008] In a first aspect, the present application provides a method for testing a set-top box, the method comprising: during a test of a target set-top box, broadcasting a test instruction message corresponding to a test case to be tested to the target set-top box, and the test device establishing 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, determining that the target set-top box is normally connected to the test device, and determining a test result corresponding to the test case to be tested based on 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, determining that the target set-top box is abnormally disconnected from the test device, and determining that the test result corresponding to the test case to be tested is a test failure.
[0009] In a second aspect, the present application provides a method for testing a set-top box, the method comprising: obtaining the network connection status of the set-top box when receiving a test instruction message sent by the test device; generating a device status message according to the network connection status, and sending the device status message to the test device.
[0010] In a third aspect, the present application also provides a testing device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement a testing method for a set-top box corresponding to the above-mentioned testing device when executing the computer program.
[0011] In a fourth aspect, the present application also provides a set-top box, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned set-top box testing method when executing the computer program.
[0012] In a fifth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the set-top box testing method as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0014] FIG1 is a schematic structural diagram of a test device provided in an embodiment of the present application;
[0015] FIG2 is a schematic structural diagram of a set-top box provided in an embodiment of the present application;
[0016] FIG3 is a schematic flow chart of a set-top box testing method provided in an embodiment of the present application;
[0017] FIG4 is a schematic flow chart of sub-steps for determining a target set-top box according to an embodiment of the present application;
[0018] FIG5 is a schematic flow chart of another set-top box testing method provided in an embodiment of the present application;
[0019] FIG6 is a schematic flow chart of another set-top box testing method provided in an embodiment of the present application;
[0020] FIG7 is a schematic flow chart of another set-top box testing method provided in an embodiment of the present application;
[0021] FIG8 is a schematic flow chart of another set-top box testing method provided in an embodiment of the present application;
[0022] FIG9 is a schematic diagram of a set-top box testing method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0024] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0025] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0026] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0027] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0028] In the subsequent description, suffixes such as "module," "component," or "unit" used to represent elements are used only to facilitate the description of the present application and have no specific meaning. Therefore, "module," "component," or "unit" may be used interchangeably.
[0029] Embodiments of the present application provide a set-top box testing method, testing device, set-top box, and computer-readable storage medium. The set-top box testing method can be applied to a test device or set-top box. By using the User Datagram Protocol (UDP) instead of the ADB tool as a communication tool between the test device and the set-top box, a keep-alive mechanism is provided during the set-top box testing process. The method can determine whether the set-top box and the test device are properly connected based on whether a device status message sent by the set-top box is received. Even test cases involving network disconnection can be executed normally, resolving the problem in related technologies of misjudging the set-top box as disconnected due to a short-term network disconnection, thereby improving the accuracy of set-top box testing.
[0030] 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.
[0031] It should be noted that the set-top box testing method provided in the embodiments of the present application can be executed by a test device or a set-top box. The following description will be made with the test device and the set-top box as the execution entities respectively.
[0032] Please refer to Figure 1, which is a schematic diagram of the structure of a test device 10 provided in an embodiment of the present application. 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.
[0033] 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 may include program instructions that, when executed, may cause the processor to execute the test method corresponding to the test device described in any embodiment.
[0034] The processor 1001 is used to provide computing and control capabilities to support the operation of the entire testing device 10 .
[0035] 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 programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or any conventional processor.
[0036] In one embodiment, the processor 1001 is configured to run a computer program stored in the memory 1002 to implement the following steps:
[0037] 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 the 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.
[0038] In one embodiment, the processor 1001 is further configured to implement:
[0039] An automated test request message is broadcasted through a preset port; and a set-top box that first returns an idle state message according to the automated test request message is determined as a target set-top box.
[0040] In one embodiment, the processor 1001 is further configured to implement:
[0041] 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 completed, and the currently collected log information is sent to the test device.
[0042] Please refer to Figure 2, which is a schematic diagram of the structure of a set-top box 20 provided in an embodiment of the present application. 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.
[0043] 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 may include program instructions that, when executed, may cause the processor to execute the test method corresponding to the set-top box described in any embodiment.
[0044] The processor 2001 is used to provide computing and control capabilities to support the operation of the entire set-top box 20 .
[0045] 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 programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or any conventional processor.
[0046] In one embodiment, the processor 2001 is configured to run a computer program stored in the memory 2002 to implement the following steps:
[0047] 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.
[0048] In one embodiment, after receiving a test instruction message sent by a test device, the processor 2001 is further configured to:
[0049] 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.
[0050] In one embodiment, the processor 2001 is further configured to implement:
[0051] When a test end message sent by the test device is received, the collection of log information is stopped, and the currently collected log information is encapsulated based on the data stream method to obtain a log information message; and the log information message is sent to the test device.
[0052] Below in conjunction with accompanying drawing, some embodiments of the present application are described in detail.Under the situation that does not conflict, the features among the following embodiment and embodiment can be combined with each other.Referring to Fig. 3, Fig. 3 is the schematic flow chart of the method for testing of a kind of set-top box that the embodiment of the present application provides.As shown in Figure 3, the method for testing of set-top box comprises step S101 to step S103.
[0053] Step S101: During the test of a target set-top box, a test instruction message corresponding to a test case to be tested 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 the User Datagram Protocol.
[0054] It should be noted that the set-top box testing method provided in the embodiment of the present application 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 the device status message sent by the set-top box is received. Even test cases involving network disconnection functions can be executed normally, which solves the problem of related technologies that the set-top box is misjudged as disconnected due to a short period of network disconnection, and can improve the accuracy of set-top box testing.
[0055] 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, wherein the test device establishes a physical link connection with the target set-top box based on the User Datagram Protocol (UDP).
[0056] Exemplarily, the testing device may encapsulate the test instructions corresponding to the test case into a message to obtain a test instruction message.
[0057] It's important to note that the UDP protocol provides a method for devices without a network connection to communicate with connected devices as long as the physical link remains connected. A physical link refers to a communication link established over a wired connection, such as a network cable or other data cable.
[0058] In an embodiment of the present application, 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 disconnect, 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.
[0059] For example, during the test of a target set-top box, the test device may broadcast test command messages corresponding to the test cases to the target set-top box in sequence based on the physical link. For example, when the test case is a startup case, the test device may send a startup command message to the target set-top box. For another example, when the test case is a network disconnection case, the test device may send a network disconnection command message to the target set-top box.
[0060] In some embodiments, when multiple set-top boxes need to be automated tested, the test equipment can establish a physical link connection with the multiple set-top boxes through a switch. Exemplarily, the test equipment can be connected to the switch via a network cable or other communication data, and the multiple set-top boxes can be connected to the switch via a network cable or other communication data.
[0061] It should be noted that in the related art, the ABD tool needs to connect the set-top box and the test equipment via 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 automation 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 via a USB data cable, the test equipment can identify the set-top box through the ABD tool, and does not need to communicate and connect through the IP (Internet Protocol, Internet Protocol) address of the set-top box. And the embodiment of the present application, by increasing a switch, can realize that the test equipment and multiple set-top boxes establish physical link connections at the same time, thereby solving the problem of low efficiency of automated testing due to a limited number of USB interfaces, can greatly improve the efficiency of set-top box testing, can also avoid opening the USB interface function, and improve the security of the set-top box.
[0062] The above embodiment adopts the User Datagram Protocol instead of the ADB tool as the tool for communication between the test device and the set-top box. This not only 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 judge that the current automated test has failed due to the loss of connection with the set-top box, resulting in misjudgment, but also solves the problem in the related art that the ABD tool 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.
[0063] 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.
[0064] In some embodiments, after broadcasting a test instruction message corresponding to the test case to be tested to a target set-top box, if a device status message is received from the target set-top box, it is determined that the target set-top box is properly connected to the test device, and the test result corresponding to the test case to be tested is determined based on an execution result message returned by the target set-top box based on the test instruction message. The device status message includes the network connection status of the target set-top box.
[0065] It should be noted that, in the embodiment of the present application, the target set-top box, after receiving the test instruction message, can parse the test instruction message, and execute the test instruction that parses and obtains.Then, the corresponding execution result is encapsulated in the UDP message in a data stream mode, obtains the execution result message, and the execution result message is sent to the test equipment.After starting the test, the target set-top box can be regularly or in real time detected the network connection status of the target set-top box, and the network connection status and log information are encapsulated into the UDP message, obtain the device status message, and then the device status message is sent to the test equipment.Wherein, the network connection status refers to the network status that the target set-top box connects the Internet.Test result can be determined according to actual conditions, and is not limited at this.
[0066] For example, 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.
[0067] 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, which can provide a keep-alive mechanism during the test of the set-top box. It can be determined whether the set-top box and the test device are normally connected 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.
[0068] 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.
[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 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.
[0070] The preset time can be set according to actual conditions, and the specific value is not limited here.
[0071] For example, when the preset time is 5 seconds, during the test of the target set-top box, a timer can be used to count the time. If no device status message sent by the target set-top box is received every 5 seconds, it can be determined that the target set-top box is abnormally disconnected from the test device. In this case, the test result corresponding to the to-be-tested case can be determined as a test failure, and the test results of the untested case can be set as test failure.
[0072] In the above embodiment, by failing to receive 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.
[0073] It should be noted that, in the embodiment of the present application, before performing the automated test, a target set-top box may be determined from a plurality of set-top boxes.
[0074] Please refer to Figure 4, which is a schematic flow chart of sub-steps of determining a target set-top box provided by an embodiment of the present application. As shown in Figure 4, the process may include step S201 and step S202.
[0075] Step S201: broadcast an automated test request message through a preset port.
[0076] 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 set-top boxes that are currently available for automated testing.
[0077] 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.
[0078] In an embodiment of the present application, the set-top box can monitor a port and, upon receiving a CFAT Discover message, can reply an idle state message to the test device via the port. The idle state message can be represented as CFAT AvaiDev. After replying the CFAT AvaiDev message, the set-top box can begin collecting log data and prepare for automated testing.
[0079] Exemplarily, the test device may determine the first set-top box that returns an idle state message in response 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 to return an idle state message in response 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 to return an idle state message in response to the automated test request message, set-top box B is determined as the candidate set-top box. After set-top box A completes 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.
[0080] Of course, in the embodiment of the present application, the test device can simultaneously perform automated testing on multiple set-top boxes. Specifically, the test device can simultaneously establish physical links with multiple set-top boxes via a switch. For example, the test device can perform automated testing on set-top boxes A, B, and C that return idle status messages in response to the automated test request message, thereby improving test efficiency.
[0081] 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. This can realize automated testing of idle or available set-top boxes and avoid automated testing of unavailable set-top boxes that may cause test failure.
[0082] Please refer to Figure 5, which is a schematic flow chart of another set-top box testing method provided by an embodiment of the present application. As shown in Figure 5, the method may include steps S301 to S303.
[0083] Step S301: During the test of a target set-top box, a test instruction message corresponding to a test case to be tested 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 the User Datagram Protocol.
[0084] 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.
[0085] 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.
[0086] 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 completed, and the currently collected log information is sent to the test device.
[0087] Exemplarily, after waiting for the target set-top box to complete executing the test instructions corresponding to all 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 has ended and instruct the target set-top box to stop collecting log information. The test end message can be represented by a CFAT TestEnd message.
[0088] 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.
[0089] It should be noted that, target set-top box, when receiving the CFAT TestEnd message, stops collecting log information, and encapsulates the log information of current collection based on the data stream mode, obtains the log information message.Then, log information message takes place to test equipment, and terminates and is connected with the current communication of test equipment.Wherein, the log information message can be expressed as the CFAT DevLog message.Test equipment, after receiving the log information message that target set-top box sends, can decrypt and store the log information message.
[0090] In the above embodiment, after 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.
[0091] Please refer to Figure 6, which is a schematic flow chart of another set-top box testing method provided by an embodiment of the present application. As shown in Figure 6, the method may include step S401 and step S402.
[0092] Step S401: upon receiving a test instruction message sent by a test device, obtaining the network connection status of the set-top box.
[0093] It should be noted that in the application embodiment, 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 based on the network connection status and send it to the test device.
[0094] In some embodiments, upon receiving a test command message sent by the test device, the set-top box obtains the network connection status of the set-top box, wherein the test command message may be expressed as CFAT TestCmd.
[0095] For example, the network connection status of the set-top box can be detected every preset time period, wherein the preset time period can be set according to actual conditions, and the specific value is not limited here.
[0096] Step S402: Generate a device status message according to the network connection status, and send the device status message to the test device.
[0097] For example, after obtaining the network connection status of the set-top box, a device status message may be generated according to the network connection status and sent to the test device, wherein the device status message may be expressed as CFAT DevStatus.
[0098] In some embodiments, after receiving the test instruction message sent by the test device, the set-top box may return a response message to the test device to confirm that the set-top box has received the test instruction message. The response message may be expressed as CFAT Reply.
[0099] In some embodiments, when the set-top box generates a device status message according to the network connection status, it may also encapsulate the network connection status and log information into a UDP message in a data stream manner to obtain the device status message.
[0100] 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 connection, 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.
[0101] Please refer to Figure 7, which is a schematic flow chart of another set-top box testing method provided by an embodiment of the present application. As shown in Figure 7, the method may include steps S501 to S503.
[0102] Step S501: execute the test instruction in the test instruction message to obtain the execution result corresponding to the test instruction.
[0103] For example, after receiving the test instruction message, the set-top box can parse the test instruction message to obtain the corresponding test instruction. Then, it can execute the test instruction to obtain the corresponding execution result. The specific process of executing the test instruction is not limited here.
[0104] Step S502: Encapsulate the execution result based on the data stream method to obtain an execution result message.
[0105] Exemplarily, after obtaining the execution result corresponding to the test instruction, the execution result may be encapsulated based on a data stream manner to obtain an execution result message.
[0106] 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.
[0107] Step S503: Send an execution result message to the test device.
[0108] 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.
[0109] 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.
[0110] In the above embodiment, automated testing of the set-top box can be achieved by executing the test instructions in the test instruction message, encapsulating the execution result based on the data stream method, and sending the obtained execution result message to the test device.
[0111] Please refer to Figure 8, which is a schematic flow chart of another set-top box testing method provided by an embodiment of the present application. As shown in Figure 8, the method may include step S601 and step S602.
[0112] 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.
[0113] 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 a data stream to obtain a log information message.
[0114] For example, upon receiving the CFAT TestEnd message, the set-top box stops collecting log information and encapsulates the currently collected log information in a data stream manner to obtain a log information message, which can be represented as CFAT DevLog.
[0115] Step S602: Send a log information message to the test device.
[0116] Illustratively, 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.
[0117] 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.
[0118] Please refer to Figure 9, which is a schematic diagram of a set-top box testing method provided by an embodiment of the present application. As shown in Figure 9, the set-top box is turned on, and the test equipment establishes a physical link connection with the set-top box, and begins automated testing of the set-top box. During the discovery phase, upon receiving the CFAT Discover message broadcast by the test equipment, the set-top box sends a control status message CFAT AvaiDev to the test equipment to prepare for automated testing.
[0119] During the test phase, upon receiving the test command message CFAT TestCmd from the test device, the set-top box 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. Upon receiving the execution result message CFAT TestResult, the test device sends a reply message CFAT Reply to the set-top box. Furthermore, during the test phase, the set-top box can also generate a device status message CFAT DevStatus based on the network connection status and send the device status message CFAT DevStatus to the test device. Upon receiving the device status message CFAT DevStatus, the test device sends a reply message CFAT Reply to the set-top box.
[0120] At the end of the test, upon receiving the test end message CFAT TestEnd from the test device, the set-top box stops collecting log information and encapsulates the currently collected log information in a data stream manner to obtain a log information message CFAT DevLog. The set-top box then sends the log information message CFAT DevLog to the test device.
[0121] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, and the processor executes the above program instructions to implement any set-top box testing method provided in the embodiments of the present application.
[0122] For example, when the program is loaded by the processor, the following steps may be performed:
[0123] 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 the 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.
[0124] For another example, when the program is loaded by the processor, the following steps may be executed:
[0125] 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.
[0126] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0127] In a 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 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, which may include a computer storage medium (or non-transitory medium) and a communication medium (or 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 disks (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, as is well known to those skilled in the art, 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.
[0128] The preferred embodiments of the present application are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present application shall fall within the scope of the present application.
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, wherein: 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, wherein: 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, wherein: The device status message includes the network connection status of the target set-top box.
5. A set-top box testing method, 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; Generate a device status message according to the network connection status, and send the device status message to the test device. Device status message.
6. The method for testing a set-top box according to claim 5, wherein: 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, wherein: 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 test device, wherein: 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, wherein: 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, wherein: 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.
Citation Information
Patent Citations
STB (Set-Top-Box) network detection method
CN109560997A
Log debugging method, device and system, terminal equipment and set top box
CN112261478A
Set top box infrared function test method, system, device and medium
CN116074492A
Set top box wireless hardware test method, system and device and medium
CN116074493A
System and Method for Troubleshooting a Set Top Box
US20090064251A1