CN112383408A - Management platform end for data format conversion and data format conversion method - Google Patents

Management platform end for data format conversion and data format conversion method Download PDF

Info

Publication number
CN112383408A
CN112383408A CN202011051437.XA CN202011051437A CN112383408A CN 112383408 A CN112383408 A CN 112383408A CN 202011051437 A CN202011051437 A CN 202011051437A CN 112383408 A CN112383408 A CN 112383408A
Authority
CN
China
Prior art keywords
snmp
data
message
data message
private
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011051437.XA
Other languages
Chinese (zh)
Other versions
CN112383408B (en
Inventor
孙亚雄
陈辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Hongxin Technology Development Co Ltd
Original Assignee
Wuhan Hongxin Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Hongxin Technology Development Co Ltd filed Critical Wuhan Hongxin Technology Development Co Ltd
Priority to CN202011051437.XA priority Critical patent/CN112383408B/en
Publication of CN112383408A publication Critical patent/CN112383408A/en
Application granted granted Critical
Publication of CN112383408B publication Critical patent/CN112383408B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0213Standardised network management protocols, e.g. simple network management protocol [SNMP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The embodiment of the invention provides a management platform end for data format conversion and a data format conversion method, wherein the management platform end comprises a snmp communication platform layer, a service layer and a service layer, wherein the snmp communication platform layer is used for receiving a private data message sent by a control device and transmitting the private data message to the service layer; sending the snmp data message converted by the service layer to the controlled equipment; and the service layer is used for converting the private data message into a snmp data message and transmitting the converted snmp data message to the snmp communication platform layer. The embodiment of the invention is used as a service layer, a snmp packet packing method is not needed to be known, only a private data structure body and a snmp data structure body are needed to be mapped by utilizing a general structure, the conversion between the private data message and the snmp data message can be realized, the assembly and the sending of the pdu packet can be directly realized by a bottom-layer snmp communication platform layer, and the pdu packet is clear in code structure, distinct in hierarchy, and better in readability and maintainability.

Description

Management platform end for data format conversion and data format conversion method
Technical Field
The present invention relates to the field of data communication technologies, and in particular, to a management platform for data format conversion and a data format conversion method.
Background
Snmp (simple Network Management protocol) is a "simple Network Management protocol" protocol for Network Management. It runs on top of the TCP/IP protocol cluster and is an application layer protocol. The network management system is defined as a uniform interface and protocol for different types of equipment, equipment manufactured by different manufacturers and equipment of different models, so that an administrator can manage the network equipment needing to be managed by using a uniform appearance. Through the network, an administrator can manage the equipment in different physical spaces, so that the efficiency of network management is greatly improved, and the work of the network administrator is simplified.
Specifically, SNMP provides an administrator with a network management platform (NMS), also called a management station, which is responsible for issuing network management commands, storing data, and analyzing data. An SNMP agent is operated on the managed equipment, and the agent realizes the SNMP communication between the equipment and the management station. The management station and the agent terminal are unified by an interface through a Management Information Base (MIB), which defines the managed objects in the device. The management station and the agent both implement corresponding MIB objects, so that both parties can identify data of the other party and implement communication. The management station applies for the data defined in the MIB from the agent, after the agent identifies, the data such as the relevant state or parameter provided by the management equipment is converted into the format defined by the MIB, and the management station responds to the data to complete one management operation.
For network management, the configuration, parameters and state information of the device need to be checked and changed through reading and setting, and meanwhile, the device is required to be capable of actively reporting in order to acquire important state changes of the device in time. Therefore, referring to fig. 1, in order to achieve the above information interaction, the management side and the agent side define five messages, which are respectively get-requests, that is, extracting one or more parameter values from the agent; get-next-request, extracting a next parameter value of the one or more parameters from the agent; set-request, setting one or more parameters of the agent; get-response, the agent end returns one or more parameter values to the management end; and trap, the agent actively reports information to the management terminal. The first three operations are sent from the management end to the agent end, the last two operations are sent from the agent end to the management end, and the management end communicates with the Udp port 161 of the agent end through the Udp port 162.
However, snmp is not supported by all devices, and for an embedded device which does not support snmp, an open-source net-snmp needs to be migrated, and a library function provided by the net-snmp needs to be called to write a corresponding program. After a program is written by using net-SNMP, the SNMP data message needs to be converted into a locally required private data structure message during receiving, and the local private data message needs to be converted into a message in an SNMP format during sending. Whether receiving or sending, the mutual conversion of the SNMP data message and the private data message is involved. Embodied as parse or fill oid, parse or fill data type, and parse or fill data value. If a function is written for each such translation, the code will appear very redundant and will be poorly readable and maintainable.
Disclosure of Invention
The embodiment of the invention provides a management platform end for data format conversion and a data format conversion method, which are used for solving the defect that a control device supporting a private format and a controlled device supporting a snmp protocol cannot communicate in the prior art and realizing the conversion between the private format and the snmp format.
The embodiment of the invention provides a management platform end for data format conversion, which comprises an embedded development board developed at the management platform end, and a snmp communication platform layer and a service layer which are asynchronously built on the embedded development board;
the snmp communication platform layer is used for receiving a private data message sent by a control device and transmitting the private data message to a service layer; sending the snmp data message converted by the service layer to the controlled equipment;
and the service layer is used for converting the private data message into a snmp data message and transmitting the converted snmp data message to the snmp communication platform layer.
On the basis of the above technical solutions, the embodiments of the present invention may be further improved as follows.
Optionally, the service layer is further configured to:
a local mapping table is pre-established on a service layer, and the local mapping table stores the mapping relation between the structure data in a private data message structure body and the structure data in a snmp data message structure body;
correspondingly, the step of converting the private data message into the snmp data message by the service layer comprises the following steps:
according to the extracted structure data in the private data message structure, mapping the data in the private data structure into structure data in a snmp data structure based on a local mapping table;
and organizing according to the structure data in the mapped snmp data structure according to the snmp data structure to form the snmp data message.
Optionally, the snmp communication platform layer is further configured to receive a snmp data message sent by the controlled device, and transmit the snmp data message to the service layer; the converted private data message transmitted by the service layer is sent to the control equipment; the control equipment does not support a snmp protocol, and the controlled equipment is controlled equipment of the snmp protocol;
the service layer is further configured to convert the snmp data message transmitted by the snmp communication platform layer into a private data message, and transmit the converted private data message to the snmp communication platform layer.
The embodiment of the invention also provides a data format conversion method, which comprises the following steps:
s1, the snmp communication platform layer receives the private data message sent by the control device and transmits the private data message to the service layer;
s2, the service layer converts the private data message into a snmp data message, and transmits the converted snmp data message to the snmp communication platform layer;
s3, the snmp communication platform layer sends the snmp data message converted by the service layer to the controlled equipment;
the managed equipment does not support a snmp protocol, and the controlled equipment is controlled equipment of the snmp protocol; the snmp communication platform layer and the service layer are asynchronously built on an embedded development board, and the embedded development board is developed at a management platform end.
Optionally, the private data message is organized according to a private data structure body agreed by the management and control device and the embedded development board;
the snmp data message is organized according to an embedded development board and an snmp data structure body agreed by controlled equipment;
the business layer converting the private data message into a snmp data message comprises:
and the service layer extracts the structure data from the private data structure of the private data message, and organizes the extracted structure data according to the snmp data structure to form the snmp data message.
Optionally, before the business layer converts the private data message into a snmp data message, the method further includes:
a local mapping table is pre-established on a service layer, and the local mapping table stores the mapping relation between the structure data in a private data message structure body and the structure data in a snmp data message structure body;
correspondingly, the step of converting the private data message into the snmp data message by the service layer comprises the following steps:
according to the extracted structure data in the private data message structure, mapping the structure data in the private data structure into data in a snmp data structure based on a local mapping table;
and organizing according to the structure data in the mapped snmp data structure according to the snmp data structure to form the snmp data message.
Optionally, the private data structure includes each operating parameter and a data type of each operating parameter;
the snmp data message structure comprises the operation type of the message, the message id, the number of the mib nodes in the message body and information of each mib node, wherein each mib node comprises oid object identifiers, oid data types corresponding to the object identifiers and specific data values.
Optionally, the pre-establishing a local mapping table on the service layer, where the local mapping table stores a mapping relationship between structure data in a private data message structure and structure data in a snmp data message structure, includes:
a global variable array is maintained in the local mapping table for each private data message, the global variable array comprises message id, mapping relation between each operation parameter in the message and oid object identifier, the number of oid object identifiers required by the message to operate, and operation type of the message, wherein one operation parameter corresponds to one oid object identifier.
Optionally, the mapping, according to the extracted structure data in the private data message structure, the structure data in the private data structure to the data in the snmp data structure based on the local mapping table includes:
the service layer extracts each operating parameter, the type of each operating parameter and a message id from the private data structure body according to the private data message;
according to the message id, finding a corresponding global variable array from a local mapping table;
finding corresponding oid object identifiers according to each operating parameter, and counting the number of oid object identifiers, wherein one operating parameter corresponds to one mib node;
and determining the message operation type according to the private data message sent by the control equipment.
Optionally, the organizing according to the data in the mapped snmp data structure according to the snmp data structure, and the forming the snmp data message includes:
and filling the mapped number of the mib nodes, the oid object identifiers included by each mib node, the number of oid object identifiers, the data types and specific data values corresponding to the oid object identifiers and the operation types of the messages into a snmp data structure, and generating the snmp data message corresponding to the private data message.
The management platform end for data format conversion and the data format conversion method provided by the embodiment of the invention are used as service layer application, do not need to know the packaging method of the snmp, only need to maintain a private data structure, the snmp operation type and oid of the operation as a local mapping table, call a general conversion function by filling the private structure, and then call a sending interface. The underlying snmp communication platform can directly realize the assembly and sending of the pdu package. When receiving, only receiving the message sent by the snmp communication platform, and converting the snmp message into a message of a local private data structure by using a general structure. The code structure is clear, the hierarchy is clear, and the readability and the maintainability are good.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic diagram illustrating information interaction between a management side and an agent side in the prior art;
fig. 2 is a schematic structural diagram of a management platform for data format conversion according to an embodiment of the present invention;
fig. 3 is a flowchart of a data format conversion method according to an embodiment of the present invention;
fig. 4 is an overall flowchart of a data format conversion method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 2, a management platform end for data format conversion is provided, which includes an embedded development board developed at the management platform end, and a snmp communication platform layer and a service layer asynchronously built on the embedded development board.
The SNMP communication platform layer is used for receiving the private data message sent by the control equipment and transmitting the private data message to the service layer; sending the snmp data message converted by the service layer to the controlled equipment; and the service layer is used for converting the private data message into a snmp data message and transmitting the converted snmp data message to the snmp communication platform layer.
It can be understood that, based on the defects in the background art, the application scenario in the embodiment of the present invention is that the management and control device is a mobile phone end, and does not support the snmp protocol, and the controlled end supports the snmp protocol. The embodiment of the invention provides a management platform end, an embedded development board is developed at the management platform end, and a snmp communication platform layer and a service layer are asynchronously built on the embedded development board.
Wherein, for the embedded development board, if the snmp protocol is required to be supported, the open-source net-snmp can be transplanted into the embedded development board. And constructing an asynchronous snmp communication platform layer on the embedded development board by utilizing a library function provided by the net-snmp, wherein the snmp communication platform layer provides a registration interface for the business layer and transfers the received and sent snmp message. When the service layer calls a registration interface to register with the snmp communication platform layer, the snmp communication platform layer creates a snmp session to the proxy end. Wherein one agent is created on each controlled device.
The snmp communication platform layer receives the private data message sent by the control equipment, transmits the private data message to the service layer, converts the private data message into an snmp data message on the service layer, transmits the converted snmp data message to the snmp communication platform layer, and sends the converted snmp data message to the controlled equipment by the snmp communication platform layer, so that the information transmission process from the control equipment to the controlled equipment is completed.
As a possible implementation, the service layer is further configured to: and a local mapping table is pre-established on a service layer, and the local mapping table stores the mapping relation between the structure data in the private data structure body and the structure data in the snmp data message structure body. Correspondingly, the step of converting the private data message into the snmp data message by the service layer comprises the following steps: according to the extracted structure data in the private data message structure, mapping the structure data in the private data structure into structure data in a snmp data structure based on a local mapping table; and organizing according to the structure data in the mapped snmp data structure according to the snmp data structure to form the snmp data message.
It can be understood that, in order to realize the conversion of the data format of the message between the management and control device and the controlled device, a local mapping table is established on the service layer, and the local mapping table stores the mapping relationship between each item of data in the private data structure and each item of data in the snmp data structure.
When the business layer receives the private Data message sent by the control equipment, extracting various Data in the private Data structure, mapping the various Data in the private Data structure into various Data in the snmp Data structure through a local mapping table, filling the mapped various Data in the defined snmp Data structure to generate the snmp Data message, then sending the snmp Data message to the snmp communication platform layer through a message queue, forming a pdu (Protocol Data Unit) packet by the snmp communication platform layer, and sending the pdu packet to the controlled equipment.
As a possible implementation manner, the snmp communication platform layer is further configured to receive a snmp data message sent by the controlled device, and transmit the snmp data message to the service layer; the converted private data message transmitted by the service layer is sent to the control equipment; the control equipment does not support the snmp protocol, and the controlled equipment is controlled equipment of the snmp protocol; the service layer is also used for converting the snmp data message transmitted by the snmp communication platform layer into a private data message and transmitting the converted private data message to the snmp communication platform layer.
It can be understood that, in the embodiment of the present invention, when the controlled device sends a return message to the management and control device, the service layer needs to convert the snmp data message into the private data message, a process of the conversion is exactly opposite to the foregoing process of converting the private data message into the snmp data message, and the foregoing process of converting the snmp data message into the private data message may refer to the foregoing process of converting the private data message into the snmp data message, which is not described herein again.
In the embodiment of the invention, the service layer does not need to care about the message format of the snmp, only needs to support the own private protocol, sends the message structure to the snmp communication platform layer by calling the conversion interface, and the snmp communication platform layer receives and sends the snmp message packet.
Referring to fig. 3, a data format conversion method according to an embodiment of the present invention is provided, including: s1, the snmp communication platform layer receives the private data message sent by the control device and transmits the private data message to the service layer; s2, the service layer converts the private data message into a snmp data message, and transmits the converted snmp data message to the snmp communication platform layer; s3, the snmp communication platform layer sends the snmp data message converted by the service layer to the controlled equipment; the control equipment does not support the snmp protocol, and the controlled equipment is controlled equipment of the snmp protocol; the snmp communication platform layer and the service layer are asynchronously built on an embedded development board, and the embedded development board is developed at a management platform end.
It can be understood that the application scenario of the embodiment of the present invention is that the management and control device is a mobile phone end, and does not support a snmp protocol, and the controlled end supports the snmp protocol. The embodiment of the invention provides a management platform end, an embedded development board is developed at the management platform end, and for the embedded development board, if the snmp protocol is required to be supported, an open-source net-snmp can be transplanted into the embedded development board. And constructing an asynchronous snmp communication platform layer on the embedded development board by utilizing a library function provided by the net-snmp, wherein the snmp communication platform layer provides a registration interface for the business layer and transfers the received and sent snmp message. When the service layer calls a registration interface to register with the snmp communication platform layer, the snmp communication platform layer creates a snmp session to the proxy end. Wherein one agent is created on each controlled device.
The snmp communication platform layer receives the private data message sent by the control equipment, transmits the private data message to the service layer, converts the private data message into an snmp data message on the service layer, transmits the converted snmp data message to the snmp communication platform layer, and sends the converted snmp data message to the controlled equipment by the snmp communication platform layer, so that the information transmission process from the control equipment to the controlled equipment is completed.
As a possible implementation, the private data message is organized according to a private data structure body agreed by the management and control device and the embedded development board; the snmp data messages are organized according to an embedded development board and snmp data structure agreed upon by the controlled equipment. The business layer converting the private data message into the snmp data message comprises the following steps: and the service layer extracts data from the private data structure of the private data message and organizes the extracted data according to the snmp data structure to form the snmp data message.
It can be understood that, among others, the private data structure is agreed by the governing device and the embedded development board, and the snmp data structure is agreed by the embedded device and the controlled device. When the service layer converts the private data message into the snmp data message, extracting each item of data in the private data message, mapping each item of extracted data into each item of data of the snmp data structure, filling each item of mapped data into the snmp data structure, and generating the snmp data message.
As a possible implementation, before the business layer converts the private data message into the snmp data message, the method further includes: and a local mapping table is pre-established on a service layer, and the local mapping table stores the mapping relation between the data in the private data message structure body and the data in the snmp data message structure body. Correspondingly, the step of converting the private data message into the snmp data message by the service layer comprises the following steps: according to the extracted data in the private data message structure, mapping the data in the private data structure into data in a snmp data structure based on a local mapping table; and organizing according to the mapped data in the snmp data structure according to the snmp data structure to form the snmp data message.
It can be understood that, in order to realize the conversion of the data format of the message between the management and control device and the controlled device, a local mapping table is established on the service layer, and the local mapping table stores the mapping relationship between each item of data in the private data structure and each item of data in the snmp data structure.
When the business layer receives the private data message sent by the control equipment, various data in the private data structure body are extracted, various data in the private data structure body are mapped into various data in the snmp data structure body through a local mapping table, the mapped various data are filled in the defined snmp data structure body to generate the snmp data message, then the snmp data message is sent to a snmp communication platform layer through a message queue, and the snmp data message is formed into a PDU (protocol data Unit) packet by the snmp communication platform layer and is sent to the controlled equipment.
As a possible implementation, pre-establishing a local mapping table on the service layer, where the local mapping table stores a mapping relationship between data in the private data message structure and data in the snmp data message structure, and the local mapping table includes: a global variable array is maintained in the local mapping table for each private data message, the global variable array comprises message ids, mapping relation between each operation parameter in the message and oid object identifiers, the number of oid object identifiers required by the message to operate, and operation types of the message, wherein one operation parameter corresponds to one oid object identifier.
It can be understood that a global variable array is maintained in the local mapping table of the business layer for each private data message, and each item of data to be filled in by the snmp data structure body and the mapping relationship between each item of data and each item of data in the private data structure body are defined in the global variable array.
As a possible implementation, the private data structure includes each operation parameter and a data type of each operation parameter; the snmp data message structure body comprises the operation type of the message, the message id, the number of the mib nodes in the message body and information of each mib node, and each mib node comprises oid object identifiers, oid data types corresponding to the object identifiers and specific data values.
It will be appreciated that the items of data in the private data structure are specifically defined and the items of data in the snmp data structure are defined. Each item of data in the private data structure body can be mapped into each item of data in the snmp data structure body through a local mapping table; similarly, each item of data in the snmp data structure body can also be mapped to each item of data in the private data structure body through the local mapping table.
As a possible implementation, according to the extracted data in the private data structure, mapping the data in the private data structure into data in a snmp data structure based on the local mapping table includes: the service layer extracts each operating parameter, the type of each operating parameter and a message id from the private data structure body according to the private data message; according to the message id, finding a corresponding global variable array from a local mapping table; finding corresponding oid object identifiers according to each operating parameter, and counting the number of oid object identifiers, wherein one operating parameter corresponds to one mib node; and determining the message operation type according to the private data message sent by the control equipment.
And filling the mapped number of the mib nodes, the oid object identifiers included by each mib node, the number of oid object identifiers, the data types and specific data values corresponding to oid object identifiers and the operation types of the messages into a snmp data structure body, and generating the snmp data message corresponding to the private data message.
It is understood that the private data structure mainly includes parameters (referred to as operation parameters) to be operated on and a data type of each operation parameter. And mapping the items of data into the items of data of the snmp data structure body according to the items of data extracted from the private data structure body based on the local mapping table. Specifically, the number of mib nodes is determined according to each operating parameter extracted from the private data structure, one operating parameter corresponding to each mib node. An operation parameter corresponds to an oid object identifier, and the data type and specific data value corresponding to the oid object identifier are the data type and specific data value of the operation parameter. The operation type of the message is determined by the controlling device when sending the message to the controlled device, for example, the operation type of the message may be a query of an operation parameter.
And filling the mapped data into a defined snmp data structure body, generating a snmp data message, transmitting the generated snmp data message to a snmp communication platform end, forming a PDU (protocol data Unit) packet by the snmp communication platform end, and sending the PDU packet to the controlled equipment.
Referring to fig. 4, the following process of the data format conversion method according to the embodiment of the present invention mainly includes the following steps:
step 1: and transplanting the open-source net-snmp to the embedded development board, compiling the source code through a cross compiling tool chain, and copying library files and header files required to be used to the development board for running and using the program.
Step 2: and running a multi-thread conversion program on the embedded development board, wherein the conversion program is mainly divided into a business layer and a snmp communication platform layer. The snmp communication platform layer is mainly responsible for receiving and sending all messages, including tcp messages with the control equipment and snmp messages with the controlled equipment; the service layer is mainly responsible for converting the private data message into the snmp data message and converting the snmp data message into the private data message.
And step 3: the management and control equipment is used as an embedded board where the client is connected with the conversion program through a wireless signal output by a wifi module on the embedded board, and the embedded board is connected with the snmp equipment to be controlled through a network cable. The service layer establishes a TCP server on the snmp communication platform layer through a registration interface of the snmp communication platform layer, and the TCP server is used for receiving and sending private data of the control equipment; and simultaneously, a snmp management end is established in the snmp communication platform layer for receiving and sending the snmp message.
And 4, step 4: the management and control equipment and the embedded development board communicate through tcp in a private data structure. Firstly, a fixed communication message header structure is defined, and the message header comprises the length information of the message body. When the business layer receives the private data message sent by the control equipment, the business layer firstly analyzes the message header to obtain the message length and then receives the message body. Various private messages depend on various business requirements. For the sake of better explanation, it is assumed that a certain service private data message body is defined as stuct _ OAM _ MSG, which is defined as follows:
typedef struct STRUCT_OAM_MSG
{
u32 test1;
s32 test2;
s16 test3;
u16 test4;
}__attribute__((__packed__))ST_OAM_MSG;
wherein, test1, test2, test3 and test4 are operation parameters in the private data structure, and u32, s32, s16 and u16 are data types of test1, test2, test3 and test4 respectively.
And 5: the service layer and the SNMP communication platform layer communicate through the SNMP data structure stuct _ SNMP _ MSG and are used for storing received and transmitted data. The snmp data structure mainly comprises the following operation types: get, get-next, set, get _ respone, trap; the message id of the message; error indication (only used for judging whether the received message is normal when receiving); the number of mib nodes contained in the message body; each mib node information, including oid object identifiers, oid corresponding data types and data specific values.
And the service layer maps each item of data extracted from the private data structure into each item of data required in the SNMP data structure through local mapping, and fills each item of mapped data into the STRUCT _ SNMP _ MSG structure to generate the SNMP data message. The SNmp message is sent to a SNmp communication platform layer through a message queue, the SNmp communication platform layer analyzes the structural body object, then a pdu package of the SNmp is formed, and the SNmp message is asynchronously sent through a library function provided by net-SNmp. Meanwhile, the SNMP communication platform layer monitors all registered SNMP sessions on the SNMP communication platform layer through select, analyzes get-response (one or more parameter values are returned to the management end by the agent end) or trap message (information is actively reported to the management end by the agent end) once the SNMP session message is received, fills in the STRUCT _ SNMP _ MSG structure object, and replies the structured object to the service layer through the message queue.
Wherein, the service layer designs a local mapping table. Maintaining a global variable array g _ msg _ def _ t, comprising: 1. a message request id; 2. a message response id; 3. oid and a parameter mapping structure pointer; 4. oid number of operations required for the message; 5. the operation type is get, set, get-next, etc. Wherein oid and the parameter mapping structure represent the mapping relationship between the parameters of the STRUCT _ OAM _ MSG and oid, for example, for the parameter test2, it needs to store its corresponding oid, which is assumed to be 1.3.6.1.4.1.2; the offset of test2 in the structure is stored, here starting with the fourth byte of the structure; the type string of test2, here "s 32", is stored; the number of bytes in test2, here four bytes, is stored. One parameter corresponds to oid, a variable in a g _ msg _ def _ t array corresponds to a service message, and all messages needing conversion need to be maintained in the g _ msg _ def _ t array.
Step 6: when the conversion program receives the private data message sent by the control equipment, the service layer firstly analyzes the private STRUCT _ OAM _ MSG structure and converts the data of the private STRUCT _ OAM _ MSG structure into data of the STRUCT _ SNMP _ MSG structure. For example, parameters test2 and test4 in the snmp device need to be issued, firstly, records of the oam message are inquired in a local g _ msg _ def _ t array, and a request id is taken out; judging the operation type of the operation, namely get, set, get-next and the like; then, the Oid of the operation required by test2 and test4, respectively, and the corresponding data type and data value are taken out from the local mapping table. And finally, filling the STRUCT _ SNMP _ MSG structure object and sending the SNMP message out.
And 7: when the conversion program receives the message reported by the snmp device, the snmp communication platform layer firstly receives the message and judges whether the message is a trap message or a get-response message. If the message is get-response message, the message id which needs to be carried with the original private data message is replied to the STRUCT _ SNMP _ MSG structural body of the service layer. And then the service layer converts the STRUCT _ SNMP _ MSG structure data into STRUCT _ OAM _ MSG structure data through the message id. For example, when the response message of the snmp message sent down in step 5 is received, it can be known by looking up the local mapping table through the message id that the response message is the response of the operation parameters test2 and test 4. Then, corresponding data is taken out from the snmp data message and filled into the STRUCT _ OAM _ MSG structure object, and the service layer transmits the data through tcp and then replies the data to the control equipment.
And when the control device sends the private data message to the conversion program, the conversion program converts the private data message into an snmp message according to the local mapping table by the message conversion method in the text and sends the snmp message to the snmp device. The message responded by the Snmp device is also converted into a message with a private format through the message conversion method in the text, and is sent to the mobile phone app through the master control. The mobile phone app can complete the management and control operation of the snmp equipment without supporting the snmp related protocol.
The management platform end for data format conversion and the data format conversion method provided by the embodiment of the invention are used as service layer application, do not need to know the packaging method of the snmp, only need to maintain a private data structure, the snmp operation type and oid of the operation as a local mapping table, call a general conversion function by filling the private structure, and then call a sending interface. The underlying snmp communication platform can directly realize the assembly and sending of the pdu package. When receiving, only receiving the message sent by the snmp communication platform, and converting the snmp message into a message of a local private data structure by using a general structure. The code structure is clear, the hierarchy is clear, and the readability and the maintainability are good.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A management platform end for data format conversion is characterized by comprising an embedded development board developed at the management platform end, and a snmp communication platform layer and a service layer which are asynchronously built on the embedded development board;
the snmp communication platform layer is used for receiving a private data message sent by a control device and transmitting the private data message to a service layer; sending the snmp data message converted by the service layer to the controlled equipment;
the service layer is used for converting the private data message into a snmp data message and transmitting the converted snmp data message to the snmp communication platform layer;
the control equipment does not support the snmp protocol, and the controlled equipment is controlled equipment of the snmp protocol.
2. The management platform according to claim 1, wherein the service layer is further configured to:
a local mapping table is pre-established on a service layer, and the local mapping table stores the mapping relation between the structure data in a private data message structure body and the structure data in a snmp data message structure body;
correspondingly, the step of converting the private data message into the snmp data message by the service layer comprises the following steps:
according to the extracted structure data in the private data message structure, mapping the structure data in the private data structure into structure data in a snmp data structure based on a local mapping table;
and organizing according to the structure data in the mapped snmp data structure according to the snmp data structure to form the snmp data message.
3. The management platform according to claim 1, wherein the snmp communication platform layer is further configured to receive a snmp data message sent by a controlled device, and transmit the snmp data message to the service layer; the converted private data message transmitted by the service layer is sent to the control equipment; the service layer is further configured to convert the snmp data message transmitted by the snmp communication platform layer into a private data message, and transmit the converted private data message to the snmp communication platform layer.
4. A data format conversion method, comprising:
the snmp communication platform layer receives a private data message sent by a control device and transmits the private data message to the service layer;
the service layer converts the private data message into a snmp data message, and transmits the converted snmp data message to the snmp communication platform layer;
the snmp communication platform layer sends the snmp data message converted by the service layer to the controlled equipment;
the managed equipment does not support a snmp protocol, and the controlled equipment is controlled equipment of the snmp protocol; the snmp communication platform layer and the service layer are asynchronously built on an embedded development board, and the embedded development board is developed at a management platform end.
5. The data format conversion method according to claim 4, wherein the private data message is organized according to a private data structure body agreed by a management and control device and the embedded development board;
the snmp data message is organized according to an embedded development board and an snmp data structure body agreed by controlled equipment;
the business layer converting the private data message into a snmp data message comprises:
and the service layer extracts the structure data from the private data structure of the private data message, and organizes the extracted structure data according to the snmp data structure to form the snmp data message.
6. The data format conversion method of claim 5, wherein before the business layer converting the private data message into a snmp data message, further comprising:
a local mapping table is pre-established on a service layer, and the local mapping table stores the mapping relation between the structure data in a private data message structure body and the structure data in a snmp data message structure body;
correspondingly, the step of converting the private data message into the snmp data message by the service layer comprises the following steps:
according to the extracted structure data in the private data message structure, mapping the structure data in the private data structure into structure data in a snmp data structure based on a local mapping table;
and organizing according to the structure data in the mapped snmp data structure according to the snmp data structure to form the snmp data message.
7. The data format conversion method according to claim 6,
the private data structure body comprises each operating parameter and the data type of each operating parameter;
the snmp data message structure comprises the operation type of the message, the message id, the number of the mib nodes in the message body and information of each mib node, wherein each mib node comprises oid object identifiers, oid data types corresponding to the object identifiers and specific data values.
8. The data format conversion method according to claim 7, wherein the pre-establishing a local mapping table at the service layer, the local mapping table storing a mapping relationship between the structure data in the private data message structure and the structure data in the snmp data message structure comprises:
a global variable array is maintained in the local mapping table for each private data message, the global variable array comprises message id, mapping relation between each operation parameter in the message and oid object identifier, the number of oid object identifiers required by the message to operate, and operation type of the message, wherein one operation parameter corresponds to one oid object identifier.
9. The method according to claim 8, wherein mapping the data in the private data structure to the structure data in the snmp data structure based on the local mapping table according to the structure data in the extracted private data message structure comprises:
the service layer extracts each operating parameter, the type of each operating parameter and a message id from the private data structure body according to the private data message;
according to the message id, finding a corresponding global variable array from a local mapping table;
finding corresponding oid object identifiers according to each operating parameter, and counting the number of oid object identifiers, wherein one operating parameter corresponds to one mib node;
and determining the message operation type according to the private data message sent by the control equipment.
10. The data format conversion method according to claim 9, wherein the forming the snmp data message organized according to the snmp data structure according to the structure data in the mapped snmp data structure comprises:
and filling the mapped number of the mib nodes, the oid object identifiers included by each mib node, the number of oid object identifiers, the data types and specific data values corresponding to the oid object identifiers and the operation types of the messages into a snmp data structure, and generating the snmp data message corresponding to the private data message.
CN202011051437.XA 2020-09-29 2020-09-29 Management platform end for data format conversion and data format conversion method Active CN112383408B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011051437.XA CN112383408B (en) 2020-09-29 2020-09-29 Management platform end for data format conversion and data format conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011051437.XA CN112383408B (en) 2020-09-29 2020-09-29 Management platform end for data format conversion and data format conversion method

Publications (2)

Publication Number Publication Date
CN112383408A true CN112383408A (en) 2021-02-19
CN112383408B CN112383408B (en) 2023-04-11

Family

ID=74580863

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011051437.XA Active CN112383408B (en) 2020-09-29 2020-09-29 Management platform end for data format conversion and data format conversion method

Country Status (1)

Country Link
CN (1) CN112383408B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6404743B1 (en) * 1997-11-04 2002-06-11 General Instrument Corporation Enhanced simple network management protocol (SNMP) for network and systems management
CN1819532A (en) * 2006-03-15 2006-08-16 杭州华为三康技术有限公司 Management information base processing method
CN1996877A (en) * 2006-09-30 2007-07-11 华为技术有限公司 A device, system and method for realizing MIB adaptation
CN101170451A (en) * 2007-12-03 2008-04-30 华为技术有限公司 A device management method and a device proxy system
CN101958878A (en) * 2009-07-15 2011-01-26 华为终端有限公司 Equipment remote management method and device
WO2011140848A1 (en) * 2010-05-14 2011-11-17 中兴通讯股份有限公司 Simple network management protocol (snmp) network element and method for communication between snmp network element and private protocol network element
CN103036732A (en) * 2011-09-30 2013-04-10 方正宽带网络服务股份有限公司 Method, system and device for network monitoring process
CN103401859A (en) * 2013-07-29 2013-11-20 华为技术有限公司 Protocol conversion method and protocol converter
US20130326045A1 (en) * 2011-04-14 2013-12-05 Huawei Technologies Co., Ltd. Linkage policy implementation method and apparatus, open platform board, and device
US9537808B1 (en) * 2015-07-14 2017-01-03 Kyocera Document Solutions, Inc. Communication between peripheral device and client device
CN106452839A (en) * 2016-09-05 2017-02-22 杭州华为数字技术有限公司 Message report method and device
CN107508713A (en) * 2017-09-21 2017-12-22 烽火通信科技股份有限公司 NMS MIB and the system and method for network element Proprietary MIB Mapping implementation NE management

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6404743B1 (en) * 1997-11-04 2002-06-11 General Instrument Corporation Enhanced simple network management protocol (SNMP) for network and systems management
CN1819532A (en) * 2006-03-15 2006-08-16 杭州华为三康技术有限公司 Management information base processing method
CN1996877A (en) * 2006-09-30 2007-07-11 华为技术有限公司 A device, system and method for realizing MIB adaptation
CN101170451A (en) * 2007-12-03 2008-04-30 华为技术有限公司 A device management method and a device proxy system
CN101958878A (en) * 2009-07-15 2011-01-26 华为终端有限公司 Equipment remote management method and device
WO2011140848A1 (en) * 2010-05-14 2011-11-17 中兴通讯股份有限公司 Simple network management protocol (snmp) network element and method for communication between snmp network element and private protocol network element
US20130326045A1 (en) * 2011-04-14 2013-12-05 Huawei Technologies Co., Ltd. Linkage policy implementation method and apparatus, open platform board, and device
CN103036732A (en) * 2011-09-30 2013-04-10 方正宽带网络服务股份有限公司 Method, system and device for network monitoring process
CN103401859A (en) * 2013-07-29 2013-11-20 华为技术有限公司 Protocol conversion method and protocol converter
US9537808B1 (en) * 2015-07-14 2017-01-03 Kyocera Document Solutions, Inc. Communication between peripheral device and client device
CN106452839A (en) * 2016-09-05 2017-02-22 杭州华为数字技术有限公司 Message report method and device
CN107508713A (en) * 2017-09-21 2017-12-22 烽火通信科技股份有限公司 NMS MIB and the system and method for network element Proprietary MIB Mapping implementation NE management

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吴黎兵等: "面向物联网环境的网络管理消息转换机制研究", 《小型微型计算机系统》 *
葛化敏等: "基于NET-SNMP的嵌入式网络管理代理的开发", 《通信技术》 *

Also Published As

Publication number Publication date
CN112383408B (en) 2023-04-11

Similar Documents

Publication Publication Date Title
US7269602B2 (en) Method and device for defining objects allowing establishment of a device management tree for mobile communication devices
US6253243B1 (en) Automated trap control for a distributed network management system
US8260899B2 (en) Network attached storage SNMP single system image
CN104581785B (en) wireless network test method, test device and mobile terminal
JP2007525870A (en) Specifying the management node in the device management system
Wu et al. OneM2M-based IoT protocol integration
CN115150274B (en) Unified configuration method, system and storage medium for time-sensitive network equipment
CN113572651B (en) Cloud platform resource management method and system based on multi-protocol equipment management architecture
CN105052076A (en) Interface management service entity, functional service entity and network element management method
CN108446105A (en) A kind of Lightweight AP I Server Development Frameworks and development approach
CN114301988A (en) Distributed calling method and device, storage medium and electronic equipment
AU2005208065B2 (en) Defining nodes in device management system
CN112383408B (en) Management platform end for data format conversion and data format conversion method
CN109150583A (en) A kind of management method and device of northbound interface
CN110620819B (en) Block chain interaction method and device, computer equipment and readable storage medium
CN109274715A (en) The platform resource management system of vehicle-mounted multi-channel communication systems
FI113824B (en) Dissemination of data to network management systems
Li et al. Efficient oneM2M protocol conversion platform based on NB-IoT access
CN112019491B (en) Message processing method and system
CN102684924A (en) Network management workstation and debugging method of network management software
CN110233747B (en) Data reporting method and cloud platform
CN106254122A (en) A kind of snmp agent implementation method based on EOC equipment
KR20090046054A (en) Apparatus and method for transferring protocol
Hosek et al. SNMP-based acquisition system for DiffServ parameters
CN106561032A (en) Message communication method based on XML

Legal Events

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