Password service method and system, electronic equipment and storage medium
Through IOC container technology, the target device object is created in the nuclear power instrument-controlled DCS system and the target password device is called, which solves the problem of recompiling the program when accessing the password device in the prior art, and realizes flexibility and maintainability in the field of high security.
Patent Information
- Application Number
- CN202510010818.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art requires recompiling the program to increase or decrease services when accessing password devices in nuclear power instrument control DCS systems, resulting in unfavorable maintenance of program and code versions, insufficient flexibility, and manual writing of factory classes and objects creation logic, increasing the complexity and maintenance difficulty of code.
Through IOC container technology, a device class call request is initiated to the IOC container, and initialize the IOC container through the configuration file according to the device class call request, create a target device object, and call the corresponding target password device through the target device object to provide password services.
It realizes that the upper-level device can call various different services at the lower level in one compilation, which improves the system's maintainability and scalability, and reduces the complexity and maintenance difficulty of the code.
Smart Images

Figure CN119939626A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of nuclear power high safety technology, and in particular to a cryptographic service method, system, electronic equipment and storage medium. Background Art
[0002] At present, IOC container technology has been widely used in many fields, such as Spring framework, etc. However, in the field of cryptographic services of nuclear power instrumentation and control DCS systems, the application of IOC container technology is relatively small, and most of the access to cryptographic devices adopts direct calling.
[0003] In the existing process of accessing cryptographic devices, the program needs to be recompiled when services need to be added or reduced, which is very unfavorable for the maintenance of program and code versions and lacks flexibility. During maintenance, the creation logic of factory classes and objects also needs to be manually written, which increases the complexity of the code and the difficulty of maintenance. Summary of the invention
[0004] In view of the shortcomings of the prior art described above, the purpose of the present invention is to provide a cryptographic service method, system, electronic device and storage medium, which are used to solve the problem that in the process of accessing cryptographic devices in the prior art, when it is necessary to add or reduce services, the program needs to be recompiled, which is very unfavorable for the maintenance of program and code versions and lacks flexibility; during maintenance, the creation logic of factory classes and objects also needs to be manually written, which increases the complexity of the code and the difficulty of maintenance.
[0005] To achieve the above-mentioned purpose and other related purposes, the present invention provides a cryptographic service method, which is applied to upper-layer applications; the cryptographic service method includes: initiating a device class call request to an IOC container; initializing the IOC container through a configuration file according to the device class call request; during the initialization process, creating a corresponding target device object for the IOC container according to the device class call request; and calling the corresponding target cryptographic device according to the target device object to provide corresponding cryptographic services through the target cryptographic device.
[0006] In one embodiment of the present invention, the IOC container is initialized through a configuration file according to a device class call request, including: creating an IOC container class object; loading the configuration file in the IOC container class object according to the device class call request to obtain the device name and device library path of the target device object corresponding to the device class call request; calling a creation function for creating the target device object from a call library according to the device library path; registering the device name and creation function corresponding to the target device object in the IOC container to initialize the IOC container.
[0007] In one embodiment of the present invention, creating an IOC container class object includes: performing a creation detection on the IOC container class object; when the IOC container class object has been created, directly returning to the IOC container class object; when the IOC container class object has not been created, creating the IOC container class object.
[0008] In one embodiment of the present invention, a configuration file is loaded in an IOC container class object according to a device class call request to obtain a device name and a device library path of a target device object corresponding to the device class call request, including: detecting the device class in the IOC container according to the device class call request; when the target device object corresponding to the device class call request does not exist in the device class, modifying the configuration file to obtain the device name and the device library path of the target device object corresponding to the device class call request.
[0009] In one embodiment of the present invention, a corresponding target device object is created for an IOC container according to a device class call request, including: parsing the device class call request through the IOC container to obtain a creation function of the target device object corresponding to the device class call request; and creating the target device object for the IOC container through the creation function.
[0010] In one embodiment of the present invention, a device class call request is parsed through an IOC container to obtain a creation function of a target device object corresponding to the device class call request, including: parsing the device class call request through the IOC container to obtain a device name corresponding to the target cryptographic device; and obtaining a creation function of the corresponding target device object registered in the IOC container according to the device name.
[0011] In one embodiment of the present invention, according to the target device object, calling the corresponding target cryptographic device to provide the corresponding cryptographic service through the target cryptographic device includes: according to the corresponding target device interface in the target device object, calling the corresponding target cryptographic device to provide the corresponding cryptographic service through the target cryptographic device.
[0012] To achieve the above-mentioned purpose and other related purposes, the present invention also provides a cryptographic service system, which is applied to upper-level applications; the cryptographic service system includes: a request unit, which is used to initiate a device class call request to an IOC container; an execution unit, which is used to initialize the IOC container through a configuration file according to the device class call request; a creation unit, which is used to create a corresponding target device object for the IOC container according to the device class call request during the initialization process; and a calling unit, which is used to call the corresponding target cryptographic device according to the target device object, so as to provide corresponding cryptographic services through the target cryptographic device.
[0013] To achieve the above-mentioned purpose and other related purposes, the present invention further provides an electronic device, which includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by one or more processors, the electronic device implements the aforementioned cryptographic service method.
[0014] To achieve the above-mentioned purpose and other related purposes, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the aforementioned cryptographic service method.
[0015] As described above, a cryptographic service method, system, electronic device and storage medium of the present invention have the following beneficial effects: it can be implemented in high-security fields such as nuclear power instrumentation and control DCS systems, through upper-layer applications such as nuclear power instrumentation and control DCS systems, using IOC containers to create target device objects during initialization to obtain corresponding cryptographic device call interfaces to call cryptographic devices, so that the upper-layer devices can be compiled once to call multiple different services at the lower layer. This method can encapsulate the interface and function of the cryptographic device in the service class, and the upper-layer application only needs to understand the unified interface provided by the IOC container, without understanding the specific cryptographic device, and can call the specific cryptographic device through the IOC container. At the same time, when a new cryptographic device needs to be added, only the configuration file needs to be modified, and the code of the upper-layer application does not need to be modified, thereby greatly improving the maintainability and scalability of the system. In addition, this method also improves the flexibility and reusability of the code, which is conducive to the expansion and maintenance of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of a cryptographic service method provided by an embodiment of the present invention.
[0017] Figure 2 The structure diagram of the cryptographic service process of the mobile DCS system of nuclear power provided by an embodiment of the present invention is shown as follows
[0018] Figure 3 Shown is a schematic diagram of a process flow of calling a device provided by an embodiment of the present invention.
[0019] Figure 4 Shown is a structural block diagram of a cryptographic service system provided by an embodiment of the present invention.
[0020] Figure 5 Shown is a structural schematic diagram of an electronic device according to an embodiment of the present invention.
[0021] Component number description
[0022] Electronic device 1; cryptographic service system 11; memory 12; processor 13; request unit 111; execution unit 112; creation unit 113; calling unit 114. DETAILED DESCRIPTION
[0023] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0024] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0025] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0026] IOC (Inversion of Control) is a design principle that transfers the control of object creation and dependencies from inside the program to the outside, thereby achieving decoupling between objects.
[0027] See also Figure 1 The present invention provides a cryptographic service method, which is applied to upper layer applications; the cryptographic service method comprises:
[0028] Step S10: Initiate a device class call request to the IOC container;
[0029] Step S20: Initialize the IOC container through the configuration file according to the device class call request;
[0030] Step S30: during the initialization process, according to the device class call request, a corresponding target device object is created for the IOC container;
[0031] Step S40: According to the target device object, the corresponding target cryptographic device is called to provide corresponding cryptographic services through the target cryptographic device.
[0032] Through the above steps, it is not difficult to find that in the high-security field, such as the nuclear power instrumentation and control DCS system application, when calling the cryptographic device, the upper-layer application corresponding to the nuclear power instrumentation and control DCS system first initiates a device class call request to the IOC container, so that the IOC container can be initialized through the configuration file according to the device class call request. In the process of executing the initialization, the target device object corresponding to the device class call request is created for the IOC container, and after the target device object is created, the target cryptographic device required by the upper-layer application is called through the target device object to provide cryptographic services through the target cryptographic device. The target device interface in the target device object created by the upper-layer application using the IOC container can be used to call the corresponding target cryptographic device, so that the upper-layer device can be compiled once and call multiple different cryptographic services of the lower layer. Moreover, by encapsulating the interface and function of the cryptographic device in the service class, the upper-layer application only needs to understand the unified interface provided by the IOC container, without understanding the specific cryptographic device. At the same time, when a new cryptographic device needs to be added, only the configuration file needs to be modified, and the code of the upper-layer application does not need to be modified, which greatly improves the maintainability and scalability of the system. In addition, this method also improves the flexibility and reusability of the code, which is conducive to the expansion and maintenance of the system.
[0033] It is worth noting that the cryptographic device (target cryptographic device) in the present invention is a physical device used to provide a variety of different cryptographic services. For example, a cryptographic card, a cryptographic machine, a USBKey, etc. Specifically, the cryptographic services provided by the target cryptographic device may include data encryption services, data decryption services, signature services, signature verification services, etc. The data encryption service object can provide corresponding device interfaces for each cryptographic device in the lower layer, so that after the target device object is created, it can be called by the upper layer application to provide cryptographic services through the corresponding target cryptographic device. Data encryption services include data storage encryption services and data transmission encryption services, and data decryption services include data storage decryption services and data transmission decryption services.
[0034] Figure 1 The flowchart of the password service method in an exemplary embodiment of the present application is shown, including steps S10 to S40. Figure 1 The technical solution of this application will be described in detail.
[0035] First, execute step S10 to initiate a device class call request to the IOC container.
[0036] When the nuclear power instrumentation and control DCS system application calls the cryptographic device, it will initiate a device class call request corresponding to the target cryptographic device to the IOC container, so that the IOC container can be initialized according to the initiated device class call request.
[0037] Next, step S20 is executed to initialize the IOC container through the configuration file according to the device class call request.
[0038] During the initialization of the IOC container, the specific device class that the IOC container needs to load, that is, the target device object, is determined through the configuration file, so that after the initialization is performed, the corresponding target device object is created to call the corresponding target cryptographic device through the target device object.
[0039] In step S20, according to the device class call request, the IOC container is initialized through the configuration file, including:
[0040] Step S201: Create an IOC container class object;
[0041] Step S202: according to the device class call request, load the configuration file in the IOC container class object to obtain the device name and device library path of the target device object corresponding to the device class call request;
[0042] Step S203: according to the device library path, calling the creation function for creating the target device object from the calling library;
[0043] Step S204: register the device name and creation function corresponding to the target device object into the IOC container to initialize the IOC container.
[0044] In this embodiment, in the process of initializing the IOC container through the configuration file, it is necessary to first create an IOC container class object. Then, according to the device class object request, the configuration file is loaded to obtain the device name and device library path of the target device object corresponding to the device class call request. Thus, in the process of initializing the IOC container, according to the device library path, the creation function for creating the target device object is called from the call library and registered in the IOC container. Thus, after the initialization is completed, according to the device class call request, the creation of the target device object is completed. Through the above method, it can be realized that when the password device needs to be modified, only the configuration file needs to be modified. After the configuration file is modified, the specific object loaded by the container is different, which can make the device class registered to the container different, so that the flexible call of the device can be realized without modifying the code. Specifically, the device library path can be used to find the encapsulated call library. In the process of initializing the IOC container, the function of creating the object is obtained from the call library. After obtaining the function pointer, the device name and function pointer are stored and registered in the container, which can be used to create the device object for subsequent parsing.
[0045] In step S201, an IOC container class object is created, including:
[0046] Step S2011: Create and detect the IOC container class object;
[0047] Step S2012: when the IOC container class object has been created, directly return to the IOC container class object;
[0048] Step S2013: When the IOC container class object has not been created, an IOC container class object is created.
[0049] In this embodiment, during the process of creating the IOC container class object, it is also necessary to perform a creation detection on the IOC container class object, so that when the IOC container class object has been created, the created IOC container class object can be directly used. If the IOC container class object has not been created, a corresponding IOC container class object is created.
[0050] In step S202, according to the device class call request, a configuration file is loaded in the IOC container class object to obtain the device name and device library path of the target device object corresponding to the device class call request, including:
[0051] Step S2021: Detect the device class in the IOC container according to the device class call request;
[0052] Step S2022: When the target device object corresponding to the device class call request does not exist in the device class, the configuration file is modified to obtain the device name and device library path of the target device object corresponding to the device class call request.
[0053] In this embodiment, when creating a target device object corresponding to a target cryptographic device, it is determined whether there is a target device object corresponding to the device class call request in the device class in the IOC container. If not, the configuration file needs to be modified, so as to obtain the device name and device library path of the target device object corresponding to the device class call request obtained after the modification, and obtain the corresponding creation function according to the device library path and register it in the IOC container to create the target device object. This achieves that when a new cryptographic device needs to be added, only the configuration file needs to be modified, and there is no need to modify the code of the upper-layer application, which greatly improves the maintainability and scalability of the system. In addition, this method also improves the flexibility and reusability of the code, which is conducive to the expansion and maintenance of the system.
[0054] Next, step S30 is executed. During the initialization process, a corresponding target device object is created for the IOC container according to the device class call request.
[0055] In the process of initializing the IOC container, when creating the target device object, it is necessary to create it according to the device class call request, that is, after registering the creation function of the target device object in the IOC container, the creation of the target device object is realized by calling the creation function in the IOC container according to the device class call request.
[0056] In step S30, according to the device class call request, a corresponding target device object is created for the IOC container, including:
[0057] Step S301: parsing the device class call request through the IOC container to obtain a creation function of a target device object corresponding to the device class call request;
[0058] Step S302: Create a target device object for the IOC container by creating a function.
[0059] In this embodiment, when creating a target device object for the IOC container, the device class call request is first parsed by using the IOC container in which the target device object is registered, thereby parsing a creation function corresponding to the device class call request, so that the target device object corresponding to the device class call request can be created for the IOC container according to the creation function, and the corresponding target cryptographic device can be called according to the target device object created in the IOC container.
[0060] In step S301, the device class call request is parsed through the IOC container to obtain a creation function of a target device object corresponding to the device class call request, including:
[0061] Step S3011: parsing the device class call request through the IOC container to obtain the device name corresponding to the target cryptographic device;
[0062] Step S3012: According to the device name, obtain the creation function of the corresponding target device object registered in the IOC container.
[0063] In this embodiment, when obtaining the creation function, the IOC container is parsed according to the device class call request to obtain the device name corresponding to the target cryptographic device in the device class call request. And then, according to the parsed device name, the creation function corresponding to the target device object is obtained in the IOC container, so that according to the device class call request, the corresponding target device object is created in the IOC container through the creation function, and the corresponding target cryptographic device is called through the target device object. Specifically, in the nuclear power instrumentation and control DCS system, the device name is the basis for the nuclear power instrumentation and control DCS system to call a specific cryptographic device. When calling the parsing function, the device name needs to be passed in, and the container will return the corresponding target device object called according to the passed in device name.
[0064] Next, step S40 is executed: according to the target device object, the corresponding target cryptographic device is called to provide corresponding cryptographic services through the target cryptographic device.
[0065] After the target device object is created in the IOC container, the corresponding target cryptographic device can be called through the target device object, so that the upper layer application can use the target device object to call the cryptographic service of the corresponding target cryptographic device.
[0066] In step S40, according to the target device object, the corresponding target cryptographic device is called to provide corresponding cryptographic services through the target cryptographic device, including:
[0067] According to the corresponding target device interface in the target device object, the corresponding target cryptographic device is called to provide the corresponding cryptographic service through the target cryptographic device.
[0068] In this embodiment, the target device object encapsulates the target device interface and corresponding functions of the target cryptographic device, so that the upper-layer application only needs to understand the unified interface provided by the IOC container without understanding the specific cryptographic device, that is, the corresponding target cryptographic device can be called through the target device object.
[0069] See also Figure 2 , Figure 2 In one embodiment, in a nuclear power instrumentation and control DCS system, the IOC mode is used to implement the calling service of the cryptographic device. Specifically, its core is the IOC container, which can load the class of each device (that is, the device class), and the configuration file is used to determine the specific device class (target device object) to load and the specific cryptographic device to call. The entire system is divided into three parts, namely the IOC container, each device class, and the upper-layer application that calls the service, such as the nuclear power instrumentation and control DCS system application. The upper-layer application can obtain each device object through the IOC container. Multiple types of devices can be loaded in the IOC container, and each type of device can distinguish multiple cryptographic devices. The cryptographic devices include cryptographic cards, cryptographic machines, USBKey, etc.
[0070] See also Figure 3 , Figure 3In one embodiment given, during the initialization of the IOC container, an IOC container class object is first created. When creating the IOC container, first check whether it has been created. If so, return the container object directly and load the configuration file. If not, create the IOC container object, load the configuration file, and obtain the specific configuration in the configuration file. Through the device class call request, check whether there is a corresponding creation function in the device library in the configuration file. If so, register it in the container object, and then create the corresponding device object by calling the parsing function for the device class call request. And call the corresponding cryptographic device for the upper-layer application according to the created device object. If the corresponding creation function does not exist in the device library in the configuration file, throw an exception and end. Through the above method, it can be realized that when the cryptographic device needs to be modified, it only needs to modify the configuration file. After the configuration file is modified, the specific object loaded by the container is different, and the specific device class registered to the container is also different, so that the flexible call of the cryptographic device can be realized without modifying the code.
[0071] Please refer to 4. The present invention also provides a cryptographic service system 11, which is applied to upper-level applications; the cryptographic service system 11 includes: a request unit 111, which is used to initiate a device class call request to the IOC container; an execution unit 112, which is used to initialize the IOC container through a configuration file according to the device class call request; a creation unit 113, which is used to create a corresponding target device object for the IOC container according to the device class call request during the initialization process; and a calling unit 114, which is used to call the corresponding target cryptographic device according to the target device object, so as to provide corresponding cryptographic services through the target cryptographic device.
[0072] It should be noted that the cryptographic service system 11 provided in the above embodiment and the cryptographic service method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the cryptographic service system 11 provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0073] See also Figure 5 The electronic device 1 may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a cryptographic service program.
[0074] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 12 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 12 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the password service, etc., but also can be used to temporarily store data that has been output or is to be output.
[0075] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, and uses various interfaces and lines to connect various components of the entire electronic device 1, and executes or executes programs or modules (such as cryptographic service programs, etc.) stored in the memory 12, and calls data stored in the memory 12 to execute various functions of the electronic device 1 and process data.
[0076] The processor 13 executes the operating system and various installed applications of the electronic device 1. The processor 13 executes the applications to implement the steps in the above-mentioned password service method.
[0077] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a request unit 111, an execution unit 112, a creation unit 113, and a call unit 114.
[0078] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium, and the computer-readable storage medium can be non-volatile or volatile. The above-mentioned software function module is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform part of the functions of the cryptographic service method described in each embodiment of the present application.
[0079] In summary, the cryptographic service method, system, electronic device and storage medium disclosed in the present invention can be implemented in high-security fields such as nuclear power instrumentation and control DCS systems, where the upper-layer applications such as nuclear power instrumentation and control DCS systems use IOC containers to create target device objects during initialization to obtain corresponding cryptographic device call interfaces to call cryptographic devices, so that the upper-layer devices can be compiled once and multiple different services of the lower layer can be called. This method can realize the encapsulation of the interface and function of the cryptographic device in the service class, and the upper-layer application only needs to understand the unified interface provided by the IOC container, without understanding the specific cryptographic device, and can call the specific cryptographic device through the IOC container. At the same time, when a new cryptographic device needs to be added, only the configuration file needs to be modified, and the code of the upper-layer application does not need to be modified, thereby greatly improving the maintainability and scalability of the system. In addition, this method also improves the flexibility and reusability of the code, which is conducive to the expansion and maintenance of the system. Therefore, the present invention effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.
[0080] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A cryptographic service method, characterized in that: Applied to upper layer applications; The password service method comprises: Initiate a device class call request to the IOC container; Initialize the IOC container through a configuration file according to the device class call request; During the initialization process, according to the device class call request, a corresponding target device object is created for the IOC container; According to the target device object, the corresponding target cryptographic device is called to provide corresponding cryptographic services through the target cryptographic device.
2. The cryptographic service method according to claim 1, characterized in that: Initializing the IOC container through a configuration file according to the device class call request, including: Create an IOC container class object; According to the device class call request, the configuration file is loaded in the IOC container class object to obtain a device name and a device library path of a target device object corresponding to the device class call request; According to the device library path, calling a creation function for creating a target device object from a calling library; The device name and the creation function corresponding to the target device object are registered in the IOC container to initialize the IOC container.
3. The cryptographic service method according to claim 2, characterized in that: Create an IOC container class object, including: Performing creation detection on the IOC container class object; When the IOC container class object has been created, directly return to the IOC container class object; When the IOC container class object has not been created, the IOC container class object is created.
4. The cryptographic service method according to claim 2, characterized in that: According to the device class call request, the configuration file is loaded in the IOC container class object to obtain the device name and device library path of the target device object corresponding to the device class call request, including: According to the device class call request, detecting the device class in the IOC container; When the target device object corresponding to the device class call request does not exist in the device class, the configuration file is modified to obtain the device name and device library path of the target device object corresponding to the device class call request.
5. The cryptographic service method according to claim 1, characterized in that: According to the device class call request, a corresponding target device object is created for the IOC container, including: Parsing the device class call request through the IOC container to obtain a creation function of a target device object corresponding to the device class call request; A target device object is created for the IOC container through the creation function.
6. The cryptographic service method according to claim 5, characterized in that: Parsing the device class call request through the IOC container to obtain a creation function of a target device object corresponding to the device class call request includes: Parsing the device class call request through the IOC container to obtain a device name corresponding to the target cryptographic device; According to the device name, a creation function of a corresponding target device object registered in the IOC container is obtained.
7. The cryptographic service method according to claim 1, characterized in that: According to the target device object, calling a corresponding target cryptographic device to provide a corresponding cryptographic service through the target cryptographic device includes: According to the corresponding target device interface in the target device object, the corresponding target cryptographic device is called to provide corresponding cryptographic services through the target cryptographic device.
8. A cryptographic service system, characterized in that: Applied to upper layer applications; The password service system comprises: A request unit, used to initiate a device class call request to the IOC container; An execution unit, configured to initialize the IOC container through a configuration file according to the device class call request; a creating unit, configured to create a corresponding target device object for the IOC container according to the device class call request during the initialization process; and The calling unit is used to call the corresponding target cryptographic device according to the target device object, so as to provide corresponding cryptographic services through the target cryptographic device.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the cryptographic service method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the cryptographic service method according to any one of claims 1 to 7.