CN115935321A - Access method and device of algorithm library and storage medium - Google Patents

Access method and device of algorithm library and storage medium Download PDF

Info

Publication number
CN115935321A
CN115935321A CN202211717317.8A CN202211717317A CN115935321A CN 115935321 A CN115935321 A CN 115935321A CN 202211717317 A CN202211717317 A CN 202211717317A CN 115935321 A CN115935321 A CN 115935321A
Authority
CN
China
Prior art keywords
information
file
target
registry
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.)
Granted
Application number
CN202211717317.8A
Other languages
Chinese (zh)
Other versions
CN115935321B (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

Images

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

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an access method, a device and a storage medium of an algorithm library, relating 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 file, and the registry file comprises registry information; traversing at least one registry key information, and acquiring 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 method and the device can search the storage path of the algorithm library needing to be accessed in the registry information through the PID/VID information of the USB device, 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 achieving the beneficial effects of improving the security of device access and improving the access efficiency.

Description

Access method and device of algorithm library and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an algorithm library access method, an algorithm library access device, and a storage medium.
Background
The intelligent cipher key is one intelligent memory identity authenticating device based on USB interface, and has built-in intelligent card CPU, memory, chip operating system and safety file system for identity authentication between the server and the user.
In the actual installation process of the USB device, the algorithm driver library is also installed in the operating system, but because there is no specification or standard convention how to safely and automatically call the algorithm library at present, the existing access mode of the algorithm library is that it is necessary to communicate with the device provider at the implementation stage to confirm the access information (library file name and access path) of the algorithm library, so as to realize the access to the algorithm library according to the access information improved by the device provider.
The existing access mode of the algorithm library has the risk that the access information provided by an equipment provider is wrong and the untrusted algorithm library is called; and the access efficiency of the algorithm library is low.
Disclosure of Invention
The invention provides an access method, an access device and a storage medium of an algorithm library, which can improve the existing access scheme of the algorithm library.
In a first aspect, the present invention provides a method for accessing an algorithm library, including:
acquiring the equipment information of the USB equipment according to the PID/VID information;
acquiring a file to be associated, wherein the file to be associated comprises at least one registry file, and the registry file comprises registry information;
traversing at least one piece of registry key information, and when the registry key information and the equipment information meet a preset relationship, obtaining a target registry key file;
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 apparatus for accessing an algorithm library, the apparatus 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 associated file acquisition module, a file association module and a file association module, wherein the associated file acquisition module is used for acquiring a file to be associated, the file to be associated comprises at least one registry file, and the registry file comprises registry information;
the table entry information traversing module is used for traversing at least one piece of registry entry information and obtaining a target registry entry file when the registry entry information and the equipment information meet a preset relationship;
and the algorithm library access module is used for acquiring a storage path of the algorithm library from the target registry 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 content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform a method of accessing a library of algorithms according to any embodiment of the present invention.
In a fourth aspect, the present invention further provides a computer-readable storage medium storing computer instructions for causing a processor to implement the method for accessing an algorithm library according to any one of the embodiments of the present invention when the computer instructions are executed.
The access scheme of the algorithm library provided by the invention comprises the steps of firstly obtaining the equipment information of the USB equipment according to the PID/VID information; then acquiring a file to be associated, wherein the file to be associated comprises at least one registry file, and the registry file comprises registry 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 required to be accessed can be searched in the registry information through the PID/VID information of the USB equipment, so that the algorithm library is automatically accessed according to the storage path, and the automatically acquired algorithm library is a trusted algorithm library authenticated by an operating system, so that the problem of access risk caused by providing inaccurate information according to a third party is avoided, and the beneficial effects of improving the equipment access safety and improving the access efficiency are achieved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to these drawings without inventive effort.
FIG. 1 is a schematic flow chart of a method for accessing an algorithm library provided by the present invention;
FIG. 2 is another schematic flow chart of the access method of the algorithm library provided by the present invention;
FIG. 3 is a schematic diagram of a structure of an access device of the algorithm library provided by the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions of the present invention will be clearly and completely described below with reference to the drawings in the present embodiment, and it is obvious that the described embodiments are only a part of embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The present invention will be described in further detail 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 of the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Fig. 1 is a schematic flow chart of an access method for an algorithm library provided by the present invention, and this embodiment may be applied to a case of performing automatic access to the algorithm library, where the method may be performed by an access device for the algorithm library, and the access device may be implemented in a form of hardware and/or software, and the access device may be configured in a computer device such as a server. Referring to fig. 1, the method may specifically include the following steps:
and S110, acquiring the device information of the USB device according to the PID/VID information.
A USB device (USB Key, also called an intelligent password Key) is a small storage device that is directly connected to a computer through a USB (universal serial bus interface), has a password authentication function, and is reliable and high-speed. The USB device can store a private key and a digital certificate of a user, and can realize the authentication of the user identity by utilizing a public key algorithm built in the USB device, thereby ensuring the security when the user logs in a system or a bank for transaction.
According to the usage specification of USB devices, all 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 according to the PID/VID information of the devices. Generally, both the VID and the PID are two bytes long, wherein the VID is obtained by suppliers applying to the USB execution forum, and the VID of each supplier is unique; the PID is determined by the supplier. A 4 byte length string that combines PID and VID serves as a unique identifier to identify the USB device.
Generally, before the USB device is used, a driver carried in the USB device needs to be installed, so that an algorithm library and the like required when the USB device is used are preset, and during the installation process, the driver needs to be installed together with a dynamic library (i.e. a "registry file" in a subsequent step) that needs to be called by the middleware, so as to implement connection between the upper layer application software and the lower layer core component through the middleware. The scheme can realize the operations of calling the corresponding interface and acquiring the information through the middleware. The middleware may be Public key cryptography standard (PKCS #11 for short) or a Cryptographic Service Provider (CSP for short), and the specific type of the middleware in this embodiment is not limited herein.
When the USB device is used, in order to implement automatic invocation of the trusted algorithm library by the middleware in the USB device, thereby improving security of invoking the algorithm library and enhancing invoking efficiency of the algorithm library, according to the algorithm library invoking scheme provided in this embodiment, first, device information of the USB device is obtained according to PID/VID information that has been accessed to the system.
Since the PID/VID information in each access system is unique, the device information of the corresponding USB device can be obtained according to the current PID/VID information. The device information of the current USB device may include name information, attribute information, and occupied memory information of the USB device, and the content included in the specific device information is not limited herein.
S120, obtaining a file to be associated, wherein the file to be associated comprises at least one registry file, and the registry file comprises registry information.
Registry file corresponding to all the USB devices installed in system history is stored in the file to be associated, usually each registry file is named according to registry information, and the current registry information may be information related to device information of each USB device. The purpose of this setting is to facilitate determining the corresponding target registry key file in the file to be associated according to the obtained device information of the USB device in the subsequent step.
For example, taking the device information of the USB device as "exit USB device" as an example, it can be known that the device name of the current USB device is "jit", when a corresponding registry key file is generated in a file to be associated, the registry key information corresponding to the current registry key may also be named by using the content related to "jit", and the naming mode of the specific registry key information is not limited herein as long as the registry key information includes information related to the device information.
The file to be associated may be a Provider file pre-stored in a preset position of the system, that is, all registry files that need to be used by the middleware in calling the algorithm library are stored in the Provider file, which is helpful for quickly finding out a target registry file in subsequent steps.
It should be noted that, the current files to be associated may be distinguished according to the type of the used middleware, that is, when the USB device is used historically, the related call file with the middleware type being CSP type may be stored in one file to be associated, the related call file with the middleware type being PKCS #11 type may be stored in another file to be associated, and the registry information may include the type information, version information, and the like of the middleware in addition to the content associated with the device information of the USB device. For example, when the registry key information may be "exit CSP V1.0", where "jit" is device information of the USB device, "CSP" is type information of the 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 relation.
If the file to be associated includes a plurality of registry key files, and each registry key file is named and stored by using corresponding registry key information, the registry key information may be traversed according to the device information of the USB device obtained in step S110 in the current step, so as to obtain the target registry key file.
The mode of traversing at least one registry key information may be that target information is obtained from the obtained device information of the USB device, and when the registry key information contains the target information, it indicates that the registry key file corresponding to the current registry key information is the target registry key file.
The target information may be a device name of the USB device, a device attribute, or timestamp information generated by device installation, and the content indicated by the specific target information is not limited herein, as long as the only corresponding target registry file can be found in the file to be associated according to the device information.
It should be noted that, no matter the target information is the device name, the device attribute, or timestamp information generated by device installation, when the USB device is installed, and the registry information file that the middleware needs to call is named by using the registry information, the registry information should also include the target information.
S140, a storage path of the algorithm library is obtained from the target registry file, and the algorithm library is accessed according to the storage path.
The target registry key file is obtained by storing a storage path of an algorithm library required by the current USB equipment 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 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 the trusted algorithm library required to be called according to the PID/VID information of the USB equipment so as to realize the safe access to the intelligent password key through the algorithm library, thereby solving the technical defects in the prior art.
In the access method of the algorithm library provided in this embodiment, first, device information of the USB device is obtained according to PID/VID information; then acquiring a file to be associated, wherein the file to be associated comprises at least one registry file, and the registry file comprises registry 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 needing to be accessed can be searched in the registry 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 a trusted algorithm library authenticated by an operating system, the problem of access risk caused by inaccurate information provided by a third party is avoided, and the beneficial effects of improving the equipment access safety and improving the access efficiency are achieved.
Fig. 2 is another schematic flow chart of the access method of the algorithm library provided by the present invention, and the relationship between the present embodiment and the foregoing embodiment further refines the corresponding features of the foregoing 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 an operating system to obtain relevant information about the USB device, and for example, the current information obtaining instruction may be an instruction to obtain a device name, a device attribute, a device occupied memory, and the like, 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 the PID/VID information of the accessed system according to the information acquisition instruction.
Because the PID/VID information is the unique identification information of each USB device and only one USB device is accessed in the system each time, when the API interface acquires the PID/VID information of the accessed system according to the information acquisition instruction, the PID/VID information of only one USB device can be acquired,
an Application Programming Interface (API) is a calling Interface that an operating system leaves for an Application program, and the Application program calls the API of the operating system to enable the operating system to execute a corresponding instruction of the Application program.
S220, judging whether the PID/VID information is prestored in a maintenance white list.
In practical application of the USB device, the system includes a white list, which is maintained to include a list of trusted PID/VID information, and the PID/VID information in the white list is currently maintained to have an associated algorithm library trusted, which can be used to ensure that the key used in service implementation is secure.
Therefore, after the PID/VID information is obtained, it is necessary to determine whether the current PID/VID information is prestored in the maintenance white list, and if so, it indicates that the algorithm library obtained according to the current PID/VID information in the subsequent steps 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, step S222 is executed, that is, the current access operation to the algorithm library is ended.
And S221, acquiring the device information of the USB device according to the PID/VID information.
S222, finishing the access operation of the algorithm library.
S230, obtaining a file to be associated, wherein the file to be associated comprises at least one registry file, and the registry file comprises registry information.
And S240, receiving a field extraction instruction.
The field extraction instruction comprises a target field of the device information, and the current target field indicates a field corresponding to the device name. Illustratively, taking the device information as "exit usbdevice" as an example, the field corresponding to the device name "jit" is the target field. This is done to the extent that the field extraction instruction can determine the target registry key file from the registry key information based on the target field.
S241, sequentially carrying out field extraction on at least one registry key information according to the field extraction instruction to obtain a name field corresponding to each registry key information.
The field extraction instruction is used for performing field extraction on the registry information, and the registry information corresponding to each registry file may include, for example, a system name, a middleware name, a version number, a device name, and the like due to a situation that naming is long and complicated. Therefore, in order to obtain the core content from the registry information quickly, the fields of the registry information can be extracted in sequence 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 can obtain a plurality of name fields, for example, each field can be extracted to include "Microsoft" field, "Base" field, "CSP" field, "jit" field, and "Provider", etc., and each field can be referred to as a name field. The field content included in the specific registry key information is not limited herein, and is subject to the actual application requirement.
S242, when the name field contains the target field, the registry key file corresponding to the registry key information is the target registry key file.
Searching sequentially according to the name fields extracted from the registry key information, and when the current registry key information contains the target fields in the equipment information, indicating that the registry key file corresponding to the current registry key information is the target registry key file; otherwise, continuing to execute the field extraction operation according to the field extraction instruction for the next registry key information.
Continuing with the example in which the target field is the field "jit", when the current registry key information contains the field "jit", 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 to a field corresponding to the device name of the USB device, and may also be a field such as a device attribute or an installation timestamp of the device, as long as the corresponding target registry file can be found in the registry information included in the file to be associated according to the current field.
And S250, acquiring 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 corresponding data value; each data item name, data type and data value may be content created by system auto-default, or may be preset, and at the stage of installing the USB device, the corresponding data item name, data type and data value may be stored in the corresponding registry file.
For example, the data item names of the data items contained by the target registry key file may include: for example, 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, and the default value may also be the content set for the current data item. The specific content of the data item name, data type, and data value contained by a specific target registry key file is not limited herein.
When the USB equipment is installed, the driver package contains the name of the target data table entry, and the installation path when the algorithm library is installed is used as a data value and is stored in the target registry entry file together with the target data table entry name. Then when the name of the target data item is obtained from the target registry key file, only the default name of the data item needs to be obtained from the target registry key file.
It should be noted that the data entry name may be stored in the driver package as preset by the device provider, or may be customized by the user, and the specific setting manner of the data entry name is not limited herein as long as the known data entry name can be found in the target registry file.
And S260, acquiring a storage path of the algorithm library according to the data value corresponding to the target data item name.
In the target registry key file, the data value corresponding to each data key name may or may not have an actual meaning, and the content of the data value corresponding to each data key is not limited herein. However, for the target data item name whose corresponding data value is the storage path for installing the algorithm library, in this way, the storage path of the algorithm library can be obtained according to the data value, so as to realize the secure 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 as follows:
when a system receives installation operation of USB equipment, equipment information of the USB equipment is obtained; and newly building a 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.
When the USB equipment is installed, an installation path of an algorithm library is appointed in a driver package in advance, the algorithm library can be automatically installed according to the current installation path, and registry files corresponding to all historical USB equipment manufacturers are contained in the files to be associated, when the current USB equipment is installed, a target registry file related to the name of the current USB equipment is synchronously established in the files to be associated according to equipment information, so that the target registry file can be searched in the files to be associated according to the preset relation.
In yet another implementation, the target data item name and the data value are stored in the target registry key file by: installing an algorithm library according to a drive package carried by the USB equipment, wherein the drive 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 to the target registry key file.
When the USB equipment is installed and the algorithm library is installed, the installation path, the name of the algorithm library and the name of the target data item of the algorithm library are preset in the drive package, the installation path, the name of the algorithm library and the name of the target data item are written into the target registry file according to the current name of the target data item in the target registry file, and the installation path and the name of the algorithm library are written into the data value corresponding to the name of the target data item in the target registry file, so that the name and the data value of the target data item are stored in advance.
Exemplarily, the name of an algorithm library preset in a drive package is ABCSFF.dll, the installation position of the algorithm library is C: \ WINDOWS \ system32, and the name of a target data item is SKFImagePath; then, when the USB device is installed, a registry file of device information about the USB device may be generated in a file to be associated, for example, a file name of a current registry is "Microsoft Base CSP jitprovider", and in the current registry file, a target data item name, a data type and a corresponding data value are synchronously added, where the target data item name is "SKFImagePath", the data type may be "REG _ SZ", and the data value is "C: \ WINDOWS \ system32\ abckf.dll", and when the target data item name is obtained, the data value corresponding to the target data item name is a path of an algorithm library to be called by the middleware.
In another implementation manner, the access scheme for the algorithm library provided in this embodiment further includes, after obtaining the storage path of the algorithm library: acquiring at least one target algorithm contained in an algorithm library; the USB device is accessed according to at least one target algorithm.
And after the storage path of the algorithm library is obtained, performing related access operation on the algorithm library according to the storage path. The algorithm library comprises 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, which has the advantage that the calling of the algorithm is realized through the target algorithm associated with the algorithm library, for example: if the current algorithm library does not support the SM9 algorithm, the SM9 is not called, and the situations of program crash and the like caused by calling the algorithm which is not supported can be avoided.
According to the access method of the algorithm library, the credible algorithm library is automatically obtained according to the PID/VID information of the equipment, so that the labor is saved, and the obtained information is accurate; before the driver of the USB equipment supplier is installed, the driver needs to be authenticated by an operating system, whether PID/VID information of the USB equipment is in a maintenance white list is verified, if yes, the access operation of the corresponding algorithm library is continued, and the key leakage risk caused by the fact that the untrusted algorithm library is not authenticated by the operating system and used by the middleware is avoided. According to the scheme provided by the embodiment, the application system can safely and automatically acquire the corresponding credible secret algorithm library, the automatic access of the USB equipment to the application system is realized, and the beneficial effects of improving the equipment access safety and improving the access efficiency are achieved.
Fig. 3 is a schematic structural diagram of an access apparatus for algorithm libraries provided by the present invention, which is suitable for executing the access method for algorithm libraries provided by this embodiment. As shown in fig. 3, the apparatus may specifically include: an equipment information obtaining module 310, an associated file obtaining module 320, an entry information traversing module 330, and an algorithm library accessing 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 associated 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;
a table entry information traversing module 330, configured to traverse at least one piece of the registry entry information, and obtain a target registry entry file when the registry entry information and the device information satisfy a preset relationship;
and the algorithm library accessing module 340 is configured to obtain a storage path of the 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 in this embodiment first obtains the device information of the USB device according to the PID/VID information; then acquiring a file to be associated, wherein the file to be associated comprises at least one registry file, and the registry file comprises registry 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 needing to be accessed can be searched in the registry 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 a trusted algorithm library authenticated by an operating system, the problem of access risk caused by inaccurate information provided by a third party is avoided, and the beneficial effects of improving the equipment access safety and 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, where the field extraction instruction includes a target field of the device information;
a field extraction unit, configured to sequentially perform field extraction on at least one piece of registry key information according to the field extraction instruction, and obtain a name field corresponding to each piece of registry key information;
and the target file obtaining unit is used for obtaining the target registry key file corresponding to the registry key information when the name field comprises the target field.
In one embodiment, the algorithm library access module 340 includes: a target name obtaining unit and a storage path obtaining unit, wherein:
a target name obtaining unit, configured to obtain a target data item name from the target registry key 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 an embodiment, the target registry key file is stored in the file to be associated by:
when a system receives installation operation of the USB equipment, equipment information of the USB equipment is obtained;
and according to the equipment information, newly establishing the target registry key file in the file to be associated, 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 by:
installing the algorithm library according to a drive package carried by the USB equipment, wherein the drive 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 name of the target data item to the target registry key file.
In one embodiment, the device information obtaining module 310 includes: a second instruction receiving unit, an information obtaining unit, and an apparatus information obtaining unit, wherein:
the second instruction receiving unit is used for receiving the information acquisition instruction;
the information acquisition unit is used for controlling the API interface to acquire the PID/VID information of the accessed system according to the information acquisition instruction;
and the equipment information obtaining unit is used for obtaining the equipment information of the USB equipment according to the PID/VID information.
In one embodiment, the apparatus further comprises: an information judgment unit, wherein:
the information judging unit is used for judging whether the PID/VID information is prestored in a maintenance white list; and if so, 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: the device 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 equipment access module is used for accessing the USB equipment according to at least one target algorithm.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the functional module, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
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, the computer program being executable by the at least one processor to enable the at least one processor to perform a method of accessing a library of algorithms according to any embodiment of the present invention.
The present invention also provides a computer readable storage medium storing computer instructions for causing a processor to implement a method for accessing an algorithm library according to any one of the embodiments of the present invention when executed.
Referring now to FIG. 4, there is illustrated a schematic block 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 an example, and should not bring any limitation to the functions and the range of use of the present embodiment.
As shown in fig. 4, the computer system 500 includes a Central Processing Unit (CPU) 501 that 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 necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via 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 portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; 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 driver 510 is also connected to the I/O interface 505 as necessary. 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 necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to the flow diagrams 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 illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 present invention, 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, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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 flowchart 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 described in the present embodiment may be implemented by software or hardware. The described modules and/or units may also be provided in a processor, and may be described as: a processor comprises an equipment information acquisition module, an associated file acquisition module, an item information traversal module and an algorithm library access module. Wherein the names of the modules do not in some cases constitute a limitation of the module itself.
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 separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring equipment information of the USB equipment according to the PID/VID information; acquiring a file to be associated, wherein the file to be associated comprises at least one registry file, and the registry file comprises registry information; traversing at least one piece of registry key information, and when the registry key information and the equipment information meet a preset relationship, obtaining a target registry key file; 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 needing to be accessed can be found in the registry 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 a trusted algorithm library authenticated by an operating system, the problem of access risk caused by inaccurate information provided by a third party is avoided, and the beneficial effects of improving the equipment access safety and improving the access efficiency are achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for accessing an algorithm library, comprising:
acquiring the equipment information of the USB equipment according to the PID/VID information;
acquiring a file to be associated, wherein the file to be associated comprises at least one registry file, and the registry file comprises registry information;
traversing at least one piece of registry key information, and acquiring a target registry key file when the registry key information and the equipment information meet a preset relationship;
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.
2. The method of claim 1, wherein traversing at least one of the registry key information to obtain a target registry key file when the registry key information and the device information satisfy a predetermined relationship comprises:
receiving a field extraction instruction, wherein the field extraction instruction comprises a target field of the equipment information;
sequentially carrying out field extraction on at least one registry key information according to the field extraction instruction to obtain a name field corresponding to each registry key information;
and when the name field comprises the target field, the registry key file corresponding to the registry key information is the target registry key file.
3. The method of claim 1, wherein obtaining the storage path of the algorithm library from the target registry key file comprises:
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 name of the target data item.
4. The method of claim 3, wherein the target registry key file is stored in the file to be associated by:
when a system receives installation operation of the USB equipment, equipment information of the USB equipment is obtained;
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.
5. The method of claim 3, 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 drive package carried by the USB equipment, wherein the drive 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 name of the target data item to the target registry key file.
6. The method of claim 1, wherein obtaining the device information of the USB device according to the PID/VID information comprises:
receiving an information acquisition instruction;
the control API interface acquires the PID/VID information of the accessed system according to the information acquisition instruction;
and acquiring the equipment information of the USB equipment according to the PID/VID information.
7. The method of claim 1, further comprising, before obtaining the device information of the USB device according to the PID/VID information:
judging whether the PID/VID information is prestored in a maintenance white list;
and if so, executing the operation of acquiring the equipment information of the USB equipment according to the PID/VID information.
8. The method of claim 1, further comprising:
acquiring at least one target algorithm contained in the algorithm library;
accessing the USB device according to at least one of the target algorithms.
9. An apparatus for accessing a library of algorithms, 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 associated file acquisition module, a file association module and a file association module, wherein the associated file acquisition module is used for acquiring a file to be associated, the file to be associated comprises at least one registry file, and the registry file comprises registry information;
the table entry information traversing module is used for traversing at least one piece of registry entry information and obtaining a target registry entry file when the registry entry information and the equipment information meet a preset relationship;
and the algorithm library access module is used for acquiring a storage path of the algorithm library from the target registry file and accessing the algorithm library according to the storage path.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out a method of accessing an algorithm library according to any one of claims 1-8.
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 true CN115935321A (en) 2023-04-07
CN115935321B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117009251A (en) * 2023-09-26 2023-11-07 中船奥蓝托无锡软件技术有限公司 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

Cited By (2)

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

Also Published As

Publication number Publication date
CN115935321B (en) 2024-04-19

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
EP3370449B1 (en) Method and device for configuring security indication information
CN109196891B (en) Method, terminal and server for managing subscription data set
CN115935321A (en) Access method and device of algorithm library and storage medium
CN110990798B (en) Application program permission configuration method and device, electronic equipment and storage medium
US11240044B2 (en) Verifying purpose of data usage at sub-application granularity
CN113010238A (en) Permission determination method, device and system for micro application call interface
CN104751046B (en) A kind of user authen method and mobile terminal device of application program
CN109145591B (en) Plug-in loading method of application program
CN109635558B (en) Access control method, device and system
CN106919812B (en) Application process authority management method and device
CN113742235A (en) Method and device for checking codes
US11431711B2 (en) Method, device and computer program product for service access
KR101101322B1 (en) Method and apparatus for application authentication
CN111885006B (en) Page access and authorized access method and device
CN113452771B (en) Interface calling method, device and system
CN114327602B (en) Information processing method, device, electronic equipment and storage medium
KR102348312B1 (en) Method and system for detecting forgery of mobile application using collecting user identifier and signature
CN113238946A (en) Method and device for detecting hook frame and electronic equipment
CN115967545A (en) Edge computing safety protection method, system, electronic equipment and readable storage medium
CN116302405A (en) Data desensitization method and device
CN114092043A (en) Data management platform, method, device and computer readable storage medium
CN115242528A (en) Log-in method of Kubernets cluster management panel
CN115695001A (en) Security authentication method between microservices and related equipment thereof

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