Device testing method and apparatus, electronic device, readable storage medium and program product
By sending sub-device connection commands to the target device, receiving and querying information on connected sub-devices, and comprehensively determining the device test results based on multi-dimensional information, the problem of low efficiency and insufficient reliability in device pairing testing in existing technologies is solved, and efficient and reliable multi-sub-device testing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN LUMIUNITED TECH CO LTD
- Filing Date
- 2026-04-15
- Publication Date
- 2026-07-14
AI Technical Summary
Existing device pairing testing methods are inefficient and cannot simulate scenarios where multiple devices access the device simultaneously. This results in compatibility issues and communication conflicts going undetected during the testing phase, leading to insufficient reliability of device test results.
By sending sub-device connection commands to the target device, receiving test response information, querying connected sub-device information, and comprehensively considering multi-dimensional information, the device test results are determined, enabling efficient and standardized batch testing of multiple sub-devices.
This improved the efficiency and consistency of equipment testing results, enhanced the reliability of equipment testing results, avoided misjudgments based on a single dimension, and ensured the accuracy of the number of sub-devices connected and identified.
Smart Images

Figure CN122395089A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things (IoT) technology, and in particular to a device testing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] With the rapid development of 5G technology, the Internet of Things (IoT) technology has also seen rapid development in the industrial sector. The IoT refers to the use of various information collection devices and technologies to collect real-time information on any object or process that needs to be monitored, connected, or interacted with, including sound, light, electricity, force, and location data. This information is then accessed through various possible networks to achieve ubiquitous connectivity between things and between things and people, thereby enabling intelligent perception, identification, and management of objects and processes. The most basic step in this process is data transmission, which requires device pairing testing.
[0003] Currently, device pairing tests mostly use a method of adding one device at a time, which is inefficient and makes it difficult to simulate the scenario of multiple devices accessing at the same time in real-world applications. This results in some potential compatibility issues and communication conflicts not being discovered during the testing phase.
[0004] Therefore, the equipment pairing test methods in related technologies suffer from insufficient reliability of equipment test results. Summary of the Invention
[0005] Therefore, it is necessary to provide a device testing method, apparatus, electronic device, computer-readable storage medium, and computer program product that can improve the reliability of device test results in response to the above-mentioned technical problems.
[0006] Firstly, this application provides a device testing method, including:
[0007] Based on the target device information and the sub-device information to be connected, a sub-device connection command is sent to the target device; the target device information refers to the device information of the target device; the sub-device information to be connected refers to the device information of several sub-devices to be connected; the sub-devices to be connected refer to the sub-devices to be connected to the target device; the sub-device connection command is used to instruct the target device to connect a corresponding number of sub-devices for testing.
[0008] In response to a test trigger operation, the system receives test response information sent by the target device; the test response information represents the response information for testing the target device and several connected sub-devices; the connected sub-devices represent the sub-devices that the target device has connected to.
[0009] Send a sub-device information query command to the target device, and receive the connected sub-device information returned by the target device; the connected sub-device information represents the device information of the plurality of connected sub-devices;
[0010] The device test results are obtained based on the test response information, the information of the sub-device to be connected, and the information of the connected sub-device.
[0011] Secondly, this application provides a device testing method, including:
[0012] Receive sub-device connection instructions sent by the test terminal; the sub-device connection instructions are used to instruct the target device to connect a corresponding number of sub-devices for testing;
[0013] In response to the sub-device connection command, connect to several sub-devices according to the sub-device access request;
[0014] In response to a test trigger operation, a test response message is sent to the test terminal; the test response message represents the response information for testing the target device and several connected sub-devices; the connected sub-devices refer to the sub-devices that have been connected to the target device.
[0015] The system receives a sub-device information query command from the test terminal and sends connected sub-device information to the test terminal; the connected sub-device information represents the device information of the plurality of connected sub-devices.
[0016] The test terminal is used to obtain device test results based on the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices; the information of the sub-devices to be connected represents the device information of several sub-devices to be connected; the sub-devices to be connected represent the sub-devices to be connected to the target device.
[0017] Thirdly, this application provides a device testing system, comprising:
[0018] The test terminal, the target device, and several sub-devices to be connected; the sub-devices to be connected refer to the sub-devices that are to be connected to the target device.
[0019] The test terminal is used to send a sub-device connection instruction to the target device based on the target device information and the sub-device information to be connected; the target device information represents the device information of the target device; the sub-device information to be connected represents the device information of a plurality of sub-devices to be connected; the sub-device connection instruction is used to instruct the target device to connect a corresponding number of sub-devices for testing;
[0020] The target device is configured to connect to several sub-devices in response to the sub-device connection command, based on the sub-device access request.
[0021] The sub-device includes a prompting unit, which has different prompting states corresponding to different access states, wherein the access state is used to characterize the connection state between the sub-device and the target device;
[0022] The target device is configured to send test response information to the test terminal in response to a test trigger operation; the test response information represents the response information for testing the target device and several connected sub-devices; the connected sub-devices represent the sub-devices that the target device has connected to.
[0023] The test terminal is used to send a sub-device information query command to the target device and receive connected sub-device information returned by the target device; the connected sub-device information represents the device information of the plurality of connected sub-devices.
[0024] The test terminal is used to obtain the device test results based on the test response information, the information of the sub-device to be connected, and the information of the connected sub-device.
[0025] Fourthly, this application also provides a device testing apparatus, comprising:
[0026] The instruction sending module is used to send a sub-device connection instruction to the target device based on the target device information and the sub-device information to be connected; the target device information refers to the device information of the target device; the sub-device information to be connected refers to the device information of several sub-devices to be connected; the sub-devices to be connected refer to the sub-devices to be connected to the target device; the sub-device connection instruction is used to instruct the target device to connect a corresponding number of sub-devices for testing;
[0027] The information receiving module is used to receive test response information sent by the target device in response to a test trigger operation; the test response information represents the response information for testing the target device and several connected sub-devices; the connected sub-devices represent the sub-devices that the target device has connected to.
[0028] The information query module is used to send a sub-device information query command to the target device and receive the connected sub-device information returned by the target device; the connected sub-device information represents the device information of the plurality of connected sub-devices;
[0029] The result acquisition module is used to obtain the device test results based on the test response information, the information of the sub-device to be connected, and the information of the connected sub-device.
[0030] Fifthly, this application also provides a device testing apparatus, comprising:
[0031] The instruction receiving module is used to receive sub-device connection instructions from the test terminal; the sub-device connection instructions are used to instruct the target device to connect a corresponding number of sub-devices for testing.
[0032] A connection module is used to respond to the sub-device connection command and connect to several sub-devices according to the sub-device access request;
[0033] A response information sending module is used to send test response information to the test terminal in response to a test trigger operation; the test response information represents the response information for testing the target device and several connected sub-devices; the connected sub-devices represent the sub-devices that are connected to the target device;
[0034] The device information sending module is used to receive the sub-device information query instruction from the test terminal and send the connected sub-device information to the test terminal; the connected sub-device information represents the device information of the plurality of connected sub-devices;
[0035] The test terminal is used to obtain device test results based on the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices; the information of the sub-devices to be connected represents the device information of several sub-devices to be connected; the sub-devices to be connected represent sub-devices to be connected to the target device.
[0036] Sixthly, this application also provides an electronic device. The electronic device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, implements the steps of the method described above.
[0037] Seventhly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.
[0038] Eighthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the above-described method.
[0039] This application, based on target device information and device information of several sub-devices to be connected, issues sub-device connection instructions to the target device, instructing the target device to connect a corresponding number of sub-devices for testing. This drives the target device to simultaneously connect to multiple sub-devices, achieving efficient and standardized batch testing of multiple sub-devices. Compared to related technologies that add sub-devices one by one during pairing testing, this effectively improves testing efficiency and enhances the consistency of test results. Furthermore, after a sub-device connects to the target device, the device test results are determined by acquiring multi-dimensional information—namely, test response information sent by the target device regarding testing the target device and several connected sub-devices, device information of the connected sub-devices, and device information of the sub-devices to be connected. This multi-verification mechanism effectively improves the reliability of the device test results. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a diagram illustrating the application environment of a device testing method in one embodiment.
[0042] Figure 2 This is a flowchart illustrating a device testing method in one embodiment;
[0043] Figure 3 This is a flowchart illustrating another device testing method in one embodiment;
[0044] Figure 4 This is a flowchart illustrating a device testing method in another embodiment;
[0045] Figure 5 This is a flowchart illustrating a test method for simultaneously adding multiple sub-devices to a camera gateway, as described in another embodiment.
[0046] Figure 6 This is a schematic diagram of a device test interface on a test software in one embodiment;
[0047] Figure 7 This is a structural block diagram of a device testing apparatus in one embodiment;
[0048] Figure 8 This is a structural block diagram of a device testing apparatus in another embodiment;
[0049] Figure 9This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0051] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0052] In one embodiment, Figure 1 This can be a schematic diagram of the implementation environment involved in the device testing method. This implementation environment includes at least a user terminal 110, a smart device 130, a server 170, and network equipment. Figure 1 In this context, network devices include gateway 150 and router 190, but this is not intended to be a specific limitation.
[0053] The user terminal 110, which can also be considered as a user terminal or terminal, can deploy (or install) the client associated with the smart device 130. This user terminal 110 can be an electronic device such as a smartphone, tablet, laptop, desktop computer, smart control panel, or other device with display and control functions, and is not limited here.
[0054] The client, associated with the smart device 130, is essentially where the user registers an account and configures the smart device 130. For example, the configuration includes adding a device identifier to the smart device 130, so that when the client runs on the user terminal 110, it can provide the user with functions such as device display and device control of the smart device 130. This client can be in the form of an application or a web page. Correspondingly, the interface for displaying the device on the client can be in the form of a program window or a web page, and there is no limitation here.
[0055] Smart device 130 is deployed in gateway 150 and communicates with gateway 150 through its own configured communication module, thereby being controlled by gateway 150. It should be understood that smart device 130 generally refers to one of multiple smart devices 130. This application embodiment only uses smart device 130 as an example; that is, this application embodiment does not limit the number or type of smart devices deployed in gateway 150. In one application scenario, smart device 130 is deployed in gateway 150 by accessing it through a local area network. The process of smart device 130 accessing gateway 150 through a local area network includes: gateway 150 first establishes a local area network, and smart device 130 joins the local area network established by gateway 150 by connecting to it. This local area network includes, but is not limited to, ZIGBEE or Bluetooth. Among them, smart devices 130 can be, but are not limited to, various smart home devices (or Internet of Things devices), such as smart printers, smart fax machines, smart cameras, smart air conditioners, smart door locks, smart lights, or human body sensors, door and window sensors, temperature and humidity sensors, water immersion sensors, natural gas alarms, smoke alarms, wall switches, wall sockets, wireless switches, wireless wall sticker switches, cube controllers, curtain motors, millimeter-wave radars, etc.
[0056] The interaction between user terminal 110 and smart device 130 can be achieved through a local area network (LAN) or a wide area network (WAN). In one application scenario, user terminal 110 establishes a wired or wireless communication connection with gateway 150 via router 190, such as Wi-Fi, allowing user terminal 110 and gateway 150 to be deployed on the same LAN, thus enabling user terminal 110 to interact with smart device 130 via the LAN path. In another application scenario, user terminal 110 establishes a wired or wireless communication connection with gateway 150 via server 170, such as 2G, 3G, 4G, 5G, or Wi-Fi, allowing user terminal 110 and gateway 150 to be deployed on the same WAN, thus enabling user terminal 110 to interact with smart device 130 via the WAN path.
[0057] Among them, server 170 can also be considered as cloud, cloud platform, platform side, server side, etc. This server 170 can be a single server, a server cluster composed of multiple servers, or a cloud computing center composed of multiple servers.
[0058] In one exemplary embodiment, such as Figure 2As shown, a device testing method is provided. Taking the application of this method to an electronic device as an example, the electronic device can be a test terminal with test software deployed on it. The test software is an application that performs device pairing tests. The test terminal can be... Figure 1 The user terminal 110 in the method includes the following steps S210 to S240. Wherein:
[0059] Step S210: Based on the target device information and the sub-device information to be connected, send a sub-device connection command to the target device.
[0060] The target device can be a control device used to establish communication connections with sub-devices and manage their access. In some embodiments, the target device may have functions such as sub-device access management, data forwarding, and communication status monitoring. In practical applications, the target device includes, but is not limited to, home gateways, industrial gateways, or other intelligent control devices with gateway functions that are located close to the user side.
[0061] The target device information refers to the device information of the target device. In some embodiments, the target device information may be parameter information related to establishing a communication connection with the sub-device, and may include the target device's MAC address (Media Access Control Address) or other unique device identification information.
[0062] Here, the sub-device to be connected refers to the sub-device that needs to be connected to the target device. In practical applications, the sub-device can be a smart device, such as a door and window sensor, a temperature and humidity sensor, or a human body sensor.
[0063] The information of the sub-devices to be connected represents the device information of several sub-devices to be connected. Specifically, it may include relevant parameter information of the sub-devices used to identify several target devices to be connected, such as the SN (Serial Number) identifier of the sub-device or other unique device identifier information, as well as the quantity information of several sub-devices to be connected.
[0064] The sub-device connection command is a control command issued by the test terminal to the target device, instructing the target device to connect a certain number of sub-devices for testing. Specifically, the sub-device connection command can be used to instruct the target device to enter a batch sub-device access state, establish a communication connection with the corresponding sub-devices to be connected, and complete the pairing test.
[0065] In practice, the test terminal, test software, and target device are on the same local area network, and the test software has been started and initialized on the test terminal. After the target device and several sub-devices to be connected have completed their power-on initialization, the test terminal can perform pairing tests on the target device and the several sub-devices to be connected.
[0066] Specifically, the test terminal can obtain the target device information (target device information) and the device information of several sub-devices to be connected (sub-device information) through the test software. Based on the target device information and the sub-device information to be connected, it generates a sub-device connection command and sends it to the target device. The sub-device connection command carries the number of sub-devices to be connected, instructing the target device to connect the corresponding number of sub-devices for testing. After receiving the sub-device connection command, the target device enters the sub-device adding state, i.e., it enters pairing mode.
[0067] After the target device is in pairing mode, triggering the connection process on the sub-device to be connected allows it to switch from standby or normal operating mode to network search mode. This enables the sub-device to actively discover the dedicated access network created by the target device and initiate an access request, thus completing the batch pairing test. In practical applications, triggering the access process on the sub-device can be done manually, including but not limited to: pressing and holding the sub-device's function button for a preset duration and then releasing it, short-pressing a combination of buttons, triggering the sub-device's reset button, or initiating network configuration for the sub-device via an external triggering device.
[0068] Step S220: In response to the test trigger operation, receive the test response information sent by the target device.
[0069] Among them, the test response information represents the response information of the test performed on the target device and several connected sub-devices, which can be used to determine the communication status between the target device and several connected sub-devices.
[0070] Among them, "connected sub-devices" refers to sub-devices that have been connected to the target device, that is, sub-devices that have successfully connected to the target device among a number of sub-devices to be connected.
[0071] The test trigger operation refers to an operation performed on a connected sub-device to trigger communication feedback. After receiving the test trigger operation, assuming normal communication between the connected sub-device and the target device, the target device can receive the response information reported by the connected sub-device and forward it to the test terminal. The response information consists of responsive data generated and sent out by the connected sub-device after receiving the test trigger operation.
[0072] In practical applications, test triggering operations include, but are not limited to: short-pressing the function button of a connected sub-device, performing button triggering on a connected sub-device, or causing the sub-device to generate a communication response through external triggering methods.
[0073] Step S230: Send a sub-device information query command to the target device and receive the connected sub-device information returned by the target device.
[0074] Among them, the sub-device information query command is a control command issued by the test terminal to query the device information of connected sub-devices.
[0075] The "connected sub-device information" refers to the device information of several connected sub-devices. Specifically, the connected sub-device information may include relevant parameter information for identifying several connected sub-devices, such as the SN (Serial Number) or other unique device identification information of several connected sub-devices, as well as the quantity information of several connected sub-devices.
[0076] In practice, the test terminal can send a sub-device information query command to the target device through the test software. The target device responds to the sub-device information query command, determines the device information of several connected sub-devices, such as the SN identifier and quantity information of several connected sub-devices, and forms the connected sub-device information, which is then returned to the test terminal.
[0077] Step S240: Obtain the device test results based on the test response information, the information of the sub-device to be connected, and the information of the connected sub-device.
[0078] The device test results are derived from a combination of test response information, information on sub-devices to be connected, and information on connected sub-devices. These results serve as the final assessment of the overall test status of the target device and its sub-devices. In practical applications, the device test results can comprehensively reflect whether sub-device access was successful, whether the number of connected devices matched the requirements, and whether the communication link between the sub-devices and the target device was unobstructed, thus achieving a holistic evaluation of batch access and communication status.
[0079] In practice, the test terminal can obtain the device test results based on the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices. The test response information verifies whether communication between the target device and the connected devices is normal, while the information of the sub-devices to be connected and the information of the connected sub-devices verify whether the device information of several sub-devices to be connected matches the device information of several connected sub-devices. If communication between the target device and each connected device is normal, and the device information of several sub-devices to be connected matches the device information of several connected sub-devices, the device test result is that the target device and each sub-device to be connected have passed the test.
[0080] In the above device testing method, a sub-device connection command is sent to the target device based on the target device information and the sub-device information to be connected. The target device information represents the device information of the target device; the sub-device information to be connected represents the device information of several sub-devices to be connected; the sub-devices to be connected represent the sub-devices to be connected to the target device; the sub-device connection command instructs the target device to connect a corresponding number of sub-devices for testing; in response to a test trigger operation, test response information sent by the target device is received; the test response information represents the response information for testing the connected target device and several connected sub-devices; the connected sub-devices represent the sub-devices already connected to the target device; a sub-device information query command is sent to the target device, and the connected sub-device information returned by the target device is received; the connected sub-device information represents the device information of several connected sub-devices; the device test result is obtained based on the test response information, the sub-device information to be connected, and the connected sub-device information.
[0081] Thus, based on the target device information and the device information of several sub-devices to be connected, this application issues sub-device connection instructions to the target device, instructing the target device to connect a corresponding number of sub-devices for testing. This drives the target device to simultaneously connect to multiple sub-devices, achieving efficient and standardized batch testing of multiple sub-devices. Compared to related technologies that add sub-devices one by one during pairing testing, this effectively improves testing efficiency and enhances the consistency of test results. Furthermore, after the sub-devices connect to the target device, the device test results are determined by acquiring multi-dimensional information, namely, the test response information sent by the target device regarding testing the target device and several connected sub-devices, the device information of the several connected sub-devices, and the device information of several sub-devices to be connected. This multi-verification mechanism effectively improves the reliability of the device test results.
[0082] In some embodiments, obtaining device test results based on test response information, information on sub-devices to be connected, and information on connected sub-devices includes: obtaining communication test results based on test response information; the communication test results include communication test results between the target device and each connected sub-device; obtaining sub-device verification results based on information on sub-devices to be connected and information on connected sub-devices; and obtaining device test results based on communication test results and sub-device verification results.
[0083] The communication test results, obtained based on the test response information, are used to determine the communication link status (communication status) between the target device and the connected sub-devices. The communication test results between the target device and each connected sub-device reflect whether the communication between each connected sub-device and the target device is normal (smooth). In practical applications, each communication test result includes whether the communication between the corresponding connected sub-device and the target device is normal, or whether the communication between the corresponding connected sub-device and the target device is abnormal.
[0084] The sub-device verification result is obtained by comparing the information of the sub-device to be connected with the information of the connected sub-devices. It is used to verify whether the sub-devices successfully connected to the target device match the sub-devices to be connected, and to verify information such as the number and identifier of the sub-devices to be connected. In practical applications, the sub-device verification result includes matching information between the sub-device to be connected and the connected sub-device information (e.g., matching number of sub-devices, matching identifiers) and mismatch information between the two (e.g., mismatch in number of sub-devices, mismatch in identifiers; or matching number of sub-devices, mismatch in identifiers).
[0085] In the specific implementation, during the process of obtaining the device test results based on the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices, the test response information can represent the response information of the test performed on the target device and several connected sub-devices. It can be used to determine the communication status between the target device and several connected sub-devices. Therefore, based on the test response information, the communication test results between the target device and each connected sub-device can be obtained to determine whether the communication between each connected sub-device and the target device is normal. By comparing the information of the sub-devices to be connected and the information of the connected sub-devices, the number and identification of the sub-devices are used to verify whether the sub-devices that have successfully connected to the target device match the sub-devices to be connected, thereby outputting the sub-device verification result. In this way, by combining the communication test results and the sub-device verification results, the final judgment information for characterizing the overall test status of the target device and the sub-devices is output, which can accurately reflect whether the sub-device access is successful, whether the number of accesses matches, and whether the communication link between the sub-devices and the target device is smooth.
[0086] The technical solution of this embodiment obtains communication test results based on test response information. These results include communication test results between the target device and each connected sub-device. Sub-device verification results are obtained based on the information of the sub-device to be connected and the information of the connected sub-devices. Finally, device test results are obtained based on the communication test results between the target device and each connected sub-device, as well as the sub-device verification results obtained by comparing the information of the sub-device to be connected and the information of the connected sub-devices. Thus, the batch access status and communication status between the target device and multiple sub-devices can be comprehensively reflected based on the communication test results between the target device and each connected sub-device, and the sub-device verification results obtained by comparing the information of the sub-device to be connected and the information of the connected sub-devices.
[0087] In some embodiments, the device test result is obtained based on the communication test result and the sub-device verification result, including: if the communication test result between the target device and each connected sub-device is normal, and the sub-device verification result shows that the information of the sub-device to be connected and the information of the connected sub-device match, the device test result is obtained as the target device and each sub-device to be connected have passed the test.
[0088] In practice, during the process of obtaining the device test results based on the communication test results and the sub-device verification results, the test terminal can determine that the device test results of several sub-devices to be connected in this batch are that the target device and each sub-device to be connected have passed the test if the communication test results between the target device and each connected sub-device are normal and the sub-device verification results show that the information of the sub-device to be connected matches the information of the connected sub-device.
[0089] In practical applications, the test terminal can display the device test results through the test software. For example, if the test results of several sub-devices to be connected in this batch are that the target device and each sub-device to be connected have passed the test, the test terminal can display test pass indicators such as "PASS" or "Test passed" through the test software, indicating that this multi-sub-device pairing test (addition test) has passed.
[0090] The technical solution of this embodiment determines that the target device and each connected sub-device have passed the test when the communication test results between the target device and each connected sub-device are normal, and the sub-device verification results show that the information of the sub-device to be connected matches the information of the connected sub-devices. Thus, when the communication status and verification results of the connected sub-devices meet preset conditions, the test is deemed to have passed. This ensures that the number of connected sub-devices, their identification information, and the reliability of the communication link are all accurate, effectively avoiding misjudgments caused by a single-dimensional judgment and improving the accuracy and comprehensiveness of the target device and sub-device pairing test results.
[0091] In some embodiments, the method further includes: recording test abnormal sub-device information when the communication test result of a connected sub-device is abnormal, or when the sub-device verification result shows that the information of the sub-device to be connected and the information of the connected sub-device do not match; the test abnormal sub-device information includes the device information of the test abnormal sub-device; the test abnormal sub-device includes a connected sub-device or an unconnected sub-device whose communication test result is abnormal.
[0092] Among them, the test-abnormal sub-devices are sub-devices that failed the test, which can include connected sub-devices or unconnected sub-devices whose communication test results indicate a communication error. Unconnected sub-devices are sub-devices that did not connect to the target device. The device information of the test-abnormal sub-devices is information used to identify the relevant characteristics of the sub-devices that had an error during the test, which can include the identification information of the test-abnormal sub-devices, the type of error (such as communication error or access failure), etc.
[0093] In specific implementation, if at least one connected sub-device shows a communication anomaly during the communication test, or if the sub-device verification result shows a mismatch between the information of the sub-device to be connected and the information of the connected sub-devices (e.g., the number of devices in the information of the sub-device to be connected is inconsistent with the number of devices in the information of the connected sub-devices, or the device identification information in the information of the sub-device to be connected is not completely consistent with the device identification information of the connected sub-devices), the test terminal can record the information of the abnormal sub-devices. The abnormal sub-device information includes the device information of the abnormal sub-devices, and the abnormal sub-devices include both connected and unconnected sub-devices whose communication test results show a communication anomaly.
[0094] For example, in this test, three sub-devices are preset to be connected, identified as SN001, SN002, and SN003. After testing, sub-device SN002 experiences a communication failure, and sub-device SN003 fails to connect to the target device. Therefore, SN002 and SN003 are identified as faulty sub-devices, and their device identifiers and corresponding fault types are recorded: communication failure and connection failure, respectively. The test software interface displays failure indicators such as "FAIL" and "Test failed." Testers can place these faulty sub-devices in the defective product storage area and upload the final test data containing information on the faulty sub-devices to the management system for subsequent quality traceability and production management.
[0095] The technical solution of this embodiment records the test abnormal sub-device information when the communication test result of a connected sub-device is abnormal, or when the sub-device verification result shows that the information of the sub-device to be connected and the information of the connected sub-device do not match. The test abnormal sub-device information includes the device information of the test abnormal sub-device. The test abnormal sub-device includes the connected sub-device or the unconnected sub-device whose communication test result is abnormal.
[0096] In this way, if a communication anomaly occurs or the information of the sub-device to be connected does not match the information of the connected sub-device, the device information of the abnormal sub-device is recorded to achieve accurate location of the abnormal device and facilitate subsequent quality traceability and production management.
[0097] In some embodiments, the information of sub-devices to be connected includes a first number of devices and a first device identifier; the first number of devices is the number of sub-devices to be connected, and the first device identifier includes the identifier of each sub-device to be connected; the information of connected sub-devices includes a second number of devices and a second device identifier; the second number of devices is the number of connected sub-devices, and the second device identifier includes the identifier of each connected sub-device.
[0098] Based on the information of the sub-device to be connected and the information of the connected sub-devices, the sub-device verification result is obtained, including: if the number of the first device is the same as the number of the second device and the identification of the first device matches the identification of the second device, the sub-device verification result is that the information of the sub-device to be connected and the information of the connected sub-devices match.
[0099] The first device quantity refers to the number of sub-devices to be connected. For example, if the number of sub-devices to be connected to the target device is 5, then the first device quantity is 5.
[0100] The first device identifier includes the identifiers (device identifiers) of each sub-device to be connected. Taking the device identifier as an SN identifier as an example, if the SN identifiers of the above 5 sub-devices to be connected are SN001, SN002, SN003, SN004 and SN005 respectively, then the first device identifier may include SN001, SN002, SN003, SN004 and SN005.
[0101] The second device count refers to the number of connected sub-devices. For example, if the target device has 5 connected sub-devices, then the second device count is 5. If the target device has 4 connected sub-devices, then the second device count is 4.
[0102] The second device identifier includes the identifiers (device identifiers) of each connected sub-device. Taking the SN identifier as an example, if the SN identifiers of the five connected sub-devices are SN001, SN002, SN003, SN004, and SN005, then the second device identifier can include SN001, SN002, SN003, SN004, and SN005. Similarly, if the SN identifiers of the four connected sub-devices are SN001, SN002, SN004, and SN005, then the second device identifier can include SN001, SN002, SN004, and SN005.
[0103] In practice, during the process of obtaining the sub-device verification result based on the information of the sub-device to be connected and the information of the connected sub-devices, the test terminal can match the first number of devices in the information of the sub-device to be connected with the second number of devices in the information of the connected sub-devices, and match the first device identifier in the information of the sub-device to be connected with the second device identifier in the information of the connected sub-devices. If the first number of devices matches the second number of devices and the first device identifier matches the second device identifier, the sub-device verification result is a match between the information of the sub-device to be connected and the information of the connected sub-devices.
[0104] For example, if the number of the first device and the number of the second device are both 5, and the identifiers of the first device and the second device are both SN001, SN002, SN003, SN004 and SN005, then it means that the number of the first device and the number of the second device are the same and the identifiers of the first device and the second device match. Therefore, the sub-device verification result is that the information of the sub-device to be connected and the information of the connected sub-device match.
[0105] If the number of the first device does not match the number of the second device and the identifiers of the first device do not match the identifiers of the second device, the sub-device verification result is that the information of the sub-device to be connected and the information of the connected sub-devices do not match. For example, if the number of the first device is 5 and the number of the second device is 4, the sub-device verification result is that the information of the sub-device to be connected and the information of the connected sub-devices do not match (specifically, the number of sub-devices does not match and the identifiers do not match). As another example, if the number of the first device is 5 and the number of the second device is 5, the identifiers of the first device include SN001, SN002, SN003, SN004 and SN005, and the identifiers of the second device include SN001, SN002, SN003, SN004 and SN006, the sub-device verification result is that the information of the sub-device to be connected and the information of the connected sub-devices do not match (specifically, the number of sub-devices matches and the identifiers do not match).
[0106] In this embodiment, the information of the sub-devices to be connected includes a first number of devices and a first device identifier; the first number of devices is the number of sub-devices to be connected, and the first device identifier includes the identifier of each sub-device to be connected; the information of the connected sub-devices includes a second number of devices and a second device identifier; the second number of devices is the number of connected sub-devices, and the second device identifier includes the identifier of each connected sub-device. When the first number of devices and the second number of devices are the same, and the first device identifier and the second device identifier match, the sub-device verification result is that the information of the sub-devices to be connected and the information of the connected sub-devices match.
[0107] In this way, during the comparison of the information of the sub-device to be connected and the information of the connected sub-devices, the device quantity information and device identification information in the information of the sub-device to be connected and the information of the connected sub-devices are matched. The sub-device verification is accurately completed from the two dimensions of quantity consistency and identification consistency, effectively avoiding the problems of missed testing, incorrect testing or device confusion, and improving the accuracy and rigor of pairing test.
[0108] In some embodiments, obtaining a communication test result based on the test response information includes: determining whether the communication test result of the connected sub-device is normal based on whether the test response information contains response information of the connected sub-device; wherein the response information is sent from the connected sub-device to the target device after the test trigger operation is applied to the connected sub-device.
[0109] Specifically, the response information can be response data generated and sent out by the connected sub-device after being triggered by the test. It is used to provide feedback on the communication status of the connected sub-device and serve as the basis for judging whether the communication link between the connected sub-device and the target device is smooth. It may include, but is not limited to, communication messages, response data packets, device status frames, etc. uploaded by the connected sub-device, and may carry sub-device identifiers, communication confirmation fields, etc.
[0110] In practice, after the test trigger operation is applied to the connected sub-device, the test terminal can collect the response information sent by the connected sub-device to the target device. The target device then reports this response information to form test response information. The test terminal can parse the test response information to determine whether it contains the response information of the corresponding connected sub-device, thereby determining whether the communication test result of the connected sub-device is normal.
[0111] For example, if a short press of a function button is performed on each of the three connected sub-devices that have successfully connected to the target device, and the test response information uploaded by the target device to the test terminal contains the response messages corresponding to each of the three connected sub-devices, then the communication test result of each connected sub-device is determined to be normal; if the test response information does not contain the response message corresponding to any of the connected sub-devices, then the communication test result of that connected sub-device is determined to be abnormal.
[0112] The technical solution of this embodiment determines whether the communication test result of the connected sub-devices is normal by judging whether the test response information contains response information from the connected sub-devices. The response information is sent from the connected sub-devices to the target device after a test trigger operation is performed on them. Thus, after the test trigger operation is performed on the connected sub-devices, by parsing the test response information representing the test between the target device and several connected sub-devices, it is determined whether the test response information contains response information from the connected sub-devices. Based on whether response information from the connected sub-devices is received, it can be accurately determined whether the communication between the connected sub-devices and the target device is normal.
[0113] In some embodiments, this application can automatically trigger a connection retry process for sub-devices that fail to connect, i.e., unconnected sub-devices. Specifically, the test terminal can send a command to the target device to query whether the sub-device to be connected has successfully connected. If an unconnected sub-device exists, the target device is triggered to execute a connection retry process for the unconnected sub-device.
[0114] In some embodiments, after the step of sending a sub-device connection instruction to the target device, the method further includes: receiving sub-device connection result information sent by the target device; if the sub-device connection result information indicates that there is an unconnected sub-device, then triggering the target device to execute a connection retry process for the unconnected sub-device until the connection retry stop condition is met.
[0115] Among them, the sub-device connection result information is used to characterize the connection result of the sub-device to be connected, and to indicate whether the sub-device to be connected has successfully connected to the target device.
[0116] The connection retry process is an access pairing process that is re-executed for unconnected sub-devices that have failed to connect. It is used to improve the success rate of sub-device access, reduce test failures caused by occasional anomalies, and improve the level of test automation. It includes steps such as the target device re-issuing the instruction to allow the addition of sub-devices to enter the pairing waiting state (in pairing mode), re-triggering the network search mechanism of unconnected sub-devices to initiate access requests, and re-executing access verification.
[0117] Among them, the connection retry stop condition refers to the preset judgment condition used to control the termination of the connection retry process, avoid unlimited connection retries, improve testing efficiency and locate abnormal sub-devices in a timely manner while ensuring access success rate.
[0118] In the specific implementation, after the test terminal sends the sub-device connection command to the target device, the test terminal can receive sub-device connection result information returned by the target device. This sub-device connection result information can indicate whether each sub-device to be connected is connected to the target device. Specifically, the test terminal can send a query command to the target device; if no sub-device is successfully connected within a preset time period, the test terminal determines that the sub-device is not connected. If the sub-device connection result information indicates that there is an unconnected sub-device, the test terminal triggers the target device to execute a connection retry process for that unconnected sub-device until a preset connection retry stop condition is met.
[0119] For example, after the test terminal sends a sub-device connection command to the target device indicating that there are three sub-devices waiting to be connected, it retrieves the sub-device connection result information by sending a query command to the target device. Upon receiving the sub-device connection command, the target device enters the sub-device add state, i.e., pairing mode. If, within a preset time period (e.g., 30 seconds, the specific value can be set according to actual needs), it determines that a sub-device is not connected, the target device sends a sub-device connection result information back to the test terminal indicating the existence of an unconnected sub-device. The test terminal then triggers the target device to execute a connection retry procedure for the unconnected sub-device. The target device resends the allow add command and enters the pairing waiting state, re-triggering the network search mechanism for the unconnected sub-device to initiate an access request again, until the preset connection retry stop condition is met.
[0120] The technical solution of this embodiment automatically identifies unconnected sub-devices by obtaining sub-device connection result information and triggers the target device to perform a connection retry process for the unconnected sub-devices. Combined with preset retry stop conditions, it can reduce manual intervention, reduce human operation errors, effectively solve occasional access anomalies, improve the success rate of sub-device access, avoid invalid repeated tests, and improve the automation and testing efficiency of batch pairing tests between the target device and sub-devices.
[0121] In some embodiments, the connection retry stop condition may include sub-device connection result information indicating that the target device has connected to a corresponding number of sub-devices, or the number of times the connection retry process for unconnected sub-devices has been executed has reached a preset threshold.
[0122] In practice, the connection retry stopping conditions may include sub-device connection result information indicating that the target device has connected to a certain number of sub-devices, or the number of times the connection retry process for unconnected sub-devices has been executed has reached a preset threshold. During testing, after the test terminal detects the existence of unconnected sub-devices and triggers the connection retry process, it determines in real time whether the above stopping conditions are met. If any condition is met, the connection retry process is terminated.
[0123] For example, this test requires the target device to connect to 3 sub-devices, with a preset threshold of 3 attempts. If the target device successfully connects to all 3 sub-devices during the connection retry process, the test terminal confirms, based on the sub-device connection result information returned by the gateway, that the number of connected sub-devices matches the number of sub-devices to be connected, and then directly stops the connection retry process. If one of the sub-devices still fails to connect to the target device after 3 connection retries, meaning the number of times the connection retry process has been executed has reached the preset threshold, the test terminal also terminates the connection retry process for that sub-device and marks it as an abnormal connection device.
[0124] The technical solution of this embodiment sets the connection retry stop condition to the target device having connected to the corresponding number of sub-devices or the number of retries reaching a preset threshold. This can not only terminate the retry in a timely manner after the sub-device has completed normal access to improve test efficiency, but also stop invalid attempts after the retry limit is exceeded. This balances the integrity and process controllability of batch access testing, and effectively improves test stability and execution efficiency.
[0125] In some other embodiments, such as Figure 3 As shown, a device testing method is provided. Taking the application of this method to an electronic device as an example, the electronic device can specifically be a target device with gateway functionality. The method includes the following steps S310 to S340. Wherein:
[0126] Step S310: Receive the sub-device connection command from the test terminal.
[0127] The sub-device connection command is used to instruct the target device to connect a certain number of sub-devices for testing. Specifically, the sub-device connection command is a control command issued by the test terminal to the target device, instructing the target device to connect a certain number of sub-devices for testing.
[0128] In practice, the test terminal can obtain the target device information (target device information) and the device information of several sub-devices to be connected (sub-device information) through the test software. Based on the target device information and the sub-device information to be connected, a sub-device connection command is generated and sent to the target device. The sub-device connection command carries the number of sub-devices to be connected, instructing the target device to connect the corresponding number of sub-devices for testing. After receiving the sub-device connection command, the target device enters the sub-device adding state, i.e., enters pairing mode.
[0129] Step S320: In response to the sub-device connection command, connect to several sub-devices according to the sub-device access request.
[0130] Among them, the sub-device access request is a request type of information initiated by the sub-device to the target device to request the establishment of a connection with the target device.
[0131] In practice, after the target device is in pairing mode, triggering the sub-device to execute the connection process (such as performing a button trigger operation on the sub-device) allows the sub-device to switch to network search mode. This enables the sub-device to actively discover the dedicated access network created by the target device and initiate a sub-device access request. Upon receiving the sub-device access request, the target device can connect to the sub-device.
[0132] Step S330: In response to the test trigger operation, send test response information to the test terminal.
[0133] The test response information refers to the response information obtained from testing the target device and several connected sub-devices. The connected sub-devices refer to the sub-devices that are connected to the target device.
[0134] The test trigger operation refers to an operation performed on a connected sub-device to trigger communication feedback. In some embodiments, after receiving the test trigger operation, if communication between the connected sub-device and the target device is normal, the target device can receive the response information reported by the connected sub-device and forward it to the test terminal. The response information is a response-type data information generated and sent out by the connected sub-device after receiving the test trigger operation.
[0135] Step S340: Receive the sub-device information query command from the test terminal and send the connected sub-device information to the test terminal.
[0136] Among them, the connected sub-device information represents the device information of several connected sub-devices.
[0137] The test terminal is used to obtain the device test results based on the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices; the information of the sub-devices to be connected represents the device information of several sub-devices to be connected; the sub-devices to be connected represent the sub-devices to be connected to the target device.
[0138] Among them, the sub-device information query command is a control command issued by the test terminal to query the device information of connected sub-devices.
[0139] In practical implementation, the test terminal can send a sub-device information query command to the target device via test software. The target device responds to the query command, determining the device information of several connected sub-devices, such as the number of SN identifiers of these connected sub-devices, forming the connected sub-device information, and returns this information to the test terminal. Thus, the test terminal can obtain the device test results based on the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices. The device test results are a comprehensive assessment of the overall test status of the target device and its sub-devices, derived from the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices. In practical applications, the device test results can comprehensively reflect whether sub-device access was successful, whether the number of connected devices matched, and whether the communication link between the sub-devices and the target device was smooth, achieving a comprehensive evaluation of batch access and communication status.
[0140] In the above device testing method, the following steps are taken: receiving a sub-device connection instruction from a test terminal; the sub-device connection instruction instructs the target device to connect a corresponding number of sub-devices for testing; responding to the sub-device connection instruction, connecting to several sub-devices according to sub-device access requests; responding to a test trigger operation, sending test response information to the test terminal; the test response information represents the response information for testing the target device and several connected sub-devices; the connected sub-devices represent the sub-devices already connected to the target device; receiving a sub-device information query instruction from the test terminal, sending connected sub-device information to the test terminal; the connected sub-device information represents the device information of several connected sub-devices; wherein, the test terminal is used to obtain the device test results based on the test response information, the sub-device information to be connected, and the connected sub-device information; the sub-device information to be connected represents the device information of several sub-devices to be connected; the sub-devices to be connected represent the sub-devices to be connected to the target device.
[0141] Thus, this application, based on the sub-device connection instructions issued by the test terminal, instructs the target device to connect to a corresponding number of sub-devices for testing, driving the target device to simultaneously connect to multiple sub-devices. This enables efficient and standardized batch testing of multiple sub-devices. Compared to related technologies that add sub-devices one by one during pairing testing, this approach effectively improves testing efficiency and enhances the consistency of test results. Furthermore, after the sub-devices connect to the target device, the device test results are determined using multi-dimensional information: test response information sent by the target device regarding testing the target device with several connected sub-devices, device information of several connected sub-devices, and device information of several sub-devices to be connected. This multi-verification mechanism effectively improves the reliability of the device test results.
[0142] In one embodiment, such as Figure 4 As shown, a device testing method is provided. Taking the application of this method to an electronic device as an example, the method includes:
[0143] In step S402, the test terminal sends a sub-device connection command to the target device based on the target device information and the sub-device information to be connected.
[0144] Step S404: The target device receives the sub-device connection command sent by the test terminal.
[0145] In step S406, the target device responds to the sub-device connection command and connects to several sub-devices according to the sub-device access request.
[0146] Step S408: The test terminal receives the sub-device connection result information sent by the target device.
[0147] Step S410: If the sub-device connection result information indicates that there is an unconnected sub-device, the target device is triggered to execute the connection retry process for the unconnected sub-device until the connection retry stop condition is met.
[0148] In step S412, the target device responds to the test trigger operation by sending test response information to the test terminal.
[0149] Step S414: The test terminal receives the test response information sent by the target device.
[0150] Step S416: The test terminal sends a sub-device information query command to the target device and receives the connected sub-device information returned by the target device.
[0151] In step S418, the test terminal obtains the communication test result based on the test response information.
[0152] In step S420, the test terminal obtains the sub-device verification result based on the sub-device information to be connected and the connected sub-device information.
[0153] Step S422: If the communication test result between the target device and each connected sub-device is normal, and the sub-device verification result shows that the information of the sub-device to be connected and the information of the connected sub-device match, then the device test result is that the target device and each sub-device to be connected have passed the test.
[0154] It should be noted that the specific limitations of the above steps can be found in the specific limitations of a device testing method described above.
[0155] In some embodiments, a device testing system is provided, the system including: a test terminal, a target device and a plurality of sub-devices to be connected; the sub-devices to be connected refer to the sub-devices to be connected to the target device.
[0156] The test terminal is used to send sub-device connection instructions to the target device based on the target device information and the sub-device information to be connected; the target device information represents the device information of the target device; the sub-device information to be connected represents the device information of several sub-devices to be connected; the sub-device connection instructions are used to instruct the target device to connect the corresponding number of sub-devices for testing.
[0157] The target device is used to respond to the sub-device connection command and connect to several sub-devices according to the sub-device access request.
[0158] The sub-device includes a prompting unit, which has different prompting states corresponding to different access states. The access state is used to characterize the connection state between the sub-device and the target device.
[0159] The notification unit is a functional module located on the sub-device and used to output status notification information. Specifically, it outputs corresponding notification statuses based on the different access statuses of the sub-device and the target device, reflecting the current access result and connection status of the sub-device, so that testers can quickly identify whether the device has successfully connected to the target device.
[0160] In some embodiments, the prompting unit may include an optical unit, such as an indicator light, with different lighting modes corresponding to different access states, such as the indicator light being off, flashing, or constantly on. In other embodiments, the prompting unit may include an acoustic unit, such as a buzzer or a speaker, with different sound emission modes corresponding to different access states, such as intermittent beeping or constant beeping.
[0161] When a sub-device successfully connects to the target device, the prompting unit displays the first prompting state, such as a solid blue indicator light or a continuous buzzer sound. When a sub-device fails to connect or is not connected, the prompting unit displays the second prompting state, such as an indicator light going out or flashing, or a buzzer sounding intermittently or stopping, so that testers can visually understand the connection status of the sub-device.
[0162] The target device is used to send test response information to the test terminal in response to a test trigger operation; the test response information represents the response information for testing the target device and several connected sub-devices.
[0163] The test terminal is used to send sub-device information query commands to the target device and receive connected sub-device information returned by the target device; the connected sub-device information represents the device information of several connected sub-devices.
[0164] The test terminal is used to obtain the device test results based on the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices.
[0165] It should be noted that the specific limitations of the above system can be found in the specific limitations of a device testing method described above.
[0166] Thus, this application employs a triple verification mechanism: the prompting unit of the sub-device corresponds to the prompting status of different access states; the test response information for testing the target device and several connected sub-devices is parsed; and the information of the sub-device to be connected and the information of the connected sub-devices are compared. This mechanism can accurately determine the access status of the sub-device, the integrity of the communication link, and the accuracy of data transmission, avoiding misjudgments caused by a single verification method and improving the accuracy of device test results.
[0167] For ease of understanding by those skilled in the art, such as Figure 5 As shown, taking the target device as the gateway device, specifically a camera gateway, as an example, a flowchart illustrating a testing method for simultaneously adding multiple sub-devices to a camera gateway is provided. The camera gateway is a WiFi-connected device. This embodiment illustrates an example where the sub-devices to be connected include at least three sub-devices (such as at least two door / window sensors and one human body sensor). The testing system includes the camera gateway, the sub-devices to be connected, a test terminal (computer), and test software. The test terminal, camera gateway, and test software are located on the same local area network. The method includes the following steps:
[0168] 1. Pre-test preparation: Obtain the device information of the camera gateway and the sub-devices to be connected by scanning the barcode, i.e., the MAC address on the camera gateway sticker and the SN identifier of each sub-device. Ensure that the test terminal and the camera gateway are on the same local area network, and that the test software has been started and initialized on the test terminal. Figure 6 Step 1 is shown in the device test interface of the provided test software;
[0169] 2. Camera Gateway Activation and Network Connection: Power on the camera gateway. After the device completes its startup, press and hold the gateway function button for 3 seconds to trigger the gateway to connect to WiFi and complete the connection between the gateway and the local area network (step 2 in the interface image).
[0170] After connecting, perform basic function tests, such as checking the model value, language, main control version, and coordinator version of the camera gateway. At the same time, delete the package mode, reset the package mode, and add the number of sub-devices (steps 3-9 in the interface diagram).
[0171] 3. Sub-device startup: Install the adapter batteries for each door / window sensor and human body sensor, complete the device startup initialization, and ensure that the sub-device to be connected is in the pairing state;
[0172] 4. Simultaneous addition of multiple sub-devices:
[0173] By inputting the MAC address of the camera gateway and the SN identifiers of the three sub-devices into the testing software, a multi-sub-device addition command (sub-device connection command) is sent to the camera gateway, specifying the number of sub-devices to be added (sub-devices to be connected) in the command;
[0174] 5. After receiving the instruction, the camera gateway enters the multi-sub-device addition state, and its indicator light switches to a purple flashing state to indicate that it is currently in pairing mode (step 11 in the interface diagram).
[0175] 6. While the camera gateway indicator light is flashing purple, press and hold the function button of each sub-device for 7 seconds and then release. The sub-device will trigger the network search mechanism, actively search for the dedicated network created by the gateway to add the sub-device, and initiate a sub-device access request (step 10 in the interface diagram).
[0176] 7.3 Sub-device Access Result Judgment: If all three sub-devices successfully connect to the camera gateway, their indicator lights will turn solid blue. If the connection fails, the sub-device indicator lights will flash or turn off. For sub-devices that fail to connect, the test system will automatically trigger a retry process (connection retry process), with a maximum of three retries. If the connection still fails after three retries, the sub-device is considered to have failed to connect; otherwise, it is considered to have succeeded. For sub-devices that fail to connect, they can be retested or a different gateway device can be used for retesting. If it is determined that the sub-device is faulty, it will be repaired.
[0177] 8. Communication Link Verification: Briefly press the function button of each added sub-device (test trigger operation). The test software verifies whether the communication link between each sub-device and the gateway is smooth by parsing the communication messages reported by the camera gateway (test response information). If the test software receives the response message (response information) of the corresponding sub-device, it determines that the sub-device is communicating normally (steps 12-14 in the interface diagram).
[0178] 9. Add result verification: Send a sub-device information query command to the camera gateway through the test software. After receiving the command, the gateway returns the number of successfully added sub-devices and their corresponding SN identifiers (connected sub-device information). The test software compares the returned information with the initially entered sub-device information (sub-device information to be connected) to confirm that the number is consistent and the SN identifiers are completely matched (step 15 in the interface diagram).
[0179] 10. Test Result Processing: If the test software displays the "PASS" mark, it indicates that the multi-sub-device addition test has passed. Power off the camera gateway, remove the batteries from each sub-device, and place all devices in the good product storage area. If the test software displays the "FAIL" mark or there are cases of sub-device addition failure / communication abnormality, place the corresponding device in the defective product storage area and record the SN identifier and fault type of the faulty device. Finally, the test data is uploaded to the MES (Manufacturing Execution System) system (steps 16-18 in the interface diagram).
[0180] Thus, this application enables simultaneous addition and testing of multiple sub-devices, improving testing efficiency by at least 2 times compared to the traditional method of adding them one by one, making it particularly suitable for rapid testing in mass production scenarios. Simultaneously, a standardized operating procedure is established, clearly defining the operation time, device status indicators, and retry mechanisms for each step, reducing human error and ensuring the consistency and reliability of test results. Furthermore, a triple verification mechanism—indicator status, message parsing, and information verification—accurately determines the sub-device addition status, communication link integrity, and data transmission accuracy, avoiding misjudgments caused by single verification methods. In addition, the automatic retry mechanism reduces manual intervention and the workload of testing personnel, while the categorized storage and information recording of faulty devices, along with uploading to the MES (Manufacturing Execution System), facilitates subsequent problem tracing and batch repair.
[0181] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0182] Based on the same inventive concept, this application also provides a device testing apparatus for implementing the device testing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more device testing apparatus embodiments provided below can be found in the limitations of the device testing method described above, and will not be repeated here.
[0183] In one exemplary embodiment, such as Figure 7 As shown, a device testing apparatus is provided, comprising: a command sending module 710, an information receiving module 720, an information querying module 730, and a result obtaining module 740, wherein:
[0184] The instruction sending module 710 is used to send a sub-device connection instruction to the target device based on the target device information and the sub-device information to be connected; the target device information refers to the device information of the target device; the sub-device information to be connected refers to the device information of a number of sub-devices to be connected; the sub-devices to be connected refer to the sub-devices to be connected to the target device; the sub-device connection instruction is used to instruct the target device to connect a corresponding number of sub-devices for testing.
[0185] The information receiving module 720 is used to receive test response information sent by the target device in response to a test trigger operation; the test response information represents the response information for testing the target device and a plurality of connected sub-devices; the connected sub-devices represent the sub-devices that the target device has connected to.
[0186] The information query module 730 is used to send a sub-device information query instruction to the target device and receive the connected sub-device information returned by the target device; the connected sub-device information represents the device information of the plurality of connected sub-devices.
[0187] The result acquisition module 740 is used to obtain the device test result based on the test response information, the information of the sub-device to be connected, and the information of the connected sub-device.
[0188] In one embodiment, the result obtaining module 740 is specifically used to obtain communication test results based on the test response information; the communication test results include communication test results between the target device and each of the connected sub-devices; obtain sub-device verification results based on the sub-device information to be connected and the connected sub-device information; and obtain the device test results based on the communication test results and the sub-device verification results.
[0189] In one embodiment, the result obtaining module 740 is specifically used to obtain the device test result that the target device and each of the connected sub-devices have passed the test when the communication test result between the target device and each of the connected sub-devices is normal and the sub-device verification result is that the information of the sub-device to be connected and the information of the connected sub-devices match.
[0190] In one embodiment, the device further includes: an information recording module, configured to record test-abnormal sub-device information when the communication test result of the connected sub-device is abnormal, or when the sub-device verification result shows that the information of the sub-device to be connected and the information of the connected sub-device do not match; the test-abnormal sub-device information includes the device information of the test-abnormal sub-device; the test-abnormal sub-device includes connected sub-devices or unconnected sub-devices whose communication test result is abnormal.
[0191] In one embodiment, the information of the sub-device to be connected includes a first number of devices and a first device identifier; the first number of devices is the number of sub-devices to be connected, and the first device identifier includes the identifier of each sub-device to be connected; the information of the connected sub-devices includes a second number of devices and a second device identifier; the second number of devices is the number of connected sub-devices, and the second device identifier includes the identifier of each connected sub-device; the result obtaining module 740 is specifically used to obtain the sub-device verification result that the information of the sub-device to be connected and the information of the connected sub-devices match when the first number of devices is the same as the second number of devices and the first device identifier matches the second device identifier.
[0192] In one embodiment, the result obtaining module 740 is specifically used to determine whether the communication test result of the connected sub-device is normal based on whether the test response information contains the response information of the connected sub-device; wherein, the response information is sent from the connected sub-device to the target device after the test trigger operation is applied to the connected sub-device.
[0193] In one embodiment, the device further includes: a retry module, configured to receive sub-device connection result information sent by the target device; if the sub-device connection result information indicates that there is an unconnected sub-device, the target device is triggered to execute a connection retry process for the unconnected sub-device until the connection retry stop condition is met.
[0194] In one embodiment, the connection retry stopping condition includes the sub-device connection result information indicating that the target device has connected to a corresponding number of sub-devices, or the number of times the connection retry process for the unconnected sub-devices has been executed has reached a preset threshold.
[0195] In one exemplary embodiment, such as Figure 8 As shown, a device testing apparatus is provided, comprising: an instruction receiving module 810, a connection module 820, a response information sending module 830, and a device information sending module 840, wherein:
[0196] The instruction receiving module 810 is used to receive sub-device connection instructions from the test terminal; the sub-device connection instructions are used to instruct the target device to connect a corresponding number of sub-devices for testing.
[0197] The connection module 820 is used to connect to several sub-devices in response to the sub-device connection command and according to the sub-device access request.
[0198] The response information sending module 830 is used to send test response information to the test terminal in response to a test trigger operation; the test response information represents the response information for testing the target device and several connected sub-devices; the connected sub-devices represent the sub-devices that have been connected to the target device.
[0199] The device information sending module 840 is used to receive the sub-device information query instruction of the test terminal and send the connected sub-device information to the test terminal; the connected sub-device information represents the device information of the plurality of connected sub-devices.
[0200] The test terminal is used to obtain device test results based on the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices; the information of the sub-devices to be connected represents the device information of several sub-devices to be connected; the sub-devices to be connected represent sub-devices to be connected to the target device.
[0201] Each module in the aforementioned testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0202] In one exemplary embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9As shown, the electronic device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a device testing method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the electronic device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the electronic device, or external keyboards, touchpads, or mice, etc.
[0203] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0204] In one embodiment, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0205] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0206] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0207] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0208] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0209] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0210] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A device testing method, characterized in that, The method includes: Based on the target device information and the sub-device information to be connected, a sub-device connection command is sent to the target device; the target device information refers to the device information of the target device; the sub-device information to be connected refers to the device information of several sub-devices to be connected; the sub-devices to be connected refer to the sub-devices to be connected to the target device; the sub-device connection command is used to instruct the target device to connect a corresponding number of sub-devices for testing. In response to a test trigger operation, the system receives test response information sent by the target device; the test response information represents the response information for testing the target device and several connected sub-devices; the connected sub-devices represent the sub-devices that the target device has connected to. Send a sub-device information query command to the target device, and receive the connected sub-device information returned by the target device; the connected sub-device information represents the device information of the plurality of connected sub-devices; The device test results are obtained based on the test response information, the information of the sub-device to be connected, and the information of the connected sub-device.
2. The method according to claim 1, characterized in that, The step of obtaining the device test result based on the test response information, the information of the sub-device to be connected, and the information of the connected sub-device includes: Based on the test response information, the communication test results are obtained; the communication test results include the communication test results between the target device and each of the connected sub-devices; Based on the information of the sub-device to be connected and the information of the connected sub-devices, the sub-device verification result is obtained; The device test results are obtained based on the communication test results and the sub-device verification results.
3. The method according to claim 2, characterized in that, The step of obtaining the device test result based on the communication test result and the sub-device verification result includes: If the communication test result between the target device and each of the connected sub-devices is normal, and the sub-device verification result shows that the information of the sub-device to be connected and the information of the connected sub-devices match, then the device test result is that the target device and each of the sub-devices to be connected have passed the test.
4. The method according to claim 3, characterized in that, The method further includes: If the communication test result of the connected sub-device is abnormal, or if the sub-device verification result shows that the information of the sub-device to be connected and the information of the connected sub-device do not match, the abnormal sub-device information is recorded; the abnormal sub-device information includes the device information of the abnormal sub-device; the abnormal sub-device includes the connected sub-device or the unconnected sub-device whose communication test result is abnormal.
5. The method according to claim 3, characterized in that, The information of sub-devices to be connected includes a first number of devices and a first device identifier; the first number of devices is the number of sub-devices to be connected, and the first device identifier includes the identifier of each sub-device to be connected; the information of connected sub-devices includes a second number of devices and a second device identifier; the second number of devices is the number of connected sub-devices, and the second device identifier includes the identifier of each connected sub-device; The step of obtaining the sub-device verification result based on the sub-device information to be connected and the connected sub-device information includes: When the number of the first device is the same as the number of the second device and the first device identifier matches the second device identifier, the sub-device verification result is that the sub-device information to be connected and the connected sub-device information match.
6. The method according to claim 3, characterized in that, The step of obtaining the communication test result based on the test response information includes: Based on whether the test response information includes the response information of the connected sub-device, it is determined whether the communication test result of the connected sub-device is normal; wherein, the response information is sent from the connected sub-device to the target device after the test trigger operation is applied to the connected sub-device.
7. The method according to claim 1, characterized in that, After the step of sending the sub-device connection command to the target device, the method further includes: Receive sub-device connection result information sent by the target device; If the sub-device connection result information indicates that there is an unconnected sub-device, the target device is triggered to execute a connection retry process for the unconnected sub-device until the connection retry stop condition is met.
8. The method according to claim 7, characterized in that, The connection retry stopping conditions include the sub-device connection result information indicating that the target device has connected to a corresponding number of sub-devices, or the number of times the connection retry process for the unconnected sub-devices is executed reaches a preset threshold.
9. A method for testing equipment, characterized in that, The method includes: Receive sub-device connection instructions sent by the test terminal; the sub-device connection instructions are used to instruct the target device to connect a corresponding number of sub-devices for testing; In response to the sub-device connection command, connect to several sub-devices according to the sub-device access request; In response to a test trigger operation, a test response message is sent to the test terminal; the test response message represents the response information for testing the target device and several connected sub-devices; the connected sub-devices refer to the sub-devices that have been connected to the target device. The system receives a sub-device information query command from the test terminal and sends connected sub-device information to the test terminal; the connected sub-device information represents the device information of the plurality of connected sub-devices. The test terminal is used to obtain device test results based on the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices; the information of the sub-devices to be connected represents the device information of several sub-devices to be connected; the sub-devices to be connected represent the sub-devices to be connected to the target device.
10. A device testing system, characterized in that, The system includes: a test terminal, a target device, and several sub-devices to be connected; the sub-devices to be connected refer to sub-devices that are to be connected to the target device. The test terminal is used to send a sub-device connection instruction to the target device based on the target device information and the sub-device information to be connected; the target device information represents the device information of the target device; the sub-device information to be connected represents the device information of a plurality of sub-devices to be connected; the sub-device connection instruction is used to instruct the target device to connect a corresponding number of sub-devices for testing; The target device is configured to connect to several sub-devices in response to the sub-device connection command, based on the sub-device access request. The sub-device includes a prompting unit, which has different prompting states corresponding to different access states, wherein the access state is used to characterize the connection state between the sub-device and the target device; The target device is configured to send test response information to the test terminal in response to a test trigger operation; the test response information represents the response information for testing the target device and several connected sub-devices; the connected sub-devices represent the sub-devices that the target device has connected to. The test terminal is used to send a sub-device information query command to the target device and receive connected sub-device information returned by the target device; the connected sub-device information represents the device information of the plurality of connected sub-devices. The test terminal is used to obtain the device test results based on the test response information, the information of the sub-device to be connected, and the information of the connected sub-device.
11. A device for testing equipment, characterized in that, The device includes: The instruction sending module is used to send a sub-device connection instruction to the target device based on the target device information and the sub-device information to be connected; the target device information refers to the device information of the target device; the sub-device information to be connected refers to the device information of several sub-devices to be connected; the sub-devices to be connected refer to the sub-devices to be connected to the target device; the sub-device connection instruction is used to instruct the target device to connect a corresponding number of sub-devices for testing; The information receiving module is used to receive test response information sent by the target device in response to a test trigger operation; the test response information represents the response information for testing the target device and several connected sub-devices; the connected sub-devices represent the sub-devices that the target device has connected to. The information query module is used to send a sub-device information query command to the target device and receive the connected sub-device information returned by the target device; the connected sub-device information represents the device information of the plurality of connected sub-devices; The result acquisition module is used to obtain the device test results based on the test response information, the information of the sub-device to be connected, and the information of the connected sub-device.
12. A device testing apparatus, characterized in that, The device includes: The instruction receiving module is used to receive sub-device connection instructions from the test terminal; the sub-device connection instructions are used to instruct the target device to connect a corresponding number of sub-devices for testing. A connection module is used to respond to the sub-device connection command and connect to several sub-devices according to the sub-device access request; A response information sending module is used to send test response information to the test terminal in response to a test trigger operation; the test response information represents the response information for testing the target device and several connected sub-devices; the connected sub-devices represent the sub-devices that are connected to the target device; The device information sending module is used to receive the sub-device information query instruction from the test terminal and send the connected sub-device information to the test terminal; the connected sub-device information represents the device information of the plurality of connected sub-devices; The test terminal is used to obtain device test results based on the test response information, the information of the sub-devices to be connected, and the information of the connected sub-devices; the information of the sub-devices to be connected represents the device information of several sub-devices to be connected; the sub-devices to be connected represent sub-devices to be connected to the target device.
13. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.