Test method and apparatus, electronic device, and storage medium
By obtaining the design drawings to generate simulated data packets and displaying tire pressure, vehicle speed, fuel consumption and other information in the vehicle system, and using image processing technology to verify the interface display, the problems of high complexity, high cost and low efficiency of traditional vehicle testing methods are solved, and fast and accurate test results are achieved.
Patent Information
- Application Number
- PCT/CN2024/123547
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-10
- Filing Date
- 2024-10-09
- Publication Date
- 2025-10-16
AI Technical Summary
Traditional automotive testing methods are complex, costly, and inefficient, requiring a large amount of hardware equipment and human resources, and the testing process is time-consuming.
By obtaining the design drawing, a simulation data packet is generated, and the vehicle system is used to receive and parse the data packet. The tire pressure, vehicle speed, fuel consumption and driving distance are displayed on the vehicle interface. Image processing technology is used to compare the design drawing with the target drawing to verify whether the interface display is correct and obtain the test results.
Quickly and accurately verify whether the automotive system interface display meets the design requirements, reduce the complexity of the testing process, improve test efficiency, and reduce test costs.
Smart Images

Figure CN2024123547_16102025_PF_FP_ABST
Abstract
Description
Test method and device, electronic device and storage medium TECHNICAL FIELD
[0001] The present application relates to the technical field of testing, in particular to a test method and device, an electronic device and a storage medium. BACKGROUND
[0002] With the rapid development of the automotive industry, the iteration cycle of vehicle models becomes shorter, and higher requirements are put forward for test efficiency and quality. The traditional test method of the automotive industry has the following problems:
[0003] 1. High complexity: The traditional test method usually requires a large number of hardware devices and manual operation, and the test process is complex;
[0004] 2. High cost: The traditional automotive system test method needs to purchase expensive hardware devices and tools, and a large number of human resources are needed for testing and monitoring, and the demand for hardware devices and human resources is high;
[0005] 3. Low efficiency: The traditional test method usually takes a lot of time and effort to test and analyze data, and is inefficient.
[0006] In summary, the technical problems in the related art need to be improved.
[0007] SUMMARY
[0008] The main purpose of the embodiments of the present application is to provide a test method and device, an electronic device and a storage medium, which aims to reduce the complexity of the test process, improve the test efficiency and reduce the test cost.
[0009] To achieve the above-mentioned purpose, one aspect of the embodiments of the present application provides a test method, which comprises:
[0010] Obtaining a design drawing;
[0011] Generating a simulation data packet according to a preset mapping relationship and a functional module in the design drawing, the simulation data packet comprising tire pressure, vehicle speed, fuel consumption and driving distance;
[0012] Receiving and analyzing the simulation data packet through the automotive system;
[0013] In response to a first instruction, displaying the tire pressure, the vehicle speed, the fuel consumption and the driving distance on the car machine interface of the automotive system;
[0014] Taking a screenshot of the car machine interface to obtain a target image;
[0015] Using image processing technology to compare the target image with the design drawing to verify whether the interface display is correct, and obtaining a test result.
[0016] In some embodiments, the method further comprises:
[0017] sending the analog data packet using the Ethernet communication module;
[0018] recording the test result.
[0019] In some embodiments, the method further comprises:
[0020] mapping the function modules in the design diagram with the data packets in the Ethernet communication to determine a preset mapping relationship.
[0021] In some embodiments, the mapping the function modules in the design diagram with the data packets in the Ethernet communication to determine a preset mapping relationship comprises:
[0022] mapping the function modules in the design diagram with the data packets in the Ethernet communication by way of a dictionary to determine a preset mapping relationship, the mapping relationship comprising a mapping dictionary.
[0023] In some embodiments, the method further comprises:
[0024] in response to a second instruction, displaying the target diagram, the design diagram, and the test result on a test result page of the automotive system.
[0025] In some embodiments, the using image processing technology to compare the target diagram with the design diagram to verify whether the interface display is correct to obtain a test result comprises:
[0026] extracting first key features from the design diagram and second key features from the target diagram;
[0027] comparing the first key features with the second key features to obtain a difference degree;
[0028] obtaining a preset threshold value;
[0029] when the difference degree exceeds the preset threshold value, determining that the interface display is incorrect, the test result comprising a test failure.
[0030] In some embodiments, the method further comprises:
[0031] when the difference degree does not exceed the preset threshold value, determining that the interface display is correct, the test result comprising a test success.
[0032] In some embodiments, the method further comprises:
[0033] when the difference degree exceeds the preset threshold value, obtaining a target model;
[0034] The target picture and the design picture are analyzed by a target model to obtain a test failure cause.
[0035] In some embodiments, the method further includes:
[0036] In response to the third instruction, the target picture, the design picture, the test result, the difference degree, and the test failure cause are displayed on a test result page of the automobile system.
[0037] To achieve the above object, another aspect of the embodiments of the present application provides a test device, which comprises:
[0038] A design picture acquisition module is configured to acquire a design picture.
[0039] A data simulation module is configured to generate a simulation data packet according to a preset mapping relationship and a functional module in the design picture, wherein the simulation data packet comprises tire pressure, vehicle speed, fuel consumption, and driving distance.
[0040] A receiving module is configured to receive and analyze the simulation data packet through an automobile system.
[0041] A display module is configured to display the tire pressure, the vehicle speed, the fuel consumption, and the driving distance on a car machine interface of the automobile system in response to a first instruction.
[0042] A target picture acquisition module is configured to take a screenshot of the car machine interface to obtain a target picture.
[0043] A test module is configured to compare the target picture and the design picture by using an image processing technology to verify whether the interface display is correct, and obtain a test result.
[0044] To achieve the above object, another aspect of the embodiments of the present application provides an electronic device, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the above method when executing the computer program.
[0045] To achieve the above object, another aspect of the embodiments of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the above method.
[0046] The embodiments of the present application at least have the following beneficial effects: The present application provides a test method and device, electronic equipment and storage medium, the scheme obtains a design drawing; generates a simulation data packet according to a preset mapping relationship and a function module in the design drawing, accurately simulates the data packet, and verifies the behavior and performance under different conditions; receives and analyzes the simulation data packet through the automobile system; in response to a first instruction, displays tire pressure, vehicle speed, fuel consumption and driving distance on the vehicle machine interface of the automobile system, intuitively verifies whether the automobile system correctly receives and displays information from the simulation data packet, takes a screenshot of the vehicle machine interface, obtains a target drawing, compares the design drawing and the target drawing using image processing technology, verifies whether the interface display is correct, obtains a test result, quickly and accurately verifies whether the interface display of the automobile system meets the design requirements, reduces the complexity of the test process, improves the test efficiency and reduces the test cost. BRIEF DESCRIPTION OF DRAWINGS
[0047] FIG. 1 is a flowchart of a test method provided by an embodiment of the present application;
[0048] FIG. 2 is another flowchart of a test method provided by an embodiment of the present application;
[0049] FIG. 3 is a flowchart of step S208 in FIG. 2;
[0050] FIG. 4 is another flowchart of a test method provided by an embodiment of the present application;
[0051] FIG. 5 is a schematic diagram of a design drawing provided by an embodiment of the present application;
[0052] FIG. 6 is a schematic diagram of a preset mapping relationship provided by an embodiment of the present application;
[0053] FIG. 7 is a schematic diagram of a target drawing provided by an embodiment of the present application;
[0054] FIG. 8 is a schematic diagram of a key component provided by an embodiment of the present application;
[0055] FIG. 9 is a schematic diagram of the structure of a test device provided by an embodiment of the present application;
[0056] FIG. 10 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.
[0058] It can be understood that the terms "first", "second" and the like used in the present application can be used herein to describe various concepts, but unless specifically 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 the present application, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "when" or "in response to determining".
[0059] The terms "at least one", "multiple", "each", "any" and the like used in the present application include one, two or more than two, multiple includes two or more than two, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as understood by those skilled in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0061] Before the embodiments of the present application are described in detail, first, some nouns and terms involved in the embodiments of the present application are described, and the nouns and terms involved in the embodiments of the present application are applicable to the following explanations.
[0062] 1) Car interface, refers to the interface of the intelligent in-vehicle information system installed in the car interior.
[0063] 2) Intelligent in-vehicle information system (In-Vehicle Infotainment, IVI), refers to the information entertainment and in-vehicle information management system installed in the car interior. The intelligent in-vehicle information system aims to provide various information and services for drivers and passengers, while enhancing driving safety and convenience.
[0064] 3) Cockpit interface, refers to the man-machine interface in the car interior cabin, including all driver and passenger interactive control panels, display screens and interactive devices.
[0065] With the rapid development of the automotive industry, the iteration cycle of vehicle models becomes shorter, and higher requirements are put forward for testing efficiency and quality. The traditional testing method of the automotive industry has the following problems:
[0066] 1. High complexity: The traditional testing method usually requires a large number of hardware devices and manual operations, and the testing process is complex;
[0067] 2. High cost: The traditional automotive system testing method needs to purchase expensive hardware devices and tools, and a large number of human resources are needed for testing and monitoring, which requires high demand for hardware devices and human resources;
[0068] 3. Low efficiency: The traditional testing method usually needs to spend a lot of time and effort to test and analyze data, which is inefficient.
[0069] Therefore, the embodiments of the present application provide a testing method and device, an electronic device and a storage medium. The scheme obtains a design drawing; generates a simulation data packet according to a preset mapping relationship and a functional module in the design drawing, accurately simulates the data packet, and verifies the behavior and performance under different conditions; receives and analyzes the simulation data packet through the automotive system; in response to a first instruction, displays the tire pressure, vehicle speed, fuel consumption and driving distance on the car machine interface of the automotive system, and intuitively verifies whether the automotive system correctly receives and displays the information from the simulation data packet; takes a screenshot of the car machine interface to obtain a target drawing; uses image processing technology to compare the design drawing with the target drawing, verifies whether the interface display is correct, obtains a test result, quickly and accurately verifies whether the interface display of the automotive system meets the design requirements, reduces the complexity of the testing process, improves the testing efficiency, and reduces the testing cost.
[0070] The testing method provided by the embodiments of the present application relates to the technical field of testing. The testing method provided by the embodiments of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, etc., but is not limited thereto; the server end can be configured as an independent physical server, can also be configured as a server cluster or a distributed system composed of multiple physical servers, can also be configured as a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform, and the server can also be a node server in a blockchain network; the software can be an application that implements the testing method, etc., but is not limited to the above forms.
[0071] The application is operable in a variety of general purpose or special purpose computer systems environments or configurations. Examples of well-known computing systems, environments, and / or configurations that can be suitable for use with the application include personal computers, server computers, handheld or laptop devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like, that perform particular tasks or implement particular abstract data types. The application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including memory storage devices.
[0072] FIG. 1 is an optional flowchart of a test method provided by an embodiment of the application. The method in FIG. 1 can include, but is not limited to, steps S101 to S106.
[0073] In step S101, a design diagram is acquired.
[0074] Specifically, the design diagram includes the layout and functional modules of the cockpit interface.
[0075] The application does not make specific limitations on the acquisition method of the design diagram, which can be flexibly selected in combination with actual test needs. For example, the design diagram can be acquired by means of screenshot, acquired from a database, or acquired from a designer.
[0076] In this embodiment, the design diagram is acquired, which prepares for subsequent testing.
[0077] In step S102, a simulation data packet is generated according to a preset mapping relationship and the functional modules in the design diagram.
[0078] Specifically, the simulation data packet includes simulation data such as tire pressure, vehicle speed, fuel consumption, and driving distance.
[0079] In some embodiments, the mapping relationship between the functional modules and the simulation data is preset.
[0080] Optionally, the preset mapping relationship and the functional modules in the design diagram are acquired, and the simulation data packet is generated according to the preset mapping relationship and the functional modules in the design diagram.
[0081] Further, the generated simulation data packet is sent to the automobile system through an Ethernet protocol by using an Ethernet communication module.
[0082] In this embodiment, the simulation data packet is generated according to the preset mapping relationship and the functional module in the design diagram, the data packet is accurately simulated, behaviors and performances in different situations are verified, and preparation is made for subsequent verification of the parsed data packet.
[0083] In step S103, the simulation data packet is received and parsed by the automotive system.
[0084] In some embodiments, the automotive system receives the simulation data packet and parses information therein.
[0085] Further, the tire pressure, vehicle speed, fuel consumption and driving distance are parsed by the automotive system.
[0086] In this embodiment, the simulation data packet is received and parsed by the automotive system, the tire pressure, vehicle speed, fuel consumption and driving distance are obtained, it is determined that the simulation data packet is successfully received by the automotive system and parsed, the data parsing efficiency is improved, and it is beneficial to verify whether the content of the simulation data packet is correct, and preparation is made for subsequent display of the tire pressure, vehicle speed, fuel consumption and driving distance on the car machine interface of the automotive system.
[0087] In step S104, the tire pressure, vehicle speed, fuel consumption and driving distance are displayed on the car machine interface of the automotive system in response to a first instruction.
[0088] Specifically, the first instruction is used to display the car machine interface, and is triggered when the car machine interface is opened or refreshed.
[0089] In some embodiments, the parsed tire pressure, vehicle speed, fuel consumption and driving distance are obtained, and the tire pressure, vehicle speed, fuel consumption and driving distance are displayed on the car machine interface of the automotive system.
[0090] In this embodiment, the tire pressure, vehicle speed, fuel consumption and driving distance are displayed on the car machine interface of the automotive system in response to the first instruction, and it is intuitively verified whether the information from the simulation data packet is correctly received and displayed by the automotive system.
[0091] In step S105, a target image is obtained by taking a screenshot of the car machine interface.
[0092] The way of taking a screenshot of the car machine interface is not specifically limited in this application, and can be flexibly selected according to actual testing needs. For example, the screenshot can be taken by using the built-in screenshot function of the automotive system, or by using a screenshot tool or software.
[0093] In this embodiment, the car machine interface is taken a screenshot to obtain the target image, and preparation is made for subsequent verification of whether the interface display is correct.
[0094] In step S106, the design diagram and the target image are compared using image processing technology to verify whether the interface display is correct, and a test result is obtained.
[0095] In some embodiments, the difference between the design image and the target image is compared using image processing techniques to obtain a difference degree, and it is determined whether the difference degree exceeds a preset threshold to verify whether the interface display is correct, thereby obtaining a 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, the difference degree between the design image and the target image is calculated by comparing the features of the two images, and it is determined whether the difference degree exceeds a preset threshold to verify whether the interface display is correct, thereby obtaining a test result. The first key feature includes pixel value, color, texture, shape, and the second key feature includes pixel value, color, texture, shape.
[0097] In some embodiments, the similarity of the two images is calculated using one of normalized cross-correlation and cosine similarity.
[0098] In some embodiments, the difference degree is quantified using one of structural similarity index (SSIM), mean squared error (MSE), and peak signal-to-noise ratio (PSNR).
[0099] It can be understood that if the difference degree exceeds the preset threshold, the image difference is large, the car machine interface display is incorrect, and the test fails; otherwise, it is considered that the image difference is within an acceptable range, the car machine interface display is correct, and the test is successful.
[0100] In this embodiment, the design image and the target image are compared using image processing techniques to verify whether the interface display is correct, thereby obtaining a test result, quickly and accurately verifying whether the car machine interface display of the automotive system meets the design requirements, reducing the complexity of the test process, improving the test efficiency, and reducing the test cost.
[0101] The steps S101 to S106 shown in the embodiments of the present application obtain a design image; generate a simulation data packet according to a preset mapping relationship and a functional module in the design image, accurately simulate the data packet, and thereby verify the behavior and performance under different conditions; receive and parse the simulation data packet by the automotive system; in response to a first instruction, display tire pressure, vehicle speed, fuel consumption, and driving distance on the car machine interface of the automotive system, and intuitively verify whether the automotive system correctly receives and displays information from the simulation data packet; take a screenshot of the car machine interface to obtain a target image; compare the design image and the target image using image processing techniques to verify whether the interface display is correct, thereby obtaining a test result, quickly and accurately verifying whether the interface display of the automotive system meets the design requirements, reducing the complexity of the test process, improving the test efficiency, and reducing the test cost.
[0102] FIG. 2 is an optional flowchart of a test method according to an embodiment of the present application. The method in FIG. 1 can include, but is not limited to, steps S201 to S210.
[0103] In step S201, the function modules in the design diagram are mapped to the data packets in the Ethernet communication by means of a dictionary, and a preset mapping relationship is determined.
[0104] Specifically, the preset mapping relationship includes a mapping dictionary.
[0105] In step S201 of some embodiments, the function modules in the design diagram are mapped to the data packets in the Ethernet communication by means of a dictionary, and a mapping dictionary is established as the preset mapping relationship.
[0106] In this embodiment, the function modules in the design diagram are mapped to the data packets in the Ethernet communication by means of a dictionary, and the preset mapping relationship is determined, so that an accurate and clear mapping relationship is established, and preparation is made for subsequent generation of simulation data packets according to the function modules in the design diagram and the preset mapping relationship.
[0107] In step S202, the design diagram is obtained.
[0108] In step S203, simulation data packets are generated according to the function modules in the design diagram and the preset mapping relationship.
[0109] In step S203 of some embodiments, the mapping dictionary is obtained, the function modules in the design diagram are queried in the mapping dictionary, the data to be simulated is obtained, and the simulation data packets are generated according to the data to be simulated.
[0110] In this embodiment, the simulation data packets are generated according to the function modules in the design diagram and the preset mapping relationship, and accurate data simulation is performed, which is beneficial to subsequent testing and verification.
[0111] In step S204, the simulation data packets are sent by using the Ethernet communication module.
[0112] In step S204 of some embodiments, the generated simulation data packets are sent to the automotive system through the Ethernet protocol by using the Ethernet communication module.
[0113] In this embodiment, the simulation data packets are sent by using the Ethernet communication module, the real network communication environment is simulated, the receiving and processing capabilities of the automotive system for different types of data packets are verified, and preparation is made for subsequent reception and analysis of the simulation data packets by the automotive system.
[0114] In step S205, the simulation data packets are received and analyzed by the automotive system.
[0115] In step S206, in response to the first instruction, the tire pressure, vehicle speed, fuel consumption and driving distance are displayed on the car machine interface of the automotive system.
[0116] In step S207, a screenshot of the car machine interface is taken to obtain a target diagram.
[0117] Step S208, comparing the design graph with the target graph using image processing technology to verify whether the interface display is correct and obtaining a test result.
[0118] Step S209, recording the test result.
[0119] In step S209 of some embodiments, the application does not make specific limitations on the way of recording the test result, which can be flexibly selected according to the actual test needs. For example, the test result can be stored through a database or a server.
[0120] In this embodiment, recording the test result is beneficial to preserving the original test record, in-depth analysis of the failed test, finding out the root cause, and timely repairing and optimizing the test process.
[0121] Step S210, in response to a second instruction, displaying the target graph, the design graph and the test result on a test result page of the automotive system.
[0122] Specifically, the second instruction is used to automatically display the test result page of the automotive system after obtaining the test result, which is triggered when the test result page of the automotive system is automatically opened or refreshed after obtaining the test result.
[0123] In this embodiment, in response to the second instruction, the target graph, the design graph and the test result are displayed on the test result page of the automotive system, which is beneficial to intuitively display the test result and help the user determine the cause of the test failure and make repairs and optimization.
[0124] Referring to FIG. 3, in some embodiments, step S208 can include but is not limited to steps S301 to S309:
[0125] Step S301, extracting a first key feature from the design graph and a second key feature from the target graph.
[0126] In step S301 of some embodiments, the design graph and the target graph are preprocessed, and the image processing algorithm is used to detect the features of the design graph and the target graph, and the first key feature and the second key feature are extracted from the detected features.
[0127] In some embodiments, the design graph and the target graph preprocessing includes but is not limited to the following steps:
[0128] Grayscale: converting the design graph and the target graph from color to grayscale, reducing the data amount and eliminating the interference of color information on feature extraction;
[0129] Contrast enhancement: enhancing the contrast of the design image and the target image by at least one of histogram equalization and gamma correction, so that the features are more prominent;
[0130] Noise removal: removing the noise of the design image and the target image using a filter.
[0131] In some embodiments, performing feature detection includes but is not limited to:
[0132] Using an edge detection algorithm to detect edges in the design image and the target image.
[0133] Using a corner detection algorithm to identify the first corner point in the design image and the second corner point in the target image.
[0134] Using a feature point detection algorithm (such as SIFT, SURF, ORB, etc.) to extract the first key feature point in the design image and the second key feature point in the target image.
[0135] Optionally, using a feature matching algorithm to match the second feature of the target image with the features in the database to find the best match. According to the matching result and the preset threshold, the most representative feature point is selected as the first key feature.
[0136] Optionally, using a feature matching algorithm to match the features of the design image with the features in the database to find the best match. According to the matching result and the preset threshold, the most representative feature point is selected as the second key feature.
[0137] In this embodiment, the first key feature is extracted from the design image and the second key feature is extracted from the target image, which accurately represents the content of the design image and the target image through the first key feature and the second key feature, and helps to evaluate the difference degree subsequently.
[0138] Step S302, comparing the first key feature and the second key feature to obtain the difference degree.
[0139] In step S302 of some embodiments, the key features of the design image and the target image are matched by a pre-defined rule.
[0140] Optionally, the second key feature of the target image and the first key feature of the design image are matched by a trained machine learning model.
[0141] In some embodiments, the design image and the target image are divided into multiple regions, and the difference between the first key feature and the second key feature of the corresponding regions in the design image and the target image is compared. Optionally, the difference between the two feature vectors of the first key feature and the second key feature is quantified by one of the Euclidean distance and the 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, and the difference between the design drawing and the target drawing is obtained quickly and accurately, which prepares for obtaining the test results later.
[0143] Step S303: Obtain a preset threshold.
[0144] Specifically, the preset threshold is a preset difference threshold.
[0145] The present application does not impose any specific restrictions on the method for determining the preset threshold, and it can be flexibly selected in combination with actual test needs. For example, the preset threshold can be determined by the user or by a model based on historical test results.
[0146] In this embodiment, the preset threshold is obtained, which reduces the complexity of the testing process and prepares for the 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, and whether the interface display of the automobile system meets the design requirements is quickly and accurately verified, thereby reducing the complexity of the testing process, improving testing efficiency, and reducing testing costs.
[0150] Step S305: Determine whether the interface display is incorrect.
[0151] Specifically, the test results include test failures.
[0152] Optionally, the test result also includes incorrect interface display.
[0153] In this embodiment, it is determined that the interface display is incorrect and the test has failed, which prepares for the subsequent analysis of the cause of the test failure. The complexity of the test process is reduced through the automated process, the test efficiency is improved, and the test cost is reduced.
[0154] Step S306: Acquire the target model.
[0155] Specifically, the target model is a trained model used to analyze the causes of test failures.
[0156] This application does not make any specific restrictions on the target model, and it can be flexibly selected based on actual test needs. For example, the target model can use a convolutional neural network or a VGG trained on a large-scale image dataset.
[0157] Step S307, analyzing the design graph and the target graph through the target model to obtain the test failure cause.
[0158] In step S307 of some embodiments, the test failure cause is obtained by analyzing the design graph and the target graph through the target model, and it is determined by the user whether the test failure cause is correct. If correct, the design graph and the target graph and the test failure cause are used to optimize the target model.
[0159] Step S308, in response to a third instruction, displaying the target graph, the design graph, the test result, the difference degree and the test failure cause on the test result page of the automotive system.
[0160] Specifically, the third instruction is used to display the test result page of the automotive system when the test fails, and is triggered when the test result page of the automotive system is opened or refreshed after the test failure cause is obtained.
[0161] Step S309, determining that the interface is displayed correctly.
[0162] Specifically, the test result includes test success.
[0163] Optionally, the test result also includes that the interface is displayed correctly.
[0164] In step S309 of some embodiments, it is determined that the interface is displayed correctly, and it is determined that the test is successful. The complexity of the test process is reduced by an automated process, the test efficiency is improved, and the test cost is reduced.
[0165] FIG. 4 is an optional flowchart of a test method provided by an embodiment of the present application. In some embodiments, the design graph is a cockpit interface design graph designed by an HMI professional. The method in FIG. 4 can include, but is not limited to, steps S401 to S416.
[0166] Step S401, mapping the function modules in the design graph and the data packets in the Ethernet communication through a dictionary to determine a preset mapping relationship.
[0167] In step S401 of some embodiments, the function modules in the design graph are mapped to the data packets in the Ethernet communication (a dictionary is created by mapping each signal to a value as a key through a dictionary), ensuring complete coverage of the test.
[0168] Step S402, obtaining the design graph.
[0169] Exemplarily, the design graph schematic diagram is shown in FIG. 5, wherein the design graph schematic diagram includes a tire pressure, vehicle speed, fuel consumption and driving distance chart.
[0170] Step S403, generating a simulation data packet according to the preset mapping relationship and the function modules in the design graph.
[0171] Exemplarily, the preset mapping relationship diagram is shown in FIG. 6. The tire pressure information prompt includes display or alarm work instructions, and the tire pressure information prompt includes HMIVw_NotifyOnChgFLTireSt, HMIVw_NotifyOnChgFRTireSt, HMIVw_NotifyOnchgRLTireSt, HMIVw_NotifyOnChgRRTireSt and HMIVw_NotifyonchgTireWarningSt. Specifically, HMIVw_NotifyOnChgFLTireSt represents "left front tire pressure change". When the air pressure of the left front tire changes, the system updates this state and may trigger a warning; HMIVw_NotifyOnChgFRTireSt represents "right front tire pressure change". When the air pressure of the right front tire changes, the system updates this state and may trigger a warning. HMIVw_NotifyOnchgRLTireSt represents "left rear tire pressure change". When the air pressure of the left rear tire changes, the system updates this state and may trigger a warning. HMIVw_NotifyOnChgRRTireSt represents "right rear tire pressure change". When the air pressure of the right rear tire changes, the system updates this state and may trigger a warning. HMIVw_NotifyonchgTireWarningSt represents "tire warning state notification". When the air pressure of any tire exceeds the preset safety range, the system updates HMIVw_NotifyonchgTireWarningSt.
[0172] In step S404 of some embodiments, the simulation data packet is sent using the Ethernet communication module to simulate changes in vehicle status, and the simulation data packet includes tire pressure, vehicle speed, fuel consumption, driving distance, etc.
[0173] In step S404 of some embodiments, the simulation data packet is sent using the Ethernet communication module to simulate changes in vehicle status, and the simulation data packet includes tire pressure, vehicle speed, fuel consumption, driving distance, etc.
[0174] In step S405 of some embodiments, the automobile system starts the automobile HMI interface and sets the program to monitor the Ethernet receiving state of the automobile system.
[0175] In step S405 of some embodiments, the automobile system starts the automobile HMI interface and sets the program to monitor the Ethernet receiving state of the automobile system.
[0176] The automobile system subscribes through a service signal, and after subscription, the underlying system transmits signals to the instrument application. After the instrument application receives the signals, it displays the corresponding functions.
[0177] It can be understood that the Ethernet signal is successfully received, and the function can be implemented, if not, the function is not displayed, at this time, the problem in implementation can be judged, and the instrument application judges the fault reason.
[0178] In step S406, in response to the first instruction, the tire pressure, vehicle speed, fuel consumption and driving distance are displayed on the car machine interface of the automobile system.
[0179] In step S407, the car machine interface is screenshot to obtain a target image.
[0180] In step S407 of some embodiments, the car machine interface is screenshot to capture the currently displayed content. Among them, each signal has a corresponding function, and also has a corresponding slice, and the application displays the slice to the screen end. Illustratively, the target image schematic diagram is shown in FIG. 7, wherein the target image schematic diagram includes tire pressure, vehicle speed, fuel consumption, and driving distance chart.
[0181] Illustratively, the code of the embodiment is as follows:
[0182] In step S408, the first key feature is extracted from the design image and the second key feature is extracted from the target image, and the difference degree is obtained by comparing the first key feature with the second key feature.
[0183] In step S408 of some embodiments, the first key feature and the second key feature are extracted from the image, such as pixel value, color, texture, shape, etc.
[0184] Specifically, image difference analysis can be performed in the following way to obtain the difference degree:
[0185] Pixel-by-pixel difference: Calculate the difference value of each pixel in adjacent frames. The difference between pixel values (such as absolute value difference or squared difference) can be used to represent the degree of difference between frames. Larger difference values may indicate the presence of errors or abnormal conditions.
[0186] Block matching: Divide the image into multiple blocks and compare 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, cross-correlation, etc. Inconsistent or abnormal block matching results may indicate the presence of slice errors.
[0187] Correlation comparison: Evaluate the similarity between adjacent frames by calculating their correlation. Correlation measures can be achieved by calculating the correlation coefficient or similarity index (such as structural similarity index) between the pixels of the two frames. Low correlation or similarity index may indicate the presence of slice errors or discontinuity in image content.
[0188] Optionally, key components in the target image and the design image are determined, such as buttons, text boxes, icons, etc. The positions, sizes, shapes, styles, and relative relationships of the key components in the images are compared to obtain the difference degree. Exemplarily, a schematic diagram of key components in the target image is shown in FIG. 8.
[0189] Further, by comparing the features of the design image and the target image, the similarity or difference degree between them is calculated.
[0190] In step S409, a preset threshold is obtained, and it is determined whether the difference degree exceeds the preset threshold.
[0191] In step S410, it is determined that the interface is displayed incorrectly.
[0192] In step S410 of some embodiments, it is determined that the interface is displayed incorrectly, and the test result is a test failure.
[0193] In step S411, a target model is obtained, and the design image and the target image are analyzed by the target model to obtain the test failure reason.
[0194] In step S412, the test result is recorded.
[0195] In step S412 of some embodiments, the result of each test is recorded, including passing and failing cases, and specific reasons for failure.
[0196] Further, the failed test is analyzed in depth to find the root cause, and the test process is repaired and optimized in time.
[0197] Optionally, according to the test result and feedback, the test process and method are continuously optimized to improve the test efficiency and quality. The design image and signal mapping are continuously updated to adapt to the changes and development of the automotive HMI interface.
[0198] In step S413, in response to a third instruction, the target image, the design image, the test result, the difference degree, and the test failure reason are displayed on a test result page of the automotive system.
[0199] In step S414, it is determined 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 a test success.
[0201] In step S415, the test result is recorded.
[0202] In step S416, in response to a second instruction, the target image, the design image, the test result, and the difference degree are displayed on a test result page of the automotive system.
[0203] Referring to FIG. 9, the embodiment of the present application further provides a testing device, which can realize the testing method, and the device comprises:
[0204] The design drawing acquisition module 901 is configured to acquire a design drawing.
[0205] The data simulation module 902 is configured to generate a simulation data packet according to a preset mapping relationship and a functional module in the design drawing, wherein the simulation data packet comprises tire pressure, vehicle speed, fuel consumption and driving distance.
[0206] The receiving module 903 is configured to receive and analyze the simulation data packet through an automobile system.
[0207] The display module 904 is configured to display the tire pressure, the vehicle speed, the fuel consumption and the driving distance on a vehicle-machine interface of the automobile system in response to a first instruction.
[0208] The target drawing acquisition module 905 is configured to take a screenshot of the vehicle-machine interface to obtain a target drawing.
[0209] The testing module 906 is configured to compare the target drawing with the design drawing by using an image processing technology, verify whether the interface display is correct, and obtain a testing result.
[0210] It can be understood that the content in the above method embodiments is applicable to the device embodiments, the device embodiments specifically realize the functions of the above method embodiments, and achieve the same beneficial effects as the above method embodiments.
[0211] The embodiment of the present application further provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor realizes the testing method when executing the computer program. The electronic device can be any intelligent terminal, such as a tablet computer or a vehicle-mounted computer.
[0212] It can be understood that the content in the above method embodiments is applicable to the device embodiments, the device embodiments specifically realize the functions of the above method embodiments, and achieve the same beneficial effects as the above method embodiments.
[0213] Referring to FIG. 9, FIG. 9 shows the hardware structure of the electronic device according to another embodiment, which comprises:
[0214] The processor 901 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, and is configured to execute related programs to implement the technical solutions provided by the embodiments of the present application.
[0215] The memory 902 can be implemented by a ROM (ReadOnly Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory), and the like. The memory 902 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are stored in the memory 902 and are called and executed by the processor 901 to implement the test method of the embodiments of the present application.
[0216] The input / output interface 903 is configured to implement information input and output.
[0217] The communication interface 904 is configured to implement the communication interaction between the device and other devices, and can realize the communication through a wired manner (for example, a USB, a network cable, or the like) or a wireless manner (for example, a mobile network, WIFI, Bluetooth, or the like).
[0218] The bus 905 is configured to transmit information between various components (for example, the processor 901, the memory 902, the input / output interface 903, and the communication interface 904) of the device.
[0219] The processor 901, the memory 902, the input / output interface 903, and the communication interface 904 are connected to each other through the bus 905 to realize the communication connection between the device.
[0220] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the test method.
[0221] It can be understood that the contents in the above method embodiments are all applicable to the storage medium embodiments, the storage medium embodiments specifically implement the functions of the above method embodiments, and the same beneficial effects as the above method embodiments are achieved.
[0222] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory disposed remotely with respect to the processor, and these remote memories can be connected to the processor through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0223] The test method, test device, electronic equipment and storage medium provided by the embodiments of the present application can obtain a design drawing; generate a simulation data packet according to a preset mapping relationship and a functional module in the design drawing, accurately simulate the data packet, and verify behaviors and performances in different situations; receive and analyze the simulation data packet through a car system; in response to a first instruction, display tire pressure, vehicle speed, fuel consumption and driving distance on a car-machine interface of the car system, intuitively verify whether the car system correctly receives and displays information from the simulation data packet; take a screenshot of the car-machine interface to obtain a target drawing; compare the design drawing and the target drawing using image processing technology, verify whether the interface display is correct, obtain a test result, quickly and accurately verify whether the interface display of the car system meets the design requirements, reduce the complexity of the test process, improve the test efficiency, and reduce the test cost.
[0224] The embodiments described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0225] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps than the figures shown, or combine certain steps, or different steps.
[0226] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, that is, can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0227] Those skilled in the art can understand that all or some steps in the above disclosed method, the function modules / units in the system and the device can be implemented as software, firmware, hardware and appropriate combinations thereof.
[0228] The terms "first", "second", "third", "fourth", and the like in the description and in the claims of this application, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of orderly or chronological mundane operation, reverse order operation, based on circuitry availability, based on stated preference or the like, and that "default" or other orderings are thus permissible. Further, the terms "comprise", "comprising", "include", "including", and the like, are specifically intended to be open-ended. That is, references to individual steps and the like do not suhstantially exclude the presence of two or more of a given step or its integral presence in the process, method, system, article, or apparatus having been made with a wider scope. The use of notation such as "first", "second", "third", etc. does not generally limit the areas, but is used to connect between similar objects.
[0229] It should be understood that, in the application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the relationship between associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are only A, only B, and A and B at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or the like means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can mean 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 several embodiments provided in the application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the above-mentioned units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed objects can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0231] The units described above as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the application.
[0232] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.
[0233] If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in part, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes multiple instructions used to cause 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 methods in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various other media that can store programs.
[0234] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, and are not intended to limit the scope of the embodiments of the present application. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the embodiments of the present application.
Claims
1. A testing method, characterized in that: The method comprises: Get the design drawings; Generate a simulation data package according to a preset mapping relationship and the functional modules in the design diagram, the simulation data package including tire pressure, vehicle speed, fuel consumption and travel distance; receiving and parsing the simulated data packet through the vehicle system; In response to a first instruction, displaying the tire pressure, the vehicle speed, the fuel consumption, and the travel distance on a vehicle computer interface of a vehicle system; Taking a screenshot of the vehicle computer interface to obtain a 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 a test result.
2. The method according to claim 1, characterized in that The method further comprises: Using an Ethernet communication module to send the simulated data packet; The test results are recorded.
3. The method according to claim 1, characterized in that The method further comprises: Map the functional modules in the design diagram with the data packets in the Ethernet communication to determine the preset mapping relationship.
4. The method according to claim 3, characterized in that The preset mapping relationship includes a mapping dictionary, and mapping the functional modules in the design diagram with the data packets in the Ethernet communication to determine the preset mapping relationship includes: The functional modules in the design diagram are mapped with the data packets in the Ethernet communication in a dictionary manner to obtain the mapping dictionary.
5. The method according to claim 1, wherein The method further comprises: In response to a second instruction, the target diagram, the design diagram, and the test result are displayed on a test result page of the automobile system.
6. The method according to claim 1, characterized in that The use of image processing technology to compare the target image with the design image to verify whether the vehicle interface display is correct, thereby obtaining a test result, includes: extracting a first key feature from the design drawing and a second key feature from the target drawing; comparing the first key feature with the second key feature to obtain a difference; Get the preset threshold; When the difference exceeds the preset threshold, it is determined that the interface display is incorrect and a test result of test failure is obtained.
7. The method according to claim 6, characterized in that The method further comprises: When the difference does not exceed the preset threshold, it is determined that the interface display is correct and a test result indicating a successful test is obtained.
8. The method according to claim 6, characterized in that The method further comprises: When the difference exceeds the preset threshold, obtaining the target model; The target diagram and the design diagram are analyzed through the target model to obtain the reason for the test failure.
9. The method according to claim 8, characterized in that The method further comprises: In response to a third instruction, the target diagram, the design diagram, the test result, the degree of difference, and the test failure reason are displayed on a test result page of the automobile system.
10. A testing device, characterized in that: The device comprises: A design drawing acquisition module, used to acquire a design drawing; A data simulation module, configured to generate a simulation data package according to a preset mapping relationship and the functional modules in the design diagram, wherein the simulation data package includes tire pressure, vehicle speed, fuel consumption, and travel distance; A receiving module, configured to receive and parse the simulated data packet through a vehicle system; a display module, configured to display the tire pressure, the vehicle speed, the fuel consumption, and the travel distance on a vehicle-machine interface of a vehicle system in response to a first instruction; A target image acquisition module is used to take a screenshot of the vehicle interface to obtain a target image; The test 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, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 9.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Automatic testing method for automobile instrument signals
CN111141529A
Automatic lane change data reinjection method and device, equipment and storage medium
CN115687500A
Automatic driving reliability test method, device, equipment, medium and program product
CN116302364A
Data test method, electronic device and storage medium
US20210383162A1
Tire Pressure Monitoring System Learning Method, Device, Sensor, System and Medium
US20230150317A1