A method for dynamic management of network resources

By dynamically managing network resources through a monitoring polling and periodic reporting mechanism, the problem of fault location deviation caused by differences in network resource status is solved, and real-time updates and secure transmission of network resources are achieved.

CN116708153BActive Publication Date: 2025-12-09NINGBO CLOUDAI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310771309.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-27
Publication Date
2025-12-09
Estimated Expiration
2043-06-27

AI Technical Summary

Technical Problem

In the process of information network operation and maintenance, the dynamic increase or decrease of network resources in existing technologies leads to a large difference between the actual deployment status and the original deployment list, resulting in a large deviation in fault location.

Method used

The network resources within the IP address range are obtained in real time through polling at the monitoring terminal, a network resource table is generated, and a regular reporting mechanism is used for dynamic addition, updating and removal management. At the same time, multiple data protection methods such as ciphertext, plaintext + checksum, and ciphertext + checksum are used to ensure data security.

Benefits of technology

It improves the accuracy of network resource monitoring, reduces fault location errors, and ensures real-time updates and secure transmission of network resource status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116708153B_ABST
    Figure CN116708153B_ABST
Patent Text Reader

Abstract

The embodiment of the present application relates to a kind of dynamic management methods of network resources, the method comprises: monitoring terminal receives a group of starting, end IP address group corresponding first target address group;According to the first target address group, network resource initial addition generates corresponding network resource table;After network resource initial addition, the first upload data on any network resource of the preset listening port is sent is listened to;And when receiving first upload data, it is formatted data analysis processing to generate corresponding current parsing state and current parsing plaintext;And according to current parsing plaintext when current parsing state is normal state, network resource table is dynamically managed.By the present application, monitoring accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to a dynamic management method of network resources. BACKGROUND

[0002] When the information network is built, the network construction party will provide a network resource deployment list for the network maintenance personnel, and the maintenance personnel will monitor and maintain all network resources (such as servers, databases, storage devices, network devices and terminal machines) in the network through the network resource deployment list. However, we found in practice that as the network application expands and the network resources dynamically increase and decrease, there will be a large difference between the real network resource deployment state and the original network resource deployment list after the information network is operated for a period of time. If the original network resource deployment list is still used for problem positioning when the network fails, it is likely to cause a large fault positioning deviation. SUMMARY

[0003] The purpose of the present application is to overcome the defects of the prior art, provide a dynamic management method of network resources, an electronic device and a computer readable storage medium. First, the monitoring end acquires the network resources in an IP address range in real time by polling and initializes a network resource table corresponding thereto. Then, the monitoring end and the network resources agree on a regular reporting method to dynamically add, update and remove the network resources in the network resource table. In order to ensure the security of data transmission between the monitoring end and the network resources, multiple data protection methods (cipher mode, plaintext + check code mode, cipher + check code mode) are provided in the interaction process. Through the present application, the real deployment state of the network resources can be more accurately mastered, and the purpose of improving the monitoring accuracy and reducing the fault positioning deviation can be achieved.

[0004] To achieve the above purpose, the first aspect of the embodiment of the present application provides a dynamic management method of network resources, which comprises:

[0005] The monitoring end receives a group of starting and ending IP addresses to form a corresponding first target address group;

[0006] According to the first target address group, the network resource is initially added to generate a corresponding network resource table;

[0007] After the initial addition of the network resource, the first upload data sent by any network resource on the preset listening port is listened to; and when the first upload data is received, the format data is parsed to generate a corresponding current parsing state and a current parsing plaintext; and when the current parsing state is normal, the network resource table is dynamically managed according to the current parsing plaintext; the current parsing state includes a normal state and an error state.

[0008] Preferably, the first target address group comprises a first start IP address and a first end IP address; and the first start IP address and the first end IP address are in the same network segment.

[0009] The network resource table comprises a plurality of first resource records; each first resource record comprises a first resource MAC address field, a first resource IP address field, a first timestamp field, a first resource name field and a first resource type field; and the first resource type field comprises a server type, a database type, a storage device type, a network device type and a terminal type.

[0010] The network resources comprise servers, databases, storage devices, network devices and terminals.

[0011] The monitoring terminal and each network resource are locally preset with a same device key.

[0012] Preferably, the network resource initial adding according to the first target address group generates a corresponding network resource table, and specifically comprises:

[0013] Step 31, the monitoring terminal initializes an empty network resource table; and sets the first start IP address of the first target address group as a corresponding current IP address.

[0014] Step 32, a first resource polling instruction is sent to the network resource corresponding to the current IP address through a preset polling port; and return data from the current IP address is received at the polling port; if no return data from the current IP address is received within a preset first waiting time, step 36 is performed; if first return data from the current IP address is received within the first waiting time, step 33 is performed.

[0015] Step 33, the first return data is processed by format data analysis to generate a corresponding current analysis state and current analysis plaintext; the current analysis state comprises a normal state and an error state.

[0016] Step 34, whether the current analysis state is a normal state is identified; if yes, step 35 is performed; if no, step 36 is performed.

[0017] Step 35, extracting the resource MAC address, resource IP address, resource name and resource type from the plaintext of the current analysis as the corresponding first resource MAC address field, first resource IP address field, first resource name field and first resource type field, and taking the timestamp of the current system time as the corresponding first timestamp field, and adding the corresponding first resource record composed of the first resource MAC address field, first resource IP address field, first timestamp field, first resource name field and first resource type field obtained in this time to the network resource table;

[0018] Step 36, adding 1 to the current IP address as a new current IP address;

[0019] Step 37, identifying whether the current IP address exceeds the first end IP address of the first target address group; if yes, go to step 32 for further processing; if no, stop the loop and output the latest network resource table as the final processing result.

[0020] Preferably, the first return data and the first upload data have the same data format, both composed of a first security identifier and a first data body;

[0021] The first security identifier includes four identification bits, namely: plaintext identification bit, ciphertext identification bit, plaintext+check code identification bit and ciphertext+check code identification bit; the plaintext identification bit, the ciphertext identification bit, the plaintext+check code identification bit and the ciphertext+check code identification bit all include two state identifiers, namely: active identifier and inactive identifier; among the four identification bits, only one identification bit has an active identifier, and the state identifiers of the other three identification bits should all be inactive identifiers;

[0022] When the state identifier of the plaintext identification bit of the first security identifier is active, the first data body includes a first plaintext;

[0023] When the state identifier of the ciphertext identification bit of the first security identifier is active, the first data body includes a first random number and a first ciphertext;

[0024] When the state identifier of the plaintext+check code identification bit of the first security identifier is active, the first data body includes a second plaintext and a first check code;

[0025] When the state identifier of the ciphertext+check code identification bit of the first security identifier is active, the first data body includes a second random number, a second ciphertext and a second check code.

[0026] Preferably, the method further comprises:

[0027] The network resource obtains preset resource MAC address information, resource IP address information, resource name information and resource type information from the local as the corresponding current resource MAC address, current resource IP address, current resource name and current resource type when receiving the first resource polling instruction sent by the monitoring end; and obtains preset security identification information from the local as the corresponding first security identification; and performs resource data encapsulation processing according to the obtained current resource MAC address, current resource IP address, current resource name, current resource type and first security identification to obtain the corresponding first encapsulation data; and sends the first encapsulation data obtained this time as the corresponding first return data to the polling port of the monitoring end;

[0028] The network resource also obtains preset resource MAC address information, resource IP address information, resource name information and resource type information from the local as the corresponding current resource MAC address, current resource IP address, current resource name and current resource type; and obtains preset security identification information from the local as the corresponding first security identification; and performs resource data encapsulation processing according to the obtained current resource MAC address, current resource IP address, current resource name, current resource type and first security identification to obtain the corresponding first encapsulation data; and uploads the first encapsulation data obtained this time as the corresponding first upload data to the monitoring end of the listening port;

[0029] The resource type information preset locally by the network resource includes server type, database type, storage device type, network device type and terminal type;

[0030] The resource data encapsulation processing according to the obtained current resource MAC address, current resource IP address, current resource name, current resource type and first security identification is specifically:

[0031] If the state identification of the plaintext identification bit of the first security identification is an active identification, the first plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name and the current resource type; and the first data body is composed of the first plaintext; and the first encapsulation data is composed of the first security identification and the first data body;

[0032] If the state identifier of the ciphertext identifier of the first security identifier is an activation identifier, a corresponding first original plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name and the current resource type; a random number is obtained from the local as a corresponding first random number; the first random number is encrypted based on the locally preset device key, and the encryption result is taken as a corresponding first process key; the first original plaintext is encrypted based on the first process key, and the encryption result is taken as a corresponding first ciphertext; and the first data body is composed of the obtained first random number and the first ciphertext; and the first encapsulation data output is composed of the first security identifier and the first data body.

[0033] If the state identifier of the plaintext+check code identifier of the first security identifier is an activation identifier, the second plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name and the current resource type; the second plaintext is digitally summarized based on a preset digital summary algorithm, and the calculation result is taken as a corresponding first check code; and the first data body is composed of the obtained second plaintext and the first check code; and the first encapsulation data output is composed of the first security identifier and the first data body.

[0034] If the state identifier of the ciphertext+check code identifier of the first security identifier is an activation identifier, a corresponding second original plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name and the current resource type; a random number is obtained from the local as a corresponding second random number; the second random number is encrypted based on the locally preset device key, and the encryption result is taken as a corresponding second process key; the second original plaintext is encrypted based on the second process key, and the encryption result is taken as a corresponding second ciphertext; the second original plaintext is digitally summarized based on a preset digital summary algorithm, and the calculation result is taken as a corresponding second check code; and the first data body is composed of the obtained second random number, the second ciphertext and the second check code; and the first encapsulation data output is composed of the first security identifier and the first data body.

[0035] Preferably, the formatted data analysis processing specifically includes:

[0036] Step 61, taking the first upload data or the first return data of this processing as a corresponding current data; and extracting the first security identifier and the first data body from the current data;

[0037] Step 62, identify whether there is and only one of the four identification bits of the first security identification is in the active state; if yes, go to step 63; if no, set the corresponding current parsing state as the error state and set the corresponding current parsing plaintext as empty, and go to step 67;

[0038] Step 63, if the state of the plaintext identification bit of the first security identification is the active state, extract the corresponding first plaintext from the first data body; set the corresponding current parsing state as the normal state, and set the corresponding current parsing plaintext as the first plaintext;

[0039] Step 64, if the state of the ciphertext identification bit of the first security identification is the active state, extract the corresponding first random number and the first ciphertext from the first data body; encrypt the first random number based on the locally preset device key, and take the encryption result as the corresponding third process key; decrypt the first ciphertext based on the third process key, and take the decryption result as the corresponding first decrypted plaintext; set the corresponding current parsing state as the normal state, and set the corresponding current parsing plaintext as the first decrypted plaintext;

[0040] Step 65, if the state of the plaintext+check code identification bit of the first security identification is the active state, extract the corresponding second plaintext and the first check code from the first data body; perform digital digest calculation on the second plaintext based on the preset digital digest algorithm, and take the calculation result as the third check code; identify whether the first and third check codes match; if yes, set the corresponding current parsing state as the normal state, and set the corresponding current parsing plaintext as the second plaintext; if no, set the corresponding current parsing state as the error state, and set the corresponding current parsing plaintext as empty;

[0041] Step 66: If the status identifier of the ciphertext + checksum identifier bit of the first security identifier is an activation identifier, then extract the corresponding second random number, second ciphertext, and second checksum from the first data body; encrypt the second random number based on a locally preset device key, and use the encryption result as the corresponding fourth process key; decrypt the second ciphertext based on the fourth process key, and use the decryption result as the corresponding second decrypted plaintext; perform digital digest calculation on the second decrypted plaintext based on a preset digital digest algorithm, and use the calculation result as the corresponding fourth checksum; identify whether the second and fourth checksums match; if they match, set the corresponding current parsing status to normal status, and set the corresponding current parsing plaintext to the second decrypted plaintext; if they do not match, set the corresponding current parsing status to error status, and set the corresponding current parsing plaintext to empty.

[0042] Step 67: Output the obtained current parsing state and the current parsing plaintext as the processing result.

[0043] Preferably, the step of dynamically managing the network resource table based on the current parsed plaintext specifically includes:

[0044] Extract the resource MAC address from the current plaintext parsing as the corresponding current MAC address; and take the first resource record in the network resource table whose first resource MAC address field matches the current MAC address as the corresponding current resource record;

[0045] If the current resource record is not empty, the resource MAC address, resource IP address, resource name, and resource type are extracted from the current parsed plaintext and the corresponding first resource MAC address field, first resource IP address field, first resource name field, and first resource type field in the current resource record are updated; and the first timestamp field of the current resource record is updated with the timestamp of the current system time.

[0046] If the current resource record is empty, the resource MAC address, resource IP address, resource name, and resource type are extracted from the current parsed plaintext and used as the corresponding first resource MAC address field, first resource IP address field, first resource name field, and first resource type field. The current system time timestamp is used as the corresponding first timestamp field. The first resource record is composed of the first resource MAC address field, first resource IP address field, first timestamp field, first resource name field, and first resource type field obtained in this instance and added to the network resource table.

[0047] Preferably, the method further comprises:

[0048] The monitoring end periodically traverses each of the first resource records of the network resource table; and when traversing, takes the first resource record currently traversed as a corresponding current resource record; extracts the first timestamp field of the current resource record as a corresponding first timestamp; takes the timestamp of the current system time as a corresponding second timestamp; calculates the time interval of the first and second timestamps to obtain a corresponding first time interval; and removes the current resource record from the network resource table when the first time interval exceeds a preset time interval threshold.

[0049] The second aspect of the embodiment of the application provides an electronic device, comprising a memory, a processor and a transceiver.

[0050] The processor is used for coupling with the memory, reading and executing instructions in the memory to realize the method in the first aspect;

[0051] The transceiver is coupled with the processor, and the transceiver is controlled by the processor to perform message transmission and reception.

[0052] The third aspect of the embodiment of the application provides a computer readable storage medium, which stores computer instructions, and when the computer instructions are executed by a computer, the computer executes the method in the first aspect.

[0053] The embodiment of the application provides a network resource dynamic management method, an electronic device and a computer readable storage medium, a monitoring end acquires network resources in an IP address range in real time through a polling mode and initializes a network resource table, the monitoring end and network resources are arranged to periodically report to dynamically add, update and remove network resources in the network resource table, and multiple data protection modes (cipher mode, plaintext+check code mode and cipher+check code mode) are provided for the monitoring end and the network resources in the interaction process to ensure the security of data transmission. The application can more accurately master the real deployment state of network resources, and can improve monitoring accuracy and reduce fault positioning deviation. BRIEF DESCRIPTION OF DRAWINGS

[0054] Figure 1 A network resource dynamic management method provided for the first embodiment of the application is shown in the figure.

[0055] Figure 2 A structure schematic diagram of an electronic device provided for the second embodiment of the application is shown in the figure. DETAILED DESCRIPTION

[0056] In order to make the objects, technical solutions and advantages of the present application clearer, the following further describes the present application in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of, rather than all of, the embodiments of the present application. Based upon the embodiments of the present application, all other embodiments obtained by those ordinarily skilled in the art without creative effort belong to the scope of the present application.

[0057] Figure 1 A network resource dynamic management method provided by the embodiment one of the present application is shown in Fig. 1, which mainly includes the following steps: Figure 1

[0058] Step 1, the monitoring terminal receives a group of start and end IP addresses to form a corresponding first target address group;

[0059] The first target address group includes a first start IP address and a first end IP address; the first start IP address and the first end IP address are in the same network segment, for example, the first start IP address is 192.168.1.100 and the first end IP address is 192.168.1.255.

[0060] Here, the monitoring terminal of the embodiment of the present application is a device, equipment, server or service terminal for monitoring network resources in an information network; the network resources of the embodiment of the present application include servers, databases, storage devices, network devices and terminal machines, the storage devices commonly include disk arrays, SUN network storage, NAS network storage, IP SAN network storage, etc., the network devices commonly include switches, routers, firewalls, network bridges, hubs, gateways, VPN servers, wireless access points (WAP), modems, base stations, etc.; it should be noted that the monitoring terminal and each network resource of the embodiment of the present application are both pre-stored with a device key in the local, and the device keys of the monitoring terminal and all network resources are the same.

[0061] Step 2, network resource initial addition is performed according to the first target address group to generate a corresponding network resource table;

[0062] Specifically, step 21, the monitoring terminal initializes a network resource table with empty content; and the first start IP address of the first target address group is taken as a corresponding current IP address;

[0063] The network resource table includes a plurality of first resource records; the first resource record includes a first resource MAC address field, a first resource IP address field, a first time stamp field, a first resource name field and a first resource type field; the first resource type field includes a server type, a database type, a storage device type, a network device type and a terminal machine type. ​

[0064] Step 22, sending a first resource polling instruction to the network resource corresponding to the current IP address through a preset polling port; and receiving and waiting for the return data from the current IP address at the polling port; if the return data from the current IP address is not received within a preset first waiting time, going to step 26; if the first return data from the current IP address is received within the first waiting time, going to step 23;

[0065] It should be noted that when the network resource in the embodiment of the application receives the first resource polling instruction sent by the monitoring end, the preset resource MAC address information, resource IP address information, resource name information and resource type information are obtained from the local as the corresponding current resource MAC address, current resource IP address, current resource name and current resource type; the preset security identification information is obtained from the local as the corresponding first security identification; and the current resource MAC address, current resource IP address, current resource name, current resource type and first security identification are obtained as the corresponding first encapsulation data; and the first encapsulation data obtained this time is taken as the corresponding first return data to the polling port of the monitoring end.

[0066] The resource type information preset by the network resource locally includes server type, database type, storage device type, network device type and terminal type.

[0067] The security identification information preset by the network resource locally includes four identification bits, which are plaintext identification bit, ciphertext identification bit, plaintext+check code identification bit and ciphertext+check code identification bit; the plaintext identification bit, ciphertext identification bit, plaintext+check code identification bit and ciphertext+check code identification bit all include two state identifications, which are active identification and inactive identification; only one of the four identification bits has the active identification, and the state identifications of the other three identification bits should all be inactive identifications.

[0068] In addition, the current resource MAC address, current resource IP address, current resource name, current resource type and first security identification are obtained as the corresponding first encapsulation data, which is specifically:

[0069] Step A1, if the state identification of the plaintext identification bit of the first security identification is the active identification, the first plaintext corresponding to the current resource MAC address, current resource IP address, current resource name and current resource type is composed; the first plaintext is taken as the corresponding first data body; and the first security identification and the first data body are composed as the corresponding first encapsulation data output.

[0070] Step A2, if the state of the ciphertext identifier of the first security identifier is the active identifier, then the corresponding first original plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name and the current resource type; a random number is obtained from the local as the corresponding first random number; the first random number is encrypted based on the pre-set device key of the local, and the encryption result is taken as the corresponding first process key; the first original plaintext is encrypted based on the first process key, and the encryption result is taken as the corresponding first ciphertext; the obtained first random number and first ciphertext are composed to form the corresponding first data body; and the first security identifier and the first data body are composed to form the corresponding first encapsulation data output;

[0071] Step A3, if the state of the plaintext+check code identifier of the first security identifier is the active identifier, then the corresponding second plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name and the current resource type; the second plaintext is calculated based on the pre-set digital digest algorithm, and the calculation result is taken as the corresponding first check code; the obtained second plaintext and first check code are composed to form the corresponding first data body; and the first security identifier and the first data body are composed to form the corresponding first encapsulation data output;

[0072] Step A4, if the state of the ciphertext+check code identifier of the first security identifier is the active identifier, then the corresponding second original plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name and the current resource type; a random number is obtained from the local as the corresponding second random number; the second random number is encrypted based on the pre-set device key of the local, and the encryption result is taken as the corresponding second process key; the second original plaintext is encrypted based on the second process key, and the encryption result is taken as the corresponding second ciphertext; the second original plaintext is calculated based on the pre-set digital digest algorithm, and the calculation result is taken as the corresponding second check code; the obtained second random number, second ciphertext and second check code are composed to form the corresponding first data body; and the first security identifier and the first data body are composed to form the corresponding first encapsulation data output;

[0073] In summary, that is, the data format of the first returned data is: composed of a first security identifier and a first data body; the first security identifier includes four identifier bits, which are: a plaintext identifier bit, a ciphertext identifier bit, a plaintext+check code identifier bit and a ciphertext+check code identifier bit; the plaintext identifier bit, the ciphertext identifier bit, the plaintext+check code identifier bit and the ciphertext+check code identifier bit all include two state identifiers, which are: an active identifier and an inactive identifier; among the four identifier bits, only one identifier bit has an active identifier, and the state identifiers of the remaining three identifier bits should all be inactive identifiers; when the state identifier of the plaintext identifier bit of the first security identifier is active, the first data body includes a first plaintext; when the state identifier of the ciphertext identifier bit of the first security identifier is active, the first data body includes a first random number and a first ciphertext; when the state identifier of the plaintext+check code identifier bit of the first security identifier is active, the first data body includes a second plaintext and a first check code; when the state identifier of the ciphertext+check code identifier bit of the first security identifier is active, the first data body includes a second random number, a second ciphertext and a second check code;

[0074] Step 23, performing format data analysis processing on the first returned data to generate corresponding current analysis state and current analysis plaintext;

[0075] Among them, the current analysis state includes a normal state and an error state;

[0076] Specifically, it includes: step 231, taking the first returned data of this processing as corresponding current data; and extracting the corresponding first security identifier and first data body from the current data;

[0077] Step 232, identifying whether only one of the four identifier bits of the first security identifier has an active identifier; if so, go to step 233; if not, set the corresponding current analysis state to an error state and set the corresponding current analysis plaintext to empty, and go to step 237;

[0078] Step 233, if the state identifier of the plaintext identifier bit of the first security identifier is active, extract the corresponding first plaintext from the first data body; and set the corresponding current analysis state to a normal state, and set the corresponding current analysis plaintext to the first plaintext;

[0079] Step 234, if the state of the ciphertext identification bit of the first security identification is the active identification, the corresponding first random number and the first ciphertext are extracted from the first data body; and the first random number is encrypted based on the locally preset device key, and the encryption result is taken as the corresponding third process key; and the first ciphertext is decrypted based on the third process key, and the decryption result is taken as the corresponding first decrypted plaintext; and the corresponding current analysis state is set as the normal state, and the corresponding current analysis plaintext is set as the first decrypted plaintext;

[0080] Step 235, if the state of the plaintext+check code identification bit of the first security identification is the active identification, the corresponding second plaintext and the first check code are extracted from the first data body; and the second plaintext is calculated by the preset digital digest algorithm, and the calculation result is taken as the third check code; and whether the first and third check codes match is identified; if yes, the corresponding current analysis state is set as the normal state, and the corresponding current analysis plaintext is set as the second plaintext; if no, the corresponding current analysis state is set as the error state, and the corresponding current analysis plaintext is set as empty;

[0081] Step 236, if the state of the ciphertext+check code identification bit of the first security identification is the active identification, the corresponding second random number, the second ciphertext and the second check code are extracted from the first data body; and the second random number is encrypted based on the locally preset device key, and the encryption result is taken as the fourth process key; and the second ciphertext is decrypted based on the fourth process key, and the decryption result is taken as the second decrypted plaintext; and the second decrypted plaintext is calculated by the preset digital digest algorithm, and the calculation result is taken as the fourth check code; and whether the second and fourth check codes match is identified; if yes, the corresponding current analysis state is set as the normal state, and the corresponding current analysis plaintext is set as the second decrypted plaintext; if no, the corresponding current analysis state is set as the error state, and the corresponding current analysis plaintext is set as empty;

[0082] Step 237, the obtained current analysis state and current analysis plaintext are taken as the processing result and outputted;

[0083] Step 24, whether the current analysis state is the normal state is identified; if yes, step 25 is turned to; if no, step 26 is turned to;

[0084] Step 25, extracting the resource MAC address, resource IP address, resource name and resource type from the plaintext of the current analysis as the corresponding first resource MAC address field, first resource IP address field, first resource name field and first resource type field, and taking the time stamp of the current system time as the corresponding first time stamp field, and adding the corresponding first resource record to the network resource table by the first resource MAC address field, first resource IP address field, first time stamp field, first resource name field and first resource type field obtained in this time;

[0085] Step 26, adding 1 to the current IP address as the new current IP address;

[0086] For example, if the current IP address is 192.168.1.100, then the new current IP address obtained by adding 1 to the current IP address is 192.168.1.101;

[0087] Step 27, identifying whether the current IP address exceeds the first end IP address of the first target address group; if yes, go to step 22 for further processing; if no, stop the loop and output the latest network resource table as the final processing result.

[0088] In summary, the monitoring end of the embodiment of the present application performs real-time acquisition on the network resources in the IP address range [first start IP address, first end IP address] in a polling manner through step 2 above, and constructs a network resource table based on the acquired real-time information. After obtaining the network resource table, the monitoring end of the embodiment of the present application will perform dynamic updating and adding operations on the network resources in the network resource table through subsequent step 3.

[0089] It should be noted that, in order to ensure that the monitoring end can continuously receive information of the network resource and does not always start the time-consuming operation mechanism of full network polling, a periodic reporting mechanism is agreed between the monitoring end and the network resource, that is, the network resource of the embodiment of the application obtains preset resource MAC address information, resource IP address information, resource name information and resource type information from the local as the corresponding current resource MAC address, current resource IP address, current resource name and current resource type; and obtains preset security identification information from the local as the corresponding first security identification; and performs resource data encapsulation processing according to the obtained current resource MAC address, current resource IP address, current resource name, current resource type and first security identification to obtain the corresponding first encapsulation data; and uploads the obtained first encapsulation data as the corresponding first upload data to the monitoring end of the listening port. Here, the processing procedure of the monitoring end for obtaining the corresponding first encapsulation data according to the obtained current resource MAC address, current resource IP address, current resource name, current resource type and first security identification during periodic reporting is the same as the processing procedure of steps A1-A4 in the foregoing, and thus the repeated description is not given. The data format of the obtained first upload data is also the same as that of the first return data in the foregoing, that is, the first upload data is also composed of the first security identification and the first data body, and thus the repeated description is not given.

[0090] Step 3, after the network resource is initially added, the first upload data sent by any network resource on the preset listening port is listened to; and when the first upload data is received, the first upload data is subjected to formatted data analysis processing to generate the corresponding current analysis state and current analysis plaintext; and when the current analysis state is a normal state, the network resource table is dynamically managed according to the current analysis plaintext;

[0091] The current analysis state includes a normal state and an error state.

[0092] Specifically, step 31, after the network resource is initially added, the monitoring end listens to the first upload data sent by any network resource on the preset listening port.

[0093] Here, the listening port set in the embodiment of the application and the polling port mentioned in the foregoing are two different ports, and the two ports cannot coincide.

[0094] Step 32, when the first upload data is received, the first upload data is subjected to formatted data analysis processing to generate the corresponding current analysis state and current analysis plaintext.

[0095] The current analysis state includes a normal state and an error state.

[0096] Here, the formatted data parsing process of the current step is basically the same as the formatted data parsing process in step 23 of the previous step.

[0097] Specifically, step 321, the first upload data of the current processing is taken as the corresponding current data, and the corresponding first security identifier and first data body are extracted from the current data;

[0098] Step 322, identify whether there is and only one identification bit of the four identification bits of the first security identifier in the active identification state; if yes, go to step 323; if no, set the corresponding current parsing state to error state and set the corresponding current parsing plaintext to empty, and go to step 327;

[0099] Step 323, if the plaintext identification bit of the first security identifier is in the active identification state, extract the corresponding first plaintext from the first data body; and set the corresponding current parsing state to normal state, and set the corresponding current parsing plaintext to the first plaintext;

[0100] Step 324, if the ciphertext identification bit of the first security identifier is in the active identification state, extract the corresponding first random number and first ciphertext from the first data body; and encrypt the first random number based on the locally preset device key, and take the encryption result as the corresponding third process key; and decrypt the first ciphertext based on the third process key, and take the decryption result as the corresponding first decrypted plaintext; and set the corresponding current parsing state to normal state, and set the corresponding current parsing plaintext to the first decrypted plaintext;

[0101] Step 325, if the plaintext+check code identification bit of the first security identifier is in the active identification state, extract the corresponding second plaintext and first check code from the first data body; and perform digital digest calculation on the second plaintext based on the preset digital digest algorithm, and take the calculation result as the third check code; and identify whether the first and third check codes match; if yes, set the corresponding current parsing state to normal state, and set the corresponding current parsing plaintext to the second plaintext; if no, set the corresponding current parsing state to error state, and set the corresponding current parsing plaintext to empty;

[0102] Step 326, if the state of the cipher text of the first security identifier + the check code identifier bit is the active identifier, the corresponding second random number, second cipher text and second check code are extracted from the first data body; and the second random number is encrypted based on the locally preset device key, and the encryption result is taken as the corresponding fourth process key; and the second cipher text is decrypted based on the fourth process key, and the decryption result is taken as the corresponding second decrypted plaintext; and the second decrypted plaintext is calculated by the preset digital digest algorithm, and the calculation result is taken as the corresponding fourth check code; and whether the second and fourth check codes match is identified; if they match, the corresponding current analysis state is set as the normal state, and the corresponding current analysis plaintext is set as the second decrypted plaintext; if they do not match, the corresponding current analysis state is set as the error state, and the corresponding current analysis plaintext is set as empty;

[0103] Step 327, the obtained current analysis state and current analysis plaintext are taken as the processing result and output;

[0104] Step 33, when the current analysis state is the normal state, the network resource table is dynamically managed according to the current analysis plaintext;

[0105] Specifically, it includes: step 331, the resource MAC address is extracted from the current analysis plaintext as the corresponding current MAC address; and the first resource record in the network resource table, whose first resource MAC address field matches the current MAC address, is taken as the corresponding current resource record;

[0106] Step 332, if the current resource record is not empty, the resource MAC address, resource IP address, resource name and resource type are extracted from the current analysis plaintext to update the corresponding first resource MAC address field, first resource IP address field, first resource name field and first resource type field in the current resource record; and the first timestamp field of the current resource record is updated with the timestamp of the current system time;

[0107] Here, if the current resource record is not empty, it means that the current network resource has been added to the network resource table, at this time, it only needs to be dynamically updated;

[0108] Step 333, if the current resource record is empty, the resource MAC address, resource IP address, resource name and resource type are extracted from the current analysis plaintext as the corresponding first resource MAC address field, first resource IP address field, first resource name field and first resource type field, and the timestamp of the current system time is taken as the corresponding first timestamp field, and the first resource MAC address field, first resource IP address field, first timestamp field, first resource name field and first resource type field obtained this time are taken as the corresponding first resource record to add to the network resource table.

[0109] Here, if the current resource record is empty, it means that the current network resource has not been added in the network resource table, at this time, it needs to be dynamically added.

[0110] To sum up, the embodiment of the application realizes the dynamic adding and updating operation of the network resource by the above-mentioned step 3 through the agreed periodic reporting mode between the monitoring end and the network resource.

[0111] It should be noted that the monitoring end of the embodiment of the application also realizes the dynamic removal operation of the network resource through a periodic arrangement mode of the network resource table, that is, the monitoring end also periodically traverses each first resource record of the network resource table; and during the traversal, the first resource record currently traversed is taken as the corresponding current resource record; and the first timestamp field of the current resource record is extracted as the corresponding first timestamp; and the timestamp of the current system time is taken as the corresponding second timestamp; and the time interval of the first and second timestamps is calculated to obtain the corresponding first time interval; and when the first time interval exceeds the preset time interval threshold, the current resource record is removed from the network resource table.

[0112] Figure 2 A structural schematic diagram of an electronic device is provided for the second embodiment of the application. The electronic device can be the terminal device or the server as described above, or can be a terminal device or a server connected with the terminal device or the server as described above to implement the method of the embodiment of the application. As shown in the figure, the electronic device can include a processor 301 (such as a CPU), a memory 302, a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiving action of the transceiver 303. The memory 302 can store various instructions for completing various processing functions and implementing the processing steps described in the foregoing method embodiment. Preferably, the electronic device related to the embodiment of the application further includes a power supply 304, a system bus 305 and a communication port 306. The system bus 305 is used to realize the communication connection between elements. The above-mentioned communication port 306 is used for the connection communication between the electronic device and other external devices. Figure 2

[0113] In Figure 2 ​The system bus 305 mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as a client, a read-write library and a read-only library). The memory can include a Random Access Memory (RAM), and can also include a Non-Volatile Memory, such as at least one disk memory.

[0114] The processor mentioned above can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), a Graphics Processing Unit (GPU), etc.; can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0115] It should be noted that the embodiments of the present application also provide a computer readable storage medium, which stores instructions, and when the instructions run on a computer, the computer executes the method and processing procedure provided in the above embodiments.

[0116] The embodiments of the present application also provide a chip for running instructions, which is used to execute the processing steps described in the foregoing method embodiments.

[0117] The embodiment of the present application provides a network resource dynamic management method, an electronic device and a computer readable storage medium, a network resource table is initialized by a monitoring end through polling mode for real-time acquisition of network resources in an IP address range, network resources in the network resource table are dynamically added, updated and removed by a regular reporting mode agreed between the monitoring end and the network resources, and in order to guarantee the safety of data transmission between the monitoring end and the network resources, a plurality of data protection modes (cipher mode, plaintext+check code mode, cipher+check code mode) are provided in the interaction process. Through the present application, the real deployment state of the network resources can be more accurately mastered, the monitoring accuracy can be improved, and the fault positioning deviation can be reduced.

[0118] Those skilled in the art should further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both, and in order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been described in the above description in general. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0119] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be implemented by hardware, a software module executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0120] The above specific implementation mode further details the purpose, technical solution and beneficial effects of the present application, and it should be understood that the above description is only a specific implementation mode of the present application and is not used to limit the protection scope of the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for dynamic management of network resources, characterized in that, The method comprises: The monitoring end receives a set of starting and ending IP addresses to form a corresponding first target address group; According to the first target address group, network resource initial addition is performed to generate a corresponding network resource table; After network resource initial addition, the first upload data on any network resource on a preset listening port is listened to; when the first upload data is received, it is processed by formatted data analysis to generate a corresponding current analysis state and current analysis plaintext; when the current analysis state is normal, the network resource table is dynamically managed according to the current analysis plaintext; the current analysis state includes a normal state and an error state.

2. The dynamic management method of network resources according to claim 1, characterized in that: The first target address group includes a first starting IP address and a first ending IP address; the first starting IP address and the first ending IP address are in the same network segment; The network resource table includes a plurality of first resource records; the first resource record includes a first resource MAC address field, a first resource IP address field, a first timestamp field, a first resource name field and a first resource type field; the first resource type field includes a server type, a database type, a storage device type, a network device type and a terminal type; The network resources include servers, databases, storage devices, network devices and terminals; The monitoring end and each network resource are locally preset with the same device key.

3. The method of claim 2, wherein, According to the first target address group, network resource initial addition is performed to generate a corresponding network resource table, which specifically comprises: Step 31, the monitoring end initializes an empty network resource table; and the first starting IP address of the first target address group is taken as a corresponding current IP address; Step 32, a first resource polling instruction is sent to the network resource corresponding to the current IP address through a preset polling port; and the return data from the current IP address is received on the polling port; if the return data from the current IP address is not received within a preset first waiting time, step 36 is performed; if the first return data from the current IP address is received within the first waiting time, step 33 is performed; Step 33, the first return data is processed by formatted data analysis to generate a corresponding current analysis state and current analysis plaintext; the current analysis state includes a normal state and an error state; Step 34, whether the current analysis state is normal is identified; if yes, step 35 is performed; if no, step 36 is performed; Step 35, the current analysis plaintext is taken as the first resource name field and the first resource type field of the first resource record in the network resource table; the current IP address is taken as the first resource IP address field of the first resource record in the network resource table; the current timestamp is taken as the first timestamp field of the first resource record in the network resource table; the first resource MAC address field of the first resource record in the network resource table is taken as the device key; and the network resource table is dynamically managed according to the current analysis plaintext; and step 36 is performed. Step 36, the current IP address is taken as the first starting IP address of the first target address group; and the first target address group is updated. Step 35, extracting the resource MAC address, resource IP address, resource name and resource type from the plaintext of the current analysis as the corresponding first resource MAC address field, first resource IP address field, first resource name field and first resource type field, and taking the timestamp of the current system time as the corresponding first timestamp field, and adding the corresponding first resource record composed of the first resource MAC address field, first resource IP address field, first timestamp field, first resource name field and first resource type field obtained in this time to the network resource table; Step 36, adding 1 to the current IP address as a new current IP address; Step 37, identifying whether the current IP address exceeds the first end IP address of the first target address group; if yes, go to step 32 for further processing; if no, stop the loop and output the latest network resource table as the final processing result.

4. The dynamic management method of network resources according to claim 3, characterized in that, the first return data and the first upload data have the same data format, both composed of a first security identifier and a first data body; the first security identifier includes four identification bits, namely, plaintext identification bit, ciphertext identification bit, plaintext+check code identification bit and ciphertext+check code identification bit; the plaintext identification bit, the ciphertext identification bit, the plaintext+check code identification bit and the ciphertext+check code identification bit all include two state identifiers, namely, active identifier and inactive identifier; among the four identification bits, only one identification bit has an active identifier, and the state identifiers of the other three identification bits should all be inactive identifiers; when the state identifier of the plaintext identification bit of the first security identifier is active, the first data body includes first plaintext; when the state identifier of the ciphertext identification bit of the first security identifier is active, the first data body includes first random number and first ciphertext; when the state identifier of the plaintext+check code identification bit of the first security identifier is active, the first data body includes second plaintext and first check code; when the state identifier of the ciphertext+check code identification bit of the first security identifier is active, the first data body includes second random number, second ciphertext and second check code.

5. The method for dynamic management of network resources according to claim 4, characterized in that, The method further comprises: The network resource receives the first resource polling instruction sent by the monitoring end, obtains preset resource MAC address information, resource IP address information, resource name information and resource type information from the local as corresponding current resource MAC address, current resource IP address, current resource name and current resource type, obtains preset security identification information from the local as corresponding first security identification, performs resource data encapsulation processing according to the obtained current resource MAC address, current resource IP address, current resource name, current resource type and first security identification to obtain corresponding first encapsulation data, and sends the obtained first encapsulation data as corresponding first return data to the polling port of the monitoring end. The network resource also periodically obtains preset resource MAC address information, resource IP address information, resource name information and resource type information from the local as corresponding current resource MAC address, current resource IP address, current resource name and current resource type, obtains preset security identification information from the local as corresponding first security identification, performs resource data encapsulation processing according to the obtained current resource MAC address, current resource IP address, current resource name, current resource type and first security identification to obtain corresponding first encapsulation data, and uploads the obtained first encapsulation data as corresponding first upload data to the listening port of the monitoring end. The network resource local preset resource type information includes server type, database type, storage device type, network device type and terminal type. The network resource local preset resource type information includes server type, database type, storage device type, network device type and terminal type. The network resource local preset resource type information includes server type, database type, storage device type, network device type and terminal type. If the state identification of the plaintext identification bit of the first security identification is an active identification, the first plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name and the current resource type, the first data body is composed of the first plaintext, the first encapsulation data is composed of the first security identification and the first data body, and the first encapsulation data is output. If the status of the ciphertext identifier bit of the first security identifier is an active identifier, then the corresponding first original plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name, and the current resource type; a random number is obtained locally as the corresponding first random number; the first random number is encrypted based on a locally preset device key, and the encryption result is used as the corresponding first process key; the first original plaintext is encrypted based on the first process key, and the encryption result is used as the corresponding first ciphertext; the obtained first random number and the first ciphertext are combined to form the corresponding first data body; and the first security identifier and the first data body are combined to form the corresponding first encapsulated data output. If the status flag of the plaintext + checksum flag of the first security flag is an active flag, then the second plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name, and the current resource type; and the second plaintext is processed by a preset digital digest algorithm to calculate a digital digest, and the calculation result is used as the corresponding first checksum; the obtained second plaintext and the first checksum are combined to form the corresponding first data body; and the first security flag and the first data body are combined to form the corresponding first encapsulated data output. If the status flag of the ciphertext + checksum flag of the first security identifier is an active flag, then the corresponding second original plaintext is composed of the current resource MAC address, the current resource IP address, the current resource name, and the current resource type; a random number is obtained locally as the corresponding second random number; the second random number is encrypted based on a locally preset device key, and the encryption result is used as the corresponding second process key; the second original plaintext is encrypted based on the second process key, and the encryption result is used as the corresponding second ciphertext; the second original plaintext is calculated based on a preset digital digest algorithm, and the calculation result is used as the corresponding second checksum; the obtained second random number, the second ciphertext, and the second checksum are combined to form the corresponding first data body; and the first security identifier and the first data body are combined to form the corresponding first encapsulated data output.

6. The method for dynamic management of network resources according to claim 4, wherein, The formatted data parsing process specifically includes: Step 61: Take the first uploaded data or the first returned data processed in this step as the corresponding current data; and extract the corresponding first security identifier and the first data body from the current data; Step 62: Identify whether there is one and only one active flag in the four flag bits of the first security flag; if yes, proceed to step 63; if no, set the corresponding parsing status to error and set the corresponding parsing plaintext to empty, and proceed to step 67. Step 63, if the state of the plaintext identification bit of the first security identification is an activation identification, the corresponding first plaintext is extracted from the first data body; and the corresponding this-time analysis state is set as a normal state, and the corresponding this-time analysis plaintext is set as the first plaintext; Step 64, if the state of the ciphertext identification bit of the first security identification is an activation identification, the corresponding first random number and the first ciphertext are extracted from the first data body; and the first random number is encrypted based on the locally preset device key, and the encryption result is taken as a corresponding third process key; and the first ciphertext is decrypted based on the third process key, and the decryption result is taken as a corresponding first decrypted plaintext; and the corresponding this-time analysis state is set as a normal state, and the corresponding this-time analysis plaintext is set as the first decrypted plaintext; Step 65, if the state of the plaintext+check code identification bit of the first security identification is an activation identification, the corresponding second plaintext and the first check code are extracted from the first data body; and the second plaintext is calculated by a preset digital digest algorithm, and the calculation result is taken as a third check code; and whether the first and third check codes match is identified; if yes, the corresponding this-time analysis state is set as a normal state, and the corresponding this-time analysis plaintext is set as the second plaintext; if no, the corresponding this-time analysis state is set as an error state, and the corresponding this-time analysis plaintext is set as empty; Step 66, if the state of the ciphertext+check code identification bit of the first security identification is an activation identification, the corresponding second random number, the second ciphertext and the second check code are extracted from the first data body; and the second random number is encrypted based on the locally preset device key, and the encryption result is taken as a fourth process key; and the second ciphertext is decrypted based on the fourth process key, and the decryption result is taken as a second decrypted plaintext; and the second decrypted plaintext is calculated by a preset digital digest algorithm, and the calculation result is taken as a fourth check code; and whether the second and fourth check codes match is identified; if yes, the corresponding this-time analysis state is set as a normal state, and the corresponding this-time analysis plaintext is set as the second decrypted plaintext; if no, the corresponding this-time analysis state is set as an error state, and the corresponding this-time analysis plaintext is set as empty; Step 67, the obtained this-time analysis state and this-time analysis plaintext are taken as a processing result and output.

7. The method for dynamic management of network resources according to claim 2, wherein, The network resource table is dynamically managed according to the this-time analysis plaintext, specifically including: A resource MAC address is extracted from the this-time analysis plaintext as a current MAC address; and a first resource record in the network resource table, in which the first resource MAC address field matches the current MAC address, is taken as a current resource record; If the current resource record is not empty, the resource MAC address, resource IP address, resource name and resource type extracted from the current parsing plaintext are used to update the corresponding first resource MAC address field, first resource IP address field, first resource name field and first resource type field in the current resource record; and the first timestamp field of the current resource record is updated with the timestamp of the current system time; If the current resource record is empty, the resource MAC address, resource IP address, resource name and resource type extracted from the current parsing plaintext are used as the corresponding first resource MAC address field, first resource IP address field, first resource name field and first resource type field, and the timestamp of the current system time is used as the corresponding first timestamp field, and the corresponding first resource record composed of the first resource MAC address field, first resource IP address field, first timestamp field, first resource name field and first resource type field is added to the network resource table.

8. The method for dynamic management of network resources according to claim 2, wherein, The method further comprises: The monitoring end periodically traverses each first resource record of the network resource table; and in the traversal, the first resource record currently traversed is used as the corresponding current resource record; the first timestamp field of the current resource record is extracted as the corresponding first timestamp; the timestamp of the current system time is used as the corresponding second timestamp; the time interval of the first and second timestamps is calculated to obtain the corresponding first time interval; and when the first time interval exceeds the preset time interval threshold, the current resource record is removed from the network resource table.

9. An electronic device, comprising: Comprise: a memory, a processor and a transceiver; The processor is used to couple with the memory, read and execute the instructions in the memory to realize the method of any one of claims 1-8; The transceiver is coupled with the processor, and the transceiver is controlled by the processor to perform message transmission and reception.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, when the computer instructions are executed by the computer, the computer executes the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Network address resource visualization management system

    CN108769289A

  • Data monitoring method and device

    CN112995119A