Interface adaptation method, device, electronic device and storage medium

By parsing the object identifier of the request message in an electronic device and calling the corresponding application program interface to operate the private library, the problem that different manufacturers' driver processes are prone to conflicts in modifying the standard library is solved, and the maintainability of the standard library is improved.

CN115913931BActive Publication Date: 2025-03-25QI-ANXIN LEGENDSEC INFORMATION TECH (BEIJING) INC +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211406001.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2025-03-25
Estimated Expiration
2042-11-10

AI Technical Summary

Technical Problem

In electronic devices, when there are a large number of driver processes from different manufacturers, the modification operations of the standard library are prone to conflicts.

Method used

By obtaining the request message, parsing the object identifier and determining whether it is a preset identifier in the standard library. If so, directly call the application program interface corresponding to the object identifier to operate the private library, thereby adapting to the interface and avoiding multiple driver processes directly modifying the standard library.

Benefits of technology

It effectively avoids conflicts caused by direct modification of the standard library by multiple driver processes, and improves the maintainability of the standard library.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115913931B_ABST
    Figure CN115913931B_ABST
Patent Text Reader

Abstract

The present application provides an interface adaptation method, device, electronic device and storage medium, the method comprising: obtaining a request message, and parsing an object identifier from the request message; determining whether the object identifier is a preset identifier in a standard library; if so, calling an application program interface corresponding to the object identifier, the application program interface is used to operate a private library corresponding to the object identifier. In the implementation process of the above scheme, by directly calling the application program interface corresponding to the object identifier when it is determined that the object identifier parsed from the request message is a preset identifier in the standard library, the application program interface can directly operate the private library, thereby adapting and determining the called interface according to the object identifier, avoiding the situation where multiple driver processes directly modify the standard library, which is prone to conflicts, and effectively improving the maintainability of the standard library.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of network communication and network management, and in particular to an interface adaptation method, device, electronic device and storage medium. Background Art

[0002] At present, the Network Management System (NMS) server can send a request message (such as a query request or a setting request) to the managed electronic device through the Simple Network Management Protocol (SNMP). After receiving the request message, the SNMP agent (SNMP-agent) process on the electronic device operates the Management Information Base (MIB) in the electronic device according to the request message. The MIB implemented by different manufacturers is usually a public standard library. Electronic devices usually communicate and interact with driver processes (such as hardware driver processes or network protocol driver processes) and maintain the above-mentioned standard library based on the communication interaction results. In the specific implementation process, it is found that when there are a large number of driver processes from different manufacturers in the electronic device, there will be a problem that the modification operation of the standard library is prone to conflict. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide an interface adaptation method, device, electronic device and storage medium, which are used to improve the problem that conflicts are prone to occur in modification operations of standard libraries.

[0004] The embodiment of the present application provides an interface adaptation method, including: obtaining a request message, and parsing an object identifier from the request message; determining whether the object identifier is a preset identifier in a standard library; if so, calling an application program interface corresponding to the object identifier, the application program interface is used to operate a private library corresponding to the object identifier. In the implementation process of the above scheme, by directly calling the application program interface corresponding to the object identifier when it is determined that the object identifier parsed from the request message is a preset identifier of the standard library, the application program interface can directly operate the private library, thereby adapting and determining the called interface according to the object identifier, avoiding the situation where multiple driver processes directly modify the standard library, which is prone to conflicts, and effectively improving the maintainability of the standard library.

[0005] Optionally, in an embodiment of the present application, after determining whether the object identifier is a preset identifier in the standard library, it further includes: if the object identifier is not a preset identifier in the standard library, calling a public program interface, the public program interface is used to operate the standard library. In the implementation process of the above scheme, when it is determined that the object identifier is not a preset identifier in the standard library, the public program interface is called, and interface adaptation is achieved by calling different interfaces, so that the adapted interface (such as a public program interface or an application program interface) is used to operate the standard library or private library of the MIB. When the SNMP agent process needs to interact with different products (such as hardware or network protocols), it only needs to use the adapted interface (such as a public program interface or an application program interface) to achieve interaction, thereby avoiding the situation where multiple driver processes directly modify the standard library, which is prone to conflicts, and effectively improving the maintainability of the standard library.

[0006] Optionally, in an embodiment of the present application, determining whether the object identifier is a preset identifier in the standard library includes: determining whether the object identifier is a preset identifier in the standard library through a management information base MIB adapter. In the implementation process of the above scheme, the management information base MIB adapter determines whether the object identifier is a preset identifier in the standard library. When it is necessary to interact with different products (such as hardware or network protocols), it is only necessary to call the corresponding interface (such as a public program interface or an application program interface) according to the judgment result to achieve interaction, thereby avoiding the situation where multiple driver processes directly modify the standard library, which is prone to conflicts, and effectively improving the maintainability of the standard library.

[0007] Optionally, in an embodiment of the present application, the application program interface includes: a link library interface of the driver process; calling the application program interface corresponding to the object identifier includes: calling the link library interface of the driver process so that the driver process returns the operation result of the private library. In the implementation process of the above scheme, by calling the link library interface of the driver process so that the driver process returns the operation result of the private library, the interaction between the driver process and the private library is realized, avoiding the situation where multiple driver processes directly modify the standard library and causing conflicts, and effectively improving the maintainability of the standard library.

[0008] Optionally, in an embodiment of the present application, the application program interface includes: an inter-process communication IPC interface; calling the application program interface corresponding to the object identifier, including: calling the IPC interface to obtain a constructed IPC message; forwarding the constructed IPC message to the driver process, so that the driver process returns the operation result of the private library. In the implementation process of the above scheme, by calling the IPC interface to obtain the constructed IPC message, and forwarding the constructed IPC message to the driver process, the interaction between the driver process and the private library is realized, avoiding the situation where multiple driver processes directly modify the standard library and causing conflicts, and effectively improving the maintainability of the standard library.

[0009] Optionally, in an embodiment of the present application, forwarding the constructed IPC message to the driver process includes: encapsulating the constructed IPC message to obtain the encapsulated IPC message; and forwarding the encapsulated IPC message to the driver process. In the implementation process of the above scheme, by encapsulating the constructed IPC message and forwarding the encapsulated IPC message to the driver process, a unified encapsulation format for driver process interaction is achieved, which facilitates the interactive maintenance and expansion of the driver process, thereby improving the overall robustness.

[0010] Optionally, in an embodiment of the present application, after forwarding the constructed IPC message to the driver process, it also includes: obtaining the operation result corresponding to the IPC message returned by the driver process; and updating the private library corresponding to the object identifier according to the operation result corresponding to the IPC message. In the implementation process of the above scheme, by obtaining the operation result corresponding to the IPC message returned by the driver process, and updating the private library corresponding to the object identifier according to the operation result corresponding to the IPC message, the interaction between the driver process and the private library is realized, avoiding the situation where multiple driver processes directly modify the standard library, which is prone to conflicts, and effectively improving the maintainability of the standard library.

[0011] The embodiment of the present application also provides an interface adapter device, including: a message acquisition and parsing module, used to obtain a request message and parse an object identifier from the request message; an object identification judgment module, used to judge whether the object identifier is a preset identifier in a standard library; an application interface calling module, used to call the application interface corresponding to the object identifier if the object identifier is a preset identifier in the standard library, and the application interface is used to operate a private library corresponding to the object identifier.

[0012] Optionally, in an embodiment of the present application, the interface adaptation device further includes: a public interface calling module, which is used to call a public program interface if the object identifier is not a preset identifier in the standard library, and the public program interface is used to operate the standard library.

[0013] Optionally, in an embodiment of the present application, the object identification judgment module includes: an adapter judgment submodule, which is used to judge whether the object identifier is a preset identifier in the standard library through the management information base MIB adapter.

[0014] Optionally, in an embodiment of the present application, the application program interface includes: a link library interface of the driving process; an application interface calling module, including: a driving process calling sub-module, used to call the link library interface of the driving process so that the driving process returns the operation result of the private library.

[0015] Optionally, in an embodiment of the present application, the application program interface includes: an inter-process communication IPC interface; an application interface calling module, including: an IPC interface calling sub-module, used to call the IPC interface to obtain a constructed IPC message; an IPC message forwarding sub-module, used to forward the constructed IPC message to the driver process so that the driver process returns the operation result of the private library.

[0016] Optionally, in an embodiment of the present application, the IPC message forwarding submodule includes: an IPC message encapsulation unit, used to encapsulate the constructed IPC message to obtain an encapsulated IPC message; and an IPC message forwarding unit, used to forward the encapsulated IPC message to the driving process.

[0017] Optionally, in an embodiment of the present application, the application interface calling module also includes: an operation result acquisition submodule, used to obtain the operation result corresponding to the IPC message returned by the driving process; an operation result update submodule, used to update the private library corresponding to the object identifier according to the operation result corresponding to the IPC message.

[0018] An embodiment of the present application further provides an electronic device, including: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method described above is performed.

[0019] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described above is executed.

[0020] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and in part will become apparent from the description, or will be understood by implementing the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 A schematic diagram of an interface adaptation system provided by an embodiment of the present application is shown;

[0023] Figure 2 A flow chart of an interface adaptation method provided in an embodiment of the present application is shown;

[0024] Figure 3 A schematic diagram of the structure of the management information base MIB provided in an embodiment of the present application is shown;

[0025] Figure 4 A schematic diagram of the structure of an interface adapter device provided in an embodiment of the present application is shown;

[0026] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0027] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments in the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the embodiments of the present application claimed for protection, but merely represents the selected embodiments in the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the embodiments of the present application.

[0028] It is understandable that the "first" and "second" in the embodiments of the present application are used to distinguish similar objects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit the difference.

[0029] Before introducing the interface adaptation method provided in the embodiment of the present application, some concepts involved in the embodiment of the present application are first introduced:

[0030] An Application Programming Interface (API), also known as an application programming interface, is a set of predefined functions that aims to provide applications and developers with the ability to access a set of routines based on certain software or hardware without having to access the source code or understand the details of the internal working mechanism.

[0031] See also Figure 1 A schematic diagram of an interface adaptation system provided by an embodiment of the present application is shown; before introducing the interface adaptation method, the interface adaptation system is first introduced, and the interface adaptation system may include: a network management system (NMS) server and an electronic device, and the NMS server and the electronic device may communicate with each other through the SNMP protocol. For example: the NMS server sends a request message (such as a query request or a setting request) to the electronic device, and after the electronic device receives the request message, the electronic device may process the request message through the SNMP agent (SNMP-agent) process, thereby obtaining a response message corresponding to the request message (such as a message including a Traps status), and then send the response message to the NMS server.

[0032] The above-mentioned electronic device may run an SNMP agent process, and the electronic device may call a public program interface through the SNMP agent process to operate the standard library of MIB (also known as a public library or a public MIB library), or operate the private library of MIB through the application program interface (API) of the driver process, or interact with hardware or network protocols through the API of the driver process to obtain an interaction result, and operate the private library according to the interaction result to obtain the operation result of the private library. Then, the SNMP agent process may generate a response message according to the operation result of the private library, and send the response message to the NMS server.

[0033] It should be noted that the interface adaptation method provided in the embodiment of the present application can be executed by the above-mentioned electronic device, which refers to a network device or terminal device with the function of executing a computer program. The network devices here include: bridges, switches, routers, and the terminal devices here include: smart phones, personal computers, tablet computers, personal digital assistants or mobile Internet devices, etc.

[0034] The following introduces application scenarios to which the interface adaptation method is applicable. The application scenarios here include but are not limited to: when there are a large number of driver processes from different manufacturers in an electronic device, the interface adaptation method can be used to adapt the MIB modification operation. If the object identifier is a preset identifier in the standard library, the application program interface corresponding to the object identifier is called to operate the private library corresponding to the object identifier, thereby adapting and determining the called interface based on the object identifier, avoiding conflicts caused by multiple driver processes directly modifying the standard library, and effectively improving the maintainability of the standard library.

[0035] See also Figure 2 The flowchart of the interface adaptation method provided by the embodiment of the present application is shown; the main idea of ​​the interface adaptation method is that, when it is determined that the object identifier parsed from the request message is a preset identifier of the standard library, the application interface corresponding to the object identifier is directly called, and the application interface can directly operate the private library, thereby determining the adaptation call application interface (or public program interface) according to the object identifier. The implementation method of the above interface adaptation method may include:

[0036] Step S110: Obtain a request message, and parse the object identifier from the request message.

[0037] See also Figure 3 The structural diagram of the management information base MIB provided by the embodiment of the present application is shown; the object identifier (Object IDentifier, OID) refers to the unique identifier in the MIB parsed from the request message. The MIB can be stored in a tree structure, and the nodes of the tree represent managed objects. The managed objects can be uniquely identified by a path starting from the root. This path can be understood as the OID. For example, the OID of directory is 1.3.6.1.1, and the OID of mgmt is 1.3.6.1.2. The root node OID of the private library can be set according to the specific situation. For example, the root node OID of the private library is set to 1.3.6.1.4. Then, if the object identifier OID is 1.3.6.1.4, it can be confirmed that the object identifier OID is the preset identifier in the standard library.

[0038] The implementation method of the above step S110 is, for example: the electronic device receives a request message sent by the NMS server, the request message here includes an object identifier (OID), so the object identifier can be parsed from the request message, the object identifier here can be, for example, 1.3.6.1.1 or 1.3.6.1.4, etc. The request message here can also include an operation identifier, that is, an operation identifier performed on the target corresponding to the object identifier, for example: obtaining resource utilization, policy information and / or cluster information on the hardware corresponding to the object identifier, etc.; wherein the resource utilization may include: CPU utilization, disk utilization and / or memory utilization, etc., the policy information includes but is not limited to: switching policy information, routing policy information and / or interception policy information, etc., the cluster information includes but is not limited to: high-availability cluster information, master-slave cluster information and / or storage cluster information, etc.

[0039] Step S120: Determine whether the object identifier is a preset identifier in the standard library.

[0040] The preset identifier refers to the object identifier (OID) required to operate the private library. The preset identifier here can be set according to the specific situation, for example, the preset identifier can be set to 1.3.6.1.4 or 1.3.6.1.5.

[0041] Step S130: If the object identifier is a preset identifier in the standard library, then the application program interface corresponding to the object identifier is called, and the application program interface is used to operate the private library corresponding to the object identifier.

[0042] It can be understood that since there are many implementation methods for the above steps S120 to S130, the implementation methods for the above steps S120 to S130 will be described in detail below.

[0043] In the above implementation process, when it is determined that the object identifier parsed from the request message is a preset identifier in the standard library, the application interface corresponding to the object identifier is directly called. The application interface can directly operate the private library, thereby adapting and determining the called interface according to the object identifier, avoiding conflicts caused by multiple driver processes directly modifying the standard library, and effectively improving the maintainability of the standard library.

[0044] As an optional implementation of the above interface adaptation method, after determining that the object identifier is not a preset identifier in the standard library, a public program interface may be called to operate the standard library. This implementation may include:

[0045] Step S140: If the object identifier is not a preset identifier in the standard library, a public program interface is called, and the public program interface is used to operate the standard library.

[0046] The implementation method of the above step S140 is, for example: since an SNMP agent process can be run on the electronic device, the electronic device can call the public program interface through the SNMP agent process to operate the standard library of MIB (also known as the public library or public MIB library). If the SNMP agent process is run, the files that can be written include but are not limited to: OID files, private (MIB) files and conf template files; wherein, the OID file stores all the enterprise OID values ​​in the private library of MIB, the private (MIB) file stores the contents of all the private MIBs that the electronic device needs to support, and the conf template file stores the used port number, supported MIB nodes and access rights, etc. When the SNMP agent process is running, a folder corresponding to the actual product name (such as hardware device or network protocol) can be created in a preset directory (such as an OEM directory), and these OID files, private (MIB) files and conf template files can be created and written in the folder, so as to realize the centralized management of the differences of the SNMP agent process running files of different products.

[0047] In the above implementation process, interface adaptation is achieved by calling different interfaces, so that the adapted interface (such as public program interface or application program interface) is used to operate the standard library or private library of MIB. This interface adaptation method makes the SNMP agent process unaware of the underlying implementation of different products (such as hardware or network protocols). When the SNMP agent process needs to interact with different products (such as hardware or network protocols), it only needs to use the adapted interface (such as public program interface or application program interface) to achieve interaction, avoiding the situation where multiple driver processes directly modify the standard library, which is prone to conflicts, and effectively improves the maintainability of the standard library.

[0048] As a first optional implementation of the above step S120, judging whether the object identifier is a preset identifier in the standard library by using the management information base MIB adapter, this implementation may include:

[0049] Step S121: Determine whether the object identifier is a preset identifier in the standard library through the management information base MIB adapter.

[0050] For example, the implementation method of the above step S121 is as follows: assuming that the preset identifier in the standard library is 1.3.6.1.4, a MIB adapter program compiled or interpreted in a preset programming language can be used to determine whether the object identifier is a preset identifier in the standard library. If the object identifier OID obtained by the MIB adapter program is 1.3.6.1.1, it can be confirmed that the object identifier OID is not a preset identifier in the standard library. On the contrary, if the object identifier OID obtained by the MIB adapter program is 1.3.6.1.4, it can be confirmed that the object identifier OID is not a preset identifier in the standard library.

[0051] As a second optional implementation of the above step S120, determining whether the object identifier is a preset identifier in the standard library by a custom executable program may include:

[0052] Step S122: determining, through the custom executable program, whether the object identifier is a preset identifier in the standard library.

[0053] The implementation method of the above step S122 is, for example: using a custom executable program compiled or interpreted by a preset programming language to determine whether the object identifier is a preset identifier in the standard library. Programming languages ​​that can be used include: C, C++, Java, BASIC, JavaScript, LISP, Shell, Perl, Ruby, Python, and PHP, etc. If the object identifier OID obtained by the MIB adapter is 1.3.6.1.1, it can be confirmed that the object identifier OID is not a preset identifier in the standard library. On the contrary, if the object identifier OID obtained by the MIB adapter is 1.3.6.1.4, it can be confirmed that the object identifier OID is not a preset identifier in the standard library.

[0054] As an optional implementation of the above step S130, the above application program interface includes: a link library interface of the driving process; the implementation of calling the application program interface corresponding to the object identifier may include:

[0055] Step S131: calling the link library interface of the driver process so that the driver process returns the operation result of the private library.

[0056] The link library interface refers to an application program interface that calls one of the link modes of the driver process. Specifically, it can adopt the lib library interface of the static library or the dynamic link library (DLL) interface.

[0057] The implementation method of the above step S131 is, for example: the SNMP agent (SNMP-agent) process calls the link library interface (such as lib library interface or DLL interface) of the driver process to enable the driver process to interact with the hardware or network protocol, obtain the interaction result, and operate the private library according to the interaction result to obtain the operation result of the private library. Then, the SNMP agent process can generate a response message according to the operation result of the private library, and send the response message to the NMS server.

[0058] As an optional implementation of the above step S130, the above application program interface includes: an inter-process communication (IPC) interface; the implementation of calling the application program interface corresponding to the object identifier may include:

[0059] Step S132: Call the IPC interface to obtain the constructed IPC message.

[0060] The implementation method of the above step S132 is, for example: the SNMP agent (SNMP-agent) process calls the IPC interface through the MIB adapter, where the IPC interface is used to construct an IPC message, thereby obtaining the constructed IPC message.

[0061] Step S133: forwarding the constructed IPC message to the driver process, so that the driver process returns the operation result of the private library.

[0062] As an optional implementation of the above step S133, in the process of forwarding the constructed IPC message to the driver process, the IPC message may also be encapsulated, and the implementation may include:

[0063] Step S133a: The SNMP agent process encapsulates the constructed IPC message to obtain the encapsulated IPC message.

[0064] Step S133b: The SNMP agent process forwards the encapsulated IPC message to the driver process.

[0065] The implementation method of the above steps S133a to S133b is, for example: the SNMP agent process encapsulates the constructed IPC message in the JavaScript Object Notation (JSON) format or the eXtensible Markup Language (XML) format to obtain the encapsulated IPC message, and then the SNMP agent process forwards the encapsulated IPC message to the driver process. The driver process can also interact with the hardware or network protocol according to the IPC message to obtain the interaction result, and operate the private library according to the interaction result, and then forward the operation result corresponding to the IPC message to the SNMP agent process. The SNMP agent process receives the operation result corresponding to the IPC message sent by the driver process, thereby obtaining the operation result corresponding to the IPC message.

[0066] As an optional implementation of the above step S130, after forwarding the constructed IPC message to the driver process, the private library may also be updated according to the operation result returned by the driver process. This implementation may include:

[0067] Step S134: Obtain the operation result corresponding to the IPC message returned by the driver process.

[0068] Step S135: Update the private library corresponding to the object identifier according to the operation result corresponding to the IPC message.

[0069] For example, the implementation method of the above steps S134 to S135 is as follows: the driver process may also forward the operation result corresponding to the IPC message to the SNMP agent process, so that the SNMP agent process obtains the operation result corresponding to the IPC message returned by the driver process. After receiving the operation result corresponding to the IPC message returned by the driver process, the SNMP agent process may update the private library corresponding to the object identifier according to the operation result corresponding to the IPC message, obtain the update result of the private library, generate a response message according to the update result of the private library, and send the response message to the NMS server.

[0070] See also Figure 4 The structure diagram of the interface adapter device provided in the embodiment of the present application is shown; the embodiment of the present application provides an interface adapter device 200, including:

[0071] The message acquisition and parsing module 210 is used to acquire the request message and parse the object identifier from the request message.

[0072] The object identification determination module 220 is used to determine whether the object identifier is a preset identifier in the standard library.

[0073] The application interface calling module 230 is used to call the application program interface corresponding to the object identifier if the object identifier is a preset identifier in the standard library, and the application program interface is used to operate the private library corresponding to the object identifier.

[0074] Optionally, in the embodiment of the present application, the interface adapter device further includes:

[0075] The public interface calling module is used to call the public program interface if the object identifier is not a preset identifier in the standard library, and the public program interface is used to operate the standard library.

[0076] Optionally, in an embodiment of the present application, the object identification determination module includes:

[0077] The adapter judgment submodule is used to judge whether the object identifier is a preset identifier in the standard library through the management information base MIB adapter.

[0078] Optionally, in the embodiment of the present application, the application program interface includes: a link library interface of the driving process; an application interface calling module, including:

[0079] The driver process calls the submodule, which is used to call the link library interface of the driver process so that the driver process returns the operation result of the private library.

[0080] Optionally, in an embodiment of the present application, the application program interface includes: an inter-process communication IPC interface; an application interface calling module includes:

[0081] The IPC interface calling submodule is used to call the IPC interface to obtain the constructed IPC message.

[0082] The IPC message forwarding submodule is used to forward the constructed IPC message to the driver process so that the driver process returns the operation result of the private library.

[0083] Optionally, in an embodiment of the present application, the IPC message forwarding submodule includes:

[0084] The IPC message encapsulation unit is used to encapsulate the constructed IPC message to obtain the encapsulated IPC message.

[0085] The IPC message forwarding unit is used to forward the encapsulated IPC message to the driver process.

[0086] Optionally, in the embodiment of the present application, the application interface calling module further includes:

[0087] The operation result acquisition submodule is used to obtain the operation result corresponding to the IPC message returned by the driver process.

[0088] The operation result updating submodule is used to update the private library corresponding to the object identifier according to the operation result corresponding to the IPC message.

[0089] It should be understood that the device corresponds to the above-mentioned interface adaptation method embodiment and can execute the various steps involved in the above-mentioned method embodiment. The specific functions of the device can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the operating system (OS) of the device.

[0090] See also Figure 5 The electronic device 300 provided in the embodiment of the present application includes: a processor 310 and a memory 320, wherein the memory 320 stores machine-readable instructions executable by the processor 310, and when the machine-readable instructions are executed by the processor 310, the above method is executed.

[0091] The embodiment of the present application further provides a computer-readable storage medium 330 , on which a computer program is stored. When the computer program is executed by the processor 310 , the above method is executed.

[0092] Among them, the computer-readable storage medium 330 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.

[0093] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0094] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed device and method can also be implemented in other ways. The device embodiments described above are only schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a part of a module, a program segment or a code, and a part of a module, a program segment or a code includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also be different from the order of occurrence marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which is mainly determined by the functions involved.

[0095] In addition, each functional module of each embodiment in the embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. In addition, in the description of this specification, the description of reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present application. In this specification, the schematic representation of the above terms does not necessarily have to be directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples without contradicting each other.

[0096] The above description is only an optional implementation manner of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application.

Claims

1. An interface adaptation method, characterized in that: include: Obtaining a request message, and parsing an object identifier from the request message; Determine whether the object identifier is a preset identifier in the standard library, the preset identifier is an object identifier used when operating a private library; If so, calling the application program interface corresponding to the object identifier, wherein the application program interface is used to operate the private library corresponding to the object identifier; If the object identifier is not a preset identifier in the standard library, calling a public program interface, wherein the public program interface is used to operate the standard library; Wherein, the application program interface includes: a link library interface or an inter-process communication IPC interface of the manufacturer's driver process; the calling of the application program interface corresponding to the object identifier includes: calling the link library interface of the manufacturer's driver process, or calling the IPC interface, obtaining a constructed IPC message, and forwarding the constructed IPC message to the manufacturer's driver process, so that the manufacturer's driver process interacts with different products to obtain an interaction result, and operates the private library according to the interaction result to obtain an operation result of the private library, and the different products include: hardware or network protocols; updating the private library corresponding to the object identifier according to the operation result of the private library; The forwarding of the constructed IPC message to the manufacturer's driver process includes: encapsulating the constructed IPC message to obtain the encapsulated IPC message; and forwarding the encapsulated IPC message to the manufacturer's driver process.

2. The method according to claim 1, characterized in that The determining whether the object identifier is a preset identifier in a standard library includes: The management information base (MIB) adapter determines whether the object identifier is a preset identifier in the standard library.

3. An interface adapter device, characterized in that: include: A message acquisition and parsing module, used to acquire a request message and parse an object identifier from the request message; An object identification judgment module is used to judge whether the object identifier is a preset identifier in the standard library, and the preset identifier is an object identifier used when operating a private library; An application interface calling module, used for calling an application program interface corresponding to the object identifier if the object identifier is a preset identifier in a standard library, wherein the application program interface is used for operating a private library corresponding to the object identifier; If the object identifier is not a preset identifier in the standard library, calling a public program interface, wherein the public program interface is used to operate the standard library; Wherein, the application program interface includes: a link library interface or an inter-process communication IPC interface of the manufacturer's driver process; the calling of the application program interface corresponding to the object identifier includes: calling the link library interface of the manufacturer's driver process, or calling the IPC interface, obtaining a constructed IPC message, and forwarding the constructed IPC message to the manufacturer's driver process, so that the manufacturer's driver process interacts with different products to obtain an interaction result, and operates the private library according to the interaction result to obtain an operation result of the private library, and the different products include: hardware or network protocols; updating the private library corresponding to the object identifier according to the operation result of the private library; The forwarding of the constructed IPC message to the manufacturer's driver process includes: encapsulating the constructed IPC message to obtain the encapsulated IPC message; and forwarding the encapsulated IPC message to the manufacturer's driver process.

4. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method according to any one of claims 1 to 2 is performed.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 2 is executed.

Citation Information

Patent Citations

  • System and method for realizing network element management through mapping of NMS (Network Management Station) MIB (Management Information Base) and network element private MIB

    CN107508713A