Instruction calling method and device for multi-protocol adaptation
By implementing the instruction-based call method of multi-protocol adaptation in the instruction channel device, the problem of insufficient support for non-instructive interfaces by the network management system is solved, the instruction-based definition and pseudo-instruction issuance of non-instructive protocols is realized, and the system's business capabilities are expanded.
Patent Information
- Application Number
- CN202111115266.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-23
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-09-23
AI Technical Summary
In the prior art, the network management system can only issue instructions through an instructional interface and cannot support non-instructive interfaces, resulting in the issuance capability of the network management system being limited by the protocol capability of the instruction channel device, affecting the expansion of the system's business capabilities.
By implementing the instruction-based call method of multi-protocol adaptation in the instruction channel device, the instruction interface protocol type of the target device is identified. If it is a non-instruction protocol, the mapping table of the pseudo instruction set is matched, the pseudo instruction set is generated, and the pseudo instruction translation and message assembly are performed, and the protocol message text is generated for issuance.
The instruction channel device's instruction definition and pseudo-instruction is implemented, which expands the system's business capabilities and avoids the need for customized development of southward device interfaces.
Smart Images

Figure CN115866099B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a multi-protocol adaptation instruction calling method and device. Background Art
[0002] In the current mobile communications field, the command channel device is a protocol proxy device between the network management system and the command issuing interface (Telnet, SSH2) of different equipment manufacturers. The command channel device plays the role of a bastion host, establishing a secure command issuing and calling channel between the network management system and the equipment.
[0003] Figure 1 The figure is a schematic diagram of the process of issuing commands in the network management system in the related technology. The solution of the related technology is that the command channel device transmits the text of the command type interface (Telnet, SSH2) to the device, but cannot support other types of mainstream interfaces (for example, HTTP, DB, CORBA, SNMP), resulting in the network management system's ability to issue commands being limited by the corresponding protocol capabilities of the command channel device. Each network management system needs to customize the development of non-command type interfaces to meet business requirements, which greatly affects the expansion of the system's business capabilities. Summary of the invention
[0004] The present invention provides a multi-protocol adapted directive calling method and device, which are used to solve the problem that the network management system can only support directive interfaces in the related technology, but cannot support other non-directive interfaces, resulting in the issuance capability of the network management system being limited by the protocol capability of the instruction channel device, which greatly affects the expansion of the system's business capabilities. The method realizes the directive definition of non-instructive protocols and the pseudo-instruction issuance capability of the instruction channel device, which facilitates the expansion of the system's business capabilities.
[0005] In a first aspect, the present invention provides a multi-protocol adaptation instruction calling method, comprising:
[0006] receiving a first instruction sent by the gateway system to a target device, and identifying a protocol type of a command interface of the target device;
[0007] In the case where it is identified that the protocol type of the command interface of the target device is a non-command type protocol, matching a mapping table of pseudo-command sets according to the attribute information of the target device to obtain a first pseudo-command set corresponding to the target device;
[0008] Based on the first pseudo-instruction set, the first instruction is translated into pseudo-instructions and message is assembled to generate a protocol message text;
[0009] The protocol message text is sent to the target device.
[0010] In one embodiment, matching a mapping table of pseudo instruction sets according to the attribute information of the target device to obtain a first pseudo instruction set corresponding to the target device includes:
[0011] According to the device manufacturer, device type and software version corresponding to the target device, a mapping table of pseudo instruction sets is matched to obtain a first pseudo instruction set corresponding to the target device.
[0012] In one embodiment, before the step of matching the mapping table of pseudo instruction sets according to the information of the target device to obtain the first pseudo instruction set corresponding to the target device, the step further includes:
[0013] Interface features of multiple equipment manufacturers are clustered and grouped, and protocol types, equipment manufacturers, equipment types, and software versions are mapped into corresponding pseudo instruction sets to obtain a mapping table of the pseudo instruction set.
[0014] In one embodiment, the performing pseudo instruction translation and message assembly on the first instruction based on the first pseudo instruction set to generate a protocol message text includes:
[0015] Obtaining a prefix of a pseudo-instruction corresponding to the first instruction, and matching a first pseudo-instruction from the first pseudo-instruction set by using the prefix and a device manufacturer, a device type, and a software version corresponding to the target device;
[0016] Obtaining input parameters of the first instruction;
[0017] A message template corresponding to the first pseudo instruction is obtained, and the message template is rendered in combination with the input parameters and the attribute information corresponding to the target device to generate a protocol message text.
[0018] In one embodiment, the method further comprises:
[0019] When it is identified that the protocol type of the command interface of the target device is a command-type protocol, the first command is sent to the target device according to the command issuing mechanism of the command-type interface.
[0020] In one embodiment, the non-command type protocol includes at least one of the following: HTTP, DB, CORBA, FTP, SNMP.
[0021] In a second aspect, the present invention provides a multi-protocol adapted instruction calling device, comprising:
[0022] An interface protocol identification module, configured to receive a first instruction sent by the gateway system to a target device and identify a protocol type of an instruction interface of the target device;
[0023] a pseudo instruction set matching module, configured to match a mapping table of pseudo instruction sets according to attribute information of the target device to obtain a first pseudo instruction set corresponding to the target device when the protocol type of the instruction interface of the target device is identified as a non-instruction type protocol;
[0024] A message generation module, used for performing pseudo-instruction translation and message assembly on the first instruction based on the first pseudo-instruction set to generate a protocol message text;
[0025] A sending module is used to send the protocol message text to the target device.
[0026] In a third aspect, the present invention provides an electronic device comprising a memory and a memory storing a computer program, wherein the processor, when executing the program, implements the steps of the instructional calling method for multi-protocol adaptation described in the first aspect.
[0027] In a fourth aspect, the present invention provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, wherein the computer program is used to enable the processor to execute the steps of the instruction-based calling method for multi-protocol adaptation described in the first aspect.
[0028] The present invention provides a multi-protocol adapted instruction calling method and device, which, when receiving a first instruction sent by a gateway system to a target device, identifies the protocol type of the instruction interface of the target device; when identifying that the protocol type of the instruction interface of the target device is a non-instruction type protocol, matches a mapping table of a pseudo-instruction set according to the attribute information of the target device to obtain a first pseudo-instruction set corresponding to the target device, and after matching the corresponding pseudo-instruction set, performs pseudo-instruction translation and message assembly to generate a protocol message text and send it to the target device. The present invention realizes multi-protocol instruction adaptation based on the attribute information of the target device through a pseudo-instruction set, so that the instruction channel device realizes the expansion capability of multiple interface protocols, and there is no need to develop an interface connection with a southbound device. By using the instruction sending channel of the instruction channel device, the sending operation capability of the non-instruction type interface can be completed. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 A schematic diagram of the process of issuing instructions from a network management system in the related technology;
[0031] Figure 2 A schematic diagram of a path for issuing instructions in related technologies;
[0032] Figure 3 One of the flow charts of the instructional calling method for multi-protocol adaptation provided by the embodiment of the present invention;
[0033] Figure 4 A schematic diagram of the overall business logic of the instruction channel device provided by an embodiment of the present invention;
[0034] Figure 5 A schematic diagram of a process for translating pseudo instructions and assembling messages for the first instructions based on the first pseudo instruction set to generate a protocol message text provided in an embodiment of the present invention;
[0035] Figure 6 A schematic diagram of pseudo instruction translation and message assembly provided by an embodiment of the present invention;
[0036] Figure 7 A second flow chart of the instruction-based calling method for multi-protocol adaptation provided by an embodiment of the present invention;
[0037] Figure 8 A schematic diagram of an application scenario of the multi-protocol adaptation instruction calling method provided by an embodiment of the present invention;
[0038] Fig. 9 A schematic diagram of the structure of a multi-protocol adaptation instruction calling device provided by an embodiment of the present invention;
[0039] Fig.10 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] In the complex device interaction environment of the 5th generation mobile communication (5G) device virtualization and cloudification, the network management system has put forward higher requirements for the interactive operation with devices in 5G service orchestration, service activation, data collection, fault preprocessing, intelligent inspection and other scenarios. With the full commercialization of 5G networks and network function virtualization (NFV), cloud computing, virtualization, and edge computing technologies have emerged. The interface protocols released by southbound devices are not limited to the remote login protocol (teletype network, Telnet) and Secure Shell Protocol Version 2 (Secure Shell 2, SSH2). Since the current command channel device does not support non-command protocols, the network management system currently directly accesses the device. Figure 2 FIG. 1 is a schematic diagram of the path for issuing instructions in the related technology. Figure 2 As shown, the existing instruction calling method and device are only applicable to the two protocols of Telnet and SSH2, and the defects are:
[0042] 1. The system does not support the sending operation for non-command protocols such as Hyper Text Transfer Protocol (HTTP), database protocol DB (data base), Common Object Request Broker Architecture (CORBA), Simple Network Management Protocol (SNMP), and File Transfer Protocol (FTP).
[0043] 2. Each network management system needs customized development of non-command interfaces to meet business requirements.
[0044] 3. The operation of accessing devices by bypassing the instruction device results in significant security concealment and uncontrollable access in network security management.
[0045] In order to solve the above defects, the embodiments of the present invention provide a multi-protocol adaptation instruction calling method and device.
[0046] The following describes in detail the multi-protocol adaptation instruction calling method provided by the embodiment of the present invention through specific embodiments and application scenarios in conjunction with the accompanying drawings.
[0047] The instruction-based calling method for multi-protocol adaptation provided in an embodiment of the present invention can be executed by an instruction channel device or a functional module or functional entity in the instruction channel device that can implement the instruction-based calling method for multi-protocol adaptation.
[0048] The command channel device mentioned in the embodiment of the present invention refers to a protocol proxy device between the network management system and the command interface (Telnet, SSH2) of different equipment manufacturers, which mainly plays the role of a bastion host and establishes a secure command issuing and calling channel between the network management system and the equipment. It should be noted that the command channel device can also be called a protocol proxy device.
[0049] The following describes the instruction-based calling method for multi-protocol adaptation provided by an embodiment of the present invention by taking the instruction channel device as an execution subject as an example.
[0050] Figure 3 One of the flow charts of the instructional calling method for multi-protocol adaptation provided by the embodiment of the present invention is as follows: Figure 3 As shown, the multi-protocol adaptation instruction calling method includes the following steps:
[0051] Step 100: receiving a first instruction sent by the gateway system to a target device, and identifying a protocol type of an instruction interface of the target device;
[0052] The command channel device receives a first command sent from the gateway system to the target device, and identifies the protocol type of the command interface of the target device.
[0053] It should be noted that the present application does not limit the order of receiving the first instruction sent by the gateway system to the target device and identifying the protocol type of the instruction interface of the target device.
[0054] Optionally, after receiving the first instruction sent by the gateway system to the target device, the instruction channel device identifies the protocol type of the instruction interface of the target device.
[0055] Optionally, the command channel device identifies the protocol type of the command interface of the target device, and then receives the first command sent by the gateway system to the target device.
[0056] Step 101: When it is identified that the protocol type of the command interface of the target device is a non-command type protocol, a mapping table of a pseudo-command set is matched according to the attribute information of the target device to obtain a first pseudo-command set corresponding to the target device;
[0057] If the command channel device recognizes that the protocol type of the command interface of the target device is a non-command protocol, a mapping table of a pseudo-command set is matched according to the attribute information of the target device to obtain a first pseudo-command set corresponding to the target device.
[0058] Optionally, the non-command type protocol includes at least one of the following: HTTP, DB, CORBA, FTP, SNMP.
[0059] For example, if the command channel device identifies that the protocol type of the command interface of the target device is SNMP, it determines that the protocol type of the command interface of the target device is a non-command type protocol.
[0060] Optionally, the attribute information of the target device includes but is not limited to device manufacturer, device type and software version.
[0061] It should be noted that, in the embodiment of the present invention, the attribute information of the target device may also be replaced by the interface characteristics of the target device.
[0062] If it is determined that the protocol type of the command interface of the target device is a non-command type protocol, the command channel device will match the mapping table of the pseudo-command set according to the attribute information of the target device to obtain the first pseudo-command set corresponding to the target device.
[0063] The mapping table of the pseudo instruction set contains the mapping relationship between the attribute information of the target device and the pseudo instruction set.
[0064] It can be understood that the pseudo instruction sets corresponding to the target devices with the same attribute information are the same.
[0065] In the specific implementation process, the mapping table of the pseudo-instruction set can cluster and group the interface features of major mainstream equipment manufacturers, and map them into a corresponding set of pseudo-instruction sets based on protocol type, equipment manufacturer, equipment type, and software version, supporting matching rules for equipment manufacturer, equipment type, and software version.
[0066] It should be noted that the embodiment of the present invention does not limit the order of step 100 and step 101.
[0067] In some optional embodiments, step 101 may be performed before step 100 .
[0068] For example, after the network management system successfully connects to the target device, the command channel device matches the mapping table of the pseudo-command set according to the attribute information of the target device to obtain a set of pseudo-command sets corresponding to the target device. This step occurs before the network management system issues commands.
[0069] Step 102: performing pseudo-instruction translation and message assembly on the first instruction based on the first pseudo-instruction set to generate a protocol message text;
[0070] The instruction channel device performs pseudo-instruction translation and message assembly on the first instruction based on the first pseudo-instruction set to generate a protocol message text.
[0071] Step 103: Send the protocol message text to the target device.
[0072] Finally, the instruction channel device sends the protocol message text to the target device, thereby sending the instruction to the target device.
[0073] The overall business logic of the instruction channel device provided in the embodiment of the present invention can be referred to Figure 4 .
[0074] The multi-protocol adaptation instruction calling method provided by the present invention realizes multi-protocol instruction adaptation based on the attribute information of the target device through a pseudo-instruction set, so that the instruction channel device can realize the expansion capability of multiple interface protocols, and there is no need to develop interface docking with the southbound device. By using the instruction issuance channel of the instruction channel device, the issuance operation capability of the non-instruction type interface can be completed. The instruction channel device is very suitable for new technical environments (5G, NFV) through this novel multi-protocol adaptation method. In the new technical environment, the instruction channel device still has the ability to control the safe and orderly issuance of instructions of the network management system.
[0075] On the basis of the above embodiment, before the step of matching the mapping table of pseudo instruction sets according to the information of the target device to obtain the first pseudo instruction set corresponding to the target device, the step further includes:
[0076] Interface features of multiple equipment manufacturers are clustered and grouped, and protocol types, equipment manufacturers, equipment types, and software versions are mapped into corresponding pseudo instruction sets to obtain a mapping table of the pseudo instruction set.
[0077] In the present invention, the definition of a pseudo-instruction set is a method of clustering a group of identical devices and mapping them to a set of pseudo-instruction sets, thereby forming a set of modes that are compatible with the current instruction issuance. The mapping rules for different protocols (non-instruction type) and device types are "protocol type" + "manufacturer" + "device type" + "software version", as shown in Table 1 below.
[0078] Table 1 Mapping table of pseudo instruction set
[0079]
[0080] In some optional embodiments, matching a mapping table of pseudo instruction sets according to the attribute information of the target device to obtain a first pseudo instruction set corresponding to the target device includes:
[0081] According to the device manufacturer, device type and software version corresponding to the target device, a mapping table of pseudo instruction sets is matched to obtain a first pseudo instruction set corresponding to the target device.
[0082] The mapping method in the embodiment of the present invention clusters and groups based on the interface characteristics of major mainstream equipment manufacturers, maps the protocol type, equipment manufacturer, equipment type and software version into a corresponding set of pseudo-instruction sets, and supports matching rules based on equipment manufacturer, equipment type and software version.
[0083] The specific matching rules are as follows:
[0084] 1. Equipment manufacturer: Use regular expressions for exact or fuzzy matching, "*" represents all.
[0085] 2. Device type: Use regular expressions for exact or fuzzy matching. “*” represents all.
[0086] 3. Software version: Use the interval method for exact or fuzzy matching, such as: [1.0] == 1.0 equals version 1.0, [1.0,)>= version greater than or equal to 1.0, (1.0,)>1.0 version greater than 1.0, "*" represents all.
[0087] By using the regular and interval matching method of the three attributes of device manufacturer, device type, and software version, a cluster configuration process that adapts to more devices with less configuration workload can be achieved.
[0088] In some optional embodiments, such as Figure 5 As shown, the step 102 performs pseudo-instruction translation and message assembly on the first instruction based on the first pseudo-instruction set to generate a protocol message text, including the following sub-steps:
[0089] Step 200: Obtain a prefix of a pseudo-instruction corresponding to the first instruction, and match a first pseudo-instruction from the first pseudo-instruction set by using the prefix and the device manufacturer, device type, and software version corresponding to the target device;
[0090] Step 201: Obtain input parameters of the first instruction;
[0091] Step 203: Obtain a message template corresponding to the first pseudo instruction, render the message template in combination with the input parameters and the attribute information corresponding to the target device, and generate a protocol message text.
[0092] That is, the instruction channel device obtains the prefix of the pseudo-instruction corresponding to the first instruction, and matches the first pseudo-instruction from the first pseudo-instruction set using the prefix and the device manufacturer, device type and software version corresponding to the target device.
[0093] Further, the input parameters of the first instruction are extracted. For example, the input parameters of the instruction {test, 128.0.0.34, 128.0.0.220, 24, ture} are extracted, which correspond to the instruction name, the starting IP address, the ending IP address, the subnet mask and whether to update.
[0094] The matching message template is extracted, and the message template is rendered in combination with the input parameters and the attribute information of the target device to generate a specific protocol message text.
[0095] Figure 6 A schematic diagram of pseudo instruction translation and message assembly provided by an embodiment of the present invention. Figure 6 ,The pseudo-instruction translation process includes instruction recognition and parameter extraction.
[0096] In some optional embodiments, the method further includes:
[0097] When it is identified that the protocol type of the command interface of the target device is a command-type protocol, the first command is sent to the target device according to the command issuing mechanism of the command-type interface.
[0098] Figure 7 The second flowchart of the instruction-based calling method for multi-protocol adaptation provided by the embodiment of the present invention. Figure 7 The multi-protocol adaptation instruction calling method includes the steps of protocol identification, pseudo instruction set matching, pseudo instruction translation, message assembly and sending.
[0099] If the command channel device identifies that the protocol type of the command interface of the target device is a command type protocol, it will issue the command according to the command issuing mechanism of the command type interface.
[0100] That is, the command channel device supports converting non-command protocol messages into commands through this new multi-protocol adaptation method, and integrates it with the original command protocol delivery process.
[0101] The present invention realizes multi-protocol adaptation based on protocol type, equipment manufacturer, equipment type and software version through a pseudo instruction set.
[0102] Figure 8 Schematic diagram of application scenarios of the multi-protocol adaptation instruction calling method provided in an embodiment of the present invention. In the present invention, the instruction channel device realizes the expansion capability of multiple interface protocols through the above-mentioned multi-protocol adaptation instruction calling method. The network management system does not need to develop an interface connection with the southbound device. By using the instruction issuing channel of the instruction channel device, the issuing operation capability of the non-instruction type interface can be completed. In the new technical environment (5G, NFV), the instruction channel device still has the ability to control the safe and orderly instruction issuing control of the network management system.
[0103] The following is a description of the multi-protocol adaptation instruction calling device provided by the present invention. The multi-protocol adaptation instruction calling device described below and the multi-protocol adaptation instruction calling method described above can be referenced to each other.
[0104] Fig. 9 A schematic diagram of the structure of a multi-protocol adaptation instruction calling device provided by an embodiment of the present invention. Fig. 9 As shown, the multi-protocol adaptation instruction calling device includes:
[0105] An interface protocol identification module 910 is used to receive a first instruction sent by the gateway system to a target device, and identify a protocol type of an instruction interface of the target device;
[0106] The pseudo instruction set matching module 920 is used to match the mapping table of the pseudo instruction set according to the attribute information of the target device to obtain a first pseudo instruction set corresponding to the target device when the protocol type of the instruction interface of the target device is identified as a non-instruction type protocol;
[0107] A message generation module 930, configured to perform pseudo-instruction translation and message assembly on the first instruction based on the first pseudo-instruction set to generate a protocol message text;
[0108] The sending module 940 is used to send the protocol message text to the target device.
[0109] The multi-protocol adaptation instruction calling device provided by the present invention realizes multi-protocol instruction adaptation based on the attribute information of the target device through a pseudo-instruction set, so that the instruction channel device can realize the expansion capability of multiple interface protocols, and there is no need to develop interface docking with the southbound device. By using the instruction issuance channel of the instruction channel device, the issuance operation capability of the non-instruction type interface can be completed. The instruction channel device is very suitable for new technical environments (5G, NFV) through this novel multi-protocol adaptation method. In the new technical environment, the instruction channel device still has the ability to control the safe and orderly issuance of instructions of the network management system.
[0110] Optionally, matching a mapping table of pseudo instruction sets according to the attribute information of the target device to obtain a first pseudo instruction set corresponding to the target device includes:
[0111] According to the device manufacturer, device type and software version corresponding to the target device, a mapping table of pseudo instruction sets is matched to obtain a first pseudo instruction set corresponding to the target device.
[0112] Optionally, it also includes:
[0113] The mapping module is used to cluster and group the interface features of multiple equipment manufacturers, map the protocol type, equipment manufacturer, equipment type and software version into a corresponding pseudo instruction set, and obtain a mapping table of the pseudo instruction set.
[0114] Optionally, the message generating module 930 is specifically configured to:
[0115] Obtaining a prefix of a pseudo-instruction corresponding to the first instruction, and matching a first pseudo-instruction from the first pseudo-instruction set by using the prefix and a device manufacturer, a device type, and a software version corresponding to the target device;
[0116] Obtaining input parameters of the first instruction;
[0117] A message template corresponding to the first pseudo instruction is obtained, and the message template is rendered in combination with the input parameters and the attribute information corresponding to the target device to generate a protocol message text.
[0118] Optionally, it also includes:
[0119] The processing module is used to send the first instruction to the target device according to the instruction issuing mechanism of the instruction type interface when it is identified that the protocol type of the instruction interface of the target device is a command type protocol.
[0120] Optionally, the non-command type protocol includes at least one of the following: HTTP, DB, CORBA, FTP, SNMP.
[0121] The multi-protocol adaptation instruction calling device provided in the embodiment of the present invention may be an instruction channel device
[0122] It should be noted here that the multi-protocol adaptive instruction calling device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment and can achieve the same technical effect. The parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.
[0123] Fig.10 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.10 As shown, the electronic device may include: a processor 1010, a communication interface 1020, a memory 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020, and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 may call a computer program in the memory 1030 to execute the steps of the instruction-based calling method of multi-protocol adaptation, for example, including:
[0124] receiving a first instruction sent by the gateway system to a target device, and identifying a protocol type of a command interface of the target device;
[0125] In the case where it is identified that the protocol type of the command interface of the target device is a non-command type protocol, matching a mapping table of pseudo-command sets according to the attribute information of the target device to obtain a first pseudo-command set corresponding to the target device;
[0126] Based on the first pseudo-instruction set, the first instruction is translated into pseudo-instructions and message is assembled to generate a protocol message text;
[0127] The protocol message text is sent to the target device.
[0128] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0129] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer can execute the instruction-based calling method of multi-protocol adaptation provided by the above methods, the method comprising:
[0130] receiving a first instruction sent by the gateway system to a target device, and identifying a protocol type of a command interface of the target device;
[0131] In the case where it is identified that the protocol type of the command interface of the target device is a non-command type protocol, matching a mapping table of pseudo-command sets according to the attribute information of the target device to obtain a first pseudo-command set corresponding to the target device;
[0132] Based on the first pseudo-instruction set, the first instruction is translated into pseudo-instructions and message is assembled to generate a protocol message text;
[0133] The protocol message text is sent to the target device.
[0134] On the other hand, an embodiment of the present application further provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, wherein the computer program is used to enable the processor to execute the instruction-based calling method of multi-protocol adaptation provided in the above embodiments, for example, including:
[0135] receiving a first instruction sent by the gateway system to a target device, and identifying a protocol type of a command interface of the target device;
[0136] In the case where it is identified that the protocol type of the command interface of the target device is a non-command type protocol, matching a mapping table of pseudo-command sets according to the attribute information of the target device to obtain a first pseudo-command set corresponding to the target device;
[0137] Based on the first pseudo-instruction set, the first instruction is translated into pseudo-instructions and message is assembled to generate a protocol message text;
[0138] The protocol message text is sent to the target device.
[0139] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0140] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0141] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-protocol adapted instruction calling method, applied to an instruction channel device, characterized in that: include: receiving a first instruction sent by the gateway system to a target device, and identifying a protocol type of a command interface of the target device; In the case where the protocol type of the command interface of the target device is identified as a non-command type protocol, a mapping table of a pseudo-command set is matched according to the attribute information of the target device to obtain a first pseudo-command set corresponding to the target device; the non-command type protocol includes at least one of the following: HTTP, DB, CORBA, FTP, SNMP; Based on the first pseudo-instruction set, the first instruction is translated into pseudo-instructions and message is assembled to generate a protocol message text; Sending the protocol message text to the target device; The performing pseudo-instruction translation and message assembly on the first instruction based on the first pseudo-instruction set to generate a protocol message text includes: Obtaining a prefix of a pseudo-instruction corresponding to the first instruction, and matching a first pseudo-instruction from the first pseudo-instruction set by using the prefix and a device manufacturer, a device type, and a software version corresponding to the target device; Obtaining input parameters of the first instruction; A message template corresponding to the first pseudo instruction is obtained, and the message template is rendered in combination with the input parameters and the attribute information corresponding to the target device to generate a protocol message text.
2. The multi-protocol adaptation instruction calling method according to claim 1, characterized in that: The matching of the mapping table of pseudo instruction sets according to the attribute information of the target device to obtain a first pseudo instruction set corresponding to the target device includes: According to the device manufacturer, device type and software version corresponding to the target device, a mapping table of pseudo instruction sets is matched to obtain a first pseudo instruction set corresponding to the target device.
3. The multi-protocol adaptation instruction calling method according to claim 1 or 2, characterized in that: Before the step of matching the mapping table of pseudo instruction sets according to the information of the target device to obtain the first pseudo instruction set corresponding to the target device, the method further includes: Interface features of multiple equipment manufacturers are clustered and grouped, and protocol types, equipment manufacturers, equipment types, and software versions are mapped into corresponding pseudo instruction sets to obtain a mapping table of the pseudo instruction set.
4. The multi-protocol adaptation instruction calling method according to claim 1, characterized in that: The method further comprises: When it is identified that the protocol type of the command interface of the target device is a command type protocol, the first command is sent to the target device according to the command issuing mechanism of the command type interface; the command type protocol includes Telnet and SSH2.
5. A multi-protocol adapted instruction calling device, characterized in that: An interface protocol identification module, configured to receive a first instruction sent by the gateway system to a target device and identify a protocol type of an instruction interface of the target device; A pseudo-instruction set matching module is used to match a mapping table of pseudo-instruction sets according to attribute information of the target device to obtain a first pseudo-instruction set corresponding to the target device when the protocol type of the instruction interface of the target device is identified as a non-instruction type protocol; the non-instruction type protocol includes at least one of the following: HTTP, DB, CORBA, FTP, SNMP; A message generation module, used for performing pseudo-instruction translation and message assembly on the first instruction based on the first pseudo-instruction set to generate a protocol message text; A sending module, used to send the protocol message text to the target device; The message generation module is used to obtain a prefix of a pseudo-instruction corresponding to the first instruction, and match the first pseudo-instruction from the first pseudo-instruction set using the prefix and the device manufacturer, device type and software version corresponding to the target device; and obtain input parameters of the first instruction; A message template corresponding to the first pseudo instruction is obtained, and the message template is rendered in combination with the input parameters and the attribute information corresponding to the target device to generate a protocol message text.
6. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the steps of the instruction-based calling method for multi-protocol adaptation described in any one of claims 1 to 4 are implemented.
7. A processor-readable storage medium, characterized in that: The processor-readable storage medium stores a computer program, and the computer program is used to enable the processor to execute the steps of the multi-protocol adaptation instruction calling method according to any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the instruction-based calling method for multi-protocol adaptation as claimed in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Transactional network management engine for intelligent pipeline and network management transaction processing method of transactional network management engine
CN104660435A