Automatic test method, device and equipment based on end scanning band-out collision logic

By adopting an automated testing method based on collision logic derived from end-scanning, a smart terminal is used to replace the camera video stream and perform scanning and comparison of waybill information. This solves the problem of cumbersome automated testing operations in existing technologies and achieves efficient and low-cost testing of scanning and recognition systems.

CN117354426BActive Publication Date: 2026-11-20SHANGHAI ZHONGTONGJI NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311404465.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-26
Publication Date
2026-11-20
Estimated Expiration
2043-10-26

AI Technical Summary

Technical Problem

Existing technologies for automated testing of scanning and recognition systems require too many pre-prepared conditions, are cumbersome to operate, and are difficult to accurately control video streams and handle anomalies.

Method used

An automated testing method based on end-scan collision logic is adopted. A smart terminal is used to acquire the video to be played and the scanning and recognition system to be tested. By intercepting camera events and replacing them with the video to be played, the scanning and recognition system is called to scan the waybill information, generate the scanning results, and compare them with the waybill information in the database to generate the test results.

Benefits of technology

It enables automated testing with a single device, reducing equipment costs. The video stream is controllable, allowing for precise control of program flow and facilitating exception handling, thus reducing the difficulty and cost of system setup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117354426B_ABST
    Figure CN117354426B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of automatic testing, in particular to an automatic testing method, device and equipment based on end scanning and collision logic, which can acquire a to-be-played video and a to-be-tested scanning and identifying system; after detecting a camera event, replace the picture in the camera of the intelligent terminal with the to-be-played video; call the scanning and identifying system to scan the picture in the camera of the intelligent terminal for face information and generate a scanning result. It can be understood that the technical solution shown in the present application can perform automatic testing with only one intelligent terminal, reduce cost, and the video stream is controllable, so that the program can be accurately controlled, the program can be conveniently processed for exception and compensated for errors, and no additional application program needs to be developed, thereby greatly reducing the cost of system construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automatic testing technology, and specifically to an automatic testing method, apparatus, and equipment based on end-scan collision logic. Background Technology

[0002] In the express delivery industry, scanning and recognizing information on waybills using cameras from various devices (mobile phones, barcode scanners, etc.) is a continuous process throughout the waybill's lifecycle. At several points in this lifecycle, the information on the waybill needs to be entered and uploaded to the corresponding system to generate the tracking information. Manually entering waybill information is clearly impractical, so a method is needed to automate this process. Currently, popular technologies include OCR (Optical Character Recognition) and machine learning. Various express delivery companies have developed a wide variety of scanning and recognition systems based on OCR and machine learning frameworks. Measuring the recognition speed and accuracy of these systems requires a significant amount of repetitive work from software testers.

[0003] To test scanning systems, the current method typically involves using two devices (usually Android phones) to automate the testing. The specific steps are as follows:

[0004] Step S1: Prepare two devices. One device is used to play pre-stored videos of express delivery waybills at regular intervals, and the other is used for scanning and recognition. Step S2: The device used for playback reads information from the database and downloads the corresponding video based on the returned video address. After downloading, it plays the video. Step S3: The device used for scanning simultaneously captures video footage through a camera, thereby using the scanning and recognition system under test to identify the waybill information and complete the data entry.

[0005] The above method has the following drawbacks: it requires two devices; it requires precise control over the scanning and order number playback timing of the two devices, which may require the development of a separate application; and since the device used to play the express delivery waybill is uncontrollable, it is difficult to handle exceptions in the automated system code.

[0006] Therefore, the current automated testing of scanning and recognition systems requires too many pre-prepared conditions and is cumbersome to operate. Summary of the Invention

[0007] In view of this, the purpose of the present invention is to provide an automatic testing method, apparatus and equipment based on end-scan collision logic, so as to solve the problem that the automatic testing of scanning recognition systems in the prior art requires too many pre-prepared conditions and is cumbersome to operate.

[0008] According to a first aspect of the present invention, an automatic testing method based on end-scan collision logic is provided, applied to a smart terminal, comprising:

[0009] Obtain the video to be played and the scanning and recognition system to be tested;

[0010] Once a camera event is detected, the image from the smart terminal's camera will be replaced with the video to be played.

[0011] The scanning and recognition system is invoked to scan the image in the camera of the smart terminal for the waybill information, and a scanning result is generated.

[0012] Preferably, the method further includes:

[0013] When acquiring the video to be played, it is also possible to acquire the corresponding shipping label information in the video;

[0014] After generating the scan results, the scan results are compared with the waybill information to generate test results.

[0015] Preferably, obtaining the video to be played includes:

[0016] Establish a remote connection with the database, retrieve the waybill information and the video address corresponding to the waybill information from the database;

[0017] The video to be played is obtained based on the video address.

[0018] Preferably, after generating the scan results, the method further includes:

[0019] Determine whether other waybill information exists in the database;

[0020] If so, retrieve the new waybill information and the corresponding video address from the database, and then proceed with the next steps.

[0021] Preferably, replacing the image from the smart terminal's camera with the video to be played includes:

[0022] The camera event is intercepted, and the behavior of the smart terminal in processing the camera is converted into playing the video to be played, and the camera callback screen is converted into the video screen to be played.

[0023] According to a second aspect of the present invention, an automatic testing apparatus based on end-scan collision logic is provided, comprising:

[0024] The data acquisition module is used to acquire the video to be played and the scanning and recognition system to be tested;

[0025] The image replacement module is used to replace the image in the smart terminal's camera with the video to be played when a camera event is detected.

[0026] The testing module is used to call the scanning and recognition system to scan the waybill information in the image of the smart terminal camera and generate the scanning result.

[0027] According to a third aspect of the present invention, an automated testing device based on end-scan collision logic is provided, comprising:

[0028] The main controller and the memory connected to the main controller;

[0029] The memory stores program instructions;

[0030] The main controller is used to execute program instructions stored in the memory and perform any of the methods described above.

[0031] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:

[0032] It is understood that the technical solution presented in this invention can acquire the video to be played and the scanning and recognition system to be tested; upon detecting a camera event, the image from the smart terminal's camera is replaced with the video to be played; the scanning and recognition system is invoked to scan the image from the smart terminal's camera for waybill information, generating a scanning result. It is also understood that the technical solution presented in this invention requires only one smart terminal for automated testing, reducing costs. Furthermore, the video stream is controllable, allowing for precise control of the program's flow, facilitating exception handling and related error compensation, without requiring additional application development, thus significantly reducing system setup costs.

[0033] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0034] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0035] Figure 1 This is a schematic diagram illustrating the steps of an automatic testing method based on end-scan collision logic according to an exemplary embodiment;

[0036] Figure 2 This is a schematic diagram of a virtual camera process according to an exemplary embodiment;

[0037] Figure 3 This is a schematic diagram of an automated testing method for cameras, according to an exemplary embodiment. Detailed Implementation

[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0039] Example 1

[0040] Figure 1 This is a schematic diagram illustrating the steps of an automated testing method based on end-scan collision logic according to an exemplary embodiment. See also... Figure 1 This paper provides an automated testing method based on end-scan collision logic, applicable to smart terminals, including:

[0041] Step S11: Obtain the video to be played and the scanning and recognition system to be tested.

[0042] In practice, the scanning and recognition system to be tested is the scanning and recognition system developed by various express delivery companies based on OCR and machine learning frameworks, and the video to be played is a video used to test the scanning and recognition system. The video contains waybill information and is used to test the aforementioned scanning and recognition system.

[0043] Step S12: When a camera event is detected, the image from the smart terminal's camera is replaced with the video to be played.

[0044] Step S13: Call the scanning and recognition system to scan the waybill information in the image of the smart terminal camera and generate a scanning result.

[0045] It is understood that the technical solution shown in this embodiment can acquire the video to be played and the scanning and recognition system to be tested; when a camera event is detected, the image in the smart terminal's camera is replaced with the video to be played; the scanning and recognition system is invoked to scan the label information in the image in the smart terminal's camera and generate a scanning result. It is understood that the technical solution shown in this embodiment requires only one smart terminal for automated testing, reducing costs. Furthermore, the video stream is controllable, allowing for precise control of the program's flow, facilitating exception handling and related error compensation, without requiring additional application development, thus greatly reducing system setup costs.

[0046] It should be noted that the method also includes:

[0047] When acquiring the video to be played, it is also possible to acquire the corresponding shipping label information in the video;

[0048] After generating the scan results, the scan results are compared with the waybill information to generate test results.

[0049] In practice, to automate the generation of test results, the shipping label information corresponding to the video can be obtained. After the scanning and recognition system under test generates the scanning results, the scanning results are compared with the shipping label information to obtain the test results. It is understood that the technical solution provided in this embodiment can further improve the automation level of the method.

[0050] It should be noted that obtaining the video to be played includes:

[0051] Establish a remote connection with the database, retrieve the waybill information and the video address corresponding to the waybill information from the database;

[0052] The video to be played is obtained based on the video address.

[0053] In practice, there are two ways to implement the video to be played: one is to record a long video and play it continuously without interruption; the other is to have one video for each express delivery waybill and then control the playback and switching of the videos.

[0054] The express delivery waybill with short video can store waybill information and video address in a remote database. The technical solution shown in this embodiment can read the information in the database, download the corresponding video according to the video address, and then play it.

[0055] Compared to long videos, short videos have better anomaly handling capabilities, more precise process control capabilities, and more efficient storage space control capabilities.

[0056] It should be noted that after generating the scan results, the following are also included:

[0057] Determine whether other waybill information exists in the database;

[0058] If so, retrieve the new waybill information and the corresponding video address from the database, and then proceed with the next steps.

[0059] In practice, if the video to be played is a short video, each video corresponds to a shipping label information. The database stores several shipping label information entries and the corresponding video download address. After the scanning and recognition system under test in this method identifies one video, the smart terminal can continue to retrieve the next shipping label information from the database, thus continuing the testing of the scanning and recognition system. It is understood that the technical solution shown in this embodiment further improves the automation level of the method.

[0060] It should be noted that replacing the image from the smart terminal's camera with the video to be played includes:

[0061] The camera event is intercepted, and the behavior of the smart terminal in processing the camera is converted into playing the video to be played, and the camera callback screen is converted into the video screen to be played.

[0062] In practice, virtual camera technology can be used to capture the camera video stream of a device (Android, barcode scanner, etc.), and the camera video stream can be replaced by hooking (a system mechanism to replace "interrupts" in DOS) and corresponding event callbacks, so as to achieve the goal of automating the testing of the express waybill scanning system with a single device.

[0063] See Figure 2 When a smart terminal's operating system captures a camera event, it calls the camera event callback method to process the video stream captured by the camera. The Xposed framework can intercept camera events and use its built-in hook method to change the system's behavior in handling the camera. In the technical solution shown in this embodiment, this hook method replaces the camera's video with a video containing express delivery waybill information.

[0064] Xposed (Xposed Framework) is an open-source framework service that runs in Android's high-privilege mode. It can affect program operation (modify the system) without modifying the APK file. Many powerful modules can be created based on it and run simultaneously without functional conflicts.

[0065] Virtual camera technology is implemented using the hook method provided by Xposed. Based on this, existing processes can be optimized. See [link / reference]. Figure 3 When a camera event is detected, the video stream is replaced using Xposed, a camera callback is executed, the waybill information is identified using OCR, and it is determined whether all data in the database has been scanned. If the data is complete, the process ends; if there is still other data, the above steps are repeated.

[0066] The technical solution illustrated in this embodiment implements a virtual camera for the device through the Xposed hook mechanism. Self-developed video control flow code assists in video downloading and device file processing, avoiding any intrusion into the original system's source code.

[0067] Understandably, this solution requires only one device to complete the entire automated system, reducing equipment costs compared to existing technologies. The short video streaming method allows for better control over the timing of device scanning and improved anomaly handling. The entire automated system can be built without the assistance of other systems, significantly reducing the difficulty of system setup.

[0068] Example 2

[0069] An automatic testing device based on end-scan collision logic is provided, comprising:

[0070] The data acquisition module is used to acquire the video to be played and the scanning and recognition system to be tested;

[0071] The image replacement module is used to replace the image in the smart terminal's camera with the video to be played when a camera event is detected.

[0072] The testing module is used to call the scanning and recognition system to scan the waybill information in the image of the smart terminal camera and generate the scanning result.

[0073] It is understood that the technical solution shown in this embodiment can acquire the video to be played and the scanning and recognition system to be tested through the data acquisition module; when a camera event is detected, the image in the smart terminal's camera is replaced with the video to be played through the image replacement module; and the testing module calls the scanning and recognition system to scan the image in the smart terminal's camera to generate the scanning result. It is understood that the technical solution shown in this embodiment can perform automated testing with only one smart terminal, reducing costs. Furthermore, the video stream is controllable, allowing for precise control of the program's flow, facilitating exception handling and related error compensation, without requiring additional application development, thus greatly reducing the cost of system setup.

[0074] Example 3

[0075] An automated testing device based on end-scan collision logic is provided, comprising:

[0076] The main controller and the memory connected to the main controller;

[0077] The memory stores program instructions;

[0078] The main controller is used to execute program instructions stored in the memory and perform any of the methods described above.

[0079] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.

[0080] It should be noted that in the description of this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means at least two.

[0081] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0082] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0083] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0084] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0085] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.

[0086] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0087] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. An automatic testing method based on end-scan collision logic, applied to smart terminals, characterized in that, include: Obtain the video to be played and the scanning and recognition system to be tested; Obtaining the video to be played includes: establishing a remote connection with a database, obtaining waybill information and a video address corresponding to the waybill information from the database; and obtaining the video to be played based on the video address. When a camera event is detected, the image from the smart terminal's camera is replaced with the video to be played, including: intercepting the camera event, converting the smart terminal's camera processing behavior into playing the video to be played, and converting the camera callback image into the video image to be played. The scanning and recognition system is invoked to scan the waybill information in the image from the smart terminal's camera, and a scanning result is generated. The scan results are compared with the waybill information to generate test results.

2. The method according to claim 1, characterized in that, After generating the scan results, the following is also included: Determine whether other waybill information exists in the database; If so, retrieve the new waybill information and the corresponding video address from the database, and then proceed with the next steps.

3. An automatic testing device based on end-scan collision logic, characterized in that, include: The data acquisition module is used to acquire the video to be played and the scanning and recognition system to be tested; Obtaining the video to be played includes: establishing a remote connection with a database, obtaining waybill information and a video address corresponding to the waybill information from the database; and obtaining the video to be played based on the video address. The image replacement module is used to replace the image in the camera of the smart terminal with the video to be played after a camera event is detected. The module includes: intercepting the camera event, converting the smart terminal's behavior of processing the camera into playing the video to be played, and converting the camera callback image into the video image to be played. The testing module is used to call the scanning and recognition system to scan the waybill information in the image of the smart terminal camera and generate the scanning result; The scan results are compared with the waybill information to generate test results.

4. An automatic testing device based on end-scan collision logic, characterized in that, include: The main controller and the memory connected to the main controller; The memory stores program instructions; The master controller is used to execute program instructions stored in the memory to perform the method as described in any one of claims 1 or 2.

Citation Information

Patent Citations

  • Express delivery document information input method based on scanning image and input apparatus thereof

    CN106203416A

  • Method and device for calibrating identification result of mobile phone number of express waybill and storage medium

    CN113378843A