CN115935321B - Method, device and storage medium for accessing algorithm library - Google Patents

Method, device and storage medium for accessing algorithm library Download PDF

Info

Publication number
CN115935321B
CN115935321B CN202211717317.8A CN202211717317A CN115935321B CN 115935321 B CN115935321 B CN 115935321B CN 202211717317 A CN202211717317 A CN 202211717317A CN 115935321 B CN115935321 B CN 115935321B
Authority
CN
China
Prior art keywords
information
target
file
registry key
algorithm library
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211717317.8A
Other languages
Chinese (zh)
Other versions
CN115935321A (en
Inventor
徐成刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhengyuan Xingjie Information Technology Co ltd
Zhongke Information Security Common Technology National Engineering Research Center Co ltd
Changchun Jida Zhengyuan Information Technology Co ltd
Original Assignee
Shenzhen Zhengyuan Xingjie Information Technology Co ltd
Zhongke Information Security Common Technology National Engineering Research Center Co ltd
Changchun Jida Zhengyuan Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhengyuan Xingjie Information Technology Co ltd, Zhongke Information Security Common Technology National Engineering Research Center Co ltd, Changchun Jida Zhengyuan Information Technology Co ltd filed Critical Shenzhen Zhengyuan Xingjie Information Technology Co ltd
Priority to CN202211717317.8A priority Critical patent/CN115935321B/en
Publication of CN115935321A publication Critical patent/CN115935321A/en
Application granted granted Critical
Publication of CN115935321B publication Critical patent/CN115935321B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses an access method, a device and a storage medium of an algorithm library, and relates to the technical field of computers, wherein the method comprises the steps of obtaining equipment information of USB equipment according to PID/VID information; acquiring a file to be associated, wherein the file to be associated comprises at least one registry key file, and the registry key file comprises registry key information; traversing at least one registry key information, and obtaining a target registry key file when the registry key information and the equipment information meet a preset relationship; and acquiring a storage path of the algorithm library from the target registry key file, and accessing the algorithm library according to the storage path. The invention can find the storage path of the algorithm library to be accessed in the registry item information through the PID/VID information of the USB equipment, so as to automatically access the algorithm library according to the storage path, and the automatically acquired algorithm library is a trusted algorithm library authenticated by an operating system, thereby improving the safety of equipment access and improving the access efficiency.

Description

Method, device and storage medium for accessing algorithm library
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a storage medium for accessing an algorithm library.
Background
The intelligent cipher key is one intelligent memory identity identifying equipment based on USB interface, and has built-in intelligent CPU, memory, chip operation system and safe file system for identity identification between the server and the user.
In the actual installation process of the USB device, the algorithm driving library is also installed in the operating system at the same time, but because no standard or standard convention is available at present how to safely and automatically call the algorithm library, the conventional algorithm library access mode is that the access information (library file name and access path) of the algorithm library needs to be communicated with the device provider in the implementation stage so as to realize the access to the algorithm library according to the access information improved by the device provider.
The existing access mode to the algorithm library has the risk that the access information provided by the equipment provider is wrong and is called to the unreliable algorithm library; and the access efficiency of the algorithm library is lower.
Disclosure of Invention
The invention provides an access method, an access device and a storage medium for an algorithm library, which can improve the existing access scheme for the algorithm library.
In a first aspect, the present invention provides a method for accessing an algorithm library, including:
acquiring device information of the USB device according to the PID/VID information;
acquiring a file to be associated, wherein the file to be associated comprises at least one registry key file, and the registry key file comprises registry key information;
traversing at least one piece of registry key information, and obtaining a target registry key file when the registry key information and the equipment information meet a preset relation;
and acquiring a storage path of an algorithm library from the target registry key file, and accessing the algorithm library according to the storage path.
In a second aspect, the present invention provides an access device for an algorithm library, the device comprising:
The device information acquisition module is used for acquiring the device information of the USB device according to the PID/VID information;
The system comprises an association file acquisition module, a registration file generation module and a registration file generation module, wherein the association file acquisition module is used for acquiring a file to be associated, the file to be associated comprises at least one registry item file, and the registry item file comprises registry item information;
The table item information traversing module is used for traversing at least one piece of registry item information, and acquiring a target registry item file when the registry item information and the equipment information meet a preset relation;
and the algorithm library access module is used for acquiring a storage path of an algorithm library from the target registry key file and accessing the algorithm library according to the storage path.
In a third aspect, the present invention also provides an electronic device, including:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of accessing the algorithm library according to any one of the embodiments of the present invention.
In a fourth aspect, the present invention further provides a computer readable storage medium, where computer instructions are stored, where the computer instructions are configured to cause a processor to execute the method for accessing an algorithm library according to any embodiment of the present invention.
The invention provides an access scheme of an algorithm library, which comprises the steps of firstly, obtaining equipment information of USB equipment according to PID/VID information; then obtaining a file to be associated, wherein the file to be associated comprises at least one registry key file, and the registry key file comprises registry key information; traversing at least one registry key information, and obtaining a target registry key file when the registry key information and the equipment information meet a preset relationship; and finally, acquiring a storage path of the algorithm library from the target registry key file, and accessing the algorithm library according to the storage path. According to the scheme provided by the embodiment, the storage path of the algorithm library to be accessed can be searched in the registry item information through the PID/VID information of the USB equipment, so that the algorithm library is automatically accessed according to the storage path, the automatically acquired algorithm library is the trusted algorithm library authenticated by the operating system, the problem of access risk caused by providing inaccurate information according to a third party is avoided, the safety of equipment access is improved, and the beneficial effects of improving the access efficiency are achieved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and should not be considered as limiting the scope, and that other related drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an algorithm library access method provided by the invention;
FIG. 2 is another flow chart of the algorithm library access method provided by the invention;
FIG. 3 is a schematic diagram of a configuration of an algorithm library access device according to the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a detailed description of the same will be given below with reference to the accompanying drawings in this embodiment, and it is apparent that the described embodiment is only a partial embodiment of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Fig. 1 is a schematic flow chart of an algorithm library access method provided by the present invention, where the present embodiment is applicable to a case of automatically accessing an algorithm library, the method may be performed by an algorithm library access device, the device may be implemented in hardware and/or software, and the device may be configured in a computer device such as a server. Referring to fig. 1, the method may specifically include the steps of:
S110, acquiring device information of the USB device according to the PID/VID information.
The USB device (USB Key, also called intelligent password Key) is a small-sized storage device which is directly connected with a computer through USB (universal serial bus interface), has password verification function and is reliable and high-speed. The USB equipment can store the private key and the digital certificate of the user, and can realize authentication of the user identity by utilizing a public key algorithm built in the USB equipment, thereby ensuring the security when the user logs in a system or banks.
According to the usage specification of the USB devices, all the USB devices include a Product ID (PID) and a Vendor ID (VID), i.e., PID/VID information, and the computer system distinguishes the USB devices through the PID/VID information of the devices. Both the general VID and the PID are two bytes long, wherein the VID is obtained by the vendor from the USB executive forum, and the VID of each vendor is unique; the PID is determined by the vendor itself. The USB device is identified using a4 byte-length string of a combination of PID and VID as a unique identification.
The driver carried in the USB device is generally required to be installed before the USB device is used, so that an algorithm library and the like required when the USB device is to be used are performed in advance, and in the process of installation, the driver needs to be installed together with a dynamic library (i.e. a "registry key file" in a subsequent step) required to be called by the middleware, so that connection between the upper layer application software and the lower layer core component is realized through the middleware. According to the scheme, the operation of calling the corresponding interface and acquiring the information can be realized through the middleware. The middleware may be a public key cryptography encryption standard (Public key cryptographic standard, abbreviated as pkcs#11) or an encryption service provider (Cryptographic Service Provider, abbreviated as CSP), and the type of use of the middleware in the embodiment is not limited herein.
When the USB device is used, in order to realize automatic calling of the middleware in the USB device to the trusted algorithm library, so that the safety of algorithm library calling is improved, and the calling efficiency of the algorithm library is improved, the algorithm library calling scheme provided by the embodiment firstly obtains the device information of the USB device according to the PID/VID information of the accessed system.
Because the PID/VID information in the access system is unique each time, the device information of the corresponding USB device can be acquired according to the current PID/VID information. The device information of the current USB device may include name information, attribute information, occupied memory information, and the like of the USB device, and the content included in the specific device information is not limited herein.
S120, acquiring a file to be associated, wherein the file to be associated comprises at least one registry key file, and the registry key file comprises registry key information.
Registry files corresponding to all USB devices which are installed in a system history are stored in the files to be associated, and usually each registry file is named according to registry information, and the current registry information can be information related to the device information of each USB device. The purpose of this arrangement is to facilitate the determination of the corresponding target registry key file in the file to be associated in a subsequent step from the obtained device information of the USB device.
Taking the USB device information as "jit usbdevice" as an example, it is known that the device name of the current USB device is "jit", and when a corresponding registry file is generated in the file to be associated, the registry information corresponding to the current registry may be named by using the content related to "jit", and the naming manner of the registry information is not limited herein, so long as the registry information includes the information associated with the device information.
The files to be associated can be "Provider" files stored in a preset position of the system in advance, namely, all registry item files required to be used by the middleware in the process of calling the algorithm library are stored under the "Provider" files, so that the target registry item files can be quickly found in the subsequent steps.
It should be noted that, the current files to be associated may be distinguished according to the type of the middleware used, that is, when the USB device is used in history, the related call file with the type of the middleware being CSP may be stored in one file to be associated, the related call file with the type of the middleware being pkcs#11 may be stored in another file to be associated, and the registry information may include, in addition to the content associated with the device information of the USB device, the type information, version information of the middleware, and the like. For example, when the registry key information may be "jit CSP V1.0.0", where "jit" is device information of a USB device, "CSP" is type information of a middleware, "V1.0" is version information of the middleware, and the like, the content included in the registry key information is not limited herein.
S130, traversing at least one registry key information, and obtaining a target registry key file when the registry key information and the equipment information meet a preset relationship.
The files to be associated include a plurality of registry files, and each registry file uses the corresponding registry information to name and store, so that in the current step, the registry information can be traversed according to the device information of the USB device obtained in step S110, so as to obtain the target registry file.
The traversing of the at least one registry key information may be performed by acquiring target information from the acquired device information of the USB device, and indicating that the registry key file corresponding to the current registry key information is the target registry key file when the registry key information includes the target information.
The target information may be a device name, a device attribute, timestamp information generated by device installation, or the like of the USB device, and the content indicated by the specific target information is not limited herein, so long as a unique corresponding target registry key file can be found in the files to be associated according to the device information.
It should be noted that, whether the target information is a device name, a device attribute, or timestamp information generated by device installation, when the USB device is installed, when the registry file to be called by the middleware is named by using the registry information, the registry information should also include the target information, which is to be used for obtaining the target registry file only when traversing at least one registry information included in the file to be associated according to the target information, where the registry information is also stored according to the corresponding target information.
S140, acquiring a storage path of the algorithm library from the target registry key file, and accessing the algorithm library according to the storage path.
The purpose of obtaining the target registry key file is that the storage path of the algorithm library required by the current USB device is stored in the target registry key file, so that the target registry key file is obtained from the file to be associated, the storage path of the algorithm library is obtained from the target registry key file, and finally the normal access to the algorithm library is realized according to the storage path of the algorithm library. Through the steps, the middleware can automatically find a trusted algorithm library to be called according to the PID/VID information of the USB equipment, so that the intelligent password key can be safely accessed through the algorithm library, and the technical defects in the prior art are overcome.
According to the access method of the algorithm library provided by the embodiment, firstly, equipment information of the USB equipment is obtained according to PID/VID information; then obtaining a file to be associated, wherein the file to be associated comprises at least one registry key file, and the registry key file comprises registry key information; traversing at least one registry key information, and obtaining a target registry key file when the registry key information and the equipment information meet a preset relationship; and finally, acquiring a storage path of the algorithm library from the target registry key file, and accessing the algorithm library according to the storage path. According to the scheme provided by the embodiment, the storage path of the algorithm library to be accessed can be searched in the registry item information through the PID/VID information of the USB equipment, so that the algorithm library is automatically accessed according to the storage path, the automatically acquired algorithm library is the trusted algorithm library authenticated by the operating system, the problem of access risk caused by providing inaccurate information according to a third party is avoided, the safety of equipment access is improved, and the beneficial effects of improving the access efficiency are achieved.
Fig. 2 is another flow chart of the algorithm library access method provided by the present invention, and the relationship between the present embodiment and the above embodiment further refines the corresponding features of the above embodiment. As shown in fig. 2, the method may include the steps of:
S210, receiving an information acquisition instruction.
The current information obtaining instruction may be an instruction generated by the operating system to obtain related information about the USB device, and in an exemplary embodiment, the current information obtaining instruction may be an instruction for obtaining a device name, a device attribute, a device occupied memory, etc., where the information obtaining instruction provided in this embodiment is used to obtain PID/VID information of the USB device in the access system.
S211, the control API interface acquires PID/VID information of the accessed system according to the information acquisition instruction.
Because the PID/VID information is unique identification information of each USB device, and only one USB device is accessed in the system at a time, when the API interface acquires the PID/VID information of the accessed system according to the information acquisition instruction, only the PID/VID information of one USB device can be acquired,
An application programming interface (Application Programming Interface, abbreviated as API) is a call interface that the operating system leaves to the application, and the application makes the operating system execute the corresponding instructions of the application by calling the API of the operating system.
S220, judging whether the PID/VID information is prestored in a maintenance white list.
In the practical application of the USB equipment, the system comprises a maintenance white list, a trusted PID/VID information list is contained in the maintenance white list, the associated algorithm library of the PID/VID information in the current maintenance white list is trusted, and the current algorithm library can be used, so that the secret key used in service realization is ensured to be safe.
Therefore, after the PID/VID information is obtained, it needs to be determined whether the current PID/VID information is pre-stored in the maintenance white list, if so, it indicates that the algorithm library obtained according to the current PID/VID information in the subsequent step is safe, and step S221 may be executed; if not, it indicates that the current PID/VID information is not verified, and the corresponding algorithm library is not trusted, and step S222 is executed, that is, the current access operation to the algorithm library is ended.
S221, obtaining the device information of the USB device according to the PID/VID information.
S222, ending the access operation to the algorithm library.
S230, acquiring a file to be associated, wherein the file to be associated comprises at least one registry key file, and the registry key file comprises registry key information.
S240, receiving a field extraction instruction.
The field extraction instruction includes a target field of the device information, the current target field indicating a field corresponding to the device name. Illustratively, taking device information of "jit usbdevice" as an example, a field corresponding to the device name "jit" is a target field. The purpose of this is that the field extraction instruction may determine the target registry key file from the registry key information based on the target field.
S241, sequentially extracting the fields of at least one piece of registry information according to the field extraction instruction to obtain a name field corresponding to each piece of registry information.
The field extraction instruction is configured to perform field extraction on registry information, where each registry file corresponds to registry information with a longer and more complex name, and the registry information may include a system name, a middleware name, a version number, a device name, and so on. Therefore, in order to facilitate quick acquisition of core content from registry information, field extraction may be sequentially performed on registry item information according to the field extraction instruction.
Taking the registry key information as "Microsoft Base CSP jit Provider" as an example, in the process of sequentially extracting the fields of the registry key information, each registry key information may obtain a plurality of name fields, for example, a name field may be extracted, where the name field includes a "Microsoft" field, a "Base" field, a "CSP" field, a "jit" field, and a "Provider" field. The contents of the fields included in the registry key information are not limited herein, and are based on the actual application requirements.
S242, when the name field contains the target field, the registry file corresponding to the registry information is the target registry file.
Sequentially searching name fields extracted from registry key information, and indicating that a registry key file corresponding to the current registry key information is a target registry key file when the current registry key information contains a target field in the equipment information; otherwise, the operation of field extraction is continued for the next registry key information according to the field extraction instruction.
Continuing with the example of the target field being "jit", when the current registry key information includes the "jit" field, it indicates that the registry key file corresponding to the current registry key information is the target registry key file.
It should be noted that, the target field provided in this embodiment is not limited by a field corresponding to a device name of the USB device, but may be a field such as a device attribute or an installation timestamp of the device, so long as a corresponding target registry key file can be found in registry key information included in the file to be associated according to the current field.
S250, obtaining the name of the target data item from the target registry key file.
The target registry key file comprises a plurality of data items, and each data item comprises a corresponding data type and a data value; each data item name, data type and data value can be content which is automatically built by default for the system, or can be preset, and the corresponding data item name, data type and data value can be stored in the corresponding registry key file in the stage of installing the USB device.
Illustratively, the data item names of the data items contained in the target registry key file may include: for example, "IMAGE PATH", "SKFIMAGEPATH" and "Type", the data Type corresponding to each data item may be reg_sz or reg_ DWPRG, and the content corresponding to each data value may be null, a default value or a content set for the current data item. The specific contents of the data item names, data types, and data values contained in the specific target registry key file are not limited herein.
When the USB device is installed, the driver package contains a target data table name, and an installation path when the algorithm library is installed is used as a data value and stored in a target registry file together with the target data table name. When the target data item name is acquired in the target registry item file, only the default data item name is acquired in the target registry item file.
It should be noted that, the data entry names may be preset by the device provider and stored in the driver package, or may be user-defined, and the specific setting manner of the data entry names is not limited herein, so long as the obtained data entry names can be found in the target registry entry file.
S260, obtaining a storage path of the algorithm library according to the data value corresponding to the name of the target data item.
In the target registry key file, the data value corresponding to each data key name may have a practical meaning or may have no practical meaning, and the content of the data value corresponding to each data key is not limited herein. But for the target data item name, the corresponding data value is a storage path for installing the algorithm library, and in this way, the storage path of the algorithm library can be obtained according to the data value, so as to realize safe access to the algorithm library according to the storage path.
In one implementation, the target registry key file is stored in the file to be associated by:
When the system receives the installation operation of the USB equipment, acquiring equipment information of the USB equipment; and a target registry key file is newly built in the file to be associated according to the equipment information, wherein the target registry key file comprises target registry key information, and the target registry key information and the equipment information meet a preset relation.
When the USB equipment is installed, an installation path of an algorithm library is pre-agreed in a driver package, the algorithm library is automatically installed according to the current installation path, and registry files corresponding to all manufacturers of all historical USB equipment are contained in files to be associated, so that when the current USB equipment is installed, a target registry file related to the name of the current USB equipment is synchronously newly built in the files to be associated according to equipment information, and the target registry file can be searched in the files to be associated according to a preset relation.
In yet another implementation, the target data item name and data value are stored in the target registry key file by: installing an algorithm library according to a driving package carried by the USB equipment, wherein the driving package comprises an installation path of the algorithm library, an algorithm library name and a target data item name; obtaining a data value corresponding to the name of the target data item according to the name of the algorithm library and the installation path of the algorithm library; and storing the data value corresponding to the target data item name into the target registry key file.
When installing USB equipment, when installing an algorithm library, presetting an installation path of the algorithm library, an algorithm library name and a target data item name in a driving package, writing the installation path of the algorithm library and the algorithm library name into a data value corresponding to the target data item name in a target registry item file according to the current target data item name in the target registry item file so as to realize the pre-storage of the target data item name and the data value.
Illustratively, the name of the preset algorithm library in the drive package is ABCSKF.dll, the installation position of the algorithm library is C \WINDOWS\system32, and the name of the target data item is SKFIMAGEPATH; when the USB device is installed, a registry key file of device information about the USB device may be generated in the file to be associated, for example, a current registry key file name is "Microsoft Base CSP jit Provider", and in the current registry key file, a target data item name is "SKFIMAGEPATH", a data type may be "reg_sz", and a data value is "C: \windows\system 32\abckf. Dll", where when the target data item name is obtained, the data value corresponding to the target data item name is the path of the algorithm library to be called by the middleware.
In another implementation manner, the access scheme of the algorithm library provided in this embodiment, after obtaining the storage path of the algorithm library, further includes: acquiring at least one target algorithm contained in an algorithm library; the USB device is accessed according to at least one target algorithm.
After the storage path of the algorithm library is obtained, performing relevant access operation on the algorithm library according to the storage path. The algorithm library contains at least one associated target algorithm, the current target algorithm can be understood as an algorithm supported by the algorithm library, and the USB device can be accessed according to the associated target algorithm library, so that the advantage is that the algorithm is called through the target algorithm associated by the algorithm library, for example: if the current algorithm library does not support the SM9 algorithm, the SM9 is not called any more, and program crash and other conditions caused by calling the unsupported algorithm can be avoided.
According to the access method of the algorithm library, the trusted algorithm library is automatically obtained according to the PID/VID information of the equipment, so that labor is saved, and the obtained information is accurate; before the driver of the USB equipment provider is installed, the driver needs to be authenticated by an operating system, and if yes, the access operation of the corresponding algorithm library is continued by verifying whether the PID/VID information of the USB equipment is in the maintenance white list, so that the risk of key leakage caused by the fact that the untrusted algorithm library is not used by middleware through the authentication of the operating system is avoided. According to the scheme provided by the embodiment, the application system can safely and automatically acquire the corresponding trusted secret algorithm library, so that the USB equipment can be automatically accessed into the application system, the safety of equipment access is improved, and the access efficiency is improved.
Fig. 3 is a schematic structural diagram of an algorithm library accessing device provided by the present invention, which is suitable for executing the algorithm library accessing method provided by the present embodiment. As shown in fig. 3, the apparatus may specifically include: a device information acquisition module 310, an associated file acquisition module 320, an entry information traversal module 330, and an algorithm library access module 340, wherein:
a device information obtaining module 310, configured to obtain device information of the USB device according to the PID/VID information;
An association file obtaining module 320, configured to obtain a file to be associated, where the file to be associated includes at least one registry key file, and the registry key file includes registry key information;
An item information traversing module 330, configured to traverse at least one piece of registry item information, and obtain a target registry item file when the registry item information and the device information satisfy a preset relationship;
and the algorithm library access module 340 is configured to obtain a storage path of an algorithm library from the target registry key file, and access the algorithm library according to the storage path.
The access device of the algorithm library provided by the embodiment firstly obtains the equipment information of the USB equipment according to the PID/VID information; then obtaining a file to be associated, wherein the file to be associated comprises at least one registry key file, and the registry key file comprises registry key information; traversing at least one registry key information, and obtaining a target registry key file when the registry key information and the equipment information meet a preset relationship; and finally, acquiring a storage path of the algorithm library from the target registry key file, and accessing the algorithm library according to the storage path. According to the scheme provided by the embodiment, the storage path of the algorithm library to be accessed can be searched in the registry item information through the PID/VID information of the USB equipment, so that the algorithm library is automatically accessed according to the storage path, the automatically acquired algorithm library is the trusted algorithm library authenticated by the operating system, the problem of access risk caused by providing inaccurate information according to a third party is avoided, the safety of equipment access is improved, and the beneficial effects of improving the access efficiency are achieved.
In one embodiment, the table entry information traversing module 330 includes: a first instruction receiving unit, a field extracting unit, and a target file obtaining unit, wherein:
A first instruction receiving unit configured to receive a field extraction instruction, the field extraction instruction including a target field of the device information;
the field extraction unit is used for sequentially extracting the fields of at least one piece of registry key information according to the field extraction instruction to obtain a name field corresponding to each piece of registry key information;
and the target file obtaining unit is used for obtaining the registry item file corresponding to the registry item information as the target registry item file when the name field contains the target field.
In one embodiment, the algorithm library access module 340 includes: a target name acquisition unit and a storage path acquisition unit, wherein:
The target name acquisition unit is used for acquiring a target data item name from the target registry item file;
And the storage path obtaining unit is used for obtaining the storage path of the algorithm library according to the data value corresponding to the target data item name.
In one embodiment, the target registry key file is stored in the file to be associated by:
Acquiring equipment information of the USB equipment when a system receives installation operation of the USB equipment;
And newly establishing the target registry key file in the file to be associated according to the equipment information, wherein the target registry key file comprises target registry key information, and the target registry key information and the equipment information meet a preset relation.
In one embodiment, the target data item name and the data value are stored in the target registry key file as follows:
installing the algorithm library according to a driving package carried by the USB equipment, wherein the driving package comprises an installation path of the algorithm library, an algorithm library name and a target data item name;
Obtaining a data value corresponding to the target data item name according to the algorithm library name and the algorithm library installation path;
and storing the data value corresponding to the target data item name into the target registry key file.
In one embodiment, the device information acquisition module 310 includes: a second instruction receiving unit, an information acquiring unit, and an apparatus information acquiring unit, wherein:
The second instruction receiving unit is used for receiving the information acquisition instruction;
the information acquisition unit is used for controlling an API interface to acquire the PID/VID information of the accessed system according to the information acquisition instruction;
And the device information obtaining unit is used for obtaining the device information of the USB device according to the PID/VID information.
In one embodiment, the apparatus further comprises: an information judgment unit in which:
An information judging unit for judging whether the PID/VID information is prestored in a maintenance white list; if yes, executing the operation of acquiring the equipment information of the USB equipment according to the PID/VID information.
In one embodiment, the apparatus further comprises: a target algorithm acquisition module and a device access module, wherein:
The target algorithm acquisition module is used for acquiring at least one target algorithm contained in the algorithm library;
And the device access module is used for accessing the USB device according to at least one target algorithm.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above. The specific working process of the functional module described above may refer to the corresponding process in the foregoing method embodiment, and will not be described herein.
The invention also provides an electronic device, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the method for accessing the algorithm library according to any embodiment of the present invention.
The invention also provides a computer readable medium, wherein the computer readable storage medium stores computer instructions, and the computer instructions are used for enabling a processor to implement the algorithm library access method according to any embodiment of the invention when being executed.
Referring now to FIG. 4, there is illustrated a schematic diagram of a computer system 500 suitable for use in implementing the electronic device of the present invention. The electronic device shown in fig. 4 is only one example, and should not impose any limitation on the functions and the scope of use of the present embodiment.
As shown in fig. 4, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output portion 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 501.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules and/or units involved in the present embodiment may be implemented by software, or may be implemented by hardware. The described modules and/or units may also be provided in a processor, e.g., may be described as: the processor comprises a device information acquisition module, an associated file acquisition module, an item information traversing module and an algorithm library access module. The names of these modules do not constitute a limitation on the module itself in some cases.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: acquiring device information of the USB device according to the PID/VID information; acquiring a file to be associated, wherein the file to be associated comprises at least one registry key file, and the registry key file comprises registry key information; traversing at least one piece of registry key information, and obtaining a target registry key file when the registry key information and the equipment information meet a preset relation; and acquiring a storage path of an algorithm library from the target registry key file, and accessing the algorithm library according to the storage path.
According to the technical scheme of the embodiment, the storage path of the algorithm library to be accessed can be found in the registry item information through the PID/VID information of the USB equipment, so that the algorithm library is automatically accessed according to the storage path, the automatically acquired algorithm library is the trusted algorithm library authenticated by the operating system, the problem of access risk caused by providing inaccurate information according to a third party is avoided, the safety of equipment access is improved, and the beneficial effects of improving the access efficiency are achieved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (8)

1. An access method for an algorithm library, comprising:
Acquiring device information of the USB device according to the PID and the VID information;
acquiring a file to be associated, wherein the file to be associated comprises at least one registry key file, and the registry key file comprises registry key information;
traversing at least one piece of registry key information, and obtaining a target registry key file when the registry key information and the equipment information meet a preset relation;
acquiring a storage path of an algorithm library from the target registry key file, and accessing the algorithm library according to the storage path;
wherein traversing at least one piece of registry key information, and obtaining a target registry key file when the registry key information and the equipment information meet a preset relationship, comprises:
receiving a field extraction instruction, wherein the field extraction instruction comprises a target field of the equipment information;
sequentially extracting fields of at least one piece of registry key information according to the field extraction instruction to obtain a name field corresponding to each piece of registry key information;
When the name field contains the target field, the registry key file corresponding to the registry key information is the target registry key file;
The obtaining the storage path of the algorithm library from the target registry key file comprises the following steps:
Acquiring a target data item name from the target registry key file;
And obtaining a storage path of the algorithm library according to the data value corresponding to the target data item name.
2. The method of claim 1, wherein the target registry key file is stored in the file to be associated by:
Acquiring equipment information of the USB equipment when a system receives installation operation of the USB equipment;
And newly establishing the target registry key file in the file to be associated according to the equipment information, wherein the target registry key file comprises target registry key information, and the target registry key information and the equipment information meet a preset relation.
3. The method of claim 1, wherein the target data item name and the data value are stored in the target registry key file by:
installing the algorithm library according to a driving package carried by the USB equipment, wherein the driving package comprises an installation path of the algorithm library, an algorithm library name and a target data item name;
Obtaining a data value corresponding to the target data item name according to the algorithm library name and the algorithm library installation path;
and storing the data value corresponding to the target data item name into the target registry key file.
4. The method of claim 1, wherein the obtaining device information of the USB device based on the PID and VID information comprises:
Receiving an information acquisition instruction;
the control API interface acquires the PID and VID information of the accessed system according to the information acquisition instruction;
and obtaining the equipment information of the USB equipment according to the PID and the VID information.
5. The method of claim 1, further comprising, prior to obtaining device information for the USB device based on the PID and VID information:
judging whether the PID and VID information is prestored in a maintenance white list;
If yes, executing the operation of acquiring the device information of the USB device according to the PID and the VID information.
6. The method according to claim 1, wherein the method further comprises:
Acquiring at least one target algorithm contained in the algorithm library;
Accessing the USB device according to at least one of the target algorithms.
7. An algorithm library access device, comprising:
the device information acquisition module is used for acquiring the device information of the USB device according to the PID and the VID information;
The system comprises an association file acquisition module, a registration file generation module and a registration file generation module, wherein the association file acquisition module is used for acquiring a file to be associated, the file to be associated comprises at least one registry item file, and the registry item file comprises registry item information;
The table item information traversing module is used for traversing at least one piece of registry item information, and acquiring a target registry item file when the registry item information and the equipment information meet a preset relation;
The algorithm library access module is used for acquiring a storage path of an algorithm library from the target registry key file and accessing the algorithm library according to the storage path;
the table item information traversing module comprises: the device comprises a first instruction receiving unit, a field extracting unit and a target file obtaining unit;
The first instruction receiving unit is configured to receive a field extraction instruction, where the field extraction instruction includes a target field of the device information;
The field extraction unit is used for sequentially extracting the fields of at least one piece of registry key information according to the field extraction instruction to obtain a name field corresponding to each piece of registry key information;
The target file obtaining unit is configured to, when the name field includes the target field, set a registry key file corresponding to the registry key information as the target registry key file; wherein the algorithm library access module comprises: a target name acquisition unit and a storage path acquisition unit;
the target name acquisition unit is used for acquiring a target data item name from the target registry item file;
The storage path obtaining unit is used for obtaining the storage path of the algorithm library according to the data value corresponding to the target data item name.
8. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a method of accessing an algorithm library according to any of claims 1-6.
CN202211717317.8A 2022-12-29 2022-12-29 Method, device and storage medium for accessing algorithm library Active CN115935321B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211717317.8A CN115935321B (en) 2022-12-29 2022-12-29 Method, device and storage medium for accessing algorithm library

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211717317.8A CN115935321B (en) 2022-12-29 2022-12-29 Method, device and storage medium for accessing algorithm library

Publications (2)

Publication Number Publication Date
CN115935321A CN115935321A (en) 2023-04-07
CN115935321B true CN115935321B (en) 2024-04-19

Family

ID=86557647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211717317.8A Active CN115935321B (en) 2022-12-29 2022-12-29 Method, device and storage medium for accessing algorithm library

Country Status (1)

Country Link
CN (1) CN115935321B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117009251B (en) * 2023-09-26 2024-01-02 中船奥蓝托无锡软件技术有限公司 Data analysis system, data analysis algorithm library, dynamic loading method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007052541A (en) * 2005-08-16 2007-03-01 Fujifilm Holdings Corp Image management device and program
CN101436234A (en) * 2008-04-30 2009-05-20 北京飞天诚信科技有限公司 System and method for ensuring operation environment safety
CN102004655A (en) * 2010-11-25 2011-04-06 北京飞天诚信科技有限公司 Device and method for automatically installing drivers

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007052541A (en) * 2005-08-16 2007-03-01 Fujifilm Holdings Corp Image management device and program
CN101436234A (en) * 2008-04-30 2009-05-20 北京飞天诚信科技有限公司 System and method for ensuring operation environment safety
CN102004655A (en) * 2010-11-25 2011-04-06 北京飞天诚信科技有限公司 Device and method for automatically installing drivers

Also Published As

Publication number Publication date
CN115935321A (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US9667426B2 (en) Information processing apparatus, program, storage medium and information processing system
CN111695156A (en) Service platform access method, device, equipment and storage medium
US20140258128A1 (en) Method for managing fund security and mobile terminal
CN109462601B (en) Multi-platform access method and device based on eSIM
CN112039826B (en) Login method and device applied to applet end, electronic equipment and readable medium
CN108763951B (en) Data protection method and device
US20190108329A1 (en) Method and Terminal for Enhancing Information Security
CN115935321B (en) Method, device and storage medium for accessing algorithm library
WO2017084569A1 (en) Method for acquiring login credential in smart terminal, smart terminal, and operating systems
CN112738021A (en) Single sign-on method, terminal, application server, authentication server and medium
EP1422958B1 (en) Permission token management system, permission token management method, program and recording medium
CN104751046B (en) A kind of user authen method and mobile terminal device of application program
CN106919812B (en) Application process authority management method and device
CN109699030B (en) Unmanned aerial vehicle authentication method, device, equipment and computer readable storage medium
CN109635558B (en) Access control method, device and system
CN112565251B (en) Access authentication method, device and system for vehicle-mounted application
US20240031166A1 (en) Web-side data signature method and apparatus and computer device
WO2015081834A1 (en) Method and apparatus for distinguishing software types
CN107016266B (en) Content-based authentication
CN112825094A (en) Data permission verification method and device
CN108768973B (en) Trusted application operation request auditing method and trusted application management server
CN115250186B (en) Network connection authentication method, device, computer equipment and storage medium
CN112367347B (en) Encryption equipment access method, device and computer readable storage medium
CN108171046B (en) Terminal verification flow simplification method, device, equipment and readable storage medium
CN114092043A (en) Data management platform, method, device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant