A cockpit screen real-time test method and device, electronic equipment and storage medium

By establishing a channel between the test host and the screen under test, control commands are sent and video streams are received in real time, and video frames are detected frame by frame. This solves the problems of high latency and high missed detection rate in the automated testing of cockpit screens, and achieves efficient screen testing.

CN122193771APending Publication Date: 2026-06-12AUTOLINK INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
AUTOLINK INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-04-07
Publication Date
2026-06-12

Smart Images

  • Figure CN122193771A_ABST
    Figure CN122193771A_ABST
Patent Text Reader

Abstract

The application provides a cockpit screen real-time test method and device, electronic equipment and a storage medium. The method comprises the following steps: when a connection is established between a test host and a to-be-tested screen, starting a target screen mirroring service component to establish a first channel and a second channel; based on the test host, a target control instruction is sent to the to-be-tested screen in real time through the first channel, so that the to-be-tested screen executes the target control instruction; the test host collects a video stream of the to-be-tested screen in real time and sends it out; based on a test tool, a video frame of the to-be-tested screen intercepted at a preset target frame period is acquired through the second channel, and a continuous image sequence of the to-be-tested screen is obtained; based on the test tool, frame-by-frame detection is performed on the continuous image sequence within a preset target detection time length, and whether the test passes or not is judged based on a detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automotive electronic testing technology, and more specifically, to a method, apparatus, electronic device, and storage medium for real-time testing of cockpit screens. Background Technology

[0002] Automated testing of cockpit screens is a core component in ensuring the functionality, performance, safety, and user experience of smart cockpits. It arose from the fact that traditional testing methods could no longer handle the complexity, rapid iteration, and high reliability requirements of systems driven by the wave of automotive intelligence, thus giving rise to a modern testing technology system characterized by automation, intelligence, and integration.

[0003] Currently, existing automated cockpit screen testing typically uses ADB commands. Specifically, it involves interacting with the cockpit screen and taking screenshots using various ADB commands, then retrieving and recognizing the images from the cockpit screen to achieve automated testing of the cockpit screen.

[0004] However, existing ADB testing solutions take a long time to capture cockpit screen screenshots, have high latency, and are difficult to capture short-lived images or screen UI changes with uncertain response times, resulting in a high false negative rate. Summary of the Invention

[0005] In view of this, the purpose of this application is to provide a cockpit screen real-time testing method, device, electronic device and storage medium. By establishing a connection between the test host and the screen under test and establishing a first channel and a second channel to send control commands and receive the video stream of the screen under test in real time, and capturing the video frames of the screen under test for frame-by-frame detection, the image acquisition latency of the screen under test is reduced, solving the problem of high latency in traditional solutions. Moreover, for short-lived images or screen UI feature changes with uncertain response times, it can ensure that the screen image is captured, reducing the missed detection rate.

[0006] In a first aspect, embodiments of this application provide a method for real-time testing of cockpit screens, the method comprising: Once a connection is established between the test host and the screen under test, the target screen mirroring service component is started to establish a first channel and a second channel; wherein, the first channel is used to send control commands to the screen under test, and the second channel is used to receive the video stream of the screen under test in real time; The test host sends target control commands to the screen under test in real time through the first channel, so that the screen under test executes the target control commands. The test host also collects and transmits the video stream of the screen under test in real time. Based on the video frames of the screen under test captured by the test tool through the second channel at a preset target frame period, a continuous image sequence of the screen under test is obtained. The testing tool performs frame-by-frame detection on the continuous image sequence within a preset target detection time, and determines whether the test passes based on the detection results.

[0007] In one possible implementation, the test host and the test tool are connected via a dual-ended USB cable, with one end of the dual-ended USB cable inserted into the USB port of the test host and the other end connected to the USB port of the test tool; the first channel and the second channel communicate via a target port; establishing a connection between the test host and the screen under test includes: In response to the input of a target ADB command in the command window of the test host, the vehicle serial number is obtained through the target ADB command; If the vehicle serial number is successfully obtained, it is determined that the test host and the test tool are successfully connected.

[0008] In one possible implementation, the detection of the continuous image sequence frame by frame includes: Determine the expected UI features corresponding to each frame of continuous image sequence and the template image corresponding to the expected UI features, and perform scale normalization processing on the continuous image sequence and the template image for each frame of continuous image sequence; A preset similarity measurement model is used to calculate the similarity between the continuous image sequence and the template image, and the test is judged based on the similarity.

[0009] In one possible implementation, determining whether the test passes based on the similarity includes: If the similarity between the continuous image sequence and the template image reaches a preset matching threshold, then it is determined that the continuous image sequence has identified the corresponding expected UI feature; If, within the target detection time, any consecutive image sequence contains the corresponding expected UI feature, the test is considered passed.

[0010] In one possible implementation, before initiating the target screen mirroring service component to establish the first and second channels, the method further includes: The screen mirroring service deployment file corresponding to the target screen mirroring service component is pushed to the test host and started; wherein, the screen mirroring service deployment file is the specific physical carrier and deployment package of the screen mirroring service component; Set the screen display identifier and the display width of the screen under test; wherein the display width of the screen under test is not less than the maximum value of the actual screen size of the screen under test.

[0011] In one possible implementation, establishing the first channel and the second channel includes: Establish a first and second abstract namespace locally; A first channel is established based on the first abstract namespace, and a second channel is established based on the second abstract namespace.

[0012] In one possible implementation, determining whether the test passes based on the similarity includes: If no consecutive image sequence within the target detection time period identifies the corresponding expected UI feature, the test is deemed to have failed.

[0013] Secondly, embodiments of this application also provide a cockpit screen real-time testing device, the device comprising: The module is used to establish a first channel and a second channel when a connection is established between the test host and the screen under test; wherein, the first channel is used to send control commands to the screen under test, and the second channel is used to receive the video stream of the screen under test in real time. The sending module is used to send target control commands to the screen under test in real time through the first channel based on the test host, so that the screen under test executes the target control commands, and the test host collects the video stream of the screen under test in real time and sends it out. The acquisition module is used to acquire video frames of the screen under test captured at a preset target frame period through the second channel based on the test tool, so as to obtain a continuous image sequence of the screen under test. The detection module is used to perform frame-by-frame detection on the continuous image sequence based on the testing tool within a preset target detection time, and to determine whether the test is passed based on the detection results.

[0014] In one possible implementation, the test host and the test tool are connected via a dual-ended USB cable, one end of which is inserted into the USB port of the test host, and the other end of which is connected to the USB port of the test tool; the first channel and the second channel communicate via a target port; the construction module is specifically used for: In response to the input of a target ADB command in the command window of the test host, the vehicle serial number is obtained through the target ADB command; If the vehicle serial number is successfully obtained, it is determined that the test host and the test tool are successfully connected.

[0015] In one possible implementation, the detection module is specifically used for: Determine the expected UI features corresponding to each frame of continuous image sequence and the template image corresponding to the expected UI features, and perform scale normalization processing on the continuous image sequence and the template image for each frame of continuous image sequence; A preset similarity measurement model is used to calculate the similarity between the continuous image sequence and the template image, and the test is judged based on the similarity.

[0016] In one possible implementation, the detection module is specifically used for: If the similarity between the continuous image sequence and the template image reaches a preset matching threshold, then it is determined that the continuous image sequence has identified the corresponding expected UI feature; If, within the target detection time, any consecutive image sequence contains the corresponding expected UI feature, the test is considered passed.

[0017] In one possible implementation, the device further includes: The push module is used to push the screen mirroring service deployment file corresponding to the target screen mirroring service component to the test host and start it before starting the target screen mirroring service component to establish the first channel and the second channel; wherein, the screen mirroring service deployment file is the specific physical carrier and deployment package of the screen mirroring service component; The setting module is used to set the screen display identifier for the screen under test and the display width of the screen under test; wherein the display width of the screen under test is not less than the maximum value of the actual screen size of the screen under test.

[0018] In one possible implementation, the building module is specifically used for: Establish a first and second abstract namespace locally; A first channel is established based on the first abstract namespace, and a second channel is established based on the second abstract namespace.

[0019] In one possible implementation, the detection module is specifically used for: If no consecutive image sequence within the target detection time period identifies the corresponding expected UI feature, the test is deemed to have failed.

[0020] Thirdly, embodiments of this application provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the cockpit screen real-time testing method as described in any of the first aspects.

[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the cockpit screen real-time testing method described in any one of the first aspects.

[0022] This application provides a cockpit screen real-time testing method, apparatus, electronic device, and storage medium. When a connection is established between the test host and the screen under test, a target screen mirroring service component is activated to establish a first channel and a second channel. The test host sends target control commands to the screen under test in real time through the first channel, causing the screen under test to execute the target control commands. The test host acquires and transmits the video stream of the screen under test in real time. A testing tool acquires video frames of the screen under test captured at a preset target frame period through the second channel, obtaining a continuous image sequence of the screen under test. The testing tool performs frame-by-frame detection on the continuous image sequence within a preset target detection time, and determines whether the test passes based on the detection results. This application, by establishing a connection between the test host and the screen under test and establishing a first and second channel to send control commands and receive the video stream of the screen under test in real time, and by capturing and detecting the video frames of the screen under test frame by frame, reduces the image acquisition latency of the screen under test, solving the high latency problem of traditional solutions. Furthermore, it ensures the capture of screen images for short-lived scenes or screen UI feature changes with uncertain response times, reducing the false negative rate.

[0023] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0024] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a flowchart of a real-time cockpit screen testing method provided according to an embodiment of this application; Figure 2 This is a schematic diagram of the real-time testing steps for the cockpit screen; Figure 3 This is a schematic diagram of the first and second channels; Figure 4 This is a schematic diagram of the cockpit screen real-time testing device provided according to an embodiment of this application; Figure 5This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0027] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0028] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0029] Considering that automated testing of cockpit screens is a core component in ensuring the functionality, performance, safety, and user experience of smart cockpits, it stems from the fact that traditional testing methods can no longer cope with the complexity, rapid iteration, and high reliability requirements of systems driven by the wave of automotive intelligence. This has given rise to a modern testing technology system characterized by automation, intelligence, and integration.

[0030] Currently, existing automated cockpit screen testing typically uses ADB commands. Specifically, it involves interacting with the cockpit screen and taking screenshots using various ADB commands, then retrieving and recognizing the images from the cockpit screen to achieve automated testing of the cockpit screen.

[0031] However, existing ADB testing solutions take a long time to capture cockpit screen screenshots, have high latency, and are difficult to capture short-lived images or screen UI changes with uncertain response times, resulting in a high false negative rate.

[0032] To address this issue, this application provides a cockpit screen real-time testing method, apparatus, electronic device, and storage medium. By establishing a connection between the test host and the screen under test and establishing a first channel and a second channel to send control commands and receive the video stream of the screen under test in real time, and by capturing video frames of the screen under test for frame-by-frame detection, the image acquisition latency of the screen under test is reduced, solving the problem of high latency in traditional solutions. Furthermore, for short-lived images or screen UI feature changes with uncertain response times, it can ensure that the screen image is captured, reducing the missed detection rate.

[0033] Figure 1 This is a flowchart of a real-time cockpit screen testing method provided according to an embodiment of this application. Figure 1 As shown, the real-time cockpit screen testing method of this application embodiment may specifically include: S101. When a connection is established between the test host and the screen under test, the target screen mirroring service component is started to establish the first channel and the second channel.

[0034] S102. The test host sends target control commands to the screen under test in real time through the first channel, so that the screen under test executes the target control commands. The test host also collects the video stream of the screen under test in real time and sends it out.

[0035] S103. Based on the test tool, the video frames of the screen under test are captured by the second channel at a preset target frame period to obtain a continuous image sequence of the screen under test.

[0036] S104. The testing tool performs frame-by-frame detection on the continuous image sequence within the preset target detection time, and determines whether the test passes based on the detection results.

[0037] In the above-mentioned real-time cockpit screen testing method, a connection is established between the test host and the screen under test, and a first channel and a second channel are established to send control commands and receive the video stream of the screen under test in real time. The video frames of the screen under test are captured and tested frame by frame. This reduces the image acquisition latency of the screen under test, solves the problem of high latency in traditional solutions, and ensures that the screen image is captured for short-lived images or screen UI feature changes with uncertain response times, thus reducing the missed detection rate.

[0038] The exemplary steps described above in the embodiments of this application are illustrated below with specific examples: S101, when a connection is established between the test host and the screen under test, the target screen mirroring service component is started to establish the first channel and the second channel.

[0039] In this embodiment, the first channel is used to send control commands to the screen under test, and the second channel is used to receive the video stream from the screen under test in real time. The target screen mirroring service component can be the scrcpy-server component. A connection is established between the test host and the screen under test, the target screen mirroring service component is started, and the first and second channels, i.e., the first Socket channel and the second Socket channel, are established for subsequent processing. For example, as... Figure 2 and Figure 3 As shown.

[0040] It should be noted that before starting the target screen mirroring service component to establish the first and second channels, the screen mirroring service deployment file corresponding to the target screen mirroring service component should be pushed to the test host and started; the screen display identifier and display width of the screen under test should be set. The screen mirroring service deployment file is the specific physical carrier and deployment package of the screen mirroring service component; the display width of the screen under test should not be less than the maximum value of the actual screen size of the screen under test.

[0041] Specifically, for example, the screen mirroring service deployment file scrcpy.jar is pushed to the test host via amb push. During startup, the display_id of the screen under test is set to control interaction with the corresponding screen, and the screen's display width is set; max_width cannot be lower than the maximum value of the actual screen size to ensure that the original screen frame size is obtained. For example, as... Figure 2 As shown.

[0042] It should be noted that the test host and the test tool are connected via a dual-ended USB cable. One end of the dual-ended USB cable is inserted into the USB port of the test host, and the other end is connected to the USB port of the test tool. The first channel and the second channel communicate via the target port. For example, the two socket channels communicate via the local 127.0.0.1:n port.

[0043] Optionally, in response to entering the target ADB command in the command window of the test host, the vehicle serial number is obtained through the target ADB command; in response to successfully obtaining the vehicle serial number, it is determined that the test host and the test tool are successfully connected.

[0044] Specifically, in the command prompt window of the host computer (i.e., the test tool), the serial number of the vehicle's infotainment system is obtained using the ADB command "adb devices". Once successfully obtained, it indicates that the test tool and the test host have successfully connected. Additionally, the screen identifiers of each screen can be obtained using the target ADB command; that is, the IDs of each screen can also be obtained based on ADB commands, allowing for subsequent screen switching and control command responses via screen IDs.

[0045] Optionally, when establishing the first channel and the second channel, a first abstract namespace and a second abstract namespace are established locally; the first channel is established based on the first abstract namespace, and the second channel is established based on the second abstract namespace.

[0046] Specifically, two abstract namespace socket connections are established locally, namely the first socket channel and the second socket channel, for scrcpy to use to receive video stream data from the device and send control streams. When the first frame of the tested screen video stream data is obtained, the initialization is marked as complete.

[0047] S102, the test host sends target control commands to the screen under test in real time through the first channel, so that the screen under test executes the target control commands, and the test host acquires the video stream of the screen under test in real time and sends it out.

[0048] In this embodiment, the target control command includes click, swipe, or long-press commands, etc.; the test host sends the target control command (e.g., click command) to the screen under test in real time through the first Socket channel, so that the screen under test executes the target control command. At this time, the interface of the screen under test often changes, for example, entering the interface after clicking, while the test host captures the video stream of the screen under test in real time and sends it out. For example, such as Figure 2 As shown.

[0049] S103, based on the test tool acquiring video frames of the screen under test through the second channel at a preset target frame period, a continuous image sequence of the screen under test is obtained.

[0050] In this embodiment, the testing tool is a local client or a host computer. The testing tool uses the aforementioned second Socket channel to capture video frames of the screen under test at a target frame period (e.g., Δt ≤ 500 ms, such as 50 ms, corresponding to 20 fps), obtaining a continuous image sequence of the screen under test for subsequent processing. For example, as... Figure 2 As shown.

[0051] S104, the testing tool performs frame-by-frame detection on the continuous image sequence within a preset target detection time, and determines whether the test passes based on the detection results.

[0052] In this embodiment, the target detection duration is a preset detection duration, for example, detection duration T = 3 s; the testing tool performs frame-by-frame detection on the continuous image sequence within the target detection duration to determine whether the test passes. For example, as Figure 2 As shown.

[0053] In some implementations, when detecting a continuous image sequence frame by frame, the expected UI features corresponding to each frame of the continuous image sequence and the template image corresponding to the expected UI features are determined. For each frame of the continuous image sequence, the continuous image sequence and the template image are scaled and normalized. A preset similarity measurement model is used to calculate the similarity between the continuous image sequence and the template image, and the test is judged based on the similarity.

[0054] Among them, expected UI features represent the key features of the page on the screen being tested. For example, when a click command enters the Bluetooth device page, it will trigger changes in some key features, such as a new interface, new colors, etc. These expected UI features are captured for detection and recognition.

[0055] Optionally, when determining whether a test passes based on similarity, if the similarity between a continuous image sequence and a template image reaches a preset matching threshold, then the continuous image sequence is determined to have identified the corresponding expected UI feature; if any frame of a continuous image sequence identifies the corresponding expected UI feature within the target detection time, then the test is determined to have passed.

[0056] In addition, if no consecutive image sequence within the target detection time period identifies the corresponding expected UI feature, the test is deemed to have failed.

[0057] Specifically, the recognition method of this application adopts template matching, that is, after sending control commands, screenshots of the screen under test are acquired at intervals and the specified expected UI features are identified. If the similarity between the continuous image sequence and the template image reaches a preset matching threshold, the corresponding expected UI feature is identified. Therefore, if any frame of continuous image sequence identifies the corresponding expected UI feature or is identified successfully at least once, the test is deemed to have passed. If no frame of continuous image sequence identifies the corresponding expected UI feature or is not identified successfully at least once, the test is deemed to have failed.

[0058] The cockpit screen real-time testing method provided in this application involves establishing a connection between the test host and the screen under test, activating the target screen mirroring service component to establish a first channel and a second channel, and sending target control commands to the screen under test in real time through the first channel to enable the screen under test to execute the target control commands. The test host also acquires and transmits the video stream of the screen under test in real time. A testing tool acquires video frames of the screen under test captured at a preset target frame period through the second channel, obtaining a continuous image sequence of the screen under test. The testing tool then performs frame-by-frame detection on the continuous image sequence within a preset target detection duration, and determines whether the test passes based on the detection results. This cockpit screen real-time testing method, by establishing a connection between the test host and the screen under test and establishing a first and second channel to send control commands and receive the video stream of the screen under test in real time, and by capturing and detecting the video frames of the screen under test frame by frame, reduces the image acquisition latency of the screen under test, solves the high latency problem of traditional solutions, and ensures that screen images are captured even for short-lived scenes or screen UI feature changes with uncertain response times, thus reducing the false negative rate.

[0059] In general, this application starts the scrcpy-server component between the test host and the screen under test, establishing a dual-Socket channel. The first Socket channel is used to send click, swipe, or long-press commands, and the second Socket channel is used to receive the screen video stream in real time. Video frames are captured with a frame period of Δt ≤ 500 ms, and the expected UI features are identified frame by frame within the test duration T = 3 seconds. The test is considered passed if at least one hit is achieved. Compared with the traditional ADB screenshot solution, this application greatly shortens the image acquisition time, can quickly capture images multiple times without additional hardware, significantly reduces the false negative rate, and is suitable for parallel automated testing of multiple screens in vehicles.

[0060] Figure 4 This is a schematic diagram of the cockpit screen real-time testing device provided according to an embodiment of this application; as shown below. Figure 4 As shown, the cockpit screen real-time testing device 400 of this application embodiment may specifically include: The construction module 401 is used to start the target screen mirroring service component to establish a first channel and a second channel when a connection is established between the test host and the screen under test; wherein, the first channel is used to send control commands to the screen under test, and the second channel is used to receive the video stream of the screen under test in real time; The sending module 402 is used to send a target control command to the screen under test in real time through the first channel based on the test host, so that the screen under test executes the target control command, and the test host collects the video stream of the screen under test in real time and sends it out. The acquisition module 403 is used to acquire video frames of the screen under test captured at a preset target frame period through the second channel based on the test tool, so as to obtain a continuous image sequence of the screen under test. The detection module 404 is used to perform frame-by-frame detection on the continuous image sequence based on the test tool within a preset target detection time, and to determine whether the test is passed based on the detection results.

[0061] In one possible implementation, the test host and the test tool are connected via a dual-ended USB cable, one end of which is inserted into the USB port of the test host, and the other end of which is connected to the USB port of the test tool; the first channel and the second channel communicate via a target port; the construction module is specifically used for: In response to the input of a target ADB command in the command window of the test host, the vehicle serial number is obtained through the target ADB command; If the vehicle serial number is successfully obtained, it is determined that the test host and the test tool are successfully connected.

[0062] In one possible implementation, the detection module is specifically used for: Determine the expected UI features corresponding to each frame of continuous image sequence and the template image corresponding to the expected UI features, and perform scale normalization processing on the continuous image sequence and the template image for each frame of continuous image sequence; A preset similarity measurement model is used to calculate the similarity between the continuous image sequence and the template image, and the test is judged based on the similarity.

[0063] In one possible implementation, the detection module is specifically used for: If the similarity between the continuous image sequence and the template image reaches a preset matching threshold, then it is determined that the continuous image sequence has identified the corresponding expected UI feature; If, within the target detection time, any consecutive image sequence contains the corresponding expected UI feature, the test is considered passed.

[0064] In one possible implementation, the device further includes: The push module is used to push the screen mirroring service deployment file corresponding to the target screen mirroring service component to the test host and start it before starting the target screen mirroring service component to establish the first channel and the second channel; wherein, the screen mirroring service deployment file is the specific physical carrier and deployment package of the screen mirroring service component; The setting module is used to set the screen display identifier for the screen under test and the display width of the screen under test; wherein the display width of the screen under test is not less than the maximum value of the actual screen size of the screen under test.

[0065] In one possible implementation, the building module is specifically used for: Establish a first and second abstract namespace locally; A first channel is established based on the first abstract namespace, and a second channel is established based on the second abstract namespace.

[0066] In one possible implementation, the detection module is specifically used for: If no consecutive image sequence within the target detection time period identifies the corresponding expected UI feature, the test is deemed to have failed.

[0067] The cockpit screen real-time testing device provided in this application establishes a connection between the test host and the screen under test, and starts the target screen mirroring service component to establish a first channel and a second channel. Based on the test host, the target control command is sent to the screen under test in real time through the first channel, so that the screen under test executes the target control command. The test host acquires the video stream of the screen under test in real time and sends it out. Based on the test tool, the video frames of the screen under test are captured at a preset target frame period through the second channel to obtain a continuous image sequence of the screen under test. Based on the test tool, the continuous image sequence is detected frame by frame within a preset target detection time. Based on the detection results, it is determined whether the test passes the test. The cockpit screen real-time testing device of this application establishes a connection between the test host and the screen under test and establishes a first channel and a second channel to send control commands and receive the video stream of the screen under test in real time, and captures the video frames of the screen under test for frame-by-frame detection. This reduces the image acquisition delay of the screen under test, solves the problem of high latency in traditional solutions, and ensures that the screen image is captured for short-lived images or screen UI feature changes with uncertain response times, thus reducing the false negative rate.

[0068] like Figure 5 As shown in the embodiment of this application, an electronic device 500 includes a processor 501, a memory 502, and a bus. The memory 502 stores machine-readable instructions that can be executed by the processor 501. When the electronic device is running, the processor 501 communicates with the memory 502 via the bus, and the processor 501 executes the machine-readable instructions to perform the steps of the cockpit screen real-time testing method described above.

[0069] Specifically, the memory 502 and processor 501 mentioned above can be general-purpose memory and processor, without any specific limitations. When the processor 501 runs the computer program stored in the memory 502, it can execute the above-mentioned cockpit screen real-time test method.

[0070] Corresponding to the above-described cockpit screen real-time testing method, this application embodiment also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the steps of the above-described cockpit screen real-time testing method.

[0071] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.

[0072] The modules described as separate components may or may not be physically separate. The components shown as modules 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.

[0073] In addition, 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.

[0074] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, 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 a portion 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 several 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 deployment methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0075] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for real-time testing of cockpit screens, characterized in that, The method includes: Once a connection is established between the test host and the screen under test, the target screen mirroring service component is started to establish a first channel and a second channel; wherein, the first channel is used to send control commands to the screen under test, and the second channel is used to receive the video stream of the screen under test in real time; The test host sends target control commands to the screen under test in real time through the first channel, so that the screen under test executes the target control commands. The test host also collects and transmits the video stream of the screen under test in real time. Based on the video frames of the screen under test captured by the test tool through the second channel at a preset target frame period, a continuous image sequence of the screen under test is obtained. The testing tool performs frame-by-frame detection on the continuous image sequence within a preset target detection time, and determines whether the test passes based on the detection results.

2. The method according to claim 1, characterized in that, The test host and the test tool are connected via a dual-ended USB cable. One end of the dual-ended USB cable is inserted into the USB port of the test host, and the other end of the dual-ended USB cable is connected to the USB port of the test tool. The first channel and the second channel communicate via the target port; The connection between the test host and the screen under test is established, including: In response to the input of a target ADB command in the command window of the test host, the vehicle serial number is obtained through the target ADB command; If the vehicle serial number is successfully obtained, it is determined that the test host and the test tool are successfully connected.

3. The method according to claim 1, characterized in that, The step of detecting the continuous image sequence frame by frame includes: Determine the expected UI features corresponding to each frame of continuous image sequence and the template image corresponding to the expected UI features, and perform scale normalization processing on the continuous image sequence and the template image for each frame of continuous image sequence; A preset similarity measurement model is used to calculate the similarity between the continuous image sequence and the template image, and the test is judged based on the similarity.

4. The method according to claim 3, characterized in that, The process of determining whether the test passes based on the similarity score includes: If the similarity between the continuous image sequence and the template image reaches a preset matching threshold, then it is determined that the continuous image sequence has identified the corresponding expected UI feature; If, within the target detection time, any consecutive image sequence contains the corresponding expected UI feature, the test is considered passed.

5. The method according to claim 1, characterized in that, Before initiating the target screen mirroring service component to establish the first and second channels, the method further includes: The screen mirroring service deployment file corresponding to the target screen mirroring service component is pushed to the test host and started; wherein, the screen mirroring service deployment file is the specific physical carrier and deployment package of the screen mirroring service component; Set the screen display identifier and the display width of the screen under test; wherein the display width of the screen under test is not less than the maximum value of the actual screen size of the screen under test.

6. The method according to claim 1, characterized in that, The establishment of the first channel and the second channel includes: Establish a first and second abstract namespace locally; A first channel is established based on the first abstract namespace, and a second channel is established based on the second abstract namespace.

7. The method according to claim 4, characterized in that, The process of determining whether the test passes based on the similarity score includes: If no consecutive image sequence within the target detection time period identifies the corresponding expected UI feature, the test is deemed to have failed.

8. A cockpit screen real-time testing device, characterized in that, The device includes: The module is used to establish a first channel and a second channel when a connection is established between the test host and the screen under test; wherein, the first channel is used to send control commands to the screen under test, and the second channel is used to receive the video stream of the screen under test in real time. The sending module is used to send target control commands to the screen under test in real time through the first channel based on the test host, so that the screen under test executes the target control commands, and the test host collects the video stream of the screen under test in real time and sends it out. The acquisition module is used to acquire video frames of the screen under test captured at a preset target frame period through the second channel based on the test tool, so as to obtain a continuous image sequence of the screen under test. The detection module is used to perform frame-by-frame detection on the continuous image sequence based on the testing tool within a preset target detection time, and to determine whether the test is passed based on the detection results.

9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the cockpit screen real-time testing method as described in any one of claims 1 to 7 are performed.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the cockpit screen real-time testing method as described in any one of claims 1 to 7.