Equipment use method and device in test system and test system

By introducing an automated process of device discovery, occupancy requests and release requests in the test system, the problems of inefficiency and low reliability caused by manual configuration in the prior art are solved, and efficient and reliable test system configuration is achieved.

CN119759757APending Publication Date: 2025-04-04SHENZHEN GONGJIN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411686290.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In the prior art, when building a distributed automated test system, it is necessary to manually confirm the usage status of the remote server and configure key information, resulting in inefficient and low reliability.

Method used

The control device sends a device discovery message, and after the test device responds and confirms that it is available, the control device sends an occupation request message. After the test device confirms, it executes the test script, and releases the request message when the script is completed to release the test device.

Benefits of technology

It realizes automated equipment discovery and configuration of test system, improves the configuration efficiency of the test environment, and ensures the reliability of the test system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759757A_ABST
    Figure CN119759757A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of automatic testing, and provides an equipment using method and device in a testing system and the testing system. The device use method is applied to the test system, the test system comprises a control device and a plurality of test devices, and the device use method in the test system comprises the following steps: the control device sends a device discovery message; the at least one test device sends a device response message to the control device; the control device sends an occupation request message to at least one test device; the at least one test device sends an occupation confirmation message to the control device; the control device uses the at least one occupied test device to execute the test script; when the execution of the test script in the control equipment is completed, the control equipment sends a release request message to the test equipment corresponding to the test script; and the test equipment sends a release confirmation message to the control equipment. The configuration efficiency of the test environment in the test system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of automated testing technology, and in particular, relates to a method for using equipment in a testing system, a device, and a testing system. Background Art

[0002] RobotFramework is an automated testing framework based on Python that supports distributed testing. It provides a lot of basic test libraries, supports third-party extension libraries, and also provides a lot of built-in tools and extension interfaces for easy docking with other systems. Based on RobotFramework, a comprehensive and easily expandable automated system can be built. When using the RobotFramework automated testing platform for automated testing, test computers distributed in different locations within the enterprise are usually connected to form a distributed automated testing system to achieve more complex testing, thereby achieving resource sharing and improving the utilization of hardware resources. In the prior art, the current conventional practice is that when a distributed automated testing system needs to be built within a local area network, the test personnel need to confirm one by one whether the remote computer as the remote server is being used, and the key information such as the IP of the remote server and the network hardware configuration in the remote computer need to be configured in the RobotFramework test platform. This approach is not only inefficient but also has low reliability. Summary of the invention

[0003] The embodiments of the present application provide a method for using equipment in a test system, an apparatus, and a test system, which can solve the technical problems of low efficiency and low reliability caused by manually configuring the test system.

[0004] In a first aspect, an embodiment of the present application provides a method for using a device in a test system, wherein the test system includes a control device and a plurality of test devices, and the method includes:

[0005] A control device sends a device discovery message, where the device discovery message is used to discover at least one test device in the test system;

[0006] When receiving the device discovery message, at least one test device sends a device response message to the control device, wherein the device response message is used to indicate that the test device can respond to the device discovery message of the control device;

[0007] When receiving a device response message of at least one test device, the control device sends an occupation request message to at least one test device, wherein the occupation request message is used to indicate that the control device requests to occupy the test device;

[0008] When receiving the occupation request message, at least one test device sends an occupation confirmation message to the control device, wherein the occupation confirmation message is used to indicate that the test device confirms that it can be occupied;

[0009] After receiving an occupation confirmation message of at least one test device, the control device executes a test script using the at least one occupied test device;

[0010] When the test script in the control device is executed, the control device sends a release request message to the test device corresponding to the test script, wherein the release request message is used to indicate that the control device requests to release the test device;

[0011] When receiving the release request message from the control device, the test device sends a release confirmation message to the control device, where the release confirmation message is used to confirm that the test device has been released.

[0012] In a possible implementation manner of the first aspect, when receiving a device response message from at least one test device, the control device sends an occupation request message to the at least one test device, including:

[0013] The control device adds the communication address information of at least one test device to the first queue according to the order in which the device response message of at least one test device is received;

[0014] The control device takes out the communication address information of the test device from the first queue in a first-in-first-out order;

[0015] The control device sends an occupation request message to the test device according to the communication address information of the test device taken out from the first queue.

[0016] In a possible implementation manner of the first aspect, receiving an occupation confirmation message of at least one test device includes:

[0017] The control device adds the communication address information of at least one test device to the second queue according to the order in which the occupation confirmation message of at least one test device is received;

[0018] The control device clears the communication address information of the test device in the first queue according to the communication address information of the test device added to the second queue.

[0019] In a possible implementation manner of the first aspect, when the test script in the control device is executed, the control device sends a release request message to the test device corresponding to the test script, including:

[0020] When the test script in the control device is executed, the control device takes out the communication address information of the test device corresponding to the test script from the second queue;

[0021] The control device sends a release request message to the test device corresponding to the test script according to the communication address information of the test device corresponding to the test script.

[0022] In a possible implementation manner of the first aspect, the device response message includes configuration information of the test device, and the method further includes:

[0023] The control device determines the test device corresponding to the test script according to the test configuration information required by the test script and the configuration information of at least one test device.

[0024] In a possible implementation manner of the first aspect, the method further includes:

[0025] When the at least one test device sends a device response message to the control device, the at least one test device sets the device use flag to a negotiation flag;

[0026] When the at least one test device sends an occupation confirmation message to the control device, the at least one test device sets the device use flag to an occupied flag;

[0027] When the test device sends a release confirmation message to the control device, the test device sets the device use flag to an unoccupied flag.

[0028] In a possible implementation manner of the first aspect, the method further includes:

[0029] When the at least one test device sets the device use flag to a negotiation flag, the at least one test device starts a timer;

[0030] If an occupation request message is received before the timer times out, when the at least one test device sends an occupation confirmation message to the control device, the at least one test device sets the device use flag to an occupied flag and destroys the timer;

[0031] If the timer times out and no occupation request message is received, the at least one test device sets the device usage flag to an unoccupied flag and destroys the timer.

[0032] In a second aspect, an embodiment of the present application provides a device for using a device in a test system, wherein the test system includes a control device and a plurality of test devices, and the device is applied to the control device, and the device includes:

[0033] A first sending module, configured to send a device discovery message, wherein the device discovery message is used to discover at least one test device in the test system;

[0034] A second sending module is used to send an occupation request message to at least one test device when receiving a device response message of at least one test device, wherein the device response message is used to indicate that the test device can respond to the device discovery message of the control device, and the occupation request message is used to indicate that the control device requests to occupy the test device;

[0035] A third using module is used to execute a test script using at least one occupied test device after receiving an occupation confirmation message of at least one test device, wherein the occupation confirmation message is used to indicate that the test device confirms that it can be occupied;

[0036] The fourth sending module is used to send a release request message to the test device corresponding to the test script when the test script in the control device is executed. The release request message is used to indicate that the control device requests to release the test device.

[0037] In a third aspect, an embodiment of the present application provides a device for using a device in a test system, the test system comprising a control device and a plurality of test devices, the device being applied to the test device, the device comprising:

[0038] a fifth sending module, configured to send a device response message to the control device when receiving a device discovery message, wherein the device discovery message is used to discover at least one test device in the test system, and the device response message is used to indicate that the test device can respond to the device discovery message of the control device;

[0039] A sixth sending module, configured to send an occupation confirmation message to the control device when receiving an occupation request message, wherein the occupation request message is used to indicate that the control device requests to occupy the test device, and the occupation confirmation message is used to indicate that the test device confirms that it can be occupied;

[0040] The seventh sending module is used to send a release confirmation message to the control device when receiving a release request message from the control device, wherein the release request message is used to indicate that the control device requests to release the test device, and the release confirmation message is used to confirm that the test device has been released.

[0041] In a fourth aspect, an embodiment of the present application provides a test system, the test system comprising a control device and at least one test device, the control device is used to send a device discovery message, the device discovery message is used to discover at least one test device in the test system;

[0042] When receiving the device discovery message, at least one of the test devices is used to send a device response message to the control device, wherein the device response message is used to indicate that the test device can respond to the device discovery message of the control device;

[0043] When receiving a device response message of at least one of the test devices, the control device is used to send an occupation request message to at least one of the test devices, wherein the occupation request message is used to indicate that the control device requests to occupy the test device;

[0044] When receiving the occupation request message, at least one of the test devices is used to send an occupation confirmation message to the control device, wherein the occupation confirmation message is used to indicate that the test device confirms that it can be occupied;

[0045] After receiving an occupation confirmation message of at least one test device, the control device is used to execute a test script using the occupied at least one test device;

[0046] When the test script in the control device is executed, the control device is used to send a release request message to the test device corresponding to the test script, and the release request message is used to indicate that the control device requests to release the test device;

[0047] When receiving the release request message from the control device, the test device is used to send a release confirmation message to the control device, where the release confirmation message is used to confirm that the test device has been released.

[0048] In a fifth aspect, an embodiment of the present application provides a method for using a device in a test system, wherein the test system includes a control device and a plurality of test devices, and the method is applied to the control device, and the method includes:

[0049] Sending a device discovery message, where the device discovery message is used to discover at least one test device in the test system;

[0050] When receiving a device response message of at least one test device, sending an occupation request message to at least one test device, the device response message is used to indicate that the test device can respond to the device discovery message of the control device, and the occupation request message is used to indicate that the control device requests to occupy the test device;

[0051] After receiving an occupation confirmation message of at least one test device, executing a test script using at least one occupied test device, wherein the occupation confirmation message is used to indicate that the test device confirms that it can be occupied;

[0052] When the test script in the control device is executed, a release request message is sent to the test device corresponding to the test script, and the release request message is used to indicate that the control device requests to release the test device.

[0053] In a sixth aspect, an embodiment of the present application provides a method for using a device in a test system, wherein the test system includes a control device and a plurality of test devices, and the method is applied to the test device, and the method includes:

[0054] When receiving a device discovery message, sending a device response message to the control device, the device discovery message is used to discover at least one test device in the test system, and the device response message is used to indicate that the test device can respond to the device discovery message of the control device;

[0055] When receiving an occupation request message, sending an occupation confirmation message to the control device, the occupation request message is used to indicate that the control device requests to occupy the test device, and the occupation confirmation message is used to indicate that the test device confirms that it can be occupied;

[0056] When receiving the release request message of the control device, a release confirmation message is sent to the control device, wherein the release request message is used to indicate that the control device requests to release the test device, and the release confirmation message is used to confirm that the test device has been released.

[0057] In the seventh aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the device usage method of the fifth aspect or the sixth aspect described above is implemented.

[0058] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the device use method of the fifth aspect or the sixth aspect described above is implemented.

[0059] In a ninth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device implements the device use method that can implement the fifth aspect or the sixth aspect mentioned above when executing the computer program product.

[0060] It can be understood that the beneficial effects of the second to ninth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0061] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0062] The present application provides a method for using a device in a test system, the method for using the device is applied in the test system, the test system includes a control device and multiple test devices, the method includes: the control device sends a device discovery message, the device discovery message is used to discover at least one test device in the test system; when receiving the device discovery message, at least one test device sends a device response message to the control device, the device response message is used to indicate that the test device can respond to the device discovery message of the control device; when receiving the device response message of at least one test device, the control device sends an occupation request message to at least one test device, the occupation request message is used to indicate that the control device requests occupation The test device is used; when receiving an occupation request message, at least one test device sends an occupation confirmation message to the control device, and the occupation confirmation message is used to indicate that the test device confirms that it can be occupied; after receiving the occupation confirmation message of at least one test device, the control device uses the at least one occupied test device to execute the test script; when the test script in the control device is executed, the control device sends a release request message to the test device corresponding to the test script, and the release request message is used to indicate that the control device requests to release the test device; when receiving the release request message of the control device, the test device sends a release confirmation message to the control device, and the release confirmation message is used to confirm that the test device has been released. The device use method in the test system provided by the present application is realized through the interaction between the control device and the test device in the test system, and the interaction mode between the client and the server is used. The control device and the test device realize the automatic discovery and configuration of the test device in the test system by the control device according to the agreed process and messages, which can improve the configuration efficiency of the test environment in the test system and ensure the reliability of the test system. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0064] Figure 1 is a schematic diagram of a test system provided by an embodiment of the present application;

[0065] Figure 2 is a flow chart of a method for using a device in a test system provided in an embodiment of the present application;

[0066] Figure 3 is a flowchart of a method for using a device in a test system provided in another embodiment of the present application;

[0067] Figure 4 is a schematic diagram of a test system provided by an embodiment of the present application;

[0068] Figure 5 is a structural schematic diagram of a device in a control device provided in an embodiment of the present application;

[0069] Figure 6 is a schematic diagram of the structure of a device in a test device provided in an embodiment of the present application;

[0070] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0072] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0073] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0074] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0075] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0076] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0077] The device usage method in the test system provided in the embodiment of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific type of electronic devices.

[0078] For example, the electronic device may be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a vehicle networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a TV set top box (STB), a customer premises equipment (CPE) and / or other devices for communicating on a wireless system and a next-generation communication system, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network, etc.

[0079] Figure 1 is a schematic diagram of a test system provided in one embodiment of the present application.

[0080] like Figure 1 As shown, the test system includes a control device and multiple test devices. The control device in the test system can be one or more. The communication between the control device and the test device is realized through the network device. Figure 1 As shown, the test system includes a first control device 11 and a second control device 12. The test system also includes a first test device 21, a second test device 22, a third test device 23, and a fourth test device 24. In this application, examples are often given in which one control device controls multiple test devices. Those skilled in the art should understand that the way in which multiple control devices control multiple test devices is the same or similar to the way in which one control device controls multiple test devices, and will not be repeated here.

[0081] The RobotFramework automated testing framework is often used as an example in this application. Those skilled in the art should understand that the device usage method in the test system proposed in this application can also be applied to other automated testing frameworks.

[0082] The control device and the test device can interact based on the client-server interaction mode. The control device acts as the client and the test device acts as the server. The test device can run the RobotFramework remote server. The control device can be installed with the RobotFramework automated testing platform and used as a client.

[0083] The test device can run the RobotFramework remote server. Users can call the library in the remote server through the network to extend the functionality of RobotFramework.

[0084] The test system in this application can be composed of a control device and one or more test devices to form a distributed networking environment. The control device and the test device are usually deployed in the same local area network, and multiple sets of the test system may be deployed in the same local area network to perform different test tasks. The control device can be a main control PC, and the test device can be a remote PC.

[0085] The master PC is installed with the RobotFramework automated test platform, in which the user can edit or execute automated test scripts to perform various tests. When the automated test script starts running, the master PC calls the automatic discovery configuration module (also called the discovery configuration module, the discovery module) to discover and occupy the available remote servers in the local area network, and then automatically forms a test system that meets the needs of the current automated test script operation. The automatic discovery configuration module can be an independent library or plug-in, which can be called in the initial stage of the test script running or can be called through the control after opening the RobotFramework automated test platform.

[0086] The remote PC installs and runs the RobotFramework remote server. While the remote server is running, it will execute a monitoring configuration module (also called monitoring module) to monitor the discovery configuration request (i.e., device discovery message) of the master PC. The monitoring module in the RobotFramework remote server is an independent test library, which is called through visual controls after the RobotFramework remote server is turned on. At the same time, it can support custom configuration of key configuration information of the remote server, such as hardware information and network information of all network cards of the remote PC, so as to pass its own key configuration information to the discovery configuration module of the master PC during the discovery configuration process for use in the test script.

[0087] Those skilled in the art should understand that the above networking method through a local area network is only an example. The control device and the test device in this application can also be networked and communicated through a wide area network, local area network, wireless network, wired network, etc. composed of various network devices such as routers and interactive machines.

[0088] Figure 2 It is a flowchart of a method for using equipment in a test system provided in an embodiment of the present application.

[0089] S21, a control device sends a device discovery message, where the device discovery message is used to discover at least one test device in the test system.

[0090] Here, the device discovery message may be a broadcast message. For example, the control device may send a specific UDP (User Datagram Protocol) broadcast message to a designated port of the local area network broadcast address through the automatic discovery configuration module to discover available test devices in the local area network.

[0091] The device discovery message is a message used by the control device to discover the test devices currently available in the test system.

[0092] S22: When receiving the device discovery message, at least one test device sends a device response message to the control device, where the device response message is used to indicate that the test device can respond to the device discovery message of the control device.

[0093] The monitoring module of the test device can monitor the network connected to the local area network and the specified port. When receiving the device discovery message of the control device, the monitoring module of the test device can send the device response message to the control device in a unicast manner. Among them, the device discovery message includes the communication address information of the control device such as IP, port, etc., so that the test device can send the device response message to the control device according to the communication address information of the control device. Correspondingly, the control device receives the device response message sent by the test device.

[0094] The device response message is a message used to indicate that the test device can respond to the control device. When the test device is currently in an unoccupied state, the test device can send a device response message to the control device. If the test device is currently in an occupied state or is in a negotiation state with other control devices, the test device will not send back a device response message to the control device that sent the device message.

[0095] S23, when receiving a device response message from at least one test device, the control device sends an occupation request message to the at least one test device, where the occupation request message is used to indicate that the control device requests to occupy the test device.

[0096] When the control device receives a device response message from at least one test device, the control device can determine the communication address information of the test device (e.g., the IP address, port, etc. of the test device) based on the device response message. Subsequently, the control device can send an occupation request message to the test device according to the communication address information of the test device. Accordingly, the test device receives the occupation request message sent by the control device.

[0097] The occupation request message refers to a message used to indicate that the control device desires to occupy the test device.

[0098] S24, when receiving the occupation request message, at least one test device sends an occupation confirmation message to the control device, where the occupation confirmation message is used to indicate that the test device confirms that it can be occupied.

[0099] When the monitoring module of the test device receives the occupation request message, it can send an occupation confirmation message to the control device according to the communication address information of the control device. Correspondingly, the control device receives the occupation confirmation message sent by the test device.

[0100] The occupation confirmation message is a message used to confirm that the test equipment can be occupied.

[0101] S25, after receiving the occupation confirmation message of the at least one test device, the control device uses the at least one occupied test device to execute the test script.

[0102] After receiving the occupation confirmation message of at least one test device, it indicates that at least one test device can be used to execute the test script. The control device can select a test device from the at least one occupied test device for use in executing the test script.

[0103] S26, when the test script in the control device is executed, the control device sends a release request message to the test device corresponding to the test script, and the release request message is used to indicate that the control device requests to release the test resources of the test device.

[0104] There is a corresponding relationship between the test script and the test device, that is, one test script corresponds to a certain test device. When a test script is executed, it means that the test device corresponding to the test script has been used up. When the test script in the control device is executed, the control device can send a release request message to the test device corresponding to the test script to release the test resources of the test device.

[0105] The release request message is a message used to instruct the control device to request to release the test device.

[0106] When the test script in the control device is executed, the control device can send a release request message to the test device corresponding to the test script according to the communication address information of the test device corresponding to the test script. Correspondingly, the test device corresponding to the test script receives the release request message sent by the control device.

[0107] S27, when receiving the release request message from the control device, the test device sends a release confirmation message to the control device, where the release confirmation message is used to confirm that the test device has been released.

[0108] When the monitoring module of the test device receives the release request message, it can send a release confirmation message to the control device according to the communication address information of the control device. Correspondingly, the control device receives the release confirmation message sent by the test device.

[0109] The release confirmation message is a message used to confirm that the test device has been released. After sending the release confirmation message, the test resources of the test device have been released, and the test device resumes the monitoring state and can be used to receive the device discovery message of the control device again.

[0110] The present application provides a method for using a device in a test system, the method for using the device is applied in the test system, the test system includes a control device and multiple test devices, the method includes: the control device sends a device discovery message, the device discovery message is used to discover at least one test device in the test system; when receiving the device discovery message, at least one test device sends a device response message to the control device, the device response message is used to indicate that the test device can respond to the device discovery message of the control device; when receiving the device response message of at least one test device, the control device sends an occupation request message to at least one test device, the occupation request message is used to indicate that the control device requests occupation The test device is used; when receiving an occupation request message, at least one test device sends an occupation confirmation message to the control device, and the occupation confirmation message is used to indicate that the test device confirms that it can be occupied; after receiving the occupation confirmation message of at least one test device, the control device uses the at least one occupied test device to execute the test script; when the test script in the control device is executed, the control device sends a release request message to the test device corresponding to the test script, and the release request message is used to indicate that the control device requests to release the test device; when receiving the release request message of the control device, the test device sends a release confirmation message to the control device, and the release confirmation message is used to confirm that the test device has been released. The device use method in the test system provided by the present application is realized through the interaction between the control device and the test device in the test system, and the interaction mode between the client and the server is used. The control device and the test device realize the automatic discovery and configuration of the test device in the test system by the control device according to the agreed process and messages, which can improve the configuration efficiency of the test environment in the test system and ensure the reliability of the test system.

[0111] In one embodiment, when receiving a device response message from at least one test device, the control device sends an occupation request message to the at least one test device, including:

[0112] The control device adds the communication address information of at least one test device to the first queue according to the order in which the device response message of at least one test device is received;

[0113] The control device takes out the communication address information of the test device from the first queue in a first-in-first-out order;

[0114] The control device sends an occupation request message to the test device according to the communication address information of the test device taken out from the first queue.

[0115] Here, the first queue may also be referred to as a temporary queue (TEMP_QUEUE). The temporary queue refers to a queue used to store test device related information (such as communication address information of the test device) when the control device currently receives a device response message from the test device but has not officially occupied the test device.

[0116] For example, the control device receives the device response messages of three test devices in the following order: test device A, test device B, test device C. Then the control device adds the communication address information of test device A, test device B, and test device C to the first queue in the order of test device A, test device B, and test device C. In the order of first-in-first-out, the control device first takes out the communication address information of test device A (such as the IP and port of test device A) from the first queue, and sends an occupation request message to test device A according to the communication address information of test device A taken out from the first queue. Then, in the order of first-in-first-out, the control device takes out the communication address information of test device B (such as the IP and port of test device B) from the first queue, and sends an occupation request message to test device B according to the communication address information of test device B taken out from the first queue. Subsequently, in a first-in-first-out order, the control device takes out the communication address information of the test device C (such as the IP and port of the test device C) from the first queue, and sends an occupation request message to the test device C based on the communication address information of the test device C taken out from the first queue.

[0117] Because the control device may receive device response messages from multiple test devices after sending a device discovery message, the control device adds the communication address information of the multiple test devices to the first queue according to the order of the device response messages received from the multiple test devices. The control device can record and determine the order of the test device responses in an orderly manner, and send occupancy request messages to the test devices in an orderly manner, so as to improve the efficiency and stability of the interaction between the control device and the test devices.

[0118] In one embodiment, receiving an occupation confirmation message of at least one test device comprises:

[0119] The control device adds the communication address information of at least one test device to the second queue according to the order in which the occupation confirmation message of at least one test device is received;

[0120] The control device clears the communication address information of the test device in the first queue according to the communication address information of the test device added to the second queue.

[0121] Here, the second queue may also be referred to as a formal queue (QUEUE). The formal queue refers to a queue used to store information related to the test device (such as communication address information of the test device) when the control device has received an occupation confirmation message from the test device and has formally occupied the test device.

[0122] Continuing with the previous example, for example, the control device receives occupancy confirmation messages from two test devices in the order of test device B and test device C. Then the control device adds the communication address information of test device B and test device C to the second queue in the order of test device B and test device C. When the communication address information of test device B has been added to the second queue, the control device clears the communication address information of test device B in the first queue. When the communication address information of test device C has been added to the second queue, the control device clears the communication address information of test device C in the first queue.

[0123] Since the control device may receive occupancy confirmation messages from multiple test devices after sending an occupancy request message, the control device adds the communication address information of multiple test devices to the second queue in the order of the occupancy confirmation messages received from the multiple test devices, so that the order of the occupied test devices can be recorded and determined in an orderly manner, and the occupied test devices can be used in an orderly manner to execute test scripts, so as to improve the efficiency and stability of the interaction between the control device and the test device. In addition, the control device clears the communication address information of the test device in the first queue based on the communication address information of the test device added to the second queue, ensuring that the test devices in the first queue are all unoccupied test devices, and ensuring the accuracy and effectiveness of the test device information in the first queue.

[0124] In one embodiment, when the test script in the control device is executed, the control device sends a release request message to the test device corresponding to the test script, including:

[0125] When the test script in the control device is executed, the control device takes out the communication address information of the test device corresponding to the test script from the second queue;

[0126] The control device sends a release request message to the test device corresponding to the test script according to the communication address information of the test device corresponding to the test script.

[0127] After receiving an occupation confirmation message of at least one test device, the control device uses the at least one occupied test device to execute the test script. When the test script is executed using the at least one occupied test device, a correspondence between the test script and the test device is established. Continuing with the previous example, for example, if test script A uses test device B for testing, then test script A corresponds to test device B. When the execution of test script A in the control device is completed, the control device takes out the communication address information of test device B corresponding to test script A from the second queue. Then, the control device sends a release request message to test device B corresponding to test script A based on the communication address information of test device B corresponding to test script A.

[0128] When the execution of the test script in the control device is completed, the control device takes out the communication address information of the test device corresponding to the test script from the second queue, and sends a release request message to the test device corresponding to the test script based on the communication address information of the test device corresponding to the test script, thereby ensuring that the test devices in the second queue are all officially occupied test devices, thereby ensuring the accuracy and validity of the test device information in the second queue.

[0129] In one embodiment, the device response message includes configuration information of the test device, and the method further includes:

[0130] The control device determines the test device corresponding to the test script according to the test configuration information required by the test script and the configuration information of at least one test device.

[0131] Here, the configuration information of the test device includes but is not limited to the network configuration information of the test device and user-defined configuration information. The network configuration information of the test device includes but is not limited to network card information, for example, the test device uses a wired network card, or the test device uses a wireless network card. User-defined configuration information includes but is not limited to information such as test libraries and test functions. The control device can write the configuration information of the test device included in the received device response message into a specified configuration file so that it can be called when executing the test script. The control device can call the test device that matches the test configuration information required by the test script based on the configuration information of multiple test devices.

[0132] The test configuration information required by the test script is used to represent the configuration information required when the test script is tested. For example, test script A needs to use a wired network card and needs to use test library A. The control device can determine the test device that can match the test configuration information of the test script, that is, the test device corresponding to the test script, based on the test configuration information required by the test script and the respective configuration information of multiple test devices. For example, test device B uses a wired network card and supports test library A. Test device C uses a wireless network card and supports test library C. The control device can determine that the test device corresponding to test script A is test device B.

[0133] The control device determines the test device corresponding to the test script based on the test configuration information required by the test script and the configuration information of at least one test device, thereby ensuring that the test script can be matched with the test device that meets the required test configuration information, thereby improving the efficiency and effectiveness of executing the test script.

[0134] In one embodiment, the method for using the device in the test system further includes:

[0135] When the at least one test device sends a device response message to the control device, the at least one test device sets the device use flag to a negotiation flag;

[0136] When the at least one test device sends an occupation confirmation message to the control device, the at least one test device sets the device use flag to an occupied flag;

[0137] When the test device sends a release confirmation message to the control device, the test device sets the device use flag to an unoccupied flag.

[0138] Here, the device use flag (UseFlag in English) can be used to indicate the current state of the test device. The test device can maintain the device use flag to determine the current state of the test device.

[0139] When the test device does not receive a device response message, the test device is in a listening state, and the device use flag of the test device can be set to an unoccupied flag (UseFlag=0). When the device discovery message of the control device is received, and the test device sends a device response message to the control device, the test device can set its own device use flag to a negotiation flag (UseFlag=1) to indicate that the test device is negotiating occupancy with the control device. When the occupancy request message of the control device is received, and the test device sends an occupancy confirmation message to the control device, the test device can set its own device use flag to an occupied flag (UseFlag=2) to indicate that the test device has been occupied by the control device. When the release request message of the control device is received, and the test device sends a release confirmation message to the control device, the test device can set its own device use flag to an unoccupied flag (UseFlag=0) to indicate that the test device has been used by the control device, and the test device returns to the listening state in preparation for the next use.

[0140] By setting different device use flags in different states, the test device can better maintain and determine the current state of the test device, and ensure the efficiency and stability of the interaction between the control device and the test device.

[0141] In one embodiment, the method for using the device in the test system further includes:

[0142] When the at least one test device sets the device use flag to a negotiation flag, the at least one test device starts a timer;

[0143] If an occupation request message is received before the timer times out, when the at least one test device sends an occupation confirmation message to the control device, the at least one test device sets the device use flag to an occupied flag and destroys the timer;

[0144] If the timer times out and no occupation request message is received, the at least one test device sets the device usage flag to an unoccupied flag and destroys the timer.

[0145] Here, the timer is used to time the negotiation process between the test device and the control device. The timer can be, for example, 5 seconds to 5 minutes. Taking 1 minute as an example, when the test device sets the device usage flag to the negotiation flag (UseFlag=1), the test device starts a 1-minute timer. If an occupation request message is received before the 1-minute timer times out, when the test device sends an occupation confirmation message to the control device, the test device sets the device usage flag to the occupied flag (UseFlag=2) and destroys the timer. If the 1-minute timer times out and no occupation request message is received, the test device sets the device usage flag to the unoccupied flag (UseFlag=0) and destroys the timer.

[0146] When the test device sets the device use flag to the negotiation flag and starts the timer, it can ensure that the negotiation process between the control device and the test device determines the negotiation result when the timer ends, which can improve the efficiency of the negotiation process between the control device and the test device. If the negotiation is unsuccessful, the device use flag is set to the unoccupied flag, which can improve the efficiency of the use of the test resources of the test device and improve the utilization rate of the test resources of the test device.

[0147] In one embodiment, the present application proposes a method for using a device in a test system, wherein the test system includes a control device and a plurality of test devices, and the method is applied to the control device, and the method includes:

[0148] Sending a device discovery message, where the device discovery message is used to discover at least one test device in the test system;

[0149] When receiving a device response message of at least one test device, sending an occupation request message to at least one test device, the device response message is used to indicate that the test device can respond to the device discovery message of the control device, and the occupation request message is used to indicate that the control device requests to occupy the test device;

[0150] After receiving an occupation confirmation message of at least one test device, executing a test script using at least one occupied test device, wherein the occupation confirmation message is used to indicate that the test device confirms that it can be occupied;

[0151] When the test script in the control device is executed, a release request message is sent to the test device corresponding to the test script, and the release request message is used to indicate that the control device requests to release the test device.

[0152] In one embodiment, when receiving a device response message from at least one test device, sending an occupation request message to at least one test device comprises:

[0153] Adding the communication address information of at least one test device to the first queue according to the order in which the device response message of at least one test device is received;

[0154] Taking out the communication address information of the test device from the first queue in a first-in-first-out order;

[0155] According to the communication address information of the test device taken out from the first queue, an occupation request message is sent to the test device.

[0156] In one embodiment, receiving an occupation confirmation message of at least one test device comprises:

[0157] Adding the communication address information of at least one test device to the second queue according to the order in which the occupation confirmation message of at least one test device is received;

[0158] According to the communication address information of the test device added to the second queue, the communication address information of the test device in the first queue is cleared.

[0159] In one embodiment, when the test script in the control device is executed, sending a release request message to the test device corresponding to the test script includes:

[0160] When the test script in the control device is executed, the communication address information of the test device corresponding to the test script is taken out from the second queue;

[0161] According to the communication address information of the test device corresponding to the test script, a release request message is sent to the test device corresponding to the test script.

[0162] In one embodiment, the device response message includes configuration information of the test device, and the method further includes:

[0163] The test device corresponding to the test script is determined according to the test configuration information required by the test script and the configuration information of at least one test device.

[0164] In one embodiment, the present application proposes a method for using a device in a test system, the test system comprising a control device and a plurality of test devices, the method being applied to the test device, the method comprising:

[0165] When receiving a device discovery message, sending a device response message to the control device, the device discovery message is used to discover at least one test device in the test system, and the device response message is used to indicate that the test device can respond to the device discovery message of the control device;

[0166] When receiving an occupation request message, sending an occupation confirmation message to the control device, the occupation request message is used to indicate that the control device requests to occupy the test device, and the occupation confirmation message is used to indicate that the test device confirms that it can be occupied;

[0167] When receiving the release request message of the control device, a release confirmation message is sent to the control device, wherein the release request message is used to indicate that the control device requests to release the test device, and the release confirmation message is used to confirm that the test device has been released.

[0168] In one embodiment, the method further comprises:

[0169] When the test device sends the device response message to the control device, the device use flag is set to a negotiation flag;

[0170] When the test device sends an occupation confirmation message to the control device, the device use flag is set to an occupied flag;

[0171] When the test device sends a release confirmation message to the control device, the device use flag is set to an unoccupied flag.

[0172] In one embodiment, the method further comprises:

[0173] When the test device sets the device usage flag to the negotiation flag, a timer is started;

[0174] If an occupation request message is received before the timer times out, when the test device sends an occupation confirmation message to the control device, the device use flag is set to an occupied flag and the timer is destroyed;

[0175] If the timer times out and no occupation request message is received, the device usage flag is set to an unoccupied flag and the timer is destroyed.

[0176] The specific description of the above embodiments is the same as or similar to the specific description described above, and will not be repeated here.

[0177] Figure 3 It is a flowchart of a method for using a device in a test system provided in another embodiment of the present application.

[0178] The RobotFramework automated testing platform is installed on the host PC (i.e., a form of control device). Before running, the automated testing script first calls the remote server discovery module to discover and configure the remote server.

[0179] The remote PC (i.e., a form of test equipment) installs the RobotFramework remote server. When the remote server is started, the monitoring module in the remote server is called. The monitoring module initially sets its own UseFlag (initial value is 0, indicating that the current remote server is not occupied) to indicate the current occupied state of the remote server. The monitoring module decides whether to respond to the discovery configuration request of the host PC based on the state of UseFlag.

[0180] After the master PC establishes a connection with a remote server, the monitoring module will update its UseFlag to indicate that the current remote PC is being used. If the monitoring module receives a discovery configuration request from another master PC at this time, it will no longer respond.

[0181] When a test task (i.e., test script) in the host PC needs to release a remote server after execution, a release message (i.e., release request message) is sent to notify the remote server. The monitoring module in the remote server can reset its UseFlag flag (reset to 0) and re-enter the monitoring state.

[0182] S31, the master PC sends a device discovery message, the device discovery message is used to discover at least one remote PC in the test system. The automatic discovery configuration module (i.e., discovery module) in the master PC sends a specific UDP broadcast message to a specified port Port of the local area network broadcast address to discover available remote servers in the local area network.

[0183] S32, when receiving the device discovery message, at least one remote PC sends a device response message to the master PC, and the device response message is used to indicate that the remote PC can respond to the device discovery message of the master PC. The monitoring module of the remote server in the remote PC monitors the network connected to the local area network and the designated port Port. When receiving the UDP broadcast message sent by the master PC, the monitoring module immediately responds to the master PC in a unicast manner. The unicast message optionally carries information such as the network configuration of the remote server and other user-defined configuration information. At the same time, when the remote PC sends the device response message to the master PC, the remote PC sets the device use flag to the negotiation flag. The remote PC sets its own UseFlag to 1, indicating that it is negotiating a connection with the master PC. At the same time, when the remote PC sets the device use flag to the negotiation flag, the remote PC starts a timer. The remote PC starts a timer, and if a request call message (that is, an occupation request message) is received from the master PC before the timer times out, it enters step S34. Otherwise, if the timer times out and no request call message (ie, occupation request message) is received from the master PC, the remote PC resets its own UseFlag to 0, destroys the timer, and enters the listening state.

[0184] S33, when receiving a device response message from at least one remote PC, the master PC sends an occupation request message to the remote PC, and the occupation request message is used to indicate that the master PC requests to occupy the remote PC. The master PC adds the communication address information of at least one remote PC to the first queue (also called the temporary queue) in the order in which the device response message of at least one remote PC is received; the master PC takes out the communication address information of the remote PC from the first queue in a first-in-first-out order; the master PC sends an occupation request message to the remote PC based on the communication address information of the remote PC taken out from the first queue. After receiving the device response messages from multiple remote servers, the master PC adds the IP and port groups of multiple remote servers to the temporary queue (TEMP_QUEUE) in turn. Then, the master PC takes out the IP and port group from the temporary queue in turn and sends an occupation request message to the corresponding remote server.

[0185] S34, when receiving the occupation request message, the remote PC sends an occupation confirmation message to the master PC, and the occupation confirmation message is used to indicate that the remote PC confirms that it can be occupied. After receiving the request call message, the monitoring module of the remote PC immediately responds to the master PC with an occupation confirmation message. At the same time, when the remote PC sends the occupation confirmation message to the master PC, the remote PC sets the device use flag to the occupied flag. The remote PC immediately sets its own UseFlag to 2, indicating that the current remote server has been occupied. At the same time, the remote PC destroys its own timer, and the process of the master PC discovering and configuring the remote server is completed.

[0186] S35, after receiving the occupation confirmation message of the remote PC, the master PC uses the occupied remote PC to execute the test script. The master PC adds the communication address information of at least one remote PC to the second queue (also called the formal occupation queue) in the order of receiving the occupation confirmation message of at least one remote PC; the master PC clears the communication address information of the remote PC in the first queue according to the communication address information of the remote PC added to the second queue. After the master PC receives the occupation confirmation message of the remote PC, the master PC adds the IP and port group of the remote server to a formal occupation queue (QUEUE), writes the configuration option information in the received message to the specified configuration file, and conveniently calls it in the test script, and clears the IP and port group of the remote server in the temporary queue TEMP_QUEUE that has been added to the formal occupation queue. The master PC can determine the remote PC corresponding to the test script according to the test configuration information required by the test script and the configuration information of at least one remote PC.

[0187] S36, when the test script in the master PC is executed, the master PC sends a release request message to the remote PC corresponding to the test script, and the release request message is used to indicate that the master PC requests to release the remote PC. When the test script in the master PC is executed, the master PC takes out the communication address information of the remote PC corresponding to the test script from the second queue; the master PC sends the release request message to the remote PC corresponding to the test script according to the communication address information of the remote PC corresponding to the test script. When the test script in the master PC is executed, if the master PC needs to release the remote server, the discovery module takes out the IP and port group corresponding to the test script from the formally occupied queue (QUEUE) in turn, and sends a release request message to the remote server corresponding to the test script.

[0188] S37, when receiving the release request message from the master PC, the remote PC sends a release confirmation message to the master PC, and the release confirmation message is used to confirm that the remote PC has been released. After receiving the release request message from the master PC, the monitoring module of the remote PC immediately responds with a confirmation message. When the remote PC sends the release confirmation message to the master PC, the remote PC sets the device use flag to the unoccupied flag. At the same time, the remote PC sets its own UseFlag to 0 and continues to enter the monitoring state.

[0189] Figure 4 is a schematic diagram of a test system provided in one embodiment of the present application.

[0190] like Figure 4 As shown, the present application provides a test system. The test system 4 includes a control device 41 and at least one test device. The at least one test device includes a test device 421, a test device 422, ..., a test device 42N.

[0191] The control device 41 is used to send a device discovery message, where the device discovery message is used to discover at least one test device in the test system 4 .

[0192] When receiving the device discovery message, at least one test device is used to send a device response message to the control device 41 , where the device response message is used to indicate that the test device can respond to the device discovery message of the control device 41 .

[0193] When receiving a device response message from at least one of the test devices, the control device 41 is used to send an occupation request message to the at least one test device, where the occupation request message is used to indicate that the control device 41 requests to occupy the test device.

[0194] When receiving the occupation request message, at least one test device is used to send an occupation confirmation message to the control device 41, where the occupation confirmation message is used to indicate that the test device confirms that it can be occupied.

[0195] After receiving the occupation confirmation message of the at least one test device, the control device 41 is used to execute the test script using the at least one occupied test device.

[0196] When the test script in the control device 41 is executed, the control device 41 is used to send a release request message to the test device corresponding to the test script, and the release request message is used to indicate that the control device 41 requests to release the test device.

[0197] When receiving the release request message from the control device 41 , the test device is used to send a release confirmation message to the control device 41 , where the release confirmation message is used to confirm that the test device has been released.

[0198] The specific description of the above embodiments is the same as or similar to the specific description described above, and will not be repeated here.

[0199] Figure 5 It is a structural diagram of a device in a control device provided in an embodiment of the present application.

[0200] like Figure 5 As shown, the present application provides a device using apparatus 51 in a test system, the test system includes a control device 5 and a plurality of test devices, the apparatus 51 is applied to the control device 5, and the apparatus 51 includes:

[0201] A first sending module 511, configured to send a device discovery message, wherein the device discovery message is used to discover at least one test device in the test system;

[0202] A second sending module 512 is configured to send an occupation request message to at least one test device when receiving a device response message from at least one test device, wherein the device response message is used to indicate that the test device can respond to the device discovery message of the control device, and the occupation request message is used to indicate that the control device requests to occupy the test device;

[0203] A third using module 513 is used to execute a test script using at least one occupied test device after receiving an occupation confirmation message of at least one test device, wherein the occupation confirmation message is used to indicate that the test device confirms that it can be occupied;

[0204] The fourth sending module 514 is used to send a release request message to the test device corresponding to the test script when the test script in the control device is executed. The release request message is used to indicate that the control device requests to release the test device.

[0205] In one embodiment, the second sending module 512 is used to:

[0206] Adding the communication address information of at least one test device to the first queue according to the order in which the device response message of at least one test device is received;

[0207] Taking out the communication address information of the test device from the first queue in a first-in-first-out order;

[0208] According to the communication address information of the test device taken out from the first queue, an occupation request message is sent to the test device.

[0209] In one embodiment, the third using module 513 is used to:

[0210] Adding the communication address information of at least one test device to the second queue according to the order in which the occupation confirmation message of at least one test device is received;

[0211] According to the communication address information of the test device added to the second queue, the communication address information of the test device in the first queue is cleared.

[0212] In one embodiment, the fourth sending module 514 is used to:

[0213] When the test script in the control device is executed, the communication address information of the test device corresponding to the test script is taken out from the second queue;

[0214] According to the communication address information of the test device corresponding to the test script, a release request message is sent to the test device corresponding to the test script.

[0215] In one embodiment, the device response message includes configuration information of the test device, and the apparatus 51 further includes:

[0216] The eighth determination module is used to determine the test device corresponding to the test script according to the test configuration information required by the test script and the configuration information of at least one test device.

[0217] The specific description of the above embodiments is the same as or similar to the specific description described above, and will not be repeated here.

[0218] Figure 6 It is a structural schematic diagram of a device in a testing device provided in an embodiment of the present application.

[0219] like Figure 6As shown, the present application provides a device using apparatus 61 in a test system, the test system includes a control device and a plurality of test devices 6, the apparatus 61 is applied to the test device 6, and the apparatus 61 includes:

[0220] A fifth sending module 611 is configured to send a device response message to the control device when receiving a device discovery message, wherein the device discovery message is used to discover at least one test device in the test system, and the device response message is used to indicate that the test device can respond to the device discovery message of the control device;

[0221] A sixth sending module 612 is used to send an occupation confirmation message to the control device when receiving an occupation request message, wherein the occupation request message is used to indicate that the control device requests to occupy the test device, and the occupation confirmation message is used to indicate that the test device confirms that it can be occupied;

[0222] The seventh sending module 613 is used to send a release confirmation message to the control device when receiving a release request message from the control device, wherein the release request message is used to indicate that the control device requests to release the test device, and the release confirmation message is used to confirm that the test device has been released.

[0223] In one embodiment, the device 61 further includes a ninth configuration module, and the ninth configuration module is used to:

[0224] When the test device sends the device response message to the control device, the device use flag is set to a negotiation flag;

[0225] When the test device sends an occupation confirmation message to the control device, the device use flag is set to an occupied flag;

[0226] When the test device sends a release confirmation message to the control device, the device use flag is set to an unoccupied flag.

[0227] In one embodiment, the device 61 further includes a tenth timing module, and the tenth timing module is used to:

[0228] When the test device sets the device usage flag to the negotiation flag, a timer is started;

[0229] If an occupation request message is received before the timer times out, when the test device sends an occupation confirmation message to the control device, the device use flag is set to an occupied flag and the timer is destroyed;

[0230] If the timer times out and no occupation request message is received, the device usage flag is set to an unoccupied flag and the timer is destroyed.

[0231] The specific description of the above embodiments is the same as or similar to the specific description described above, and will not be repeated here.

[0232] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0233] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0234] The present application also provides an electronic device, such as Figure 7 As shown, the electronic device 7 includes: at least one processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the at least one processor 70, and when the processor 70 executes the computer program 72, the steps in any of the above-mentioned method embodiments are implemented.

[0235] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0236] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0237] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0238] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0239] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0240] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0241] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0242] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for using a device in a test system, characterized in that: The test system comprises a control device and a plurality of test devices, and the method comprises: A control device sends a device discovery message, where the device discovery message is used to discover at least one test device in the test system; When receiving the device discovery message, at least one test device sends a device response message to the control device, wherein the device response message is used to indicate that the test device can respond to the device discovery message of the control device; When receiving a device response message of at least one test device, the control device sends an occupation request message to at least one test device, wherein the occupation request message is used to indicate that the control device requests to occupy the test device; When receiving the occupation request message, at least one test device sends an occupation confirmation message to the control device, wherein the occupation confirmation message is used to indicate that the test device confirms that it can be occupied; After receiving an occupation confirmation message of at least one test device, the control device executes a test script using the at least one occupied test device; When the test script in the control device is executed, the control device sends a release request message to the test device corresponding to the test script, wherein the release request message is used to indicate that the control device requests to release the test device; When receiving the release request message from the control device, the test device sends a release confirmation message to the control device, where the release confirmation message is used to confirm that the test device has been released.

2. The method for using the device in the test system according to claim 1, characterized in that: When receiving a device response message from at least one test device, the control device sends an occupation request message to the at least one test device, including: The control device adds the communication address information of at least one test device to the first queue according to the order in which the device response message of at least one test device is received; The control device takes out the communication address information of the test device from the first queue in a first-in-first-out order; The control device sends an occupation request message to the test device according to the communication address information of the test device taken out from the first queue.

3. The method for using the device in the test system according to claim 2, characterized in that: The receiving of an occupation confirmation message of at least one test device comprises: The control device adds the communication address information of at least one test device to the second queue according to the order in which the occupation confirmation message of at least one test device is received; The control device clears the communication address information of the test device in the first queue according to the communication address information of the test device added to the second queue.

4. The method for using the device in the test system according to claim 3, characterized in that: When the test script in the control device is executed, the control device sends a release request message to the test device corresponding to the test script, including: When the test script in the control device is executed, the control device takes out the communication address information of the test device corresponding to the test script from the second queue; The control device sends a release request message to the test device corresponding to the test script according to the communication address information of the test device corresponding to the test script.

5. The method for using a device in a test system according to any one of claims 1 to 4, characterized in that: The device response message includes configuration information of the test device, and the method further includes: The control device determines the test device corresponding to the test script according to the test configuration information required by the test script and the configuration information of at least one test device.

6. The method for using a device in a test system according to any one of claims 1 to 4, characterized in that: The method further comprises: When the at least one test device sends a device response message to the control device, the at least one test device sets the device use flag to a negotiation flag; When the at least one test device sends an occupation confirmation message to the control device, the at least one test device sets the device use flag to an occupied flag; When the test device sends a release confirmation message to the control device, the test device sets the device use flag to an unoccupied flag.

7. The method for using the device in the test system according to claim 6, characterized in that: The method further comprises: When the at least one test device sets the device use flag to a negotiation flag, the at least one test device starts a timer; If an occupation request message is received before the timer times out, when the at least one test device sends an occupation confirmation message to the control device, the at least one test device sets the device use flag to an occupied flag and destroys the timer; If the timer times out and no occupation request message is received, the at least one test device sets the device usage flag to an unoccupied flag and destroys the timer.

8. A device for using a device in a test system, characterized in that: The test system includes a control device and a plurality of test devices, the device is applied to the control device, and the device includes: A first sending module, configured to send a device discovery message, wherein the device discovery message is used to discover at least one test device in the test system; A second sending module is used to send an occupation request message to at least one test device when receiving a device response message of at least one test device, wherein the device response message is used to indicate that the test device can respond to the device discovery message of the control device, and the occupation request message is used to indicate that the control device requests to occupy the test device; A third using module is used to execute a test script using at least one occupied test device after receiving an occupation confirmation message of at least one test device, wherein the occupation confirmation message is used to indicate that the test device confirms that it can be occupied; The fourth sending module is used to send a release request message to the test device corresponding to the test script when the test script in the control device is executed. The release request message is used to indicate that the control device requests to release the test device.

9. A device for using a device in a test system, characterized in that: The test system includes a control device and a plurality of test devices, and the device is applied to the test devices, and the device includes: a fifth sending module, configured to send a device response message to the control device when receiving a device discovery message, wherein the device discovery message is used to discover at least one test device in the test system, and the device response message is used to indicate that the test device can respond to the device discovery message of the control device; A sixth sending module, configured to send an occupation confirmation message to the control device when receiving an occupation request message, wherein the occupation request message is used to indicate that the control device requests to occupy the test device, and the occupation confirmation message is used to indicate that the test device confirms that it can be occupied; The seventh sending module is used to send a release confirmation message to the control device when receiving a release request message from the control device, wherein the release request message is used to indicate that the control device requests to release the test device, and the release confirmation message is used to confirm that the test device has been released.

10. A testing system, characterized in that: The test system comprises a control device and at least one test device, the control device is used to send a device discovery message, and the device discovery message is used to discover at least one test device in the test system; When receiving the device discovery message, at least one of the test devices is used to send a device response message to the control device, wherein the device response message is used to indicate that the test device can respond to the device discovery message of the control device; When receiving a device response message of at least one of the test devices, the control device is used to send an occupation request message to at least one of the test devices, wherein the occupation request message is used to indicate that the control device requests to occupy the test device; When receiving the occupation request message, at least one of the test devices is used to send an occupation confirmation message to the control device, wherein the occupation confirmation message is used to indicate that the test device confirms that it can be occupied; After receiving an occupation confirmation message of at least one test device, the control device is used to execute a test script using the occupied at least one test device; When the test script in the control device is executed, the control device is used to send a release request message to the test device corresponding to the test script, and the release request message is used to indicate that the control device requests to release the test device; When receiving the release request message from the control device, the test device is used to send a release confirmation message to the control device, where the release confirmation message is used to confirm that the test device has been released.