Network segment information compliance report generation method, system, storage medium and device

By reading Excel files and using a professional library to parse and verify IP addresses and subnet information, a compliance report is generated, solving the problem of time-consuming and error-prone manual checks in network management, and achieving efficient and accurate network security checks.

CN119766654BActive Publication Date: 2025-11-04TRAVELSKY TECHNOLOGY LIMITED
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411885929.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-11-04
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

Existing technologies require manual checks of network configurations in network management, which are time-consuming and prone to errors. They are also difficult to adapt to diverse network environments, leading to security vulnerabilities.

Method used

The xlrd library is used to read Excel files, the ipaddress library is used to parse and verify IP addresses and subnet information, a compliance report is generated, and the xlwt library is used to mark information that does not conform to the specifications.

Benefits of technology

It achieves efficient and accurate compliance checks on IP addresses and subnet information, reduces the probability of missed and false alarms, promptly detects potential network security risks, and is suitable for diverse network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766654B_ABST
    Figure CN119766654B_ABST
Patent Text Reader

Abstract

The application provides a network segment information compliance report generation method, system, storage medium and device, and the method comprises the following steps: reading a worksheet file, traversing a to-be-inspected column of the worksheet, and extracting IP addresses and subnet information; analyzing and processing predefined network segment information in a text file, obtaining and saving a network segment information compliance range; verifying the IP addresses and the subnet information according to the network segment information compliance range, and generating a verification result; marking the verification result to the worksheet file, and generating and saving a network segment information compliance report. The application provides a network segment information compliance report generation method, and efficient IP address verification and network segment information compliance checking are realized by using professional libraries and technologies. Various conditions such as CIDR format subnets and IP address ranges can be processed, and the method is suitable for diversified network environments, and provides a customized network policy compliance checking solution for different organizations and enterprises.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of network security technology, and in particular relates to a method, system, storage medium and device for generating network segment information compliance reports. Background Technology

[0002] In traditional network management, administrators need to manually check network configuration files to ensure that each IP address or subnet complies with the organization's network policy. This process is not only time-consuming but also error-prone, especially when dealing with large amounts of data. Human negligence or misunderstanding can lead to security vulnerabilities, thereby exposing the entire network to risks.

[0003] While existing technologies have alleviated the burden of manually checking network configurations to some extent, they often require complex configuration and expertise, making them difficult for non-professionals to use. Furthermore, many tools are focused on specific types of network devices or protocols, lacking sufficient flexibility to handle diverse network environments. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a method for generating a network segment information compliance report, the method comprising:

[0005] Read the worksheet file, traverse the columns to be checked in the worksheet, and extract the IP address and subnet information;

[0006] Parse and process predefined network segment information in text files, and obtain and save the compliance range of network segment information;

[0007] Based on the compliance range of the network segment information, verify the IP address and subnet information, and generate a verification result;

[0008] Mark the verification results in a worksheet file, and generate and save a network segment information compliance report.

[0009] Furthermore, reading the worksheet file includes: using the xlrd library's open workbook function to read the worksheet file.

[0010] Furthermore, the parsing and processing of predefined network segment information in the text file includes:

[0011] Read the contents of a text file line by line, skipping blank lines;

[0012] The text file content is parsed according to the CIDR notation or IP address range.

[0013] Furthermore, the content of the text file is parsed, including:

[0014] When the text file content is a CIDR format subnet, the IPv4Networks class of the ipaddress library is used for parsing;

[0015] When the text file content is a specific range of IP addresses, the IPv4Address class and the summarize_address_range function are used for parsing.

[0016] Furthermore, the compliance scope of network segment information is obtained and saved, including storing the parsed text file content as the compliance scope of network segment information in the Offices Subnets list.

[0017] Furthermore, the verification of the IP address and subnet information includes: using the ipaddress library to verify the IP address or subnet information in the column to be checked in the worksheet;

[0018] When the column to be checked in the worksheet is an IP address, use the IPv4Address and summarize addressrange functions to verify it;

[0019] When the column to be checked in the worksheet is subnet information, use IPv4Network for verification.

[0020] Furthermore, the generation and saving of the network segment information compliance report includes:

[0021] Create a copy of the worksheet file;

[0022] Iterate through each cell in the worksheet file and, based on the verification results, mark any IP addresses and subnet information that do not conform to the predefined definitions;

[0023] Generate and save compliance reports.

[0024] A network segment information compliance report generation system, the system comprising: a file reading and parsing module, a predefined network segment information parsing module, an IP address and subnet information verification module, and a compliance report generation module;

[0025] The file reading and parsing module uses the open_workbook function of the xlrd library to open the worksheet file, and then iterates through the worksheet or the columns to be checked one by one;

[0026] The predefined network range parsing module is used to process predefined network segment information in text files;

[0027] The IP address and subnet information verification module uses the ipaddress library to verify each IP address or subnet in the column to be checked one by one.

[0028] The compliance report generation module uses the xlwt library to mark IP addresses and subnet information that do not comply with network policies in a worksheet file, and adds detailed explanations to the right of the cells to generate a compliance report.

[0029] A computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the steps described above.

[0030] An electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0031] Memory, used to store computer programs;

[0032] When a processor executes a program stored in memory, it implements any of the steps described above.

[0033] Compared with the prior art, the present invention has the following advantages:

[0034] 1. This invention proposes a method for generating network segment information compliance reports. By employing professional libraries and technologies, it achieves efficient IP address verification and network segment information compliance checks.

[0035] 2. It can handle various situations such as CIDR format subnets and IP address ranges, and is suitable for diverse network environments, providing customized network policy compliance inspection solutions for different organizations and enterprises.

[0036] 3. By marking non-compliant IP addresses and subnet information, potential network security risks can be identified in a timely manner; the use of professional databases and technologies ensures the accuracy of verification and reduces the probability of missed and false alarms; it has become an important auxiliary tool for network security management and effectively safeguards the overall security of the network.

[0037] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures pointed out in the description, claims and drawings. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 A flowchart illustrating a method for generating network segment information compliance reports is provided.

[0040] Figure 2 A schematic diagram of a network segment information compliance report generation system is shown. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] like Figure 1 As shown, a method for generating a network segment information compliance report includes the following steps:

[0043] S1. Read the worksheet (Excel) file, traverse the columns to be checked in each worksheet, and extract the IP address and subnet information.

[0044] S1.1 Use the xlrd library's open workbook function to read the worksheet (Excel) file, and then iterate through the worksheet and the columns to be inspected.

[0045] S1.2. Obtain the values ​​of the worksheet or the column to be inspected, and extract the IP address and subnet information.

[0046] S2. Parse and process predefined network segment information in a text file, and obtain and save the allowed range of network segment information.

[0047] S2.1 Read the text file content line by line, skipping blank lines.

[0048] S2.2. Parse the contents of the read text file according to the CIDR (Classless Inter-Domain Routing) notation or IP address range.

[0049] Alternatively, when the text file content is a CIDR format subnet, the IPv4Networks class of the ipaddress library can be used for parsing;

[0050] When the text file content is a specific range of IP addresses, the IPv4Address class and the summarize_address_range function are used for parsing.

[0051] S2.3 Store the parsed text file content as the network segment information compliance range in the officessubnets list.

[0052] S3. Verify the IP addresses and subnet information in the columns to be checked in the worksheet.

[0053] S3.1 Use the ipaddress library to verify each IP address or subnet information in the worksheet and the column to be checked one by one.

[0054] Alternatively, when the worksheet and the column to be checked contain IP addresses, the IPv4Address and summarizeaddress range functions can be used for verification.

[0055] When the worksheet and the column to be checked contain subnet information, use IPv4Network for verification.

[0056] S4. Based on the verification results, mark the IP addresses and subnet information that do not conform to the predefined network segment information in the worksheet (Excel) file, provide detailed explanations, and generate a compliance report worksheet (Excel) file.

[0057] S4.1 Create a copy of the worksheet to allow for modifications and to maintain data integrity and traceability.

[0058] S4.2. Traverse each cell and mark any IP addresses and subnet information that do not conform to the predefined rules.

[0059] S4.3 Generate and save a worksheet (Excel) file containing the compliance report.

[0060] like Figure 2 The aforementioned network segment information compliance report generation system includes: a file reading and parsing module, a predefined network segment information parsing module, an IP address and subnet information verification module, and a compliance report generation module.

[0061] The file reading and parsing module uses the open_workbook function of the xlrd library to open a worksheet (Excel) file, and then iterates through the worksheet or the columns to be inspected one by one.

[0062] The predefined network range resolution module is used to process predefined network segment information in text files.

[0063] The IP address and subnet information verification module uses the ipaddress library to verify each IP address or subnet in the column to be checked one by one.

[0064] The compliance report generation module uses the xlwt library to mark IP addresses and subnet information that do not comply with network policies in a worksheet (Excel) file, and adds detailed explanations to the right of the cells to generate a compliance report.

[0065] Based on the above disclosure, the present invention also provides an electronic device. The electronic device of this embodiment includes at least one processor and at least one storage medium electrically connected to the processor. The storage medium is electrically connected to the processor, wherein the storage medium stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.

[0066] Based on the same inventive concept, the present invention also provides a storage medium storing instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described above.

[0067] The foregoing description and accompanying drawings fully illustrate embodiments of the invention to enable those skilled in the art to practice them. Other embodiments may include structural and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Some portions and features of some embodiments may be included or substituted for portions and features of other embodiments. Embodiments of the invention are not limited to the structures described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from their scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for generating a network segment information compliance report, characterized in that, The method includes, Read the worksheet file, iterate through the columns to be checked in the worksheet, and extract the IP addresses and subnet information; Parse and process predefined network segment information in text files, and obtain and save the compliance range of network segment information; Based on the compliance range of the network segment information, verify the IP address and subnet information, and generate a verification result; Mark the verification results in a worksheet file, generate and save a network segment information compliance report; The verification of the IP address and subnet information includes: using the ipaddress library to verify the IP address or subnet information in the column to be checked in the worksheet; When the column to be checked in the worksheet is an IP address, use the IPv4Address and summarize address range functions to verify it; When the column to be checked in the worksheet is subnet information, use IPv4Network for verification.

2. The method for generating a network segment information compliance report according to claim 1, characterized in that, The reading of the worksheet file includes: using the xlrd library's open workbook function to read the worksheet file.

3. The method for generating a network segment information compliance report according to claim 1, characterized in that, The parsing and processing of predefined network segment information in the text file includes: Read the contents of a text file line by line, skipping blank lines; The text file content is parsed according to CIDR notation or IP address range.

4. The method for generating a network segment information compliance report according to claim 3, characterized in that, Parsing the content of the text file includes: When the text file content is a CIDR format subnet, the IPv4Networks class of the ipaddress library is used for parsing; When the text file content is a specific range of IP addresses, the IPv4Address class and the summarize_address_range function are used for parsing.

5. The method for generating a network segment information compliance report according to claim 3, characterized in that, Obtain and save the compliance range of network segment information, including storing the parsed text file content as the compliance range of network segment information in the officessubnets list.

6. The method for generating a network segment information compliance report according to claim 1, characterized in that, The generation and storage of the network segment information compliance report includes: Create a copy of the worksheet file; Iterate through each cell in the worksheet file and, based on the verification results, mark any IP addresses and subnet information that do not conform to the predefined definitions; Generate and save compliance reports.

7. A network segment information compliance report generation system, characterized in that, The system includes: a file reading and parsing module, a predefined network segment information parsing module, an IP address and subnet information verification module, and a compliance report generation module; The file reading and parsing module uses the open_workbook function of the xlrd library to open the worksheet file, and then iterates through the worksheet or the columns to be checked one by one; The predefined network range parsing module is used to process predefined network segment information in text files; The IP address and subnet information verification module uses the ipaddress library to verify each IP address or subnet in the column to be checked; specifically, the ipaddress library is used to verify the IP address or subnet information in the column to be checked in the worksheet. When the column to be checked in the worksheet is an IP address, use the IPv4Address and summarize address range functions to verify it; When the column to be checked in the worksheet is subnet information, use IPv4Network for verification; The compliance report generation module uses the xlwt library to mark IP addresses and subnet information that do not comply with network policies in a worksheet file, and adds detailed explanations to the right of the cells to generate a compliance report.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-6.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Inter-security-domain firewall security policy compliance baseline management method and inter-security-domain firewall security policy compliance baseline management device

    CN112351014A

  • Network segmentation

    US20150236935A1