Algorithm calling method and device, equipment and storage medium

By combining the first algorithm library with the second algorithm library and dynamic interactive calls based on the algorithm resource status, the resource occupation problem caused by algorithm concurrency when the security unit and embedded SIM card are solved, and the stability and efficiency of the system are achieved.

CN119960948APending Publication Date: 2025-05-09BEIJING TSINGTENG MICROSYSTEM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510203744.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

When the security unit and the embedded SIM card are integrated into the same security unit chip, the algorithm concurrency may lead to algorithm resource occupation, business process blockage or hardware errors, which will lead to system crash.

Method used

By combining the first algorithm library and the second algorithm library, and dynamic interactive calls are made according to the status of the algorithm resources, the scalability of the use of the algorithm module is improved, thereby avoiding blockage caused by resource occupation.

Benefits of technology

It effectively avoids system crashes caused by algorithm resource occupation, improves the scalability of algorithm module usage, and ensures the stability and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119960948A_ABST
    Figure CN119960948A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of SE and eSIM, and particularly provides an algorithm calling method, device, equipment and system and a storage medium, the method is applied to first equipment, the first equipment comprises a security unit, an embedded user identification module, an interface module, a first algorithm library and a second algorithm library, and the method is executed by the interface module. The method comprises the steps that in response to a received interface calling request, calculation parameters carried in the interface calling request are obtained, and the interface calling request is sent by a safety unit or sent by an embedded user identification module; creating a first calculation task based on calculation parameters carried in the interface calling request; selecting a first algorithm from the first algorithm library or the second algorithm library based on the state of the algorithm resource required to be used by the first algorithm library; calling the first algorithm to execute the first calculation task. The first algorithm library and the second algorithm library are combined, dynamic calling is carried out according to the state of the algorithm resource, and the expansibility of the algorithm module is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of SE and eSIM, and in particular to an algorithm calling method, apparatus, device and storage medium. Background Art

[0002] When the Security Element (SE) and embedded SIM card (eSIM) are integrated into a security element chip, the security element chip can not only provide a wide range of security services, but also has the ability to manage mobile network authentication.

[0003] When the security unit and embedded SIM card are integrated into the same security unit chip, it is inevitable that both parties will need to perform data calculations at the same time in the business process, resulting in algorithm concurrency. When the algorithm module is called concurrently for calculation, the business process will be blocked or the hardware will report an error because the algorithm resources are being occupied, causing the system to crash. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides an algorithm calling method, apparatus, device and storage medium, which utilizes the first algorithm library in combination with the second algorithm library, and performs dynamic interactive calling according to the status of the algorithm resources to improve the scalability of the use of the algorithm module.

[0005] In a first aspect, the present application provides an algorithm calling method, which is applied to a first device, wherein the first device includes a security unit, an embedded user identification module, an interface module, a first algorithm library, and a second algorithm library, and the method is executed by the interface module, and the method includes: in response to receiving an interface calling request, obtaining calculation parameters carried in the interface calling request, wherein the interface calling request is sent by the security unit, or the interface calling request is sent by the embedded user identification module; creating a first computing task based on the calculation parameters carried in the interface calling request; selecting a first algorithm from the first algorithm library or the second algorithm library based on the status of algorithm resources required to be used by the first algorithm library; and calling the first algorithm to execute the first computing task.

[0006] In the second aspect, the present application provides an algorithm calling device, which is configured in an interface module in a first device, and the first device also includes a security unit, an embedded user identification module, a first algorithm library and a second algorithm library. The device includes: a computing parameter acquisition module, which is used to obtain the computing parameters carried in the interface call request in response to receiving an interface call request, and the interface call request is sent by the security unit, or the interface call request is sent by the embedded user identification module; a computing task creation module, which is used to create a first computing task based on the computing parameters carried in the interface call request; an algorithm selection module, which is used to select a first algorithm from the first algorithm library or the second algorithm library based on a pre-configured algorithm call logic; a computing task execution module, which is used to call the first algorithm to execute the first computing task.

[0007] In a third aspect, the present application provides an electronic device, which includes an algorithm calling device, and the device includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by one or more processors, the one or more processors implement the algorithm calling method as described in the first aspect above.

[0008] In a fourth aspect, the present application provides a storage medium, which may be a computer-readable storage medium, storing a computer program thereon, which, when executed by a processor, implements the algorithm calling method in the first aspect described above.

[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, implements any transmission algorithm calling method as described in the first aspect above.

[0010] The embodiment of the present application provides an algorithm calling method, device, equipment and storage medium, the method is applied to a first device, the first device includes a security unit, an embedded user identification module, an interface module, a first algorithm library and a second algorithm library, the method is executed by the interface module, and the method includes: in response to receiving an interface call request, obtaining the calculation parameters carried in the interface call request, the interface call request is sent by the security unit, or the interface call request is sent by the embedded user identification module; creating a first calculation task based on the calculation parameters carried in the interface call request; based on the state of the algorithm resources required to be used by the first algorithm library, selecting a first algorithm from the first algorithm library or the second algorithm library; calling the first algorithm to execute the first calculation task. The first algorithm library is combined with the second algorithm library, and dynamic interactive calls are performed according to the state of the algorithm resources to improve the scalability of the use of the algorithm module. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0012] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0013] Figure 1 A flowchart of an algorithm calling method provided in an embodiment of the present application;

[0014] Figure 2 A schematic diagram of the structure of a first device provided in an embodiment of the present application;

[0015] Figure 3 A schematic diagram of a flow chart executed by an interface module according to an embodiment of the present application;

[0016] Figure 4 A flowchart of another algorithm calling method provided in an embodiment of the present application;

[0017] Figure 5 A flowchart of another algorithm calling method provided in an embodiment of the present application;

[0018] Figure 6 A flowchart of another algorithm calling method provided in an embodiment of the present application;

[0019] Figure 7 is a flowchart of a hardware algorithm performing a computing task provided by an embodiment of the present application;

[0020] Figure 8 is a flowchart of a software algorithm provided in an embodiment of the present application for executing a computing task;

[0021] Fig. 9 A flowchart of another algorithm calling method provided in an embodiment of the present application;

[0022] Fig.10 A schematic diagram of the structure of an algorithm calling device provided in an embodiment of the present application;

[0023] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0025] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.

[0026] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0027] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0028] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0029] The algorithm calling method provided by the present application is described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0030] Figure 1 This is a flowchart of an algorithm calling method in an embodiment of the present application. This embodiment is applicable to data transmission by network-free devices. The method can be executed by an algorithm calling device. The algorithm calling device can be implemented in software and / or hardware. The algorithm calling device can be configured in an interface module of the first device.

[0031] The first device in the embodiment of the present application refers to an all-in-one device that integrates eSE and eSIM into a security unit chip, which can not only provide a wide range of security services, but also has the ability to manage mobile network identity authentication. It is usually used in the field of mobile communications, such as smartphones and other portable devices.

[0032] The algorithm calling method provided in the embodiment of the present application is applied to the above-mentioned first device, which includes an embedded security unit eSE, an embedded user identification module eSIM, an interface module, a first algorithm library and a second algorithm library. The algorithm calling method provided in the embodiment of the present application is executed by the interface module.

[0033] Specifically, Figure 2 As shown, the first device 20 provided in the embodiment of the present application includes an eSE 21, an eSIM 22, an interface module 23 and an algorithm module 24, wherein the algorithm module 24 deploys a first algorithm library and a second algorithm library.

[0034] eSE can be understood as a security chip specially designed to store and process sensitive data. eSE can be used to store keys, certificates and other forms of encrypted data to ensure that sensitive information is not accessed without authorization. eSE is often used in mobile payment, digital identity authentication and other application scenarios that require high security. eSIM is a smart card used in mobile phones. Its main function is to store user identification information, encryption keys and network authentication information, so that the phone can connect to a specific mobile network.

[0035] The interface module is a module including an application programming interface (API) and an algorithm call logic unit. The algorithm module deploys a first algorithm library and a second algorithm library, wherein the first algorithm library includes various types of hardware algorithms and the second algorithm library includes various types of software algorithms.

[0036] Among them, hardware algorithms refer to logic embedded in physical circuit designs to perform specific tasks. Hardware algorithms are implemented by designing integrated circuits (ICs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other types of hardware devices. Hardware algorithms can usually provide faster speeds and higher efficiency than software algorithms, especially in highly repetitive and computationally intensive tasks. For example, video decoders, encryption accelerators, network processing units, etc. may contain hardware algorithms.

[0037] A software algorithm is a set of instructions written in a programming language to solve a specific problem or perform a specific task. Software algorithms are designed by software developers and run on general-purpose computer processors. Since software algorithms exist in code rather than physical hardware, they can be easily updated or replaced. Examples of software algorithms include sorting algorithms, search algorithms, encryption algorithms, etc.

[0038] Based on various components included in the first device, an algorithm calling method of an embodiment of the present application is introduced below. Figure 1As shown, an algorithm calling method provided in an embodiment of the present application mainly includes steps S101-S104.

[0039] S101. In response to receiving an interface call request, obtaining a calculation parameter carried in the interface call request, where the interface call request is sent by a security unit or an embedded user identification module.

[0040] An interface call request is a request sent by an eSE or eSIM to an algorithm module that provides algorithm services, mainly requesting the algorithm in the algorithm module to perform certain computing tasks. An interface call request is usually sent via a network protocol and follows a specific application programming interface (API) specification, where the network protocol may include HTTP or HTTPS.

[0041] The interface call request usually includes necessary calculation parameters to ensure that the interface call request can be processed correctly. Specifically, the calculation parameters are specific data items or variables carried in the interface call request. The calculation parameters are used to indicate the type of algorithm that the interface module needs to use and the data content and length that needs to be calculated. The calculation parameters may include, but are not limited to: numerical values, strings, objects, etc. Furthermore, when used to perform security-related tasks, the above-mentioned calculation parameters may also include: encryption keys, signatures, tokens or other security-related data.

[0042] When the interface module receives an interface call request sent by the eSE or eSIM, the interface module parses the interface call request and extracts the calculation parameters contained in the interface call request so as to further process the interface call request or perform corresponding operations.

[0043] For example, in a payment application, eSE sends an interface call request to verify a transaction, and the calculation parameters carried in the interface call request may include transaction amount, timestamp, user ID, digital signature, algorithm type, etc. The interface module parses the interface call request to accurately obtain the above calculation parameters, so as to select the appropriate algorithm based on the above calculation parameters for subsequent security checks and transaction processing.

[0044] In a possible implementation, in response to receiving an interface call request, the interface call request is checked for legitimacy and integrity, and after the check passes, a first computing task is created based on the computing parameters carried in the interface call request. If the check fails, an illegal state value is generated, and the illegal state value is fed back to the sender of the interface call request, and the interface call ends.

[0045] S102: Create a first computing task based on computing parameters carried in the interface call request.

[0046] A computing task is a collection of instructions or algorithms, which is mainly used to solve a specific problem or perform a specific operation. Computing tasks mainly include but are not limited to: input data, processing logic, output results, state management, etc., among which input data can be understood as the initial data required for the computing task, and the input data mainly comes from the calculation parameters in the interface call request. Processing logic refers to a set of rules, algorithms or program codes that can achieve the goals of the computing task. Output results refer to the results or feedback information generated after the computing task is completed. State management refers to tracking the progress and status of the task to ensure that the task can be paused, resumed or canceled.

[0047] The first computing task may be understood as a computing task created based on computing parameters carried in the currently received interface call request.

[0048] Specifically, the type of computing task to be created and its specific requirements are determined based on the computing parameters. Specifically, the computing parameters are matched with predefined task patterns or rules to determine what operations should be performed. For example: if there are parameters such as transaction amount and user ID, a "transaction verification task" needs to be created. If there are digital signature parameters, signature verification may need to be performed as part of the task.

[0049] According to the above analysis results, create and initialize the calculation task. Specifically, set the input data and use the parsed calculation parameters as the input data of the calculation task. For example, in the "transaction verification task", set the transaction amount, user ID, etc. as the initial conditions of the task. Load the processing logic and load the corresponding algorithm or program code according to the task type. For the "transaction verification task", it can include logic such as account balance check and signature verification. Prepare the output structure to define the expected result format returned after the task is completed. For example, the output of the "transaction verification task" may be a Boolean value (true / false), indicating whether the transaction has passed the verification. Configure state management, set the initial state for the task, and prepare a method to track the progress of the task. This helps to query the status of the task later or resume the task when necessary.

[0050] The specific process of creating a computing task is not specifically limited in the embodiments of the present application.

[0051] S103: Select a first algorithm from the first algorithm library or the second algorithm library based on the status of the algorithm resources required by the first algorithm library.

[0052] From the above discussion, it can be seen that the first algorithm library includes various types of hardware algorithms, so the algorithm resources required by the first algorithm library can be understood as the hardware resources required for various types of hardware algorithm tasks or operations in the first algorithm library. Among them, the above hardware may include but is not limited to: design integrated circuits (ICs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), and other types of hardware devices.

[0053] The states of the algorithm resources required by the first algorithm library include an available state and an unavailable state. The available state can be understood as the hardware resources required by the first algorithm library are in an idle state and can be called to perform the first computing task. The unavailable state can be understood as the hardware resources required by the first algorithm library are performing other computing tasks and cannot be called to perform the first computing task.

[0054] In one possible implementation, based on the status of algorithm resources required by the first algorithm library, selecting the first algorithm from the first algorithm library or the second algorithm library includes: detecting whether the algorithm resources required by the first algorithm library are in an available state; if the algorithm resources required by the first algorithm library are not in an available state, selecting the first algorithm from the second algorithm library.

[0055] Check whether the algorithm resources required by the first algorithm library are in an available state. If the algorithm resources required by the first algorithm library are in an available state, it indicates that the hardware resources required by the first algorithm library are in an idle state and can be called to perform the first computing task. At this time, select the first algorithm from the first algorithm library. If the algorithm resources required by the first algorithm library are not in an available state, it indicates that the hardware resources required by the first algorithm library are performing other computing tasks and cannot be called to perform the first computing task. At this time, select the first algorithm from the second algorithm library to perform the first computing task using the first algorithm selected from the second algorithm library.

[0056] Specifically, the first algorithm library includes various types of hardware algorithms, and the second algorithm library includes various types of software algorithms. If the hardware resources required by the first algorithm library are in an available state, it indicates that the hardware resources required by the first algorithm library are in an idle state and can be called to execute the first computing task. At this time, a suitable hardware algorithm is selected from the first algorithm library as the first algorithm.

[0057] If the algorithm resources required by the first algorithm library are not in an available state, it indicates that the hardware resources required by the first algorithm library are executing other computing tasks and cannot be called to execute the first computing task. At this time, a suitable software algorithm is selected from the second algorithm library as the first algorithm to execute the first computing task using the software algorithm selected from the second algorithm library.

[0058] In the embodiment of the present application, when the hardware resources are used, the software algorithm is used to execute the computing tasks to realize the concurrent execution of the computing tasks, without involving the modification of the chip hardware algorithm library, and ensuring that the first computing task that needs to be executed is not blocked. According to the principle of real-time priority, when the hardware resources are available, the hardware algorithm is used to execute the first computing task to speed up the computing speed and improve the computing efficiency.

[0059] For some hardware resources, since the hardware device becomes an immutable part once it is integrated into the product, its usage status cannot usually be directly monitored. In an embodiment of the present application, a method for determining the status of a hardware resource is provided.

[0060] In one possible implementation, detecting whether algorithm resources required for use by the first algorithm library are in an available state includes: reading the working status of resources from hardware resources required for use by the first algorithm library; and judging whether the algorithm resources required for use by the first algorithm library are in an available state based on the working status of the resources.

[0061] If the working state of the resource read from the hardware resource required for the first algorithm library is working, it is determined that the algorithm resource required for the first algorithm library is not in an available state. If the working state of the resource read from the hardware resource required for the first algorithm library is idle, it is determined that the algorithm resource required for the first algorithm library is in an available state.

[0062] For different types of hardware resources, different methods can be used to read the working status of the resources.

[0063] For example: for a design integrated circuit, by measuring the power consumption of the design integrated circuit, if the power consumption is higher than the power consumption in the idle state, the design integrated circuit is in operation; if the power consumption is lower than the power consumption in the idle state, the design integrated circuit is in idle state. For a design integrated circuit with an access interface, it is possible to determine whether the design integrated circuit is processing data by monitoring the signal activity on the input and output pins. If there is signal activity on the input and output pins, the design integrated circuit is in a working state, and it is determined that the hardware resources required for the first algorithm library are not in an available state; if there is no signal activity on the input and output pins, the design integrated circuit is not in a working state, and it is determined that the hardware resources required for the first algorithm library are in an available state.

[0064] Another example: For ASICs, the current working status can be read through dedicated software through built-in diagnostic or status reporting functions. For ASICs with communication interfaces, it can be determined whether they are in working state by checking network traffic or activities in the communication protocol.

[0065] Another example: For field programmable gate arrays (FPGAs), FPGAs can only perform specific functions after loading configuration files (bitstreams). The currently loaded configuration files are queried through the programming interface to confirm whether the FPGA has been configured to perform a certain task. The FPGA development platform provides an API for real-time monitoring of the device status, including key parameters such as power consumption, temperature, and clock frequency, to determine whether the FPGA is working. Some FPGA boards will have LED indicators to display different working states, such as initialization completion, error occurrence, etc.

[0066] S104: Call a first algorithm to execute a first computing task.

[0067] If the first algorithm is a hardware algorithm selected from the first algorithm library, then the hardware algorithm is called to perform the first computing task. If the first algorithm is a software algorithm selected from the second algorithm library, then the software algorithm is called to perform the first computing task.

[0068] Specifically, a corresponding function or hardware resource is called to execute the first computing task.

[0069] Furthermore, during the execution of the first computing task, the task progress is tracked through log records, callback functions or dedicated monitoring tools. An appropriate exception handling mechanism can also be set up so that timely responses and measures can be taken when problems are encountered.

[0070] When the first computing task is completed, collect the output results. This may include the result object returned directly, or the data stored in the file system. Ensure that all occupied resources are properly released, including closing file handles, disconnecting network connections, and stopping occupied hardware resources.

[0071] In a specific implementation, Figure 3 As shown, the algorithm calling process provided in the embodiment of the present application mainly includes: S201-S208.

[0072] S201: A user calls an interface module through an eSE or an eSIM and sends an algorithm call request to the interface module, wherein the algorithm call request includes calculation parameters.

[0073] S202, the interface module performs a legality check on the algorithm call request and the calculation parameters included therein. If the check passes, S203 is executed; if the check fails, S207 is executed.

[0074] S203: The interface module creates a first computing task based on computing parameters included in the algorithm calling request.

[0075] S204: Create a first computing task object and wait for scheduling.

[0076] Scheduling is achieved through the scheduler.

[0077] S205, determine whether the call is completed, if not, execute S204, if so, execute S206.

[0078] S206. Obtain the calculation result of the first calculation task and feed it back to the eSE or eSIM, and execute S208.

[0079] S207 . Feedback the parameter illegal status value to the eSE or eSIM, and execute S208 .

[0080] S208, end.

[0081] The embodiment of the present application provides an algorithm calling method, device, equipment and storage medium, the method is applied to a first device, the first device includes a security unit, an embedded user identification module, an interface module, a first algorithm library and a second algorithm library, the method is executed by the interface module, and the method includes: in response to receiving an interface call request, obtaining a calculation parameter carried in the interface call request, the interface call request is sent by the security unit, or the interface call request is sent by the embedded user identification module; creating a first calculation task based on the calculation parameter carried in the interface call request; based on the state of the algorithm resources required to be used by the first algorithm library, selecting a first algorithm from the first algorithm library or the second algorithm library; calling the first algorithm to execute the first calculation task. The first algorithm library is combined with the second algorithm library, and dynamic interactive calls are performed according to the state of the algorithm resources to improve the scalability of the use of the algorithm module.

[0082] Based on the above embodiments, the present application further optimizes the algorithm calling method, such as Figure 4 As shown, another algorithm calling method provided in the embodiment of the present application mainly includes:

[0083] S301. In response to receiving an interface call request, obtaining a calculation parameter carried in the interface call request, where the interface call request is sent by a security unit or an embedded user identification module.

[0084] S302: Create a first computing task based on the computing parameters carried in the interface call request.

[0085] The process of S301-S302 provided in the embodiment of the present application is the same as the process of S101-S102 provided in the above embodiment. For details, please refer to the description in the above embodiment, which will not be repeated in the embodiment of the present application.

[0086] S303, detecting whether the algorithm resources required by the first algorithm library are in an available state, if so, executing S304, if not, executing S305.

[0087] In an embodiment of the present application, the method for determining whether an algorithm resource is in an available state is the same as the method provided in the above embodiment. For details, please refer to the description in the above embodiment, and will not be repeated in the embodiment of the present application.

[0088] S304: Select a first algorithm from a first algorithm library, and call the first algorithm to execute a first computing task.

[0089] In the embodiment of the present application, if the hardware resources required by the first algorithm library are in an available state, it indicates that the hardware resources required by the first algorithm library are in an idle state and can be called to perform the first computing task. At this time, a suitable hardware algorithm is selected from the first algorithm library as the first algorithm, and the first algorithm is called to perform the first computing task. After the first computing task is executed, the calculation result of the first computing task is fed back to the sender of the algorithm call request as response data, that is, the calculation result of the first computing task is fed back to the sSE or eSIM as response data.

[0090] In a specific implementation, if the hardware resources are in an available state, a hardware algorithm is selected from a first algorithm library, and the hardware algorithm is called to execute the first computing task.

[0091] S305: Select a first algorithm from the second algorithm library, and call the first algorithm to execute the first computing task.

[0092] In an embodiment of the present application, if the algorithm resources required by the first algorithm library are not in an available state, it indicates that the hardware resources required by the first algorithm library are executing other computing tasks and cannot be called to execute the first computing task. At this time, a suitable software algorithm is selected from the second algorithm library as the first algorithm, so as to use the software algorithm selected from the second algorithm library to execute the first computing task.

[0093] In a specific implementation, if the hardware resources are not in an available state, a software algorithm is selected from the second algorithm library, and the software algorithm is called to execute the first computing task.

[0094] S306: In the process of calling the second algorithm to execute the first computing task, periodically determine whether the algorithm resources required by the first algorithm library are in an available state.

[0095] In an embodiment of the present application, in the process of calling the software algorithm to execute the first computing task, it is polled whether the hardware resources are in an available state. If the hardware resources are not in an available state, the software algorithm is continued to be called to execute the first computing task.

[0096] S307: If the algorithm resources required by the first algorithm library are available, switch the first computing task to the third algorithm for execution.

[0097] The third algorithm is an algorithm selected from the first algorithm library and matching the first computing task.

[0098] The third algorithm refers to a hardware algorithm selected from the first algorithm library that matches the first computing task. The algorithm that matches the first computing task can be understood as a specific algorithm for executing the first computing task. For example, if an encryption algorithm is required to execute the first computing task, then a hardware resource of the encryption algorithm is selected from the first algorithm library to call the hardware resource to execute the first computing task related to the encryption algorithm.

[0099] In the process of calling the software algorithm to execute the first computing task, the hardware resources are polled to see whether they are in an available state. If the hardware resources are in an available state, it indicates that the computing task being executed by the hardware resources has been completed, and the hardware resources are released, and are now in an idle and available state. At this time, a hardware algorithm matching the first computing task is selected from the first algorithm library as the third algorithm, and the third algorithm is called to execute the first computing task to improve computing efficiency.

[0100] In the embodiment of the present application, according to the principle of real-time priority, when hardware resources are available, the hardware algorithm is used to execute the first computing task to speed up the computing speed and improve the computing efficiency; when the hardware resources are used, the software algorithm is used to execute the computing task to achieve concurrent execution of the computing tasks, without involving modifications to the chip hardware algorithm library, and ensuring that the first computing task that needs to be executed is not blocked. Furthermore, in the process of the software algorithm executing the first computing task, the hardware resources are polled to see if they are available. When the hardware resources are available, the first computing task is switched to the hardware algorithm for execution, so as to use the hardware algorithm to ensure efficiency and real-time performance.

[0101] In one possible implementation, the computing parameters include the type of algorithm used by the first computing task; switching the first computing task to the third algorithm for execution includes: if the type of algorithm used by the first computing task is the first type, calling the third algorithm to re-execute the first computing task; if the type of algorithm used by the first computing task is the second type, obtaining the computing result of the executed part of the first computing task executed by the first algorithm; calling the third algorithm, and transmitting the computing result of the executed part of the first computing task and the unexecuted part of the first computing task to the third algorithm, so that the third algorithm continues to execute the unexecuted part based on the computing result of the executed part.

[0102] The first type can be understood as the type of algorithm that needs to be restarted after being interrupted. For example, the first type of algorithm includes but is not limited to: asymmetric algorithms, digest algorithms, etc. Asymmetric algorithms include but are not limited to: RSA, ECC, SM2, etc., and digest algorithms include but are not limited to: SHA1, SHA256, SHA512, MD5, etc.

[0103] The second type can be understood as this type of algorithm, after being interrupted or paused, it can not affect the previous calculation results, and can recalculate the current results after being interrupted, and then perform subsequent calculations again. For example: the first type of algorithm includes but is not limited to: symmetric algorithms, checksum algorithms, etc. Symmetric algorithms include but are not limited to: DES, AES, SM1, SM4, SM7, etc.; checksum algorithms, CRC, LRC, etc.

[0104] In a specific implementation scenario, for a symmetric algorithm, each calculation is performed based on the minimum unit of the algorithm's block length, such as 8 bytes for DES, and 16 bytes for AES, SM1, and SM4. If the calculation is paused or interrupted midway, it will not affect the previous calculation results. After being interrupted, the result of this calculation can be recalculated and the calculation can continue.

[0105] For asymmetric algorithms, the principle of RSA encryption and decryption is based on large number operations, and the principle of ECC is based on elliptic curve point multiplication operations, both of which need to be recalculated after interruption.

[0106] In the embodiment of the present application, if the algorithm type used by the first computing task is the second type, the calculation result of the executed part of the first computing task executed by the first algorithm is obtained; the third algorithm is called, and the calculation result of the executed part of the first computing task and the unexecuted part of the first computing task are transmitted to the third algorithm, so that the third algorithm continues to execute the unexecuted part based on the calculation result of the executed part. This avoids the algorithm from being re-executed and improves the execution effect of the algorithm.

[0107] If the algorithm type used by the first computing task is the first type, the third algorithm is called to re-execute the first computing task to avoid calculation result errors caused by switching from the software algorithm to the hardware algorithm, so as to improve the accuracy of the calculation result.

[0108] In a specific implementation, Figure 5 As shown, the algorithm calling process provided in the embodiment of the present application mainly includes: S401-S409.

[0109] S401: A user calls an interface module through an eSE or an eSIM, and sends an algorithm calling request to the interface module.

[0110] S402: The interface calling module pre-processes the received algorithm calling request to generate a first computing task.

[0111] S403, determine whether the hardware resources are available, if so, execute S404, if not, execute S405.

[0112] S404, calling the hardware algorithm to execute the first computing task, and executing S408 after the computing is completed.

[0113] S405: Calling a software algorithm to execute a first computing task.

[0114] S406, determine whether the first calculation task of the software algorithm is completed, if so, execute S408, if not, execute S407.

[0115] S407, determine whether the hardware resources are available, if so, execute S404, if not, return to execute S405.

[0116] S408: Integrate the output result of the first computing task into response data.

[0117] S409: Send response data to the eSE or eSIM.

[0118] In the embodiment of the present application, when the hardware resources are used, the software algorithm is used to execute the computing tasks to realize the concurrent execution of the computing tasks, without involving the modification of the chip hardware algorithm library, and ensuring that the first computing task that needs to be executed is not blocked. According to the principle of real-time priority, when the hardware resources are available, the hardware algorithm is used to execute the first computing task to speed up the computing speed and improve the computing efficiency.

[0119] Based on the above embodiments, the present application further optimizes the algorithm calling method, such as Figure 6 As shown, another algorithm calling method provided in the embodiment of the present application mainly includes:

[0120] S501. In response to receiving an interface call request, obtaining a calculation parameter carried in the interface call request, where the interface call request is sent by a security unit or an embedded user identification module.

[0121] S502: Create a first computing task based on the computing parameters carried in the interface call request;

[0122] S503: Determine whether the algorithm resources required by the first algorithm library are available. If so, execute S504; if not, execute S505.

[0123] S504: Select a first algorithm from a first algorithm library, and call the first algorithm to execute a first computing task.

[0124] The processes of S501-S504 provided in the embodiment of the present application are the same as the processes of S301-S304 provided in the above embodiment. For details, please refer to the description in the above embodiment, which will not be repeated in the embodiment of the present application.

[0125] S505: Obtain the priority of the second computing task and the priority of the first computing task.

[0126] The second computing task refers to the computing task being executed by the first algorithm library.

[0127] When the algorithm resources required by the first algorithm library are not in an available state, it indicates that the hardware resources required by the first algorithm library are executing other computing tasks. In the embodiment of the present application, the other computing tasks being executed by the hardware resources are regarded as the second computing tasks.

[0128] The priority of the second computing task is carried in the algorithm calling request corresponding to the second computing task, and the priority of the first computing task is carried in the algorithm calling request corresponding to the first computing task.

[0129] Specifically, the calculation parameters carried in the algorithm call request include a priority, and after the calculation task is created using the calculation parameters, the priority is directly assigned to the calculation task. For example, the priority is configured from 0 to the maximum, and the larger the value, the higher the priority.

[0130] For example: Ret FUN(Struct dataDomain, int priority), where Ret is used to return whether the calculation result is successful, Struct dataDomain is a data structure including input and output data information, and priority indicates the algorithm priority.

[0131] S506: Determine whether the priority of the first computing task is higher than the priority of the second computing task. If so, execute S510; if not, execute S507.

[0132] Determine whether the priority of the first computing task is higher than the priority of the second computing task. Specifically, compare the priority value of the first computing task with the priority value of the second computing task. If the priority value of the first computing task is greater than the priority value of the second computing task, it indicates that the priority of the first computing task is higher than the priority of the second computing task. If the priority value of the first computing task is less than or equal to the priority value of the second computing task, it indicates that the priority of the first computing task is not higher than the priority of the second computing task.

[0133] S507: Select a first algorithm from the second algorithm library, and call the first algorithm selected from the second algorithm library to execute the first computing task.

[0134] When the priority of the first computing task is not higher than the priority of the second computing task, that is, the priority of the first computing task is lower than the priority of the second computing task, or the priority of the first computing task is equal to the priority of the second computing task, it indicates that the second computing task being executed by the hardware resources has a higher priority and requires faster real-time performance. At this time, the hardware resources are kept to continue executing the second computing task.

[0135] A software algorithm matching the first computing task is selected from the first algorithm library as the first algorithm, and the software algorithm is called to execute the first computing task to ensure the real-time performance of the first computing task.

[0136] S508. In the process of calling the first algorithm selected from the second algorithm library to execute the first computing task, periodically determine whether the algorithm resources required by the first algorithm library are in an available state.

[0137] S509: If the algorithm resources required by the first algorithm library are available, the first computing task is switched to a third algorithm for execution, where the third algorithm is an algorithm selected from the first algorithm library and matching the first computing task.

[0138] S508-S509 provided in the embodiment of the present application is the same as the process of S306-S307 provided in the above embodiment. For details, please refer to the description in the above embodiment, which will not be repeated in the embodiment of the present application.

[0139] S510: Switch the second computing task to a second algorithm for execution, where the second algorithm is an algorithm selected from a second algorithm library and matching the second computing task.

[0140] When the priority of the first computing task is higher than that of the second computing task, that is, the priority value of the first computing task is greater than the priority value of the second computing task, it indicates that the first computing task requires faster real-time performance. At this time, the second computing task being executed by the hardware resources is switched to the second algorithm for execution. In other words, the second computing task is switched from being executed by the hardware algorithm to being executed by the software algorithm to release hardware resources so that the hardware algorithm can execute the first computing task with higher real-time performance.

[0141] The process of switching the second computing task to the second algorithm for execution is the same as the process of switching the first computing task to the third algorithm for execution provided in the above embodiment. For details, please refer to the description in the above embodiment, and will not be repeated in the embodiments of this application.

[0142] S511. Select a first algorithm from a first algorithm library, and call the first algorithm to execute a first computing task.

[0143] After switching the second computing task being executed by the hardware resources to the second algorithm for execution, the hardware resources are released and are in an idle state. A hardware algorithm matching the first computing task is selected from the first algorithm library as the first algorithm, and the hardware algorithm is called to execute the first computing task.

[0144] In the embodiment of the present application, when computing tasks are concurrent, the basis for concurrency judgment is whether the hardware resources are available and whether there is an ongoing computing. Compare the priorities of the computing tasks. If the first computing task and the second computing task have the same priority, use the software algorithm to execute the first computing task, poll the hardware resource status in the middle, and when the hardware resources are available, switch the first computing task to the hardware algorithm for execution, and organize the calculated data after the calculation is completed. The priority of the first computing task is higher than that of the second computing task. The hardware algorithm is interrupted, the hardware resources are released, and the first computing task is switched to the software algorithm for execution, so that the high-priority first computing task is executed using the hardware algorithm to ensure efficiency and real-time performance.

[0145] On the contrary, if the priority of the first computing task is lower than that of the second computing task, the original hardware algorithm is maintained to execute the second computing task, and the low-priority first computing task is executed using the software algorithm, and the hardware resource status is queried in the middle. When the high-priority second computing task is completed, but the low-priority first computing task has not been completed, it will be judged that the hardware resources are available and then switched to the hardware algorithm for execution.

[0146] The above embodiments can ensure that high-priority computing tasks can be responded to in the most timely manner.

[0147] Figure 7 is a flowchart of the hardware algorithm provided in the embodiment of the present application performing a computing task, such as Figure 7 As shown, the process of the hardware algorithm executing the computing task mainly includes: S601-S606.

[0148] S601, select algorithm type and organize calculation data.

[0149] S602: Call the hardware algorithm interface to execute the computing task.

[0150] S603: Determine whether it is interrupted externally. If so, execute S606; if not, execute S604.

[0151] S604: Determine whether the computing task is completed. If so, execute S605; if not, execute S606.

[0152] S605: Feedback the calculation result to the eSE or eSIM.

[0153] S606: Generate error information and feed it back to the eSE or eSIM.

[0154] The process of hardware algorithm executing computing tasks depends on the current chip capabilities. When the chip is integrated with hardware units specifically used to execute specific algorithms, the execution efficiency and security of the algorithm can be significantly improved.

[0155] The process of hardware algorithm executing computing tasks depends on the hardware resources of the chip, and data processing is performed through the collaborative work of MCU and chip algorithm unit. The basic process is: hardware algorithm unit initialization, configuration of input data, start hardware calculation, wait for calculation completion, read calculation results. The packaged first algorithm library is provided in advance, and there is no need to care about the internal implementation of the hardware algorithm. It can be called directly and the processing speed is fast. In the case of relying on specific hardware, concurrent reentry cannot be achieved, that is, hardware resources cannot be used for multi-tasking at the same time.

[0156] Figure 8 is a flowchart of the software algorithm provided in the embodiment of the present application for executing a computing task, such as Figure 8 As shown in the figure, the process of executing computing tasks by the software algorithm mainly includes:

[0157] S701: Obtain the data to be calculated corresponding to the calculation task.

[0158] S702: Call the software algorithm interface to process the data to be calculated.

[0159] S703: Determine whether the calculation is successful. If so, execute S704; if not, execute S705.

[0160] S705: Feedback the calculation result to the eSE or eSIM.

[0161] S706: Check whether the calculation conditions are met, and feed back the check result to the eSE or eSIM.

[0162] Software algorithms are based on the principles of algorithms and are completely implemented by software programming languages. The chip does not need corresponding hardware resources, which reduces hardware costs. Users can implement support and update and maintain them as needed, which is highly flexible. Concurrent calls can be made. Compared with hardware, software algorithms have lower computing power and poorer performance when processing large amounts of data and complex logic.

[0163] In a specific implementation, Fig. 9 is a flowchart of the software algorithm provided in the embodiment of the present application for executing a computing task, specifically, Fig. 9 As shown,

[0164] S801. Obtain the first created computing task.

[0165] S802: Determine whether the hardware resources are available. If so, execute S803; if not, execute S804.

[0166] S803, calling the hardware algorithm to execute the first computing task, and after the computing is completed, executing S810.

[0167] S804, determining whether the hardware algorithm has a second computing task being executed, if so, executing S805, if not, feeding back an error message.

[0168] S805: Determine whether the priority of the first computing task is higher than the priority of the second computing task. If so, execute S806; if not, execute S807.

[0169] S806: interrupt the execution of the second computing task and execute S803.

[0170] S807: Call the software algorithm to execute the first computing task.

[0171] S808, determine whether the software algorithm has completed the first computing task, if so, execute S810, if not, execute S809.

[0172] S809: Determine whether the hardware resources are available. If so, execute S803; if not, return to execute S807.

[0173] S810: Integrate the output result of the first computing task into response data.

[0174] S811. Release computing resources.

[0175] In the embodiment of the present application, the scheduling strategy refers to combining the characteristics of the hardware algorithm and the software algorithm, and making reasonable corresponding scheduling based on comprehensive judgments such as the current external computing request and the current chip status, which can better improve the system performance and stability.

[0176] After calling the interface module, the algorithm task of the corresponding priority is created inside the interface module and scheduled according to the priority.

[0177] According to the principle of real-time priority, when hardware resources are available, the hardware algorithm is called for calculation, which is efficient. If the current hardware resources are not available, the software algorithm is used for calculation to ensure that the data that needs to be calculated is not blocked.

[0178] In addition, if the software algorithm performs a part of the computing task in a concurrent situation, the computing task performed by the hardware has been completed, and the hardware resources are released, the remaining data to be calculated can be switched from the software algorithm to the hardware algorithm to continue the calculation, thereby improving the computing efficiency. After the calculation is completed, the results of the first part of the software calculation and the results of the second part of the hardware calculation need to be combined to obtain complete data.

[0179] Specifically, concurrency can be divided into polling concurrency and preemptive concurrency. Polling concurrency will not artificially interrupt the hardware algorithm execution, but will only switch the computing tasks executed by the software algorithm to the hardware algorithm execution when the hardware resources are idle. Preemptive concurrency will interrupt the normal low-priority computing tasks according to the call priority in the concurrent scenario, so that the high-priority computing tasks that arrive later will be executed first, and the low-priority computing tasks will be executed after the high-priority computing is completed.

[0180] When a high-priority calculation arrives, the high-priority calculation will interrupt the low-priority calculation. The high-priority calculation will be calculated using the hardware algorithm, and the low-priority calculation will be calculated using the software algorithm. This ensures that the high-priority calculation can respond in the most timely manner.

[0181] Fig.10 Schematic diagram of the structure of an algorithm calling device in an embodiment of the present application, such as Fig.10 As shown, the algorithm calling device 100 provided in the embodiment of the present application is configured in an interface module in a first device, and the first device also includes a security unit, an embedded user identification module, a first algorithm library and a second algorithm library. The device includes: a computing parameter acquisition module 101, which is used to obtain the computing parameters carried in the interface call request in response to receiving an interface call request, and the interface call request is sent by the security unit, or the interface call request is sent by the embedded user identification module; a computing task creation module 102, which is used to create a first computing task based on the computing parameters carried in the interface call request; an algorithm selection module 103, which is used to select a first algorithm from the first algorithm library or the second algorithm library based on a pre-configured algorithm call logic; a computing task execution module 104, which is used to call the first algorithm to execute the first computing task.

[0182] In one possible implementation, the algorithm selection module 103 is used to select the first algorithm from the first algorithm library or the second algorithm library based on the status of the algorithm resources required by the first algorithm library, and is specifically used to detect whether the algorithm resources required by the first algorithm library are in an available state; if the algorithm resources required by the first algorithm library are not in an available state, the first algorithm is selected from the second algorithm library.

[0183] In one possible implementation, the computing parameters include the priority of the first computing task; the algorithm selection module 103 is used to determine whether the algorithm resources required by the first algorithm library are in an available state when selecting the first algorithm from the first algorithm library or the second algorithm library based on the state of the algorithm resources required by the first algorithm library; if the algorithm resources required by the first algorithm library are not in an available state, obtain the priority of the second computing task, the second computing task refers to the computing task being executed by the first algorithm library; if the priority of the first computing task is lower than the priority of the second computing task, or if the priority of the first computing task is the same as the priority of the second computing task, select the first algorithm from the second algorithm library.

[0184] In one possible implementation, the algorithm selection module 103 is also used to switch the second computing task to a second algorithm for execution if the priority of the first computing task is higher than the priority of the second computing task, where the second algorithm is an algorithm selected from a second algorithm library that matches the second computing task; and select the first algorithm from the first algorithm library.

[0185] In one possible implementation, the algorithm selection module 103 is also used to periodically determine whether the algorithm resources required by the first algorithm library are in an available state during the process of calling the second algorithm to execute the first computing task; if the algorithm resources required by the first algorithm library are in an available state, the first computing task is switched to the third algorithm for execution, and the third algorithm is an algorithm selected from the first algorithm library and matching the first computing task.

[0186] In one possible implementation, the calculation parameters include the type of algorithm used for the first calculation task; the algorithm selection module 103 is further used to call a third algorithm to re-execute the first calculation task if the type of algorithm used for the first calculation task is the first type; if the type of algorithm used for the first calculation task is the second type, obtain the calculation result of the executed part of the first calculation task executed by the first algorithm; call the third algorithm, and transmit the calculation result of the executed part of the first calculation task and the unexecuted part of the first calculation task to the third algorithm, so that the third algorithm continues to execute the unexecuted part based on the calculation result of the executed part.

[0187] In one possible implementation, the algorithm selection module 103 is used to detect whether the algorithm resources required by the first algorithm library are in an available state, and is specifically used to read the working status of resources from the hardware resources required by the first algorithm library; based on the working status of the resources, it is determined whether the algorithm resources required by the first algorithm library are in an available state.

[0188] The algorithm calling device provided in the embodiment of the present application can execute the algorithm calling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0189] Fig.11 is a schematic diagram of the structure of an electronic device provided in this embodiment. The electronic device may include a first device or a second device, such as Fig.11 As shown, the electronic device 110 includes a processor 111, a memory 112, an input device 113 and an output device 114; the number of processors 111 in the electronic device can be one or more. Fig.11 A processor 111 is taken as an example; the processor 111, the memory 112, the input device 113 and the output device 114 in the electronic device can be connected by a bus or other means. Fig.11 The example of connecting through bus is taken in the following.

[0190] The memory 112 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the algorithm calling method in the embodiment of the present invention. The processor 111 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 112, that is, implements the algorithm calling method provided in the embodiment of the present invention.

[0191] The memory 112 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 112 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 112 may further include a memory remotely arranged relative to the processor 111, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0192] The input device 113 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device, and may include a keyboard, a mouse, etc. The output device 114 may include a display device such as a display screen.

[0193] This embodiment also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to implement the algorithm calling method provided by the embodiment of the present invention.

[0194] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided by an embodiment of the present invention are not limited to the method operations described above, and can also execute related operations in the algorithm calling method provided by any embodiment of the present invention.

[0195] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0196] It is worth noting that in the embodiment of the above-mentioned algorithm calling device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0197] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0198] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An algorithm calling method, characterized in that: The method is applied to a first device, the first device includes a security unit, an embedded user identification module, an interface module, a first algorithm library and a second algorithm library, the method is performed by the interface module, and the method includes: In response to receiving an interface call request, obtaining a calculation parameter carried in the interface call request, wherein the interface call request is sent by the security unit or the interface call request is sent by the embedded user identification module; Creating a first computing task based on the computing parameters carried in the interface call request; Selecting a first algorithm from the first algorithm library or the second algorithm library based on a state of algorithm resources required by the first algorithm library; The first algorithm is called to execute the first computing task.

2. The algorithm calling method according to claim 1, characterized in that: The selecting the first algorithm from the first algorithm library or the second algorithm library based on the state of the algorithm resources required to be used by the first algorithm library includes: Detecting whether the algorithm resources required by the first algorithm library are in an available state; If the algorithm resources required by the first algorithm library are not available, a first algorithm is selected from the second algorithm library.

3. The algorithm calling method according to claim 1 or 2, characterized in that: The computing parameters include the priority of the first computing task; The selecting the first algorithm from the first algorithm library or the second algorithm library based on the state of the algorithm resources required to be used by the first algorithm library includes: Determining whether the algorithm resources required by the first algorithm library are available; If the algorithm resources required by the first algorithm library are not in an available state, obtaining the priority of the second computing task, where the second computing task refers to the computing task being executed by the first algorithm library; If the priority of the first computing task is lower than the priority of the second computing task, or if the priority of the first computing task is the same as the priority of the second computing task, a first algorithm is selected from the second algorithm library.

4. The algorithm calling method according to claim 3, characterized in that: Also includes: If the priority of the first computing task is higher than the priority of the second computing task, switching the second computing task to a second algorithm for execution, where the second algorithm is an algorithm selected from the second algorithm library and matching the second computing task; A first algorithm is selected from the first algorithm library.

5. The algorithm calling method according to claim 2, characterized in that: After selecting the first algorithm from the second algorithm library, the method further includes: In the process of calling the second algorithm to execute the first computing task, periodically determining whether the algorithm resources required by the first algorithm library are in an available state; If the algorithm resources required by the first algorithm library are available, the first computing task is switched to a third algorithm for execution, where the third algorithm is an algorithm selected from the first algorithm library and matching the first computing task.

6. The algorithm calling method according to claim 5, characterized in that: The computing parameters include the type of algorithm used by the first computing task; The switching the first computing task to a third algorithm for execution comprises: If the algorithm type used by the first computing task is the first type, calling the third algorithm to re-execute the first computing task; If the algorithm type used by the first computing task is the second type, obtaining a computing result of the executed portion of the first computing task executed by the first algorithm; The third algorithm is called, and the calculation result of the executed part of the first computing task and the unexecuted part of the first computing task are transmitted to the third algorithm, so that the third algorithm continues to execute the unexecuted part based on the calculation result of the executed part.

7. The algorithm calling method according to any one of claims 2 to 6, characterized in that: The detecting whether the algorithm resources required by the first algorithm library are in an available state includes: Reading the working status of resources from the hardware resources required by the first algorithm library; Based on the working status of the resources, it is determined whether the algorithm resources required by the first algorithm library are in an available state.

8. An algorithm calling device, characterized in that: The device is configured in an interface module in a first device, the first device further includes a security unit, an embedded user identification module, a first algorithm library and a second algorithm library, and the device includes: A calculation parameter acquisition module, configured to, in response to receiving an interface call request, acquire the calculation parameters carried in the interface call request, wherein the interface call request is sent by the security unit or the embedded user identification module; A computing task creation module, used to create a first computing task based on the computing parameters carried in the interface call request; An algorithm selection module, configured to select a first algorithm from the first algorithm library or the second algorithm library based on a pre-configured algorithm calling logic; A computing task execution module is used to call the first algorithm to execute the first computing task.

9. An electronic device, characterized in that: The device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the algorithm calling method according to any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the algorithm calling method according to any one of claims 1 to 7 is implemented.