Service operation and maintenance method and device, server and readable storage medium
By using API to receive and map scripts to automatically execute service events in the operation and maintenance of DHCP services, the operation and maintenance reliability problems caused by manual input of commands are solved, and more efficient and reliable operation and maintenance services are achieved.
Patent Information
- Application Number
- CN202311640931.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2025-05-30
AI Technical Summary
In the park network, the operation and maintenance of DHCP services requires manual input of a large number of commands, resulting in poor reliability of operation and maintenance services.
The service event data from the second server is received through the first API, and the service event is automatically executed based on the API mapping script, reducing the need for manual input of commands.
Improve the reliability of operation and maintenance services, reduce the possibility of manual errors, and promptly feedback response information.
Smart Images

Figure CN120075197A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of communication technologies, and in particular, to a service operation and maintenance method, apparatus, server, and readable storage medium. Background Art
[0002] Currently, in a campus network, a network administrator can perform operation and maintenance on the DHCP service by manually entering commands through the Internet Systems Consortium Dynamic Host Configuration Protocol (ISC-DHCP) software installed on a Linux server.
[0003] However, according to the above method, since a large number of commands need to be manually entered each time the DHCP service is operated and maintained, and once an incorrect command is entered, the DHCP service will be abnormal, the reliability of the operation and maintenance service is poor. Summary of the Invention
[0004] Embodiments of the present application provide a service operation and maintenance method, server, and readable storage medium to solve the problem of poor reliability of the operation and maintenance service.
[0005] To achieve the above object, embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect of embodiments of the present application, a service operation and maintenance method is provided, which is applied to a first server. The method includes:
[0007] Receiving, through a first Application Programming Interface (API), first data corresponding to a first service event from a second server, where the first API is an API corresponding to the first service event;
[0008] Executing the first service event based on a first script mapped by the first API;
[0009] Sending response information of the first service event to the second server.
[0010] For the service operation and maintenance method provided by embodiments of the present application, since the first server can receive data corresponding to the first service event from the second server through the first API and automatically execute the first service event based on the script mapped by the first API interface, without the need for a network administrator to manually enter a large number of commands, and can timely feedback the response information of the first service event to the second server, the reliability of the operation and maintenance service can be improved.
[0011] In combination with the first aspect, in a possible implementation manner, executing the first service event based on the first script mapped by the first API includes:
[0012] Transmitting the first data received through the first API to the first script;
[0013] Executing the first script.
[0014] In combination with the first aspect and the above possible implementation manner, in another possible implementation manner, the first server includes at least one API corresponding one-to-one to at least one service event, and the at least one API includes the first API;
[0015] Before receiving, through the first API, the first data corresponding to the first service event from the second server, the method further includes:
[0016] Creating a one-to-one mapping relationship between the at least one API and at least one script.
[0017] In combination with the first aspect and the above possible implementation manner, in another possible implementation manner, creating the one-to-one mapping relationship between the at least one API and at least one script includes:
[0018] Mapping the interface parameters of each API in the at least one API to a script.
[0019] A second aspect of the embodiments of the present application provides another service operation and maintenance method, which is applied to a second server. The method includes:
[0020] Generating, based on the information corresponding to the first service event input in the first interface, the first data corresponding to the first service event, where the first interface is used for operating and maintaining the service event corresponding to the first server, and the first data is used for the first server to execute the first service event;
[0021] Sending the first data to the first server;
[0022] When receiving the response information of the first service event sent by the first server, displaying the response information in the first interface.
[0023] The service operation and maintenance method provided by the embodiments of this application can improve the reliability of operation and maintenance services. Since only by inputting the information corresponding to the first service event in the first interface for operating and maintaining the service events corresponding to the first server, the data corresponding to the first service event can be automatically generated and sent to the first server to achieve the operation and maintenance of the first service event, without the need to manually input a large number of commands, and the response information of the first service event can be displayed on the first interface, so that the network administrator can view the operation and maintenance status information of the service event in a timely manner.
[0024] In combination with the second aspect, in a possible implementation manner, the sending the first data to the first server includes:
[0025] Sending the first data to the first API of the first server;
[0026] Wherein, the first API is the API corresponding to the first service event.
[0027] In combination with the second aspect and the above possible implementation manner, in another possible implementation manner, the first service event includes at least one of the following:
[0028] Configuring the DHCP address pool;
[0029] Viewing the DHCP address pool;
[0030] Configuring the DHCP primary and standby;
[0031] Binding the Dynamic Host Configuration Protocol Media Access Control (DHCP MAC) address and the Dynamic Host Configuration Protocol Internet Protocol (DHCP IP) address;
[0032] Unbinding the DHCP MAC address and the DHCP IP address;
[0033] Viewing the allocation information of the DHCP IP address;
[0034] Viewing the DHCP log;
[0035] Viewing the DHCP service status;
[0036] Restarting the DHCP service.
[0037] In combination with the second aspect and the above possible implementation manner, in another possible implementation manner, in the case of receiving the response information of the first service event sent by the first server, before displaying the response information on the first interface, the method further includes:
[0038] Store the response information in the database of the second server.
[0039] Combined with the second aspect and the above possible implementation manners, in another possible implementation manner, the method further includes:
[0040] Periodically collect second information from the first server;
[0041] Wherein, the second information includes: DHCP service status, DHCP logs, and DHCP lease information.
[0042] In a third aspect of the embodiments of the present application, a service operation and maintenance device is provided. The device includes a receiving module, an execution module, and a first sending module;
[0043] The receiving module is configured to receive, through a first API, first data corresponding to a first service event from a second server, where the first API is the API corresponding to the first service event;
[0044] The execution module is configured to execute the first service event based on a first script mapped by the first API;
[0045] The first sending module is configured to send response information of the first service event to the second server.
[0046] Specific implementation manners may refer to the behavior functions of the first server in the service operation and maintenance method provided in the first aspect or the possible implementation manners of the first aspect.
[0047] In a fourth aspect of the embodiments of the present application, another service operation and maintenance device is provided. The device includes a generation module, a second sending module, and a display module;
[0048] The generation module is configured to generate first data corresponding to the first service event based on information corresponding to the first service event input in a first interface, where the first interface is used to operate and maintain service events corresponding to a first server, and the first data is used for the first server to execute the first service event;
[0049] The second sending module is configured to send the first data to the first server;
[0050] The display module is configured to display the response information in the first interface when receiving the response information of the first service event sent by the first server.
[0051] Specific implementation manners may refer to the behavior functions of the second server in the service operation and maintenance method provided in the second aspect or the possible implementation manners of the second aspect.
[0052] In the fifth aspect of the embodiments of the present application, a server is provided, including a processor and a memory. The memory stores programs or instructions that can run on the processor. When the programs or instructions are executed by the processor, the steps of the service operation and maintenance method described in the first aspect and its possible implementation manners of the first aspect are implemented, or the steps of the service operation and maintenance method described in the second aspect and its possible implementation manners of the second aspect are implemented.
[0053] In the sixth aspect of the embodiments of the present application, a readable storage medium is provided. Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by a processor, the steps of the service operation and maintenance method described in the first aspect and its possible implementation manners of the first aspect are implemented, or the steps of the service operation and maintenance method described in the second aspect and its possible implementation manners of the second aspect are implemented. Description of the Drawings
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0055] Figure 1 It is a flowchart of a service operation and maintenance method provided by the embodiments of the present application;
[0056] Figure 2 It is a flowchart of another service operation and maintenance method provided by the embodiments of the present application;
[0057] Figure 3 It is a schematic diagram of the first interface in a service operation and maintenance method provided by the embodiments of the present application;
[0058] Figure 4 It is a schematic diagram of the first server and the second server in a service operation and maintenance method provided by the embodiments of the present application;
[0059] Figure 5 It is a schematic diagram of the composition of a service operation and maintenance device provided by the embodiments of the present application;
[0060] Figure 6 It is a schematic diagram of the composition of another service operation and maintenance device provided by the embodiments of the present application;
[0061] Figure 7 It is a schematic diagram of the composition of a server provided by the embodiments of the present application. Detailed Embodiments
[0062] Next, in combination with the accompanying drawings in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present application.
[0063] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same category, and do not limit the number of objects. For example, the first object can be one or multiple.
[0064] In addition, the term "and / or" in this article is only a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0065] The terms "at least one (item)", "at least one of", etc. in the specification and claims of the present application refer to any one, any two or more combinations of the objects they contain. For example, at least one (item) of a, b, and c can represent: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".
[0066] Next, the implementation manners of the embodiments of the present application will be described in detail in combination with the accompanying drawings.
[0067] In the context of the digital transformation, the scale of terminals in the campus network has been increasing day by day, posing higher requirements for the service experience and operation and maintenance management of terminal network access.
[0068] Currently, in the campus network, network administrators can perform operation and maintenance on the DHCP service by manually entering commands through the ISC-DHCP software installed on the Linux server.
[0069] However, according to the above method, since a large number of commands need to be manually entered each time for the operation and maintenance of the DHCP service, and once an incorrect command is entered, the DHCP service will be abnormal, resulting in poor reliability of the operation and maintenance service.
[0070] To solve the above technical problems, embodiments of the present application provide a service operation and maintenance method, a server, and a readable storage medium. The service operation and maintenance method provided by the embodiments of the present application may have an execution entity such as a service operation and maintenance device, a server, or a functional module in the server, etc.
[0071] Figure 1 The flowchart of a service operation and maintenance method provided by an embodiment of the present application is shown. The service operation and maintenance method provided by the embodiment of the present application is applied to a first server; as Figure 1 shown, the service operation and maintenance method provided by the embodiment of the present application may include the following steps 101 to 103.
[0072] Step 101, the first server receives first data corresponding to a first service event from a second server through a first API.
[0073] Wherein, the above first API is the API corresponding to the above first service event.
[0074] In a possible implementation manner, the above first server may include multiple APIs, each API may correspond to a service event, and the service events corresponding to any two APIs are different.
[0075] It should be noted that an API is code provided by an operating system or a program library for an application program to call. Its main purpose is to enable application developers to call a set of routine functions without having to consider the underlying source code or understand the details of its internal working mechanism. The API itself is abstract, and it only defines an interface without involving the specific operations in the actual implementation process of the application program.
[0076] In a possible implementation manner, the above first service event may include at least one of the following 1.1 to 1.9:
[0077] 1.1, Configure the DHCP address pool;
[0078] 1.2, View the DHCP address pool;
[0079] 1.3, Configure the DHCP primary and standby;
[0080] 1.4, Bind the DHCP MAC address and the DHCP IP address;
[0081] 1.5, Unbind the DHCP MAC address and the DHCP IP address;
[0082] 1.6, View the allocation information of the DHCP IP address;
[0083] 1.7, View the DHCP log;
[0084] 1.8. View the DHCP service status;
[0085] 1.9. Restart the DHCP service.
[0086] For the specific descriptions of the above 1.1 to 1.9, reference can be made to the relevant descriptions in the related art. To avoid repetition, they are not elaborated here.
[0087] It should be noted that the embodiments of the present application only illustrate the above first service event including at least one of the above 1.1 to 1.9. In actual implementation, the first service event can also be any other possible service event, which is not limited in the embodiments of the present application.
[0088] In a possible implementation manner, the above first data can be the data obtained after the second server performs operations such as data calculation, logical processing, and parameter encapsulation on the information corresponding to the above first service event input.
[0089] In a possible implementation manner, the above first server can be a DHCP server, and the DHCP server can include a primary DHCP server and a standby DHCP server.
[0090] In a possible implementation manner, the above second server can be a Software Defined Network (SDN) server, that is, a server deployed with an SDN controller.
[0091] Step 102. The first server executes the first service event based on the first script mapped by the first API.
[0092] In a possible implementation manner, each API in the above first server can map a script, and the scripts mapped by any two APIs are different.
[0093] In a possible implementation manner, the above first script can be a programmable shell script.
[0094] In a possible implementation manner, each of the above APIs can correspond to a unique service event and can map a unique script. Therefore, there is a one-to-one correspondence between the service event, the API, and the script.
[0095] For example, service event 1 corresponds to API1, and API1 maps script 1; service event 2 corresponds to API2, and API2 maps script 2; service event 3 corresponds to API3, and API3 maps script 3, etc.
[0096] The specific method for creating a one-to-one correspondence among service events, APIs, and scripts will be described in detail in the following embodiments. To avoid repetition, it will not be elaborated here.
[0097] In a possible implementation manner, step 102 above can be specifically implemented through the following steps 102a and 102b.
[0098] Step 102a: The first server transmits the first data received through the first API to the first script.
[0099] In a possible implementation manner, there is a mapping relationship between the first API and the first script above. The first data received through the first API can be directly transmitted to the first script mapped by the first API.
[0100] Step 102b: The first server executes the first script.
[0101] In a possible implementation manner, the first data is included in the first script above. Thus, the first server can execute the first script to make the first service event take effect on the first server.
[0102] In the embodiment of the present application, since the first data received through the first API above can be directly transmitted to the first script and the first service event is executed by executing the first script, the first service event can be automatically executed on the first server above, thereby simplifying the process of operating and maintaining service events.
[0103] Step 103: The first server sends response information of the first service event to the second server.
[0104] In a possible implementation manner, the response information above can be used to indicate the processing result of the first server for the first service event.
[0105] In the service operation and maintenance method provided by the embodiment of the present application, since the first server can receive the data corresponding to the first service event from the second server through the first API and automatically execute the first service event based on the script mapped by the first API interface, without the need for network administrators to manually input a large number of commands, and can timely feedback the response information of the first service event to the second server, the reliability of the operation and maintenance service can be improved.
[0106] Next, the specific method for creating a one-to-one correspondence among service events, APIs, and scripts will be described in detail.
[0107] In a possible implementation, the above first server may include at least one API corresponding one-to-one to at least one service event, and the at least one API includes the above first API. Exemplarily, before the above step 101, the service operation and maintenance method provided by the embodiments of the present application may further include the following step 104.
[0108] Step 104: The first server creates a one-to-one mapping relationship between at least one API and at least one script.
[0109] In a possible implementation, the above step 104 may be specifically implemented by the following step 104a.
[0110] Step 104a: The first server maps the interface parameters of each API in at least one API to a script.
[0111] For example, assume that the at least one service event corresponding one-to-one to the at least one API includes: configuring an IPV4 address pool, deleting an IPV4 address pool, binding an IPV4 MAC and IP, unbinding an IPV4 MAC and IP, configuring DHCP master and standby, configuring an IPV6 address pool, deleting an IPV6 address pool, binding an IPV6 MAC and IP, and unbinding an IPV6 MAC and IP; then the mapping process of the at least one service event, the at least one API, and at least one script is as follows:
[0112] Configuring an IPV4 address pool: Map the parameters subnetIp (i.e., subnet IP), netmask (i.e., subnet mask), rangeStart (i.e., the parameter Start of the range function, used to indicate the start value of the sequence), rangeEnd (i.e., the parameter Start of the range function, used to indicate the end value of the sequence), routersIp (i.e., router session initial protocol), maxLeaseTime (i.e., maximum lease event), primaryDns (i.e., primary domain name system), and backUpDns (i.e., backup domain name system) of the interface (i.e., API) http: / / ip:port / v4AddSubnet to the programmable shell script v4_config_add_subnet.sh;
[0113] Deleting an IPV4 address pool: Map the parameters subnetIp, netmask, rangeStart, rangeEnd, routersIp, maxLeaseTime, primaryDns, and backUpDns of the interface http: / / ip:port / v4DeleteSubnet to the programmable shell script
[0114] v4_config_delete_subnet.sh;
[0115] Bind IPV4 MAC and IP: Map the interface http: / / ip:port / v4MacIpBind parameters hostName (i.e., the hostname), mac, and ip to the programmable shell script config_add_macIp.sh;
[0116] Unbind IPV4 MAC and IP: Map the interface http: / / ip:port / v4MacIpReBind parameters hostName, mac, and ip to the programmable shell script config_delete_macIp.sh;
[0117] Configure DHCP primary and standby: Map the interface http: / / ip:port / addFailover parameter peerAddressIp (the peer IP address, used to specify an IP address) to the programmable shell script config_set_primary.sh;
[0118] Configure the IPV6 address pool: Map the interface http: / / ip:port / v6AddSubnet parameters subnetIp, netmask, rangeStart, rangeEnd, routersIp, preferredLifeTime (i.e., the preferred lifetime), primaryDns, and backUpDns to the programmable shell script v6_config_add_subnet.sh;
[0119] Delete the IPV6 address pool: Map the interface http: / / ip:port / v6DeleteSubnet parameters subnetIp, netmask, rangeStart, rangeEnd, routersIp, preferredLifeTime, primaryDns, and backUpDns to the programmable shell script
[0120] v6_config_delete_subnet.sh;
[0121] Bind IPV6 MAC and IP: Map the interface http: / / ip:port / v6MacIpBind parameters hostName, mac, and ip to the programmable shell script v6_config_add_macIp.sh;
[0122] Unbind the IPV6 MAC and IP: Map the interface parameters hostName, mac, and ip of the interface http: / / ip:port / v6MacIpReBind to the programmable shell script v6_config_delete_macIp.sh.
[0123] In the embodiments of the present application, since the first server can map the interface parameters of each of the above at least one API to a script to create a one-to-one mapping relationship between the at least one API and the at least one script, the accuracy of creating the mapping relationship between the API and the script can be improved, so as to improve the accuracy of the operation and maintenance service event.
[0124] Figure 2 The flowchart of another service operation and maintenance method provided by the embodiments of the present application is shown. The service operation and maintenance method provided by the embodiments of the present application is applied to the second server; as Figure 2 shown, the service operation and maintenance method provided by the embodiments of the present application may include the following steps 201 to 203.
[0125] Step 201, the second server generates first data corresponding to the first service event based on the information corresponding to the first service event input in the first interface.
[0126] Among them, the above first interface is used to operate and maintain the service event corresponding to the first server, and the first data is used for the first server to execute the first service event.
[0127] In a possible implementation manner, the above first interface may be an operation and maintenance control interface for the service event corresponding to the first server.
[0128] In a possible implementation manner, the display parameters of the above first interface may be any display parameters.
[0129] In a possible implementation manner, the above display parameters include but are not limited to: display size, display color, display shape, display transparency, etc.
[0130] For example, as Figure 3 shown, the network administrator can input the information corresponding to the first service event in the first interface 30, which may include the terminal name, host name, MAC address, IP address, etc. After the network administrator finishes inputting, the above second server can generate the above first data according to the input information corresponding to the first service event.
[0131] In a possible implementation manner, the above first service event may include at least one of the following:
[0132] Configure the DHCP address pool;
[0133] View the DHCP address pool;
[0134] Configure the DHCP primary and standby;
[0135] Bind the DHCP MAC address and the DHCP IP address;
[0136] Unbind the DHCP MAC address and the DHCP IP address;
[0137] View the allocation information of the DHCP IP address;
[0138] View the DHCP log;
[0139] View the DHCP service status;
[0140] Restart the DHCP service.
[0141] In the embodiments of the present application, since the above first service event may include at least one of the above, different data can be generated by inputting information of different service events for operation and maintenance management of the corresponding service event. Therefore, the flexibility of operation and maintenance of the service event can be improved.
[0142] Step 202, the second server sends the first data to the first server.
[0143] In a possible implementation manner, the above step 202 may be specifically implemented by the following step 202a.
[0144] Step 202a, the second server sends the first data to the first API of the first server.
[0145] Wherein, the above first API is the API corresponding to the above first service event.
[0146] In the embodiments of the present application, since the second server can send the above first data to the API corresponding to the above first service event in the first server, the operation and maintenance of the first service event can be implemented through this API, thereby reducing the error rate of data transmission and improving the accuracy of service time operation and maintenance.
[0147] Step 203, when receiving the response information of the first service event sent by the first server, the second server displays the response information in the first interface.
[0148] It can be understood that displaying the above response information in the above first interface can enable the network administrator to timely obtain the status information of the above first service event.
[0149] In a possible implementation, the above-mentioned second server may display the above-mentioned response information in any possible area of the above-mentioned first interface, which can be specifically determined according to actual usage requirements, and the embodiments of the present application do not make any limitations.
[0150] For other descriptions in the embodiments of the present application, reference may specifically be made to the relevant descriptions in the above-mentioned method embodiments on the first server side. To avoid repetition, they will not be elaborated here.
[0151] In the service operation and maintenance method provided by the embodiments of the present application, since only by inputting the information corresponding to the first service event in the first interface for operating and maintaining the service events corresponding to the first server, the data corresponding to the first service event can be automatically generated and sent to the first server to implement the operation and maintenance of the first service event, without the need to manually input a large number of commands, and the response information of the first service event can be displayed in the first interface, so that the network administrator can view the operation and maintenance status information of the service event in a timely manner. Therefore, the reliability of the operation and maintenance service can be improved.
[0152] In a possible implementation, before the above-mentioned step 203, the service operation and maintenance method provided by the embodiments of the present application may further include the following step 204.
[0153] Step 204: The second server stores the response information in the database of the first server.
[0154] In a possible implementation, the above-mentioned second server may also, when receiving the above-mentioned response information, first store the response information in the database of the second server, and then display the response information in the above-mentioned first interface; that is, the second server may first execute the above-mentioned step 203 and then execute the above-mentioned step 204, or first execute the above-mentioned step 204 and then execute the above-mentioned step 203, which can be specifically set according to actual usage requirements, and the embodiments of the present application do not make any limitations.
[0155] In the embodiments of the present application, since the second server can store the above-mentioned response information in the database of the first server, the response information can be persisted, which is convenient for subsequent calling or viewing.
[0156] In a possible implementation, the service operation and maintenance method provided by the embodiments of the present application may further include the following step 205.
[0157] Step 205: The second server periodically collects second information from the first server.
[0158] Among them, the above-mentioned second information includes: DHCP service status, DHCP logs, and DHCP lease information.
[0159] In a possible implementation, the period for the second server to collect the second information can be any possible period; for example, the period can be 5 minutes, 7 minutes, 10 minutes, etc.
[0160] In a possible implementation, after the second server collects the second information each time, it can save the collected second information to the database for timely invocation.
[0161] In the embodiments of the present application, since the second server can periodically collect the second information from the first server, it is convenient to perform operation and maintenance management on the service event again without having to obtain the second information, thereby simplifying the process of service operation and maintenance management.
[0162] Next, with reference to the accompanying drawings, the service operation and maintenance method provided by the embodiments of the present application will be exemplarily described.
[0163] Exemplarily, taking the above first server including the main DHCP server and the standby DHCP server, and the second server being the SDN server as an example, as Figure 4 shown, the SDN server includes a WEB front end, a DHCP manager, and a database. Both the main DHCP server and the standby DHCP server include a DHCP orchestration adapter and ISC-DHCP. Among them, the WEB front end is a component that provides browser visualization operations and monitoring; the DHCP manager is a DHCP service manager microservice component; the database is a data persistence middleware; the DHCP orchestration adapter is deployed on the DHCP server in the form of a microservice, provides an API interface for orchestrating DHCP configurations, converts API interface requests into shell programmable commands, and executes and takes effect on the DHCP server; shell is a Linux programmable execution command; ISC-DHCP is an open-source DHCP service software, deployed on the Linux operating system in a binary installation manner, including two parts: V4 Server (i.e., the service) and V6 Server. V4 Server provides V4 IP allocation services, and V6 Server provides V6 IP allocation services.
[0164] The specific operation and maintenance process of the above first service event is as follows:
[0165] 1. The network administrator opens a browser and accesses the controller page (i.e., the above first interface), and enters the information of the above first service event on this page;
[0166] 2. The WEB front end sends the request for the above first service event to the DHCP manager;
[0167] 3. After receiving the request, the DHCP manager performs data operations, logical processing, parameter encapsulation, etc. to obtain the above-mentioned first data, and calls the API interface of the DHCP orchestration adapter to transfer the request action and the first data;
[0168] 4. After receiving the request, the DHCP orchestration adapter passes the parameters to the programmable shell script corresponding to the action and executes it on the server while responding to the DHCP manager;
[0169] 5. After receiving the configuration command, ISC-DHCP takes effect automatically;
[0170] 6. The DHCP manager responds with the processing result to the WEB page;
[0171] 7. The DHCP manager saves the processing result to the DB database for persistence;
[0172] 8. The DHCP manager periodically collects the DHCP service status, logs, lease information and saves them to the DB database.
[0173] In a possible implementation, taking the realization of DHCP IP allocation visualization as an example, when a network administrator configures DHCP, usually only cares about the address pool and IP. The first server can abstract the two concepts of the address pool and IP, and the system ensures the correctness of command writing and the detection of configuration conflicts. The network administrator does not need to consider how to specifically implement it, and can complete the operation and maintenance management of service events. When the network administrator wants to configure an address pool, only need to fill in the IP allocation network segment, mask, default gateway, lease time, then can complete the basic configuration of an address pool. Of course, the network administrator can also select optional configurations such as the start and end IP of the network segment, primary and secondary Domain Name System (DNS), etc. to refine the management of the address pool. The operation type of the network administrator and the configured content filled in will be transmitted to the DHCP orchestration adapter through http. After receiving the message, the DHCP orchestration adapter can call different shell scripts to process the configured content according to the operation type, convert the configured content into the configuration items of ISC-DHCP and write them into ISC-DHCP to make it effective. For the modification and deletion operations of the address pool, the network administrator only needs to find the corresponding address pool and perform the desired operation. The SDN will combine the existing configuration and send the operation to the DHCP orchestration adapter. The DHCP orchestration adapter calls the corresponding shell script according to the operation type and the configured content and writes it into ISC-DHCP.
[0174] In a possible implementation, the above DHCP IP allocation visualization mainly combines the IP details of the address pool, the lease details of the DHCP service, and the ARP table details, calculates them, and returns the results to the WEB page for presentation. The DHCP IP allocation status includes the following six types:
[0175] 1. Allocable: An IP that is not allocated by DHCP within the available range of the address pool and has no binding operation;
[0176] 2. Non-allocable: An IP outside the available range of the address pool;
[0177] 3. Bound: An IP within the available range of the address pool that has been bound;
[0178] 4. Offline: An IP allocated by DHCP within the available range of the address pool, but not scanned by ARP;
[0179] 5. Online: An IP allocated by DHCP within the available range of the address pool and scanned by ARP;
[0180] 6. Conflict: The MAC address assigned by DHCP within the available range of the address pool is inconsistent with the one scanned by ARP.
[0181] In a possible implementation, taking the visualization of the operation and maintenance status as an example, the principle of the operation and maintenance status is as follows:
[0182] 1. Service reachability status: The DHCP manager component probes the connectivity of the DHCP server by ping every 5 minutes. If the ping is successful, it means the server is reachable; otherwise, it is unreachable;
[0183] 2. DHCP manager status: The DHCP manager component calls the health check Http interface provided by the DHCP orchestration adapter every 5 minutes. If the interface responds with 200, it means the DHCP manager is reachable; otherwise, it is unreachable;
[0184] 3. DHCPv4 service status: The DHCP manager component calls the V4 service status acquisition interface provided by the DHCP orchestration adapter every 5 minutes. If the interface responds with 1, it means the DHCPv4 service status is normal; otherwise, it is abnormal;
[0185] 4. DHCPv6 service status: The DHCP manager component calls the V6 service status acquisition interface provided by the DHCP orchestration adapter every 5 minutes. If the interface responds with 1, it means the DHCPv6 service status is normal; otherwise, it is abnormal.
[0186] High availability includes the following:
[0187] 1. High availability of DCHP service: The system has two DHCP servers that provide DHCP services respectively, one as the primary and the other as the backup. They communicate with each other. When one server fails, the other can still provide DHCP services to ensure the high availability of the system. At the same time, each server is implanted with a DHCP health detection script that checks the status of the ISC-DHCP service every 5 minutes. When the DHCP service process is abnormal, the corresponding process is automatically restarted;
[0188] 2. High availability of DHCP manager: The server is implanted with a DHCP manager health self-healing script that automatically checks the status of the DHCP manager every 5 minutes. When the process is abnormal, the corresponding process is automatically restarted.
[0189] In a possible implementation, the basic tools carried by different server systems at the factory are different. To ensure that the DHCP manager can obtain correct results on any system, the above programmable shell script does not use IP query tools such as ifconfig, binary conversion tools such as bc, and text processing tools such as awk and sed. Instead, the following methods are used to achieve compatibility with multiple operating systems:
[0190] 1. Use the native ip command in Linux and directly read the system configuration file under / proc / net / to obtain the server IP;
[0191] 2. Use the native printf to convert decimal to any base;
[0192] 3. Use the native arithmetic expansion function to convert any base to decimal to complete a series of calculations such as IP masks;
[0193] 4. Use the built-in string replacement function in Shell to complete the conversion from configuration to configuration items and the deletion of existing content.
[0194] The embodiments of the present application can divide the functions of the above servers according to the above method examples. For example, each function can correspond to a functional module, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation.
[0195] Figure 5 Shows a possible composition schematic diagram of a service operation and maintenance device provided by the embodiments of the present application. As Figure 5 shown, the service operation and maintenance device 50 may include: a receiving module 51, an execution module 52, and a first sending module 53.
[0196] Among them, the receiving module 51 can be used to receive, through the first API, the first data corresponding to the first service event from the second server, where the first API is the API corresponding to the first service event. The execution module 52 can be used to execute the first service event based on the first script mapped by the first API. The first sending module 53 can be used to send the response information of the first service event to the second server.
[0197] In a possible implementation manner, the execution module 52 can specifically be used to transmit the first data received through the first API to the first script; and execute the first script.
[0198] In a possible implementation manner, the first server may include at least one API corresponding one-to-one to at least one service event, and the at least one API includes the first API. Exemplarily, the service operation and maintenance device 50 may further include a creation module. The creation module can be used to create a one-to-one mapping relationship between the at least one API and at least one script before the receiving module 51 receives, through the first API, the first data corresponding to the first service event from the second server.
[0199] In a possible implementation manner, the creation module can specifically be used to map the interface parameters of each API in the at least one API to a script.
[0200] It should be noted that all relevant contents of the steps involved in the above method embodiments on the first server side can be cited in the function descriptions of the corresponding functional modules, and will not be elaborated here.
[0201] Figure 6 FIG. shows a possible schematic composition diagram of another service operation and maintenance device provided by an embodiment of the present application. As Figure 6 shown, the service operation and maintenance device 60 may include: a generation module 61, a second sending module 62, and a display module 63.
[0202] Among them, the generation module 61 can be used to generate, based on the information corresponding to the first service event input in the first interface, the first data corresponding to the first service event, where the first interface is used to operate and maintain the service event corresponding to the first server, and the first data is used for the first server to execute the first service event. The second sending module 62 can be used to send the first data to the first server. The display module 63 can be used to display the response information in the first interface when receiving the response information of the first service event sent by the first server.
[0203] In a possible implementation, the second sending module 62 can be specifically configured to send the first data to the first API of the first server, where the first API is the API corresponding to the first service event.
[0204] In a possible implementation, the first service event may include at least one of the following: configuring a DHCP address pool; viewing a DHCP address pool; configuring DHCP primary and standby; binding a DHCP MAC address and a DHCP IP address; unbinding a DHCP MAC address and a DHCP IP address; viewing the allocation information of a DHCP IP address; viewing DHCP logs; viewing the DHCP service status; restarting the DHCP service.
[0205] In a possible implementation, the service operation and maintenance device 60 may further include a storage module. The storage module can be used to store the response information to the database of the second server before the display module 63 displays the response information of the first service event sent by the first server in the first interface.
[0206] In a possible implementation, the service operation and maintenance device 60 may further include a collection module. The collection module can be used to periodically collect second information from the first server, where the second information includes: DHCP service status, DHCP logs, and DHCP lease information.
[0207] It should be noted that all relevant content of each step involved in the above method embodiment on the second server side can be cited in the function description of the corresponding functional module, and will not be repeated here.
[0208] It should be noted that the specific working process of each functional module in the server provided in the embodiments of the present application can refer to the specific description of the corresponding process in the method embodiments. The embodiments of the present application will not be described in detail here. The server provided in the embodiments of the present application is used to execute the above service operation and maintenance method, and thus can achieve the same effect as the above service operation and maintenance method.
[0209] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0210] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the devices or units can be in electrical, mechanical or other forms.
[0211] The units described as separate components may or may not be physically separated. The components displayed as units can be one physical unit or multiple physical units, that is, they can be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0212] In addition, the functional units in each embodiment of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0213] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical discs that can store program codes.
[0214] As Figure 7 shown, the embodiment of the present application further provides a server 70, including a processor 71 and a memory 72. A program or instruction that can run on the processor 71 is stored on the memory 72. When the program or instruction is executed by the processor 71, it implements each step of the service operation and maintenance method embodiment as described above, and can achieve the same technical effect. To avoid repetition, it will not be described here again.
[0215] The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it realizes each process of the above-mentioned service operation and maintenance method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0216] As mentioned above, the above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A service operation and maintenance method, applied to a first server, Characterized in that, The method includes: Receiving, through a first application programming interface (API), first data corresponding to a first service event from a second server, where the first API is the API corresponding to the first service event; Executing the first service event based on a first script mapped by the first API; Sending response information of the first service event to the second server.
2. The method according to claim 1, Characterized in that, The executing the first service event based on the first script mapped by the first API includes: Transmitting the first data received through the first API to the first script; Executing the first script.
3. The method according to claim 1 or 2, Characterized in that, The first server includes at least one API corresponding to at least one service event one by one, and the at least one API includes the first API; Before receiving, through the first API, first data corresponding to a first service event from a second server, the method further includes: Creating a one-to-one mapping relationship between the at least one API and at least one script.
4. The method according to claim 3, Characterized in that, The creating the one-to-one mapping relationship between the at least one API and at least one script includes: Mapping the interface parameters of each API in the at least one API to a script.
5. A service operation and maintenance method, applied to a second server, Characterized in that, The method includes: Generating first data corresponding to the first service event based on information corresponding to the first service event input in a first interface, where the first interface is used for operating and maintaining service events corresponding to the first server, and the first data is used for the first server to execute the first service event; Sending the first data to the first server; Displaying the response information in the first interface when receiving the response information of the first service event sent by the first server.
6. The method according to claim 5, Characterized in that, The sending the first data to the first server includes: Sending the first data to a first API of the first server; Wherein, the first API is the API corresponding to the first service event.
7. The method according to claim 5, Characterized in that, The first service event includes at least one of the following: Configuring a Dynamic Host Configuration Protocol (DHCP) address pool; Viewing the DHCP address pool; Configuring DHCP primary and standby; Binding a Dynamic Host Configuration Protocol Media Access Control (DHCP MAC) address and a Dynamic Host Configuration Protocol Media Access Control Internet Protocol (DHCP IP) address; Unbinding the DHCP MAC address and the DHCP IP address; Viewing the allocation information of the DHCP IP address; Viewing the DHCP log; Viewing the DHCP service status; Restarting the DHCP service.
8. The method according to any one of claims 5 to 7, Characterized in that, Before displaying the response information of the first service event sent by the first server in the first interface when the response information is received, the method further includes: Storing the response information into the database of the second server.
9. The method according to any one of claims 5 to 7, characterized in that the method further includes: Periodically collecting second information from the first server; wherein the second information includes: DHCP service status, DHCP logs, and DHCP lease information.
10. A service operation and maintenance device, characterized in that the device includes a receiving module, an execution module, and a first sending module; The receiving module is configured to receive, through a first API, first data corresponding to a first service event from a second server, where the first API is the API corresponding to the first service event; The execution module is configured to execute the first service event based on a first script mapped by the first API; The first sending module is configured to send the response information of the first service event to the second server.
11. A service operation and maintenance device, characterized in that the device includes a generating module, a second sending module, and a display module; The generating module is configured to generate first data corresponding to the first service event based on the information corresponding to the first service event input in a first interface, where the first interface is used for operating and maintaining the service event corresponding to a first server, and the first data is used for the first server to execute the first service event; The second sending module is configured to send the first data to the first server; The display module is configured to display the response information in the first interface when the response information of the first service event sent by the first server is received.
12. A server, characterized in that it includes a processor and a memory, and the memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, it implements the steps of the service operation and maintenance method according to any one of claims 1 to 4, or implements the steps of the service operation and maintenance method according to any one of claims 5 to 9.
13. A readable storage medium, characterized in that the readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, it implements the steps of the service operation and maintenance method according to any one of claims 1 to 4, or implements the steps of the service operation and maintenance method according to any one of claims 5 to 9.