Test method and apparatus, electronic device, and storage medium
By generating simulated data packets and using image processing technology to verify the display of the automotive system interface, the problems of high complexity, high cost, and low efficiency of traditional testing methods are solved, and fast and accurate test results are achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- CHINA FAW CO LTD
- Filing Date
- 2024-10-09
- Publication Date
- 2026-05-21
AI Technical Summary
Traditional automotive testing methods are complex, costly, and inefficient, requiring a large amount of hardware and human resources, and the testing process is time-consuming.
By acquiring the design drawings, a simulated data packet is generated according to a preset mapping relationship. The vehicle system receives and parses the data packet, and displays tire pressure, vehicle speed, fuel consumption, and driving distance on the vehicle interface. Image processing technology is used to compare the design drawings with the target drawings to verify whether the interface display is correct and obtain the test results.
This reduces the complexity of the testing process, improves testing efficiency, lowers testing costs, and enables rapid and accurate verification of automotive system interface displays.
Smart Images

Figure CN2024123547_21052026_PF_FP_ABST
Abstract
Description
A testing method and apparatus, electronic device and storage medium Technical Field
[0001] This application relates to the field of testing technology, and in particular to a testing method and apparatus, electronic equipment and storage medium. Background Technology
[0002] With the rapid development of the automotive industry, vehicle iteration cycles have become shorter, placing higher demands on testing efficiency and quality. Traditional testing methods in the automotive industry suffer from the following problems:
[0003] 1. High complexity: Traditional testing methods usually require a large amount of hardware equipment and manual operation, making the testing process complex;
[0004] 2. High cost: Traditional automotive system testing methods require the purchase of expensive hardware and tools, as well as a large amount of human resources for testing and monitoring, resulting in high demand for both hardware and human resources.
[0005] 3. Low efficiency: Traditional testing methods usually require a lot of time and effort to conduct testing and data analysis, which is inefficient.
[0006] In summary, the technical problems existing in the relevant technologies need to be improved.
[0007] Summary of the Invention
[0008] The main objective of this application is to provide a testing method, apparatus, electronic device, and storage medium, which aims to reduce the complexity of the testing process, improve testing efficiency, and reduce testing costs.
[0009] To achieve the above objectives, one aspect of this application provides a testing method, the method comprising:
[0010] Obtain the design drawings;
[0011] A simulated data packet is generated based on a preset mapping relationship and the functional modules in the design drawing. The simulated data packet includes tire pressure, vehicle speed, fuel consumption, and driving distance.
[0012] The simulated data packets are received and parsed by the vehicle system;
[0013] In response to the first command, the tire pressure, vehicle speed, fuel consumption, and driving distance are displayed on the vehicle system's infotainment interface.
[0014] Take a screenshot of the vehicle's infotainment interface to obtain the target image;
[0015] Image processing techniques are used to compare the target image with the design image to verify whether the interface display is correct and to obtain test results.
[0016] In some embodiments, the method further includes:
[0017] The simulated data packets are sent using an Ethernet communication module;
[0018] Record the test results.
[0019] In some embodiments, the method further includes:
[0020] Map the functional modules in the design drawings to the data packets in Ethernet communication to determine the preset mapping relationship.
[0021] In some embodiments, mapping the functional modules in the design drawing to data packets in Ethernet communication and determining a preset mapping relationship includes:
[0022] The functional modules in the design drawings are mapped to data packets in Ethernet communication using a dictionary to determine a preset mapping relationship, which includes a mapping dictionary.
[0023] In some embodiments, the method further includes:
[0024] In response to the second instruction, the target diagram, the design diagram, and the test results are displayed on the test results page of the vehicle system.
[0025] In some embodiments, comparing the target image with the design image using image processing technology to verify whether the interface display is correct and obtaining test results includes:
[0026] Extract a first key feature from the design drawing and extract a second key feature from the target drawing;
[0027] Compare the first key feature with the second key feature to obtain the degree of difference;
[0028] Obtain the preset threshold;
[0029] When the difference exceeds the preset threshold, it is determined that the interface display is incorrect, and the test result includes test failure.
[0030] In some embodiments, the method further includes:
[0031] If the difference does not exceed the preset threshold, the interface display is determined to be correct, and the test result includes test success.
[0032] In some embodiments, the method further includes:
[0033] When the difference exceeds the preset threshold, the target model is obtained;
[0034] By analyzing the target model and the design drawing, the reasons for the test failure can be obtained.
[0035] In some embodiments, the method further includes:
[0036] In response to the third instruction, the target diagram, the design diagram, the test results, the degree of difference, and the reason for the test failure are displayed on the test results page of the vehicle system.
[0037] To achieve the above objectives, another aspect of this application provides a testing apparatus, the apparatus comprising:
[0038] The design drawing acquisition module is used to acquire design drawings.
[0039] The data simulation module is used to generate a simulation data package based on a preset mapping relationship and the functional modules in the design drawing. The simulation data package includes tire pressure, vehicle speed, fuel consumption, and driving distance.
[0040] A receiving module is used to receive and parse the simulated data packets through the vehicle system;
[0041] The display module is used to display the tire pressure, vehicle speed, fuel consumption and driving distance on the vehicle system's infotainment interface in response to the first instruction.
[0042] The target image acquisition module is used to take a screenshot of the vehicle interface to obtain a target image;
[0043] The testing module is used to compare the target image with the design image using image processing technology, verify whether the interface display is correct, and obtain test results.
[0044] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.
[0045] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.
[0046] The embodiments of this application include at least the following beneficial effects: This application provides a testing method and apparatus, electronic device, and storage medium. This solution obtains a design drawing; generates a simulated data packet according to a preset mapping relationship and the functional modules in the design drawing, accurately simulating the data packet to verify the behavior and performance under different conditions; receives and parses the simulated data packet through the vehicle system; responds to a first instruction and displays tire pressure, vehicle speed, fuel consumption, and driving distance on the vehicle system's in-vehicle interface, intuitively verifying whether the vehicle system correctly receives and displays information from the simulated data packet; takes a screenshot of the in-vehicle interface to obtain a target image; uses image processing technology to compare the design drawing and the target image to verify whether the interface display is correct, and obtains the test results. This quickly and accurately verifies whether the interface display of the vehicle system meets the design requirements, reduces the complexity of the testing process, improves testing efficiency, and reduces testing costs. Attached Figure Description
[0047] Figure 1 is a flowchart of the testing method provided in an embodiment of this application;
[0048] Figure 2 is another flowchart of the testing method provided in the embodiments of this application;
[0049] Figure 3 is a flowchart of step S208 in Figure 2;
[0050] Figure 4 is another flowchart of the testing method provided in the embodiments of this application;
[0051] Figure 5 is a schematic diagram of a design provided in an embodiment of this application;
[0052] Figure 6 is a schematic diagram of the preset mapping relationship provided in an embodiment of this application;
[0053] Figure 7 is a schematic diagram of the target diagram provided in an embodiment of this application;
[0054] Figure 8 is a schematic diagram of key components provided in an embodiment of this application;
[0055] Figure 9 is a schematic diagram of the test device provided in an embodiment of this application;
[0056] Figure 10 is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring 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 those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0058] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0059] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0061] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0062] 1) The vehicle interface refers to the interface of the intelligent in-vehicle information system installed inside the car.
[0063] 2) In-Vehicle Infotainment (IVI) refers to the infotainment and in-vehicle information management system installed inside a car. IVI aims to provide drivers and passengers with various information and services while enhancing driving safety and convenience.
[0064] 3) The cockpit interface refers to the human-machine interface inside the car cabin, including all control panels, displays and interactive devices for driver and passenger interaction.
[0065] With the rapid development of the automotive industry, vehicle iteration cycles have become shorter, placing higher demands on testing efficiency and quality. Traditional testing methods in the automotive industry suffer from the following problems:
[0066] 1. High complexity: Traditional testing methods usually require a large amount of hardware equipment and manual operation, making the testing process complex;
[0067] 2. High cost: Traditional automotive system testing methods require the purchase of expensive hardware and tools, as well as a large amount of human resources for testing and monitoring, resulting in high demand for both hardware and human resources.
[0068] 3. Low efficiency: Traditional testing methods usually require a lot of time and effort to conduct testing and data analysis, which is inefficient.
[0069] In view of this, embodiments of this application provide a testing method and apparatus, an electronic device, and a storage medium. This solution obtains a design drawing; generates a simulated data packet according to a preset mapping relationship and the functional modules in the design drawing, accurately simulating the data packet to verify behavior and performance under different conditions; receives and parses the simulated data packet through the vehicle system; in response to a first instruction, displays tire pressure, vehicle speed, fuel consumption, and driving distance on the vehicle system's infotainment interface, intuitively verifying whether the vehicle system correctly receives and displays information from the simulated data packet; takes a screenshot of the infotainment interface to obtain a target image; uses image processing technology to compare the design drawing and the target image to verify whether the interface display is correct, obtaining test results. This quickly and accurately verifies whether the vehicle system's interface display meets design requirements, reducing the complexity of the testing process, improving testing efficiency, and reducing testing costs.
[0070] The testing method provided in this application relates to the field of testing technology. The testing method provided in this application can be applied to a terminal, a server, or software running on a terminal or server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the testing method, but is not limited to the above forms.
[0071] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0072] Figure 1 is an optional flowchart of a testing method provided in an embodiment of this application. The method in Figure 1 may include, but is not limited to, steps S101 to S106.
[0073] Step S101: Obtain the design drawing.
[0074] Specifically, the design drawings include the layout of the cockpit interface and functional modules.
[0075] This application does not impose specific limitations on the method of obtaining design drawings; the appropriate method can be flexibly selected based on actual testing needs. For example, design drawings can be obtained by taking screenshots, retrieving them from a database, or obtaining them from a designer.
[0076] In this embodiment, the design drawings are obtained to prepare for subsequent testing.
[0077] Step S102: Generate a simulated data packet based on the preset mapping relationship and the functional modules in the design drawing.
[0078] Specifically, the simulated data package includes simulated data such as tire pressure, vehicle speed, fuel consumption, and driving distance.
[0079] In some embodiments, a mapping relationship between functional modules and simulation data is pre-set.
[0080] Optionally, a preset mapping relationship and functional modules in the design drawing are obtained, and a simulated data packet is generated based on the preset mapping relationship and functional modules in the design drawing.
[0081] Furthermore, using an Ethernet communication module, the generated simulated data packets are sent to the vehicle system via the Ethernet protocol.
[0082] In this embodiment, simulated data packets are generated according to the preset mapping relationship and the functional modules in the design diagram. The data packets are accurately simulated to verify the behavior and performance under different conditions, thus preparing for subsequent data packet parsing and verification.
[0083] Step S103: Receive and parse the simulated data packets through the vehicle system.
[0084] In some embodiments, the vehicle system receives analog data packets and parses the information contained therein.
[0085] Furthermore, the vehicle system analyzes tire pressure, vehicle speed, fuel consumption, and driving distance.
[0086] In this embodiment, the vehicle system receives and parses the simulated data packet to obtain tire pressure, vehicle speed, fuel consumption, and driving distance. This confirms that the vehicle system has successfully received the simulated data packet and parses it, improving data parsing efficiency and facilitating the verification of the content of the simulated data packet. This prepares the vehicle system for displaying tire pressure, vehicle speed, fuel consumption, and driving distance on the vehicle's infotainment interface.
[0087] In step S104, in response to the first instruction, tire pressure, vehicle speed, fuel consumption, and driving distance are displayed on the vehicle system's infotainment interface.
[0088] Specifically, the first instruction is used to display the vehicle infotainment interface and is triggered when the vehicle infotainment interface is opened or refreshed.
[0089] In some embodiments, the obtained tire pressure, vehicle speed, fuel consumption, and driving distance are acquired and displayed on the vehicle system's infotainment interface.
[0090] In this embodiment, in response to the first instruction, tire pressure, vehicle speed, fuel consumption, and driving distance are displayed on the vehicle system's infotainment interface to visually verify whether the vehicle system has correctly received and displayed information from the simulated data packet.
[0091] Step S105: Take a screenshot of the vehicle's infotainment system interface to obtain the target image.
[0092] This application does not impose specific limitations on the method of taking screenshots of the vehicle's infotainment system interface; the appropriate method can be flexibly selected based on actual testing needs. For example, screenshots can be taken using the built-in screenshot function of the vehicle system, or using screenshot tools or software.
[0093] In this embodiment, a screenshot of the vehicle's infotainment system interface is taken to obtain the target image, which prepares for subsequent verification of whether the interface display is correct.
[0094] Step S106: Use image processing technology to compare the design drawing and the target drawing, verify whether the interface display is correct, and obtain the test results.
[0095] In some embodiments, image processing technology is used to compare the differences between the design drawing and the target drawing to obtain the difference degree. It is then determined whether the difference degree exceeds a preset threshold to verify whether the interface display is correct, thereby obtaining the test result.
[0096] Optionally, a first key feature is extracted from the design image and a second key feature is extracted from the target image. By comparing the features of the two images, the difference between the design image and the target image is calculated. It is then determined whether the difference exceeds a preset threshold to verify whether the interface display is correct, thereby obtaining the test result. The first key feature includes pixel value, color, texture, and shape, and the second key feature includes pixel value, color, texture, and shape.
[0097] In some embodiments, the similarity between two graphs is calculated using one of normalized cross-correlation or cosine similarity.
[0098] In some embodiments, one of the following metrics—structural similarity index (SSIM), mean squared error (MSE), and peak signal-to-noise ratio (PSNR)—is used to quantify the degree of difference.
[0099] Understandably, if the difference exceeds the preset threshold, the image difference is too large, the vehicle interface will display incorrectly, and the test will fail; otherwise, the image difference is considered to be within an acceptable range, the vehicle interface will display correctly, and the test will succeed.
[0100] In this embodiment, image processing technology is used to compare the design drawing and the target drawing to verify whether the interface display is correct and obtain test results. This allows for quick and accurate verification of whether the vehicle system's infotainment interface display meets the design requirements, reducing the complexity of the testing process, improving testing efficiency, and lowering testing costs.
[0101] Steps S101 to S106 as illustrated in this embodiment involve: acquiring a design drawing; generating a simulated data packet based on a preset mapping relationship and the functional modules in the design drawing; accurately simulating the data packet to verify behavior and performance under different conditions; receiving and parsing the simulated data packet through the vehicle system; displaying tire pressure, vehicle speed, fuel consumption, and driving distance on the vehicle system's infotainment interface in response to a first instruction, intuitively verifying whether the vehicle system correctly receives and displays information from the simulated data packet; taking a screenshot of the infotainment interface to obtain a target image; comparing the design drawing and the target image using image processing technology to verify whether the interface display is correct, obtaining test results, quickly and accurately verifying whether the vehicle system's interface display meets design requirements, reducing the complexity of the testing process, improving testing efficiency, and reducing testing costs.
[0102] Figure 2 is an optional flowchart of the testing method provided in the embodiment of this application. The method in Figure 1 may include, but is not limited to, steps S201 to S210.
[0103] Step S201: Map the functional modules in the design drawing to the data packets in the Ethernet communication using a dictionary to determine the preset mapping relationship.
[0104] Specifically, the preset mapping relationships include a mapping dictionary.
[0105] In step S201 of some embodiments, the functional modules in the design diagram are mapped to data packets in Ethernet communication using a dictionary, and a mapping dictionary is established as a preset mapping relationship.
[0106] In this embodiment, a dictionary is used to map the functional modules in the design drawing to the data packets in Ethernet communication, determine the preset mapping relationship, and establish an accurate and clear mapping relationship, which prepares for the subsequent generation of simulated data packets based on the preset mapping relationship and the functional modules in the design drawing.
[0107] Step S202: Obtain the design drawing.
[0108] Step S203: Generate a simulated data packet based on the preset mapping relationship and the functional modules in the design drawing.
[0109] In step S203 of some embodiments, a mapping dictionary is obtained, the mapping dictionary is queried according to the functional modules in the design diagram to obtain the data to be simulated, and a simulation data packet is generated according to the data to be simulated.
[0110] In this embodiment, a simulated data packet is generated based on the preset mapping relationship and the functional modules in the design diagram to accurately simulate the data, which is beneficial for subsequent testing and verification.
[0111] Step S204: Use the Ethernet communication module to send simulated data packets.
[0112] In step S204 of some embodiments, the generated simulated data packets are sent to the vehicle system via the Ethernet protocol using an Ethernet communication module.
[0113] In this embodiment, an Ethernet communication module is used to send simulated data packets to simulate a real network communication environment, verify the vehicle system's ability to receive and process different types of data packets, and prepare for the vehicle system to receive and parse the simulated data packets in the future.
[0114] Step S205: Receive and parse the simulated data packet through the vehicle system.
[0115] In step S206, in response to the first instruction, tire pressure, vehicle speed, fuel consumption, and driving distance are displayed on the vehicle system's infotainment interface.
[0116] Step S207: Take a screenshot of the vehicle's infotainment system interface to obtain the target image.
[0117] Step S208: Use image processing technology to compare the design drawing and the target drawing, verify whether the interface display is correct, and obtain the test results.
[0118] Step S209: Record the test results.
[0119] In step S209 of some embodiments, this application does not specifically limit the method of recording test results, and can flexibly select the method according to actual test needs. For example, test results can be stored in a database or on a server.
[0120] In this embodiment, recording the test results helps to preserve the original test records, facilitates in-depth analysis of failed tests, identifies the root causes of problems, and allows for timely repair and optimization of the test process.
[0121] In step S210, in response to the second instruction, the target diagram, design diagram, and test results are displayed on the test results page of the vehicle system.
[0122] Specifically, the second instruction is used to automatically display the test result page of the vehicle system after the test results are obtained, and is triggered when the test result page of the vehicle system is automatically opened or refreshed after the test results are obtained.
[0123] In this embodiment, in response to the second instruction, the target diagram, design diagram and test results are displayed on the test results page of the vehicle system. This is beneficial for intuitively displaying the test results and for users to identify the cause of the test failure and carry out repair and optimization.
[0124] Please refer to Figure 3. In some embodiments, step S208 may include, but is not limited to, steps S301 to S309:
[0125] Step S301: Extract the first key feature from the design drawing and extract the second key feature from the target drawing.
[0126] In step S301 of some embodiments, image preprocessing is performed on the design drawing and the target drawing, and image processing algorithms are used to perform feature detection on the design drawing and the target drawing, and first key features and second key features are extracted from the detected features.
[0127] In some embodiments, the preprocessing of design drawings and target drawings includes, but is not limited to, the following steps:
[0128] Grayscale conversion: Converting design and target images from color to grayscale reduces data volume and eliminates interference from color information on feature extraction;
[0129] Contrast enhancement: Enhance the contrast between the design image and the target image by using at least one of histogram equalization and gamma correction to make the features more prominent;
[0130] Noise Removal: Use filters to remove noise from the design and target images.
[0131] In some embodiments, feature detection includes, but is not limited to:
[0132] Edge detection algorithms are used to detect edges in the design drawing and the target drawing.
[0133] A corner detection algorithm is used to identify the first corner in the design drawing and the second corner in the target drawing.
[0134] Feature point detection algorithms (such as SIFT, SURF, ORB, etc.) are used to extract the first key feature point in the design drawing and the second key feature point in the target drawing.
[0135] Optionally, a feature matching algorithm is used to match the second feature of the target image with features in the database to find the best match. Based on the matching results and a preset threshold, the most representative feature point is selected as the first key feature.
[0136] Optionally, a feature matching algorithm is used to match the features of the design drawing with features in the database to find the best match. Based on the matching results and a preset threshold, the most representative feature point is selected as the second key feature.
[0137] In this embodiment, a first key feature is extracted from the design drawing and a second key feature is extracted from the target drawing. The first and second key features accurately represent the content of the design drawing and the target drawing, which helps to evaluate the degree of difference in subsequent assessments.
[0138] Step S302: Compare the first key feature with the second key feature to obtain the difference.
[0139] In step S302 of some embodiments, feature matching is performed on the key features of the design drawing and the target drawing using predefined rules.
[0140] Optionally, a trained machine learning model can be used to match the second key feature of the target graph with the first key feature of the design graph.
[0141] In some embodiments, the design drawing and the target drawing are divided into multiple regions, and the differences between the first key feature and the second key feature of the corresponding regions in the design drawing and the target drawing are compared. Optionally, the difference between the two feature vectors of the first key feature and the second key feature is quantified by one of Euclidean distance and cosine similarity to obtain the difference degree.
[0142] In this embodiment, the first key feature and the second key feature are compared to obtain the difference degree, which quickly and accurately obtains the difference degree between the design drawing and the target drawing, thus preparing for the subsequent test results.
[0143] Step S303: Obtain the preset threshold.
[0144] Specifically, the preset threshold is a pre-set difference threshold.
[0145] This application does not impose specific limitations on the method for determining the preset threshold; it can be flexibly selected based on actual testing needs. For example, the preset threshold can be determined by the user or by the model based on historical test results.
[0146] In this embodiment, obtaining a preset threshold reduces the complexity of the testing process and prepares for subsequent determination of whether the difference exceeds the preset threshold.
[0147] Step S304: Determine whether the difference exceeds a preset threshold.
[0148] In step S304 of some embodiments, it is determined whether the difference exceeds a preset threshold. If the difference exceeds the preset threshold, step S305 is executed; otherwise, step S309 is executed.
[0149] In this embodiment, it is determined whether the difference exceeds a preset threshold, so as to quickly and accurately verify whether the interface display of the car system meets the design requirements, reduce the complexity of the testing process, improve testing efficiency, and reduce testing costs.
[0150] Step S305: Determine that the interface display is incorrect.
[0151] Specifically, test results include test failures.
[0152] Optionally, test results may also include incorrect interface display.
[0153] In this embodiment, determining that the interface display is incorrect and the test has failed prepares for subsequent analysis of the reasons for the test failure. The automation process reduces the complexity of the testing process, improves testing efficiency, and reduces testing costs.
[0154] Step S306: Obtain the target model.
[0155] Specifically, the target model is a pre-trained model used to analyze the reasons for test failures.
[0156] This application does not impose specific limitations on the target model, which can be flexibly selected based on actual testing needs. For example, the target model can be a convolutional neural network or a VGG model trained on a large-scale image dataset.
[0157] Step S307: Analyze the design drawing and target drawing using the target model to obtain the reasons for test failure.
[0158] In step S307 of some embodiments, the design drawing and target drawing are analyzed by the target model to obtain the test failure reason. The user determines whether the test failure reason is correct. If it is correct, the design drawing, target drawing and test failure reason are used to optimize the target model.
[0159] In step S308, in response to the third instruction, the target diagram, design diagram, test results, difference, and reasons for test failure are displayed on the test results page of the vehicle system.
[0160] Specifically, the third instruction is used to display the test results page of the vehicle system when the test fails, and is triggered when the test results page of the vehicle system is opened or refreshed after the reason for the test failure is obtained.
[0161] Step S309: Confirm that the interface is displayed correctly.
[0162] Specifically, the test result includes "test successful".
[0163] Optionally, the test results also include whether the interface displays correctly.
[0164] In step S309 of some embodiments, it is determined that the interface is displayed correctly and the test is successful. The automation process reduces the complexity of the testing process, improves testing efficiency, and reduces testing costs.
[0165] Figure 4 is an optional flowchart of the test method provided in the embodiments of this application. In some embodiments, the design drawing is a cockpit interface design drawing professionally designed by HMI. The method in Figure 4 may include, but is not limited to, steps S401 to S416.
[0166] Step S401: Map the functional modules in the design drawing to the data packets in the Ethernet communication using a dictionary to determine the preset mapping relationship.
[0167] In step S401 of some embodiments, the functional modules in the design diagram are mapped to data packets in Ethernet communication (by creating a dictionary that maps each signal to a key and a value) to ensure complete test coverage.
[0168] Step S402: Obtain the design drawing.
[0169] For example, the design diagram is shown in Figure 5, which includes charts of tire pressure, vehicle speed, fuel consumption, and driving distance.
[0170] Step S403: Generate a simulated data packet based on the preset mapping relationship and the functional modules in the design drawing.
[0171] For example, a schematic diagram of the preset mapping relationship is shown in Figure 6. The tire pressure information prompts include display or alarm operation indicators, and the tire pressure information prompts include HMIVw_NotifyOnChgFLTireSt, HMIVw_NotifyOnChgFRTireSt, HMIVw_NotifyOnchgRLTireSt, HMIVw_NotifyOnChgRRTireSt, and HMIVw_NotifyonchgTireWarningSt. Specifically, HMIVw_NotifyOnChgFLTireSt indicates "left front tire pressure change". When the pressure of the left front tire changes, the system updates this status and may trigger a warning; HMIVw_NotifyOnChgFRTireSt indicates "right front tire pressure change". When the pressure of the right front tire changes, the system updates this status and may trigger a warning; HMIVw_NotifyOnchgRLTireSt indicates "left rear tire pressure change". When the pressure of the left rear tire changes, the system updates this status and may trigger a warning. HMIVw_NotifyOnChgRRTireSt indicates "Right Rear Tire Pressure Change". The system updates this status when the pressure of the right rear tire changes, and may trigger a warning. HMIVw_NotifyonchgTireWarningSt indicates "Tire Warning Status Notification". The system updates HMIVw_NotifyonchgTireWarningSt when the pressure of any tire exceeds the preset safe range.
[0172] Step S404: Generate a simulated data packet based on the preset mapping relationship and the functional modules in the design drawing.
[0173] In step S404 of some embodiments, an Ethernet communication module is used to send a simulated data packet to simulate changes in the vehicle's state. The simulated data packet includes information such as tire pressure, vehicle speed, fuel consumption, and driving distance.
[0174] Step S405: Receive and parse the simulated data packet through the vehicle system.
[0175] In step S405 of some embodiments, the vehicle system starts the vehicle HMI interface and sets up a program to monitor the Ethernet reception status of the vehicle system.
[0176] The vehicle system subscribes to service signals, and after subscription, the underlying system transmits signals to the instrument cluster application. The instrument cluster application then receives the signals and displays the corresponding functions.
[0177] Understandably, the function can only be realized if the Ethernet signal is successfully received; if it fails, the function will not be displayed. In this case, it can be determined that there is an implementation problem, and the instrument application needs to determine the cause of the fault.
[0178] In step S406, in response to the first instruction, tire pressure, vehicle speed, fuel consumption, and driving distance are displayed on the vehicle system's infotainment interface.
[0179] Step S407: Take a screenshot of the vehicle's infotainment system interface to obtain the target image.
[0180] In step S407 of some embodiments, a screenshot is taken of the vehicle interface to capture the currently displayed content. Each signal has a corresponding function and a corresponding slice, which the application displays on the screen. For example, a target graph diagram is shown in Figure 7, which includes charts for tire pressure, vehicle speed, fuel consumption, and driving distance.
[0181] For example, the code for this embodiment is shown below:
[0182] Step S408: Extract the first key feature from the design drawing and the second key feature from the target drawing, compare the first key feature and the second key feature to obtain the difference.
[0183] In step S408 of some embodiments, a first key feature and a second key feature, such as pixel value, color, texture, shape, etc., are extracted from the image.
[0184] Specifically, image difference analysis can be performed in the following ways to obtain the degree of difference:
[0185] Pixel-by-pixel differencing: Calculates the difference between each pixel in adjacent frames. The degree of difference between frames can be represented by calculating the difference between pixel values (such as absolute difference or squared difference). Larger differences may indicate the presence of errors or anomalies.
[0186] Block matching: Dividing an image into multiple blocks and comparing the pixel differences between corresponding blocks in adjacent frames. Block matching algorithms can calculate similarity measures between blocks based on pixel differences, such as mean squared error or cross-correlation. Inconsistent or anomalous block matching results may indicate the presence of slicing errors.
[0187] Correlation comparison: This assesses the similarity between adjacent frames by calculating their correlation. Correlation metrics can be achieved by calculating the correlation coefficient or similarity index (such as the structural similarity index) between pixels in two frames. Low correlation or similarity indices may indicate slicing errors or discontinuities in image content.
[0188] Optionally, key components such as buttons, text boxes, and icons are identified in the target image and the design drawing. Their positions, sizes, shapes, and styles, as well as their relative relationships within the images, are compared to determine the degree of difference. For example, a schematic diagram of the key components of the target image is shown in Figure 8.
[0189] Furthermore, by comparing the features of the design drawing and the target drawing, the similarity or difference between them is calculated.
[0190] Step S409: Obtain a preset threshold and determine whether the difference exceeds the preset threshold.
[0191] Step S410: Determine that the interface display is incorrect.
[0192] In step S410 of some embodiments, it is determined that the interface display is incorrect, and the test result is a test failure.
[0193] Step S411: Obtain the target model, analyze the design drawing and target drawing through the target model, and obtain the reasons for the test failure.
[0194] Step S412: Record the test results.
[0195] In step S412 of some embodiments, the result of each test is recorded, including whether it passes or fails, and the specific reason for the failure.
[0196] Furthermore, conduct in-depth analysis of failed tests to identify the root causes of the problems and promptly fix and optimize the testing process.
[0197] Optionally, based on test results and feedback, continuously optimize the testing process and methods to improve testing efficiency and quality. Continuously update design drawings and signal mappings to adapt to changes and developments in automotive HMI interfaces.
[0198] In step S413, in response to the third instruction, the target diagram, design diagram, test results, difference, and reasons for test failure are displayed on the test results page of the vehicle system.
[0199] Step S414: Confirm that the interface is displayed correctly.
[0200] In step S414 of some embodiments, it is determined that the interface is displayed correctly and the test result is that the test is successful.
[0201] Step S415: Record the test results.
[0202] Step S416, in response to the second instruction, displays the target diagram, design diagram, test results, and degree of difference on the test results page of the vehicle system.
[0203] Please refer to Figure 9. This application embodiment also provides a testing apparatus that can implement the above-described testing method. The apparatus includes:
[0204] Design drawing acquisition module 901 is used to acquire design drawings;
[0205] The data simulation module 902 is used to generate a simulation data packet based on a preset mapping relationship and the functional modules in the design drawing. The simulation data packet includes tire pressure, vehicle speed, fuel consumption, and driving distance.
[0206] Receiver module 903 is used to receive and parse the simulated data packets through the vehicle system;
[0207] Display module 904 is used to display the tire pressure, vehicle speed, fuel consumption and driving distance on the vehicle system's infotainment interface in response to the first instruction;
[0208] The target image acquisition module 905 is used to take a screenshot of the vehicle interface to obtain a target image;
[0209] The test module 906 is used to compare the target image with the design image using image processing technology, verify whether the interface display is correct, and obtain test results.
[0210] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0211] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described testing method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0212] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0213] Please refer to Figure 9, which illustrates the hardware structure of an electronic device according to another embodiment. The electronic device includes:
[0214] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0215] The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 using the test methods of the embodiments of this application.
[0216] The input / output interface 903 is used to implement information input and output;
[0217] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0218] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);
[0219] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.
[0220] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described test method.
[0221] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0222] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0223] The testing method, testing device, electronic device, and storage medium provided in this application embodiment acquire a design drawing; generate simulated data packets according to a preset mapping relationship and the functional modules in the design drawing, accurately simulating the data packets to verify behavior and performance under different conditions; receive and parse the simulated data packets through the vehicle system; in response to a first instruction, display tire pressure, vehicle speed, fuel consumption, and driving distance on the vehicle system's infotainment interface, intuitively verifying whether the vehicle system correctly receives and displays information from the simulated data packets; take a screenshot of the infotainment interface to obtain a target image; use image processing technology to compare the design drawing and the target image to verify whether the interface display is correct, and obtain test results. This quickly and accurately verifies whether the vehicle system's interface display meets design requirements, reduces the complexity of the testing process, improves testing efficiency, and reduces testing costs.
[0224] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0225] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0226] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0227] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0228] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0229] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0230] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0231] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0232] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0233] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0234] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A test method characterized by, The method includes: Obtain the design drawings; A simulated data packet is generated based on a preset mapping relationship and the functional modules in the design drawing. The simulated data packet includes tire pressure, vehicle speed, fuel consumption, and driving distance. The simulated data packets are received and parsed by the vehicle system; In response to the first command, the tire pressure, vehicle speed, fuel consumption, and driving distance are displayed on the vehicle system's infotainment interface. Take a screenshot of the vehicle's infotainment interface to obtain the target image; Image processing technology is used to compare the target image with the design image to verify whether the vehicle interface display is correct, thereby obtaining the test results.
2. The method of claim 1, wherein, The method further includes: The simulated data packets are sent using an Ethernet communication module; Record the test results.
3. The method of claim 1, wherein, The method further includes: The functional modules in the design drawings are mapped to data packets in Ethernet communication to determine the preset mapping relationship.
4. The method of claim 3, wherein, The preset mapping relationship includes a mapping dictionary. The process of mapping functional modules in the design drawing to data packets in Ethernet communication to determine the preset mapping relationship includes: The mapping dictionary is obtained by mapping the functional modules in the design drawing to the data packets in Ethernet communication using a dictionary.
5. The method of claim 1, wherein, The method further includes: In response to the second instruction, the target diagram, the design diagram, and the test results are displayed on the test results page of the vehicle system.
6. The method of claim 1, wherein, The step of using image processing technology to compare the target image with the design image to verify whether the vehicle interface display is correct, thereby obtaining test results, includes: Extract a first key feature from the design drawing and extract a second key feature from the target drawing; Compare the first key feature with the second key feature to obtain the degree of difference; Obtain the preset threshold; When the difference exceeds the preset threshold, it is determined that the interface display is incorrect, and the test result is a test failure.
7. The method of claim 6, wherein, The method further includes: If the difference does not exceed the preset threshold, the interface display is determined to be correct, and a test result indicating successful testing is obtained.
8. The method of claim 6, wherein, The method further includes: When the difference exceeds the preset threshold, the target model is obtained; By analyzing the target model and the design drawing, the reasons for the test failure can be obtained.
9. The method of claim 8, wherein, The method further includes: In response to the third instruction, the target diagram, the design diagram, the test results, the degree of difference, and the reason for the test failure are displayed on the test results page of the vehicle system.
10. A test device, characterized by The device includes: The design drawing acquisition module is used to acquire design drawings. The data simulation module is used to generate a simulation data package based on a preset mapping relationship and the functional modules in the design drawing. The simulation data package includes tire pressure, vehicle speed, fuel consumption, and driving distance. A receiving module is used to receive and parse the simulated data packets through the vehicle system; The display module is used to display the tire pressure, vehicle speed, fuel consumption and driving distance on the vehicle system's infotainment interface in response to the first instruction. The target image acquisition module is used to take a screenshot of the vehicle interface to obtain a target image; The testing module is used to compare the target image with the design image using image processing technology, verify whether the interface display is correct, and obtain test results.
11. An electronic device, comprising: include: At least one processor; at least one memory storing at least one program; when the at least one program is executed by the at least one processor, the at least one processor is caused to implement the method according to any one of claims 1-9.
12. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by a processor to implement the method according to any one of claims 1-9.