A gate system identity authentication method and device

By employing a layered decoupled architecture and adaptive technology, the compatibility, security, and efficiency issues of camp gate identity authentication have been resolved, achieving efficient and secure identity verification, reducing maintenance costs, and providing a traceable verification history.

CN122116514APending Publication Date: 2026-05-29SUZHOU ZHISHU ANQING INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUZHOU ZHISHU ANQING INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-02-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing camp gate identity authentication technologies suffer from poor compatibility, insufficient security, high component coupling, inconvenient maintenance and expansion, data insecurity, and difficulty in traceability, making it impossible to achieve efficient and secure identity verification.

Method used

By adopting a layered and decoupled architecture, an identity authentication system with adaptive command matching, dual-mode verification, and traceable caching is constructed through adaptive permission verification, adaptive reading of document chips, standardized collection and preprocessing of biometric features, dual verification on both local and cloud platforms, and overall scheduling of the entire process. This system achieves accurate, secure, and efficient identity verification.

Benefits of technology

It improves the security, compatibility, and efficiency of identity verification at the camp gate, reduces maintenance costs, supports adaptive reading of different types of document chips, ensures the secure transmission and storage of sensitive data, and provides traceable verification history records, facilitating security auditing and event tracing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122116514A_ABST
    Figure CN122116514A_ABST
Patent Text Reader

Abstract

The application discloses a gate system identity authentication method and device, which is suitable for an Android terminal and belongs to the technical field of identity verification. The method is based on a layered decoupling architecture and comprises the following steps: permission adaptive checking, certificate chip adaptive reading, biological feature standardized collection and preprocessing, local cloud dual verification, result feedback and traceable record, and whole-process scheduling and abnormal control. The device comprises a core control layer, a function module layer, a data model layer and a basic tool layer. The application improves the certificate reading compatibility by defining an APDU instruction library, improves the comparison accuracy by adopting face key feature point quantitative scoring and fingerprint high-quality feature screening, guarantees the data security by combining data encryption, data verification and token, and supports offline and online dual-mode verification and traceable verification history. The application adapts to the personnel access verification requirements of high safety, high reliability and high efficiency, is stable and has strong expansibility, and can effectively improve the accuracy and safety of gate identity authentication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention proposes a method and device for identity authentication in a gate system, belonging to the field of identity verification technology. Background Technology

[0002] As the core checkpoint for personnel and vehicle entry and exit, the security, accuracy, and efficiency of identity verification at the camp gate directly affect internal security management. Currently, existing camp gate identity authentication technologies suffer from the following shortcomings: poor compatibility of verification methods, relying solely on standardized interaction commands that cannot adapt to different types of document chips, leading to issues such as data read failures and communication timeouts; a lack of systematic security mechanisms for sensitive data processing, making it susceptible to leakage and tampering during transmission and storage; insufficient coordination between local and cloud verification, making it prone to interruptions during network fluctuations, failing to balance verification efficiency and authority; high component coupling in the verification system, lacking standardized logic for end-to-end scheduling and anomaly control, resulting in high maintenance and expansion costs; and unregulated management of historical verification information, lacking traceable caching strategies, hindering camp gate security audits and incident investigations.

[0003] In existing technologies, the basic technologies such as APDU command interaction for NFC document reading, network communication on Android terminals, and local lightweight storage are all publicly available. However, existing technologies do not provide a concrete and feasible solution for combining these basic technologies with the high security, high traffic, and high compatibility requirements of camp gate identity verification to build an identity authentication system with adaptive command matching, dual-mode verification, traceable caching, and standardized scheduling throughout the entire process. Therefore, there is an urgent need for an identity authentication method and device adapted to the camp gate scenario to address the shortcomings of the aforementioned existing technologies. Summary of the Invention

[0004] This invention provides a method and apparatus for identity authentication in a camp gate system, which solves the problems of insufficient security, high component coupling, inconvenient maintenance and expansion, data insecurity, and difficulty in traceability in the prior art. It enables accurate, secure, and efficient verification of the identity of camp gate personnel, while reducing maintenance costs and improving system scalability and availability.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] A gate system identity authentication method, applied to an Android terminal, achieves collaborative scheduling and control of the entire identity verification process based on a layered decoupled architecture. The method includes the following steps:

[0007] S1, Adaptive Permission Verification

[0008] The system performs a unified scan and verification of the core permissions for gate identity verification on Android terminals. These core permissions include NFC, camera, fingerprint, network, and storage permissions. For unauthorized permissions, the system automatically requests permissions based on specific scenarios, clearly explains the purpose of the permissions to the user, and centrally processes the authorization results. If necessary permissions are not authorized, a standardized exception code is returned, and the user is prompted to authorize and restart the verification process. If all core permissions have been authorized, a verification result indicating compliance is obtained, and the system proceeds to the next verification stage, achieving adaptive permission verification.

[0009] S2, Adaptive reading of document chip

[0010] This step is the core process for resolving the chip compatibility issue of identification documents, and specifically includes:

[0011] Communication connection and ATR acquisition: The NFC communication component of the NFC document adaptive reading module enables NFC listening mode. When the resident's document is close to the NFC sensing area of ​​the terminal, it establishes an ISO-DEP protocol communication connection with the document chip and acquires the chip's ATR response data. The ATR response data includes core parameters such as chip model, communication rate, maximum data block length, and security verification requirements.

[0012] APDU instruction adaptive matching: The APDU instruction generation component retrieves the locally pre-built APDU instruction library and matches the acquired ATR response data with the "ATR identifier-APDU instruction" association stored in the instruction library. If a suitable custom APDU instruction is matched, that instruction is invoked; otherwise, the standardized APDU instruction set defined by the ISO 7816 standard is invoked by default.

[0013] Chip Data Reading and Parsing: The matched APDU command is sent to the document chip, a 5-second command execution timeout threshold is set, and one automatic retry is supported. Core data groups such as DG1 document core information and DG2 portrait information are read in blocks to obtain raw byte data. The document data parsing component performs encoding parsing, code escaping, and data formatting processing (such as GB2312 encoding parsing, ethnic code escaping, and birth date format conversion) on the raw byte data to obtain structured document information, which is synchronously stored in the document information standardized data model of the data model layer.

[0014] Step S2 obtains the ATR response data of the certificate chip through the NFC communication component, retrieves the pre-built APDU instruction library, matches the APDU instruction that is compatible with the ATR response data and sends it to the certificate chip, reads the core data group in the chip in blocks and performs encoding parsing, code escaping and data formatting processing to obtain structured certificate information and store it in a standardized data model to realize the adaptive reading of the certificate chip.

[0015] S3. Standardized collection and preprocessing of biometric features

[0016] This step standardizes the collection of facial and fingerprint biometric features to ensure the accuracy of subsequent comparisons. Specifically, it includes:

[0017] Face image acquisition and preprocessing: The camera component is activated to acquire face images at 1080P preview resolution and 4-megapixel shooting specifications. The acquired images undergo multi-dimensional quality checks for integrity, sharpness, and illumination. If the sharpness score is <0.6 or the illumination uniformity is <0.5, up to three retry attempts are automatically triggered. For face images that meet the quality standards, preprocessing operations including grayscale conversion, normalization, histogram equalization, and multi-stage enhancement filtering are performed sequentially to obtain preprocessed face images that meet the comparison criteria, which are then stored in the face feature standardization data model.

[0018] Fingerprint feature acquisition and processing: The fingerprint acquisition component is activated to acquire fingerprint images. Based on the principle of geometric feature matching, feature point extraction, filtering, clustering, distance calculation and direction vector analysis are performed on the fingerprint images. High-quality feature points with a quality score of not less than 0.6 and a number of feature points of not less than 12 are selected. A standardized fingerprint feature data model is constructed and stored.

[0019] If a failure occurs during face or fingerprint acquisition or processing, the exception handling component is triggered, and a standardized exception code is returned.

[0020] Step S3 performs standardized shooting, multi-dimensional quality detection and multi-stage preprocessing on the face image, and performs collection, feature point extraction, filtering and cluster analysis on the fingerprint features to obtain a face preprocessed image that meets the comparison standard and high-quality fingerprint feature point data, which are stored in the corresponding biometric data model to realize standardized collection and preprocessing of biometric features.

[0021] S4, local and cloud dual authentication

[0022] This step balances verification efficiency and authority, achieving dual-mode collaboration between local offline verification and cloud-based online verification, specifically including:

[0023] The system retrieves structured document information, preprocessed face images, and fingerprint feature point data from the data model layer and performs local offline feature comparison: face comparison uses a feature point matching algorithm, and passes if the matching score is not lower than a preset threshold; fingerprint comparison performs template alignment, core feature point search, and feature point matching, and passes if the preset distance, angle thresholds, and minimum number of matching feature points are met, and returns a standardized error code if the local comparison fails.

[0024] After the local comparison is successful, the data security processing flow is initiated: the encryption key is retrieved from the AndroidKeyStore secure storage, the sensitive data is encrypted using the AES-256-CBC algorithm, and the data hash value is generated using the HMAC-SHA256 algorithm to realize data integrity verification; a JWT authorization token containing user identifier and expiration time is generated and signed.

[0025] Through the configured network communication link, a verification request is sent to the cloud carrying encrypted data, data hash value and JWT authorization token. After the cloud completes data decryption, token verification, integrity verification and authoritative data comparison, it returns the encrypted verification result. The local machine decrypts the result to obtain the final identity verification result and stores it in the verification result model.

[0026] Step S4 first performs local offline feature comparison on the structured document information, preprocessed face image and fingerprint feature point data. After the local comparison is successful, high-strength encryption and integrity verification are performed on the sensitive data. The encrypted data is sent to the cloud with the authorization token to complete online authoritative verification, and the final identity verification result is obtained and stored, realizing dual verification of local and cloud.

[0027] S5. Results Feedback and Traceability Recording

[0028] The system retrieves the final verification result from the verification result model and displays a clear success / failure message to the user. If the verification fails, the system displays the corresponding standardized exception code and description information. The system caches the de-identified verification history information locally according to preset rules and synchronizes it to the cloud, enabling multi-condition querying and automatic expiration cleanup of verification history, and achieving result feedback and traceable records.

[0029] S6. Overall process coordination and anomaly control

[0030] The core scheduling component automates and schedules all verification steps, including adaptive permission verification, adaptive document chip reading, standardized biometric data collection and preprocessing, local and cloud-based dual verification, result feedback, and traceable recording. This ensures orderly linkage between functional modules and unified data flow. Abnormal situations at each stage are categorized and captured, matched with corresponding abnormal codes in a standardized abnormal code system (1001-1006), specifically including: 1001 - lack of necessary permissions, 1002 - document reading failure, 1003 - biometric data collection failure, 1004 - local biometric comparison failure, 1005 - online verification request failure, and 1006 - online verification process abnormality. This facilitates problem localization and troubleshooting. Abnormal information (including device information, abnormal time, abnormal step, and abnormal details) is recorded throughout the entire process and stored synchronously on both local and cloud platforms. This control logic ensures the orderliness and stability of the verification process, facilitating subsequent problem localization and troubleshooting.

[0031] Step S6 automates the connection and scheduling of all verification links, classifies and captures abnormal situations in each link, matches standardized abnormal codes, and records abnormal information throughout the entire link to obtain orderly and stable verification process results, thereby achieving overall scheduling and abnormal control of the entire process.

[0032] Furthermore, in the adaptive reading step of the document chip, the APDU instruction library is constructed as follows: Based on the ISO7816 standard framework, according to the communication rate, maximum data block length, and security verification requirements obtained from parsing the ATR response data of different document chips, custom APDU instructions adapted to each chip are dynamically generated. The custom APDU instructions include a data block length field adapted to the chip characteristics and a key verification field generated by the data security module. The custom APDU instructions are uniquely associated with the ATR response data of the corresponding chip and stored in the local instruction library to form an automatically matching APDU instruction library.

[0033] Furthermore, the configuration method for the network communication link in the local cloud dual authentication step is as follows: Build a network communication client based on the Retrofit+OkHttp framework, set unified connection, read, and write timeout thresholds and automatic request retry counts; add an SSL security verification interceptor and a full log interceptor to the network communication client to achieve custom certificate verification of the HTTPS communication link and full-link logging of network requests / responses; monitor the terminal network status in real time, and automatically switch to local offline verification mode when offline network is detected to ensure that the identity verification process is not interrupted.

[0034] Furthermore, in the result feedback and traceability record, the de-identified verification history information is cached locally according to preset rules and synchronized to the cloud, enabling multi-condition querying and automatic expiration cleanup of verification history. The method includes: using Android's built-in lightweight storage component to store the de-identified verification history information and encrypted biometric templates, adding timestamps to the stored data and setting preset validity periods and maximum storage quantities; when the stored data exceeds the preset validity period or maximum storage quantity, automatically performing expired data cleanup and reverse deletion of excess data, while synchronizing the verification history information to the cloud, enabling accurate multi-condition querying and traceability of verification history by document number, verification time, and verification result.

[0035] Correspondingly, the present invention also provides a gate system identity authentication device, applied to an Android terminal, which adopts a layered decoupled architecture, with each layer working together to achieve accurate identity verification. The device includes:

[0036] The core control layer includes an identity verification core scheduling controller, a result feedback component, and an exception handling component. The identity verification core scheduling controller treats the entire identity verification process, various components at the functional module layer, and various types of data at the data model layer as processing objects, performing overall scheduling, collaborative control, exception handling, and providing a unified interface for processing, thereby achieving efficient and orderly verification process management. The result feedback component is used to display verification results and exception information to users, achieving standardized output of results. The exception handling component is configured with a standardized exception code system, treating verification results and exceptions throughout the process as processing objects, performing feedback display, exception capture, and error coding processing, ensuring the stability and maintainability of the verification process.

[0037] The functional module layer includes an NFC document adaptive reading module, a biometric standardized processing module, a dual verification module, a data security module, a network communication module, and a permission and caching module. Each module is linked with the core control layer through a standardized interface to respectively realize document chip adaptive reading, biometric collection preprocessing, local and cloud dual verification, sensitive data security processing, stable and secure network communication, permission verification, and local traceable caching.

[0038] The data model layer includes multiple standardized data models that provide a structured definition of document information, biometric data, verification results, cloud request / response data, and verification history information throughout the entire identity verification process. It also constructs a unified data format to enable unified data transmission, storage, and interaction between the core control layer and the functional module layer.

[0039] The basic tools layer includes logging tools, global crash handling tools, application information tools, and application global entry components. It takes system operation logs, unhandled exceptions, application information, and component initialization as processing objects, and performs log recording, exception capture, information acquisition, and unified component initialization processing. It realizes full-link hierarchical logging, system global exception capture and user-friendly prompts, unified acquisition of device and application information, and unified initialization and status monitoring of components at each layer, thereby achieving auxiliary protection for stable system operation and supporting the normal operation of components at each layer.

[0040] Furthermore, the identity verification core scheduling controller in the core control layer provides a unified verification entry point to the outside world, and coordinates the entire process of adaptive permission verification, adaptive reading of document chips, standardized collection and preprocessing of biometric features, dual verification between local and cloud, result feedback and traceable recording. If any link fails, the exception handling component returns a standardized exception code and corresponding description information to achieve rapid problem location.

[0041] Furthermore, the NFC document adaptive reading module in the functional module layer includes an NFC communication component, an APDU instruction generation component, and a document data parsing component. Specifically: the NFC communication component supports ATR data acquisition and multi-rate communication adaptation, used to establish a communication connection with the document chip and acquire ATR response data; the APDU instruction generation component has a built-in automatically matching APDU instruction library, used to match and adapt APDU instructions based on the ATR response data and send them to the document chip; the document data parsing component is used to perform encoding parsing, code escaping, and data formatting processing on the read chip data to obtain structured document information.

[0042] Furthermore, the biometric standardization processing module in the functional module layer includes a face processing submodule and a fingerprint processing submodule. These submodules respectively implement standardized image capture, multi-dimensional quality detection, and multi-stage preprocessing for face images, as well as fingerprint feature acquisition, feature point extraction, and high-quality screening. The face processing submodule is implemented based on Google MLKit and uses a face feature point extraction algorithm as the processing method. It uses face images as the processing object to perform face presence detection, quality scoring, and multi-feature point extraction to ensure the accuracy and reliability of face comparison. The fingerprint processing submodule uses template alignment, core feature point search, and feature point matching as processing methods. It uses fingerprint feature templates and acquired fingerprint feature points as the processing object and obtains high-precision fingerprint comparison results by limiting the distance threshold of 15 pixels, the angle threshold of 20 degrees, and the minimum number of matching feature points of no less than 12.

[0043] Furthermore, the data security module in the functional module layer works in conjunction with the NFC document adaptive reading module and the dual verification module. For the custom APDU instructions requiring security verification in the NFC document adaptive reading module, the data security module retrieves the chip-specific key from the AndroidKeyStore and generates a verification code, injecting this verification code into the instruction body of the custom APDU instruction. The data security module performs AES-256-CBC encryption and HMAC-SHA256 integrity verification on sensitive data in the dual verification process, while simultaneously generating and signing a JWT authorization token. The JWT token contains core information such as user identifier and expiration time, ensuring the security of sensitive data during transmission and storage, and providing security protection for the transmission and storage of sensitive data in the dual verification process.

[0044] Furthermore, the network communication module in the functional module layer is built on the Retrofit and OkHttp framework and is configured with timeout control, automatic retry, SSL security verification and log interception mechanisms. It takes cloud communication requests and transmitted data as processing objects, performs request sending, response receiving, SSL security verification and log interception processing, realizes stable and secure network communication and real-time network status detection, supports automatic switching of offline mode, and obtains stable and secure local and cloud communication effects.

[0045] Furthermore, the permission and caching module of the functional module layer includes a permission management component and a local caching component. The permission management component takes the permission mechanism of different versions of the Android terminal as the processing object and performs adaptation processing. The local caching component serves as an auxiliary means, taking locally cached document information, fingerprint templates, and verification history as the processing object and performing batch cleaning and precise query processing.

[0046] Furthermore, the data model layer includes a document information model, a biometric model, a verification result model, a cloud communication model, and a verification record model. The document information model (IdentityCardData) stores the core information of the structured document. The biometric model (FaceFeature, FingerprintFeature) stores preprocessed face images and fingerprint feature point data. The verification result model (VerificationOutcome) stores the final result of local / cloud verification. The cloud communication model (IdentityVerificationRequest, IdentityVerificationReply) includes an identity verification request model and an identity verification response model, which are used to store the request and response data for cloud verification. The verification record model (VerificationRecord) stores the de-identified verification history information. Each core data model in the data model layer follows a unified data format specification. The document information model strictly adheres to the GA450-2013 resident document chip technical requirements, including all document fields such as name, document number, gender, ethnicity, date of birth, address, issuing authority, validity period, and Base64 image. The verification record model includes fields such as anonymized document information, verification result, matching score, and verification time, and supports multi-condition queries, facilitating security auditing and historical tracing at the camp.

[0047] Furthermore, the global crash handling tool in the basic tool layer uses an exception capture algorithm as the processing method to comprehensively capture unhandled exceptions during system operation, while recording crash logs (including device information, application information, and stack information) and displaying user-friendly prompts to prevent applications from crashing directly and improve the stability of device operation. The logging tool supports both console printing and local file recording modes, names log files by date, and automatically deletes logs that expire after 7 days, facilitating later troubleshooting and system optimization.

[0048] Beneficial effects of this invention:

[0049] By building an APDU instruction library that can automatically match, adaptive instruction matching and data reading for different types of ID card chips are achieved, solving the problem that existing technologies only support standardized instructions and fail to read niche chips, and adapting to all resident ID card chips that comply with national standards; at the same time, the permission module adapts to the permission mechanisms of different versions of Android, improving the compatibility of terminal devices.

[0050] A full-chain sensitive data security processing mechanism has been built, which securely retrieves keys from AndroidKeyStore, uses AES-256-CBC encryption and HMAC-SHA256 integrity verification to process sensitive data, and combines JWT authorization tokens and custom SSL certificate verification network communication links to effectively prevent data leakage, tampering and unauthorized access. In addition, the local cloud dual verification mechanism further enhances the authenticity and authority of identity verification.

[0051] It supports automatic switching between local offline verification and cloud online verification. Local verification can be completed quickly when the network is offline, meeting the high traffic requirements of the camp gate. The network communication module is equipped with timeout control and automatic retry mechanism. The core control layer realizes full-process abnormal management and standardized processing, avoiding process interruption or application crash, and improving verification efficiency and system stability.

[0052] A standardized verification history caching strategy was designed. Verification information is de-identified, cached locally, and synchronized to the cloud. It supports precise queries based on multiple conditions, and automatically cleans up expired information and deletes excess data. This not only protects user privacy but also facilitates security auditing and incident tracing at the camp.

[0053] The architecture adopts a layered and decoupled design, with clear responsibilities for each layer and modules linked through standardized interfaces. The core control layer is only responsible for process scheduling and does not participate in specific business implementation. When adding verification methods or upgrading core algorithms, only the corresponding functional modules need to be modified, without adjusting the entire process scheduling logic, which reduces maintenance costs and improves system scalability. Attached Figure Description

[0054] Figure 1 This is a flowchart of the identity authentication method for the gate system of the present invention;

[0055] Figure 2 This is a diagram illustrating the architecture of the identity authentication device for the gate system of the present invention. Detailed Implementation

[0056] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0057] Numerous specific details are set forth in the following description to provide a thorough understanding of the invention. The described embodiments are only a part of, and not all, of the embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

[0059] This invention provides a method and device for identity authentication in a camp gate system, applicable to smart terminals running Android 6.0 and above (equipped with NFC function, a front-facing camera with 5 megapixels or higher, a fingerprint recognition module, and ≥2GB of memory). It is primarily used in the scenario of verifying the identity of personnel entering and exiting the camp gate, enabling accurate verification of the identities of visitors and internal personnel.

[0060] Example 1: Identity Authentication Method for Entry System

[0061] The identity authentication method in this embodiment is based on the collaborative implementation of a layered and decoupled core control layer, functional module layer, and data model layer. The specific steps are as follows:

[0062] Step 1: Permission Verification

[0063] The identity verification application is launched, and the permission management component automatically scans the core permissions of the Android terminal. Core permissions include NFC permission, camera permission, fingerprint permission, network permission, and storage permission. For unauthorized permissions, a permission request pop-up window automatically appears, explaining the purpose of the permission to the user (e.g., "NFC permission is required to read resident ID card"), and the user's authorization result is processed centrally. If there are unauthorized but necessary permissions (such as NFC permission and camera permission), error code 1001 (necessary permission missing) is returned, prompting the user to authorize and restart the verification. If all core permissions have been authorized, a permission compliance verification result is obtained, and the process proceeds to the next step.

[0064] Step 2: NFC reading of ID card

[0065] The NFC communication component enables NFC monitoring mode. When the resident's ID card approaches the terminal's NFC sensing area, a connection is established with the ID card chip based on the ISO-DEP protocol and ISO7816 standard. A 5-second timeout is set; if the connection times out, it will automatically retry once. The APDU instruction generation component generates a standardized APDU instruction set and sequentially sends the main file selection instruction and the ID card application selection instruction to select the DG1 (core ID card information) and DG2 (photo information) data groups within the ID card chip, reading the data in blocks (256 bytes per block). The document data parsing component receives the raw byte data, parses it using GB2312 encoding, converts ethnic codes (such as "01") to their corresponding ethnic names (such as "Han"), and formats the raw birth date data (such as "19900101") as "1990-01-01". Finally, it parses the data to obtain a structured ID card data document information model containing information such as name, ID number, gender, ethnicity, date of birth, address, issuing authority, validity period, and Base64 image. This data is then synchronously stored in the data model layer, completing the document retrieval process. If a command sending failure or data parsing error occurs during the retrieval process, error code 1002 (document retrieval failed) is returned.

[0066] Step 3: Biometrics Collection and Processing

[0067] (1) Face processing: Start the CameraX camera component in AndroidJetpack, enable 1080P preview mode, guide the user to align with the viewfinder through the FacialCapture component, and capture a 4-megapixel face image; use a face detection tool (based on Google MLKit) to perform quality checks on the captured face image to determine the integrity of the image, including whether the face is complete, the sharpness (sharpness score ≥ 0.6), and the lighting (lighting uniformity ≥ 0.5). If the quality does not meet the standards, the shooting will be automatically retried, up to 3 times; if no high-resolution face image is captured after 3 attempts... If a high-quality face image is not acquired, error code 1003 (biometric information acquisition failed) is returned. If a high-quality face image is acquired, the face image processor preprocessing component performs multi-stage preprocessing, sequentially performing grayscale conversion (converting the color image to grayscale), normalization (normalizing pixel values ​​to the 0-1 range), histogram equalization (enhancing image contrast), and multi-stage enhancement filtering (removing image noise) to obtain a preprocessed face image that meets the comparison criteria, which is then stored in the face feature correlation model of the data model layer. At the same time, the face detection tool extracts face feature points, including eyes, nose, mouth, and facial contours, and performs quality scoring.

[0068] The facial feature point quality scoring method includes: scoring the detected key facial feature points separately for the eye region, nose region, mouth region, and overall face quality; the face preprocessing module obtains an eye quality score based on the visibility, clarity, and symmetry of the eye feature points; the face preprocessing module obtains a nose quality score based on the continuity, clarity, and occlusion status of the nose feature points; the face preprocessing module obtains a mouth quality score based on the completeness, opening and closing rationality, and lip line clarity of the mouth feature points; the face preprocessing module obtains a comprehensive face quality score based on facial pose, illumination uniformity, and overall occlusion; the face preprocessing module then performs a weighted fusion of the eye, nose, and mouth quality scores and the comprehensive face quality score. Specifically, the scoring for each item and the weighted fusion rules are as follows:

[0069] Eye Feature Point Quality Scoring: Scoring is conducted separately for each eye, with core dimensions including visibility, sharpness, and symmetry. Single-eye score = Visibility × 0.4 + Sharpness × 0.4 + Symmetry × 0.2; Binocular comprehensive score = (Left eye score + Right eye score) / 2. Visibility is determined by the occlusion ratio of key points in both eyes (≥80% visibility = 1.0 point, 60%–80% visibility = 0.8 points, 30%–60% visibility = 0.5 points, <30% visibility = 0 points); Sharpness is determined by the gradient value and edge intensity of the eye region (higher gradient value, higher score, maximum 1.0 point, minimum 0 points); Symmetry is determined by the height difference, width difference, and tilt angle difference between the left and right eyes (smaller difference, higher score, maximum 1.0 point, minimum 0 points).

[0070] Nose Feature Point Quality Score: The core dimensions include nasal bridge continuity, nasal tip clarity, and unobstructed state. The score = continuity × 0.3 + clarity × 0.4 + unobstructed state × 0.3. Continuity is determined by the coherence of key points on the nasal bridge (complete continuity scores 1.0, slight breaks score 0.7, severe breaks score 0); clarity is determined by the edge strength and contrast of the nasal tip area (sharper edges and higher contrast result in a higher score, with a maximum of 1.0 and a minimum of 0); unobstructed state is determined by the occlusion ratio of the nose (unobstructed state scores 1.0, slight occlusion scores 0.6, severe occlusion scores 0).

[0071] Mouth Feature Point Quality Score: The core dimensions include lip contour integrity, opening and closing rationality, and lip line clarity. The score = integrity × 0.4 + opening and closing rationality × 0.2 + clarity × 0.4. Integrity is determined by the detection of key points on the upper lip, lower lip, and corners of the mouth (1.0 point for complete detection, 0.6 points for partial detection, and 0 points for no detection); opening and closing rationality is determined by the degree of mouth opening (1.0 point for natural closure or slight opening, 0.7 points for moderate opening, and 0 points for excessive opening or abnormal closure); clarity is determined by the sharpness of the lip line edge (1.0 point for sharp edge, 0.6 points for slight blurring, and 0 points for severe blurring).

[0072] Overall facial quality score: The core dimensions include facial posture, lighting uniformity, and overall occlusion. The score = posture × 0.4 + lighting × 0.3 + no occlusion × 0.3. Among them, posture is judged based on yaw angle, pitch angle, and roll angle (angles within ±30° earn 1.0 point, ±30° to ±45° earn 0.6 points, and exceeding ±45° earn 0 points); lighting uniformity is judged based on the difference in brightness between the left and right sides of the face and the proportion of highlight / shadow area (small brightness difference, highlight / shadow area <10% earns 1.0 point, moderate brightness difference, highlight / shadow area 10% to 20% earns 0.7 points, large brightness difference, highlight / shadow area >20% earns 0 points); no occlusion is judged based on the occlusion ratio of cheeks, forehead, and chin (no occlusion earns 1.0 point, slight occlusion earns 0.6 points, and severe occlusion earns 0 points).

[0073] Overall quality score: The above four sub-scores are weighted and combined, and the formula is: Overall score = Eyes score × 0.35 + Nose score × 0.25 + Mouth score × 0.20 + Overall facial score × 0.20;

[0074] The scoring thresholds are set as follows: ≥0.70 is considered high quality and can proceed to the comparison; 0.50 to 0.70 is considered medium quality and can be retried once; <0.50 is considered low quality and will be rejected from the comparison.

[0075] (2) Fingerprint Processing: The fingerprint acquisition component is activated, guiding the user to press the fingerprint sensor to acquire a fingerprint image. The acquired fingerprint image is processed using the fingerprint feature toolkit. Based on the principle of geometric feature matching, fingerprint feature points (endpoints, bifurcation points, etc.) are extracted. The feature points are filtered (removing fuzzy feature points), clustered (clustered by location), distance calculated, and direction vector analyzed to select high-quality feature points with a quality score ≥ 0.6. A fingerprint feature model containing feature point coordinates, orientation angles, types, and quality scores is constructed and stored in the fingerprint feature model of the data model layer. If fingerprint acquisition fails or the number of feature points extracted is insufficient (less than 12), error code 1003 (biometric acquisition failed) is returned.

[0076] Step 4: Two-factor authentication

[0077] (1) Local offline comparison: The local verification component calls the face preprocessing image and fingerprint feature point data from the data model layer to perform face comparison and fingerprint comparison. The face comparison adopts the feature point matching algorithm to calculate the matching score between the collected face feature points and the face feature points associated with the certificate. If the score is ≥0.75, the face comparison is passed. The fingerprint comparison is performed by the fingerprint comparison component. First, the fingerprint feature template and the collected fingerprint feature points are rotated / translated (template alignment). Then, the core feature points are found and the distance between the feature points (≤15 pixels) and the difference in the direction angle (≤20 degrees) are calculated. If the number of matched feature points is ≥12, the fingerprint comparison is passed. If the face or fingerprint comparison fails, error code 1004 (local biometric comparison failed) is returned.

[0078] (2) Cloud-based online verification: After local comparison is successful, the data security manager initiates encryption processing, using the AES-256-CBC algorithm (following the NISTSP800-38D standard), to obtain a 256-bit strong random key and a 16-bit initialization vector from the Android keystore, encrypting sensitive data such as structured document information, pre-processed face images, and fingerprint feature point data; simultaneously, the HMAC-SHA256 algorithm is used to generate a data hash value for data integrity verification; the JWT token generation component generates a JWT authorization token containing the user identifier and expiration time (30 minutes), and performs signature processing on the token; the Retrofit network client is configured with a 30-second connection / read / write timeout, carrying the encryption... The system sends encrypted data, a data hash value, and a JWT token to the cloud via an authentication API. An SSL tool performs custom SSL certificate verification to prevent man-in-the-middle attacks. If the network request fails, error code 1005 (online verification request failed) is returned. If the cloud receives the request, it decrypts the data, verifies the token's validity, checks the data integrity, compares the information with the document information and biometric data in the cloud's authoritative database, completes the online verification, and returns an encrypted verification result. If an exception occurs during the cloud verification process, such as data decryption failure or an invalid token, error code 1006 (online verification process error) is returned. The local system receives the encrypted result from the cloud, decrypts it, obtains the final identity verification result, and synchronously stores it in the verification result model.

[0079] Step 5: Results Feedback and Recording

[0080] The final verification result is displayed to the user, indicating whether the verification was successful or failed. If it fails, the corresponding error code and description are displayed (e.g., "1004 - Local biometric matching failed, please re-collect biometric information"). The data decryption component performs final decryption and confirmation of the cloud verification result. The local data caching / storage component caches the verification history information to SharedPreferences. The verification history information includes the anonymized ID number, name, verification result, face / fingerprint matching score, and verification time. SharedPreferences is a lightweight local storage tool on the Android platform, which is essentially a key-value storage method based on XML files. The fingerprint template is encrypted and stored using Base64 encoding, and the ID information is associated with a timestamp. A 30-day automatic expiration and cleanup mechanism is set, and a maximum of 100 verification history records are retained, arranged in reverse chronological order. The cloud synchronization component synchronizes the verification history information to the cloud, realizing the synchronization of historical data between local and cloud. It supports multiple conditions for querying by ID number, verification time, verification result, etc., which facilitates security auditing and historical traceability.

[0081] Step 6: Full Process Control

[0082] The identity verification core scheduling controller provides a unified entry point for comprehensive verification to the outside world, and internally coordinates the entire process from steps 1 to 5 above, coordinating the collaborative work of various components to ensure orderly connection of each link; the anomaly handling component classifies and captures anomalies in the entire process (such as unauthorized permissions, document reading failure, biometric collection failure, etc.), records anomaly information (including device information, anomaly time, anomaly reason), and returns the corresponding error code; at the same time, it monitors the working status of each component in real time, and if a component anomaly occurs, it triggers a restart mechanism in a timely manner to improve verification efficiency and system stability.

[0083] Example 2: Gate System Identity Authentication Device

[0084] The identity authentication device in this embodiment is applied to an Android terminal and adopts a layered and decoupled architecture, including a core control layer, a functional module layer, a data model layer, and a basic tool layer. Each layer works collaboratively, and the specific structure is as follows:

[0085] 1. Core Control Layer

[0086] The core control layer is the central hub for the device's overall scheduling, primarily comprising the Identity Verification Controller, result feedback components, and exception handling components.

[0087] (1) Identity verification core scheduling controller: It provides a unified verification entry point for executing complete verification to the outside world and receives verification trigger instructions from upper layer applications; internally, it coordinates the processes of permission verification, document reading, biometric processing, dual verification, result feedback and recording, and manages the start / stop timing of modules and data flow paths; based on state machines and standardized interfaces, it realizes process automation, module decoupling, and anomaly controllability, coordinates the collaborative work of various components and data in the entire functional module layer and data model layer, and realizes the automated connection of each link;

[0088] (2) Result feedback component: Receives the verification results from the data model layer, displays clear verification prompts (success / failure) to the user, and synchronously displays error codes and descriptions to help the user understand the reasons for the anomalies;

[0089] (3) Anomaly Handling Component: Captures various anomalies throughout the entire process, classifies and defines error codes, and the specific anomalies and corresponding error codes are as follows: lack of necessary permissions corresponds to error code 1001, document reading failure corresponds to error code 1002, biometric information collection failure corresponds to error code 1003, local biometric feature comparison failure corresponds to error code 1004, online verification request failure corresponds to error code 1005, and online verification process anomaly corresponds to error code 1006. The anomaly handling component will record the occurrence time, equipment information, anomaly triggering link and specific cause of each type of anomaly in detail, forming a complete anomaly log, which is synchronously stored locally and in the cloud, so that technicians can quickly locate problems and troubleshoot faults in the future, and ensure the maintainability of the device operation.

[0090] The components of the core control layer work together, with the core scheduling component leading the entire process, the result feedback component responsible for information synchronization, and the exception handling component responsible for risk mitigation. The three work together to ensure the orderly and stable operation of the identity verification process, while providing data support for future system optimization.

[0091] 2. Functional Module Layer

[0092] The functional module layer, as the core business implementation layer, receives scheduling instructions from the core control layer. Through the collaborative work of various sub-modules, it completes core business tasks such as document reading, biometric processing, and data security. The specific implementation details of each sub-module are as follows:

[0093] (1) NFC Document Reading Module: This module includes an NFC communication component, an APDU instruction generation component, and a document data parsing component. The NFC communication component uses an enhanced version, supporting ATR acquisition and key adaptation functions, and can be adapted to different models of resident document chips, improving compatibility. During operation, the NFC communication component starts the listening mode. When the resident document is close to the terminal's NFC sensing area, it establishes a stable connection with the document chip based on the ISO-DEP protocol and ISO7816 standard, and sets a 5-second timeout control. If the connection times out, it will automatically retry once to avoid reading failure due to unstable connection. The APDU instruction generation component generates a standardized APDU instruction set and sends the main file selection, document application selection, data group selection, and reading instructions in sequence to accurately locate the core data area within the document chip and read the data in blocks (256 bytes per block) to ensure the integrity of the data reading. The document data parsing component receives the raw byte data, parses it using GB2312 encoding, converts the ethnic code into the corresponding ethnic name, formats the raw birth date data into the standardized format "YYYY-MM-DD", and performs Base64 decoding on the portrait information. Finally, it generates structured document information containing full information such as name, document number, gender, ethnicity, birth date, address, issuing authority, validity period, and portrait code, which is synchronously transmitted to the document information model in the data model layer for subsequent verification.

[0094] (2) Biometrics Processing Module: This module includes a face processing submodule and a fingerprint processing submodule, which work in parallel to complete the acquisition, preprocessing and feature extraction of face and fingerprint features, respectively, providing data support for dual verification. The face processing submodule includes a face acquisition component (FacialCapture), a face preprocessing component (FacialImageHandler), and a face detection tool (FaceDetectionTool): The face acquisition component guides the user to align the viewfinder, turn on the 1080P preview mode, and capture a 4-megapixel face image to ensure image clarity; the face detection tool is based on Google MLKit technology and performs integrity, clarity and illumination detection on the acquired face image. Images with a quality score lower than 0.6 will trigger automatic retry, with a maximum of 3 retries. If no qualified image is acquired after 3 retries, error code 1003 is triggered, indicating that biometric information acquisition has failed. The qualified face image undergoes multi-stage preprocessing by the face preprocessing component, which sequentially performs grayscale conversion, normalization, histogram equalization, and multi-stage enhancement filtering to remove image noise, enhance contrast, extract face feature points that meet the comparison criteria, and store them in the face feature model of the data model layer.

[0095] The fingerprint processing submodule includes a fingerprint acquisition component, a fingerprint feature toolkit, and a fingerprint comparison component. After the fingerprint acquisition component starts, it guides the user to press the terminal's fingerprint sensor to acquire a clear fingerprint image. If blurry fingerprints or improper pressing occur during acquisition, the user will be prompted to press again. The fingerprint feature toolkit, based on the principle of geometric feature matching, preprocesses the acquired fingerprint image, first removing image noise and enhancing fingerprint texture clarity, then extracting core fingerprint feature points (including endpoints, bifurcation points, isolated points, etc.) to improve fingerprint quality. The extracted feature points undergo filtering (removing blurry or highly interfering low-quality feature points), clustering (grouping by feature point location and orientation), distance calculation, and orientation vector analysis to select high-quality feature points with a quality score ≥ 0.6. Finally, a fingerprint feature model containing core parameters such as feature point coordinates, orientation angle, type, and quality score is constructed and synchronously stored in the fingerprint feature model of the data model layer to provide data support for subsequent comparison. The fingerprint comparison component preloads locally cached fingerprint templates or loads document-bound fingerprint templates associated with the data model layer. After feature extraction is completed, preliminary feature matching verification can be performed in advance to ensure that the fingerprint feature data meets the comparison standards.

[0096] (3) Data Security Module: This module takes the Data Security Manager as its core component and coordinates the security processing of sensitive data encryption, key management, authorization verification, etc. It is the core support for ensuring the security of identity verification data. Its workflow is as follows: First, the key management component prioritizes obtaining encryption keys from the Android Keystore (AndroidKeyStore) to avoid the risk of leakage caused by hard-coded key storage. If the corresponding key is not stored in the Android Keystore, a 256-bit strong random key is automatically generated and synchronously stored in the Android Keystore for secure management. Second, for sensitive data such as document information, pre-processed face images, and fingerprint feature point data, the AES-256-CBC encryption algorithm is used for encryption processing, and the NISTSP800-38D standard is strictly followed to generate a 16-bit initialization vector to ensure that sensitive data cannot be illegally parsed during transmission and storage. At the same time, the HMAC-SHA256 algorithm is used to generate a data hash value for the encrypted sensitive data to verify data integrity and prevent data from being tampered with during transmission. Finally, the JWT token generation component generates a JWT authorization token containing user identifier, terminal device information, and token expiration time (default 30 minutes), and performs token signing processing to ensure the validity and unforgeability of the token, providing identity authorization support for communication between local and cloud, and preventing unauthorized requests to access cloud verification interfaces.

[0097] (4) Network Communication Module: This module uses Retrofit and OkHttp as the core network clients, along with the IdentityApiService interface component and the SSLTool security component, to achieve stable and secure communication between the local terminal and the cloud server. Specific implementation details are as follows: The RetrofitNetworkClient network client is pre-configured with 30-second connection timeout, read timeout, and write timeout parameters to avoid communication failures due to network fluctuations. It also supports an automatic request retry mechanism (up to 2 retries) to improve communication success rate. The SSLTool security component is responsible for the security verification of the HTTPS communication link. Through a custom SSL certificate verification mechanism, it prevents security risks such as man-in-the-middle attacks and data hijacking, ensuring the security of the data transmission link between the local terminal and the cloud. The Identity Authentication API service interface component encapsulates the cloud RESTful API interface, uniformly handling the sending of cloud verification requests, the receiving and parsing of response data. It also works with the LogTool logging tool to intercept and record all network communication requests and response data in full, facilitating later network fault troubleshooting. Furthermore, the network communication module also supports offline status detection. If no network connection is detected on the terminal, it will promptly report back to the core control layer, triggering the local offline verification mode to ensure the identity verification process is not interrupted.

[0098] (5) Permissions and Caching Module: This module includes a permission management component (PermissionValidator / PermissionHandler) and a local caching component (LocalDataCache / LocalDataStorage), which are responsible for terminal permission adaptation and verification data caching management, respectively. The permission management component adapts to the permission mechanisms of different Android versions. For Android 10 and above, it simplifies storage permission management based on the Scoped Storage mechanism, eliminating the need to apply for full storage permissions and only requiring necessary cache storage permissions, thus improving the user experience. For Android 6.0-9.0, it strictly follows the system permission application specifications, automatically applying for core permissions such as NFC, camera, and fingerprint, and clearly explaining the purpose of the permissions to the user. The local caching component uses SharedPreferences as the cache storage medium, primarily caching anonymized document information, encrypted fingerprint templates, verification history, and other data. Fingerprint templates are stored after Base64 encoding encryption, further enhancing data security. Simultaneously, the caching component supports a data expiration cleanup mechanism, associating document information and fingerprint templates with timestamps and setting automatic expiration after 30 days. A maximum of 100 verification history records are retained, arranged in reverse chronological order; records exceeding this limit are automatically deleted. Furthermore, the caching component supports batch cleanup and precise query functions, allowing users to query verification history by document number, verification time, verification result, and other criteria, facilitating security audits and historical traceability at the camp.

[0099] 3. Data Model Layer

[0100] The data model layer, serving as the core data support for the entire device, defines various types of data throughout the identity verification process using standardized data model definition components. This constructs a unified data format, ensuring smooth and consistent data transmission between the core control layer and functional module layers, and preventing process anomalies caused by data corruption. In this embodiment, the core data models of the data model layer all adhere to a unified data format specification, as detailed below:

[0101] (1) ID Card Information Model (IdentityCardData): Strictly follows the technical requirements of GA450-2013 Resident ID Card Chip, including all ID card fields such as name, ID card number, gender, ethnicity, date of birth, address, issuing authority, validity period, and Base64 encoded portrait. The ethnicity field stores the ethnic name after escaping (e.g., "Han nationality"). The date of birth field adopts the standardized format "YYYY-MM-DD". The portrait information is stored using Base64 encoding, which is convenient for subsequent face comparison.

[0102] (2) The biometric model includes a face feature model (FaceFeature) and a fingerprint feature model (FingerprintFeature). The face feature model (FaceFeature) includes a set of facial feature point coordinates, feature point types (eyes / nose / mouth / facial contour feature points), quality scores for each region (eye score, nose score, mouth score, and overall facial score), overall quality score, hash value of the preprocessed face image, and acquisition timestamp, among other core fields. The overall quality score field is used to identify the overall clarity, completeness, symmetry, and lighting adaptability of the facial feature points, and selects those with an overall quality score ≥0.70. High-quality facial feature data is used for comparison, eliminating low-quality feature points caused by occlusion, blurring, or abnormal poses, ensuring the accuracy and stability of facial comparison from the data source level. This model is deeply integrated with the biometric standardization processing module, local verification component, and data security module: the facial processing submodule of the biometric standardization processing module writes the extracted feature point data and quality score results of each dimension into the model; the data security module performs AES-256-CBC encryption on the hash value of the preprocessed facial image and the core feature point data in the model and stores it locally, and generates an HMAC-SHA256 checksum and writes it into the model; the local verification component retrieves the encrypted feature point data and quality score results from the model, and only performs the feature point matching algorithm on high-quality feature data, realizing data support for the entire process of facial feature data extraction, quantification scoring, encrypted storage, and accurate comparison. At the same time, the collection timestamp field in the model can help verify historical traceability, and the hash value field is used to verify the integrity of facial image transmission and storage process to prevent data tampering.

[0103] The fingerprint feature model includes core fields such as feature point coordinates, orientation angle, feature point type (endpoints, bifurcation points, etc.), and quality score. The quality score field is used to identify the clarity of fingerprint feature points, and high-quality feature points are selected for comparison to ensure the accuracy of fingerprint comparison. This model works in conjunction with the biometric processing module, local verification component, and data security module to provide data support for the entire process of fingerprint feature data extraction, storage, encryption, and comparison.

[0104] (3) The Verification Outcome model includes fields such as whether the verification was successful, result description information, error code, face matching score, fingerprint matching score, and verification time. The error code field corresponds to the standardized error codes (1001-1006) defined by the exception handling component. If the verification fails, the specific reason for the failure will be shown to the user through the result description information field, providing data support for the result feedback component.

[0105] (4) The cloud communication model includes an identity verification request model (IdentityVerificationRequest) and an identity verification response model (IdentityVerificationReply). The identity verification request model contains fields such as encrypted sensitive data, data hash value, JWT authorization token, and terminal device information, which are used to carry data when the network communication module sends a verification request to the cloud. The identity verification response model contains fields such as encrypted verification result, result verification code, and cloud verification time, which are used to return the verification result from the cloud to the local terminal. The two work together to realize data interaction between the local terminal and the cloud.

[0106] (5) Verification Record Model: It includes fields such as desensitized ID number, name, verification result, face matching score, fingerprint matching score, verification time, and terminal device information. The ID number and name are desensitized (e.g., the middle 8 digits of the ID number are hidden, and the last 1 digit of the name is hidden) to protect user privacy. This model works in conjunction with the local caching module and the cloud synchronization component to realize the local caching and cloud synchronization of the verification history. It supports multi-condition queries and provides data support for camp security audit.

[0107] In addition, the data model layer also supports data format validation, which verifies the validity of field data in each model (such as ID number format validation and date format validation). If illegal data is detected, it will be promptly reported to the exception handling component of the core control layer and return the corresponding error message to avoid process abnormalities caused by illegal data and improve system stability.

[0108] 4. Basic Tools Layer

[0109] The basic tool layer serves as an auxiliary support layer, including the LogTool logging tool, the CrashHandlerTool global crash handling tool, the PackageInfoTool application information tool, and the IdentityApplication application global entry component. These tool components work together to provide auxiliary support for the normal operation of the upper core control layer, functional module layer, and data model layer, thereby improving the stability and maintainability of the device.

[0110] (1) LogTool: Supports both console printing and local file recording modes. The log content covers the entire process of permission verification, document reading, biometric processing, dual authentication, and network communication, and records the running status, data parameters, and abnormal information of each step in detail. The log files are named by date (e.g., "log_20260224.txt") and have a 7-day automatic expiration and cleanup mechanism to automatically delete expired log files, avoiding excessive use of terminal storage resources. At the same time, the log tool supports log hierarchical recording (debugging level, information level, and error level), which makes it easier for technicians to quickly locate problems and troubleshoot faults based on the log level, providing data support for system optimization.

[0111] (2) CrashHandlerTool Global Crash Handling Tool: Utilizes an exception capture algorithm to comprehensively capture unhandled exceptions (such as component exceptions, data parsing failures, network interruptions, etc.) during system operation, preventing applications from crashing directly and improving the stability of device operation; After capturing an exception, it automatically records a crash log, which includes device information (device model, Android version), application information (application version, package name), stack information, exception occurrence time, exception triggering link, etc., and stores it locally, and synchronizes it to the cloud when conditions permit; At the same time, it displays a friendly error message to the user (such as "The application has encountered a temporary exception, please try again"), guiding the user to restart the verification process and improving the user experience.

[0112] (3) PackageInfoTool: This tool is responsible for obtaining terminal device information and application running information, including device model, Android system version, application version number, package name, terminal NFC function status, camera parameters, fingerprint sensor status, etc., to provide data support for permission verification, component adaptation, and anomaly investigation. For example, in the permission verification stage, the application information tool obtains the Android system version to provide a basis for version adaptation of the permission management component. In the anomaly investigation stage, the device information provided by the application information tool can help technicians locate compatibility issues on different devices.

[0113] (4) IdentityApplication Global Entry Component: As the global entry point for the entire identity verification application, it is responsible for the unified initialization of each layer of components (such as core scheduling components, network clients, data models, security components, etc.) to ensure that each component can be loaded normally and work together after the application starts. At the same time, this component is responsible for maintaining the global context of the application, providing context support for each layer of components, and avoiding process abnormalities caused by component initialization failure. In addition, the global entry component also supports component status monitoring, monitors the running status of each core component in real time, and if a component abnormality is detected, it will trigger the restart mechanism in time and notify the exception handling component to record the exception information.

[0114] The camp gate system identity authentication device in this embodiment uses a four-layer architecture: a core control layer for overall scheduling, a functional module layer for core business implementation, a data model layer for data support, and a basic tool layer for stable operation. This architecture is decoupled and has clear responsibilities, enabling accurate, secure, and efficient verification of personnel identities at the camp gate. Furthermore, it integrates multiple security technologies, standardized anomaly handling, and standardized data management, effectively addressing the shortcomings of existing technologies. This makes it suitable for high-security, high-traffic personnel access verification scenarios at camp gates, facilitating future functional expansion and maintenance.

[0115] The Android terminal described in this embodiment is compatible with Android 6.0 and above. The terminal must be equipped with NFC, a front-facing camera with at least 5 megapixels, a fingerprint recognition module, and at least 2GB of memory to ensure all components function properly and meet the identity verification requirements. For terminals with different configurations, the operating parameters of each component (such as adjusting camera resolution and fingerprint collection sensitivity) can be adjusted using application information tools in the basic tool layer to achieve compatible operation and improve device compatibility.

[0116] It should be noted that the scope of protection of this invention is not limited to the specific embodiments described above. For those skilled in the art, appropriate adjustments can be made to the specific implementation details of some components (such as adjusting the threshold parameters for fingerprint comparison, optimizing the implementation of the encryption algorithm, adding other biometric verification sub-modules, etc.) without departing from the core technical solution of this invention. All such adjustments fall within the scope of protection of this invention.

[0117] For example, in the biometric processing module, an iris processing sub-module can be added to expand the iris verification function. In this case, only iris acquisition, preprocessing, and feature extraction-related components need to be added to the functional module layer, and an iris feature model needs to be added to the data model layer. There is no need to modify the scheduling logic of the core control layer and the core functions of other modules, which demonstrates the scalability advantage of the layered decoupled architecture of this invention. As another example, in the data security module, the encryption algorithm can be replaced with other high-strength encryption algorithms (such as RSA-2048). Only the encryption component implementation of the data security module needs to be modified, without affecting the normal operation of other layer components, thus adapting to the security requirements of different scenarios.

Claims

1. A gate system authentication method, applied to an Android terminal, characterized in that, This method, based on a layered decoupled architecture, enables collaborative scheduling and control of the entire identity verification process. The method includes: S1. Perform unified scanning and verification of the core permissions for camp identity verification on Android terminals. For unauthorized permissions, perform scenario-based automatic application and centrally process the authorization results. If there are unauthorized necessary permissions, return a standardized exception code. After the permissions are compliant, proceed to the next verification stage to achieve adaptive permission verification. S2. Obtain the ATR response data of the certificate chip through the NFC communication component, retrieve the pre-built APDU instruction library, match the APDU instruction that is compatible with the ATR response data and send it to the certificate chip, read the core data group in the chip in blocks and then perform encoding parsing, code escaping and data formatting processing to obtain structured certificate information and store it in a standardized data model to realize the adaptive reading of the certificate chip. S3. Perform standardized shooting, multi-dimensional quality detection and multi-stage preprocessing on face images, and perform collection, feature point extraction, filtering and cluster analysis on fingerprint features to obtain face preprocessed images and high-quality fingerprint feature point data that meet the comparison standards. These are stored in the corresponding biometric data models to realize standardized collection and preprocessing of biometric features. S4. Perform local offline feature comparison on structured document information, pre-processed face image and fingerprint feature point data. After the local comparison is successful, perform high-strength encryption and integrity verification on sensitive data. Send the encrypted data to the cloud with the authorization token to complete online authoritative verification, obtain the final identity verification result and store it, and realize dual verification of local and cloud. S5. After decrypting the cloud verification result, return a clear verification result and corresponding error code. Cache the desensitized verification history information locally according to preset rules and synchronize it to the cloud. Realize multi-condition query and automatic expiration cleanup of verification history, and realize result feedback and traceable record. S6. Automated connection and scheduling of all verification links, classification and capture of abnormal situations in each link, standardized abnormal code matching and full-link recording of abnormal information, to obtain orderly and stable verification process results, and realize overall scheduling and abnormal control of the whole process.

2. The gate system identity authentication method according to claim 1, characterized in that, In the adaptive reading of the document chip, the pre-built APDU instruction library includes: based on the ISO7816 standard framework, according to the communication rate, maximum data block length and security verification requirements obtained by parsing the ATR response data of different document chips, custom APDU instructions adapted to each chip are dynamically generated. The custom APDU instructions include a data block length field adapted to the chip characteristics and a key verification field generated by the data security module. The custom APDU instructions are uniquely associated with the ATR response data of the corresponding chip and stored in the local instruction library to form an automatically matching APDU instruction library.

3. The gate system identity authentication method according to claim 1, characterized in that, In the standardized acquisition and preprocessing of biometric features, the multi-stage preprocessing of face images includes grayscale conversion, normalization, histogram equalization, and multi-stage enhancement filtering operations performed sequentially. The extraction and processing of fingerprint feature points are based on the principle of geometric feature matching, performing feature point filtering, clustering, distance calculation, and direction vector analysis to select feature points with a quality score not lower than a preset threshold, and the number of matched feature points is not lower than a preset number.

4. The gate system identity authentication method according to claim 1, characterized in that, In the dual local and cloud verification process, sensitive data undergoes high-strength encryption and integrity verification. The encrypted data, carrying an authorization token, is sent to the cloud for online authoritative verification. This method includes: retrieving the encryption key from the AndroidKeyStore secure storage; encrypting the sensitive data using the AES-256-CBC algorithm; simultaneously generating a data hash value using the HMAC-SHA256 algorithm to verify data integrity; generating a JWT authorization token containing the user identifier and expiration time and performing signature processing; and sending a verification request to the cloud via a network communication link configured with a custom SSL certificate verification, carrying the encrypted data, data hash value, and JWT authorization token.

5. The gate system identity authentication method according to claim 1, characterized in that, In the result feedback and traceability record, the desensitized verification history information is cached locally according to preset rules and synchronized to the cloud, enabling multi-condition querying and automatic expiration cleanup of verification history. The method includes: using Android's built-in lightweight storage component to store the desensitized verification history information and encrypted biometric templates, adding timestamps to the stored data and setting preset validity periods and maximum storage quantities; when the stored data exceeds the preset validity period or maximum storage quantity, automatically performing expired data cleanup and reverse deletion of excess data, while synchronizing the verification history information to the cloud, enabling accurate querying and traceability of verification history based on multiple conditions such as document number, verification time, and verification result.

6. A gate system identity authentication device, applied to an Android terminal, characterized in that, The device adopts a layered decoupled architecture, with each layer working together to achieve accurate identity verification. The device includes: The core control layer includes an identity verification core scheduling controller, a result feedback component, and an exception handling component. The identity verification core scheduling controller treats the entire identity verification process, various components at the functional module layer, and various types of data at the data model layer as processing objects, performing overall scheduling, collaborative control, exception handling, and providing a unified interface for processing, thereby achieving efficient and orderly verification process management. The result feedback component is used to display verification results and exception information to users, achieving standardized output of results. The exception handling component is configured with a standardized exception code system, treating verification results and exceptions throughout the process as processing objects, performing feedback display, exception capture, and error coding processing, ensuring the stability and maintainability of the verification process. The functional module layer includes an NFC document adaptive reading module, a biometric standardized processing module, a dual verification module, a data security module, a network communication module, and a permission and caching module. Each module is linked with the core control layer through a standardized interface to respectively realize document chip adaptive reading, biometric collection preprocessing, local and cloud dual verification, sensitive data security processing, stable and secure network communication, permission verification, and local traceable caching. The data model layer includes multiple standardized data models that provide a structured definition of document information, biometric data, verification results, cloud request / response data, and verification history information throughout the entire identity verification process. It also constructs a unified data format to enable unified data transmission, storage, and interaction between the core control layer and the functional module layer. The basic tools layer includes logging tools, global crash handling tools, application information tools, and application global entry components, which respectively realize the hierarchical recording of logs across the entire chain, the capture and friendly prompts of system global anomalies, the unified acquisition of device and application information, and the unified initialization and status monitoring of components at each layer.

7. The gate system identity authentication device according to claim 6, characterized in that, The identity verification core scheduling controller in the core control layer provides a unified verification entry point to the outside world. Internally, it coordinates the entire process of adaptive permission verification, adaptive reading of document chips, standardized collection and preprocessing of biometric features, dual verification between local and cloud, result feedback and traceable recording. If any link fails, the exception handling component returns a standardized exception code and corresponding description information to achieve rapid problem location.

8. The gate system identity authentication device according to claim 6, characterized in that, The NFC document adaptive reading module in the functional module layer includes an NFC communication component, an APDU instruction generation component, and a document data parsing component. The NFC communication component supports ATR data acquisition and multi-rate communication adaptation, and is used to establish a communication connection with the document chip and acquire ATR response data. The APDU instruction generation component has a built-in automatically matching APDU instruction library, used to match and adapt APDU instructions based on the ATR response data and send them to the document chip. The document data parsing component is used to perform encoding parsing, code escaping, and data formatting processing on the read chip data to obtain structured document information.

9. The gate system identity authentication device according to claim 6, characterized in that, The data security module in the functional module layer works in conjunction with the NFC document adaptive reading module and the dual authentication module. For the custom APDU instructions that require security verification in the NFC document adaptive reading module, the data security module retrieves the chip-specific key from the Android key library and generates a verification code, which is then injected into the instruction body of the custom APDU instruction. The data security module performs AES-256-CBC encryption and HMAC-SHA256 integrity verification on sensitive data in the dual authentication process, and generates and signs a JWT authorization token to ensure the security of the transmission and storage of sensitive data in the dual authentication process.

10. The gate system identity authentication device according to claim 6, characterized in that, The permission and caching module of the functional module layer includes a permission management component and a local caching component. The permission management component takes the permission mechanism of different versions of Android terminals as the processing object and performs adaptation processing. The local caching component serves as an auxiliary means to take locally cached document information, fingerprint templates, and verification history as the processing objects and perform batch cleaning and precise query processing.