Smart home equipment test method and device, computer equipment and storage medium
By generating a cloud testing environment and using virtual testing equipment and cloud home devices to execute test cases, traditional localized testing cannot cope with cross-regional problems, and efficient smart home device testing is achieved.
Patent Information
- Application Number
- CN202510292165.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-07-08
AI Technical Summary
Traditional localized testing methods for smart home devices cannot meet the testing needs across regions, especially in distributed teams and remote office environments, and cannot cope with test scenarios with large spans.
By generating a cloud testing environment, using virtual test devices and cloud home devices to execute test cases, implement cross-regional smart home device testing, including obtaining test requests, generating test tasks, predicting and calling cloud resources, executing test cases and sending results to a distributed database.
It realizes smart home equipment testing without geographical restrictions, improves testing efficiency and coverage, and solves the problem that localized testing cannot cope with large span ranges.
Smart Images

Figure CN120276983A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a method, device, computer equipment, and storage medium for testing smart home devices. Background Art
[0002] With the rapid iteration of smart home software development, the traditional local testing method for smart home devices can no longer meet the requirements of efficient and high-quality testing. Especially in the context of the increasing popularity of distributed teams and remote work, the test environment and development environment may span globally. The local testing means for smart home devices cannot be separated from the inherent test environment and test equipment, so they cannot handle test scenarios with a large span. Therefore, there is an urgent need for a testing means for smart home devices that can cross regions. Summary of the Invention
[0003] This application provides a method, device, computer equipment, and storage medium for testing smart home devices to solve the problem that the local testing means for smart home devices cannot handle test scenarios with a large span.
[0004] In the first aspect, this application provides a method for testing smart home devices, and the method includes:
[0005] Obtain a smart home device test request, where the smart home device test request is used to request virtual testing of a target home device;
[0006] Generate a test task and a cloud test environment corresponding to the test task according to the smart home device test request;
[0007] Predict and call cloud resources corresponding to each test case in the test task, where the cloud resources include virtual test devices and cloud home devices;
[0008] Execute the corresponding test case using the cloud resources corresponding to each test case in the cloud test environment to obtain test results corresponding to each test case;
[0009] Send the test results corresponding to each test case to a distributed database.
[0010] In the second aspect, this application provides a device for testing smart home devices, and the device includes:
[0011] An obtaining module, configured to obtain a smart home device test request, where the smart home device test request is used to request virtual testing of a target home device;
[0012] A processing module, configured to generate a test task and a cloud test environment corresponding to the test task according to the smart home device test request;
[0013] A calling module, configured to predict and call cloud resources corresponding to each test case in the test task, where the cloud resources include virtual test devices and cloud home devices;
[0014] An execution module, configured to execute corresponding test cases by using the cloud resources corresponding to each test case in the cloud test environment, and obtain test results corresponding to each test case;
[0015] A sending module, configured to send the test results corresponding to each test case to a distributed database.
[0016] In a third aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned smart home device testing method is implemented.
[0017] In a fourth aspect, the present application further provides a computer storage medium, storing computer-executable instructions, where the computer-executable instructions are used to execute the above-mentioned smart home device testing method.
[0018] The above technical solution provided by the embodiments of the present application has the following advantages compared with the prior art: In the method provided by the embodiments of the present application, a smart home device testing request is obtained, where the smart home device testing request is used to request virtual testing of a target home device; a test task and a cloud test environment corresponding to the test task are generated according to the smart home device testing request; cloud resources corresponding to each test case in the test task are predicted and called, where the cloud resources include virtual test devices and cloud home devices; corresponding test cases are executed by using the cloud resources corresponding to each test case in the cloud test environment, and test results corresponding to each test case are obtained; the test results corresponding to each test case are sent to a distributed database.
[0019] Based on the above method, since the cloud resources include virtual test devices and cloud home devices, both virtual test devices and cloud home devices can be called without being restricted by geographical span. The cloud resources that ignore geographical restrictions are used to execute the test task that meets the smart home device testing request, getting rid of the inherent test environment and test devices, so as to cope with test scenarios with a relatively large span, and solving the problem that the local smart home device testing means cannot cope with test scenarios with a relatively large span. Description of the Drawings
[0020] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments that conform to the present invention, and are used together with the specification to explain the principles of the present invention.
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following briefly introduces the attached drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other attached drawings can also be obtained based on these attached drawings.
[0022] One or more embodiments are exemplarily illustrated by the pictures in the corresponding attached drawings. These exemplary illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the attached drawings are represented as similar elements. Unless otherwise stated, the figures in the attached drawings do not constitute a proportional limitation.
[0023] Figure 1 It is an application environment diagram of a smart home device testing method provided by an embodiment of this application;
[0024] Figure 2 It is a schematic flowchart of a smart home device testing method provided by an embodiment of this application;
[0025] Figure 3 It is a schematic flowchart of a smart home device testing method provided by an embodiment of this application;
[0026] Figure 4 It is a schematic flowchart of a smart home device testing method provided by an embodiment of this application;
[0027] Figure 5 It is a schematic flowchart of a smart home device testing method provided by an embodiment of this application;
[0028] Figure 6 It is a schematic flowchart of a smart home device testing method provided by an embodiment of this application;
[0029] Figure 7 It is a schematic flowchart of a smart home device testing method provided by an embodiment of this application;
[0030] Figure 8 It is a schematic flowchart of a smart home device testing method provided by an embodiment of this application;
[0031] Figure 9 It is a schematic flowchart of a smart home device testing method provided by an embodiment of this application;
[0032] Figure 10 It is a structural block diagram of a smart home device testing apparatus provided by an embodiment of this application;
[0033] Figure 11 It is an internal structural diagram of a computer device provided by an embodiment of this application. Detailed implementation manners
[0034] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts belong to the scope of protection of this application.
[0035] The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. To simplify the disclosure of the present invention, the components and settings of specific examples are described below. Of course, they are only examples and are not intended to limit the present invention. In addition, the present invention may repeat reference numerals and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0036] Figure 1 It is an application environment diagram of a smart home device testing method in an embodiment. Refer to Figure 1 , this smart home device testing method is applied to a smart home device testing system. The smart home device testing system includes a test terminal 110 and a smart home device testing device 120. The test terminal 110 and the smart home device testing device 120 are connected through a network. The test terminal 110 may specifically be a desktop terminal or a mobile terminal, and the mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The test terminal 110 is used to initiate a smart home device testing request to the smart home device testing device to request the smart home device testing device 120 to perform virtual testing on a target home device. The smart home device testing device 120 may be implemented by an independent server or a server cluster composed of multiple servers.
[0037] In one embodiment, Figure 2 It is a flowchart of a smart home device testing method in an embodiment. Refer to Figure 2 , a smart home device testing method is provided. This embodiment mainly takes the application of this method to the smart home device testing device 120 in the above Figure 1 as an example to illustrate. The smart home device testing method specifically includes the following steps:
[0038] Step S210, obtain a smart home device testing request, where the smart home device testing request is used to request virtual testing of a target home device.
[0039] Specifically, the smart home device test request is a request initiated by the test terminal 110 to the smart home device test apparatus 120 for requesting a virtual test of the target home device. The smart home device test request specifically includes a test object and test content. The test object is the target home device, which can be any existing smart home device, such as a smart refrigerator, a smart air conditioner, a smart TV, a smart speaker, a smart washing machine, etc. The virtual test is to simulate the operating environment of the target home device to perform a cloud test on the target home device or the cloud home device matching the target home device, so as to obtain the test result corresponding to the target home device.
[0040] Step S220: Generate a test task and the cloud test environment corresponding to the test task according to the smart home device test request.
[0041] Specifically, determine the test process and test scenario based on the test content in the smart home device test request, generate a test task according to the test process. Each step in the test process corresponds to a test case, that is, the test task includes multiple test cases sorted in sequence according to the test steps. Determine the cloud test environment for executing the test task according to the test scenario. The cloud test environment includes the system environment and application environment for the smart home device test apparatus 120 to execute the test cases.
[0042] Step S230: Predict and call the cloud resources corresponding to each test case in the test task, where the cloud resources include virtual test devices and cloud home devices.
[0043] Specifically, predict the cloud resources required for each test case in the test task. The cloud resources include virtual test devices and cloud home devices participating in the virtual test. The virtual test devices include virtual control terminals, virtual routing terminals, virtual gateways, etc. The cloud home device refers to the smart home device that supports cloud call in the preset computer room. Multiple different types of smart home devices for participating in the cloud test are installed in the preset computer room. In the R & D scenario, the target home device can be a cloud home device; in the after-sales scenario, the target home device is the smart home device purchased by the user and does not belong to the cloud home device in the preset computer room.
[0044] Step S240: Execute the corresponding test cases in the cloud test environment by using the cloud resources corresponding to each test case to obtain the test results corresponding to each test case.
[0045] Specifically, for local testing, different types of test equipment and / or smart home devices required for testing need to be arranged on-site. It is easily restricted by on-site hardware configuration and venue, making it impossible to improve test efficiency and coverage. However, in this embodiment, by invoking cloud resources to execute each test case and obtain the test results corresponding to each test case, full test coverage can be achieved, breaking away from the limitations of the inherent test environment and test equipment, and effectively improving test efficiency and coverage.
[0046] Step S250, send the test results corresponding to each of the test cases to the distributed database.
[0047] Specifically, send the test results of each test case to the distributed database, and store the test results of each test case through the distributed database, so that multiple different testers can synchronously obtain the test process of the target home device through the distributed database.
[0048] Based on the above method, since the cloud resources include virtual test devices and cloud home devices, the virtual test devices and cloud home devices can be invoked without being restricted by geographical span. Use cloud resources that ignore geographical restrictions to execute test tasks that meet the test requests of smart home devices, break away from the inherent test environment and test equipment, so as to cope with test scenarios with a large span, and solve the problem that the local smart home device test means cannot cope with test scenarios with a large span.
[0049] In one embodiment, as Figure 3 shown, the obtaining of the smart home device test request includes:
[0050] Step S211, when receiving the smart home device test configuration, generate the smart home device test request according to the smart home device test configuration; or,
[0051] Step S212, when receiving the after-sales feedback of the home device, generate the smart home device test request according to the after-sales feedback of the home device.
[0052] Specifically, the smart home device test configuration is a test configuration set by a tester through the test terminal 110 in the R & D scenario, which is used to indicate the tester's test requirements for the target home device, so as to ensure that the R & D results of the target home device meet the expected effects. The smart home device test configuration specifically includes the test object and the test content. For example, the test object is a smart air conditioner, and the test content is to perform a network configuration test on the smart air conditioner to determine whether the network configuration function of the smart air conditioner is normal. Generate the corresponding smart home device test request according to the smart home device test configuration, and the smart home device test request contains all the content in the smart home device test configuration.
[0053] The after-sales feedback of home appliances is the after-sales content fed back by the customer through the test terminal 110 in the after-sales scenario, which is used to indicate the test requirements for the target home appliance that needs after-sales testing, so as to determine the after-sales treatment plan for the target home appliance. The after-sales feedback of home appliances specifically includes the abnormal state of the target home appliance, the operating parameters and appearance parameters under the abnormal state, etc. For example, if the target home appliance is a smart air conditioner, the abnormal state is abnormal network configuration, and the operating parameters under the abnormal state include the power-on state, the enabled state of the wireless communication module, the network configuration scan list, etc., and the appearance parameters include the lighting state, the display content on the screen, etc. The smart home device test request is generated according to the after-sales feedback of home appliances, and the smart home device test request contains all the content in the after-sales feedback of home appliances.
[0054] In different test scenarios, the acquisition methods of the smart home device test request are different to support the test requirements of different objects for testing the target home appliance.
[0055] In one embodiment, referring to Figure 4 , generating a test task and the corresponding cloud test environment for the test task according to the smart home device test request includes:
[0056] Step S221, generating a test task according to the test content in the smart home device test request;
[0057] Step S222, deploying the cloud test environment corresponding to the smart home device test request by using a virtual container, where the cloud test environment includes different operating systems and different types of browsers.
[0058] Specifically, the test content includes the test purpose and the test process. A test task is generated according to the test content. The test task is composed of multiple test cases, and the test cases correspond to the execution content of each test step in the test process. The virtual container is a Docker container. The virtual container will automatically install the software programs required for the test according to the smart home device test request to deploy the cloud test environment corresponding to the smart home device test request, that is, to deploy the operating system and browser required for the test. The operating system can be the Windows XP system, the Windows system or the Linux system, and the browser can be any one of the Chrome browser, the Edge browser, the IE browser, the Firefox browser, etc. Ensure that each test is carried out under the same conditions by changing a single test variable to accurately determine the test results under different test variables. When the test variable is the operating system, it is used to test the compatibility under different operating systems. When the test variable is the browser, it is used to test the compatibility under different browsers.
[0059] The automatic deployment of the cloud test environment through the virtual container can improve the test efficiency of smart home devices.
[0060] In one embodiment, referring to Figure 5 , predicting and invoking cloud resources corresponding to each test case in the test task includes:
[0061] Step S231, predicting cloud resources corresponding to each test case in the test task by using a regression model;
[0062] Step S232, invoking cloud resources corresponding to each test case according to a load balancing scheme in a cloud resource pool.
[0063] Specifically, referring to Figure 5 and Figure 9 , a regression model is used to predict the time series corresponding to the test task, that is, historical cloud resource data used in the historical test process corresponding to the test task is used to predict the cloud resources required for each test case when the current prediction task is executed. Based on the cloud resources used in the previous test process of the test process, the required cloud resources are automatically amplified or reduced, so as to predict the cloud resources required for each test case in the current test task. For example, by predicting the time series corresponding to the test task, it is obtained that the data concurrency and required resources are higher from the 20th to the 25th minute in the previous test process, and the highest peak does not exceed a certain threshold. Then, appropriate cloud resources can be scheduled in advance to prepare for the current test process. However, the current test process will be dynamically updated due to software version iteration, so it is necessary to monitor historical dynamic changes for dynamic adjustment. If the peak value of the previous test process increases by 10% after each version iteration, then 10% more test resources can be prepared in advance for the next version iteration to wait for invocation, instead of waiting until after the threshold is exceeded and then waiting for allocation.
[0064] The cloud resource pool contains multiple cloud resources that support invocation. However, when invoking cloud resources, it is necessary to preferentially invoke cloud resources with an idle working state and the fewest load connection numbers according to the load balancing scheme, so as to ensure the maximum utilization rate of cloud resources.
[0065] In one embodiment, as Figure 6 shown, after invoking cloud resources corresponding to each test case according to a load balancing scheme in the cloud resource pool, the method further includes:
[0066] Step S233, during the process of executing the corresponding test case by using the cloud resources corresponding to each test case in the cloud test environment, obtaining the target cloud resource utilization rate, where the target cloud resource utilization rate is the ratio between the number of target cloud resources in the used state and the total number of target cloud resources, and the target cloud resources are virtual test devices or cloud home devices;
[0067] Step S234, when the usage rate of the target cloud resource is greater than the preset usage rate, add the target cloud resource to the cloud resource pool.
[0068] Specifically, referring to Figure 6 and Figure 9 , during the execution of the test case, it is necessary to obtain the usage rate of the target cloud resource to determine whether the target cloud resource meets the short-term execution requirements of the current test case. The target cloud resource can be any one of the virtual test terminal 110, virtual routing terminal, virtual gateway, cloud home device, etc. The usage rate of the target cloud resource is the ratio between the number of used target cloud resources in the cloud resource pool and the total number of all target cloud resources. The usage rate of the target cloud resource is used to indicate the usage proportion of the target cloud resource in the cloud resource pool. If the usage rate of the target cloud resource exceeds the corresponding preset usage rate, it means that the number of used target cloud resources in the cloud resource pool is relatively large, and the number of remaining available target cloud resources is relatively small, which may not be able to meet the short-term execution requirements of the current test case. Therefore, it is necessary to add target cloud resources to increase the number of available target cloud resources in the cloud resource pool, and dynamically adjust the number of cloud resources in the cloud resource pool according to the short-term execution requirements of the test case to meet the short-term execution requirements of the test case.
[0069] In one embodiment, as Figure 7 shown, execute the corresponding test cases using the cloud resources corresponding to each of the test cases in the cloud test environment, and obtain the test results corresponding to each of the test cases, including:
[0070] Step S241, in the same cloud test environment, execute the corresponding test cases in a distributed and parallel manner using the cloud resources corresponding to each of the test cases, and obtain the test results corresponding to each of the test cases.
[0071] Specifically, referring to Figure 7 and Figure 9 , in the same cloud test environment, the corresponding test cases can be executed in sequence according to the test process using the cloud resources corresponding to each test case, or the cloud resources corresponding to each test case can be distributed and parallelly executed using the Appium tool to implement distributed testing, ensure that the tests can be synchronized, and improve the test efficiency.
[0072] In one embodiment, referring to Figure 8 and Figure 9 , after sending the test results corresponding to each of the test cases to the distributed database, the method further includes:
[0073] Step S260, use a message queue to send the test results of each of the test cases in the distributed database to multiple monitoring terminals;
[0074] Step S270, when there is no test result of the test case corresponding to the target home device in the message queue, use a virtual container to destroy the cloud test environment and release the cloud resources corresponding to each test case.
[0075] Specifically, the test results corresponding to each test case in the distributed database are sent to the monitoring terminals corresponding to different testers through the message queue. The test data is stored in the distributed database. The message queue is used to ensure the reliability and real-time of data transmission. The real-time communication tool (websocket) is used for message push notification to achieve real-time synchronization and sharing of the test process, so as to realize the synchronization of the test process across multiple terminals and regions, breaking the limitations of distance and cost.
[0076] When there is no test result of the test case corresponding to the target home device in the message queue, it means that the test results of all test cases have been successfully sent to each monitoring terminal, indicating that the test task has been completed. Then, use a virtual container to destroy the cloud test environment and release the cloud resources corresponding to each test case, so as to dynamically change the usage status of the cloud resources in the cloud resource pool according to the execution status of the test task, and avoid waste of resources caused by long-term occupation of cloud resources and addition of new cloud resources.
[0077] Refer to Figure 9 , before testing, it is necessary to create and manage cloud resources and cloud test environments in the smart home device test device. Figure 9 The dynamic allocation and recycling of resources in [] includes predicting and allocating cloud resources for test tasks and recycling cloud resources after the test tasks are completed. Polling the resource occupancy situation is to judge whether the usage rate of the target cloud resources exceeds the threshold when executing test cases. Obtaining the environment configuration is to obtain the smart home device test request, and then deploy the cloud test environment according to the smart home device test request for subsequent testing. Distributed testing is realized through the Appium tool, so as to execute different test cases on different test devices to achieve distributed testing. Then, the test results of the test cases are stored in the distributed database, and the test results are pushed to different monitoring terminals through the real-time communication tool to realize the multi-terminal cross-regional viewing of the execution process of the test task. After the test task is completed, the cloud test environment is destroyed and the cloud resources are recycled to avoid waste of resources.
[0078] Through the above embodiments, when the project iterates or the customer feedbacks problems, the cloud debugging of smart home devices can be enabled through a simple mobile phone and a computer, without worrying about resource bottlenecks, and the environment exactly the same as the customer's home can be simulated at any time for testing, and the current test situation of the device can be viewed at any time and anywhere, which provides great help for the test tracking of solving cross-regional customer problems.
[0079] Figures 2 to 9 It is a schematic flowchart of a method for testing smart home devices in different embodiments. It should be understood that although Figures 2 to 9 each step in the flowchart is shown in sequence according to the indication of the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figures 2 to 9 at least a part of the steps in
[0080] In one embodiment, as Figure 10 shown, a smart home device testing apparatus 120 is provided, including:
[0081] An acquisition module 310, configured to acquire a smart home device test request, where the smart home device test request is used to request a virtual test for a target home device;
[0082] A processing module 320, configured to generate a test task and a cloud test environment corresponding to the test task according to the smart home device test request;
[0083] An invocation module 330, configured to predict and invoke cloud resources corresponding to each test case in the test task, where the cloud resources include virtual test devices and cloud home devices;
[0084] An execution module 340, configured to execute corresponding test cases by using cloud resources corresponding to each test case in the cloud test environment to obtain test results corresponding to each test case;
[0085] A sending module 350, configured to send the test results corresponding to each test case to a distributed database.
[0086] In one embodiment, the acquisition module 310 is further configured to:
[0087] In the case of receiving a smart home device test configuration, generate the smart home device test request according to the smart home device test configuration; or,
[0088] In the case of receiving after-sales feedback of a home device, generate the smart home device test request according to the after-sales feedback of the home device.
[0089] In one embodiment, the processing module 320 is further configured to:
[0090] Generate a test task according to the test content in the smart home device test request;
[0091] Deploy the cloud test environment corresponding to the smart home device test request by using virtual containers, where the cloud test environment includes different operating systems and different types of browsers.
[0092] In one embodiment, the calling module 330 is further configured to:
[0093] Predict the cloud resources corresponding to each test case in the test task by using a regression model;
[0094] Call the cloud resources corresponding to each test case according to the load balancing scheme in the cloud resource pool.
[0095] In one embodiment, the calling module 330 is further configured to:
[0096] During the process of executing the corresponding test case by using the cloud resources corresponding to each test case in the cloud test environment, obtain the target cloud resource utilization rate, where the target cloud resource utilization rate is the ratio between the number of target cloud resources in the used state and the total number of target cloud resources, and the target cloud resources are virtual test devices or cloud home devices;
[0097] When the target cloud resource utilization rate is greater than the preset utilization rate, add the target cloud resources in the cloud resource pool.
[0098] In one embodiment, the execution module 340 is further configured to:
[0099] In the same cloud test environment, use the cloud resources corresponding to each test case to execute the corresponding test case in a distributed and parallel manner, and obtain the test results corresponding to each test case.
[0100] In one embodiment, the sending module 350 is further configured to:
[0101] Send the test results of each test case in the distributed database to multiple monitoring terminals by using a message queue;
[0102] When the test result of the test case corresponding to the target home device does not exist in the message queue, destroy the cloud test environment by using virtual containers and release the cloud resources corresponding to each test case.
[0103] Such as Figure 11As shown in the figure, an embodiment of the present application provides a computer device, including a processor 711, a communication interface 712, a memory 713, and a communication bus 714. Among them, the processor 711, the communication interface 712, and the memory 713 complete communication with each other through the communication bus 714;
[0104] The memory 713 is used to store computer programs;
[0105] When the processor 711 is used to execute the program stored on the memory 713, it implements the smart home device testing method provided by any one of the foregoing method embodiments.
[0106] Those skilled in the art can understand that Figure 11 The structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0107] In one embodiment, the smart home device testing apparatus 120 provided by the present application can be implemented in the form of a computer program, and the computer program can run on a computer device as Figure 11 shown. Each program module constituting the smart home device testing apparatus 120 can be stored in the memory of the computer device. For example, Figure 10 the acquisition module 310, the processing module 320, the invocation module 330, the execution module 340, and the sending module 350 shown. The computer program constituted by each program module enables the processor to execute the smart home device testing methods of the various embodiments of the present application described in this specification.
[0108] Figure 11 The computer device shown can execute the acquisition of the smart home device testing request through the acquisition module 310 in the smart home device testing apparatus 120 as Figure 10 shown, where the smart home device testing request is used to request virtual testing of the target home device. The computer device can execute the generation of the test task and the corresponding cloud test environment according to the smart home device testing request through the processing module 320. The computer device can execute the prediction and invocation of the cloud resources corresponding to each test case in the test task through the invocation module 330, where the cloud resources include virtual test devices and cloud home devices. The computer device can execute the execution of the corresponding test cases using the cloud resources corresponding to each test case in the cloud test environment through the execution module 340 to obtain the test results corresponding to each test case. The computer device can execute the sending of the test results corresponding to each test case to the distributed database through the sending module 350.
[0109] The embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the smart home device testing method provided in any of the foregoing method embodiments.
[0110] The device embodiments described above are merely illustrative. 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 may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0111] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0112] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless otherwise clearly specified in the context, the singular forms "a", "an" and "the" as used herein may also include the plural forms. The terms "comprising", "including", "containing" and "having" are inclusive and thus specify the presence of the stated features, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be executed in the specific order described or illustrated, unless the execution order is clearly specified. It should also be understood that additional or alternative...
[0113] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for testing a smart home device, characterized in that, The method includes: Obtaining a smart home device test request, where the smart home device test request is used to request a virtual test for a target home device; Generating a test task and a cloud test environment corresponding to the test task according to the smart home device test request; Predicting and invoking cloud resources corresponding to each test case in the test task, where the cloud resources include virtual test devices and cloud home devices; Executing corresponding test cases in the cloud test environment by using the cloud resources corresponding to each test case to obtain test results corresponding to each test case; Sending the test results corresponding to each test case to a distributed database.
2. The method according to claim 1, characterized in that, The obtaining of the smart home device test request includes: When receiving a smart home device test configuration, generating the smart home device test request according to the smart home device test configuration; or, When receiving after-sales feedback of a home device, generating the smart home device test request according to the after-sales feedback of the home device.
3. The method according to claim 1, wherein The generating of the test task and the cloud test environment corresponding to the test task according to the smart home device test request includes: Generating a test task according to the test content in the smart home device test request; Deploying the cloud test environment corresponding to the smart home device test request by using virtual containers, where the cloud test environment includes different operating systems and different types of browsers.
4. The method according to claim 1, characterized in that The predicting and invoking of the cloud resources corresponding to each test case in the test task includes: Predicting the cloud resources corresponding to each test case in the test task by using a regression model; Invoking the cloud resources corresponding to each test case according to a load balancing scheme in a cloud resource pool.
5. The method according to claim 4, wherein After invoking the cloud resources corresponding to each test case according to a load balancing scheme in a cloud resource pool, the method further includes: During the process of executing corresponding test cases by using the cloud resources corresponding to each test case in the cloud test environment, obtaining a target cloud resource utilization rate, where the target cloud resource utilization rate is the ratio between the number of target cloud resources in a used state and the total number of target cloud resources, and the target cloud resources are virtual test devices or cloud home devices; When the target cloud resource utilization rate is greater than a preset utilization rate, adding the target cloud resources in the cloud resource pool.
6. The method according to claim 1, wherein The executing of corresponding test cases in the cloud test environment by using the cloud resources corresponding to each test case to obtain test results corresponding to each test case includes: In the same cloud test environment, executing corresponding test cases in a distributed and parallel manner by using the cloud resources corresponding to each test case to obtain test results corresponding to each test case.
7. The method according to claim 1, wherein After sending the test results corresponding to each test case to a distributed database, the method further includes: Sending the test results of each test case in the distributed database to multiple monitoring terminals by using a message queue; When the test results of the test cases corresponding to the target home device do not exist in the message queue, destroying the cloud test environment by using virtual containers and releasing the cloud resources corresponding to each test case.
8. A smart home device testing apparatus, characterized in that, The device includes: An acquisition module, configured to acquire a smart home device test request, where the smart home device test request is used to request a virtual test for a target home device; A processing module, configured to generate a test task and a cloud test environment corresponding to the test task according to the smart home device test request; An invocation module, configured to predict and invoke cloud resources corresponding to each test case in the test task, where the cloud resources include virtual test devices and cloud home devices; An execution module, configured to execute corresponding test cases by using the cloud resources corresponding to each test case in the cloud test environment to obtain test results corresponding to each test case; A sending module, configured to send the test results corresponding to each test case to a distributed database.
9. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.