Fingerprint instrument SDK calling method and terminal

By dynamically loading the configuration files and library files of the fingerprint scanner SDK, the multi-brand fingerprint scanner SDK adaptation and class duplication problems are solved, and fingerprint scanner function management is realized without recompiling the host application, which improves the reuse rate and development flexibility and reduces maintenance costs.

CN120045238APending Publication Date: 2025-05-27FUJIAN CENTM INFORMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411919966.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

During the application development process, fingerprint printer SDKs of multiple brands need to be adapted, and SDKs of the same brand may have class duplication problems, resulting in compilation errors, and traditional methods require recompilation of the host application, which is very cost-effective.

Method used

By reading the main configuration file, selecting the fingerprint scanner configuration, and reading the corresponding configuration file, dynamically loading the dynamic library and executable files, the flexible configuration and management of the fingerprint scanner function is realized, and the host application can be avoided recompiling.

Benefits of technology

Improves the reuse rate and development flexibility of the fingerprint scanner SDK, reduces maintenance costs and the risk of compilation errors, and ensures system stability and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045238A_ABST
    Figure CN120045238A_ABST
Patent Text Reader

Abstract

The invention discloses a fingerprint instrument SDK calling method and a terminal, and the method comprises the steps: starting a host application, reading a main configuration file, selecting fingerprint instrument configuration according to the main configuration file, and reading a related configuration file; enumerating the mounting condition of the fingerprint instrument according to the product identification code and the supplier identification code, if the mounting succeeds, acquiring and copying the dynamic library to a host application dynamic library according to a directory pointed by a related configuration file, loading a private directory, loading the copied dynamic library to the host application, and if the loading succeeds, loading the private directory to the host application dynamic library. If yes, reading the executable file protection package according to a resource directory configured by the fingerprint instrument, and decrypting the executable file protection package to obtain an executable file; according to the method, the fingerprint instrument implementation class in the executable file is subjected to instantiation operation, so that loading of the external dynamic library and the executable file is completed, when feature collection is initiated on an upper layer, the instantiation class is used for hardware calling to complete a collection function, a host application does not need to be recompiled, and the reuse rate of the integrated fingerprint instrument SDK is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and particularly relates to a method for calling a fingerprint reader SDK and a terminal. Background Art

[0002] As a biometric device, a fingerprint reader has been widely used in multiple scenarios, such as attendance management, fingerprint login and payment on mobile phones, teller login and authorization in bank business handling, etc. In these applications, the system first needs to pre-enter the fingerprint template of the user, and during actual operation, it collects finger features and compares them with the pre-stored template to complete identity verification and transaction confirmation. Many fingerprint readers are integrated into devices with the Android system. However, there are multiple brands of fingerprint readers on the market, and each brand has a corresponding SDK (Software Development Kit). The processing and return formats of fingerprint data may vary in different application scenarios. Even for fingerprint readers of the same brand, their SDKs may also be different. Therefore, during the application development process, not only do we need to adapt to the SDKs of multiple brands of fingerprint readers, but we also need to deal with the compilation error problems caused by possible duplication of SDK classes of the same brand.

[0003] The traditional solution is to directly integrate the fingerprint reader SDK into the Android host application, encapsulate the relevant functions, and recompile the entire application every time a new SDK is connected. Although this method is simple and direct, it has significant disadvantages: every time a new SDK is connected, the host application needs to be recompiled, and it may not be able to compile successfully due to the duplication of SDK classes of the same brand of fingerprint reader, and it is necessary to coordinate with the fingerprint reader manufacturer to modify the SDK. Therefore, there is an urgent need for a method for calling a fingerprint reader SDK and a terminal that can solve the above problems. Summary of the Invention

[0004] The technical problem to be solved by the present invention is: to provide a method for calling a fingerprint reader SDK and a terminal, which can flexibly add new fingerprint readers without recompiling the host application, improve the reuse rate of integrating the fingerprint reader SDK, and reduce the maintenance cost.

[0005] In order to solve the above technical problem, the technical solution adopted by the present invention is: A method for calling a fingerprint reader SDK, comprising the steps of: S1. In response to a fingerprint reader function call request, start the host application and read the main configuration file, select the fingerprint reader configuration according to the main configuration file, and read the corresponding fingerprint reader configuration file, where the fingerprint reader configuration file includes a resource directory, a product identification code, and a vendor identification code; S2. Enumerate the mounting status of the fingerprint reader according to the product identification code and the supplier identification code. When the mounting is successful, obtain and copy the dynamic library to the private directory for loading dynamic libraries of the host application according to the resource directory, load the copied dynamic library into the host application. When the loading is successful, read the executable file protection package according to the resource directory and decrypt the executable file protection package to obtain the executable file; S3. Instantiate the fingerprint reader implementation class in the executable file, and use the instantiated class to call the hardware to complete the acquisition function when initiating feature acquisition at the upper layer.

[0006] To solve the above technical problems, another technical solution adopted by the present invention is: A calling terminal for a fingerprint reader SDK includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned calling method for a fingerprint reader SDK is implemented.

[0007] The beneficial effects of the present invention are as follows: The calling method and terminal for a fingerprint reader SDK provided by the present invention realize dynamic configuration management by reading the main configuration file and selecting the fingerprint reader and its configuration file according to the main configuration file, can flexibly adjust the fingerprint reader configuration according to different requirements or environments, and improve the flexibility and scalability of fingerprint reader function development; enumerate the mounting status of the fingerprint reader according to the product identification code and the supplier identification code, determine the connection status of the fingerprint reader, improve the stability and security of the system, obtain and copy the dynamic library to the private directory for loading dynamic libraries of the host application according to the resource directory, load the copied dynamic library into the host application, can update or replace the fingerprint reader function without modifying the host application, which is convenient for maintenance and upgrade, decrypt the executable file protection package to ensure that only legitimate executable files will be loaded and executed, and improve data security; realize the actual call of the fingerprint reader function by instantiating the fingerprint reader implementation class in the executable file, and read the user fingerprint features to ensure that the system can identify and use the correct fingerprint reader, and improve the reliability and security of the system. Description of the Drawings

[0008] Figure 1 It is a flowchart of a calling method for a fingerprint reader SDK according to an embodiment of the present invention; Figure 2 It is a schematic diagram of a calling terminal for a fingerprint reader SDK according to an embodiment of the present invention; Figure 3 It is an architecture diagram of a calling method for a fingerprint reader SDK according to an embodiment of the present invention; Figure 4 It is a fingerprint reader SDK calling flowchart of a calling method for a fingerprint reader SDK according to an embodiment of the present invention; Description of Reference Numerals: 1. A calling terminal for a fingerprint reader SDK; 2. A memory; 3. A processor. Specific Embodiment

[0009] To describe in detail the technical content, achieved objectives and effects of the present invention, the following is described in conjunction with the embodiments and with reference to the accompanying drawings.

[0010] Please refer to Figure 1 , the embodiment of the present invention provides a method for calling a fingerprint reader SDK, including the steps: S1. In response to a fingerprint reader function call request, start the host application and read the main configuration file, select the fingerprint reader configuration according to the main configuration file, and read the corresponding fingerprint reader configuration file, where the fingerprint reader configuration file includes a resource directory, a product identification code, and a vendor identification code; S2. Enumerate the mounting status of the fingerprint reader according to the product identification code and the vendor identification code. When the mounting is successful, obtain and copy the dynamic library to the private directory for loading the dynamic library of the host application according to the resource directory, load the copied dynamic library into the host application. When the loading is successful, read the executable file protection package according to the resource directory and decrypt the executable file protection package to obtain an executable file; S3. Instantiate the fingerprint reader implementation class in the executable file, and use the instantiated class to perform hardware calls to complete the acquisition function when initiating feature acquisition at the upper layer.

[0011] As can be seen from the above description, the beneficial effects of the present invention are as follows: By reading the main configuration file and selecting the fingerprint reader and its configuration file according to the main configuration file, dynamic configuration management is realized, and the fingerprint reader configuration can be flexibly adjusted according to different requirements or environments, improving the flexibility and scalability of fingerprint reader function development; Enumerating the mounting status of the fingerprint reader according to the product identification code and the vendor identification code to determine the connection status of the fingerprint reader, improving the stability and security of the system. Obtaining and copying the dynamic library to the private directory for loading the dynamic library of the host application according to the resource directory, and loading the copied dynamic library into the host application, can update or replace the fingerprint reader function without modifying the host application, facilitating maintenance and upgrade. Decrypting the executable file protection package to ensure that only legitimate executable files will be loaded and executed, improving data security; By instantiating the fingerprint reader implementation class in the executable file, the actual call of the fingerprint reader function is realized, and the user fingerprint features are read to ensure that the system can identify and use the correct fingerprint reader, improving the reliability and security of the system.

[0012] Further, before the step S1, it further includes: Define a fingerprint sensor acquisition protocol class according to the fingerprint sensor function of the host application. During the fingerprint sensor integration process, define and compile a fingerprint sensor implementation class to obtain an executable file. The fingerprint sensor implementation class inherits the fingerprint sensor acquisition protocol class; Encrypt the executable file to generate an executable file protection package, and store the executable file protection package and the dynamic library of the fingerprint sensor software development kit in the directory of the Android device.

[0013] As can be seen from the above description, by defining and compiling a fingerprint sensor implementation class that inherits the fingerprint sensor acquisition protocol class to generate an executable file, it is possible to standardize the data acquisition methods of different fingerprint sensor hardware, ensure the scalability and compatibility of the fingerprint sensor functions; encrypt the executable file to generate an executable file protection package, improve software security, and store the executable file protection package and the dynamic library of the fingerprint sensor software development kit in the directory of the Android device, simplifying the deployment process and facilitating the management and update of development-related files.

[0014] Further, encrypting the executable file to generate an executable file protection package includes: Generate the public and private keys of the first encryption algorithm, generate an encrypted digital certificate according to the key in the first encryption algorithm, and build the encrypted digital certificate into the Android device; Concatenate the product identification code of the fingerprint sensor and the full path of the fingerprint sensor implementation class into a first byte array, use the first preset length of bytes of the first byte array as the first random number, concatenate the package name of the host application and the full path of the fingerprint sensor acquisition protocol class into a second byte array, use the first preset length of bytes of the second byte array as the second random number, generate a shared key using the key exchange algorithm according to the first random number and the second random number, and use the shared key as the encryption key; Encrypt the executable file using the second encryption algorithm to generate an encrypted executable file, sign the encrypted executable file using the encrypted digital certificate, and add a custom file protocol declaration, version number, compilation time, and the signature result of the first encryption algorithm to the header of the encrypted executable file to generate an executable file protection package.

[0015] As can be seen from the above description, by generating the public and private keys of the first encryption algorithm, the security and integrity of the data are ensured, and the encrypted digital certificate generated based on the private key of the first encryption algorithm is built into the Android device to enhance the security verification ability of the system and avoid being attacked; the product identification code of the fingerprint reader and the host application package name are respectively spliced with the corresponding class paths into byte arrays, a preset number of bytes are extracted from these two byte arrays as random numbers, and a shared key is generated based on the random numbers using the key exchange algorithm, making the generated shared key random and unpredictable, enhancing data security; the executable file is encrypted using the second encryption algorithm to prevent unauthorized access and tampering, and the encrypted digital certificate is used to sign the encrypted executable file to facilitate determining the integrity of the encrypted executable file through signature verification.

[0016] Further, decrypting the executable file protection package to obtain the executable file includes: Reading the header of the executable file protection package, matching the custom file protocol statement, taking the version number and compilation time in the header as the return value of the software development kit version number interface, and performing encrypted signature verification on the file content of the executable file protection package using the encrypted digital certificate built into the Android device; If the verification passes, decrypt the file content of the executable file protection package using the encryption key to obtain the executable file. If the verification fails, return that the signature verification of the executable file protection package of the fingerprint reader fails.

[0017] As can be seen from the above description, by reading the header information from the executable file protection package and matching the custom file protocol statement, the correctness of data reading is ensured, and the version number and compilation time in the header are used as the return value of the software development kit version number interface to facilitate tracking and managing different fingerprint readers and improve the maintainability of the fingerprint reader. The file content of the executable file protection package is encrypted and verified using the encrypted digital certificate built into the Android device to confirm the integrity of the file content; if the signature verification passes, decrypt the file content of the executable file protection package using the encryption key to obtain the executable file so that the executable file can run normally on the device. If the signature verification fails, return that the signature verification of the executable file protection package of the fingerprint reader fails, promptly inform the error message, and prevent potential security risks.

[0018] Further, the step S2 further includes: Enumerate the mounting status of the fingerprint reader according to the product identification code and the vendor identification code. When the mounting is not successful, return that the fingerprint reader is not connected; Load the copied dynamic library into the host application. When the loading fails, return that the fingerprint reader dynamic library loading fails.

[0019] As described above, the connection status of the fingerprint reader is accurately detected through the product identification code and the supplier identification code. In the case of unsuccessful mounting, an error message is returned in a timely manner, facilitating fault troubleshooting and repair during development; the copied dynamic library is loaded into the host application, simplifying the device deployment process. When the loading fails, an error message is returned in a timely manner to ensure the stability and security of the host application.

[0020] Please refer to Figure 2 , Another embodiment of the present invention provides a calling terminal for a fingerprint reader SDK, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned calling method for a fingerprint reader SDK is implemented.

[0021] The above-mentioned calling method and terminal for a fingerprint reader SDK of the present invention are applicable to the fingerprint reader integration scenario, improving the reuse rate of the integrated fingerprint reader SDK and reducing the maintenance cost, thereby realizing the scalability of fingerprint reader function development. The following is illustrated by specific embodiments: Please refer to Figure 1 and Figure 3 , Embodiment 1 of the present invention is: A calling method for a fingerprint reader SDK, including the steps of: S1. In response to a fingerprint reader function call request, start the host application and read the main configuration file, select the fingerprint reader configuration according to the main configuration file, and read the corresponding fingerprint reader configuration file. The fingerprint reader configuration file includes a resource directory, a product identification code, and a supplier identification code.

[0022] In this embodiment, by reading the main configuration file and selecting the fingerprint reader according to the main configuration file, and reading the corresponding fingerprint reader configuration file, the fingerprint reader configuration file describes the full path of the fingerprint reader implementation class, the resource directory for placing the dynamic library, the product identification code and the supplier identification code of the fingerprint reader, and a string of custom English identification codes returned by the fingerprint reader. The English identification code is used to return information that can be used to expand and identify the fingerprint reader model and other purposes when calling the fingerprint reader function, realizing dynamic configuration management, and being able to flexibly adjust the fingerprint reader configuration according to different requirements or environments, improving the flexibility and scalability of fingerprint reader function development. For example, taking the requirements of bank counter business as an example, different banks may use different fingerprint reader brands and have different requirements for the returned feature formats. Considering this situation, there are multiple fingerprint reader configurations in the fingerprint reader list supported by the main configuration file to provide front-end users with options or to select a certain fingerprint reader configuration to meet the requirements when publishing the application.

[0023] Further, in this embodiment, before the step S1, it further includes: defining a fingerprint sensor acquisition protocol class according to the fingerprint sensor function of the host application, defining and compiling a fingerprint sensor implementation class during the fingerprint sensor integration process to obtain an executable file, where the fingerprint sensor implementation class inherits the fingerprint sensor acquisition protocol class, and the fingerprint sensor acquisition protocol class includes an acquisition template, features, comparison, cancellation, a fingerprint sensor identification code, and an SDK version number; encrypting the executable file to generate an executable file protection package, and storing the executable file protection package and the dynamic library of the fingerprint sensor software development kit in the directory of the Android device. By defining and compiling a fingerprint sensor implementation class that inherits the fingerprint sensor acquisition class to generate an executable file, it is possible to standardize the data acquisition methods of different fingerprint sensor hardware, ensure the scalability and compatibility of the fingerprint sensor function, encrypt the executable file to generate an executable file protection package, improve software security, store the executable file protection package and the dynamic library of the fingerprint sensor software development kit in the directory of the Android device, simplify the deployment process, and help manage and update development-related files.

[0024] Further, in this embodiment, the executable file is encrypted to generate an executable file protection package, including: generating public and private keys of a first encryption algorithm, generating an encrypted digital certificate according to the key in the first encryption algorithm, and embedding the encrypted digital certificate into the Android device; concatenating the product identification code of the fingerprint scanner with the full path of the fingerprint scanner implementation class to form a first byte array, taking the first preset length of bytes of the first byte array as a first random number, concatenating the package name of the host application with the full path of the fingerprint scanner acquisition protocol class to form a second byte array, taking the first preset length of bytes of the second byte array as a second random number, generating a shared key using a key exchange algorithm according to the first random number and the second random number, and using the shared key as the encryption key; encrypting the executable file using a second encryption algorithm to generate an encrypted executable file, signing the encrypted executable file using the encrypted digital certificate, and adding a custom file protocol declaration, version number, compilation time, and the signature result of the first encryption algorithm to the header of the encrypted executable file to generate an executable file protection package. By generating public and private keys of the first encryption algorithm, the security and integrity of the data are ensured, and the encrypted digital certificate generated according to the private key of the first encryption algorithm is embedded into the Android device to enhance the security verification ability of the system and avoid being attacked; concatenating the product identification code of the fingerprint scanner and the package name of the host application with the corresponding class paths respectively to form byte arrays, extracting a preset number of bytes from these two byte arrays as random numbers, and generating a shared key using a key exchange algorithm based on the random numbers, so that the generated shared key has randomness and unpredictability, enhancing data security; encrypting the executable file using the second encryption algorithm to prevent unauthorized access and tampering, and signing the encrypted executable file using the encrypted digital certificate to facilitate determining the integrity of the encrypted executable file by verifying the signature. Among them, the first encryption algorithm is preferably the national cryptography algorithm SM2, the second encryption algorithm is preferably the national cryptography algorithm SM4, the first preset length of bytes is preferably 16 bytes (padding with 0 if the length is insufficient), taking the first random number and the second random number as the input parameters of the key exchange algorithm, the key exchange algorithm generates a shared key, and uses the shared key as the encryption key. A prime number and a base number required in the key algorithm are agreed upon by both parties during generation, that is, the encryption stage and the decryption stage.

[0025] S2. Enumerate the mounting status of the fingerprint scanner according to the product identification code and the vendor identification code. When the mounting is successful, obtain and copy the dynamic library from the resource directory to the private directory for loading the dynamic library of the host application, load the copied dynamic library into the host application. When the loading is successful, read the executable file protection package from the resource directory and decrypt the executable file protection package to obtain the executable file.

[0026] In this embodiment, please refer to Figure 4 ,Figure 4 The fingerprint reader SDK call flow chart of a fingerprint reader SDK call method according to an embodiment of the present invention enumerates the mounting status of the fingerprint reader through a product identification code and a vendor identification code, determines the connection status of the fingerprint reader, improves the stability and security of the system, obtains and copies the dynamic library to the private directory of the host application's dynamic library loading according to the resource directory, loads the copied dynamic library into the host application, can update or replace the fingerprint reader function without modifying the host application, is convenient for maintenance and upgrade, decrypts the executable file protection package to ensure that only legitimate executable files will be loaded and executed, and improves data security.

[0027] Further, in this embodiment, the step S2 further includes: enumerating the mounting status of the fingerprint reader according to the product identification code and the vendor identification code, and when the mounting fails, returning that the fingerprint reader is not connected; loading the copied dynamic library into the host application, and when the loading fails, returning that the fingerprint reader dynamic library loading fails, timely feedback the mounting status of the fingerprint reader and the loading status of the dynamic library, which is convenient for development to troubleshoot and repair faults, and ensures the stability and security of the host application.

[0028] Further, in this embodiment, decrypting the executable file protection package to obtain an executable file includes: reading the header of the executable file protection package, matching the custom file protocol declaration to ensure the correctness of data reading, using the version number and compilation time in the header as the return value of the software development kit version number interface, which is convenient for tracking and managing different fingerprint readers, improves the maintainability of the fingerprint reader, and encrypts and verifies the signature of the file content of the executable file protection package using the built-in encryption digital certificate of the Android device to confirm the integrity of the file content; if the verification passes, decrypt the file content of the executable file protection package using the encryption key to obtain an executable file so that the executable file can run normally on the device, and if the signature verification fails, return that the executable file protection package signature verification of the fingerprint reader fails, timely inform the error message, and prevent potential security risks.

[0029] S3. Instantiate the fingerprint reader implementation class in the executable file, and use the instantiated class to perform hardware calls to complete the acquisition function when initiating feature acquisition at the upper layer.

[0030] In this embodiment, by instantiating the fingerprint reader implementation class in the executable file, the actual call of the fingerprint reader function is realized, and the user fingerprint feature is read to ensure that the system can identify and use the correct fingerprint reader, improving the reliability and security of the system.

[0031] Please refer to Figure 2, Embodiment 2 of the present invention is as follows: A calling terminal 1 of a fingerprint sensor SDK, including a memory 2, a processor 3, and a computer program stored on the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, each step of the calling method of the fingerprint sensor SDK in Embodiment 1 is implemented.

[0032] In summary, a method for invoking a fingerprint SDK and a terminal provided by the present invention define a fingerprint acquisition protocol class according to the fingerprint function of the host application, define and compile a fingerprint implementation class during the fingerprint integration process to obtain an executable file. The fingerprint implementation class inherits the fingerprint acquisition protocol class, which can standardize the data acquisition methods of different fingerprint hardware, ensure the scalability and compatibility of the fingerprint function, and encrypt the executable file to generate an executable file protection package, including: generating public and private keys of a first encryption algorithm, generating an encrypted digital certificate according to the key in the first encryption algorithm, and embedding the encrypted digital certificate into the Android device to enhance the security verification ability of the system; concatenating the product identification code of the fingerprint device with the full path of the fingerprint implementation class to form a first byte array, taking the first preset length of bytes of the first byte array as a first random number, concatenating the package name of the host application with the full path of the fingerprint acquisition protocol class to form a second byte array, taking the first preset length of bytes of the second byte array as a second random number, generating a shared key using a key exchange algorithm based on the first random number and the second random number, and using the shared key as an encryption key. By concatenating the product identification code of the fingerprint device and the package name of the host application with the corresponding class paths respectively to form byte arrays, extracting a preset number of bytes from these two byte arrays as random numbers, and generating a shared key using a key exchange algorithm based on the random numbers, the generated shared key has randomness and unpredictability, enhancing data security; encrypting the executable file using a second encryption algorithm to generate an encrypted executable file to prevent unauthorized access and tampering, signing the encrypted executable file using the encrypted digital certificate, adding a custom file protocol declaration, version number, compilation time, and the signature result of the first encryption algorithm to the head of the encrypted executable file to generate an executable file protection package, improving software security, facilitating the determination of the integrity of the encrypted executable file by verifying the signature, storing the executable file protection package and the dynamic library of the fingerprint software development kit in the directory of the Android device, simplifying the deployment process, and helping to manage and update development-related files; in response to a fingerprint function call request, starting the host application and reading the main configuration file, selecting a fingerprint device according to the main configuration file and reading the corresponding fingerprint device configuration file to achieve dynamic configuration management, being able to flexibly adjust the fingerprint device configuration according to different requirements or environments, and improving the flexibility and scalability of fingerprint function development;Enumerate the mounting status of the fingerprint reader according to the product identification code and the supplier identification code. When the mounting is not successful, return that the fingerprint reader is not connected. When the mounting is successful, obtain and copy the dynamic library to the private directory for loading dynamic libraries of the host application according to the directory path, and load the copied dynamic library into the host application. When the loading is successful, read the executable file protection package according to the resource directory, decrypt the executable file protection package to obtain the executable file. When the loading fails, return that the dynamic library of the fingerprint reader fails to be loaded. By promptly feedbacking the mounting status of the fingerprint reader and the loading status of the dynamic library, improve the stability and security of the system. Loading the dynamic library into the host application can update or replace the fingerprint reader function without modifying the host application, which is convenient for maintenance and upgrade. Decrypting the executable file protection package ensures that only legitimate executable files will be loaded and executed, improving data security; decrypting the executable file protection package to obtain the executable file includes: reading the header of the executable file protection package, matching the custom file protocol declaration to ensure the correctness of data reading, using the version number and compilation time in the header as the return value of the software development kit version number interface to facilitate the tracking and management of different fingerprint readers, improving the maintainability of the fingerprint reader, and encrypting and verifying the signature of the file content of the executable file protection package using the built-in encryption digital certificate of the Android device to confirm the integrity of the file content; if the verification passes, decrypt the file content of the executable file protection package using the encryption key to obtain the executable file so that the executable file can run normally on the device. If the signature verification fails, return that the signature verification of the executable file protection package of the fingerprint reader fails, promptly inform the error message, and prevent potential security risks; instantiate the fingerprint reader implementation class in the executable file to implement the actual call of the fingerprint reader function, and read the user fingerprint features to ensure that the system can identify and use the correct fingerprint reader, improving the reliability and security of the system.;

[0033] Combined with the above content, the technical key points of the present invention are as follows: 1. Obtain the executable file by defining and compiling the fingerprint reader implementation class, separating the implementation of the new fingerprint reader function from the host application in code to avoid the unclear scope of changes caused by recompiling the host application; 2. Start the host application and read the main configuration file, select the fingerprint reader according to the main configuration file and read the corresponding fingerprint reader configuration file, and complete the dynamic loading of the specific fingerprint reader configuration, increasing the flexibility of application development. The number of fingerprint reader types that can be adapted during the application development process can be unlimited. Only one fingerprint reader is selected in the main configuration file at a certain moment, which can solve the problem of duplicate classes in the SDK even for the same brand, reducing problems during the development process; 3. Encrypt and protect the executable file through the first encryption algorithm and the second encryption algorithm, and generate an encryption key using the key exchange algorithm according to the first random number, the second random number, the preset prime number, and the base number, without using a fixed key, to prevent the executable file from being cracked by a third party and the source code from being transferred out. 4. Sign the encrypted executable file using an encrypted digital certificate, which can authenticate the integrity of the encrypted executable file stored on the device, solve the risk of the encrypted executable file being tampered with, and also solve the risk of the Android application's running code loaded from the outside being tampered with.

[0034] Therefore, the embodiments of the present invention can achieve the following beneficial effects: 1. When the fingerprint sensor function is expanded and a new fingerprint sensor SDK needs to be connected, the host application does not need to be recompiled, the scope of change in the development process is reduced, and the error rate is lowered. 2. Solve the problem of duplicate classes between the new fingerprint sensor SDK and the previously integrated fingerprint sensor SDK, effectively reducing the problems in the development process. 3. Improve the reuse rate of the integrated fingerprint sensor SDK. If the same fingerprint sensor SDK is encountered, only the main configuration file needs to be modified, without the need for secondary development.

[0035] The above are only the embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent transformation made using the specification and drawings of the present invention, or directly or indirectly applied in the relevant technical fields, shall be similarly included in the patent protection scope of the present invention.

Claims

1. A method for calling a fingerprint instrument SDK, characterized in that: Includes steps: S1. In response to a fingerprint device function call request, the host application is started and a main configuration file is read. According to the main configuration file, a fingerprint device configuration is selected and a corresponding fingerprint device configuration file is read. The fingerprint device configuration file includes a resource directory, a product identification code and a supplier identification code. S2. Enumerate the mounting status of the fingerprint device according to the product identification code and the supplier identification code. When the mounting is successful, obtain and copy the dynamic library to the host application dynamic library loading private directory according to the resource directory, load the copied dynamic library into the host application, and when the loading is successful, read the executable file protection package according to the resource directory, decrypt the executable file protection package, and obtain the executable file; S3. Instantiate the fingerprint device implementation class in the executable file, and use the instantiated class to perform hardware calls to complete the acquisition function when the upper layer initiates feature acquisition.

2. The calling method of the fingerprint instrument SDK according to claim 1, characterized in that: Before step S1, the method further includes: A fingerprint instrument acquisition protocol class is defined according to the fingerprint instrument function of the host application, and a fingerprint instrument implementation class is defined and compiled during the fingerprint instrument integration process to obtain an executable file, wherein the fingerprint instrument implementation class inherits the fingerprint instrument acquisition protocol class; The executable file is encrypted to generate an executable file protection package, and the executable file protection package and the dynamic library of the fingerprint device software development tool kit are stored in a directory of the Android device.

3. The calling method of the fingerprint instrument SDK according to claim 2, characterized in that: Encrypting the executable file to generate an executable file protection package includes: Generate public and private keys of a first encryption algorithm, generate an encrypted digital certificate according to the key in the first encryption algorithm, and embed the encrypted digital certificate into an Android device; The product identification code of the fingerprint device and the full path of the fingerprint device implementation class are concatenated into a first byte array, the first preset length of bytes of the first byte array are used as a first random number, the package name of the host application and the full path of the fingerprint device acquisition protocol class are concatenated into a second byte array, the first preset length of bytes of the second byte array are used as a second random number, a shared key is generated according to the first random number and the second random number using a key exchange algorithm, and the shared key is used as an encryption key; The executable file is encrypted using a second encryption algorithm to generate an encrypted executable file, the encrypted digital certificate is used to sign the encrypted executable file, a custom file protocol declaration, a version number, a compilation time, and a signature result of the first encryption algorithm are added to the header of the encrypted executable file to generate an executable file protection package.

4. The calling method of the fingerprint instrument SDK according to claim 3, characterized in that: Decrypt the executable file protection package to obtain an executable file, including: Read the header of the executable file protection package, match the custom file protocol declaration, use the version number and compile time in the header as the return value of the software development kit version number interface, and encrypt and verify the file content of the executable file protection package using the encrypted digital certificate built into the Android device; If the verification is successful, the encryption key is used to decrypt the file content of the executable file protection package to obtain the executable file. If the verification is unsuccessful, the fingerprint device returns a message indicating that the executable file protection package verification has failed.

5. The method for calling a fingerprint instrument SDK according to claim 1, characterized in that: The step S2 further comprises: Enumerate the mounting status of the fingerprint device according to the product identification code and the supplier identification code, and if the mounting is not successful, return that the fingerprint device is not connected; The copied dynamic library is loaded into the host application. When the loading fails, the fingerprint sensor dynamic library loading failure is returned.

6. A fingerprint instrument SDK calling terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: S1. In response to a fingerprint device function call request, the host application is started and a main configuration file is read. According to the main configuration file, a fingerprint device configuration is selected and a corresponding fingerprint device configuration file is read. The fingerprint device configuration file includes a resource directory, a product identification code and a supplier identification code. S2. Enumerate the mounting status of the fingerprint device according to the product identification code and the supplier identification code. When the mounting is successful, obtain and copy the dynamic library to the dynamic library loading private directory of the host application according to the resource directory, load the copied dynamic library into the host application, and when the loading is successful, read the executable file protection package according to the resource directory, decrypt the executable file protection package, and obtain the executable file; S3. Instantiate the fingerprint device implementation class in the executable file, and use the instantiated class to perform hardware calls to complete the acquisition function when the upper layer initiates feature acquisition.

7. A fingerprint instrument SDK calling terminal according to claim 6, characterized in that: Before step S1, the method further includes: A fingerprint instrument acquisition protocol class is defined according to the fingerprint instrument function of the host application, and a fingerprint instrument implementation class is defined and compiled during the fingerprint instrument integration process to obtain an executable file, wherein the fingerprint instrument implementation class inherits the fingerprint instrument acquisition protocol class; The executable file is encrypted to generate an executable file protection package, and the executable file protection package and the dynamic library of the fingerprint device software development tool kit are stored in a directory of the Android device.

8. A fingerprint instrument SDK calling terminal according to claim 7, characterized in that: Encrypting the executable file to generate an executable file protection package includes: Generate public and private keys of a first encryption algorithm, generate an encrypted digital certificate according to the key in the first encryption algorithm, and embed the encrypted digital certificate into an Android device; The product identification code of the fingerprint device and the full path of the fingerprint device implementation class are concatenated into a first byte array, the first preset length of bytes of the first byte array are used as a first random number, the package name of the host application and the full path of the fingerprint device acquisition protocol class are concatenated into a second byte array, the first preset length of bytes of the second byte array are used as a second random number, a shared key is generated according to the first random number and the second random number using a key exchange algorithm, and the shared key is used as an encryption key; The executable file is encrypted using a second encryption algorithm to generate an encrypted executable file, the encrypted digital certificate is used to sign the encrypted executable file, a custom file protocol declaration, a version number, a compilation time, and a signature result of the first encryption algorithm are added to the header of the encrypted executable file to generate an executable file protection package.

9. A fingerprint instrument SDK calling terminal according to claim 8, characterized in that: Decrypt the executable file protection package to obtain an executable file, including: Read the header of the executable file protection package, match the custom file protocol declaration, use the version number and compile time in the header as the return value of the software development kit version number interface, and encrypt and verify the file content of the executable file protection package using the encrypted digital certificate built into the Android device; If the verification is successful, the encryption key is used to decrypt the file content of the executable file protection package to obtain the executable file. If the verification is unsuccessful, the fingerprint device returns a message indicating that the executable file protection package verification has failed.

10. The calling terminal of the fingerprint instrument SDK according to claim 6, characterized in that: The step S2 further comprises: Enumerate the mounting status of the fingerprint device according to the product identification code and the supplier identification code, and if the mounting is not successful, return that the fingerprint device is not connected; The copied dynamic library is loaded into the host application. When the loading fails, the fingerprint sensor dynamic library loading failure is returned.