A method and device for generating SNMP response message

By realizing repeated judgment, sharding judgment and shortening processing units in the SNMP management system of the controlled end, the problem of de-management caused by SNMP response packet sharding is solved, ensuring that the network management end can receive and parse SNMP response packets normally.

CN113726574BActive Publication Date: 2025-02-28HANGZHOU DPTECH INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111012683.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-31
Publication Date
2025-02-28
Estimated Expiration
2041-08-31

AI Technical Summary

Technical Problem

In network management, when the SNMP response packet length exceeds the MTU of the link or exceeds the MIB node length requirement of the controlled end, the response packet will be sharded, resulting in the network management end being unable to recognize and reorganize, causing the controlled end to be decontrolled.

Method used

By implementing the repeated judgment, sharding judgment and shortening processing unit on the controlled end, it determines whether the received SNMP request message is repeated and detects whether the response message is sharded. If sharding, shortening processing is performed to generate a new SNMP response message to avoid sharding and ensure that the network management side can receive and parse normally.

Benefits of technology

It effectively avoids the problem of destruction of the controlled end caused by SNMP response message sharding, ensuring that the network management end can successfully obtain and parse SNMP response messages, thereby achieving normal management of the controlled end.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113726574B_ABST
    Figure CN113726574B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for generating an SNMP response message, which is applied to a controlled end, and includes: determining whether a second SNMP request message that repeats the first SNMP request message is received within a specified time after receiving the first SNMP request message; if the second SNMP request message is received, determining whether the first SNMP response message corresponding to the first SNMP request message is fragmented; if the first SNMP response message is fragmented, shortening the first SNMP response message to generate a second SNMP response message corresponding to the second SNMP request message. The technical solution provided by the present application can adjust the length of the SNMP response message through the controlled end, and solve the problem that the controlled end device is out of management because the network management end cannot obtain a normal SNMP response message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network management, and in particular to a method and device for generating SNMP response messages. Background Art

[0002] As the number of network devices increases, a network management terminal is needed to manage the network devices. The network management terminal can communicate with the controlled terminal through SNMP (Simple Network Management Protocol).

[0003] As the functions of network devices increase day by day, the network management end needs to collect more and more information for monitoring. When the network management end needs to collect too much information, resulting in the length of the response message exceeding the MTU (Maximum Transmission Unit) of the link, or when the length of the data requested by the network management end itself exceeds the node length requirement of the MIB (Management Information Base) of the controlled end, the SNMP response message will be fragmented. At this time, if the network management end cannot identify and reassemble the fragmented SNMP response message, it will not be able to manage the controlled end normally, resulting in a loss of management problem. Summary of the invention

[0004] In view of the above technical problems, the present application provides a method and device for generating an SNMP response message, which can adjust the length of the SNMP response message through the controlled end.

[0005] Specifically, the present application is implemented through the following technical solutions:

[0006] According to a first aspect of the present application, a method for generating an SNMP response message is provided, the method being applied to a controlled terminal, comprising:

[0007] Determine whether a second SNMP request message that repeats the first SNMP request message is received within a specified time after receiving the first SNMP request message;

[0008] If the second SNMP request message is received, determining whether the first SNMP response message corresponding to the first SNMP request message is fragmented;

[0009] If the first SNMP response message is fragmented, the first SNMP response message is shortened to generate a second SNMP response message corresponding to the second SNMP request message.

[0010] According to a second aspect of the present application, there is provided a device for generating an SNMP response message, the device comprising:

[0011] A duplication determination unit, used to determine whether a second SNMP request message that is duplicate of the first SNMP request message is received within a specified time period after receiving the first SNMP request message;

[0012] A fragmentation determination unit, configured to determine whether a first SNMP response message corresponding to the first SNMP request message is fragmented when the second SNMP request message is received;

[0013] The shortening processing unit is used to shorten the first SNMP response message when the first SNMP response message is fragmented, so as to generate a second SNMP response message corresponding to the second SNMP request message.

[0014] According to a third aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the method for generating an SNMP response message are implemented.

[0015] According to a fourth aspect of the present application, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for generating an SNMP response message when executing the program.

[0016] The technical solution provided by the present application can detect whether the SNMP response message is fragmented without omission by performing repeatability judgment on the received SNMP request message. In the case of fragmentation of the SNMP response message, the controlled end can automatically shorten the SNMP response message and generate a processed second SNMP response message, which can avoid the fragmentation of the second SNMP response message and ensure that the network management end can successfully obtain and parse the second SNMP response message, thereby realizing effective management of the controlled end based on the second SNMP response message and avoiding the controlled end from being out of management.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0019] Figure 1 This is a schematic diagram of an SNMP management structure of an exemplary embodiment of the present application;

[0020] Figure 2 It is a flowchart of a method for generating an SNMP response message according to an exemplary embodiment of the present application;

[0021] Figure 3 It is a specific flow chart of a method for generating an SNMP response message according to an exemplary embodiment of the present application;

[0022] Figure 4 It is a structural schematic diagram of a device according to an exemplary embodiment of the present application;

[0023] Figure 5 It is a structural diagram of a device for generating an SNMP response message according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0024] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0025] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0026] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0027] SNMP is a set of network management protocols defined by the Internet Engineering Task Force. The protocol is based on the Simple Gateway Monitoring Protocol. Using SNMP, the network management terminal can remotely manage all network devices that support this protocol, including monitoring network status, modifying network device configurations, receiving network event warnings, etc. Administrators can use unified operations through the network management terminal to manage various network devices without having to pay attention to differences in device type, manufacturer, etc. Figure 1 As shown, assuming that there is a network management terminal 11, as well as various types of controlled terminals such as routers 12, printers 13, switches 14 and servers 15 in the network, the network management terminal 11 can manage the above various types of controlled terminals based on the SNMP protocol.

[0028] The network management end and the controlled end send and receive messages based on the SNMP protocol to achieve the management of the controlled end by the network management end. In a network system managed by the SNMP protocol, management information is usually presented in variables. These data are stored in the MIB management information base of the controlled end. MIB is an important part of the SNMP management system, which defines the data items that the controlled end must save, the operations allowed for each data item and its meaning, etc. That is, data variables such as the status information of the controlled end accessible to the network management end are stored in the MIB. Any data managed through the SNMP protocol is represented as an object, called a managed object. MIB is stored in a tree structure, and the leaf nodes of the tree represent the managed objects, which can be identified by a unique path starting from the root node, which is the OID (Object Identifier). The maximum length of device description information stored in a node defined by MIB is called the MIB node length requirement.

[0029] The network management end retrieves data from the controlled end that needs to be managed through the get, get next and get bulk protocol commands, or the controlled end uses the TRAP alarm command or INFORM command to actively transmit data to the network management end without being asked.

[0030] The process of the network management end retrieving data through get, get next, get bulk protocol instructions requires sending an SNMP request message to the controlled end, and the request message usually includes one or more of the above three protocol instructions. The controlled end performs corresponding related operations based on the instructions contained in the received SNMP request message, and replies the related data obtained based on the related operation to the network management end through an SNMP response message. Through the sending, receiving and processing of the above SNMP request message and SNMP response message, the network management end manages the controlled end.

[0031] If the network management end needs to collect too much information for monitoring, the length of the response message may exceed the maximum transmission data unit of the link. Or, if the length of the data requested by the network management end itself exceeds the MIB node length requirement of the controlled end, the data that should be encapsulated in an SNMP response message will be broken down into several sufficiently small fragments. These fragments are encapsulated one by one into multiple SNMP response messages so that each SNMP response message can be transmitted through the link. This situation is called "fragmentation" of the message. At this time, the network management end needs to identify the fragmented SNMP response message and reassemble the fragments contained in these SNMP response messages into complete data. However, if the network management end does not support the fragmentation function, the above-mentioned identification and reassembly operations cannot be implemented, and the data returned by the controlled end cannot be successfully obtained, making it impossible for the network management end to manage the controlled end normally, resulting in the problem of the controlled end being out of management.

[0032] Therefore, the present application proposes a method for generating SNMP response messages based on the Simple Network Management Protocol to solve the problem of controlled end disconnection caused by response message fragmentation.

[0033] Figure 2 The following is a flow chart of a method for generating an SNMP response message according to an exemplary embodiment of the present application. The method is applied to a controlled terminal and may include the following steps:

[0034] S201, determining whether a second SNMP request message that repeats the first SNMP request message is received within a specified time period after receiving the first SNMP request message.

[0035] If the network management terminal fails to receive the corresponding first SNMP response message after sending the first SNMP request message, or fails to obtain the data that the network management terminal hopes to obtain from the received first SNMP response message, the network management terminal will face the risk of being unable to manage the controlled terminal. In order to obtain or maintain control over the controlled terminal, the network management terminal will send an SNMP request message again within a certain period of time. The function of this SNMP request message is the same as the first SNMP request message mentioned above, which is used to request the controlled terminal to obtain the same data. In order to distinguish it from the first SNMP request message, the SNMP request message sent again can be called the second SNMP request message. Of course, the "first" and "second" here are relative concepts. The first SNMP request message can also be an SNMP request message sent again in response to another SNMP request message sent previously.

[0036] Therefore, if any received SNMP request message contains an instruction to obtain the same data as that in the first SNMP request message, and the receiving time of any SNMP request message is within the specified time after the first SNMP request message is received, then it can be considered that any SNMP request message is a duplicate of the first SNMP request message. The above-mentioned specified time can be determined based on experience, such as the time taken by the network management end to identify and reorganize the response message, or the average time taken by the controlled end to receive repeated request messages, or other determining factors or a combination of determining factors. Of course, it can also be set by the management and maintenance personnel according to actual needs, and this application does not limit this.

[0037] In addition to checking the instructions contained in the SNMP request message, the repetitiveness between SNMP request messages can also be determined by other methods. For example, after receiving the first SNMP request message, the controlled end can record the IP address of the network management end that sent the first SNMP request message and the request identifier contained in the first SNMP request message; then, if a second SNMP request message with the same request identifier is received from the network management end with the same IP address within a specified time period, the SNMP request message is determined to be the second SNMP request message received within the specified time period that is repeated with the first SNMP request message. The same IP address indicates that the two SNMP request messages come from the same network management end. The request identifier is added by the network management end to distinguish the SNMP request message sent by itself. When the network management end needs to resend the first SNMP request message, the resent SNMP request message will contain the same request identifier as the first SNMP request message, and the value of the request identifier is different from the request identifier contained in other SNMP request messages sent by the network management end. Therefore, by comparing the IP address and the request identifier, the second SNMP request message that is repeated with the first SNMP request message can be accurately identified.

[0038] When the controlled end receives SNMP request messages repeatedly sent by the network management end within the specified time period, it indicates that the network management end has not successfully obtained the corresponding data through the first SNMP response message returned by the controlled end in response to the first SNMP request message. For example, the first SNMP response message may not be received due to network failure or other reasons, or the received first SNMP response message may be fragmented and the network management end cannot identify and reassemble it. In short, the controlled end needs to handle the above abnormal situation accordingly. It can be seen that the present application can effectively identify the situation of repeated reception of SNMP request messages by monitoring the reception of SNMP request messages, so as to timely and accurately discover the abnormal interaction problems between the controlled end and the network management end, which helps the controlled end to make appropriate responses to the abnormal interaction problems, so as to ensure that the network management end can effectively obtain the data required by the management device, and prevent the network management end from being unable to receive the data required to manage the controlled end and causing the controlled end to be out of management.

[0039] S202: If the second SNMP request message is received, determine whether a first SNMP response message corresponding to the first SNMP request message is fragmented.

[0040] Since the reasons that may cause the controlled end to receive the above-mentioned second SNMP request message are not only the situation that the response message is fragmented, but there may also be other factors such as network failure. Therefore, when the SNMP request message is retransmitted, the reason why the network management end sends repeated SNMP request messages can be further determined. If it is determined that the reason is that the response message is fragmented and the correct response message cannot be received, corresponding processing can be made based on the technical solution of this application to ensure that the network management end can successfully receive and parse the processed SNMP response message.

[0041] As mentioned above, the request message sent by the network management terminal generally contains three types of instructions, namely get, get next and get bulk. The specific contents of the three protocol instructions of get, get next and get bulk are as follows:

[0042] get: The network management end uses this operation to obtain one or more data from the MIB of the controlled end.

[0043] get next: The network management end uses this operation to obtain the next data of one or more data from the MIB of the controlled end.

[0044] get bulk: Based on get next, it is equivalent to executing multiple get next operations in succession.

[0045] Depending on the instructions contained in the first SNMP request message, the judgment method for whether the first SNMP response message is fragmented also varies. For example, the above three protocol instructions can be divided into two categories: the first category is get bulk instructions, and the second category is get and get next instructions. These two types of protocol instructions correspond to different judgment methods.

[0046] For the first type of get bulk instructions, a method for determining whether the first SNMP response message is fragmented may include: when the first SNMP request message includes the get bulk instruction, checking whether the maximum retry value exceeds a preset value; if the maximum retry value exceeds the preset value, or if the maximum retry value does not exceed the preset value and the length of the first SNMP response message exceeds the maximum transmission data unit of the link, determining that the first SNMP response message is fragmented.

[0047] Since the get bulk instruction is based on the get next instruction, it is equivalent to executing multiple get next operations in succession. Therefore, the network management end can set the controlled end to execute a maximum number of get next operations when performing a get bulk message interaction. This number is the maximum repetition value (max repetition).

[0048] After the controlled end receives the first SNMP request message containing the get bulk instruction, it will execute the get next operation with a number of times less than or equal to the maximum retry value according to the get bulk instruction in the first SNMP request message, and the acquired data will be recorded in the first SNMP response message corresponding to the first SNMP request message and sent to the network management end. When the maximum retry value exceeds the preset value, there is a high probability or it will inevitably lead to too much data being acquired, and then the length of the response message recording these data will exceed the maximum transmission data unit of the link, which will cause the response message to be fragmented when it is transmitted through the link. The preset value can be set based on historical experience, or it can be obtained by counting the retry values ​​when fragmentation occurred in history, or it can be test data obtained by performing fragmentation test specifically on the controlled end, or it can be determined based on any other method, and the present application does not limit this.

[0049] If the maximum retry value exceeds the preset value, it proves that the maximum retry value is too large. According to the requirements of the first SNMP request message containing the get bulk instruction, when the controlled end performs the get next operation with a number of times less than or equal to the maximum retry value, too much data is obtained, resulting in the response message exceeding the maximum transmission data unit of the link. Therefore, the response message will be fragmented.

[0050] When the maximum retry value does not exceed the preset value, the first SNMP response message may still be fragmented. For example, although the maximum retry value does not exceed the preset value, the length of the response message exceeds the maximum transmission data unit of the link, and the first SNMP response message may also be fragmented during transmission.

[0051] For the second type of get and get next instructions, a method for determining whether the first SNMP response message is fragmented may include: when the first SNMP request message contains a get next or get instruction, calculating whether the length of the first SNMP response message exceeds the maximum transmission data unit of the link; if the length of the first SNMP response message exceeds the maximum transmission data unit of the link, determining that the first SNMP response message is fragmented.

[0052] After judgment, if the response message is indeed fragmented, the fragmented response message needs to be shortened so that the shortened response message will not be fragmented and can be recognized by the network management end, so that the network management end can manage the controlled end based on the shortened response message to prevent the controlled end from being out of management.

[0053] S203: If the first SNMP response message is fragmented, shorten the first SNMP response message to generate a second SNMP response message corresponding to the second SNMP request message.

[0054] There are different ways to shorten the response message according to different reasons that lead to the fragmentation of the response message.

[0055] In one embodiment, the process of shortening the first SNMP response message may include: determining the target data in the current first SNMP response message whose data length exceeds the MIB node length requirement, wherein the MIB node length requirement is the maximum device description information length defined by the MIB node on the controlled end; shortening the target data so that the shortened target data meets the MIB node length requirement.

[0056] If the network management terminal requests a target data whose length exceeds the length requirement of the MIB node, the target data cannot be normally transmitted to the network management terminal, which will cause the response message to be fragmented. In order to solve the response message fragmentation caused by the above reasons, the data needs to be processed.

[0057] At this time, since the target data sent to the network management end is truncated, it proves that there may be a problem with the setting of the MIB node length requirement. For example, the node length requirement is set too small, resulting in that when the network management end requests a data whose length exceeds the node length requirement, the response message generated by the controlled end based on the request message contains data whose length exceeds the MIB node length requirement. Therefore, the response message will inevitably be fragmented during the transmission process. The data information contained in the response message after truncation has certain omissions. In order to completely solve the above problem, an alarm log can also be sent to the maintenance personnel corresponding to the controlled end to prompt the maintenance personnel to modify the configuration of the MIB node length requirement.

[0058] For example, if the network management end requests a data with a length of 64 bytes, and the MIB node of the controlled end requires the maximum length of this type of data to be set to 32 bytes, then the response message will contain target data that exceeds the length requirement of the MIB node, and the existence of this target data will cause the response message to be fragmented.

[0059] The controlled end truncates the target data to no more than 32 bytes according to the MIB node length requirement, and can inform the equipment maintenance personnel of the controlled end to promptly modify the MIB node requirement of the controlled end to greater than 64 bytes by sending an alarm log, so that this type of data with a length of 64 bytes can be transmitted normally in the future.

[0060] In another embodiment, the process of shortening the first SNMP response message may include: discarding at least one item of data in the first SNMP response message so that the length of the remaining data is not greater than the maximum transmission data unit of the link.

[0061] When the response message contains too much data and exceeds the maximum transmission data unit that the link can transmit, the response message will be fragmented. At this time, at least one item of data in the response message can be selectively discarded so that the length of the remaining data meets the requirement of being transmitted at one time through the link.

[0062] The newly generated second SNMP response message after the shortening process can be sent from the controlled end to the network management end without fragmentation. Since the data contained in the second SNMP response message may be incomplete due to being discarded during this form of shortening process, the controlled end can also send a TRAP alarm notification to the network management end to inform the network management end of the specific reasons for the incomplete data (i.e., data discarded due to the shortening process).

[0063] The above describes two possible implementation methods of the shortening process. In the above embodiment, the two shortening processes can be implemented separately to solve the problem of fragmentation of the first SNMP response message. In some scenarios, the above two shortening processes may occur at the same time and are processed for the same first SNMP response message. For example: If a certain SNMP response message A contains a target data whose length exceeds the MIB node length requirement, which is equivalent to the above-mentioned first SNMP response message, and the length of the SNMP response message A also exceeds the maximum transmission data unit of the link, then the SNMP response message A can be shortened according to one of the above shortening methods. For example, the target data in the SNMP response message A is first shortened to make it data whose length does not exceed the MIB node length requirement, and an SNMP response message B is generated. Assume that although the SNMP response message B has undergone the above shortening process, its length still exceeds the maximum transmission data unit of the link, and the SNMP response message B will still be fragmented during the transmission process. Therefore, the controlled end shortens the SNMP response message B again to generate the SNMP response message C. Since the SNMP response message B no longer contains the target data exceeding the MIB node length requirement after the first round of shortening, at least one item of data in the SNMP response message B is discarded so that the length of the remaining data is not greater than the maximum transmission data unit of the link. After the above two-step shortening process, the generated SNMP response message C can be transmitted through the link without fragmentation, and the controlled end can send the SNMP response message C as the above second SNMP response message.

[0064] For ease of understanding, the following Figure 3 The flowchart of the present application describes the technical solution. Assuming that the controlled end is a phone with the function of transmitting missed call records, the network management end needs to obtain the telephone number information of all missed calls within a certain period of time. The network management end does not support the reorganization and identification of fragmented messages. The preset value is 20, the judgment time for sending duplicate messages is 20s, the maximum data transmission unit of the link is 1KB, and the MIB node length is required to be no more than 32 bytes.

[0065] like Figure 3 As shown, the phone as the controlled end can implement the following steps:

[0066] S301, receiving SNMP request message 1 sent by a network management terminal.

[0067] S302: Generate a corresponding SNMP response message 1 according to the instruction in the SNMP request message 1 and send the SNMP response message 1 to the network management terminal.

[0068] S303, determine whether an SNMP request message 2 that is repeated with the SNMP request message 1 is received within 20 seconds. If a repeated SNMP request message 2 is received, it proves that the network management end has a problem in obtaining the data variables required to manage the phone through the response message 1, and it is necessary to further determine whether the problem is that the SNMP response message 1 is fragmented. According to the method provided in this application, for SNMP request messages 1 containing different instructions, there are different methods for determining the corresponding SNMP response messages 1.

[0069] S304: Determine whether the SNMP request message 1 contains a get bulk instruction.

[0070] If the SNMP request message 1 includes a get bulk instruction, the process proceeds to S305 ; if the SNMP request message 1 does not include a get bulk instruction but includes a get or get next instruction, the process proceeds to S308 .

[0071] S305, determining whether the maximum retry value exceeds a preset value of 20.

[0072] If the maximum retry value does not exceed 20, the process proceeds to S306; if the maximum retry value exceeds 20, the process directly proceeds to S307.

[0073] S306, determine whether the length of the SNMP response message 1 exceeds 1KB. If the length of the SNMP response message 1 exceeds 1KB, proceed to S307. If the length of the SNMP response message 1 does not exceed 1KB, the SNMP response message 1 is not fragmented.

[0074] S307: discard at least one item of data in SNMP response message 1 so that the length of the remaining data is no more than 1 KB.

[0075] For example, to obtain the missed call number information within a certain period of time, the network management terminal sends an SNMP request message 1 containing a get bulk command to the controlled terminal, and the network management terminal sets the maximum retry value of the get bulk command to 30. The SNMP response message 1 corresponding to the SNMP request message 1 is 1.5KB in length and contains 30 pieces of missed call number data information.

[0076] Within 13 seconds after receiving the SNMP request message 1, the telephone receives the SNMP request message 2 with the same request identifier sent from the network management terminal with the same IP address.

[0077] The SNMP request message contains a get bulk instruction. Since the maximum retry value is 30, which exceeds the preset value of 20, at least one item of data in the SNMP response message 1 is discarded, so that the length of the remaining data does not exceed the maximum transmission data unit of the link. For example, the maximum transmission data unit of the link is 1KB, and at most 20 phone number data information can be transmitted in one response message at the same time. However, since the maximum retry value exceeds the preset value, the length of the SNMP response message 1 exceeds 1KB, and the length is 1.5KB, which contains 30 phone number information. At least 10 phone number data in the response message are discarded, so that the length of the remaining phone number data information is reduced to less than or equal to 1KB. The generated SNMP response message 2 meets the requirement that the length is less than the maximum transmission data unit of the link. Through the SNMP response message 2, the network management end can normally obtain some of the missed call phone number information within the period, thereby realizing the management of the phone.

[0078] If the maximum retry value is 19 in the above embodiment and the other conditions remain unchanged, then Figure 3 The judgment process in the above example changes the process of generating SNMP response message 2 as follows:

[0079] Within 13 seconds after receiving the SNMP request message 1, the telephone receives the SNMP request message 2 with the same request identifier sent from the network management terminal with the same IP address.

[0080] The SNMP request message contains a get bulk instruction. Since the maximum retry value is 19, which does not exceed the preset value 20, it is determined whether the length of the response message 1 exceeds 1KB. Since the length of the response message is 1.5KB, which exceeds 1KB, some telephone number data information in the SNMP response message 1 is discarded so that the length of the remaining data is no more than 1KB. The network management end can also manage the phone normally through the SNMP response message 2 generated by the above steps.

[0081] S308, determining whether the SNMP response message 1 contains target data with a length greater than 32 bytes.

[0082] If the SNMP response message 1 contains target data with a length greater than 32 bytes, the process proceeds to S309 ; if the SNMP response message 1 does not contain target data with a length greater than 32 bytes, the process proceeds to S306 .

[0083] S309, shorten the target data so that the shortened target data length does not exceed 32 bytes, generate an SNMP response message 2, and send the shortened SNMP response message 2 to the network management terminal.

[0084] For example, to obtain the missed call number information within a certain period of time, the network management terminal sends an SNMP request message 1 containing a get command to the controlled terminal. Among the missed calls, there is a foreign phone number data that is longer than a general phone number, and the length of the data is 64 bytes. The SNMP response message 1 corresponding to the SNMP request message 1 is 1KB in length and contains 20 missed phone number data information.

[0085] Within 13 seconds after receiving the SNMP request message 1, the telephone receives the SNMP request message 2 with the same request identifier sent from the network management terminal with the same IP address.

[0086] Since the SNMP request message 1 does not contain a get bulk instruction, it is determined whether the SNMP response message contains target data with a length exceeding 32 bytes (S308). Since the SNMP response message contains a target data with a length of 64 bytes, the target data is shortened so that the shortened target data length does not exceed 32 bytes (S309). At this time, the generated SNMP response message 2 can be transmitted through the link without fragmentation.

[0087] S310, sending the SNMP response message 2 generated after the shortening process to the network management terminal.

[0088] After judging and processing in steps S301 to S309, a new SNMP response message 2 is generated and sent to the network management terminal, which can help the network management terminal to reacquire the required information and manage the phone.

[0089] Corresponding to the embodiment of the above method, the present application also provides a device for generating an SNMP response message.

[0090] Figure 4 This is a schematic diagram of a device structure of an exemplary embodiment of the present application. Figure 4 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408 and a non-volatile memory 410. Of course, it may also include hardware required for other services. The processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it, forming a device for generating SNMP response messages at the logical level. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logical unit, but can also be hardware or logic devices.

[0091] Please refer to Figure 5, a device for generating an SNMP response message may include:

[0092] A duplication determination unit 510, configured to determine whether a second SNMP request message that is duplicate of the first SNMP request message is received within a specified time period after the first SNMP request message is received;

[0093] A fragmentation determination unit 520 is used to determine whether a first SNMP response message corresponding to the first SNMP request message is fragmented when the second SNMP request message is received;

[0094] The shortening processing unit 530 is used to shorten the first SNMP response message when the first SNMP response message is fragmented, and generate a second SNMP response message corresponding to the second SNMP request message.

[0095] In a specific implementation of the present application, the repetition determination unit 510 may be specifically used for:

[0096] Recording the IP address of the network management terminal that sends the first request message and the request identifier included in the first SNMP request message;

[0097] If a second SNMP request message with the same request identifier is received from the network management terminal with the same IP address within the specified time period, the SNMP request message is determined to be the second SNMP request message received within the specified time period and is repeated with the first SNMP request message.

[0098] In a specific implementation of the present application, the fragment determination unit 520 may be specifically used to:

[0099] In the case where the first SNMP request message includes a get bulk instruction, checking whether the maximum retry value exceeds a preset value;

[0100] If the maximum retry value exceeds the preset value, or the maximum retry value does not exceed the preset value and the length of the first SNMP response message exceeds the maximum transmission data unit of the link, it is determined that the first SNMP response message is fragmented.

[0101] In another specific implementation manner of the present application, the fragment determination unit 520 may also be specifically used for:

[0102] When the first SNMP request message includes a get next or get instruction, calculating whether the length of the first SNMP response message exceeds the maximum transmission data unit of the link;

[0103] If the length of the first SNMP response message exceeds the maximum transmission data unit of the link, it is determined that the first SNMP response message is fragmented.

[0104] In a specific implementation of the present application, the shortening processing unit 530 may be specifically used for:

[0105] Determine target data whose data length in the first SNMP response message exceeds the MIB node length requirement, wherein the MIB node length requirement is the maximum device description information length defined by the MIB node on the controlled end;

[0106] The target data is shortened so that the shortened target data meets the MIB node length requirement.

[0107] The shortening processing unit 530 may also be used for:

[0108] An alarm log is sent to the controlled end to prompt the maintenance personnel of the controlled end to modify the MIB node length requirement.

[0109] In another specific implementation of the present application, the shortening processing unit 530 may also be specifically used for:

[0110] At least one item of data in the first SNMP response message is discarded so that the length of the remaining data is not greater than the maximum transmission data unit of the link.

[0111] In a specific implementation of the present application, a device for generating an SNMP response message may further include a sending unit for sending a second SNMP response message and a TRAP alarm notification, wherein the TRAP alarm notification includes the reason why the second SNMP response message data is incomplete.

[0112] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0113] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0114] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present application. A person of ordinary skill in the art may understand and implement it without creative work.

[0115] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for generating an SNMP response message, characterized in that: The method is applied to the controlled end, and includes: Determining whether a second SNMP request message that is duplicate of the first SNMP request message is received within a specified time period after receiving the first SNMP request message; If the second SNMP request message is received, determining whether a first SNMP response message corresponding to the first SNMP request message is fragmented according to the instruction contained in the first SNMP request message; If the first SNMP response message is fragmented, shorten the first SNMP response message to generate a second SNMP response message corresponding to the second SNMP request message; The shortening process of the first SNMP response message includes: Determine target data whose data length in the first SNMP response message exceeds the MIB node length requirement, wherein the MIB node length requirement is the maximum device description information length defined by the MIB node on the controlled end; The target data is shortened so that the shortened target data meets the MIB node length requirement.

2. The method according to claim 1, characterized in that The determining whether a second SNMP request message that repeats the first SNMP request message is received within a specified time period includes: Recording the IP address of the network management terminal that sends the first SNMP request message and the request identifier included in the first SNMP request message; If an SNMP request message with the same request identifier sent from the network management terminal with the same IP address is received within a specified period of time, the SNMP request message is determined to be the second SNMP request message.

3. The method according to claim 1, characterized in that The determining whether the first SNMP response message is fragmented includes: In the case where the first SNMP request message includes a get bulk instruction, checking whether the maximum retry value exceeds a preset value; If the maximum retry value exceeds the preset value, or if the maximum retry value does not exceed the preset value and the length of the first SNMP response message exceeds the maximum transmission data unit of the link, it is determined that the first SNMP response message is fragmented.

4. The method according to claim 1, characterized in that The determining whether the first SNMP response message is fragmented includes: When the first SNMP request message includes a get next or get instruction, calculating whether the length of the first SNMP response message exceeds the maximum transmission data unit of the link; If the length of the first SNMP response message exceeds the maximum transmission data unit of the link, it is determined that the first SNMP response message is fragmented.

5. The method according to claim 1, characterized in that The method further comprises: Send an alarm log to the maintenance personnel corresponding to the controlled end to prompt the maintenance personnel to modify the MIB node length requirement.

6. The method according to claim 1, characterized in that The shortening process of the first SNMP response message includes: At least one item of data in the first SNMP response message is discarded so that the length of the remaining data is not greater than the maximum transmission data unit of the link.

7. The method according to claim 1, characterized in that Also includes: A second SNMP response message and a TRAP alarm notification are sent, wherein the TRAP alarm notification includes the reason why the second SNMP response message data is incomplete.

8. A device for generating an SNMP response message, characterized in that: Applied to the controlled end, the device includes: A duplication determination unit, used to determine whether a second SNMP request message that is duplicate of the first SNMP request message is received within a specified time period after receiving the first SNMP request message; a fragmentation determination unit, configured to determine whether a first SNMP response message corresponding to the first SNMP request message is fragmented according to an instruction contained in the first SNMP request message when the second SNMP request message is received; A shortening processing unit, used for shortening the first SNMP response message when the first SNMP response message is fragmented, and generating a second SNMP response message corresponding to the second SNMP request message; The shortening processing unit is specifically used to: determine the target data whose data length in the first SNMP response message exceeds the MIB node length requirement, wherein the MIB node length requirement is the maximum device description information length defined by the MIB node on the controlled end; The target data is shortened so that the shortened target data meets the MIB node length requirement.

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

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Media content fragmenting method, method, apparatus and system for providing media content

    CN101500142A

  • Message retransmission method and device

    CN101924620A