Test method and device, test equipment and medium

Through the test model based on neural network algorithm, the display effect of smart watches and smart bracelet dials is automatically tested, which solves the problems of misjudging and missed testing caused by artificial dependence in the existing technology, and achieves an efficient and accurate testing process.

CN120218153APending Publication Date: 2025-06-27BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311786711.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, there is manual dependence on the testing process of smart watches and smart bracelet dials, resulting in miscalculation and missed testing problems. The test time is long and the cost is high, making it difficult to meet personalized needs.

Method used

The test model trained based on neural network algorithm is used to calculate the matching degree by obtaining the image to be tested and the reference image expected to be displayed on the screen of the electronic device to automatically test the display effect of the dial.

Benefits of technology

Automatic testing is realized, reducing manual participation, improving test accuracy and comprehensiveness, saving manpower and economic costs, and shortening the R&D cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120218153A_ABST
    Figure CN120218153A_ABST
Patent Text Reader

Abstract

The invention relates to a test method and device, test equipment and a medium, and is applied to the test equipment, and the test method comprises the steps: obtaining a to-be-tested image; using a pre-trained test model to test whether the to-be-tested image is consistent with a reference image, the reference image being an image expected to be displayed on the screen of the electronic device. According to the test method disclosed by the invention, the to-be-tested image expected to be displayed on the screen of the electronic equipment can be tested based on the test model obtained by training the neural network algorithm, and due to the adoption of the automatic test method, a wide test scene can be covered in a relatively short test time, the problems of false test and missing test are avoided, and the test efficiency is improved. The test accuracy is improved, the comprehensiveness and reliability of the test method are improved, meanwhile, a large amount of labor cost and economic cost are saved, and the research and development period is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of electronic devices, and in particular, to a testing method, apparatus, testing device, and medium. Background Art

[0002] With the development of technology, wearable electronic devices such as smart watches and smart bracelets are widely used in daily life, providing users with convenient, intelligent, and personalized usage functions to help users manage time, health, and communication processes. The watch face is one of the core functions of wearable electronic devices. The styles of watch faces are diverse and can meet the personalized needs of users. However, there are not only a wide variety of watch faces, but also various elements are set on the watch face. The testing process before the watch face is put on the market is a challenge for testers. Summary of the Invention

[0003] To overcome the problems in the related art, the present disclosure provides a testing method, apparatus, testing device, and medium.

[0004] According to the first aspect of the embodiments of the present disclosure, a testing method is provided, which is applied to a testing device. The testing method includes:

[0005] Obtain an image to be tested;

[0006] Use a pre-trained testing model to test whether the image to be tested is consistent with a reference image, where the reference image is an image expected to be displayed on the screen of an electronic device;

[0007] Wherein, the testing model is a model trained based on a neural network algorithm.

[0008] In some exemplary embodiments of the present disclosure, the training method of the testing model includes:

[0009] Obtain multiple groups of image sample groups, each group of image sample groups including a reference sample and a test sample, where the reference sample is an image expected to be displayed on the screen of an electronic device, the test sample is an image actually displayed on the screen of the electronic device, and the test sample is generated based on the reference sample;

[0010] Mark the image sample groups to form a training data set, the training data set including a first marked sample group and a second marked sample group, the first matching degree parameter between the reference sample and the test sample in the first marked sample group being greater than or equal to a preset matching degree parameter, and the first matching degree parameter between the reference sample and the test sample in the second marked sample group being less than the preset matching degree parameter;

[0011] Based on the training data set, use a neural network algorithm to train to obtain the testing model.

[0012] In some exemplary embodiments of the present disclosure, the marking of the image sample groups to form a training data set includes:

[0013] Based on a preset image matching algorithm, calculate a first matching degree parameter between the reference sample and the test sample in each group of the image sample groups;

[0014] Based on the preset matching degree parameter and the first matching degree parameter of each group of the image sample groups, set the marking value of each group of the image sample groups to obtain the first marked sample group with a first marking value and the second marked sample group with a second marking value, where the marking value is used to characterize whether the reference sample and the test sample in each group of the image sample groups match;

[0015] The first marked sample group and the second marked sample group form the training data set.

[0016] In some exemplary embodiments of the present disclosure, the preset image matching algorithm includes multiple sub-algorithms. The calculating of the first matching degree parameter between the reference sample and the test sample in each group of the image sample groups based on the preset image matching algorithm includes:

[0017] Use multiple of the sub-algorithms to calculate the matching degree between the reference sample and the test sample in each group of the image sample groups respectively to obtain multiple second matching degree parameters;

[0018] Perform normalization processing on the multiple second matching degree parameters of each group of the image sample groups to obtain the first matching degree parameter of each group of the image sample groups.

[0019] In some exemplary embodiments of the present disclosure, the obtaining of the test model by training using a neural network algorithm based on the training data set includes:

[0020] Obtain the image sample groups with marking errors in the training data set, and change the marking values of the image sample groups with marking errors to obtain a corrected training data set;

[0021] Based on the corrected training data set, perform training using a neural network algorithm to obtain the test model.

[0022] In some exemplary embodiments of the present disclosure, the test method further includes:

[0023] Before marking the image sample groups, perform image preprocessing on the reference sample and the test sample;

[0024] Among them, the image preprocessing includes at least one of noise reduction processing, graphic size adjustment, and image background color processing.

[0025] In some exemplary embodiments of the present disclosure, the obtaining of multiple groups of image sample groups includes:

[0026] Obtaining a plurality of the reference samples, the reference samples being generated based on an image editor;

[0027] Based on the plurality of reference samples and a preset call model, adjusting the target features in each of the reference samples to obtain a plurality of the test samples, the reference samples corresponding one-to-one to the test samples;

[0028] The corresponding reference samples and the test samples form a group of the image sample groups.

[0029] In some exemplary embodiments of the present disclosure, the obtaining of the plurality of the test samples includes:

[0030] Controlling an image after target feature adjustment to be displayed on a screen of the electronic device;

[0031] Taking a screenshot of the image displayed on the screen of the electronic device, and the intercepted image is used as the test sample.

[0032] In some exemplary embodiments of the present disclosure, the target features include at least one of the type of the electronic device, the system type supported by the electronic device, the screen shape of the electronic device, and the display elements of the electronic device.

[0033] According to a second aspect of the embodiments of the present disclosure, there is provided a testing device, which is applied to a testing device, and the testing device includes:

[0034] An obtaining module, configured to obtain an image to be tested;

[0035] An execution module, configured to use a pre-trained test model to test whether the image to be tested is consistent with a reference image, the reference image being an image expected to be displayed on a screen of an electronic device;

[0036] Among them, the test model is a model obtained by training based on a neural network algorithm.

[0037] According to a third aspect of the embodiments of the present disclosure, there is provided a testing device, and the testing device includes:

[0038] A screen;

[0039] A processor;

[0040] A memory for storing instructions executable by the processor;

[0041] Wherein, the processor is configured to execute executable instructions in the memory to implement the test method provided in the first aspect of the present disclosure.

[0042] According to a fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, on which executable instructions are stored, and when the executable instructions are executed by a processor, the test method provided in the first aspect of the present disclosure is implemented.

[0043] Adopting the above method of the present disclosure has the following beneficial effects: The test method in the present disclosure can test a to-be-tested image expected to be displayed on the screen of an electronic device based on a test model obtained by training with a neural network algorithm. Since an automated test method is adopted, a wide range of test scenarios can be covered within a short test time, avoiding the problems of mis-testing and missed testing. This not only improves the test accuracy, but also enhances the comprehensiveness and reliability of the test method. At the same time, a large amount of labor costs and economic costs are saved, and the R & D cycle is shortened.

[0044] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present invention, and are used together with the specification to explain the principles of the present invention.

[0046] Figure 1 is a flowchart of a test method shown according to an exemplary embodiment.

[0047] Figure 2 is a flowchart of a test method shown according to an exemplary embodiment.

[0048] Figure 3 is a flowchart of a test method shown according to an exemplary embodiment.

[0049] Figure 4 is a flowchart of a test method shown according to an exemplary embodiment.

[0050] Figure 5 is a block diagram of a test device shown according to an exemplary embodiment.

[0051] Figure 6 is a block diagram of a test device shown according to an exemplary embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0053] Currently, the accuracy test of the dial display in the industry is mainly carried out manually. The number of dials that can be used on each electronic device (such as smart watches and smart bracelets) is more than 200, while each tester can only complete the test of 7 dials per day. Completing the test of all dials of each electronic device requires huge human and time costs. In addition, due to various factors such as different systems used by smart watches and smart bracelets and different shapes of the watch bodies, there are many elements and styles included in the dials. Each dial contains at least 5 elements. Since the test process needs to cover all possibilities of the display of each element, there are problems such as a wide test range and great test difficulty in the test process, and the manual test process completely depends on the subjective judgment of the tester. Therefore, it is very easy to occur mismeasurement and missed measurement.

[0054] To solve the above problems, the present disclosure provides a test method, which is applied to a test device, obtains a to-be-tested image, and uses a test model trained by a neural network algorithm to test whether the to-be-tested image is consistent with a reference image expected to be displayed on the screen of an electronic device. The present disclosure uses the test model to complete the test process of the to-be-tested image applied to the electronic device, reduces the human participation in the test process, effectively avoids problems such as mismeasurement and missed measurement, effectively improves the accuracy, comprehensiveness and reliability of the test process, saves a large amount of labor costs and economic costs at the same time, and shortens the R & D cycle of the electronic device and its supporting products.

[0055] An exemplary embodiment of the present disclosure provides a test method, which is applied to a test device. The test device tests images, themes, dials, etc. applied to an electronic device. The electronic device can specifically be a smart device with a screen display function such as a smart watch, a smart bracelet, a smart phone, a tablet computer, etc. The test method in this embodiment can be used to test the dials applied to smart watches and smart bracelets, and can also be used to test the theme interfaces, etc. applied to smart phones and tablet computers.

[0056] As Figure 1 shown, the test method shown in the present disclosure includes:

[0057] S101. Obtain a to-be-tested image;

[0058] S102. Use the pre-trained test model to test whether the image to be tested is the same as the reference image, where the reference image is the image expected to be displayed on the screen of the electronic device.

[0059] In step S101, the test device obtains the image to be tested of the electronic device through communication transmission with the electronic device. There are various display elements and features on the screen of the electronic device, such as time, date, battery power, display size, etc. The tester can set the display elements on the screen of the electronic device and change the displayed font, size, etc. In addition, the tester can also directly download existing screen display themes from the network for use, take a screenshot of the image displayed on the screen of the electronic device, and use the intercepted image as the image to be tested. When the electronic device is specifically a smart watch or a smart bracelet, the image to be tested is the watch face; when the electronic device is specifically a smart phone or a tablet computer, the image to be tested is the theme interface.

[0060] In step S102, the purpose of testing the watch faces of smart watches and smart bracelets is to ensure that after the watch face is applied to the smart watch or the smart bracelet, the watch face actually displayed on the smart watch and the smart bracelet is the same as the display effect of the target watch face expected to be provided to the user, and there will be no problems such as display errors. Therefore, before the watch face is officially launched, it needs to be tested. During the testing process, it is necessary to test whether there is a large difference between the watch face actually displayed on the screen and the expected watch face. If there is a large difference, it indicates that the watch face actually displayed on the screen does not meet the expectations and cannot be launched for use and needs to be adjusted.

[0061] The reference image is the correct image expected to be displayed on the screen of the electronic device. The test model is a model obtained by training based on the neural network algorithm. The test model can determine whether the two are the same by determining the matching degree between the image to be tested and the reference image to determine whether the image to be tested is correct. Therefore, after the test model is trained, the test device can use the trained test model to test the watch face to be launched. Input the image to be tested and the reference image corresponding to the image to be tested into the trained test model. The test model classifies the image to be tested. If it is determined that the image to be tested matches the reference image, the result 0 is output; if it is determined that the image to be tested does not match the reference image, the result 1 is output. The test device can display the output result to inform the tester; it can also prompt the tester of the specific test result in the form of sound or vibration; it can also automatically generate a corresponding test report according to the set test report template and send it to the corresponding tester by email. The content of the test report can include test items, test time, the tester who executed the test, test results, etc.

[0062] The test method of the present disclosure realizes automated testing for the test process of the dial, reduces the human participation process in the test process, and avoids the occurrence of mismeasurement and missed measurement. Since various elements can be tested in the test model, a wide range of test scenarios are covered, improving the test efficiency and test reliability, which is beneficial to reducing the R & D cycle and R & D cost of the dial.

[0063] According to an exemplary embodiment, as Figure 2 shown, the test method shown in the present disclosure includes:

[0064] S201. Obtain multiple groups of image sample groups, each group of image sample groups including a reference sample and a test sample;

[0065] S202. Mark the image sample groups to form a training data set;

[0066] S203. Based on the training data set, use a neural network algorithm for training to obtain a test model;

[0067] S204. Obtain an image to be tested;

[0068] S205. Use the pre-trained test model to test whether the image to be tested is the same as the reference image.

[0069] Among them, steps S204 and S205 are the same as the implementation manners in the above embodiments and will not be elaborated here.

[0070] In step S201, the reference sample is an image expected to be displayed on the screen of the electronic device, that is, a template of the image to be displayed on the screen of the smart watch or bracelet. The reference sample can be used to judge the correctness of the image displayed on the screen during the test process. The test sample is an image actually displayed on the screen of the electronic device. The test device generates multiple test samples based on the saved reference sample. Each test sample corresponds to each reference sample. The reference sample and the test sample generated based on the reference sample are used as a group of image sample groups. One reference sample can generate multiple test samples. When forming the image sample groups, the reference samples in multiple groups of image sample groups can be the same, but the test samples in different groups are different. Thus, for one reference sample, by changing various different elements or features on the reference sample, multiple groups of image sample groups can be formed to improve the comprehensiveness of the test process.

[0071] The test device can obtain and save multiple current popular display images through interaction with the Internet, and can appropriately process and adjust them for use as reference samples; the reference samples can also be generated by an image editor, and the device or equipment for testing can obtain and save the images generated by the image editor as reference samples through interaction with the image editor. There is no restriction on the way for the test device to obtain reference samples. Among them, the test samples and the corresponding reference samples can have the same or different display characteristics, and the corresponding values of the display characteristics can also be the same or different. The generation process of the test samples can be randomly generated by software or can be generated by manually modifying the reference samples according to requirements.

[0072] For example, in a group of image samples, the reference sample has two display elements, weather and date, and the test sample generated based on this reference sample only has one display element, weather. Another example, in a group of image samples, the reference sample has two display elements, weather and date, then the test sample generated based on this reference sample also has two display elements, weather and date, but the specific display content of the same display element is different. The date of the reference sample is displayed as November 11th, and the date of the test sample is displayed as November 1st.

[0073] Here, it should be noted that since the image sample group will be applied to the training process of the test model, and the training process requires both correct samples and incorrect samples, so that the trained test model is more reliable and comprehensive in the subsequent use process. Therefore, in the image sample group obtained by the test device for training, there can be a situation where the reference sample and the test sample are exactly the same, or there can be a situation where the reference sample and the test sample are very different. In addition, for the convenience of subsequent marking of the image sample group, the differences between the generated test samples and the reference samples can be recorded, which is conducive to subsequent calculation or reference of the matching degree between the test samples and the reference samples.

[0074] In step S202, before training the test model, it is necessary to ensure the reliability and accuracy of the training data set used for training the test model. Therefore, it is necessary to mark the image sample group to ensure that during the training process of the training model, the neural network model used by the training model can clearly distinguish which are correct samples and which are incorrect samples, improving the reliability of the learning process of the neural network model and making the trained training model more accurate and reliable.

[0075] When marking an image sample group, it is necessary to determine the differences between the reference sample and the test sample in each image sample group. The method for determining the differences between the test sample and the reference sample can be to calculate the matching degree between the reference sample and the test sample in the same group of image sample groups. When the first matching degree parameter between the reference sample and the test sample is greater than or equal to the preset matching degree parameter, that is, the image actually displayed on the screen is exactly the same or similar to the expected displayed image, the image sample group is recognized as a correct sample, and the first mark is applied to this group of image sample groups. This group of image sample groups is classified into the first marked sample group. For example, the first mark can be 1, and the first marked sample group includes all image sample groups marked as 1. When the first matching degree parameter between the reference sample and the test sample is less than the preset matching degree parameter, that is, there are significant differences between the image actually displayed on the screen and the expected displayed image, the image sample group is recognized as an incorrect sample, and the second mark is applied to this group of image sample groups. This group of image sample groups is classified into the second marked sample group. For example, the second mark can be 0, and the second marked sample group includes all image sample groups marked as 0. Among them, the preset matching degree parameter can be set by the tester according to the reference sample. Different reference samples can set different preset matching degree parameters, or the same preset matching degree parameter can be set.

[0076] After marking each group of image sample groups, the marked first marked sample group and second marked sample group are used as the training data set for the subsequent training of the test model.

[0077] For example, the screen of a smart watch can display various display elements such as time, date, battery level, and weather. A certain reference sample has three display elements: time, date, and weather. Among them, the time is 11:24 and is displayed in the center of the screen, the date is November 11th and is displayed in the upper left corner of the screen, and the weather is sunny and is displayed in the upper right corner of the screen. The test sample generated based on this reference sample also displays three display elements: time, date, and weather. Among them, the time is 11:24 and is displayed in the center of the screen, the date is November 11th and is displayed in the upper left corner of the screen, and the weather is sunny and is displayed in the lower left corner of the screen. The display position of the weather element in the test sample is different from that in the reference sample. Calculating and obtaining that the first matching degree parameter between the reference sample and the test sample is less than the preset matching degree parameter, that is, there are significant differences between the test sample and the reference sample in this group of image sample sets. The test sample is incorrect, and the second mark of the number 0 is applied to this group of image sample groups.

[0078] Of course, it can be understood that the specific values of the above first mark and second mark are only descriptive ways used to describe the technical solution. The present disclosure does not specifically limit the implementation manner of the mark. For example, the first mark can also be m, and the second mark is n.

[0079] In step S203, the test device inputs the training data set into the test model. Since the training data set includes a first labeled sample group with a first label and a second labeled sample group with a second label, the test model can learn to classify the image sample groups in the training data set, that is, to determine whether the test samples in the image sample groups are correct samples or incorrect samples. The result output by the test model can be a label value. 0 indicates that the similarity between the test sample and the reference sample in the image sample group is good, and 1 indicates that the similarity between the test sample and the reference sample in the image sample group is poor. When the result output by the test model is consistent with the label value of the image sample group, it means that the training of the test model is completed. When the result output by the test model is inconsistent with the label value of the image sample group, it indicates that an error has occurred in the training process. At this time, the test device can send a prompt message to remind manual intervention to recheck and correct the label value of the image sample group to improve the test accuracy and reliability.

[0080] In the present disclosure, the test model trained based on the labeled training data set can accurately classify the image to be tested and determine whether the display of the image to be tested is correct. Using the trained test model can greatly reduce the test time and cost, improve the launch efficiency of the dial, provide more display effects for users, and give users a fresh feeling of use.

[0081] According to an exemplary embodiment, as Figure 3 shown, the test method in this embodiment includes:

[0082] S301. Obtain a plurality of reference samples, and the reference samples are generated based on an image editor;

[0083] S302. Based on the plurality of reference samples and a preset call model, adjust the target features in each reference sample to obtain a plurality of test samples, and the reference samples and the test samples correspond one by one;

[0084] S303. The corresponding reference sample and test sample form a group of image sample groups;

[0085] S304. Perform image preprocessing on the reference sample and the test sample;

[0086] S305. Based on a preset image matching algorithm, calculate the first matching degree parameter between the reference sample and the test sample in each group of image sample groups;

[0087] S306. Based on the preset matching degree parameter and the first matching degree parameter of each group of image sample groups, set the label value of each group of image sample groups to obtain a first labeled sample group with a first label value and a second labeled sample group with a second label value;

[0088] S307. The first labeled sample group and the second labeled sample group form a training data set;

[0089] S308. Based on the training data set, use the neural network algorithm for training to obtain a test model;

[0090] S309. Obtain the image to be tested;

[0091] S310. Use the pre-trained test model to test whether the image to be tested is consistent with the reference image.

[0092] Among them, steps S308, S309, and S310 are the same as the implementation manners in the above embodiments and will not be elaborated herein.

[0093] In step S301, the reference sample is generated by an image editor. The generation rule of the reference sample can be formulated in advance by the tester. The generation rule determines the logic and method for synthesizing the reference sample. The generation rule includes the number of reference samples, the displayed elements and their values on the reference sample, the naming rule of the reference sample, etc. Among them, the displayed elements of the reference sample can be divided into two types: dynamic elements and static elements. Dynamic elements include time, week, month, weather, the values of power and progress bars, health-related values, sports-related values, etc. Among them, the element representing time can be displayed in the form of numbers or pointers. The element representing health-related values can display heart rate, blood pressure, etc. The element representing sports-related values can display steps, calories, etc. The dynamic elements will change. For example, as time passes, the element representing time will change its display state. Another example is that as the battery power changes, the value of the power will change. Static elements include Roman numerals, special elements, design fonts, etc. Among them, the special elements can be cartoon animations, landscape pictures, etc. The design fonts are Song typeface, Bold typeface, artistic fonts, etc. The static elements usually do not change. For example, even though the time is different, Roman numerals are always used for representation. The image editor obtains and reads the generation rule, retrieves the resources for synthesizing the reference sample, synthesizes the reference sample including the display of specified elements and a specified quantity, and names the reference sample with a specified name according to the naming rule, and saves the reference sample and the name of the reference sample to a specified path.

[0094] In step S302, the test device has a stub version. The stub version refers to the version used for testing in software testing. Since during the testing process, it often involves specifying input data and constructing stub functions for missing functions, where the stub function is used to simulate the behavior of the called module, the test device can use the stub version to generate test samples corresponding to the reference samples, realizing the correspondence between the displayed elements in the test samples and those in the reference samples. Since the image editor names the reference samples according to the naming rules, and its name includes information about the target features of the reference samples, after the test device obtains the reference samples and information such as the name of the reference samples, it can use the stub version to generate test samples corresponding to the reference samples. For example, if the current actual test time is 11:28 and the name of the reference sample reflects that the time displayed in the reference sample is 11:00, the test device reads the information of the reference sample and uses the stub version to generate a test sample corresponding to the reference sample, with the time displayed on the screen being the specified 11:00 instead of the actual test time 11:28.

[0095] Among them, the target features include at least one of the type of the electronic device, the system type supported by the electronic device, the screen shape of the electronic device, and the displayed elements of the electronic device. The types of electronic devices include smart watches, smart bracelets, smart phones, etc. The system types supported by the electronic devices include Velaos, WearOS, etc. The screen shapes of the electronic devices include circular, square, runway-shaped, etc. The displayed elements of the electronic device include time, week, month, weather, battery power, sports health information, special elements, design words, etc., where the time can be presented in the form of numbers or pointers.

[0096] Here, it should be noted that in order to ensure the reliability of the image sample group and facilitate setting the marker value in the subsequent steps, when constructing the image sample group, a one-to-one correspondence between the reference samples and the test samples can be adopted. The reference samples in different image sample groups can be the same, but the test samples in different image sample groups should be as different as possible. Of course, there may also be two completely identical sample groups.

[0097] In some embodiments, step S302 obtains multiple test samples, including:

[0098] Controlling an image adjusted by the target features to be displayed on the screen of the electronic device;

[0099] Taking a screenshot of the image displayed on the screen of the electronic device, and the intercepted image is used as a test sample.

[0100] After the testing device reads the information of the reference sample and the name of the reference sample, it sends it to the firmware such as the screen of the electronic device through the stub version, so that an image adjusted by the target feature is displayed on the screen, where the target feature corresponds to the target feature of the reference sample. Take a screenshot of the image displayed on the screen of the electronic device, name the captured image as the test sample according to the same naming rule as the reference sample, and save it to the same path as the reference sample to form an image sample group for subsequent test model training. For example, if the name of the reference sample is "Wandering Moon", then read the information of the reference sample, display the image adjusted by the target feature on the screen through the stub version, and name the captured test sample as "Wandering Moon" and save it in the same path as the reference sample.

[0101] In step S304, the image preprocessing includes at least one of noise reduction processing, graphic size adjustment, and image background color processing. The testing device can select one, or two, or three methods in the image preprocessing to perform image preprocessing on the sample based on the quality of the reference sample and the test sample. Among them, Gaussian blur can be used for noise reduction processing to reduce noise and interference in the image to improve the image quality. Graphic size adjustment means adjusting the length-width ratio and size of the reference sample and the test sample to be consistent, which is convenient for subsequent matching of the reference sample and the test sample, calculating the matching degree, and enhancing the accuracy of image matching. Image background color processing refers to filling the background colors of the reference sample and the test sample with the same color, such as uniformly adjusting the reference sample and the test sample in the same group of image sample groups to gray or black, to avoid errors in the matching results due to differences in the image background colors.

[0102] In step S305, the testing device uses a preset image matching algorithm to calculate the first matching degree parameter between the reference sample and the test sample in each group of image sample groups. The first matching degree parameter reflects the matching degree between the reference sample and the test sample. The higher the matching degree, the more similar the reference sample and the test sample are, and the actual display on the screen conforms to the expected display. The preset image matching algorithm can automatically test each display element such as numbers, pointers, and icons on the test sample without missing any display element to ensure the integrity of the test sample display.

[0103] The process of image matching is as follows: Load the preprocessed reference sample and test sample, calculate the size of the matching result image based on the sizes of the preprocessed reference sample and test sample; use the test sample as the reference, and move the reference sample as a sliding window through the sliding method, forming an overlapping relationship between the test sample and the reference sample. For each position of the sliding window on the test sample, calculate the matching degree between the test sample and the sliding window area to obtain the first matching degree parameter between the test sample and the entire reference sample.

[0104] In some embodiments, the preset image matching algorithm includes multiple sub-algorithms. Step S305 calculates the first matching degree parameter between the reference sample and the test sample in each group of image sample groups based on the preset image matching algorithm, including:

[0105] Use multiple sub-algorithms to calculate the matching degrees between the reference sample and the test sample in each group of image sample groups respectively, and obtain multiple second matching degree parameters;

[0106] Perform normalization processing on the multiple second matching degree parameters of each group of image sample groups to obtain the first matching degree parameter of each group of image sample groups.

[0107] The preset image matching algorithm includes multiple sub-algorithms, and the multiple sub-algorithms include the selection of the sum of squared differences matching method, the standard sum of squared differences matching method, the correlation matching method, the normalized correlation matching method, the correlation coefficient matching method, and the normalized correlation coefficient matching method. The testing device uses the above multiple sub-algorithms to calculate the matching degrees between the reference sample and the test sample in each group of image sample sets respectively, and takes the matching degrees obtained based on the sub-algorithms as the second matching degree parameters. In order to improve the accuracy of image matching, normalization processing is performed on the multiple second matching degree parameters of each group of image sample groups, and the obtained result is the first matching degree parameter, that is, the first matching degree parameter is restricted between 0 and 1 through normalization. Among them, the calculation formula for the normalized first matching degree parameter is: norm_R(x,y) = (R(x,y) - min(R)) / (max(R) - min(R)), where norm_R(x,y) is the normalized first matching degree parameter, R(x,y) is the coordinate of the displayed element in the image, max(R) is the maximum second matching degree parameter, and min(R) is the minimum second matching degree parameter. Since the matching degrees between the reference sample and the test sample are calculated respectively using multiple sub-algorithms, and then the matching degree values obtained by each sub-algorithm are subjected to normalization calculation, the finally obtained first matching degree parameter is more reliable, accurate, and objective.

[0108] In step S306, the first matching degree parameter of each group of image sample groups is compared with a preset matching degree parameter. If the first matching degree parameter is greater than or equal to the preset matching degree parameter, the marking value of this group of image sample groups is set to 1, indicating that the reference sample and the test sample in this group of image sample groups match; if the first matching degree parameter is less than the preset matching degree parameter, the marking value of this group of image sample groups is set to 0, indicating that the reference sample and the test sample in this group of image sample groups do not match. That is, by setting the marking value, a first marked sample group with a first marking value and a second marked sample group with a second marking value are obtained. The first marked sample group and the second marked sample group form the training data set in step S307 for training the test model. For example, the preset matching degree parameter is set to 100%. The first matching degree parameter of a certain group of image sample groups is calculated to be 95%, which is less than the preset matching degree parameter. Therefore, the marking value of this group of image sample groups is set to 0. The first matching degree parameter of another group of image sample groups is calculated to be 100%, which is equal to the preset matching degree parameter. Therefore, the marking value of this group of image sample groups is set to 1. Another example, the preset matching degree parameter is set to 95%. The first matching degree parameter of a certain group of image sample groups is calculated to be 90%, which is less than the preset matching degree parameter. Therefore, the marking value of this group of image sample groups is set to 0. The first matching degree parameter of another group of image sample groups is calculated to be 99%, which is greater than the preset matching degree parameter. Therefore, the marking value of this group of image sample groups is set to 1.

[0109] In some embodiments, in step S308, when an error occurs in the matching degree calculation, or some other problems occur that may cause the training data set to be inaccurate, at this time, the training data set needs to be modified. Step S308 also includes the following methods:

[0110] Obtain the image sample groups with marking errors in the training data set, change the marking values of the image sample groups with marking errors, and obtain the corrected training data set;

[0111] Based on the corrected training data set, use the neural network algorithm for training to obtain the test model.

[0112] To improve the sensitivity, specificity, and accuracy of the test model, the marked values of the image sample group with marking errors are changed, and the test model is retrained using the corrected training data set. The features in the test model and their respective weight and variance structures are adjusted, and the test model is updated. For example, a group of first marked sample groups in the training data set is input into the test model. The result of the test model input is an image with a marked value of 0, which is different from the marked value of 1 of the first marked sample group. That is, there are marking errors in this group of image sample groups, and the marked value needs to be corrected to 1. The marked values of multiple groups of image sample groups with marking errors are changed to form a corrected training data set, and the test model is retrained using the corrected training data set.

[0113] In the present disclosure, the test device trains the test model using the marked training data set. The test model realizes fully automated judgment of the correctness of display elements, is not affected by human subjective judgment, improves the test efficiency and the accuracy of test results, and saves a large amount of labor costs. Moreover, the trained test model is not limited by the type of electronic device, the system type of the electronic device, etc., nor is it limited by time and environment. It covers a wide range of test scenarios, can be used in multiple projects, improves the reusability of the test model, and saves a large amount of economic costs.

[0114] According to an exemplary embodiment, as Figure 4 shown, the test method in this embodiment includes:

[0115] S401. Set the generation rule for the reference sample generated by the image editor;

[0116] S402. The image editor reads the generation rule and generates a reference image according to the generation rule;

[0117] S403. The image editor names the reference image according to the naming rule and saves the reference image to the specified path;

[0118] S404. The test device reads the name of the reference image and adjusts the target feature based on the reference image;

[0119] S405. Control the electronic device to display the image after the target feature adjustment on the screen;

[0120] S406. Take a screenshot of the image displayed on the screen of the electronic device, and the intercepted image is used as the image to be tested;

[0121] S407. Perform image preprocessing on the reference image and the image to be tested;

[0122] S408. Calculate the second matching degree parameter of the reference image and the image to be tested after image preprocessing;

[0123] S409. Normalize multiple second matching degree parameters to obtain the first matching degree parameter between the reference image and the image to be tested in image preprocessing;

[0124] S410. Input the reference image and the image to be tested after image preprocessing into the test model;

[0125] S411. Determine whether the first matching degree parameter is greater than or equal to the preset matching degree parameter. If the first matching degree parameter is greater than or equal to the preset matching degree parameter, execute step S412; if the first matching degree parameter is less than the preset matching degree parameter, execute step S413;

[0126] S412. Mark the test result of the image to be tested as "correct";

[0127] S413. Mark the test result of the image to be tested as "wrong";

[0128] S414. Generate a test report based on the test result of the test model;

[0129] S415. Send the test report to the tester by email.

[0130] The specific implementation manners of the above steps have been described in detail in other embodiments and will not be elaborated here.

[0131] An exemplary embodiment of the present disclosure provides a test device, which is applied to a test device. As Figure 5 shown, a block diagram of a test device shown in the present disclosure.

[0132] The block diagram includes: an acquisition module 51 and an execution module 52. The acquisition module 51 is used to acquire the image to be tested; the execution module 54 is used to use a pre-trained test model to test whether the image to be tested is consistent with the reference image, and the reference image is an image expected to be displayed on the screen of the electronic device; wherein, the test model is a model obtained by training based on a neural network algorithm.

[0133] In an exemplary embodiment of the present disclosure, the testing device further includes a marking module 53 and a training module 54. The obtaining module 51 is further configured to: obtain multiple groups of image sample groups, each group of image sample groups including a reference sample and a test sample, where the reference sample is an image expected to be displayed on the screen of the electronic device, the test sample is an image actually displayed on the screen of the electronic device, and the test sample is generated based on the reference sample; the marking module 53 is configured to mark the image sample groups to form a training data set, the training data set including a first marked sample group and a second marked sample group, the first matching degree parameter between the reference sample and the test sample in the first marked sample group being greater than or equal to a preset matching degree parameter, and the first matching degree parameter between the reference sample and the test sample in the second marked sample group being less than the preset matching degree parameter; the training module 54 is configured to perform training based on the training data set using a neural network algorithm to obtain a test model.

[0134] In an exemplary embodiment of the present disclosure, the marking module 53 is further configured to: calculate the first matching degree parameter between the reference sample and the test sample in each group of image sample groups based on a preset image matching algorithm; set the marking value of each group of image sample groups based on the preset matching degree parameter and the first matching degree parameter of each group of image sample groups to obtain a first marked sample group with a first marking value and a second marked sample group with a second marking value, the marking value being used to characterize whether the reference sample and the test sample in each group of image sample groups match; the first marked sample group and the second marked sample group form the training data set.

[0135] In an exemplary embodiment of the present disclosure, the preset image matching algorithm includes multiple sub-algorithms. The marking module 53 is further configured to: calculate the matching degrees between the reference sample and the test sample in each group of image sample groups using multiple sub-algorithms respectively to obtain multiple second matching degree parameters; perform normalization processing on the multiple second matching degree parameters of each group of image sample groups to obtain the first matching degree parameter of each group of image sample groups.

[0136] In an exemplary embodiment of the present disclosure, the training module 54 is further configured to: obtain the image sample groups with marking errors in the training data set, change the marking values of the image sample groups with marking errors to obtain a corrected training data set; train the test model based on the corrected training data set.

[0137] In an exemplary embodiment of the present disclosure, the marking module 53 is further configured to: perform image preprocessing on the reference sample and the test sample before marking the image sample groups; where the image preprocessing includes at least one of noise reduction processing, graphic size adjustment, and image background color processing.

[0138] In an exemplary embodiment of the present disclosure, the obtaining module 51 is further configured to: obtain a plurality of reference samples, where the reference samples are generated based on an image editor; adjust target features in each reference sample based on the plurality of reference samples and a preset call model to obtain a plurality of test samples, and the reference samples and the test samples correspond one by one; and a corresponding reference sample and test sample form a group of image sample groups.

[0139] In an exemplary embodiment of the present disclosure, the obtaining module 51 is further configured to: control an image after target feature adjustment to be displayed on a screen of the electronic device; and take a screenshot of the image displayed on the screen of the electronic device, and the captured image is used as a test sample.

[0140] In an exemplary embodiment of the present disclosure, the target features include at least one of the type of the electronic device, the system type supported by the electronic device, the screen shape of the electronic device, and the display elements of the electronic device.

[0141] Regarding the test device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0142] Figure 6 FIG. is a block diagram of a test device 600 shown according to an exemplary embodiment. For example, the test device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0143] Refer to Figure 6 , the test device 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.

[0144] The processing component 602 generally controls the overall operation of the test device 600, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0145] The memory 604 is configured to store various types of data to support the operation of the test device 600. Examples of such data include instructions for any application or method operating on the test device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disks, or optical disks.

[0146] The power supply component 606 provides power to various components of the test device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the test device 600.

[0147] The multimedia component 608 includes a screen that provides an output interface between the test device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the test device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0148] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC) that is configured to receive external audio signals when the test device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, the audio component 610 further includes a speaker for outputting audio signals.

[0149] The I / O interface 612 provides an interface between the processing component 602 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.

[0150] The sensor assembly 614 includes one or more sensors for providing a status assessment of various aspects of the test device 600. For example, the sensor assembly 614 can detect the on / off state of the test device 600, the relative positioning of components, such as the display and keypad of the test device 600. The sensor assembly 614 can also detect a change in the position of the test device 600 or a component of the test device 600, the presence or absence of user contact with the test device 600, the orientation or acceleration / deceleration of the test device 600, and the temperature change of the test device 600. The sensor assembly 614 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0151] The communication component 616 is configured to facilitate communication between the test device 600 and other devices in a wired or wireless manner. The test device 600 can access a wireless network based on communication standards, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0152] In an exemplary embodiment, the test device 600 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above methods.

[0153] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as a memory 604 including instructions, is also provided. The above instructions can be executed by a processor 620 of the test device 600 to complete the above test method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0154] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a test device, enables a processing device of the test device to execute the test method provided by the exemplary embodiments of the present disclosure.

[0155] Those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include known common knowledge or conventional technical means in the technical field not disclosed in this disclosure. The specification and embodiments are only to be considered exemplary, and the true scope and spirit of the present invention are pointed out by the following claims.

[0156] It should be understood that the present invention is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.

Claims

1. A testing method, characterized in that, Applied to a test device, the test method includes: Obtain an image to be tested; Use a pre-trained test model to test whether the image to be tested is consistent with a reference image, where the reference image is an image expected to be displayed on the screen of an electronic device; Among them, the test model is a model obtained by training based on a neural network algorithm.

2. The test method according to claim 1, characterized in that, The training method of the test model includes: Obtain multiple groups of image sample groups, each group of the image sample groups includes the reference sample and the test sample, where the reference sample is an image expected to be displayed on the screen of an electronic device, and the test sample is an image actually displayed on the screen of the electronic device, and the test sample is generated based on the reference sample; Mark the image sample groups to form a training data set, the training data set includes a first marked sample group and a second marked sample group, the first matching degree parameter between the reference sample and the test sample in the first marked sample group is greater than or equal to a preset matching degree parameter, and the first matching degree parameter between the reference sample and the test sample in the second marked sample group is less than the preset matching degree parameter; Based on the training data set, use a neural network algorithm to train to obtain the test model.

3. The test method according to claim 2, characterized in that, The marking of the image sample groups to form a training data set includes: Based on a preset image matching algorithm, calculate the first matching degree parameter between the reference sample and the test sample in each group of the image sample groups; Based on the preset matching degree parameter and the first matching degree parameter of each group of the image sample groups, set the marking value of each group of the image sample groups to obtain the first marked sample group with a first marking value and the second marked sample group with a second marking value, where the marking value is used to represent whether the reference sample and the test sample in each group of the image sample groups match; The first marked sample group and the second marked sample group form the training data set.

4. The test method according to claim 3, wherein The preset image matching algorithm includes multiple sub-algorithms. Based on the preset image matching algorithm, calculating the first matching degree parameter between the reference sample and the test sample in each group of the image sample groups includes: Use multiple of the sub-algorithms to calculate the matching degree between the reference sample and the test sample in each group of the image sample groups respectively to obtain multiple second matching degree parameters; Normalize the multiple second matching degree parameters of each group of the image sample groups to obtain the first matching degree parameter of each group of the image sample groups.

5. The testing method according to claim 2, characterized in that, Based on the training data set, using a neural network algorithm to train to obtain the test model includes: Obtain the image sample groups with marking errors in the training data set, and change the marking values of the image sample groups with marking errors to obtain a corrected training data set; Based on the corrected training data set, use a neural network algorithm to train to obtain the test model.

6. The test method according to claim 2, wherein The test method further includes: Before marking the image sample groups, perform image preprocessing on the reference sample and the test sample; Among them, the image preprocessing includes at least one of noise reduction processing, graphic size adjustment, and image background color processing.

7. The test method according to claim 2, wherein The obtaining of multiple groups of image sample groups includes: obtaining a plurality of the reference samples, the reference samples being generated based on an image editor; adjusting target features in each of the reference samples based on the plurality of reference samples and a preset call model to obtain a plurality of the test samples, the reference samples corresponding one-to-one to the test samples; the corresponding reference samples and test samples form a group of the image sample groups.

8. The test method according to claim 7, characterized in that The obtaining of the plurality of the test samples includes: controlling an image after target feature adjustment to be displayed on a screen of the electronic device; taking a screenshot of the image displayed on the screen of the electronic device, and the captured image is used as the test sample.

9. The test method according to claim 7, wherein The target features include at least one of the type of the electronic device, the system type supported by the electronic device, the screen shape of the electronic device, and the display elements of the electronic device.

10. A testing device, characterized in that, Applied to a test device, the test device includes: an obtaining module, configured to obtain a to-be-tested image; an execution module, configured to use a pre-trained test model to test whether the to-be-tested image is consistent with a reference image, the reference image being an image expected to be displayed on a screen of an electronic device; wherein, the test model is a model obtained by training based on a neural network algorithm.

11. A test device, characterized in that, The test device includes: a screen; a processor; a memory for storing executable instructions executable by the processor; wherein, the processor is configured to execute the executable instructions in the memory to implement the test method according to any one of claims 1 to 9.

12. A non-transitory computer-readable storage medium, characterized in that, Stored thereon are executable instructions, which when executed by a processor implement the test method according to any one of claims 1 to 9.