ATS interface test method and device, electronic equipment and storage medium
Through the automated ATS interface testing method, interface elements are identified and segmented, and the test model is used to analyze element correlation and layout characteristics, solving the problem of time-consuming, labor-intensive and accurate manual testing is achieved, and efficient and accurate interface testing is achieved.
Patent Information
- Application Number
- CN202411785144.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-18
AI Technical Summary
In the prior art, it takes a lot of manpower to conduct ATS interface test based on manual operation and is not very accurate.
By obtaining the ATS interface diagram to be tested, elements are identified and segmented, and the elements are extracted; elements are related and layout features are extracted based on the ATS interface test model, and comparison and analysis are performed to obtain the ATS interface test results.
It realizes efficient and accurate ATS interface testing, reduces manpower investment, and improves the accuracy of test results.
Smart Images

Figure CN119847915A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rail transit technology, and in particular to an ATS interface testing method, device, electronic equipment and storage medium. Background Art
[0002] The train ATS system (Automatic Train Supervision) is one of the important subsystems of the ATC system (Automatic Train Control). It provides a monitoring platform for all trains and on-site signal equipment for subway operation dispatchers. At present, the testing of ATS human-computer interaction interface mainly relies on manual confirmation, which is to manually intercept the ATS interface to be tested and confirm whether there are display problems such as occlusion on the interface elements.
[0003] However, due to the large number of interface elements in the ATS interface, human-based interface testing requires a lot of manpower. Excessive manpower investment not only increases the manpower cost of the project, but also leads to many errors and omissions due to human negligence or lack of experience. Summary of the invention
[0004] The present invention provides an ATS interface testing method, device, electronic device and storage medium, which are used to solve the defects in the prior art that manual ATS interface testing consumes a lot of manpower and has low accuracy.
[0005] The present invention provides an ATS interface testing method, comprising: Get the ATS interface image to be tested; Performing element recognition on the ATS interface image to be tested to obtain an element recognition result, and segmenting the ATS interface image to be tested based on the contour coordinates of the element recognition result to extract the graphic elements to be tested; the element recognition result includes icon elements and / or text elements corresponding to the icon elements; Based on the ATS interface test model, the element correlation features and element layout features of the graphic element to be tested are extracted, and a comparative analysis is performed based on the element correlation features and the element layout features to obtain the ATS interface test results; the ATS interface test model is trained based on sample ATS interface graphic elements and the test labels corresponding to each sample ATS interface graphic element.
[0006] According to an ATS interface testing method provided by the present invention, the comparison and analysis based on the element association feature and the element layout feature to obtain the ATS interface testing result includes: Comparing and analyzing the element correlation feature with the expected element correlation feature corresponding to the graphic element to be tested, and obtaining an element correlation test result; Comparing and analyzing the element layout features with the expected element layout features corresponding to the graphic element to be tested, obtaining an element layout test result; The ATS interface test result is obtained based on the element association test result and the element layout test result.
[0007] According to an ATS interface testing method provided by the present invention, performing element recognition on the ATS interface image to be tested to obtain an element recognition result includes: Performing visual corrosion and expansion processing on the ATS interface image to be tested to obtain a pre-processed interface image; Performing graphic element recognition on the preprocessed interface image based on an image recognition model to obtain the element recognition result; The image recognition model is obtained by training a general image recognition model based on sample primitives.
[0008] According to an ATS interface testing method provided by the present invention, the ATS interface image to be tested is segmented based on the contour coordinates of the element recognition result to extract the image elements to be tested, including: Based on a preset color threshold, the color value of each pixel of the ATS interface image to be tested is compared to obtain the element recognition result; Based on the contour coordinates of the element recognition result, the ATS interface image to be tested is segmented to extract the image elements to be tested.
[0009] According to an ATS interface testing method provided by the present invention, the icon element includes at least one of a platform icon, a signal icon, a track section icon, a switch icon, and a train window icon; The text element includes the device name of the icon element.
[0010] According to an ATS interface testing method provided by the present invention, the step of obtaining an ATS interface diagram to be tested includes: The original ATS interface image is dragged based on a pre-written control program to automatically capture the ATS interface image within the current screen range to obtain the ATS interface image to be tested.
[0011] The present invention also provides an ATS interface testing device, comprising: Get unit, get the ATS interface image to be tested; The graphic element extraction unit performs element recognition on the ATS interface image to be tested to obtain an element recognition result, and segments the ATS interface image to be tested based on the contour coordinates of the element recognition result to extract the graphic elements to be tested; the element recognition result includes icon elements and / or text elements corresponding to the icon elements; The testing unit extracts the element association features and element layout features of the graphic element to be tested based on the ATS interface testing model, and performs comparative analysis based on the element association features and the element layout features to obtain the ATS interface testing results; the ATS interface testing model is trained based on sample ATS interface graphic elements and the test labels corresponding to each sample ATS interface graphic element.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned ATS interface testing methods is implemented.
[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the ATS interface testing method described in any one of the above is implemented.
[0014] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned ATS interface testing methods.
[0015] The ATS interface testing method, device, electronic device and storage medium provided by the present invention obtain the graphic element to be tested by identifying the icon elements and / or the text elements corresponding to the icon elements in the ATS interface diagram; extract the element correlation characteristics and element layout characteristics of the graphic element to be tested based on the ATS interface testing model, and perform comparison and analysis based on the element correlation characteristics and the element layout characteristics to obtain the ATS interface testing results, thereby realizing comprehensive, ATS interface characteristic-compliant, efficient and accurate interface testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 This is one of the flow charts of the ATS interface testing method provided by the present invention; Figure 2This is the second flow chart of the ATS interface testing method provided by the present invention; Figure 3 This is the third flow chart of the ATS interface testing method provided by the present invention; Figure 4 It is a structural schematic diagram of the ATS interface testing device provided by the present invention; Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] On the one hand, the train ATS system obtains the real-time status information of the on-site signal equipment and train operation through other signal systems ATS, and displays this information to the dispatchers truthfully; on the other hand, ATS also provides a human-computer interaction interface to facilitate the dispatchers to control the train operation according to the on-site conditions. The ATS software interface displays many elements including platforms, signal machines, track sections, switches, train number windows, equipment names, etc. The display positions of each element are mutually blocked, and the interface display directly affects the dispatchers' information processing and sensory evaluation. However, the current manual ATS interface testing method not only consumes a lot of manpower, but the accuracy of the test results will also be affected by the experience and ability of the testers.
[0020] In view of the above problems, the present invention provides an ATS interface testing method to achieve ATS interface testing without artificiality and with accurate and stable test results. Figure 1 It is one of the flow charts of the ATS interface testing method provided by the present invention, such as Figure 1 As shown, the method includes: Step 110, obtaining the ATS interface diagram to be tested.
[0021] Here, the ATS interface to be tested refers to the interface for interaction between the ATS system and train dispatchers, which may include various types of ATS interface elements, and each interface element is displayed in a certain layout. The interface elements here include platform, signal, track section, turnout, train number window, equipment name and many other elements.
[0022] Specifically, the complete interface interaction diagram of the ATS system can be captured as the ATS interface diagram to be tested here, or a portion of the interface interaction diagram can be captured as the ATS interface diagram to be tested here. For example, the complete interface interaction diagram can be captured in split screens, and each captured interface interaction diagram can be used as the ATS interface diagram to be tested.
[0023] Step 120, perform element recognition on the ATS interface image to be tested to obtain element recognition results, and segment the ATS interface image to be tested based on the contour coordinates of the element recognition results to extract the graphic elements to be tested; the element recognition results include icon elements and / or text elements corresponding to the icon elements.
[0024] Here, the icon element may refer to various icons in the ATS interface to be tested, such as icons corresponding to platforms, signals, track sections, switches, and train number windows. The name element here may refer to text content such as the device name and text description corresponding to the icon. Therefore, the graphic element to be tested here may refer to at least one of an icon element and a text element corresponding to the icon element. For example, the graphic element to be tested may be a separate icon element or a text element corresponding to a separate icon element, or may include an icon element and a text element corresponding to the icon element.
[0025] Specifically, the ATS interface image to be tested can be extracted by image processing or machine learning technology to obtain all the graphics to be tested contained in the ATS interface to be tested. For example, the image processing method here can be to identify the elements of the ATS interface image to be tested by edge detection algorithm or binarization processing to obtain element identification results. Then, the ATS interface image to be tested can be segmented by the contour coordinates of the element identification results, and the graphics to be tested can be extracted to facilitate the subsequent separate consistency detection of the graphics to be tested.
[0026] It should be noted that, considering that in the ATS interface display, there is a close layout relationship between the icon elements and the text elements corresponding to the icon element images. When there is no overlap between the icon elements and the text elements corresponding to the icon element images, but the distance between the two is greater than the preset layout, or when the text elements corresponding to the icon elements are missing, and the icon elements corresponding to the text elements are missing, this situation will also affect the dispatcher's perception of the ATS interface, and thus affect the dispatcher's decision-making judgment.
[0027] Therefore, in the embodiment of the present invention, by treating the icon element and the text element corresponding to the icon element as a graphic element to be tested, and performing interface detection by treating the graphic element to be tested as the minimum test unit, while ensuring that there is no occlusion between the icon element and its corresponding text element, it is also possible to ensure that the layout between the icon element and the text element complies with the specifications, thereby achieving a comprehensive and effective ATS interface test that fits the characteristics of the ATS interface.
[0028] Step 130, extracting the element association features and element layout features of the graphic element to be tested based on the ATS interface test model, and performing comparative analysis based on the element association features and the element layout features to obtain the ATS interface test results; the ATS interface test model is trained based on sample ATS interface graphic elements and the test labels corresponding to each sample ATS interface graphic element.
[0029] Here, the ATS interface test model can be obtained by training a general neural network model based on sample ATS interface primitives and test labels corresponding to each sample ATS interface primitive. The sample ATS interface primitives here may include primitives composed of a single icon element, primitives composed of a single text element, and primitives composed of an icon element and its corresponding text element. The test label corresponding to each sample ATS interface primitive here can be used to mark whether the ATS interface primitive is covered or not. The sample ATS interface image can be classified using a support vector machine model as a classifier to obtain a test label corresponding to each sample ATS interface primitive.
[0030] In the training phase of the ATS interface test model, firstly, a sample data set, i.e., a sample ATS interface primitive, can be obtained by constructing primitives composed of single icon elements with different degrees of occlusion, primitives composed of single text elements, and primitives composed of icon elements and their corresponding text elements. Then, by inputting the ATS interface primitives into the general neural network model to be trained, the general neural network is used to learn the correlation between the interface elements in the ATS interface primitives and the relative positions between the interface elements, so that the ATS interface test model finally trained can have the ability to identify whether the primitives to be tested deviate. It should be noted that, considering the difficulty of classification and the complexity of the code, the support vector machine model can be selected as the classifier, and the general neural network can be trained through the supervised learning method to achieve the effect of intelligent recognition of occlusion.
[0031] In the application stage of the ATS interface test model, the graphics element to be tested can be input into the ATS interface test model, and the element relevance features and element layout features of the graphics element to be tested can be extracted through the ATS interface test model. Then, the element relevance features and element layout features can be compared and analyzed respectively to obtain the ATS interface test results. For example, the element relevance features and the expected element relevance features can be compared and analyzed by the ATS interface test model to obtain the element relevance detection results. And the element layout detection results are obtained by comparing and analyzing the element layout features and the expected element layout features. Thus, the ATS interface test results can be obtained through the element relevance detection results and the element layout detection results to realize the consistency detection of the icon elements or text elements in the graphics element to be detected, or the icon elements and the text elements corresponding to the icon elements. The consistency detection here can include relevance consistency detection and position consistency detection. For example, if the graphics element to be detected is a platform and a platform name, the platform and the platform name can be consistency detected to detect whether the platform and the platform name are covered and deviated. Therefore, the ATS interface test results here may refer to the element test results of each ATS element to be tested, and the element test results may include whether there is element coverage or element missing. The existence of element coverage here may include the coverage between icon elements and text elements within the element, and the coverage between different elements.
[0032] It should be noted that by performing interface testing on the test graphics through the ATS interface testing model, there is no need to consume a lot of manpower, and the test results will not be affected by human factors such as fatigue and emotions, thus achieving efficient and accurate ATS interface testing.
[0033] The method provided by the embodiment of the present invention obtains the graphic element to be tested by identifying the icon elements and / or the text elements corresponding to the icon elements in the ATS interface diagram; extracts the element correlation characteristics and element layout characteristics of the graphic element to be tested based on the ATS interface test model, and performs comparison and analysis based on the element correlation characteristics and the element layout characteristics to obtain the ATS interface test results, thereby realizing comprehensive, ATS interface-specific, efficient and accurate interface testing.
[0034] Based on any of the above embodiments, in step 130, a comparison analysis is performed based on the element association feature and the element layout feature to obtain an ATS interface test result, including: Comparing and analyzing the element correlation feature with the expected element correlation feature corresponding to the graphic element to be tested, and obtaining an element correlation test result; Comparing and analyzing the element layout features with the expected element layout features corresponding to the graphic element to be tested, obtaining an element layout test result; The ATS interface test result is obtained based on the element association test result and the element layout test result.
[0035] Specifically, the graphic element to be tested can be input into the ATS interface test model, and the element correlation features and element layout features of the graphic element to be tested can be extracted through the ATS interface test model. Then, the element correlation features and the expected element correlation features corresponding to the graphic element to be tested can be compared and analyzed through the ATS interface test model to obtain the element correlation detection result. In addition, the element layout features and the expected element layout features corresponding to the graphic element to be tested are compared and analyzed to obtain the element layout detection result. Thus, the element correlation detection result and the element layout detection result can be used as the ATS interface test result.
[0036] It should be noted that the element relevance detection result here reflects whether there are redundant or missing elements in the tested primitive. In addition, the element layout detection result can reflect whether there is deviation in the elements in the tested primitive. It can also be understood that when performing consistency detection on the primitive to be detected, it is also possible to detect whether the elements in the tested primitive are covered by other primitives.
[0037] The method provided by the embodiment of the present invention divides the associated elements into a to-be-tested graphic element, extracts the element association features and element layout features of the to-be-tested graphic element, and performs comparative analysis based on the element association features and the element layout features to obtain the ATS interface test results. Thus, by detecting whether the element association and layout are consistent with the expected element association and layout, a comprehensive interface detection that fits the ATS interface layout characteristics is achieved, thereby improving the comprehensiveness and practicality of the test results.
[0038] Based on any of the above embodiments, the step of performing element recognition on the ATS interface image to be tested to obtain an element recognition result includes: Performing visual corrosion and expansion processing on the ATS interface image to be tested to obtain a pre-processed interface image; Performing graphic element recognition on the preprocessed interface image based on an image recognition model to obtain the element recognition result; The image recognition model is obtained by training a general image recognition model based on sample primitives.
[0039] Here, the image recognition model can be obtained by training a general image recognition model based on sample primitives, and the general image recognition model is constructed based on a neural network. The sample primitives here can include primitives that only contain a single icon element, primitives that only contain a single text element, and primitives that contain an icon element and a text element corresponding to the icon element. As a result, the image recognition model can learn the correlation and relative position information of the elements in the sample primitives to achieve accurate primitive recognition.
[0040] Specifically, the ATS interface image to be tested can be subjected to visual corrosion and expansion processing to obtain a preprocessed interface image, and the interfering pixels around the elements, such as noise points, edge burrs, etc., can be eliminated to make the element contour clearer, so as to improve the accuracy of primitive extraction, and then improve the accuracy of interface testing. Among them, by performing visual corrosion processing on the ATS interface image to be tested, the element boundary is shrunk inward, and small protrusions or noise points on the boundary can be removed. In addition, by performing visual expansion processing on the ATS interface image to be tested, the element boundary is expanded outward, and small holes or gaps on the boundary can be filled.
[0041] Then, the preprocessed interface image is input into the image recognition model, and the image recognition model is used to perform graphic element recognition on the preprocessed interface image to obtain accurate element recognition results that fit the characteristics of the ATS interface layout.
[0042] Based on any of the above embodiments, in step 120, segmenting the ATS interface image to be tested based on the contour coordinates of the element recognition result to extract the image elements to be tested includes: Based on a preset color threshold, the color value of each pixel of the ATS interface image to be tested is compared to obtain the element recognition result; Based on the contour coordinates of the recognition result, the ATS interface image to be tested is segmented to extract the image elements to be tested.
[0043] Here, the preset color threshold can be used to determine the interface elements and element backgrounds in the ATS interface diagram to be tested.
[0044] Specifically, first, determine the preset color threshold between the interface elements and the background in the ATS interface diagram to be tested. Then, the value of each pixel in the ATS interface diagram to be tested can be compared with the preset color threshold. It should be noted that the background color in the ATS interface diagram to be tested is usually black, and the colors of the interface elements include blue, green, and red. Thus, the pixel points whose color values of the pixel points in the ATS interface diagram to be tested meet the preset color threshold of the interface element color can be divided into interface elements; the pixel points whose color values of the pixel points in the ATS interface diagram to be tested meet the preset color threshold of the background color can be divided into the element background corresponding to the interface element.
[0045] Then, the ATS interface image to be tested can be segmented by the contour coordinates of the element recognition result to extract the image element to be tested. Alternatively, the ATS interface image to be tested can be segmented by the contour coordinates of the minimum element background where the element recognition result is located to extract the image element to be tested.
[0046] It is understandable that, since there are many interface elements in the ATS interface diagram to be tested and they are small in size, in order to facilitate the staff to view the ATS interface diagram to be tested, there is a large contrast between the background color and the color of the interface elements in the ATS interface diagram to be tested. Therefore, the method provided in the embodiment of the present invention compares the color values of each pixel in the ATS interface diagram to be tested by presetting a color threshold, realizes the element recognition result based on color segmentation, and improves the accuracy of the element recognition result.
[0047] Based on any of the above embodiments, the icon element includes at least one of a platform icon, a signal icon, a track section icon, a switch icon, and a train number window icon; and the text element includes the device name of the icon element.
[0048] Based on any of the above embodiments, Figure 2 This is the second flow chart of the ATS interface testing method provided by the present invention, such as Figure 2 As shown, the method includes: starting, executing a screenshot of the current interface, that is, obtaining the ATS interface image to be tested. Then, performing interface element analysis on the current interface screenshot to obtain the graphic element to be tested. Then, based on the big data neural network model analysis, that is, based on the ATS interface test model, the consistency of the graphic element to be tested is detected. It is judged whether there is element occlusion. In the case of element occlusion, the occlusion position is automatically marked and stored in a designated folder. In the case of no element occlusion and after storing in a designated folder, it is judged whether to end the interface detection. If so, it ends; if not, the interface is automatically dragged and the current interface screenshot is re-executed to perform the next round of interface testing.
[0049] Based on any of the above embodiments, step 110 includes: The original ATS interface image is dragged based on a pre-written control program to automatically capture the ATS interface image within the current screen range to obtain the ATS interface image to be tested.
[0050] Specifically, the mouse can be controlled by a pre-written control program to periodically drag the original ATS interface image, and then the ATS interface image within the current screen range can be automatically captured to obtain the ATS interface image to be tested. It should be noted that the automatic control method is used to obtain the ATS interface image to be tested, which facilitates repeated testing of the ATS interface in different time periods, and realizes automatic capture, automatic recognition, and automatic output of test results of images.
[0051] Based on any of the above embodiments, Figure 3 This is the third flow chart of the ATS interface testing method provided by the present invention, such as Figure 3 As shown, the method includes: first, collecting and organizing samples of interface elements to be tested.
[0052] Then, the general neural network model is trained based on the sample of interface elements to be tested to obtain the ATS interface test model. Specifically, the ATS interface primitives can be processed in the early stage to classify normal primitives from abnormal primitives, and the neural network deep model can be trained to learn the element correlation and relative position characteristics of interface elements, so as to have the ability to detect element deviation.
[0053] Next, based on the ATS interface test model, the consistency test can be performed on the graphics to be tested to determine the ATS interface test results. Specifically, the trained ATS interface test model can be loaded into the interface test software. After the software is running, it automatically takes a screenshot of the ATS human-computer interface displayed on the current screen, processes the intercepted ATS interface, extracts and segments the ATS station interface elements, and forms various categories of graphics to be tested. The trained ATS interface test model is used to compare and analyze the graphics to be tested to confirm whether the intercepted graphics to be tested have abnormal conditions such as occlusion. If there is an abnormal display, the software automatically circles the abnormal area with a red box for subsequent manual confirmation. If there is no abnormal display of the graphics to be tested, the software will automatically drag the ATS display station interface to process the next display interface graphics until the software is manually paused or stopped. It should be noted that the function can be improved by supporting continuous learning of the ATS interface test model, that is, normal graphics and abnormal graphics can be automatically generated based on the ATS interface test results. Graphics that have been confirmed to have abnormal displays can be loaded into the specified folder automatically or manually, and the test model improvement instructions can be run to incrementally update and improve the trained ATS interface test model. Through continuous testing, learning and training, the test accuracy can be improved.
[0054] The method provided by the embodiment of the present invention can cover more than 95% of the ATS interface test items, which reduces the manual testing workload of the ATS human-machine interface test, while improving the intelligence and automation level of the ATS human-machine interface test and improving the test efficiency. In addition, the ATS interface test method provided by the embodiment of the present invention can also be embedded in the interface production tool as a plug-in, and the ATS station element occlusion can be identified and prompted during the interface drawing process, assisting ATS interface drawing personnel to reduce interface production problems.
[0055] Based on any of the above embodiments, Figure 4 is a schematic diagram of the structure of the ATS interface testing device provided by the present invention, such as Figure 4 As shown, the device comprises: An acquisition unit 410 acquires an ATS interface diagram to be tested; The graphic element extraction unit 420 performs element recognition on the ATS interface image to be tested to obtain an element recognition result, and segments the ATS interface image to be tested based on the contour coordinates of the element recognition result to extract graphic elements to be tested; the element recognition result includes icon elements and / or text elements corresponding to the icon elements; The testing unit 430 extracts the element association features and element layout features of the graphic element to be tested based on the ATS interface testing model, and performs comparative analysis based on the element association features and the element layout features to obtain the ATS interface testing results; the ATS interface testing model is trained based on sample ATS interface graphic elements and the test labels corresponding to each sample ATS interface graphic element.
[0056] The device provided by the embodiment of the present invention obtains the graphic element to be tested by identifying the icon elements and / or the text elements corresponding to the icon elements in the ATS interface diagram; extracts the element correlation characteristics and element layout characteristics of the graphic element to be tested based on the ATS interface test model, and performs comparison and analysis based on the element correlation characteristics and the element layout characteristics to obtain the ATS interface test results, thereby realizing comprehensive, ATS interface-specific, efficient and accurate interface testing.
[0057] Based on any of the above embodiments, the testing unit is specifically used for: Comparing and analyzing the element correlation feature with the expected element correlation feature corresponding to the graphic element to be tested, and obtaining an element correlation test result; Comparing and analyzing the element layout features with the expected element layout features corresponding to the graphic element to be tested, obtaining an element layout test result; The ATS interface test result is obtained based on the element association test result and the element layout test result.
[0058] Based on any of the above embodiments, the primitive extraction unit is specifically used for: Based on any of the above embodiments, the primitive extraction unit is further specifically used for: Performing visual corrosion and expansion processing on the ATS interface image to be tested to obtain a pre-processed interface image; Performing graphic element recognition on the preprocessed interface image based on an image recognition model to obtain the element recognition result; The image recognition model is obtained by training a general image recognition model based on sample primitives.
[0059] Based on any of the above embodiments, the primitive extraction unit is further specifically used for: Based on a preset color threshold, the color value of each pixel of the ATS interface image to be tested is compared to obtain the element recognition result; Based on the contour coordinates of the element recognition result, the ATS interface image to be tested is segmented to extract the image elements to be tested.
[0060] Based on any of the above embodiments, the icon element includes at least one of a platform icon, a signal icon, a track section icon, a switch icon, and a train window icon; The text element includes the device name of the icon element.
[0061] Based on any of the above embodiments, the acquiring unit is specifically used for: The original ATS interface image is dragged based on a pre-written control program to automatically capture the ATS interface image within the current screen range to obtain the ATS interface image to be tested.
[0062] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the ATS interface test method, which includes: obtaining the ATS interface image to be tested; performing element recognition on the ATS interface image to be tested to obtain an element recognition result, and segmenting the ATS interface image to be tested based on the contour coordinates of the element recognition result to extract the image element to be tested; the element recognition result includes an icon element and / or a text element corresponding to the icon element; extracting the element association feature and the element layout feature of the image element to be tested based on the ATS interface test model, so as to compare and analyze the element association feature and the element layout feature to obtain the ATS interface test result; the ATS interface test model is trained based on the sample ATS interface image element and the test label corresponding to each sample ATS interface image element.
[0063] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0064] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the ATS interface testing method provided by the above-mentioned methods, which includes: obtaining an ATS interface image to be tested; performing element recognition on the ATS interface image to be tested to obtain an element recognition result, and segmenting the ATS interface image to be tested based on the contour coordinates of the element recognition result to extract the graphic elements to be tested; the element recognition result includes icon elements and / or text elements corresponding to the icon elements; extracting element correlation features and element layout features of the graphic elements to be tested based on an ATS interface testing model, and performing comparison and analysis based on the element correlation features and the element layout features to obtain an ATS interface testing result; the ATS interface testing model is trained based on sample ATS interface graphic elements and the test labels corresponding to each sample ATS interface graphic element.
[0065] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the ATS interface testing method provided by the above-mentioned methods, the method comprising: obtaining an ATS interface image to be tested; performing element recognition on the ATS interface image to be tested to obtain an element recognition result, and segmenting the ATS interface image to be tested based on the contour coordinates of the element recognition result to extract the graphic elements to be tested; the element recognition result includes icon elements and / or text elements corresponding to the icon elements; extracting element association features and element layout features of the graphic elements to be tested based on an ATS interface testing model, and performing comparison and analysis based on the element association features and the element layout features to obtain an ATS interface testing result; the ATS interface testing model is trained based on sample ATS interface graphic elements and the test labels corresponding to each sample ATS interface graphic element.
[0066] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0067] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0068] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An ATS interface testing method, characterized in that: include: Get the ATS interface image to be tested; Performing element recognition on the ATS interface image to be tested to obtain an element recognition result, and segmenting the ATS interface image to be tested based on the contour coordinates of the element recognition result to extract the graphic elements to be tested; the element recognition result includes icon elements and / or text elements corresponding to the icon elements; Based on the ATS interface test model, the element correlation features and element layout features of the graphic element to be tested are extracted, and a comparative analysis is performed based on the element correlation features and the element layout features to obtain the ATS interface test results; the ATS interface test model is trained based on sample ATS interface graphic elements and the test labels corresponding to each sample ATS interface graphic element.
2. The ATS interface testing method according to claim 1, characterized in that: The comparison and analysis based on the element association feature and the element layout feature to obtain the ATS interface test result includes: Comparing and analyzing the element correlation feature with the expected element correlation feature corresponding to the graphic element to be tested, and obtaining an element correlation test result; Comparing and analyzing the element layout features with the expected element layout features corresponding to the graphic element to be tested, obtaining an element layout test result; The ATS interface test result is obtained based on the element association test result and the element layout test result.
3. The ATS interface testing method according to claim 1, characterized in that: The performing element identification on the ATS interface diagram to be tested to obtain an element identification result includes: Performing visual corrosion and expansion processing on the ATS interface image to be tested to obtain a pre-processed interface image; Performing element recognition on the preprocessed interface image based on an image recognition model to obtain the element recognition result; The image recognition model is obtained by training a general image recognition model based on sample primitives.
4. The ATS interface testing method according to any one of claims 1 to 3, characterized in that: The step of segmenting the ATS interface image to be tested based on the contour coordinates of the element recognition result to extract the image elements to be tested includes: Based on a preset color threshold, the color value of each pixel of the ATS interface image to be tested is compared to obtain the element recognition result; Based on the contour coordinates of the element recognition result, the ATS interface image to be tested is segmented to extract the image elements to be tested.
5. The ATS interface testing method according to any one of claims 1 to 3, characterized in that: The icon elements include at least one of a platform icon, a signal icon, a track section icon, a switch icon, and a train window icon; The text element includes the device name of the icon element.
6. The ATS interface testing method according to any one of claims 1 to 3, characterized in that: The step of obtaining the ATS interface diagram to be tested includes: The original ATS interface image is dragged based on a pre-written control program to automatically capture the ATS interface image within the current screen range to obtain the ATS interface image to be tested.
7. An ATS interface testing device, characterized in that: include: Get the unit to get the ATS interface image to be tested; The graphic element extraction unit performs element recognition on the ATS interface image to be tested to obtain an element recognition result, and segments the ATS interface image to be tested based on the contour coordinates of the element recognition result to extract the graphic elements to be tested; the element recognition result includes icon elements and / or text elements corresponding to the icon elements; The testing unit extracts the element association features and element layout features of the graphic element to be tested based on the ATS interface testing model, and performs comparative analysis based on the element association features and the element layout features to obtain the ATS interface testing results; the ATS interface testing model is trained based on sample ATS interface graphic elements and the test labels corresponding to each sample ATS interface graphic element.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the ATS interface testing method as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the ATS interface testing method as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the ATS interface testing method as described in any one of claims 1 to 6 is implemented.