Data processing method, device, computer equipment and storage medium

By building a mapping relationship between JAVA files and MIB files in an SNMP network environment, the problems of inflexible and error-prone manual operations in the prior art are solved, and automation and high efficiency of data interaction are achieved.

CN114942904BActive Publication Date: 2025-09-09GUANGZHOU HAIGE COMMUNICATION GROUP INCORPORATED COMPANY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110168220.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-07
Publication Date
2025-09-09
Estimated Expiration
2041-02-07

AI Technical Summary

Technical Problem

In the existing SNMP protocol processing and MIB library configuration management, manual parsing and translation of MIB library files and manual data association are required, which is inflexible and prone to errors.

Method used

By building a mapping relationship between JAVA files and MIB files, data mapping and conversion are automatically performed, and mutual mapping between JAVA files and MIB files is achieved, thereby improving data interaction efficiency and accuracy.

Benefits of technology

It realizes the automation and high efficiency of data interaction in the SNMP network environment, reduces manual operation errors and improves the accuracy of data interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114942904B_ABST
    Figure CN114942904B_ABST
Patent Text Reader

Abstract

The present application relates to a data processing method, apparatus, computer device, and storage medium. The method comprises: obtaining an initial JAVA file corresponding to a data entity object, determining a management information base (MIB) file corresponding to the data entity object based on a mapping relationship between the initial JAVA file and a preset JAVA file and MIB file, and encapsulating and sending the MIB object data in the MIB file according to a preset network protocol. In this method, the computer device pre-establishes a mapping relationship between the JAVA file and the MIB file, achieving mutual mapping between the JAVA file and the MIB file. During data interaction over an SNMP network, data conversion can be performed directly based on the bidirectional mapping relationship, thereby improving the efficiency and accuracy of data interaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, apparatus, computer equipment, and storage medium. Background Art

[0002] The Simple Network Management Protocol (SNMP) is a commonly used network protocol. SNMP defines a unified interface and protocol for managing diverse devices, from different manufacturers, and across different models. Data exchange within the SNMP environment requires SNMP protocol processing and configuration management of the Management Information Base (MIB).

[0003] Most existing solutions rely on configuration files for data mapping and assembly, including SNMP protocol processing and MIB library configuration management. Configuration file-based data mapping and conversion involves pre-mapping MIB library nodes and data object information in the configuration file. During SNMP network operations, data association and data format conversion are manually performed based on the configuration file, enabling assembly and disassembly of SNMP Protocol Data Units (PDUs).

[0004] However, in existing solutions, to achieve data interaction under SNMP, it is necessary to manually parse and translate MIB library files, manually associate data, and manually convert data formats. This operation is inflexible and prone to errors. Summary of the Invention

[0005] Based on this, it is necessary to provide a data processing method, device, computer equipment and storage medium that can realize automatic mapping of JAVA files and MIB files in response to the above technical problems.

[0006] In a first aspect, a data processing method is provided, the method comprising:

[0007] Get the initial JAVA file corresponding to the data entity object;

[0008] Determine the management information base (MIB) file corresponding to the data entity object based on the initial JAVA file and the preset mapping relationship; the mapping relationship includes the corresponding relationship between the JAVA file and the MIB file;

[0009] According to the preset network protocol, the MIB object data in the MIB file is encapsulated and sent.

[0010] In one embodiment, the above-mentioned determining the management information base MIB file corresponding to the data entity object based on the initial JAVA file and the preset mapping relationship includes:

[0011] According to the preset key-value pair data parsing rules, the target data in the initial JAVA file is obtained, and the target JAVA file is generated according to the target data;

[0012] Determine the file OID corresponding to the MIB file interface information according to the MIB file interface information in the target JAVA file;

[0013] Determine the MIB file corresponding to the file OID based on the file OID and mapping relationship.

[0014] In one embodiment, the method for constructing the above mapping relationship includes:

[0015] Obtaining a MIB file from a preset first storage space, and obtaining MIB object data of the MIB file; the MIB object data includes multiple sub-table nodes of the MIB file and node information of the multiple sub-table nodes;

[0016] Generate the JAVA file corresponding to the MIB file based on the MIB object data, and establish a mapping relationship between the MIB file and the JAVA file.

[0017] In one embodiment, the above-mentioned generation of a JAVA file corresponding to the MIB file based on the MIB object data includes:

[0018] According to the node information of each sub-table node in the MIB file, the node interface information corresponding to each sub-table node is constructed;

[0019] Determine the MIB file interface information of the MIB file based on the node interface information corresponding to each sub-table node and the file OID of the MIB file where each sub-table node is located;

[0020] Generate a JAVA file corresponding to the MIB file according to the MIB file interface information and file OID, the node information of each sub-table node, and the node interface information of each sub-table node.

[0021] In one embodiment, the node information includes a node OID, a node name, and node attributes. Based on the node information of each sub-table node in the MIB file, the node interface information corresponding to each sub-table node is constructed, including:

[0022] Determine the attribute type of the node attribute of the child table node; the attribute types include readable and writable, readable and non-writable, neither readable and writable, and neither readable nor writable;

[0023] The node interface information of the sub-table node is determined according to the attribute type, node OID, and node name of the node attribute.

[0024] In one embodiment, the above-mentioned generation of a JAVA file corresponding to the MIB file based on the MIB file interface information, the node information of each sub-table node, and the node interface information of each sub-table node includes:

[0025] Generate a JAVA class object corresponding to the sub-table node according to the node information of the sub-table node; the JAVA class object includes the JAVA file path and the JAVA file name;

[0026] A JAVA class object structure is created according to the MIB file interface information and file OID, the node interface information of each sub-table node, and the node information of each sub-table node, and the JAVA class object structure is written into a corresponding JAVA file.

[0027] In one embodiment, before obtaining the MIB file from the preset first storage space, the method further includes:

[0028] Traverse the MIB files in the preset second storage space;

[0029] Determine whether each MIB file has been loaded into the first storage space;

[0030] If the MIB file has not been loaded into the first storage space, the MIB file is loaded into the first storage space.

[0031] In one embodiment, the encapsulating and sending the MIB object data in the MIB file according to the preset network protocol includes:

[0032] Based on the data encapsulation rules of the network protocol, the MIB object data in the MIB file is encapsulated to obtain the encapsulated MIB object data;

[0033] Send the encapsulated MIB object data to the server.

[0034] In one embodiment, the method further includes:

[0035] Receive the response instruction returned by the server, and parse the response instruction based on the data parsing rules of the network protocol to obtain the target data object;

[0036] Determine whether there is packet loss anomaly in the target data object;

[0037] If there is no packet loss exception for the target data object, the MIB object data corresponding to the target data object is obtained, and the JAVA file corresponding to the MIB file where the MIB object data is located is determined according to the mapping relationship, and the target JAVA object data is determined based on the JAVA file.

[0038] In a second aspect, a data processing device is provided, the device comprising:

[0039] The acquisition module is used to obtain the initial JAVA file corresponding to the data entity object;

[0040] A determination module is used to determine the management information base MIB file corresponding to the data entity object based on the initial JAVA file and the preset mapping relationship; the mapping relationship includes the corresponding relationship between the JAVA file and the MIB file;

[0041] The interaction module is used to encapsulate and send the MIB object data in the MIB file according to the preset network protocol.

[0042] In a third aspect, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any data processing method described in the first aspect when executing the computer program.

[0043] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data processing method described in any one of the first aspects is implemented.

[0044] In the above-mentioned data processing method, apparatus, computer device, and storage medium, the computer device obtains an initial Java file corresponding to a data entity object, determines the management information base (MIB) file corresponding to the data entity object based on the initial Java file and a preset mapping relationship between the Java file and the MIB file, and then encapsulates and transmits the MIB object data in the MIB file according to a preset network protocol. In this method, the computer device pre-establishes a mapping relationship between the Java file and the MIB file, achieving mutual mapping between the Java file and the MIB file. During data exchange over the SNMP network, data conversion can be performed directly based on the bidirectional mapping relationship, thereby improving the efficiency and accuracy of data exchange. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A diagram of an application environment of a data processing method in one embodiment;

[0046] Figure 2 1 is a flow chart of a data processing method in one embodiment;

[0047] Figure 3 1 is a flow chart of a data processing method in one embodiment;

[0048] Figure 4 1 is a flow chart of a data processing method in one embodiment;

[0049] Figure 5 1 is a flow chart of a data processing method in one embodiment;

[0050] Figure 6 1 is a flow chart of a data processing method in one embodiment;

[0051] Figure 7 1 is a flow chart of a data processing method in one embodiment;

[0052] Figure 8 1 is a flow chart of a data processing method in one embodiment;

[0053] Figure 9 1 is a flow chart of a data processing method in one embodiment;

[0054] Figure 10 1 is a flow chart of a data processing method in one embodiment;

[0055] Figure 11 1 is a flow chart of a data processing method in one embodiment;

[0056] Figure 12 is a structural block diagram of a data processing device in one embodiment;

[0057] Figure 13 is a structural block diagram of a data processing device in one embodiment;

[0058] Figure 14 FIG. 4 is a structural block diagram of a data processing device in one embodiment. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0060] The data processing method provided in this application can be applied to Figure 1 In the application environment shown. Figure 1 A computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 1As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data processing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.

[0061] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0062] The following will explain in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems through embodiments and in conjunction with the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. It should be noted that the present application Figure 2-Figure 11 The data processing methods provided in the embodiments may be executed by a computer device or a data processing apparatus. The data processing apparatus may be implemented as part or all of the computer device through software, hardware, or a combination of software and hardware. The following method embodiments are described using a computer device as the execution subject.

[0063] In one embodiment, Figure 2 As shown, a data processing method is provided, which involves a computer device obtaining an initial JAVA file corresponding to a data entity object, determining a management information base (MIB) file corresponding to the data entity object based on a mapping relationship between the initial JAVA file and a preset JAVA file and MIB file, and encapsulating and sending MIB object data in the MIB file according to a preset network protocol, including the following steps:

[0064] S201. Obtain the initial JAVA file corresponding to the data entity object.

[0065] The data entity object refers to the original data required for data interaction when data interaction is performed under a preset network protocol.

[0066] In this embodiment, when performing SNMP network operations such as get-request, get-next-request, and set-request, the computer device needs to obtain the corresponding JAVA file based on the data entity object to implement the mapping conversion between the data entity object JAVA file and the MIB file. Optionally, the computer device can generate a JAVA file containing MIB interface information in the form of key-value pairs based on the mapping file between the data entity object and the JAVA object.

[0067] S202: Determine the management information base MIB file corresponding to the data entity object according to the initial JAVA file and the preset mapping relationship; the mapping relationship includes the corresponding relationship between the JAVA file and the MIB file.

[0068] In this embodiment, the computer device pre-establishes a mapping relationship between the MIB file and the JAVA file based on the MIB file. Thus, after determining the JAVA file of the data entity object, the computer device determines the MIB file corresponding to the JAVA file based on the mapping relationship. Alternatively, the computer device obtains the MIB file's identity OID through the GetMappingOid interface of the MIB file's MIB identity information interface in the JAVA file, and obtains the corresponding MIB file based on the mapping relationship between the OID and the MIB file.

[0069] S203: Encapsulate and send the MIB object data in the MIB file according to a preset network protocol.

[0070] In this embodiment, the computer device encapsulates the MIB object data in the MIB file according to the data encapsulation rules corresponding to the preset network protocol. Optionally, the preset network protocol can be the SNMP network protocol. The computer device can construct the data unit PDU according to the SNMP protocol data unit format and send the MIB object data to the server based on SNMP4J. This embodiment does not limit this.

[0071] In the above-mentioned data processing method, a computer device obtains an initial Java file corresponding to a data entity object, determines the corresponding management information base (MIB) file based on the initial Java file and a preset mapping relationship between the Java file and the MIB file, and then encapsulates and transmits the MIB object data in the MIB file according to a preset network protocol. In this method, the computer device pre-establishes a mapping relationship between the Java file and the MIB file, enabling mutual mapping between the Java file and the MIB file. During data exchange over the SNMP network, data conversion can be performed directly based on the bidirectional mapping relationship, thereby improving the efficiency and accuracy of data exchange.

[0072] After obtaining the JAVA file, the computer device automatically performs mapping conversion between the MIB file and the JAVA file according to the preset mapping relationship. In one embodiment, Figure 3 As shown, the above-mentioned determination of the management information base MIB file corresponding to the data entity object based on the initial JAVA file and the preset mapping relationship includes:

[0073] S301. According to a preset key-value pair data parsing rule, target data in an initial JAVA file is obtained, and a target JAVA file is generated according to the target data.

[0074] In this embodiment, the computer device can obtain the target data in the initial JAVA file in the form of key-value pairs. For example, the "key" can be "device name" and the "value" can be "display". The data in the initial JAVA file is converted into key-value pair data using the key-value pair data parsing and data storage rules to generate the target JAVA file.

[0075] S302: Determine the file OID corresponding to the MIB file interface information according to the MIB file interface information in the target JAVA file.

[0076] The MIB file interface information is constructed according to the file OID of the MIB file. Therefore, in this embodiment, the computer device can determine the OID corresponding to the MIB file interface information according to the MIB file interface information in the target JAVA file.

[0077] S303: Determine the MIB file corresponding to the file OID according to the file OID and the mapping relationship.

[0078] In this embodiment, the computer device determines the MIB file corresponding to the file OID, that is, determines the MIB file corresponding to the target JAVA file based on the bidirectional mapping relationship between the file OID of the MIB file, the preset MIB file and the JAVA file. This embodiment does not limit this.

[0079] In this embodiment, after obtaining the JAVA file corresponding to the data entity object, the computer device can determine the MIB file corresponding to the target JAVA file based on the preset two-way mapping relationship between the MIB file and the JAVA file, so as to obtain the MIB data in the MIB file and perform data interaction under the preset network protocol, thereby realizing automatic data mapping and conversion and improving the efficiency and accuracy of data interaction.

[0080] In the process of data interaction, the computer device performs data conversion interaction based on the mapping relationship between the pre-built MIB file and the JAVA file. Optionally, in one embodiment, as Figure 4 As shown, the method for constructing the above mapping relationship includes:

[0081] S401 , obtaining a MIB file from a preset first storage space, and obtaining MIB object data of the MIB file; the MIB object data includes a plurality of sub-table nodes of the MIB file and node information of the plurality of sub-table nodes.

[0082] The preset first storage space may be a designated database or a designated folder. The computer device obtains the MIB file from the first storage space. Optionally, the computer device may traverse and obtain information of each sub-table node in the MIB file by calling a MIBBLE tool to obtain a sub-table node set corresponding to the MIB file, wherein the node information includes information such as the node name, node type, and node OID.

[0083] S402: Generate a JAVA file corresponding to the MIB file based on the MIB object data, and establish a mapping relationship between the MIB file and the JAVA file.

[0084] In this embodiment, the computer device generates a corresponding JAVA file based on the MIB object data. Optionally, the computer device can generate a JAVA class object corresponding to each sub-table node based on the node information of each sub-table node, and fill in the JAVA class object based on the node information of each sub-table node, thereby generating a corresponding JAVA file and establishing a mapping relationship between the MIB file and the JAVA file. This embodiment does not limit this.

[0085] In this embodiment, the computer device generates a JAVA file according to the MIB object data, thereby improving the generation efficiency and accuracy of the JAVA file.

[0086] The computer device generates a corresponding JAVA file according to the MIB object data. Optionally, the computer device can generate a JAVA file according to the node interface information of each sub-table node in the MIB file. In one embodiment, Figure 5As shown above, the JAVA file corresponding to the MIB file is generated based on the MIB object data, including:

[0087] S501 : Construct node interface information corresponding to each sub-table node according to the node information of each sub-table node in the MIB file.

[0088] In this embodiment, the computer device can determine the attribute type of the node attribute of the sub-table node based on the node attribute of the sub-table node, and determine the interface information of each sub-table node based on the attribute type of the node attribute. For example, if the attribute type of the node attribute of the sub-table node is a readable and writable SNMP attribute type field, the node attribute of the sub-table node is declared and defined according to the attribute name, and the Get and Set interface methods of the attribute are defined. This embodiment does not limit this.

[0089] S502 : Determine the MIB file interface information of the MIB file according to the node interface information corresponding to each sub-table node and the file OID of the MIB file where each sub-table node is located.

[0090] In this embodiment, the computer device creates a mapping relationship between the node OID and the MIB file based on the node interface information corresponding to each sub-table node and the file OID of the MIB file where each sub-table node is located, and defines the MIB identity information interface GetMappingOid method corresponding to the MIB file.

[0091] S503 : Generate a JAVA file corresponding to the MIB file according to the MIB file interface information and file OID, the node information of each sub-table node, and the node interface information of each sub-table node.

[0092] In this embodiment, the computer device generates a JAVA file based on the MIB file interface information and file OID, the node information of each sub-table node, and the node interface information of each sub-table node. Optionally, the computer device can generate a JAVA file corresponding to the MIB file by constructing a JAVA class object of the sub-table node and writing the above data into the JAVA class object. This embodiment does not limit this.

[0093] In this embodiment, the computer device generates a JAVA file based on the MIB file interface information and file OID, the node information of each sub-table node, and the node interface information of each sub-table node, thereby improving the generation efficiency and accuracy of the JAVA file.

[0094] The computer device generates node interface information of each sub-table node according to the node information of the sub-table node. Optionally, the computer device can determine the attribute type of the node attribute of each sub-table node according to a preset interface format, thereby generating the interface information of each sub-table node. In one embodiment, Figure 6As shown, the node information includes the node OID, node name, and node attributes. Based on the node information of each sub-table node in the MIB file, the node interface information corresponding to each sub-table node is constructed, including:

[0095] S601: Determine the attribute type of the node attribute of the child table node; the attribute type includes readable and writable, readable and non-writable, neither readable nor writable, and neither readable nor writable.

[0096] In this embodiment, the computer device can read the node attributes of the sub-table node by calling the MIBBLE tool, obtain the mapping of the OID syntax and the attribute according to the name, data type and OID identifier of the node attribute, and determine the attribute type of the node attribute of the sub-table node according to the readable and writable SNMP command corresponding to the SNMP protocol, that is, determine whether the node attribute of the sub-table node is a readable and writable type, a readable and unwritable type, an unreadable and writable type, or an unreadable and unwritable type.

[0097] S602: Determine the node interface information of the sub-table node according to the attribute type, node OID, and node name of the node attribute.

[0098] In this embodiment, the computer device determines the interface information of each sub-table node based on the attribute type, node OID, and node name of the node attribute. For example, if the attribute type of the node attribute of the sub-table node is a readable and writable SNMP attribute type field, the node attribute of the sub-table node is declared and defined according to the attribute name, and the Get and Set interface methods of the attribute are defined as Get+"attribute name" and Set+"attribute name" respectively. This embodiment does not limit this.

[0099] In this embodiment, the computer device generates interface information of each sub-table node based on the readability and writability under the SNMP protocol and the corresponding interface format in the JAVA file, according to the attribute type of the node attribute of each sub-table node, so as to facilitate the generation of MIB library file and JAVA file mapping.

[0100] Optionally, before generating the JAVA file corresponding to the MIB file, the computer device may first generate the JAVA class object corresponding to each sub-table node in the MIB file. In one embodiment, Figure 7 As shown, the JAVA file corresponding to the MIB file is generated according to the MIB file interface information, the node information of each sub-table node, and the node interface information of each sub-table node, including:

[0101] S701. Generate a JAVA class object corresponding to the sub-table node according to the node information of the sub-table node; the JAVA class object includes a JAVA file path and a JAVA file name.

[0102] In this embodiment, the computer device generates a corresponding JAVA class object for the sub-table node based on the node information of the sub-table node. Optionally, the computer device may first determine whether the sub-table node is data of a specified type. If the sub-table node has table node attribute information, the computer device determines that the sub-table node is a table structure object. Optionally, the computer device may record the sub-table node, generate a corresponding JAVA class object based on the node information of the sub-table node, and determine the name and file generation path corresponding to the JAVA class object.

[0103] S702: Create a JAVA class object structure according to the MIB file interface information and file OID, the node interface information of each sub-table node, and the node information of each sub-table node, and write the JAVA class object structure into a corresponding JAVA file.

[0104] In this embodiment, the computer device writes the MIB file interface information and file OID, the node interface information of each sub-table node, and the node information of each sub-table node into a JAVA class object. Optionally, the computer device can create a JAVA class object structure with the above data in the form of a file stream, and then find the corresponding JAVA file under the JAVA file path corresponding to the JAVA class object, and write the JAVA class object into the JAVA file.

[0105] In this embodiment, the computer device generates a JAVA class object corresponding to the sub-table node based on the node information of the sub-table node, and writes the required data, such as MIB file interface information and file OID, node interface information of each sub-table node, and node information of each sub-table node, into the JAVA class object in the form of a file stream to generate a JAVA file, thereby improving the efficiency and accuracy of JAVA file generation.

[0106] Before the computer device performs data conversion, it is also necessary to load the MIB file. In one embodiment, Figure 8 As shown, before obtaining the MIB file from the preset first storage space, the method further includes:

[0107] S801: traverse the MIB files in the preset second storage space.

[0108] In this embodiment, the computer device can obtain all MIB files in the second storage space corresponding to the preset path. Optionally, the computer device can traverse and read the MIB files in the second storage space. The second storage space can be a specified database or a specified folder, which is not limited in this embodiment.

[0109] S802: Determine whether each MIB file has been loaded into the first storage space.

[0110] In this embodiment, the computer device traverses all MIB files in the second storage space and determines whether each MIB file has been loaded into the preset first storage space. Optionally, the first storage space refers to the storage space where the computer device obtains MIB files during data exchange. If the computer device determines that the MIB file has been loaded into the first storage space, it continues to traverse the next MIB file.

[0111] S803: If the MIB file has not been loaded into the first storage space, load the MIB file into the first storage space.

[0112] In this embodiment, if the computer device determines that the MIB file has not been loaded into the first storage space, the MIB file is loaded and injected into the first storage space so that the computer device can obtain the MIB file from the first storage space when performing data interaction. This embodiment does not limit this.

[0113] In this embodiment, before performing data interaction, the computer device traverses the MIB files in the second storage space and ensures that each MIB file is loaded into the first storage space, thereby ensuring the integrity of the MIB files in the first storage space.

[0114] When computer devices interact with data, they need to follow the data encapsulation rules under the current network protocol. In one embodiment, Figure 9 As shown, the above-mentioned encapsulation and sending of the MIB object data in the MIB file according to the preset network protocol includes:

[0115] S901. Encapsulate MIB object data in the MIB file based on data encapsulation rules of the network protocol to obtain encapsulated MIB object data.

[0116] The data encapsulation rule of the network protocol may be a data encapsulation rule under the SNMP protocol.

[0117] In this embodiment, the computer device may construct a data unit PDU according to the SNMP protocol data unit format, and encapsulate the MIB object data in the MIB file according to the data encapsulation rules under the SNMP protocol to obtain the encapsulated MIB object data.

[0118] S902: Send the encapsulated MIB object data to the server.

[0119] In this embodiment, after obtaining the encapsulated MIB object data, the computer device may optionally send a data request to the server based on SNMP4J to send the encapsulated MIB object data to the server.

[0120] In this embodiment, the computer device constructs a data unit PDU and implements data interaction of the encapsulated MIB object data based on the data encapsulation rules under the SNMP protocol, thereby improving the effectiveness of data interaction.

[0121] While improving the efficiency of data interaction, the computer device can also send the MIB object data to the server, receive the response instruction returned by the server, and improve the effectiveness of data interaction by judging whether the received response instruction is abnormal. In one embodiment, Figure 10 As shown, the above method also includes:

[0122] S1001. Receive a response instruction returned by the server, and parse the response instruction based on the data parsing rules of the network protocol to obtain the target data object.

[0123] In this embodiment, after receiving the response instruction returned by the server, the computer device parses the response instruction according to the data parsing rules of the network protocol. For example, the computer device can parse the response result set based on the UDP data packet to obtain the target data object.

[0124] S1002: Determine whether there is a packet loss anomaly in the target data object.

[0125] In this embodiment, after obtaining the target data object, the computer device needs to determine whether the current target data object is complete data. Optionally, the computer device can determine whether the target data object has any abnormality, that is, determine whether the current target data object has any packet loss. If there is a packet loss abnormality, an error message is output; if there is no packet loss abnormality, the step of obtaining the initial JAVA file corresponding to the data entity object is executed.

[0126] S1003. If there is no packet loss exception for the target data object, obtain the MIB object data corresponding to the target data object, and determine the JAVA file corresponding to the MIB file where the MIB object data is located based on the mapping relationship, and determine the target JAVA object data based on the JAVA file.

[0127] In this embodiment, the computer device determines that the current target data object is complete data and there is no packet loss anomaly or other anomaly. At this time, the computer device obtains the MIB object data corresponding to the data entity object based on the target data object, and determines the MIB file where the MIB object data is located. According to the mapping relationship between the constructed MIB file and the JAVA file, the computer device determines the JAVA file corresponding to the MIB object data, and obtains the corresponding JAVA object data based on the JAVA file. This embodiment does not limit this.

[0128] In this embodiment, after receiving the response instruction, the computer device parses the response instruction to obtain the target data object and determines whether there is a packet loss anomaly in the target data object, further confirming the integrity of the received target data object and improving the effectiveness of data interaction.

[0129] To better illustrate the above method, Figure 11 As shown, this embodiment provides a data processing method, which specifically includes:

[0130] S101, traversing the MIB files in the preset second storage space;

[0131] S102, determining whether each MIB file has been loaded into the first storage space;

[0132] S103. If the MIB file has not been loaded into the first storage space, load the MIB file into the first storage space;

[0133] S104, obtaining a MIB file from a preset first storage space, and obtaining MIB object data of the MIB file; the MIB object data includes multiple sub-table nodes of the MIB file and node information of the multiple sub-table nodes;

[0134] S105. Determine the attribute type of the node attribute of the child table node; the attribute type includes readable and writable, readable and non-writable, non-readable and writable, and non-readable and non-writable;

[0135] S106. Determine the node interface information of the sub-table node according to the attribute type, node OID, and node name of the node attribute;

[0136] S107, determining the MIB file interface information of the MIB file according to the node interface information corresponding to each sub-table node and the file OID of the MIB file where each sub-table node is located;

[0137] S108. Generate a JAVA class object corresponding to the sub-table node according to the node information of the sub-table node; the JAVA class object includes a JAVA file path and a JAVA file name;

[0138] S109. Write the MIB file interface information and file OID, the node interface information of each sub-table node, and the node information of each sub-table node into a JAVA class object, generate a JAVA file corresponding to the MIB file under the JAVA file path, and establish a mapping relationship between the MIB file and the JAVA file;

[0139] S110, performing SNMP network operations, such as get-request, get-next-request, and set-request;

[0140] S111. According to a preset key-value pair data parsing rule, target data in the initial JAVA file for performing SNMP operations is obtained, and a target JAVA file is generated according to the target data;

[0141] S112. Determine the file OID corresponding to the MIB file interface information according to the MIB file interface information in the target JAVA file;

[0142] S113. Determine the MIB file corresponding to the file OID based on the file OID and the mapping relationship;

[0143] S114. Encapsulating the MIB object data in the MIB file based on the data encapsulation rule of the network protocol to obtain the encapsulated MIB object data;

[0144] S115, sending the encapsulated MIB object data to the server;

[0145] S116: Receive the response instruction returned by the server, and parse the response instruction based on the data parsing rules of the network protocol to obtain the target data object;

[0146] S117, determining whether there is a packet loss anomaly in the target data object;

[0147] S118. If the target data object does not have an abnormality, obtain MIB object data;

[0148] S119, according to the mapping relationship between the MIB file and the JAVA file, determine the JAVA file through the OID of the MIB data object;

[0149] S120 : Generate target JAVA object data according to the JAVA file based on the preset key-value pair data parsing rules.

[0150] In this embodiment, the computer device pre-builds the mapping relationship between the JAVA file and the MIB file, realizing the mutual mapping between the JAVA file and the MIB file. During the data interaction process based on the SNMP network, data conversion can be directly performed according to the two-way mapping relationship, thereby improving the efficiency and accuracy of data interaction.

[0151] The data processing method provided in the above embodiment has similar implementation principles and technical effects to those of the above method embodiment and will not be described in detail here.

[0152] It should be understood that although Figure 2-11 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2-11 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The order of execution of these steps or stages is not necessarily one by one, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0153] In one embodiment, Figure 12 As shown, a data processing device is provided, including: an acquisition module 01, a determination module 02 and an interaction module 03, wherein:

[0154] Acquisition module 01 is used to obtain the initial JAVA file corresponding to the data entity object;

[0155] Determination module 02, for determining the management information base MIB file corresponding to the data entity object based on the initial JAVA file and the preset mapping relationship; the mapping relationship includes the corresponding relationship between the JAVA file and the MIB file;

[0156] The interaction module 03 is used to encapsulate and send the MIB object data in the MIB file according to a preset network protocol.

[0157] In one embodiment, the determination module 02 is used to obtain the target data in the initial JAVA file according to the preset key-value pair data parsing rules, and generate a target JAVA file according to the target data; determine the file OID corresponding to the MIB file interface information according to the MIB file interface information in the target JAVA file; determine the MIB file corresponding to the file OID according to the file OID and the mapping relationship.

[0158] In one embodiment, Figure 13 As shown, the above data processing device further includes a construction module 04;

[0159] Construction module 04 is used to obtain the MIB file from the preset first storage space and obtain the MIB object data of the MIB file; the MIB object data includes multiple sub-table nodes of the MIB file and node information of multiple sub-table nodes; based on the MIB object data, generate a JAVA file corresponding to the MIB file and establish a mapping relationship between the MIB file and the JAVA file.

[0160] In one embodiment, construction module 04 is used to construct node interface information corresponding to each sub-table node based on the node information of each sub-table node in the MIB file; determine the MIB file interface information of the MIB file based on the node interface information corresponding to each sub-table node and the file OID of the MIB file where each sub-table node is located; and generate a JAVA file corresponding to the MIB file based on the MIB file interface information and file OID, the node information of each sub-table node, and the node interface information of each sub-table node.

[0161] In one embodiment, construction module 04 is used to determine the attribute type of the node attribute of the sub-table node; the attribute type includes readable and writable, readable and non-writable, unreadable and writable, and unreadable and non-writable; based on the attribute type of the node attribute, the node OID, and the node name, the node interface information of the sub-table node is determined.

[0162] In one embodiment, construction module 04 is used to generate a JAVA class object corresponding to the sub-table node based on the node information of the sub-table node; the JAVA class object includes a JAVA file path and a JAVA file name; based on the MIB file interface information and file OID, the node interface information of each sub-table node, and the node information of each sub-table node, a JAVA class object structure is created, and the JAVA class object structure is written into the corresponding JAVA file.

[0163] In one embodiment, Figure 14 As shown, the above data processing device further includes a traversal module 05;

[0164] The traversal module 05 is configured to traverse the MIB files in the preset second storage space; determine whether each MIB file has been loaded into the first storage space; and if the MIB file has not been loaded into the first storage space, load the MIB file into the first storage space.

[0165] In one embodiment, the interaction module 03 is configured to encapsulate the MIB object data in the MIB file based on the data encapsulation rule of the network protocol to obtain the encapsulated MIB object data; and send the encapsulated MIB object data to the server.

[0166] In one embodiment, the interaction module 03 is also used to receive a response instruction returned by the server, and parse the response instruction based on the data parsing rules of the network protocol to obtain the target data object; determine whether the target data object has a packet loss exception; if the target data object does not have a packet loss exception, obtain the MIB object data corresponding to the target data object, and determine the JAVA file corresponding to the MIB file where the MIB object data is located based on the mapping relationship, and determine the target JAVA object data based on the JAVA file.

[0167] For the specific definition of the data processing device, please refer to the definition of the data processing method above and will not be repeated here. Each module in the above-mentioned data processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software so that the processor can call and execute the operations corresponding to each of the above modules.

[0168] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0169] Get the initial JAVA file corresponding to the data entity object;

[0170] Determine the management information base (MIB) file corresponding to the data entity object based on the initial JAVA file and the preset mapping relationship; the mapping relationship includes the corresponding relationship between the JAVA file and the MIB file;

[0171] According to the preset network protocol, the MIB object data in the MIB file is encapsulated and sent.

[0172] The implementation principle and technical effects of the computer device provided in the above embodiment are similar to those of the above method embodiment and will not be repeated here.

[0173] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0174] Get the initial JAVA file corresponding to the data entity object;

[0175] Determine the management information base (MIB) file corresponding to the data entity object based on the initial JAVA file and the preset mapping relationship; the mapping relationship includes the corresponding relationship between the JAVA file and the MIB file;

[0176] According to the preset network protocol, the MIB object data in the MIB file is encapsulated and sent.

[0177] The computer-readable storage medium provided in the above embodiment has similar implementation principles and technical effects to those of the above method embodiment, and will not be described in detail here.

[0178] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0179] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0180] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A data processing method, characterized in that: The method comprises: Get the initial JAVA file corresponding to the data entity object; Determine the management information base MIB file corresponding to the data entity object according to the initial JAVA file and the preset mapping relationship; the mapping relationship includes the corresponding relationship between the JAVA file and the MIB file; Encapsulate and send the MIB object data in the MIB file according to a preset network protocol; The step of determining the management information base (MIB) file corresponding to the data entity object based on the initial JAVA file and the preset mapping relationship includes: According to a preset key-value pair data parsing rule, the target data in the initial JAVA file is obtained, and a target JAVA file is generated according to the target data; Determine the file OID corresponding to the MIB file interface information according to the MIB file interface information in the target JAVA file; According to the file OID and the mapping relationship, the MIB file corresponding to the file OID is determined.

2. The method according to claim 1, characterized in that The method for constructing the mapping relationship includes: Obtaining a MIB file from a preset first storage space, and obtaining MIB object data of the MIB file; the MIB object data includes multiple sub-table nodes of the MIB file and node information of the multiple sub-table nodes; Based on the MIB object data, a JAVA file corresponding to the MIB file is generated, and a mapping relationship between the MIB file and the JAVA file is established.

3. The method according to claim 2, characterized in that The step of generating a JAVA file corresponding to the MIB file based on the MIB object data includes: Constructing node interface information corresponding to each sub-table node according to the node information of each sub-table node in the MIB file; Determine the MIB file interface information of the MIB file according to the node interface information corresponding to each of the sub-table nodes and the file OID of the MIB file where each of the sub-table nodes is located; A JAVA file corresponding to the MIB file is generated according to the MIB file interface information and file OID, the node information of each of the sub-table nodes, and the node interface information of each of the sub-table nodes.

4. The method according to claim 3, characterized in that The node information includes a node OID, a node name, and node attributes; and constructing node interface information corresponding to each sub-table node according to the node information of each sub-table node in the MIB file includes: Determine the attribute type of the node attribute of the sub-table node; the attribute type includes readable and writable, readable and non-writable, non-readable and writable, and non-readable and non-writable; The node interface information of the sub-table node is determined according to the attribute type of the node attribute, the node OID, and the node name.

5. The method according to claim 4, characterized in that Generating a JAVA file corresponding to the MIB file according to the MIB file interface information, the node information of each of the sub-table nodes, and the node interface information of each of the sub-table nodes includes: Generate a JAVA class object corresponding to the sub-table node according to the node information of the sub-table node; the JAVA class object includes a JAVA file path and a JAVA file name; A JAVA class object structure is created according to the MIB file interface information and file OID, the node interface information of each sub-table node, and the node information of each sub-table node, and the JAVA class object structure is written into a corresponding JAVA file.

6. The method according to any one of claims 2 to 5, characterized in that Before obtaining the MIB file from the preset first storage space, the method further includes: Traverse the MIB files in the preset second storage space; Determining whether each of the MIB files has been loaded into the first storage space; If the MIB file has not been loaded into the first storage space, the MIB file is loaded into the first storage space.

7. The method according to any one of claims 1 to 5, characterized in that The encapsulating and sending the MIB object data in the MIB file according to a preset network protocol includes: Encapsulating the MIB object data in the MIB file based on the data encapsulation rule of the network protocol to obtain the encapsulated MIB object data; The encapsulated MIB object data is sent to the server.

8. The method according to claim 7, characterized in that The method further comprises: Receiving a response instruction returned by the server, and parsing the response instruction based on the data parsing rules of the network protocol to obtain a target data object; Determine whether the target data object has a packet loss anomaly; If there is no packet loss exception for the target data object, the MIB object data corresponding to the target data object is obtained, and according to the mapping relationship, the JAVA file corresponding to the MIB file where the MIB object data is located is determined, and the target JAVA object data is determined based on the JAVA file.

9. A data processing device, characterized in that: The device comprises: The acquisition module is used to obtain the initial JAVA file corresponding to the data entity object; A determination module, configured to determine a management information base (MIB) file corresponding to the data entity object based on the initial JAVA file and a preset mapping relationship; the mapping relationship includes a corresponding relationship between the JAVA file and the MIB file; An interaction module, configured to encapsulate and send the MIB object data in the MIB file according to a preset network protocol; The determining module is specifically configured to: According to a preset key-value pair data parsing rule, the target data in the initial JAVA file is obtained, and a target JAVA file is generated according to the target data; Determine the file OID corresponding to the MIB file interface information according to the MIB file interface information in the target JAVA file; According to the file OID and the mapping relationship, the MIB file corresponding to the file OID is determined.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Java to NSMP MIB mapping

    US20030177477A1