Automatic peripheral adaptation test method and device, equipment and storage medium

By deploying a full-architecture operating environment on the cloud platform and using automated testing methods, the problems of low peripheral adaptation testing efficiency and insufficient adaptability in the existing technology are solved, and efficient and multi-guaranteed peripheral adaptation testing is achieved.

CN119473841AInactive Publication Date: 2025-02-18ADVANCED OPERATING SYST INNOVATION CENT (TIANJIN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510059593.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-02-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is difficult to test multiple computer systems and peripheral adaptability in peripheral adaptation testing, and the test efficiency is low, which can easily lead to test failure.

Method used

Deploy a full-architecture operation environment that supports the operation of different computer systems on the cloud platform, execute automated peripheral adaptation testing methods through virtual machines, including obtaining test scripts, executing command tests, and automating GUI tests, and recording test data to determine test results.

Benefits of technology

It improves the success rate and efficiency of peripheral adaptation tests, can test multiple computer systems and external devices in parallel, reduces the operational complexity of obtaining test scripts, and provides multiple test guarantees.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473841A_ABST
    Figure CN119473841A_ABST
Patent Text Reader

Abstract

The invention relates to an automatic peripheral adaptation test method and device, equipment and a storage medium. The method comprises the following steps: starting at least one virtual machine carrying different computer systems on a cloud platform; a full-framework operation environment supporting operation of different computer systems is deployed on the cloud platform; for any virtual machine, according to the type of a computer system carried by the virtual machine and the information of the external device to be tested, obtaining a test script corresponding to the peripheral adaptation test; the test script comprises a command test and an automatic GUI test; executing the test script on the virtual machine, and recording test data; and determining a test result of the peripheral adaptation test according to the test data. By adopting the method, the test success rate and the test efficiency of the peripheral adaptation test can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automation technology, and in particular to an automated peripheral adaptation test method, device, equipment and storage medium. Background Art

[0002] With the maturity of operating system (OS) technology and products in my country, the application of domestic operating systems in various industries is becoming more and more common. Computing power is ubiquitous, and smart devices and sensors are widely used in every corner of life, forming a huge intelligent network. In order to meet this demand, a new operating system designed for the human-machine-object fusion computing environment, the ubiquitous operating system (UOS), came into being. The ubiquitous operating system can not only support traditional desktop and server environments, but also adapt to the diverse computing needs of mobile devices, embedded systems, and IoT devices. The ubiquitous operating system supports a wide variety of peripheral devices in large quantities, which requires the operating system to quickly and accurately identify and respond to various peripherals with high compatibility and stability. The compatibility and adaptation of ubiquitous peripheral applications with basic software and hardware layers such as ubiquitous operating systems and chips is the key to promoting the growth of the ubiquitous operating system ecosystem. Therefore, carrying out identification and automated batch testing of peripherals can not only improve test efficiency, but also ensure the compatibility and security between peripheral devices and ubiquitous operating systems, which is of great significance for solving large-scale peripheral adaptation testing.

[0003] In the prior art, peripheral adaptation testing is generally performed on a single machine, which has the problem of being unable to test the adaptability of multiple computer systems and peripherals. Moreover, peripheral adaptability testing often uses script testing methods or GUI (Graphical User Interface) testing methods. Overall, this single testing method is prone to test failures. Separately, the script testing method requires manual selection of test scripts for different computer systems and external devices, while the GUI testing method requires manual execution of a pre-designed GUI testing process, both of which have the problem of low testing efficiency. Summary of the invention

[0004] Based on this, it is necessary to provide an automated peripheral adaptation test method, device, equipment and storage medium to address the above technical problems, so as to improve the test success rate and test efficiency of peripheral adaptation testing.

[0005] In a first aspect, the present invention provides an automated peripheral device adaptation test method, comprising: On the cloud platform, start at least one virtual machine equipped with different computer systems; the cloud platform is deployed with a full-architecture operating environment that supports the operation of different computer systems; For any virtual machine, according to the computer system type and the information of the external device to be tested installed in the virtual machine, obtain the test script corresponding to the peripheral adaptation test; the test script includes command test and automated GUI test; Execute test scripts on the virtual machine and record test data; Based on the test data, the test result of the peripheral adaptation test is determined.

[0006] In one of the embodiments, a test script is executed on a virtual machine and test data is recorded, including: executing a command test; if the command test fails, executing an automated GUI test.

[0007] In one embodiment, the automated GUI test includes a first control test and / or a second control test; if the command test fails to execute, the automated GUI test is executed, including: executing the first control test and recording the number of times the first control test fails to execute; if the number of times the first control test fails to execute reaches a first preset number of executions, executing the second control test and recording the number of times the second control test fails to execute.

[0008] In one of the embodiments, a first control test is executed and the number of times the first control test fails to execute is recorded, including: obtaining a screenshot of the display interface of the virtual machine; matching keyword information of the control to be executed in the screenshot of the display interface through a first matching algorithm to obtain the position of the control to be executed on the display interface; simulating keyboard and mouse operations through an automatic control function, moving the mouse cursor to the position of the control to be executed on the display interface of the virtual machine, and executing the test operation by clicking the control to be executed; if the test operation fails to execute, it is determined that the first control test has failed to execute, and the number of times the first control test has failed to execute is accumulated.

[0009] In one embodiment, the first matching setting parameters of the first matching algorithm include: language matching settings, first area matching settings and text fuzzy matching settings; the method also includes: if the first control test fails to execute, but the number of times the first control test fails to execute does not reach a first preset number of executions, then changing the first matching setting parameters and re-executing the first control test.

[0010] In one of the embodiments, a second control test is executed, and the number of times the second control test fails to execute is recorded, including: obtaining a screenshot of the display interface of the virtual machine; matching the image information of the control to be executed in the screenshot of the display interface through a second matching algorithm to obtain the position of the control to be executed on the display interface; simulating keyboard and mouse operations through an automatic control function, moving the mouse cursor to the position of the control to be executed on the display interface of the virtual machine, and executing the test operation by clicking the control to be executed; if the test operation fails to execute, it is determined that the second control test has failed to execute, and the number of times the second control test has failed to execute is accumulated.

[0011] In one embodiment, the second matching setting parameters of the second matching algorithm include: matching image settings, desktop background settings, grayscale settings, image compression settings, second matching range settings and image fuzzy matching settings; the method also includes: if the second control test fails to execute, but the number of times the second control test fails to execute does not reach a second preset number of executions, then the second matching setting parameters are changed and the second control test is re-executed.

[0012] In a second aspect, the present invention further provides an automated peripheral device adaptation test device, comprising: An opening module is used to open at least one virtual machine equipped with different computer systems on the cloud platform; the cloud platform is deployed with a full-architecture operating environment supporting the operation of different computer systems; The acquisition module is used to acquire the test script corresponding to the peripheral adaptation test for any virtual machine according to the type of computer system carried by the virtual machine and the type of external device to be tested; the test script includes command test and automated GUI test; An execution module, used to execute the test script on the virtual machine and record the test data; The determination module is used to determine the test result of the peripheral adaptation test according to the test data.

[0013] In a third aspect, the present invention further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: On the cloud platform, start at least one virtual machine equipped with different computer systems; the cloud platform is deployed with a full-architecture operating environment that supports the operation of different computer systems; For any virtual machine, according to the computer system type and the information of the external device to be tested installed in the virtual machine, obtain the test script corresponding to the peripheral adaptation test; the test script includes command test and automated GUI test; Execute test scripts on the virtual machine and record test data; Based on the test data, the test result of the peripheral adaptation test is determined.

[0014] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented: On the cloud platform, start at least one virtual machine equipped with different computer systems; the cloud platform is deployed with a full-architecture operating environment that supports the operation of different computer systems; For any virtual machine, according to the computer system type and the information of the external device to be tested installed in the virtual machine, obtain the test script corresponding to the peripheral adaptation test; the test script includes command test and automated GUI test; Execute test scripts on the virtual machine and record test data; Based on the test data, the test result of the peripheral adaptation test is determined.

[0015] The above-mentioned automated peripheral adaptation test method, apparatus, equipment and storage medium, by deploying a full-architecture operating environment that supports the operation of different computer systems on a cloud platform, enables different virtual machines to carry and run different computer systems, and then performs peripheral adaptation tests on multiple computer systems and external devices to be tested in parallel, thereby improving the efficiency of peripheral adaptation testing; for any virtual machine, according to the type of computer system carried by the virtual machine and the information of the external device to be tested, the test script corresponding to the peripheral adaptation test is obtained, replacing the manual script selection method and reducing the operational complexity of obtaining the test script; more importantly, after combining command testing and automated GUI testing, even if the command test fails, the automated GUI test can still be executed, providing multiple guarantees for the peripheral adaptation test and improving the success rate of the peripheral adaptation test. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings required for use in the embodiments of the present invention or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A schematic diagram of a flow chart of an automated peripheral device adaptation test method in one embodiment; Figure 2 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0018] The technical scheme in the embodiment of the present invention is described clearly and completely below in conjunction with the accompanying drawings in the embodiment of the present invention. In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.

[0019] In an optional embodiment, an automated peripheral device adaptation test method is provided. In this embodiment, the method comprises the following steps: S110, on the cloud platform, start at least one virtual machine equipped with a different computer system.

[0020] Among them, a full-architecture operating environment can be deployed on the cloud platform. The full-architecture operating environment can be understood as an integrated operating environment that can support the operation of computer systems of different architectures. Optionally, the computer system may include components such as a hardware system and a software system. The hardware system may include CPU chips with computing, storage and control functions, such as Feiteng, Haiguang, Kunpeng, Loongson, Zhaoxin, etc.; the software system may include operating systems with functions such as managing computer resources, such as Kirin and Tongxin. Further, the virtual machine can be understood as a virtualized environment for peripheral adaptation testing of computer systems and external devices to be tested. Optionally, different virtual machines can be equipped with different computer systems to perform peripheral adaptation tests on multiple computer systems in parallel.

[0021] In an optional embodiment, at least one virtual machine image file may be constructed and stored on a cloud platform; on the cloud platform, a virtual machine equipped with a corresponding computer system may be started through different virtual machine image files.

[0022] Among them, the virtual machine image file can be understood as a file containing the complete configuration of the virtual machine and the computer system. Exemplarily, the process of building a virtual machine image file may include: starting the virtual machine with a pure kylin-desktop-v10-sp1-2303-x86 (or other versions of the Linux system) image; installing python3-pip; using pip to install uvicorn, selenium, fastapi, pinyin, Pillow, pyautogui, pyperclip, PyYaml, minio, paddlepaddle, paddleocr, pyscreeze, python-xlib, retrying, python-logstash and other python packages; using the apt-get command to install xclip, libcupsimage2, python3-tk, scrot and other packages; uninstalling unnecessary software; adding a startup item that requires desktop permissions in the / etc / lightdm / lightdm.conf configuration file, giving the root user desktop permissions; installing the usb-box client; reinstalling the cups network printing system; and packaging the virtual machine into an image.

[0023] In an optional embodiment, after starting the virtual machine, the virtual machine can be logged in through remote control software (such as ssh, etc.); the virtual machine is controlled to execute git instructions to pull project codes.

[0024] The project code can be understood as a test system code, which is used to install a test system on a virtual machine. The test system can provide a running environment for the test script on the virtual machine.

[0025] S120, for any virtual machine, according to the type of computer system installed in the virtual machine and the information of the external device to be tested, obtain a test script corresponding to the peripheral adaptation test.

[0026] Among them, the test script can be understood as a script file that automatically executes a series of operations on the virtual machine to complete the peripheral adaptation test. Test scripts can be divided into python scripts and shell scripts according to different writing languages. Test scripts can include command tests and automated GUI tests. Command tests can be understood as a test method for performing operations in the command interface; automated GUI tests can be understood as a test method for performing operations in the display interface.

[0027] Furthermore, the computer system type may include an operating system type, etc., and the external device information to be tested may include a device unique identifier, a device name, a device brand, a device model, etc.

[0028] In an optional embodiment, if the external device to be tested is a deli printer and the operating system type is a Kylin operating system, the virtual machine can be controlled to send a get request to the corresponding port of the test server to obtain the test script. The request parameters of the get request can include test parameters of the peripheral adaptation test, such as the download path of the control to be executed, the operating system type, the test script information (such as the download path), the task ID, the information of the external device to be tested, etc.

[0029] The control to be executed can be understood as a control for executing a test operation. For example, if the external device to be tested is a deli printer, the corresponding control to be executed can be a driver installation program of the deli printer, and the test operation is to install the deli printer driver; if the external device to be tested is a keyboard, the corresponding control to be executed can be a text box, and the test operation can be to enter a specified text in the text box.

[0030] S130, executing the test script on the virtual machine and recording the test data.

[0031] The test data may include a test log and a test video. The test log may be understood as a file recording detailed data of the test process, and the test video may be understood as a recorded video of the test process.

[0032] Optionally, the test data can be uploaded to a third-party minio remote file system and remote database. When the test results are returned, the link to the uploaded test data can be directly returned. The test interface caller can download the test data through the above link to reduce the size of the returned data.

[0033] S140, determining a test result of the peripheral adaptation test according to the test data.

[0034] In an optional embodiment, if the test data shows that the test operation is successfully executed, it is determined that the peripheral device adaptation test is successful; if the test data shows that the test operation is not successfully executed, it is determined that the peripheral device adaptation test has failed.

[0035] In this embodiment, by deploying a full-architecture operating environment that supports the operation of different computer systems on a cloud platform, different computer systems can be mounted and run on different virtual machines, and then peripheral adaptation tests are performed on multiple computer systems and external devices to be tested in parallel, thereby improving the efficiency of peripheral adaptation tests; for any virtual machine, the test script corresponding to the peripheral adaptation test is obtained according to the type of computer system mounted on the virtual machine and the information of the external device to be tested, thereby replacing the manual script selection method and reducing the operational complexity of obtaining the test script; more importantly, after combining command testing and automated GUI testing, even if the command test fails, the automated GUI test can still be executed, which provides multiple guarantees for the peripheral adaptation test and improves the success rate of the peripheral adaptation test.

[0036] Based on the technical solutions of the above embodiments, the present invention also provides an optional embodiment. In this optional embodiment, the steps of executing the test script are refined, including: S210, executing command test.

[0037] Optionally, the command test may include a Linux command test, etc. The Linux command test may be understood as a test method for executing Linux commands through a test script. Exemplarily, if the external device to be tested is a deli printer, the command test may include: inputting the driver installation instruction of the deli printer in the command line tool. If the driver installation of the deli printer is successful, it indicates that the command test is successful; if the driver installation of the deli printer fails, it indicates that the command test fails.

[0038] S220: If the command test fails to execute, then execute the automated GUI test.

[0039] Among them, the automated GUI test may include a first control test and a second control test, etc. The first control test may be understood as a method of determining the position of the control to be executed by identifying the text information of the control to be executed, and controlling the control to be executed to perform the test operation; the second control test may be understood as a method of determining the position of the control to be executed by identifying the image information of the control to be executed, and controlling the control to be executed to perform the test operation.

[0040] In an optional embodiment, for scenarios where command testing is not applicable, automated GUI testing can be directly performed. The above scenarios include specifying automated GUI testing and being unable to perform test operations through command testing.

[0041] In this embodiment, by combining command testing and automated GUI testing, when the command testing fails, the automated GUI testing can still be performed, thereby providing multiple safeguards for the peripheral device adaptation testing and improving the success rate of the peripheral device adaptation testing.

[0042] Based on the technical solutions of the above embodiments, the present invention further provides an optional embodiment, in which a step of performing automated GUI testing is added, including: S310, executing a first control test, and recording the number of times the first control test fails to execute.

[0043] In an optional embodiment, the step of executing the first control test may include: obtaining a screenshot of the display interface of the virtual machine; matching the keyword information of the control to be executed in the screenshot of the display interface through a first matching algorithm to obtain the position of the control to be executed on the display interface; simulating keyboard and mouse operations through an automatic control function, moving the mouse cursor to the position of the control to be executed on the display interface of the virtual machine, and executing the test operation by clicking the control to be executed; if the test operation fails to be executed, it is determined that the first control test has failed to execute, and the number of times the first control test has failed to execute is accumulated.

[0044] Among them, the first matching algorithm can be understood as a method for determining the location of the control to be executed on the display interface through text recognition. The keyword information of the control to be executed can include the name of the control to be executed, etc. Exemplarily, if the control to be executed is a driver installation program for a deli printer, the keyword information can be "deli driver installation program". The automatic control function can be understood as a function for simulating a user to perform mouse operations and / or keyboard operations, such as a pyautogui function.

[0045] Optionally, after obtaining the screenshot of the display interface, the text information in the screenshot of the display interface can be extracted through a text recognition method (such as an OCR algorithm, etc.); the position of the control to be executed on the display interface is determined by matching the text information with keyword information of the control to be executed.

[0046] Optionally, the above text information includes the text position (e.g., coordinates) of the text on the display interface; further, if the text information corresponding to the keyword information is matched in the screenshot of the display interface, the text position is also obtained. Further, the text position can be adjusted according to the known positional relationship between the control to be executed and the text position, thereby determining the position of the control to be executed on the display interface.

[0047] Exemplarily, if the external device to be tested is a deli printer, the test operation is to install the deli printer driver, and the process of the first control test may include: after identifying the location of the driver installation program on the display interface, the mouse cursor may be moved to the driver installation program, and the driver installation program may be double-clicked to install the driver. If the deli printer driver installation fails, the first control test fails; if the deli printer driver installation succeeds, the first control test succeeds.

[0048] In another optional embodiment, the first matching setting parameters of the first matching algorithm may include: language matching settings, first area matching settings and text fuzzy matching settings; if the first control test fails to execute, but the number of times the first control test fails to execute does not reach the first preset number of executions, the first matching setting parameters are changed and the first control test is re-executed.

[0049] Among them, the first matching setting parameters can be understood as parameters for adjusting the first matching algorithm. The language matching settings may include settings for matching texts in different languages ​​in the text information separately. Exemplarily, if the text information includes Chinese information and English information, and the keyword information also includes Chinese information and English information, the language matching settings can be turned on to match the Chinese information and English information of the text information and keyword information respectively to improve the matching success rate. The first area matching setting can be understood as setting the range for matching keyword information in the display interface screenshot, for example, by narrowing the area for text matching to improve the recognition rate. The text fuzzy matching setting may include string fuzzy matching, for example: by traversing the keyword substring of the keyword information string until the keyword substring is matched in the display interface screenshot or the maximum number of matches is reached.

[0050] In an optional embodiment, each time the first matching setting parameters are adjusted, at least one parameter of the first matching setting parameters may be adjusted.

[0051] S320: If the number of execution failures of the first control test reaches a first preset execution number, a second control test is executed, and the number of execution failures of the second control test is recorded.

[0052] It is understandable that if the number of failed executions of the first control test reaches the first preset execution number, it means that the peripheral adaptation test cannot be completed through the first control test, and the peripheral adaptation test needs to be further performed through the second control test.

[0053] In an optional embodiment, the step of executing the second control test may include: obtaining a screenshot of the display interface of the virtual machine; matching the image information of the control to be executed in the screenshot of the display interface through a second matching algorithm to obtain the position of the control to be executed on the display interface; simulating keyboard and mouse operations through an automatic control function, moving the mouse cursor to the position of the control to be executed on the display interface of the virtual machine, and executing the test operation by clicking the control to be executed; if the test operation fails to be executed, it is determined that the second control test has failed to execute, and the number of times the second control test fails to execute is accumulated.

[0054] The second matching algorithm can be understood as a method for determining the position of the control to be executed on the display interface through image recognition. The image information of the control to be executed can include a desktop icon image of the control to be executed, etc. If the control to be executed is a driver installation program of a deli printer, the image information can be an icon of the driver installation program.

[0055] In another optional embodiment, the second matching setting parameters of the second matching algorithm include: matching image settings, desktop background settings, grayscale settings, image compression settings, second matching range settings and image fuzzy matching settings; if the second control test fails to execute, but the number of times the second control test fails to execute does not reach the second preset number of executions, the second matching setting parameters are changed and the second control test is re-executed.

[0056] Among them, the second matching setting parameters can be understood as parameters for adjusting the second matching algorithm. The matching image setting can be understood as setting the image information of the control to be executed for matching, for example: increasing the number of desktop icon images of the control to be executed for matching, as long as any desktop icon image is matched in the screenshot of the display interface, the position of the control to be executed on the display interface can be determined, thereby improving the matching success rate.

[0057] Optionally, desktop background settings may include setting the color of the desktop background, such as by setting the desktop background color to black to avoid interference of complex color background on matching; and setting the resolution of the desktop background, such as setting the desktop resolution and the image resolution in the image information to the same resolution to avoid matching failure due to different resolutions.

[0058] Optionally, the grayscale setting can be understood as the color matching setting for the display interface screenshot and the image information. By changing the RGB matching to RGBA matching, the transparency matching is added. When there is an overlapping area in the display interface screenshot, the image content in the area below the overlap can still be matched, thereby improving the matching success rate.

[0059] Optionally, the image compression setting can be understood as a setting for compressing the image information of the control to be executed. For example, the image information can be lossily compressed to remove unimportant parts of the image information, so that when the display interface screenshot is matched with the image information, less data needs to be matched, thereby improving the success rate of matching.

[0060] Optionally, the second matching range setting can be understood as setting a range for matching image information in the display interface screenshot. For example, setting the image information matching in the area where the application icon is located in the display interface screenshot can narrow the matching range of the image information and thus improve the matching success rate.

[0061] Optionally, the image fuzzy matching setting can be understood as setting the display interface screenshot and image information to confirm that the match is successful when they meet the target confidence level. For example, using the OpenCV API to search for images, adding the confidence parameter to the local function can reduce the matching accuracy to improve the matching success rate.

[0062] In an optional embodiment, each time the second matching setting parameters are adjusted, at least one parameter of the second matching setting parameters may be adjusted.

[0063] In this embodiment, in the case of command test failure, the peripheral adaptation test can still be implemented through two automated GUI testing methods, namely the first control test and the second control test, thereby providing multiple test guarantees and improving the success rate of the peripheral adaptation test.

[0064] In an alternative embodiment, if Figure 1 As shown, an automated peripheral adaptation test method is provided, comprising: S410, on the cloud platform, pull up the virtual machine image and log in to the virtual machine through remote SSH.

[0065] S420, control the virtual machine to pull the project code through the git command.

[0066] S430, enables the virtual machine to send a test script request to the test server through the http protocol to obtain the test script; the request parameters of the script test request may include test parameters of the peripheral adaptation test, such as the download path of the control to be executed, the operating system type, the test script information, the task ID, the external device information to be tested, etc.

[0067] S440, executing the test script in the test system of the virtual machine, recording the test log through the log system, and recording the test video through the screen recording system.

[0068] S450, storing the test log and the test video in a remote server, and sending the storage address to an external control system.

[0069] S460, the external control system obtains the test log and the test video according to the storage address.

[0070] S470, if the computer system in the next peripheral adaptation test is the same as the computer system in the current peripheral adaptation test, execute S430-S470; if the computer system in the next peripheral adaptation test is different from the computer system in the current peripheral adaptation test, execute S410-S470.

[0071] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0072] Based on the same inventive concept, an embodiment of the present invention further provides an automated peripheral device adaptation test device for implementing the automated peripheral device adaptation test method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more automated peripheral device adaptation test device embodiments provided below can refer to the limitations of the method above, and will not be repeated here.

[0073] In an exemplary embodiment, an automated peripheral device adaptation test device is provided, comprising: an opening module, an acquisition module, an execution module and a determination module, wherein: The startup module is used to start at least one virtual machine equipped with different computer systems on the cloud platform; the cloud platform is deployed with a full-architecture operating environment that supports the operation of different computer systems.

[0074] The acquisition module is used to obtain the test script corresponding to the peripheral adaptation test for any virtual machine according to the type of computer system carried by the virtual machine and the type of external device to be tested; the test script includes command testing and automated GUI testing.

[0075] A first execution module, used for executing a test script on a virtual machine and recording test data; The second execution module is used to determine the test result of the peripheral adaptation test according to the test data.

[0076] In one of the embodiments, the execution module includes: a first execution unit, used to execute command testing; and a second execution unit, used to execute automated GUI testing if the command testing fails.

[0077] In one embodiment, the second execution unit includes: a first execution sub-unit, used to execute the first control test and record the number of times the first control test fails to execute; a first execution sub-unit, used to execute the second control test and record the number of times the second control test fails to execute if the number of times the first control test fails to execute reaches a first preset execution number.

[0078] In one of the embodiments, the first execution sub-unit is further used to: obtain a screenshot of the display interface of the virtual machine; match the keyword information of the control to be executed in the screenshot of the display interface through a first matching algorithm to obtain the position of the control to be executed on the display interface; simulate keyboard and mouse operations through an automatic control function, move the mouse cursor to the position of the control to be executed on the display interface of the virtual machine, and execute a test operation by clicking the control to be executed; if the test operation fails to be executed, it is determined that the first control test has failed to execute, and the number of times the first control test has failed to execute is accumulated.

[0079] In one embodiment, the first matching setting parameters of the first matching algorithm include: language matching settings, first area matching settings and text fuzzy matching settings; the first execution subunit is also used to change the first matching setting parameters and re-execute the first control test if the first control test fails to execute, but the number of failures of the first control test execution does not reach a first preset execution number.

[0080] In one of the embodiments, the second execution sub-unit is further used to: obtain a screenshot of the display interface of the virtual machine; match the image information of the control to be executed in the screenshot of the display interface through a second matching algorithm to obtain the position of the control to be executed on the display interface; simulate keyboard and mouse operations through an automatic control function, move the mouse cursor to the position of the control to be executed on the display interface of the virtual machine, and execute the test operation by clicking the control to be executed; if the test operation fails to be executed, it is determined that the second control test has failed to execute, and the number of times the second control test has failed to execute is accumulated.

[0081] In one embodiment, the second matching setting parameters of the second matching algorithm include: matching image settings, desktop background settings, grayscale settings, image compression settings, second matching range settings and image fuzzy matching settings; the second execution subunit is also used to change the second matching setting parameters and re-execute the second control test if the second control test fails to execute, but the number of failures of the second control test does not reach a second preset number of executions.

[0082] Each module in the above device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0083] In an exemplary embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 2 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores a computer system and a computer program. The internal memory provides an environment for the operation of the computer system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, an automated peripheral adaptation test method is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0084] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the present invention, and does not constitute a limitation on the computer device to which the present invention is applied. The specific computer device may include more or less components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0085] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented: On the cloud platform, start at least one virtual machine equipped with different computer systems; the cloud platform is deployed with a full-architecture operating environment that supports the operation of different computer systems; For any virtual machine, according to the computer system type and the information of the external device to be tested installed in the virtual machine, obtain the test script corresponding to the peripheral adaptation test; the test script includes command test and automated GUI test; Execute test scripts on the virtual machine and record test data; Based on the test data, the test result of the peripheral adaptation test is determined.

[0086] In one embodiment, when the processor executes the computer program, the following steps are also implemented: executing the test script on the virtual machine and recording the test data, including: executing the command test; if the command test fails to execute, executing the automated GUI test.

[0087] In one embodiment, the processor also implements the following steps when executing the computer program: the automated GUI test includes a first control test and / or a second control test; if the command test fails to execute, the automated GUI test is executed, including: executing the first control test and recording the number of times the first control test fails to execute; if the number of times the first control test fails to execute reaches a first preset number of executions, executing the second control test and recording the number of times the second control test fails to execute.

[0088] In one embodiment, when the processor executes the computer program, the following steps are also implemented: executing a first control test and recording the number of times the first control test fails to execute, including: obtaining a screenshot of the display interface of the virtual machine; matching the keyword information of the control to be executed in the screenshot of the display interface through a first matching algorithm to obtain the position of the control to be executed on the display interface; simulating keyboard and mouse operations through an automatic control function, moving the mouse cursor to the position of the control to be executed on the display interface of the virtual machine, and executing the test operation by clicking the control to be executed; if the test operation fails to execute, it is determined that the first control test has failed to execute, and the number of times the first control test has failed to execute is accumulated.

[0089] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the first matching setting parameters of the first matching algorithm include: language matching settings, first area matching settings and text fuzzy matching settings; the method also includes: if the first control test fails to execute, but the number of times the first control test fails to execute does not reach a first preset number of executions, then the first matching setting parameters are changed and the first control test is re-executed.

[0090] In one embodiment, when the processor executes the computer program, the following steps are also implemented: executing a second control test and recording the number of times the second control test fails to execute, including: obtaining a screenshot of the display interface of the virtual machine; matching the image information of the control to be executed in the screenshot of the display interface through a second matching algorithm to obtain the position of the control to be executed on the display interface; simulating keyboard and mouse operations through an automatic control function, moving the mouse cursor to the position of the control to be executed on the display interface of the virtual machine, and executing the test operation by clicking the control to be executed; if the test operation fails to execute, it is determined that the second control test has failed to execute, and the number of times the second control test has failed to execute is accumulated.

[0091] In one embodiment, the processor also implements the following steps when executing the computer program: the second matching setting parameters of the second matching algorithm include: matching image settings, desktop background settings, grayscale settings, image compression settings, second matching range settings and image fuzzy matching settings; the method also includes: if the second control test fails to execute, but the number of times the second control test fails to execute does not reach a second preset number of executions, then the second matching setting parameters are changed and the second control test is re-executed.

[0092] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: On the cloud platform, start at least one virtual machine equipped with different computer systems; the cloud platform is deployed with a full-architecture operating environment that supports the operation of different computer systems; For any virtual machine, according to the computer system type and the information of the external device to be tested installed in the virtual machine, obtain the test script corresponding to the peripheral adaptation test; the test script includes command test and automated GUI test; Execute test scripts on the virtual machine and record test data; Based on the test data, the test result of the peripheral adaptation test is determined.

[0093] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: executing a test script on a virtual machine and recording test data, including: executing a command test; if the command test fails, executing an automated GUI test.

[0094] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the automated GUI test includes a first control test and / or a second control test; if the command test fails to execute, the automated GUI test is executed, including: executing the first control test and recording the number of times the first control test fails to execute; if the number of times the first control test fails to execute reaches a first preset number of executions, executing the second control test and recording the number of times the second control test fails to execute.

[0095] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: executing a first control test and recording the number of times the first control test fails to execute, including: obtaining a screenshot of the display interface of the virtual machine; matching the keyword information of the control to be executed in the screenshot of the display interface through a first matching algorithm to obtain the position of the control to be executed on the display interface; simulating keyboard and mouse operations through an automatic control function, moving the mouse cursor to the position of the control to be executed on the display interface of the virtual machine, and executing the test operation by clicking the control to be executed; if the test operation fails to execute, it is determined that the first control test has failed to execute, and the number of times the first control test has failed to execute is accumulated.

[0096] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the first matching setting parameters of the first matching algorithm include: language matching settings, first area matching settings and text fuzzy matching settings; the method also includes: if the first control test fails to execute, but the number of times the first control test fails to execute does not reach the first preset number of executions, then the first matching setting parameters are changed and the first control test is re-executed.

[0097] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: executing a second control test and recording the number of times the second control test fails to execute, including: obtaining a screenshot of the display interface of the virtual machine; matching the image information of the control to be executed in the screenshot of the display interface through a second matching algorithm to obtain the position of the control to be executed on the display interface; simulating keyboard and mouse operations through an automatic control function, moving the mouse cursor to the position of the control to be executed on the display interface of the virtual machine, and executing the test operation by clicking the control to be executed; if the test operation fails to execute, it is determined that the second control test has failed to execute, and the number of times the second control test has failed to execute is accumulated.

[0098] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the second matching setting parameters of the second matching algorithm include: matching image settings, desktop background settings, grayscale settings, image compression settings, second matching range settings and image fuzzy matching settings; the method also includes: if the second control test fails to execute, but the number of times the second control test fails to execute does not reach the second preset number of executions, then the second matching setting parameters are changed and the second control test is re-executed.

[0099] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present invention may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided by the present invention may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0100] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present invention.

[0101] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. An automated peripheral device adaptation test method, characterized in that: The method comprises: On a cloud platform, at least one virtual machine equipped with different computer systems is started; the cloud platform is deployed with a full-architecture operating environment that supports the operation of different computer systems; For any virtual machine, according to the type of computer system carried by the virtual machine and the information of the external device to be tested, obtain the test script corresponding to the peripheral adaptation test; the test script includes command test and automated GUI test; Executing the test script on the virtual machine and recording test data; A test result of the peripheral device adaptation test is determined according to the test data.

2. The method according to claim 1, characterized in that The executing the test script on the virtual machine and recording the test data includes: Execute the command test; If the command test fails to execute, the automated GUI test is executed.

3. The method according to claim 2, characterized in that The automated GUI test includes a first control test and / or a second control test; if the command test fails to execute, executing the automated GUI test includes: Execute the first control test, and record the number of times the first control test fails to execute; If the number of execution failures of the first control test reaches a first preset execution number, the second control test is executed and the number of execution failures of the second control test is recorded.

4. The automated peripheral device adaptation test method according to claim 3, characterized in that: The performing of the first control test and recording the number of times the first control test fails to be performed includes: Obtaining a screenshot of the display interface of the virtual machine; Using a first matching algorithm, matching keyword information of the to-be-executed control in the display interface screenshot to obtain a position of the to-be-executed control on the display interface; The keyboard and mouse operations are simulated by the automatic control function, the mouse cursor is moved to the position of the control to be executed on the display interface of the virtual machine, and the test operation is performed by clicking the control to be executed; if the test operation fails to be executed, it is determined that the first control test has failed to execute, and the number of times the first control test has failed to execute is accumulated.

5. The automated peripheral device adaptation test method according to claim 4, characterized in that: The first matching setting parameters of the first matching algorithm include: language matching setting, first region matching setting and text fuzzy matching setting; The method further comprises: If the first control test fails to be executed, but the number of times the first control test fails to be executed does not reach the first preset execution number, the first matching setting parameter is changed and the first control test is executed again.

6. The method according to claim 3, characterized in that: The executing the second control test and recording the number of times the second control test fails to execute includes: Obtaining a screenshot of the display interface of the virtual machine; By using a second matching algorithm, the image information of the control to be executed is matched in the screenshot of the display interface to obtain the position of the control to be executed on the display interface; The keyboard and mouse operations are simulated through the automatic control function, the mouse cursor is moved to the position of the control to be executed on the display interface of the virtual machine, and the test operation is performed by clicking the control to be executed; if the test operation fails, it is determined that the second control test has failed, and the number of times the second control test has failed is accumulated.

7. The method according to claim 6, characterized in that The second matching setting parameters of the second matching algorithm include: matching image setting, desktop background setting, grayscale setting, image compression setting, second matching range setting and image fuzzy matching setting; The method further comprises: If the second control test fails to be executed, but the number of times the second control test fails to be executed does not reach a second preset execution number, the second matching setting parameters are changed and the second control test is executed again.

8. An automated peripheral adaptation test device, characterized in that: The device comprises: An opening module is used to open at least one virtual machine equipped with different computer systems on a cloud platform; the cloud platform is deployed with a full-architecture operating environment supporting the operation of different computer systems; An acquisition module is used to acquire a test script corresponding to a peripheral adaptation test for any virtual machine according to the type of computer system carried by the virtual machine and the type of external device to be tested; the test script includes a command test and an automated GUI test; An execution module, used for executing the test script on the virtual machine and recording test data; A determination module is used to determine the test result of the peripheral adaptation test according to the test data.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are 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 steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Test method and system of operation system identity authentication mechanism

    CN104657639A

  • Industrial software compatibility testing method under multiple localization platforms

    CN113918452A

  • Printer driver installation method and device and readable storage medium

    CN116048551A

  • Desktop application test method and device, electronic equipment and program product

    CN116431461A