This invention proposes an asynchronous invocation method and
system for cryptographic cards. The method includes: device opening: the application opens the cryptographic card through the SDK main thread and creates a
polling thread to query the returned data status; data sending: when the application calls the cryptographic service interface through the SDK main thread, the cryptographic service interface passes the calculation data, the sending process descriptor pid_send, the
callback function parameters, and the
callback function pointer to the driver and returns immediately without waiting for the cryptographic card's calculation result; data receiving: after the SDK
polling thread queries the cryptographic service calculation result, it automatically executes the
callback function to complete subsequent operations. This invention can effectively avoid the blocking of data interaction between the host application and the cryptographic card, improve the user experience, and fully utilize the performance of the cryptographic card.