Mobile terminal continuous code scanning method, device, equipment and storage medium
Patent Information
- Application Number
- CN202610801602.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-04
- Publication Date
- 2026-08-28
AI Technical Summary
[0003]现有技术中,H5页面调用原生扫码功能通常采用以下方式:H5通过JSBridge触发原生扫码界面,原生端完成单次扫码后关闭界面并将结果回传H5,若需连续扫码则必须由H5重新发起调用,多次往返导致交互延迟明显,用户体验差
[0017] The technical solution provided by this invention achieves modularization and cross-platform unification of scanning capabilities by encapsulating and integrating a standardized continuous barcode scanning control with a deep learning inference engine. Simultaneously, it supports dynamically obtaining interface and inference configuration parameters through request parsing, flexibly adapting to different display requirements and recognition accuracy. Furthermore, after rendering, the inference engine completes barcode positioning, character recognition, and duplicate filtering, ensuring the accuracy and efficiency of continuous barcode scanning. In addition, it dynamically generates feedback instructions based on the recognition results, supporting real-time adjustment of inference parameters and full lifecycle management of control visibility and resource release, thereby improving scanning flexibility, controllability, and adaptability to complex scenarios, reducing development and adaptation costs, and ensuring a stable and smooth scanning experience.
Smart Images

Figure CN122655810A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of logistics, and in particular to a method, apparatus, device and storage medium for continuous mobile barcode scanning. Background Technology
[0002] With the popularization of mobile internet and HTML5 technology, more and more mobile applications are adopting a hybrid development model of H5 and native technologies. Among them, barcode scanning is a high-frequency requirement in scenarios such as logistics, retail, asset management, and mobile payment, while continuous barcode scanning (such as batch scanning of product barcodes and continuous entry of asset numbers) places higher demands on scanning efficiency and real-time interaction.
[0003] In existing technologies, H5 pages typically invoke native QR code scanning functionality in the following way: H5 triggers the native QR code scanning interface via JSBridge. After the native client completes a single scan, it closes the interface and sends the result back to H5. If continuous scanning is required, H5 must re-initiate the call, resulting in significant interaction delays and a poor user experience due to multiple round trips. Some solutions keep the QR code scanning interface active on the native client, but each scan result still requires H5 to actively poll or repeatedly call the function, lacking an efficient continuous control mechanism.
[0004] In addition, traditional barcode scanning solutions mostly rely on ordinary image processing algorithms from open-source libraries. They have low recognition rates in scenarios such as complex lighting, barcode damage, and long distances. Furthermore, they lack an effective deduplication mechanism for repeated reporting of the same physical barcode during continuous scanning, which easily generates a large amount of redundant data and increases the business processing burden on the H5 side.
[0005] Therefore, existing technologies still need improvement and development. Summary of the Invention
[0006] This invention provides a method, apparatus, device, and storage medium for continuous scanning of barcodes on mobile devices with H5 and native interaction, and intelligent deduplication.
[0007] The first aspect of this invention provides a mobile continuous barcode scanning method, comprising: encapsulating a standardized continuous barcode scanning control, wherein the encapsulated standardized continuous barcode scanning control integrates a deep learning inference engine; upon receiving a barcode scanning request, parsing the barcode scanning request to obtain control display parameters and configuration parameters; configuring the interface display attributes of the standardized continuous barcode scanning control according to the control display parameters, and dynamically setting the running parameters of the deep learning inference engine according to the configuration parameters; rendering the configured standardized continuous barcode scanning control to a target position determined by a container identifier, and performing barcode positioning, barcode character recognition, and deduplication processing through the deep learning inference engine to generate a recognition result; generating a feedback instruction based on the recognition result, and obtaining a configuration adjustment instruction and a control management instruction based on the feedback instruction; dynamically adjusting the configuration parameters according to the configuration adjustment instruction, and performing display, hiding, or resource release operations on the standardized continuous barcode scanning control according to the control management instruction.
[0008] Optionally, in a first implementation of the first aspect of the present invention, the encapsulation of the standardized continuous barcode scanning control, wherein the encapsulated standardized continuous barcode scanning control integrates a deep learning inference engine, includes: constructing a deep learning inference engine, wherein the deep learning inference engine includes at least a barcode detection model, a barcode recognition model, and a continuous barcode deduplication model, wherein the continuous barcode deduplication model filters duplicate recognition results of the same barcode based on a dual mechanism of feature hashing and time window; defining a configurable interface for the control on the native side to obtain an instantiable control infrastructure, wherein the configurable interface includes at least a timing parameter and a quantity threshold parameter for controlling continuous barcode scanning behavior; when instantiating the control infrastructure, loading and integrating the deep learning inference engine into the control infrastructure to obtain a control instance, and encapsulating the control instance into a standardized continuous barcode scanning control that can be called by an H5 page.
[0009] Optionally, in the second implementation of the first aspect of the present invention, the construction of the deep learning inference engine includes at least a barcode detection model, a barcode recognition model, and a continuous scanning deduplication model. The continuous scanning deduplication model filters duplicate recognition results of the same barcode based on a dual mechanism of feature hashing and time window, including: constructing a barcode detection model based on a single-stage object detection algorithm, which is used to locate the region where the barcode is located in the input image to obtain a barcode region image; constructing a barcode recognition model based on a convolutional recurrent neural network, which is used to decode the barcode region image into string content; constructing a continuous scanning deduplication model based on a local feature hashing algorithm and a time window comparison mechanism, which is used to filter duplicate recognition results of the same barcode; and sequentially connecting the barcode detection model, the barcode recognition model, and the continuous scanning deduplication model in a series and integrating them into a pre-built inference framework on the mobile terminal to obtain the deep learning inference engine, and enabling the deep learning inference engine to provide a unified image input interface and result output interface.
[0010] Optionally, in a third implementation of the first aspect of the present invention, when a barcode scanning request is received, parsing the barcode scanning request to obtain control display parameters and configuration parameters includes: receiving the barcode scanning request from an H5 page via a preset communication bridge and verifying the permission of the barcode scanning request; parsing the control display parameters and configuration parameters from the barcode scanning request that has passed the permission verification, wherein the control display parameters include at least the preview view size, the barcode scanning frame position, and the container identifier, and the configuration parameters include at least the confidence threshold of the barcode detection model and the time window threshold of the continuous barcode deduplication model; and saving the control display parameters and configuration parameters to the standardized continuous barcode scanning control.
[0011] Optionally, in a fourth implementation of the first aspect of the present invention, configuring the interface display attributes of the standardized continuous barcode scanning control according to the control display parameters, and dynamically setting the running parameters of the deep learning inference engine according to the configuration parameters, includes: calling the native interface layout interface to set the display style of the preview area and the barcode scanning frame of the standardized continuous barcode scanning control according to the preview view size and the barcode scanning frame position in the control display parameters; adjusting the judgment sensitivity of the barcode detection model according to the confidence threshold in the configuration parameters; and setting the length of the repeated filtering time window of the continuous barcode deduplication model according to the continuous barcode deduplication model time window threshold in the configuration parameters.
[0012] Optionally, in the fifth implementation of the first aspect of the present invention, the step of rendering the configured standardized continuous scanning control to the target position determined by the container identifier, and realizing barcode positioning, barcode character recognition, and deduplication through the deep learning inference engine to generate a recognition result includes: determining the target view container according to the container identifier in the control display parameters, and rendering the configured standardized continuous scanning control into the target view container; requesting camera permissions and starting real-time image frame acquisition, and sequentially calling the barcode detection model to locate the barcode area, calling the barcode recognition model to decode the barcode characters in the barcode area, and calling the continuous scanning deduplication model to filter duplicate results in the recognized barcode characters to obtain the recognition result.
[0013] Optionally, in the sixth implementation of the first aspect of the present invention, the step of dynamically adjusting the configuration parameters according to the configuration adjustment instruction and performing the display, hiding, or resource release operation of the standardized continuous scanning control according to the control management instruction includes: receiving the configuration adjustment instruction and control management instruction issued by the H5 page according to the recognition result through a communication bridge; parsing the parameter name and new threshold in the configuration adjustment instruction to update the running parameters of the corresponding model in the deep learning inference engine in real time; if the control management instruction is a display instruction, making the standardized continuous scanning control visible; if the control management instruction is a hiding instruction, making the standardized continuous scanning control invisible; if the control management instruction is a release instruction, turning off the camera and releasing the resources occupied by the standardized continuous scanning control, and generating a confirmation message of resource release completion and feeding it back to the H5 page after executing the release instruction.
[0014] A second aspect of the present invention provides a mobile continuous barcode scanning device, comprising: an encapsulation module for encapsulating a standardized continuous barcode scanning control, wherein the encapsulated standardized continuous barcode scanning control integrates a deep learning inference engine; a parsing module for parsing a barcode scanning request information when a barcode scanning request information is received, to obtain control display parameters and configuration parameters; a configuration module for configuring the interface display attributes of the standardized continuous barcode scanning control according to the control display parameters, and dynamically setting the running parameters of the deep learning inference engine according to the configuration parameters; a scanning module for rendering the configured standardized continuous barcode scanning control to a target position determined by a container identifier, and performing barcode positioning, barcode character recognition, and deduplication processing through the deep learning inference engine to generate a recognition result; and a feedback module for generating feedback instructions based on the recognition result, and obtaining configuration adjustment instructions and control management instructions based on the feedback instructions. The adjustment module is used to dynamically adjust the configuration parameters according to the configuration adjustment instructions, and to perform the display, hiding, or resource release operations of the standardized continuous scanning control according to the control management instructions.
[0015] A third aspect of the present invention provides a mobile continuous scanning device, comprising: a memory and at least one processor, wherein the memory stores computer-readable instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the computer-readable instructions in the memory to cause the mobile continuous scanning device to perform the various steps of the mobile continuous scanning method described above.
[0016] A fourth aspect of the present invention provides a computer-readable storage medium storing computer-readable instructions that, when executed on a computer, cause the computer to perform the steps of the mobile terminal continuous scanning method described above.
[0017] The technical solution provided by this invention achieves modularization and cross-platform unification of scanning capabilities by encapsulating and integrating a standardized continuous barcode scanning control with a deep learning inference engine. Simultaneously, it supports dynamically obtaining interface and inference configuration parameters through request parsing, flexibly adapting to different display requirements and recognition accuracy. Furthermore, after rendering, the inference engine completes barcode positioning, character recognition, and duplicate filtering, ensuring the accuracy and efficiency of continuous barcode scanning. In addition, it dynamically generates feedback instructions based on the recognition results, supporting real-time adjustment of inference parameters and full lifecycle management of control visibility and resource release, thereby improving scanning flexibility, controllability, and adaptability to complex scenarios, reducing development and adaptation costs, and ensuring a stable and smooth scanning experience. Attached Figure Description
[0018] Figure 1 This is a first flowchart of a mobile terminal continuous scanning method provided in an embodiment of the present invention; Figure 2 This is a second flowchart of the mobile terminal continuous scanning method provided in an embodiment of the present invention; Figure 3 This is a third flowchart of the mobile terminal continuous scanning method provided in the embodiments of the present invention; Figure 4 This is a fourth flowchart of the mobile terminal continuous scanning method provided in the embodiments of the present invention; Figure 5 This is a fifth flowchart of the mobile terminal continuous scanning method provided in the embodiments of the present invention; Figure 6 This is a sixth flowchart of the mobile terminal continuous scanning method provided in the embodiments of the present invention; Figure 7 This is a schematic diagram of the structure of the mobile terminal continuous barcode scanning device provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a mobile continuous barcode scanning device provided in an embodiment of the present invention. Detailed Implementation
[0019] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0020] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of a mobile terminal continuous scanning method according to the present invention includes: S101. A standardized continuous barcode scanning control is encapsulated, wherein the standardized continuous barcode scanning control integrates a deep learning inference engine.
[0021] It is understood that the executing entity of this invention can be a mobile continuous scanning device, a terminal, or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as an example.
[0022] In this embodiment, the core of this step is the unified construction of cross-platform underlying capabilities, compatible with the three major mobile native systems: Android, iOS, and HarmonyOS. It follows unified development specifications for modular development, encapsulating a standardized continuous barcode scanning control. This standardized continuous barcode scanning control incorporates a lightweight, mobile-optimized deep learning inference engine, deeply integrating barcode detection, barcode recognition, and a continuous barcode deduplication model based on a dual mechanism of feature hashing and time windows. It completes underlying tasks such as engine initialization, model adaptation, and algorithm debugging. Through native unified encapsulation, it completely shields the underlying adaptation differences between different mobile systems, achieving deep binding between scanning view capabilities and AI offline inference capabilities. This provides stable underlying technical support for subsequent cross-platform calls, intelligent scanning, and duplicate filtering, ensuring consistency of basic scanning capabilities across multiple platforms.
[0023] S102. When a QR code scanning request is received, the QR code scanning request is parsed to obtain the control display parameters and configuration parameters.
[0024] In this embodiment, based on the dedicated communication bridge channel preset by the mobile WebView, the system continuously monitors the QR code scanning request information sent from the H5 page in the background, establishing a secure and stable cross-platform data transmission link and isolating external invalid data interference. After capturing the request data packet, basic verification of data format and request permissions is performed to eliminate abnormal and illegal requests and ensure interaction security. Subsequently, compliant requests are subjected to refined structured parsing, accurately separating two types of core parameters: control display parameters for controlling the QR code display effect, and configuration parameters for regulating the AI inference operation logic.
[0025] S103. Configure the interface display attributes of the standardized continuous barcode scanning control according to the control display parameters, and dynamically set the running parameters of the deep learning inference engine according to the configuration parameters.
[0026] In this embodiment, based on the parsed compliance parameters, precise configurations are completed for both the interface layer and the algorithm layer. For control display parameters, the native interface layout interface is called to dynamically adapt to the device screen size and WebView layout rules, enabling custom configuration of interface attributes such as the barcode control preview size, scanning frame position, and display style, ensuring the barcode view adapts to the H5 page layout. For configuration parameters, the model running threshold and core working parameters are updated in real time, precisely controlling key performance indicators such as barcode detection sensitivity and continuous scanning deduplication time window. Parameters take effect in real time without restarting the control or engine, achieving a fine-grained two-way adaptation between barcode display effects and AI inference performance.
[0027] S104. Render the configured standardized continuous barcode scanning control to the target position determined by the container identifier, realize barcode positioning, barcode character recognition and deduplication through a deep learning inference engine, generate recognition results, and encapsulate the recognition results and feed them back to the H5 page in real time through an event notification mechanism.
[0028] In this embodiment, the WebView target view container is accurately located based on the unique identifier of the container in the control display parameters, and the configured standardized QR code scanning control is accurately rendered to the specified page position. Camera permissions are actively requested, and after successful permission verification, the device starts real-time image frame acquisition, continuously outputting high-definition and stable real-time images.
[0029] In this embodiment, the deep learning inference engine pipeline logic completes the entire inference process frame by frame, including barcode area detection, barcode character decoding, and duplicate recognition result filtering, generating accurate and effective barcode recognition results. Finally, core data such as recognition content, recognition time, and barcode type are encapsulated in a standardized JSON format and asynchronously called back to the H5 page through a dedicated event notification mechanism, without blocking the front-end main thread, achieving real-time cross-platform synchronization of scanning results.
[0030] S105. Generate feedback instructions based on the recognition results, and obtain configuration adjustment instructions and control management instructions based on the feedback instructions.
[0031] In this embodiment, after completing single-frame barcode inference and recognition, multi-dimensional core data such as barcode character content, recognition timestamp, barcode type, recognition status, and device information are integrated and encapsulated into a standard JSON data object according to a preset unified format, and a feedback instruction is generated. Then, through a dedicated event notification mechanism, the feedback instruction is asynchronously pushed to the H5 page in real time, without blocking the main thread of the front-end page or affecting normal page interaction and continuous barcode scanning. This achieves real-time synchronization between the native barcode recognition results and the H5 business layer, providing accurate data support for subsequent business judgment, data statistics, and process processing on the H5 page.
[0032] S106. Dynamically adjust the configuration parameters according to the configuration adjustment instruction, and perform the display, hiding, or resource release operation of the standardized continuous scanning control according to the control management instruction.
[0033] In this embodiment, various dynamic control commands issued from the H5 page are continuously monitored, including configuration adjustment commands and control management commands. For configuration adjustment commands, new parameter thresholds are parsed in real time to complete the hot update of deep learning inference engine model parameters, enabling dynamic fine-tuning of inference performance. For control management commands, corresponding operations are executed according to categories. Receiving a display command activates the control view and resumes the scanning operation; receiving a hide command hides the view, pauses data acquisition and inference, and saves device resources; receiving a resource release command orderly shuts down the camera, destroys control instances, clears cached data, and generates release completion feedback information synchronized to the H5 page, achieving closed-loop controllable management of the entire lifecycle of the scanning function.
[0034] This embodiment provides a mobile continuous barcode scanning method. It achieves modularization and cross-platform unification of scanning capabilities by encapsulating a standardized continuous barcode scanning control that integrates a deep learning inference engine. Simultaneously, it supports dynamically obtaining interface and inference configuration parameters through request parsing, flexibly adapting to different display requirements and recognition accuracy. Furthermore, after rendering, the inference engine completes barcode positioning, character recognition, and duplicate filtering, ensuring the accuracy and efficiency of continuous barcode scanning. In addition, it dynamically generates feedback instructions based on the recognition results, supporting real-time adjustment of inference parameters and full lifecycle management of control visibility and resource release. This enhances scanning flexibility, controllability, and adaptability to complex scenarios, reduces development and adaptation costs, and ensures a stable and smooth scanning experience.
[0035] Please see Figure 2 The second embodiment of the mobile terminal continuous scanning method in this invention includes: S201. Construct a deep learning inference engine, wherein the deep learning inference engine includes at least a barcode detection model, a barcode recognition model, and a continuous barcode deduplication model, wherein the continuous barcode deduplication model filters duplicate recognition results of the same barcode based on a dual mechanism of feature hashing and time window.
[0036] In this embodiment, a deep learning inference engine is constructed. This deep learning inference engine includes at least a barcode detection model, a barcode recognition model, and a continuous scanning deduplication model. The continuous scanning deduplication model filters duplicate recognition results of the same barcode based on a dual mechanism of feature hashing and time windows. Specifically, it includes: constructing a barcode detection model based on a single-stage object detection algorithm, which is used to locate the region where the barcode is located in the input image to obtain a barcode region image; constructing a barcode recognition model based on a convolutional recurrent neural network, which is used to decode the barcode region image into string content; constructing a continuous scanning deduplication model based on a local feature hashing algorithm and a time window comparison mechanism, which is used to filter duplicate recognition results of the same barcode; and sequentially connecting the barcode detection model, barcode recognition model, and continuous scanning deduplication model, and integrating them into a pre-built inference framework on the mobile device to obtain the deep learning inference engine, which provides a unified image input interface and result output interface.
[0037] In this embodiment, when constructing a barcode detection model based on a single-stage object detection algorithm, a lightweight single-stage object detection algorithm is selected as the basic framework, abandoning the redundant computation of traditional two-stage detection algorithms and adapting to the real-time inference requirements of mobile devices. Combining the size characteristics, morphological features, edge textures, and complex scene distribution patterns of various 1D and 2D barcodes, the network backbone structure and detection head structure are optimized to reduce the number of model parameters and computational power consumption. Model training, iteration, and quantization compression are completed using a massive number of barcode samples, including those with blurred, occluded, reflective, and complex backgrounds, optimizing the model's positioning accuracy and inference speed. The trained model can quickly and accurately locate the barcode target area from the original image input from the camera in real time, automatically cropping and removing invalid background images, and outputting a high-definition and clean barcode area image, providing high-quality input data for subsequent character recognition.
[0038] Specifically, a lightweight variant of Mobile-YOLO is selected as the basic structure, which is divided into three core layers to adapt to low-computing-power mobile scenarios: The first is a lightweight backbone feature extraction layer, which adopts the MobileNetV2 depthwise separable convolutional structure. It splits the standard convolution operation by channel-wise convolution and pointwise convolution, and is combined with an inverted residual module and a linear bottleneck structure to significantly compress the number of model parameters and computational cost while retaining effective features. It is specifically used to extract shallow key features such as barcode edges, textures, and contours. The second is a multi-scale feature fusion layer, which sets three sets of feature output branches at different scales to adapt to large, medium, and small-sized 1D and 2D barcodes. Multi-scale feature fusion is completed through a feature pyramid structure to solve the problem of missed detection caused by differences in barcode distance and size. The third is a detection and regression output layer, which adopts a grid division prediction mechanism to evenly divide the input image into grids. Each grid is matched with multiple sets of preset anchor boxes, and the bounding box coordinate regression, target confidence scoring, and foreground and background classification are completed simultaneously to output accurate barcode region coordinate parameters.
[0039] In this embodiment, a barcode recognition model is built around a convolutional recurrent neural network, which combines the technical advantages of convolutional and recurrent networks. Convolutional layers efficiently extract spatial features such as barcode texture, contour, and grayscale variations, achieving accurate barcode feature capture and noise reduction. Recurrent neural networks accurately model the sequential relationships between barcode characters, adapting to fixed barcode encoding rules and character arrangement logic.
[0040] Specifically, the barcode recognition model adopts a lightweight CRNN three-segment classic structure, which is fully adapted to mobile edge inference and has no redundant computation. The first part is the convolutional feature extraction layer, which uses a multi-layer lightweight convolutional and pooling stacked structure to replace the traditional deep convolutional network. It is responsible for extracting spatial features such as texture, contour, and grayscale changes from the cropped barcode area image, completing image denoising and feature enhancement, and outputting a fixed-dimensional two-dimensional feature map. The second part is the recurrent sequence modeling layer, which stacks two layers of bidirectional LSTM long short-term memory network. It can capture the sequence dependencies of barcode characters in both forward and reverse directions, accurately learn the barcode character arrangement rules and spacing features, solve the context loss problem of unidirectional sequence recognition, and adapt to the ordered sequence recognition characteristics of barcodes. The third part is the transcription output layer, which adopts the CTC connection temporal classification decoding algorithm. It can automatically complete the mapping and conversion between feature sequences and barcode characters without character alignment, remove blank and invalid features, and finally output standardized barcode string content.
[0041] In this embodiment, a continuous barcode deduplication model is built by combining a local feature hashing algorithm with a time window comparison mechanism. The core principle is to extract core texture features from the recognized barcode image and generate a unique fixed hash value as the barcode's identity identifier, avoiding hash misjudgments caused by slight pixel deviations. At the same time, a dynamically configurable sliding time window is built to cache historical barcode hash data and recognition timestamps within the window. After a new barcode is recognized, it is automatically compared with the historical data within the window. If the hash matches, it is determined to be a duplicate barcode and filtered out; if there is no match, it is determined to be a valid new barcode, balancing deduplication accuracy and real-time scanning.
[0042] Specifically, the continuous barcode scanning deduplication model adopts a dual-module collaborative architecture, which is lightweight, consumes no redundant computing power, and is adapted for real-time operation on mobile devices. The first part is the local feature hash generation module, which performs grayscale conversion, resize and normalize, and sample texture features on the barcode area image before decoding to extract the core stable features of the barcode, discarding minor pixel interference caused by lighting and displacement, and generating a 64-bit fixed-length unique feature hash value through hash operation as a unique identifier for the barcode, ensuring that the hash of the same barcode is consistent and the hash of different barcodes is differentiated. The second part is the dynamic time window cache comparison module, which has a built-in configurable sliding time window, hash cache queue and comparison logic, supports custom window duration thresholds, and the cache queue automatically stores the valid barcode hash values and recognition timestamps within the window. It dynamically eliminates expired historical data according to the first-in-first-out rule. After each recognition, it automatically traverses the cache queue to complete the hash comparison and outputs the deduplicated valid recognition results.
[0043] In this embodiment, following the business logic of image detection, character recognition, and duplicate filtering, the three types of models are sequentially connected to form a pipelined inference architecture, clearly defining the input / output interface standards and runtime sequence of each model. The connected multi-model system is embedded into a lightweight mobile inference framework, and targeted adaptation work is completed on the mobile side, including operator adaptation, memory scheduling optimization, inference speed tuning, and power consumption control, to adapt to the limited computing resources of mobile devices. Finally, a standardized image input interface and recognition result output interface are uniformly built, and the data transmission format is standardized, enabling the engine to be independently invoked, batch-inferenced, and dynamically configured, ultimately forming a low-latency, high-precision, and highly stable complete deep learning inference engine.
[0044] S202. Define a configurable interface for the control on the native side to obtain an instantiable control infrastructure. The configurable interface includes at least timing parameters and quantity threshold parameters for controlling continuous scanning behavior.
[0045] In this embodiment, within a native mobile development environment, a standardized QR code scanning control interface architecture is built for H5 cross-platform dynamic invocation scenarios. The input parameter format, output parameter specifications, call sequence, and exception handling mechanisms for all interfaces are clearly defined. The core parameter interfaces are encapsulated for flexible customization, including timing parameters controlling the continuous scanning rhythm and quantity threshold parameters controlling the maximum number of codes scanned in a single operation. Supporting interfaces for interface configuration, inference parameter tuning, and lifecycle management are also extended. Through standardized interface definitions, a complete, highly flexible, quickly instantiable, and flexibly extensible control framework is built, unifying the multi-platform control calling specifications and shielding underlying system differences.
[0046] S203. When instantiating the control infrastructure, load and integrate the deep learning inference engine into the control infrastructure to obtain a control instance, and encapsulate the control instance into a standardized continuous barcode scanning control that can be called by the H5 page.
[0047] In this embodiment, based on a pre-built standardized control infrastructure, a dynamic instantiation operation is performed to generate a blank control instance framework. During instantiation, a pre-built deep learning inference engine is loaded simultaneously, completing integration operations such as path binding, interface mapping, parameter initialization, and permission adaptation between the engine and the control body, achieving a deep fusion of control view display capabilities and AI intelligent inference capabilities. Simultaneously, basic adaptation work such as default parameter configuration, exception handling mechanism setup, and runtime status monitoring is completed to ensure that the instantiated control can stably perform core operations such as QR code scanning, deep learning inference, and result output.
[0048] In this embodiment, the integrated complete control instance is uniformly encapsulated to shield the underlying interface differences, adaptation logic, and device compatibility issues of Android, iOS, and HarmonyOS systems, and to unify the control's operating logic. A standardized and universal H5 call entry point is exposed externally, standardizing the complete process of H5 calls, parameter transmission, command interaction, and result callbacks. This ultimately forms a standardized continuous barcode scanning control that can be reused across platforms, dynamically configured, and freely started, stopped, and released, supporting H5 pages to seamlessly call native continuous barcode scanning capabilities through unified logic.
[0049] In this embodiment, a layered development logic is adopted, which first builds an independent deep learning inference engine, then defines standardized interfaces, and finally integrates and encapsulates them. This completely decouples the structure of the QR code control view display layer from the deep learning inference capability layer. At the same time, by customizing standardized configurable interfaces including core parameters such as scanning timing and quantity thresholds, the calling specifications of QR code controls across multiple platforms are unified, completely shielding the underlying development differences of Android, iOS, and HarmonyOS systems. This allows H5 pages to complete the QR code scanning capability calls across all platforms based on the same calling logic. In addition, the instantiation method of dynamically loading and integrating the independent deep learning inference engine supports subsequent independent iteration and upgrade of algorithm models. It can adapt to QR code scanning scenarios with different precision and complexity without modifying the main architecture of the control, greatly reducing the development and maintenance costs of multi-platform adaptation, effectively improving the cross-platform reusability and scenario adaptation capabilities of the QR code control, and providing standardized, stable, and reliable underlying support for H5 to flexibly call native AI continuous QR code scanning capabilities.
[0050] Please see Figure 3 A third embodiment of a mobile terminal continuous QR code scanning method according to the present invention includes: S301. Receive the QR code call request information from the H5 page through the preset communication bridge, and verify the permission of the QR code call request information.
[0051] In this embodiment, a dedicated communication bridge channel is pre-configured in the mobile WebView to establish a one-to-one dedicated interaction link between the H5 and native applications, isolating interference from other business data. The channel data is continuously monitored in the background, capturing QR code scanning request information sent from the H5 page in real time. For all received request data packets, a comprehensive security verification mechanism is executed, verifying the legality of the request source, the validity of the calling permissions, the standardization of the data packet format, and the integrity of the data. Invalid requests such as illegal calls, insufficient permissions, incorrect formats, empty data, and abnormal redundant data are accurately blocked, retaining only compliant, complete, and valid standardized QR code scanning commands. This avoids functional failures caused by illegal calls and abnormal parameters from the source, ensuring the security of QR code scanning.
[0052] S302. Parse the control display parameters and configuration parameters from the scan call request information that has passed the permission verification. The control display parameters include at least the preview view size, the scan frame position and the container identifier. The configuration parameters include at least the confidence threshold of the barcode detection model and the time window threshold of the continuous scan deduplication model.
[0053] In this embodiment, valid QR code scanning requests that pass permission verification are structured and parsed, categorizing request parameters into two main types based on functional attributes: control display parameters and configuration parameters. Core data from the control display parameters is precisely extracted, including the size of the QR code preview view, the coordinate position of the scanning frame, and unique container identifiers on the page—all interface adaptation data. Simultaneously, inference configuration parameters are parsed and extracted, including algorithm control data such as the confidence threshold for the barcode detection model and the time window threshold for the continuous scanning deduplication model. Furthermore, all parsed parameters undergo numerical validity verification, eliminating parameters exceeding threshold ranges and invalid or abnormal parameters to ensure the accuracy and validity of all configuration data.
[0054] S303. Save the control display parameters and configuration parameters to the standardized continuous barcode scanning control.
[0055] In this embodiment, the compliant display parameters and inference configuration parameters that have been parsed and verified are bound and persistently stored in the currently initialized standardized barcode scanning control. A lifecycle binding mechanism between parameters and control instances is established to ensure that parameters are not lost or disordered during control operation, and cached parameters are cleared synchronously when the control is destroyed to avoid memory residue and parameter crosstalk.
[0056] In this embodiment, a communication bridging channel is established to achieve point-to-point data transmission between H5 and native systems, effectively isolating interference from other business data and ensuring the independence and stability of cross-terminal interaction. This avoids issues such as data crosstalk and request anomalies from the underlying layer. Moreover, through the permission verification mechanism, illegal calls, malicious requests, and abnormal data packets can be accurately intercepted, significantly improving the security of the QR code scanning function and the stability of system operation. In addition, the request parameters are structured and classified for parsing, clearly distinguishing between control interface display parameters and deep learning inference configuration parameters, clarifying the functional positioning and applicable scenarios of various parameters, and solving the problems of mixed parameters, ambiguous configuration, and disordered control in traditional solutions.
[0057] Please see Figure 4 A fourth embodiment of a mobile terminal continuous QR code scanning method according to the present invention includes: S401. Based on the preview view size and scanning frame position in the control display parameters, call the native interface layout interface to set the preview area and scanning frame display style of the standardized continuous scanning control.
[0058] In this embodiment, interface parameters such as the preview view size and QR code frame position are read from the control instance cache. The mobile-specific interface layout interface is then called, and the width and height of the QR code preview area are dynamically and adaptively adjusted based on the current device screen resolution, screen adaptation ratio, and WebView container layout rules. The display coordinates, size ratio, and centering style of the QR code frame are precisely located and set, automatically adapting to mobile device screens of different sizes and resolutions, while also adapting to the layout styles of various H5 pages.
[0059] S402. Adjust the judgment sensitivity of the barcode detection model according to the confidence threshold in the configuration parameters.
[0060] In this embodiment, the barcode detection confidence threshold is extracted from the configuration parameters, and the positive and negative sample judgment criteria and inference judgment logic of the barcode detection model are updated synchronously to achieve dynamic adjustment of detection sensitivity. In harsh environments with strong light, dust, complex backgrounds, or dense interference, the confidence threshold can be increased to improve the model's judgment criteria, effectively filtering background interference and suspected interference barcodes, and reducing the probability of false detections. In sparse environments with blurry barcodes, light colors, and low recognizability, the confidence threshold can be appropriately lowered to relax the judgment criteria and reduce missed detections. Through dynamic parameter adjustment, the accuracy and coverage of barcode detection are flexibly balanced to adapt to diverse and complex barcode scanning scenarios.
[0061] S403. Based on the continuous barcode scanning deduplication model time window threshold in the configuration parameters, set the length of the repeated filtering time window of the continuous barcode scanning deduplication model.
[0062] In this embodiment, the time window threshold parameter of the continuous barcode deduplication model is read and parsed, and the effective duration of the sliding time window is dynamically configured to define the effective comparison range of historical barcode hash data. For high-frequency, fast, and continuous barcode scanning scenarios such as warehousing and logistics, the time window duration is shortened to reduce the time spent on historical data comparison, improve the barcode scanning response speed, and adapt to the needs of rapid batch barcode scanning operations. For low-frequency, fine-grained barcode scanning scenarios such as retail and inventory, the time window duration is extended to expand the historical data comparison range, enhance the effect of filtering duplicate barcodes, avoid the problem of repeated recognition and repeated callbacks of the same barcode in a short period of time, and accurately adapt to the barcode scanning frequency requirements of different businesses.
[0063] In this embodiment, based on the standardized interface parameters issued by H5, the native layout interface is called to dynamically adapt to the device screen and WebView layout, flexibly adjusting the scan preview size and scan frame display style. This solves the problems of fixed traditional scan interfaces, rendering misalignment across multiple devices, and poor page adaptation, achieving seamless adaptation between the scan interface and various H5 pages. Furthermore, for the inference stage of the deep learning inference engine, the detection confidence threshold can be dynamically adjusted to flexibly control the model's recognition sensitivity according to the degree of interference in the environment. In strong light, dust, and complex background scenarios, the threshold can be increased to reduce the false detection rate, while in low-recognition barcode scenarios, the threshold can be decreased to reduce missed detections. In addition, based on the configurable time window threshold, different business scenarios such as high-frequency batch scanning and low-frequency fine scanning can be flexibly adapted to accurately filter duplicate scan data.
[0064] Please see Figure 5 A fifth embodiment of a mobile terminal continuous QR code scanning method according to the present invention includes: S501. Determine the target view container based on the container identifier in the control display parameters, and render the configured standardized continuous barcode scanning control into the target view container.
[0065] In this embodiment, the unique container identifier in the control display parameters is read, and the internal view hierarchy of the WebView is traversed layer by layer to accurately locate the target view container node specified by the H5 page. Combined with preset interface layout parameters, the standardized QR code scanning control is mounted, positioned, sized, and rendered. The display position and size of the QR code view are determined according to the H5 page layout requirements, achieving seamless integration between the QR code control and the H5 page. After rendering, view adaptation verification is automatically performed to avoid rendering misalignment, view occlusion, loading failure, and other abnormal issues, ensuring the normal display of the QR code preview interface.
[0066] S502. Request camera permission and start real-time image frame acquisition. For each acquired image frame, sequentially call the barcode detection model to locate the barcode area, call the barcode recognition model to decode the barcode characters in the barcode area, and call the continuous scanning deduplication model to filter duplicate results in the recognized barcode characters to obtain the recognition result.
[0067] In this embodiment, after the standardized continuous barcode scanning control is rendered, a camera permission request is initiated, the device permission status is verified, and once permission is granted, the camera device is immediately initialized, configuring a high-definition resolution and stable acquisition frame rate suitable for the barcode scanning scenario. The camera device continuously acquires real-time environmental image frames, automatically adapting to changes in ambient light, and outputs clear and continuous raw image data. For each acquired image frame, the barcode detection model is sequentially invoked to locate and crop the barcode area, the barcode recognition model is invoked to complete accurate character decoding, and finally, the continuous barcode scanning deduplication model is used to compare historical data, filter duplicate and invalid recognition results, and select and output unique and valid standard barcode recognition data, realizing uninterrupted continuous barcode scanning inference frame by frame.
[0068] In this embodiment, the rendering node is accurately located using a unique container identifier, enabling precise mounting and adaptation of the barcode scanning control to the specified view container on the H5 page. This allows for flexible adaptation to embedded usage scenarios involving multiple pages and modules, ensuring a neat and error-free barcode scanning view display. Simultaneously, by standardizing the camera permission application and initial frame acquisition process, the camera resource calling logic is standardized, effectively avoiding issues such as resource contention among multiple controls, device startup failures, and screen stuttering / flickering, ensuring the continuity and stability of image acquisition. Furthermore, a frame-level pipelined inference mode is adopted to sequentially complete the entire process of barcode detection, character recognition, and duplicate data deduplication frame by frame, achieving uninterrupted continuous barcode scanning operations and significantly improving scanning real-time performance and operational efficiency.
[0069] Please see Figure 6 The sixth embodiment of a mobile terminal continuous scanning method according to the present invention includes: S601. Receive configuration adjustment instructions and control management instructions issued by the H5 page based on the recognition results via a communication bridge.
[0070] In this embodiment, based on a stable cross-platform communication bridging channel, various business control commands issued from the H5 page are continuously monitored in real time, dynamically capturing configuration adjustment commands and control management commands. All received command data packets undergo format verification, legality screening, and anomaly filtering to eliminate abnormal commands with format errors, missing parameters, or invalid redundancy, ensuring that only compliant and valid commands enter the execution process. Simultaneously, the functional attributes of the two different types of commands are distinguished, the parameter fields and threshold information of the configuration adjustment commands are analyzed, and the operation type of the control management commands is identified synchronously, providing command data support for subsequent precise execution of control operations.
[0071] S602. Parse the parameter names and new thresholds in the configuration adjustment instructions to update the running parameters of the corresponding model in the deep learning inference engine in real time.
[0072] In this embodiment, for the parsed configuration adjustment command, the parameter names, new thresholds, and adjustment ranges in the command are matched to quickly locate the corresponding model functional modules in the deep learning inference engine. A hot update mechanism with real-time memory overwrite is adopted to update core operating parameters such as model detection confidence and deduplication time window in real time without restarting the barcode scanning control, interrupting real-time barcode scanning operations, or consuming additional computing power. The parameter adjustment results take effect immediately.
[0073] S603. If the control management instruction is a display instruction, the standardized continuous barcode scanning control will be made visible. If the control management instruction is a hide instruction, the standardized continuous barcode scanning control will be made invisible. If the control management instruction is a release instruction, the camera will be turned off and the resources occupied by the standardized continuous barcode scanning control will be released. After the release instruction is executed, a confirmation message indicating that the resource release is complete will be generated and sent to the H5 page.
[0074] In this embodiment, corresponding refined operations are executed according to different types of control management instructions. When a display instruction is received, the control view is activated to be visible, and camera image acquisition and barcode scanning inference operations are resumed. When a hide instruction is received, the front-end barcode scanning view interface is hidden, and image acquisition and inference operations are paused to save device power and computing resources. When a release instruction is received, a standardized resource destruction process is executed, sequentially stopping camera acquisition, shutting down the camera hardware, clearing the model inference cache, destroying control instances, and releasing system resources. After the resource release is completed, a standardized resource release completion confirmation message is generated and fed back to the H5 page in real time, achieving synchronization between the H5 and native states, preventing issues such as memory leaks, resource consumption, and background power consumption, and completing closed-loop management of the entire lifecycle of the control.
[0075] In this embodiment, based on a continuous and stable cross-platform communication channel, various control commands issued by the H5 page are monitored in real time, enabling seamless hot updates of deep learning model running parameters. This allows for real-time fine-tuning of inference performance according to business needs without restarting the QR code control, iterating the native version, or interrupting the QR code scanning business, greatly improving the efficiency of business iteration and adaptation. At the same time, a refined visual control system is built, supporting H5 to flexibly control the display and hiding state of the QR code control according to actual needs such as page switching, business start / stop, and scene switching, effectively adapting to diverse front-end interaction scenarios and reducing the ineffective consumption of device computing power and power.
[0076] The continuous scanning method for mobile devices in the embodiments of the present invention has been described above. The apparatus in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 7 The embodiments of the mobile terminal continuous scanning device in this invention include: Encapsulation module 701 is used to encapsulate a standardized continuous barcode scanning control, wherein the encapsulated standardized continuous barcode scanning control integrates a deep learning inference engine. The parsing module 702 is used to parse the QR code call request information when it receives the QR code call request information in order to obtain the control display parameters and configuration parameters; The configuration module 703 is used to configure the interface display attributes of the standardized continuous barcode scanning control according to the control display parameters, and to dynamically set the running parameters of the deep learning inference engine according to the configuration parameters. The barcode scanning module 704 is used to render the configured standardized continuous barcode scanning control to the target position determined by the container identifier, and to realize barcode positioning, barcode character recognition and deduplication processing through the deep learning inference engine to generate recognition results. Feedback module 705 is used to generate feedback instructions based on the recognition results, and to obtain configuration adjustment instructions and control management instructions based on the feedback instructions; The adjustment module 706 is used to dynamically adjust the configuration parameters according to the configuration adjustment instruction, and to perform the display, hiding or resource release operation of the standardized continuous scanning control according to the control management instruction.
[0077] In this embodiment, the encapsulation module 701 includes: a construction unit 7011, used to construct a deep learning inference engine, the deep learning inference engine including at least a barcode detection model, a barcode recognition model, and a continuous barcode deduplication model, the continuous barcode deduplication model filtering duplicate recognition results of the same barcode based on a dual mechanism of feature hashing and time window; a definition unit 7012, used to define a configurable interface for the control on the native side to obtain an instantiable control infrastructure, the configurable interface including at least a timing parameter and a quantity threshold parameter for controlling continuous barcode scanning behavior; and an encapsulation unit 7013, used to load and integrate the deep learning inference engine into the control infrastructure when instantiating the control infrastructure to obtain a control instance, and encapsulate the control instance into a standardized continuous barcode scanning control that can be called by an H5 page.
[0078] In this embodiment, the parsing module 702 includes: a verification unit 7021, configured to receive a barcode scanning request from an H5 page via a preset communication bridge, and to perform permission verification on the barcode scanning request; a first parsing unit 7022, configured to parse control display parameters and configuration parameters from the barcode scanning request that has passed permission verification, wherein the control display parameters include at least the preview view size, the barcode scanning frame position, and the container identifier, and the configuration parameters include at least the confidence threshold of the barcode detection model and the time window threshold of the continuous barcode deduplication model; and a saving unit 7023, configured to save the control display parameters and configuration parameters to the standardized continuous barcode scanning control.
[0079] In this embodiment, the configuration module 703 includes: a first configuration unit 7031, configured to call the native interface layout interface to set the preview area and display style of the standardized continuous barcode scanning control according to the preview view size and barcode scanning frame position in the control display parameters; a second configuration unit 7032, configured to adjust the judgment sensitivity of the barcode detection model according to the confidence threshold in the configuration parameters; and a third configuration unit, configured to set the repeat filtering time window length of the continuous barcode deduplication model according to the continuous barcode deduplication model time window threshold in the configuration parameters.
[0080] In this embodiment, the barcode scanning module 704 includes: a rendering unit 7041, used to determine the target view container based on the container identifier in the control display parameters, and render the configured standardized continuous barcode scanning control into the target view container; and a scanning unit 7042, used to request camera permissions and start real-time image frame acquisition, and sequentially call the barcode detection model to locate the barcode area, call the barcode recognition model to decode the barcode characters in the barcode area, and call the continuous barcode deduplication model to filter duplicate results in the recognized barcode characters to obtain the recognition result.
[0081] In this embodiment, the adjustment module 706 includes: a receiving unit 7061, configured to receive configuration adjustment instructions and control management instructions issued by the H5 page based on the recognition results via a communication bridge; a second parsing unit 7062, configured to parse the parameter names and new thresholds in the configuration adjustment instructions to update the running parameters of the corresponding model in the deep learning inference engine in real time; and an adjustment unit 7063, configured to make the standardized continuous scanning control visible when the control management instruction is a display instruction, make the standardized continuous scanning control invisible when the control management instruction is a hide instruction, and turn off the camera and release the resources occupied by the standardized continuous scanning control when the control management instruction is a release instruction, and generate a confirmation message indicating that the resource release is complete and send it back to the H5 page after executing the release instruction.
[0082] In this embodiment, a standardized continuous barcode scanning control integrating a deep learning inference engine is encapsulated to achieve modularization and cross-platform unification of scanning capabilities. Simultaneously, it supports dynamically obtaining interface and inference configuration parameters through request parsing, flexibly adapting to different display requirements and recognition accuracy. Furthermore, after rendering, the inference engine completes barcode positioning, character recognition, and duplicate filtering, ensuring the accuracy and efficiency of continuous barcode scanning. In addition, feedback instructions are dynamically generated based on the recognition results, supporting real-time adjustment of inference parameters and full lifecycle management of control visibility and resource release. This enhances scanning flexibility, controllability, and adaptability to complex scenarios, reduces development and adaptation costs, and ensures a stable and smooth scanning experience.
[0083] Figure 7The structure of the mobile terminal continuous scanning device shown does not constitute a limitation on the mobile terminal continuous scanning device, and can implement the steps of the mobile terminal continuous scanning method provided in the above-described method embodiments.
[0084] above Figure 7 The mobile terminal continuous scanning device in the embodiments of the present invention will be described in detail from the perspective of modular functional entities. The mobile terminal continuous scanning device in the embodiments of the present invention will be described in detail from the perspective of hardware processing.
[0085] Figure 8 This is a schematic diagram of the structure of a mobile continuous barcode scanning device provided in an embodiment of the present invention. The device 800 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 833 or data 832. The memory 820 and storage media 830 can be temporary or persistent storage. The program stored in the storage media 830 may include one or more modules (not shown), each module may include a series of instruction operations on the device 800. Furthermore, the processor 810 may be configured to communicate with the storage media 830 and execute the series of instruction operations stored in the storage media on the device 800.
[0086] Device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input / output interfaces 860, and / or one or more operating systems 831, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.
[0087] This invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the mobile terminal continuous scanning method.
[0088] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0089] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes 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 methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0090] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for continuous QR code scanning on a mobile device, characterized in that, include: A standardized continuous barcode scanning control is encapsulated, and the encapsulated standardized continuous barcode scanning control integrates a deep learning inference engine; When a QR code scanning request is received, the QR code scanning request is parsed to obtain the control display parameters and configuration parameters; Configure the interface display attributes of the standardized continuous barcode scanning control according to the control display parameters, and dynamically set the running parameters of the deep learning inference engine according to the configuration parameters; The configured standardized continuous scanning control is rendered to the target position determined by the container identifier, and the barcode positioning, barcode character recognition and deduplication are realized through the deep learning inference engine to generate the recognition result. Based on the recognition results, a feedback instruction is generated, and based on the feedback instruction, a configuration adjustment instruction and a control management instruction are obtained; The configuration parameters are dynamically adjusted according to the configuration adjustment instructions, and the standardized continuous scanning control is displayed, hidden, or released according to the control management instructions.
2. The mobile terminal continuous scanning method according to claim 1, characterized in that, The encapsulated standardized continuous barcode scanning control integrates a deep learning inference engine, including: Construct a deep learning inference engine, which includes at least a barcode detection model, a barcode recognition model, and a continuous scanning deduplication model. The continuous scanning deduplication model filters duplicate recognition results of the same barcode based on a dual mechanism of feature hashing and time window. Define a configurable interface for the control on the native side to obtain an instantiable control infrastructure. The configurable interface includes at least timing parameters and quantity threshold parameters for controlling continuous scanning behavior. When instantiating the control infrastructure, the deep learning inference engine is loaded and integrated into the control infrastructure to obtain a control instance, and the control instance is encapsulated into a standardized continuous barcode scanning control that can be called by H5 pages.
3. The mobile terminal continuous scanning method according to claim 2, characterized in that, The construction of the deep learning inference engine includes at least a barcode detection model, a barcode recognition model, and a continuous scanning deduplication model. The continuous scanning deduplication model filters duplicate recognition results of the same barcode based on a dual mechanism of feature hashing and time windows, including: A barcode detection model is constructed based on a single-stage object detection algorithm. The barcode detection model is used to locate the region where the barcode is located from the input image to obtain a barcode region image. A barcode recognition model is constructed based on a convolutional recurrent neural network. The barcode recognition model is used to decode barcode area images into string content. A continuous barcode deduplication model is constructed based on the local feature hashing algorithm and the time window comparison mechanism. The continuous barcode deduplication model is used to filter the duplicate recognition results of the same barcode. The barcode detection model, barcode recognition model, and continuous scanning deduplication model are sequentially connected in series and integrated into a pre-built inference framework on the mobile device to obtain a deep learning inference engine. The deep learning inference engine provides a unified image input interface and result output interface to the outside world.
4. The mobile terminal continuous scanning method according to claim 2, characterized in that, When a QR code scanning request is received, the request is parsed to obtain control display parameters and configuration parameters, including: The system receives QR code scanning request information from the H5 page through a preset communication bridge and performs permission verification on the QR code scanning request information. The control display parameters and configuration parameters are parsed from the QR code call request information that has passed the permission verification. The control display parameters include at least the preview view size, the QR code frame position and the container identifier. The configuration parameters include at least the confidence threshold of the barcode detection model and the time window threshold of the continuous QR code deduplication model. Save the control display parameters and configuration parameters to the standardized continuous barcode scanning control.
5. The mobile terminal continuous scanning method according to claim 2, characterized in that, The step of configuring the interface display attributes of the standardized continuous barcode scanning control according to the control display parameters, and dynamically setting the running parameters of the deep learning inference engine according to the configuration parameters, includes: Based on the preview view size and scanning frame position in the control display parameters, the native interface layout interface is called to set the preview area and scanning frame display style of the standardized continuous scanning control; The judgment sensitivity of the barcode detection model is adjusted according to the confidence threshold in the configuration parameters. Based on the time window threshold in the configuration parameters, set the length of the repeated filtering time window for the continuous barcode scanning deduplication model.
6. The mobile terminal continuous scanning method according to claim 2, characterized in that, The process involves rendering the configured standardized continuous barcode scanning control to the target position determined by the container identifier, and using the deep learning inference engine to perform barcode localization, barcode character recognition, and deduplication to generate a recognition result, including: Based on the container identifier in the control display parameters, determine the target view container and render the configured standardized continuous barcode scanning control into the target view container; Request camera permission and start real-time image frame acquisition. For each acquired image frame, sequentially call the barcode detection model to locate the barcode area, call the barcode recognition model to decode the barcode characters in the barcode area, and call the continuous scanning deduplication model to filter duplicate results in the recognized barcode characters to obtain the recognition result.
7. The mobile terminal continuous scanning method according to claim 2, characterized in that, The step of dynamically adjusting the configuration parameters according to the configuration adjustment instruction, and performing the display, hiding, or resource release operations of the standardized continuous barcode scanning control according to the control management instruction, includes: The system receives configuration adjustment instructions and control management instructions issued by the H5 page based on the recognition results via a communication bridge. Parse the parameter names and new thresholds in the configuration adjustment instructions to update the running parameters of the corresponding model in the deep learning inference engine in real time; If the control management instruction is a display instruction, the standardized continuous barcode scanning control will be made visible. If the control management instruction is a hide instruction, the standardized continuous barcode scanning control will be made invisible. If the control management instruction is a release instruction, the camera will be turned off and the resources occupied by the standardized continuous barcode scanning control will be released. After the release instruction is executed, a confirmation message indicating that the resource release is complete will be generated and sent to the H5 page.
8. A mobile terminal continuous barcode scanning device, characterized in that, include: An encapsulation module is used to encapsulate a standardized continuous barcode scanning control, wherein the encapsulated standardized continuous barcode scanning control integrates a deep learning inference engine. The parsing module is used to parse the QR code call request information when it receives the QR code call request information in order to obtain the control display parameters and configuration parameters; The configuration module is used to configure the interface display attributes of the standardized continuous barcode scanning control according to the control display parameters, and to dynamically set the running parameters of the deep learning inference engine according to the configuration parameters. The barcode scanning module is used to render the configured standardized continuous barcode scanning control to the target position determined by the container identifier, and to realize barcode positioning, barcode character recognition and deduplication through the deep learning inference engine to generate recognition results. The feedback module is used to generate feedback instructions based on the recognition results, and to obtain configuration adjustment instructions and control management instructions based on the feedback instructions; The adjustment module is used to dynamically adjust the configuration parameters according to the configuration adjustment instructions, and to perform the display, hiding, or resource release operations of the standardized continuous scanning control according to the control management instructions.
9. A mobile continuous barcode scanning device, characterized in that, It includes a memory and at least one processor, wherein the memory stores computer-readable instructions; The at least one processor invokes the computer-readable instructions in the memory to perform the steps of the mobile terminal continuous scanning method as described in any one of claims 1-7.
10. A computer-readable storage medium storing computer-readable instructions thereon, characterized in that, When the computer-readable instructions are executed by the processor, they implement the steps of the mobile terminal continuous scanning method as described in any one of claims 1-7.