CN114185921A - Method, device, equipment and storage medium for allocating IP to equipment in batches - Google Patents
Method, device, equipment and storage medium for allocating IP to equipment in batches Download PDFInfo
- Publication number
- CN114185921A CN114185921A CN202111436050.0A CN202111436050A CN114185921A CN 114185921 A CN114185921 A CN 114185921A CN 202111436050 A CN202111436050 A CN 202111436050A CN 114185921 A CN114185921 A CN 114185921A
- Authority
- CN
- China
- Prior art keywords
- html page
- information
- floor
- department
- name
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2425—Iterative querying; Query formulation based on the results of a preceding query
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2428—Query predicate definition using graphical user interfaces, including menus and forms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/248—Presentation of query results
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Human Computer Interaction (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method, a device, equipment and a storage medium for allocating IP to equipment in batches, wherein the method comprises the following steps: creating a personnel information table, a department floor table and an IP information table; creating an html page table, wherein the html page table comprises two columns of a name and a mac address; filling in names and corresponding mac addresses line by line on the html page; running a python program in the background, wherein the python program is used for searching the personnel information table according to the name to acquire department information; according to departments, searching a department floor table to obtain floor information; according to the floor, searching an IP information table, and sequentially designating idle IPs; displaying the IP distribution result to an html page; the invention has the advantages that: many equipment can be bound at every turn, and do not need the manual work to look over personnel department's floor, and efficiency promotes greatly, and the time that consumes obviously reduces.
Description
Technical Field
The invention relates to the field of IP address allocation, in particular to a method for allocating IP to equipment in batches.
Background
Company equipment is networked, binding of IP and mac addresses is required, each equipment has a fixed IP, and network segments of each floor are different. Logging in a DHCP server through a remote desktop, opening Windows PowerShell, adding users by using commands, and adding reserved IP of mac addresses on the DHCP server and the scope. For convenience, a binding command for one device may be generated by sequentially inputting a name, a Mac address, a floor, and a bound IP using HTML technology, as shown in fig. 1. But the people need to check the floors by themselves and only one device can be bound at each time, so that the efficiency is too low and the time is consumed.
Chinese patent publication No. CN105208142A discloses a method for automatically allocating operation and maintenance IP addresses of power grid information assets, comprising the following steps: 1) a maintenance link, namely maintaining and inputting the IP address using position information and the basic information of the switch into a database; 2) a request link, which sends an IP address allocation request; 3) a processing link, receiving an IP address allocation request; 4) and in the distribution link, the automatic distribution of the IP address of the asset equipment is realized. The invention solves the problem that network management personnel are difficult to distribute the IP address of the power grid information asset equipment, and in the process of operation and maintenance of the power grid information asset, Telnet login is simulated to the switch, and the ARP command is used for inquiring, adding, deleting and other operations on the corresponding relation between the IP address and the MAC address in the switch, so that the automatic distribution of the IP address of the asset equipment is realized, and the workload of the network management personnel is reduced. The method provided by the patent application can only bind one device each time, the efficiency is too low, and a lot of time is consumed.
Disclosure of Invention
The invention aims to solve the technical problems that only one device can be bound each time, the floor where a personnel department is located needs to be checked, the efficiency is too low, and a large amount of time is consumed in the method for allocating the IP to the devices in the prior art.
The invention solves the technical problems through the following technical means: a method of bulk allocating IPs to devices, the method comprising the steps of:
the method comprises the following steps: creating a personnel information table, a department floor table and an IP information table;
step two: creating an html page table, wherein the html page table comprises two columns of a name and a mac address;
step three: filling in names and corresponding mac addresses line by line on the html page;
step four: running a python program in the background, wherein the python program is used for searching the personnel information table according to the name to acquire department information; according to the department information, searching a department floor table to obtain floor information; according to the floor information, searching an IP information table, and sequentially designating idle IPs;
step five: and displaying the IP distribution result to an html page.
The method fills in names and corresponding mac addresses on an html page line by line, executes a python program, and searches a personnel information table to acquire department information according to the names; according to department information, searching a department floor table to acquire floor information; according to the floor information, an IP information table is searched, idle IPs are designated in sequence, a front-end html is used for operating a python program, the effect of batch quick creation is achieved, multiple devices can be bound each time, the floor where a personnel department is located does not need to be checked manually, the efficiency is greatly improved, and the consumed time is obviously reduced.
Furthermore, a new line of buttons is arranged on the html page, the new line of buttons is clicked, and a new line is added to the html page form.
Furthermore, a completion button is arranged on the html page, the completion button is clicked, and the name and Mac address data in the html page are obtained and stored in the Excel file.
Furthermore, an operation button is arranged on the html page, the operation button is clicked, and the python program is operated in the background.
Further, a result display button is arranged on the html page, the result display button is clicked, and the IP distribution result is displayed on the html page.
Further, the python program is also used for generating a device binding command according to the name, the Mac address, the floor and the IP, and storing the command in the txt file.
The invention also provides a device for distributing IP to equipment in batches, which comprises:
the table creating module is used for creating a personnel information table, a department floor table and an IP information table;
the html page creating module is used for creating an html page table, and the html page table comprises two columns of a name and a mac address;
the data adding module is used for filling names and corresponding mac addresses on the html page line by line;
the IP distribution module is used for running a python program in the background, and the python program is used for searching the personnel information table according to the name to acquire department information; according to the department information, searching a department floor table to obtain floor information; according to the floor information, searching an IP information table, and sequentially designating idle IPs;
and the result display module is used for displaying the IP distribution result to the html page.
Furthermore, a new line of buttons is arranged on the html page, the new line of buttons is clicked, and a new line is added to the html page form.
Furthermore, a completion button is arranged on the html page, the completion button is clicked, and the name and Mac address data in the html page are obtained and stored in the Excel file.
Furthermore, an operation button is arranged on the html page, the operation button is clicked, and the python program is operated in the background.
Further, a result display button is arranged on the html page, the result display button is clicked, and the IP distribution result is displayed on the html page.
Further, the python program is also used for generating a device binding command according to the name, the Mac address, the floor and the IP, and storing the command in the txt file.
The invention also provides an electronic device comprising a processor and a memory, wherein the memory stores computer program instructions capable of being executed by the processor, and the processor implements the above method steps when executing the computer program instructions.
The present invention also provides a computer readable storage medium storing computer program instructions which, when invoked and executed by a processor, implement the above-described method steps.
The invention has the advantages that: the method fills in names and corresponding mac addresses on an html page line by line, executes a python program, and searches a personnel information table to acquire department information according to the names; according to departments, searching a department floor table to obtain floor information; according to the floors, the IP information table is searched, idle IPs are designated in sequence, a front-end html is used for operating a python program, the effect of batch quick creation is achieved, multiple devices can be bound at each time, the floors where personnel departments are located do not need to be checked manually, the efficiency is greatly improved, and the consumed time is obviously reduced.
Drawings
FIG. 1 is a flow chart of a method of assigning IP to devices as disclosed in the prior art;
fig. 2 is a flowchart of a method for allocating IP to devices in bulk according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
As shown in fig. 2, a method for allocating IP to devices in bulk, the method comprising the steps of:
s1: and a personnel information table, a department floor table and an IP information table are created, wherein the personnel information table is shown in a table 1, the department floor table is shown in a table 2, and the IP information table is shown in a table 3.
TABLE 1 personal information Table
Name (I) | Department of department |
All coming from king | Delivery unit |
Li Jinke | Personnel department |
Odysai (Odyssey) | President office |
Fu Lansi | Personnel department |
King of small | Delivery unit |
Plum | Delivery unit |
TABLE 2 floor table of department
Department of department | Floor level |
President office | 5 |
Finance department | 3 |
Delivery unit | 2 |
Personnel department | 4 |
TABLE 3IP INFORMATION TABLE
IP | MAC | Name (I) |
10.88.1.21 | asdsddoejvnd | All coming from king |
10.88.1.22 | sdllkjlluehd | Li Jinke |
10.88.1.23 | acnxasxcsdcx | Odysai (Odyssey) |
10.88.1.24 | aaccabffkd11 | Fu Lansi |
10.88.1.25 | ||
10.88.1.26 | ||
10.88.1.27 |
S2: creating an html page form, wherein the html page form comprises two columns of a name and a mac address, setting a new row of buttons (realized by a button adding function) on the html page, clicking the new row of buttons, and adding a new row of buttons on the html page form.
S3: filling in names and corresponding mac addresses line by line on the html page; and the html page is also provided with a completion button, the completion button is clicked, the name and Mac address data in the html page are obtained, and the name and Mac address data are stored in an Excel file. And an operation button is further arranged on the html page, the operation button is clicked, and the python program is operated in the background. The html page content is shown in table 4, and the Excel file content is shown in table 5.
TABLE 4html Page content
TABLE 5 Excel File Contents
MAC | Name (I) |
11acbacf00dc | King of small |
cf00dcacb1ca | Plum |
S4: after the html page is filled with the content, clicking a completion button, then clicking an operation button, and operating a python program in a background, wherein the python program is used for searching a personnel information table according to the name to acquire department information; according to department information, searching a department floor table to acquire floor information; according to the floor information, searching an IP information table, and sequentially designating idle IPs; and generating a device binding command according to the name, the Mac address, the floor information and the IP, and storing the device binding command in the txt file. Specifically, the method comprises the following steps: clicking the run button, defining a function execCommand in the script tag, transmitting a parameter param and calling ActiveObject. The click event of the button "run" is added, the execute command method is called, and the onclick is "execute command (python irresult.
S5: and setting a result display button on the html page, clicking the result display button, and displaying the IP distribution result to the html page. The display results on the html page are shown in table 6.
TABLE 6 display results on html page
Through the technical scheme, the name and the corresponding mac address are filled in the html page line by line, the python program is executed, and the personnel information table is searched according to the name to obtain the department information; according to departments, searching a department floor table to obtain floor information; according to the floors, the IP information table is searched, idle IPs are designated in sequence, a front-end html is used for operating a python program, the effect of batch quick creation is achieved, multiple devices can be bound at each time, the floors where personnel departments are located do not need to be checked manually, the efficiency is greatly improved, and the consumed time is obviously reduced.
Example 2
Based on embodiment 1, embodiment 2 of the present invention further provides a device for allocating IP to devices in batches, where the device includes:
the table creating module is used for creating a personnel information table, a department floor table and an IP information table;
the html page creating module is used for creating an html page table, and the html page table comprises two columns of a name and a mac address;
the data adding module is used for filling names and corresponding mac addresses on the html page line by line;
the IP distribution module is used for running a python program in the background, and the python program is used for searching the personnel information table according to the name to acquire department information; according to department information, searching a department floor table to acquire floor information; according to the floor information, searching an IP information table, and sequentially designating idle IPs;
and the result display module is used for displaying the IP distribution result to the html page.
Specifically, a new line of buttons is arranged on the html page, the new line of buttons is clicked, and a new line is added to the html page form.
Specifically, a completion button is arranged on the html page, the completion button is clicked, and the name and Mac address data in the html page are obtained and stored in the Excel file.
Specifically, an operation button is arranged on the html page, the operation button is clicked, and the python program is operated in the background.
Specifically, a display result button is arranged on the html page, the display result button is clicked, and the IP distribution result is displayed on the html page.
Specifically, the python program is further used for generating a device binding command according to the name, the Mac address, the floor and the IP and storing the device binding command in the txt file.
Example 3
Based on embodiment 1, embodiment 3 of the present invention further provides an electronic device, which includes a processor and a memory, where the memory stores computer program instructions capable of being executed by the processor, and the processor executes the computer program instructions to implement the method steps described in embodiment 1.
Example 4
Based on embodiment 1, embodiment 4 of the present invention further provides a computer-readable storage medium, which stores computer program instructions, and the computer program instructions, when called and executed by a processor, implement the method steps described in embodiment 1.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A method for allocating IP to equipment in batches is characterized by comprising the following steps:
the method comprises the following steps: creating a personnel information table, a department floor table and an IP information table;
step two: creating an html page table, wherein the html page table comprises two columns of a name and a mac address;
step three: filling in names and corresponding mac addresses line by line on the html page;
step four: running a python program in the background, wherein the python program is used for searching the personnel information table according to the name to acquire department information; according to department information, searching a department floor table to acquire floor information; according to the floor information, searching an IP information table, and sequentially designating idle IPs;
step five: and displaying the IP distribution result to an html page.
2. The method as claimed in claim 1, wherein a new line of buttons is set on the html page, and when the new line of buttons is clicked, a new line is added to the html page table.
3. The method for allocating the IP to the equipment in batches as claimed in claim 1, wherein a completion button is arranged on the html page, and the completion button is clicked to acquire name and Mac address data in the html page and store the name and Mac address data in an Excel file.
4. The method for allocating the IP to the equipment in batches as claimed in claim 1, wherein a running button is arranged on the html page, the running button is clicked, and a python program runs in a background.
5. The method for allocating the IP to the equipment in batches as claimed in claim 1, wherein a display result button is arranged on the html page, the display result button is clicked, and the IP allocation result is displayed on the html page.
6. The method of claim 1, wherein the python program is further configured to generate a device bind command from name, Mac address, floor, IP, saved in the txt file.
7. An apparatus for allocating IPs to devices in batches, the apparatus comprising:
the table creating module is used for creating a personnel information table, a department floor table and an IP information table;
the html page creating module is used for creating an html page table, and the html page table comprises two columns of a name and a mac address;
the data adding module is used for filling names and corresponding mac addresses on the html page line by line;
the IP distribution module is used for running a python program in the background, and the python program is used for searching the personnel information table according to the name to acquire department information; according to department information, searching a department floor table to acquire floor information; according to the floor information, searching an IP information table, and sequentially designating idle IPs;
and the result display module is used for displaying the IP distribution result to the html page.
8. The apparatus of claim 7, wherein a new row of buttons is set on the html page, and when the new row of buttons is clicked, a new row is added to the html page table.
9. An electronic device comprising a processor and a memory, the memory storing computer program instructions executable by the processor, the processor implementing the method steps of any of claims 1-6 when executing the computer program instructions.
10. A computer-readable storage medium, characterized in that computer program instructions are stored which, when called and executed by a processor, implement the method steps of any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111436050.0A CN114185921A (en) | 2021-11-29 | 2021-11-29 | Method, device, equipment and storage medium for allocating IP to equipment in batches |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111436050.0A CN114185921A (en) | 2021-11-29 | 2021-11-29 | Method, device, equipment and storage medium for allocating IP to equipment in batches |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114185921A true CN114185921A (en) | 2022-03-15 |
Family
ID=80541730
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111436050.0A Pending CN114185921A (en) | 2021-11-29 | 2021-11-29 | Method, device, equipment and storage medium for allocating IP to equipment in batches |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114185921A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116320178A (en) * | 2023-05-17 | 2023-06-23 | 广东保伦电子股份有限公司 | Batch terminal binding configuration method under multi-level |
-
2021
- 2021-11-29 CN CN202111436050.0A patent/CN114185921A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116320178A (en) * | 2023-05-17 | 2023-06-23 | 广东保伦电子股份有限公司 | Batch terminal binding configuration method under multi-level |
CN116320178B (en) * | 2023-05-17 | 2023-09-05 | 广东保伦电子股份有限公司 | Batch terminal binding configuration method under multi-level |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106254471A (en) | Resource United Dispatching method and system under a kind of isomery cloud environment | |
CN110716796A (en) | Intelligent task scheduling method and device, storage medium and electronic equipment | |
CN103092599A (en) | Software develop kit | |
CN106713042A (en) | Method and device for determination of network topology | |
CN114185921A (en) | Method, device, equipment and storage medium for allocating IP to equipment in batches | |
CN104104716B (en) | Virtual desktop system and its method based on cloud computing | |
CN112988381A (en) | Method and device for generating optimization information for cloud resources and electronic equipment | |
WO2019024235A1 (en) | Electronic device, server allocation control method and computer readable storage medium | |
WO2019071958A1 (en) | Cloud computing-based salary calculation method, application server, and computer readable storage medium | |
CN108112268A (en) | Management and the relevant load balancer of automatic expanded set | |
CN114553691A (en) | Method, device and equipment for creating network configuration template and network configuration | |
CN111415062A (en) | Crowdsourcing task allocation method and device, electronic equipment and storage medium | |
CN106843971A (en) | BIOS method for refreshing, server, BMC, medium and storage control | |
DE112021003499T5 (en) | SCALABLE OPERATORS FOR AUTOMATED WORKLOAD MANAGEMENT IN HYBRID CLOUD ENVIRONMENTS | |
CN113537909A (en) | Equipment asset management method and device | |
US20220342716A1 (en) | Tenant management system capable of operating tenant specific applications appropriately | |
CN115794804A (en) | Engineering internal control data visualization processing system and method based on big data technology | |
CN112991505B (en) | Online 3D rendering method | |
CN115577958A (en) | Risk processing method, device, equipment and storage medium | |
CN115171828A (en) | Questionnaire survey method, questionnaire survey device, electronic equipment and storage medium | |
CN109241168B (en) | Processing method, device and equipment for technical standard data of power grid and storage medium | |
CN113703895A (en) | Carousel method, system, device, equipment and storage medium for billboard | |
CN112035773A (en) | Data processing method and server side equipment | |
CN113220282B (en) | Development processing method, device and storage medium for applet | |
CN109582680A (en) | Method for processing business, electronic device and readable storage medium storing program for executing based on new product development |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |