Zero-configuration opening method and device of network equipment, storage medium and electronic equipment
By pre-stored the opening business list and priority sorting in the network device, the opening business configuration is automatically executed, and the problem of insufficient flexibility in the existing technology is solved, and the flexibility and efficiency of zero configuration opening of the network device is achieved, satisfying multiple configurations need.
Patent Information
- Application Number
- CN202411332068.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-31
AI Technical Summary
The existing zero-configuration opening method of network equipment is insufficient flexibility and cannot meet certain specific opening needs, which limits the addition and execution of opening business.
By pre-stored the opening business list in the network device, and automatically execute the opening business configuration according to the priority sorting and callback functions of the opening business, including software upgrade, feature library entry, configuration package import and command line configuration, supporting dynamic editing of the opening business list to Adapt to different needs.
It realizes the flexibility and efficiency of zero configuration opening of network equipment, can complete the opening business in an orderly manner, meets various configuration needs, reduces manual intervention and repeated operations, and improves configuration efficiency.
Smart Images

Figure CN119232576A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of network technology, and in particular to the field of configuration and deployment technology, and more specifically to a zero-configuration deployment method, device, storage medium and electronic device for a network device. Background Art
[0002] When building a large-scale network topology, there are often many identical network devices in the network, and these devices use the same network configuration. If the process of configuring these devices (also known as the startup process) is done manually, the workload is large and repetitive, which not only results in high labor costs but also low configuration efficiency.
[0003] In order to solve this problem, the concept of zero-configuration deployment for network devices has been proposed, which allows the aforementioned initial configuration process to be automated to a certain extent, so as to reduce manpower costs and improve execution efficiency.
[0004] However, the existing zero-configuration deployment method restricts some deployment services from being added to the zero-configuration deployment process, cannot meet certain specific deployment requirements, and has the problem of insufficient flexibility. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a zero-configuration deployment method, apparatus, storage medium and electronic device for a network device, aiming to solve the technical problem that the existing zero-configuration deployment method has insufficient flexibility.
[0006] To achieve the above object, according to a first aspect of the present application, a zero-configuration deployment method for a network device is provided, the method comprising:
[0007] In response to a startup operation of any network device in the network topology structure, determining a startup file of the network device, wherein the startup file is at least used to indicate a plurality of startup services that the network device needs to execute;
[0008] According to the deployment service names of the plurality of deployment services, traversing the deployment service list of the network device, wherein the deployment service list pre-stores deployment service names, callback functions and priorities corresponding to the plurality of deployment services respectively;
[0009] According to the priorities corresponding to the plurality of deployment services, the callback functions corresponding to the plurality of deployment services are called to control the plurality of deployment services to execute deployment service configuration in sequence.
[0010] Optionally, in a possible implementation manner of the first aspect, calling callback functions corresponding to the plurality of deployment services respectively according to respective priorities of the plurality of deployment services, and controlling the plurality of deployment services to sequentially execute deployment service configurations includes:
[0011] Sorting the plurality of the deployment services according to respective priorities corresponding to the plurality of deployment services to generate a deployment service sequence list;
[0012] Reading, from a user configuration file of the network device, a current deployment service of which the network device has currently executed deployment service configuration;
[0013] Determine the next start-up service of the current start-up service in the start-up service sequence list;
[0014] Calling a callback function corresponding to the next deployment service, so that the next deployment service is controlled by the callback function to execute the corresponding deployment service configuration, until the plurality of deployment services are sequentially executed to complete the deployment service configuration, wherein the deployment service configuration includes at least one of the following: software upgrade, feature library entry, configuration package import, and command line configuration.
[0015] Optionally, in a possible implementation manner of the first aspect, the calling a callback function corresponding to the next deployment service includes:
[0016] Determining whether the next deployment service is a deployment service that the deployment file indicates the network device needs to execute, and determining whether the next deployment service is an undeployed service of the network device;
[0017] When it is determined that the next deployment service is the deployment service that the network device needs to execute and the next deployment service is the undeployed service, calling the callback function corresponding to the next deployment service is executed.
[0018] Optionally, in a possible implementation manner of the first aspect, before calling a callback function corresponding to the next deployment service, the method further includes:
[0019] Writing the next start service into a user configuration file of the network device;
[0020] The user configuration file is updated to the persistent storage area of the network device.
[0021] Optionally, in a possible implementation manner of the first aspect, the method further includes:
[0022] In response to a restart operation of the network device, when it is determined that the restart operation is due to calling the callback function to control the corresponding deployment service to execute the deployment service configuration, reading a current deployment service of the network device that has currently executed the deployment service configuration from a user configuration file of the network device;
[0023] Traversing the startup service sequence list to determine the next startup service of the current startup service;
[0024] A callback function corresponding to the next deployment service is called, so that the next deployment service is controlled by the callback function to execute the corresponding deployment service configuration, until the deployment services are executed in sequence to complete the deployment service configuration.
[0025] Optionally, in a possible implementation manner of the first aspect, after calling, according to the priorities corresponding to the plurality of deployment services, the callback functions corresponding to the plurality of deployment services respectively, and controlling the plurality of deployment services to sequentially execute deployment service configuration, the method further includes:
[0026] In response to the last deployment service of the plurality of deployment services executing and completing the deployment service configuration, the deployment function of the persistent storage area of the network device is closed.
[0027] Optionally, in a possible implementation manner of the first aspect, the method further includes:
[0028] In response to the editing operation on the deployment service list, new table data is added and / or existing table data is deleted in the deployment service list.
[0029] According to a second aspect of the present application, a zero-configuration deployment device for a network device is provided, the device comprising:
[0030] A response unit, configured to determine a startup file of any network device in the network topology structure in response to a startup operation of the network device, wherein the startup file is at least used to indicate a plurality of startup services that the network device needs to execute;
[0031] A traversal unit, used for traversing the startup service list of the network device according to the startup service names of the plurality of startup services, wherein the startup service list pre-stores the startup service names, callback functions and priorities corresponding to the plurality of startup services respectively;
[0032] The configuration and deployment unit is used to call the callback functions corresponding to the plurality of deployment services respectively according to the priorities corresponding to the plurality of deployment services respectively, and control the plurality of deployment services to execute deployment service configuration in sequence.
[0033] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here.
[0034] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the methods described above when executing the computer program.
[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any of the methods described above.
[0036] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods described in the first aspect.
[0037] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0038] The present application example provides a zero-configuration startup method, apparatus, storage medium and electronic device for a network device. The zero-configuration startup method for the network device determines a startup file of the network device in response to a startup operation of any network device in a network topology structure, and the startup file is at least used to indicate multiple startup services that the network device needs to execute; according to the startup service names of the multiple startup services, traverses a startup service list of the network device, and the startup service list pre-stores startup service names, callback functions and priorities corresponding to the multiple startup services; according to the priorities corresponding to the multiple startup services, calls the callback functions corresponding to the multiple startup services, and controls the multiple startup services to execute the startup service configuration in sequence.
[0039] The zero-configuration startup method for a network device provided in the present application abandons the method of simply relying on transmitting configuration files in text form and executing configuration line by line, and executes zero-configuration startup through a startup service list pre-stored in the network device, so that the zero-configuration startup process of the network device is no longer limited to the operation mode of the command line parser and the text command line, thereby expanding the scope of processable services. At the same time, it is also compatible with the original command line startup method, making the zero-configuration startup process of the network device more flexible.
[0040] In addition, according to the order of the priority values of multiple startup services, the startup service configuration is performed by calling the callback functions corresponding to the startup services in sequence, ensuring that the zero-configuration startup of the network equipment can be carried out in an orderly manner, which not only guarantees the priority processing of key startup services, but also reasonably arranges other startup services, so that the network equipment can achieve efficient and accurate completion of zero-configuration startup. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 It is a schematic flow chart of a zero-configuration deployment method for a network device provided in an embodiment of the present application;
[0043] Figure 2 It is a schematic flow chart of an optional zero-configuration deployment method for a network device provided in an embodiment of the present application;
[0044] Figure 3 It is a schematic flow chart of an optional zero-configuration deployment method for a network device provided in an embodiment of the present application;
[0045] Figure 4 It is a schematic flow chart of an optional zero-configuration deployment method for a network device provided in an embodiment of the present application;
[0046] Figure 5 It is a schematic flow chart of an optional zero-configuration deployment method for a network device provided in an embodiment of the present application;
[0047] Figure 6 It is a structural diagram of a zero-configuration deployment device for a network device provided in an embodiment of the present application;
[0048] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0050] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0051] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0052] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0053] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0054] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0055] First, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.
[0056] Deployment: Usually refers to the process of initially configuring network devices during network construction so that they can operate normally and integrate into the entire network environment.
[0057] Zero-configuration start: refers to the process of configuring devices for the first time when building a network through certain automated means without a lot of manual intervention. It aims to reduce manpower costs, improve configuration execution efficiency, and reduce repetitive manual operations.
[0058] Command Line Interface (CLI) is a way to interact with a computer system or application by entering specific text commands in a terminal or command prompt.
[0059] The above is a brief introduction to the nouns involved in the embodiments of the present application, which will not be repeated below.
[0060] When building a large-scale network topology, there are often many identical network devices in the network, and these devices use the same network configuration. If the process of configuring these devices (also known as the startup process) is done manually, the workload is large and repetitive, which not only results in high labor costs but also low configuration efficiency.
[0061] In order to solve this problem, the concept of zero-configuration deployment for network devices has been proposed, which allows the aforementioned initial configuration process to be automated to a certain extent, so as to reduce manpower costs and improve execution efficiency.
[0062] However, the existing zero-configuration deployment method transmits configuration files in text form, and the device executes each line of configuration line by line to achieve the deployment purpose, which has the problem of insufficient flexibility. In addition, if some deployment services cannot be operated through text command lines or will cause device restart after configuration, they will not be added to the zero-configuration deployment process, resulting in the limitation of the operation scope of the existing zero-configuration deployment and the inability to meet the deployment requirements of certain specific scenarios.
[0063] In order to solve the above technical problems, the example of this application provides an example of a zero-configuration startup method for network devices. It should be noted that the zero-configuration startup method for network devices provided by the example of this application can be applied to any scenario where a large-scale network topology needs to be built, so as to achieve unified and efficient network configuration for network devices such as servers and switches of the same type. For example, in the data center of a large cloud service provider, there may be tens of thousands of servers with similar network configuration requirements. Using the zero-configuration startup method provided by the example of this application, zero-configuration startup can be completed quickly and accurately, thereby improving deployment efficiency.
[0064] Please refer to Figure 1 As shown, Figure 1 A schematic flow chart of a zero-configuration deployment method for a network device provided by the present application is shown. As an example but not a limitation, the method can be applied to a network device. The method includes:
[0065] S101, in response to a startup operation of any network device in a network topology structure, determining a startup file of the network device.
[0066] Optionally, the above-mentioned deployment file is at least used to indicate multiple deployment services that the above-mentioned network device needs to execute.
[0067] In the example of the present application, when any network device in the network topology structure is powered on or triggered to start by the system, for example, the startup module configured in the network device can be executed or run, and the startup script of the startup module reads the startup file of the network device. The startup file is a file used to instruct or guide how the startup process of the network device is to proceed, and the startup file at least includes relevant information indicating multiple startup services that the network device needs to execute at the initial startup. In addition, the startup file may also include information such as the current startup service of the network device, synchronization data change time, etc.
[0068] For example, for a newly deployed router in the network topology, its corresponding deployment file may indicate the need to perform multiple different deployment services, such as basic network parameter configuration (such as IP address allocation, subnet mask setting), security policy initialization (such as firewall rule setting), and activation of specific functional modules (such as VPN service configuration).
[0069] It should be noted that the synchronization data change time refers to a fixed time string in the deployment file. If the synchronization data change time has been stored in the network device, when the network device is started next time, if it is found that the "synchronization data change time" stored in the current device is consistent with the "synchronization data change time" set in the deployment file, and the deployment task has completed the deployment service configuration, it is determined that a duplicate deployment file has been read, and the deployment process will not be re-entered.
[0070] S102: traverse a deployment service list of a network device according to deployment service names of a plurality of deployment services.
[0071] Optionally, the above-mentioned deployment service list (callback_func_list) may be described in the form of machine code but is not limited to it. The deployment service list pre-stores deployment service names, callback functions and priorities corresponding to a plurality of deployment services.
[0072] In the example of the present application, after obtaining multiple startup services indicated by the startup file, the startup service list pre-stored in the network device is fully traversed according to the respective startup service names of these startup services to determine the startup service names and priorities corresponding to the multiple startup services in the startup service list, that is, the sorting result of the priority values of the multiple startup services can be determined, as shown in Table 1 below, wherein the startup service list includes: startup service names corresponding to the multiple startup services, callback functions corresponding to each startup service / each startup service name, and priorities corresponding to each startup service / each startup service name.
[0073] Table 1
[0074] Deployment service name Callback Function Priority System_config config_file_restore 20 System_upgrade upgrade_file_upload 1 Business A cb_A 30 Cli_command exec_cli_command 40 …… …… ……
[0075] In Table 1 above, System-config is a user configuration file imported into persistent storage, which is the configuration file used when the device is running. System_upgrade is to upgrade the firmware; Cli_command is to execute CLI commands (full name: Command Line Interface commands); Service A is a synonym for any other service, that is, the start-up operation of any service can be added. The callback function is the function used to implement the start-up service function. For example, the function of the callback function config_file_restore is to read the user configuration file from the USB flash drive of the network device and execute the start-up service configuration process.
[0076] S103, calling callback functions corresponding to the plurality of deployment services respectively according to their respective priorities, and controlling the plurality of deployment services to sequentially execute deployment service configurations.
[0077] By traversing the pre-stored deployment service list in the network device, the network device can accurately determine the priority values of the plurality of deployment services, and determine the order of executing deployment service configurations in sequence according to the order of the priority values.
[0078] Specifically, for each deployment service, a callback function corresponding to the deployment service or the service name of the deployment service is called. It should be understood that the callback function corresponding to the deployment service is the specific execution instruction of the deployment service, which is responsible for controlling and implementing the configuration operation of the deployment service.
[0079] For example, when the deployment service "upgrade firmware System_upgrade" is processed, the corresponding callback function "upgrade_file_upload" is called, and the callback function connects to a specific firmware server to download the latest firmware version, and then installs the firmware and performs deployment configuration. After the deployment configuration of "upgrade firmware System_upgrade" is completed, the callback function of the next deployment service is called in order of the priority values of multiple deployment services, and the process is executed in sequence until all deployment services have completed deployment configuration.
[0080] In the present application example, the method of simply relying on transmitting configuration files in text form and executing configuration line by line is abandoned, and zero-configuration startup is performed through a startup service list pre-stored in the network device (the startup service list pre-stores startup service names, callback functions and priorities corresponding to multiple startup services). This makes the zero-configuration startup process of the network device no longer limited to the operation mode of the command line parser and the text command line, expanding the scope of the startup services that can be processed. At the same time, it is also compatible with the original command line startup method, making the startup configuration of the network device more flexible.
[0081] Moreover, according to the order of the priority values of multiple startup services, the startup service configuration is performed by calling the callback functions corresponding to the startup services in sequence, ensuring that the zero-configuration startup of the network equipment can be carried out in an orderly manner, which not only ensures the priority processing of key startup services, but also reasonably arranges other startup services, so that the network equipment can achieve efficient and accurate completion of zero-configuration startup.
[0082] This application example also provides a more flexible and efficient deployment configuration method. In a possible implementation, the method further includes:
[0083] In response to the editing operation on the deployment service list, new table data is added and / or existing table data is deleted in the deployment service list.
[0084] Specifically, in the example of the present application, by editing the startup service list, for example, adding / deleting table rows in the startup service list, startup services are added / deleted, which is no longer restricted by command line capabilities. Any service that can be implemented by machine code can be included in the startup configuration process, even including services that were originally not able to be operated through the command line.
[0085] For example, by adding new table data to the deployment service list, developers can incorporate new deployment services into the configuration process of network devices. For example, by deleting existing table data in the deployment service list, deployment services that are no longer used can be removed, avoiding unnecessary resource occupation and process complexity.
[0086] By dynamically editing the deployment service list provided in this application example, it is possible to respond to dynamic changes in the network environment and service requirements in a timely manner without the need for large-scale reconstruction or upgrade of the entire service system. By flexibly adjusting the deployment service, the long-term maintenance cost caused by fixed and immutable deployment configuration is reduced.
[0087] Please refer to Figure 2 As shown, Figure 2A schematic flow chart of an optional zero-configuration deployment method for a network device provided by the present application is shown. In a possible implementation, the above steps, according to the priorities corresponding to the multiple deployment services, call callback functions corresponding to the multiple deployment services, and control the multiple deployment services to sequentially execute deployment service configurations, include:
[0088] S201, sorting a plurality of deployment services according to respective priorities corresponding to the plurality of deployment services, and generating a deployment service sequence list.
[0089] Optionally, the deployment services may be arranged in order according to the priority sorting result corresponding to the deployment service name of each deployment service pre-recorded in the deployment service list to form a clear and definite deployment service sequence list.
[0090] For example, according to the priorities corresponding to multiple startup services pre-stored in the startup service list, the startup service: "System_upgrade" (upgrade firmware) corresponds to a priority of 1, "Service A" corresponds to a priority of 30, "System_config" (import user configuration file) corresponds to a priority of 20, and "Cli_command" (command line interface instruction) corresponds to a priority of 40. Then, the multiple startup services can be sorted according to their respective priority values, and the generated startup service sequence list is shown in Table 2 below.
[0091] Table 2
[0092] Deployment service sequence list System_config System_upgrade Business A Cli_command ……
[0093] S202, reading, from a user configuration file of the network device, a current deployment service of which the network device has currently executed a deployment service configuration.
[0094] The zero-configuration startup function is executed each time the network device is started. Specifically, during the zero-configuration startup process, the currently performed startup services are first obtained from the user configuration file stored in the persistent storage area of the network device (blank in the factory state, and startup services can be written, added, or deleted according to the business needs of the network device).
[0095] S203, traverse the above-mentioned opening service sequence list to determine the next opening service of the current opening service.
[0096] For example, taking the deployment service sequence list provided in Table 2 above as an example, if the deployment service currently executed by the network device in the deployment service configuration is "upgrade firmware System-upgrade", the next deployment service read this time is "service A".
[0097] S204, calling a callback function corresponding to the next deployment service, so that the next deployment service is controlled by the callback function to execute the corresponding deployment service configuration, until the plurality of deployment services are executed in sequence to complete the deployment service configuration.
[0098] Optionally, in the example of the present application, the above-mentioned startup service configuration includes at least one of the following: software upgrade, feature library entry, configuration package import, and command line configuration.
[0099] By checking and comparing the start-up service sequence list one by one, the next start-up service of the current start-up service is found, that is, the next service to be executed after the current start-up service is executed. After the next start-up service is determined, the callback function corresponding to the next start-up service is called to actually execute the configuration operation of the next start-up service. The above-mentioned start-up service configuration process is cyclically continued until all the start-up services are configured in sequence. Among them, after a start-up service successfully executes the start-up service configuration, or a start-up service configuration is unsuccessful, it returns to execute the traversal operation of S203.
[0100] Therefore, the deployment service can be accurately executed according to the predetermined priority and order, avoiding the confusion and disorder of service execution. Even if there is an interruption in the deployment process (such as device restart), the next deployment service can be accurately found according to the current deployment service, ensuring the continuity and integrity of zero-configuration deployment of network devices.
[0101] In this application example, the types of startup service configurations are diverse, supporting a variety of common and critical configuration operations, including software upgrades to improve device performance, feature library entry to enhance security protection, configuration package import to implement specific function settings, and traditional command line configuration to meet basic and specific needs, etc., which can fully meet the zero-configuration startup requirements of network devices.
[0102] Please refer to Figure 3 As shown, Figure 3 A schematic flow chart of an optional zero-configuration deployment method for a network device provided by the present application is shown. In a possible implementation, the above method steps, calling a callback function corresponding to the next deployment service, include:
[0103] S301, determining whether the next deployment service is a deployment service that the network device needs to execute as instructed by the deployment file, and determining whether the next deployment service is a non-deployed service of the network device.
[0104] S302: When it is determined that the next deployment service is a deployment service that needs to be executed by the network device and the next deployment service is a non-deployed service, a callback function corresponding to the next deployment service is invoked.
[0105] In the above implementation, the next deployment service to be executed is double-verified and judged. First, it is determined whether the next deployment service is a task that the network device should execute as specified in the deployment file, so as to avoid executing unnecessary or erroneous services. At the same time, it is also determined whether the next deployment service has not been executed, that is, whether the next deployment service is an undeployed service, so as to prevent the repeated execution of completed services, thereby improving efficiency and avoiding resource waste.
[0106] Only when the next deployment service satisfies both of the above conditions, that is, it is determined that the next deployment service is both the deployment service that the deployment file indicates the network device needs to execute and the deployment service that has not yet been executed, the callback function corresponding to the next deployment service is called to execute the configuration process.
[0107] For example, suppose that the following three services are specified in the deployment file of a network device: service A, service B, and service C, and the deployment configuration of service A has been completed. When determining the next deployment service B of service A, first check whether service B is included in the deployment file and whether it is a service that has not been executed. Only when service B meets the above two conditions at the same time, the callback function corresponding to service B is called to execute the deployment service configuration of service B.
[0108] In addition, if the next deployment service does not meet one of the condition restrictions, for example, it is determined that the next deployment service is not the deployment service that the network device indicated by the deployment file needs to execute, or it is determined that the next deployment service is not an undeployed service, then the process returns to execute the step of re-traversing the deployment service sequence list to determine the next deployment service of the current deployment service.
[0109] Through the above method steps, it can be ensured that the executed deployment services meet the preset condition restrictions, improve the accuracy of the deployment configuration of the network equipment, and effectively prevent the repeated execution of completed services, saving configuration resources and time.
[0110] Please refer to Figure 4 As shown, Figure 4 A schematic flow chart of an optional zero-configuration deployment method for a network device provided by the present application is shown. In a possible implementation, before executing the step of calling a callback function corresponding to the next deployment service, the method further includes:
[0111] S401, writing the next deployment service into a user configuration file of a network device.
[0112] S402: Update the user configuration file to the persistent storage area of the network device.
[0113] Before executing the callback function corresponding to the next deployment service, the deployment service to be executed (i.e., the next deployment service) is first recorded in the user configuration file of the network device to mark the deployment service to be executed. Afterwards, the user configuration file containing the next deployment service record is saved to the persistent storage area of the network device to ensure that even if the network device is powered off, restarted, or in other abnormal situations, the record of the deployment service to be executed will not be lost, which can facilitate the subsequent tracing of the deployment service execution process.
[0114] The above method and steps not only facilitate the subsequent tracing of the execution process of the deployment service, but also, even in the event of an unexpected event such as a power outage, the network device can still accurately continue to execute the deployment process before the unexpected event such as the power outage according to the user configuration file in the persistent storage after restarting, without missing or repeating the execution of the service configuration.
[0115] Please refer to Figure 5 As shown, Figure 5 A schematic flow chart of an optional zero-configuration deployment method for a network device provided by the present application is shown. In a possible implementation, the method further includes:
[0116] S501, in response to a restart operation of the network device, when it is determined that the restart operation is due to calling the above callback function to control the corresponding deployment service to execute the deployment service configuration, read the current deployment service of the network device that has currently executed the deployment service configuration from the user configuration file of the network device.
[0117] S502: traverse the deployment service sequence list to determine the next deployment service of the current deployment service.
[0118] S503, calling a callback function corresponding to the next deployment service, so that the next deployment service is controlled by the callback function to execute the corresponding deployment service configuration, until the deployment services are executed in sequence to complete the deployment service configuration.
[0119] In the above implementation, when it is detected that the network device is performing a restart operation, it is first determined whether the restart operation is caused by the callback function of the deployment service configuration being executed. If so, the currently performed deployment service is read from the user configuration file.
[0120] Next, according to the previously generated opening service sequence list, the next service of the current opening service is searched. Then, the callback function corresponding to the next opening service is called, and the callback function corresponding to the next opening service is used to control the next opening service to execute the corresponding opening service configuration, and this cycle is repeated until all opening services are configured.
[0121] For example, if a network device unexpectedly restarts while executing a certain deployment service configuration, if the restart is caused by calling a callback function to control the corresponding deployment service to execute the deployment service configuration, the progress of the deployment service configuration can be learned from the user configuration file after the restart, and then the subsequent deployment services can be continued, which will not affect the continuity of the entire deployment work.
[0122] In this application example, for the startup services that may cause the network equipment to restart, since the startup steps that have been traversed are persistently stored in the user configuration file, the startup function can retain the internal logical state before and after the restart, thereby allowing the originally restricted services to be added to the startup process, breaking through the limitations of the existing zero-configuration startup operation scope and meeting the needs of more specific scenarios.
[0123] Through the above-mentioned method steps of the present application, the success rate and stability of zero-configuration startup of network devices are improved. Even when the network device is restarted, the location of the last interruption can be accurately found to continue to execute the unfinished startup business, ensuring that all scheduled startup businesses can be fully executed in sequence, avoiding the omission of some businesses due to restart.
[0124] In a possible implementation, after calling the callback functions corresponding to the multiple deployment services respectively according to the priorities corresponding to the multiple deployment services respectively, and controlling the multiple deployment services to sequentially execute the deployment service configuration, the method further includes:
[0125] In response to the last deployment service of the plurality of deployment services executing and completing the deployment service configuration, the deployment function of the persistent storage area of the network device is closed.
[0126] In the example of this application, after all scheduled start-up services have been successfully configured in order of priority, the relevant functions used for start-up in the persistent storage area of the network device can be turned off to release relevant system resources and avoid continuous occupation of system resources, thereby improving the overall operating efficiency of the network device. In addition, by reducing unnecessary function operations, potential security risks are reduced, and start-up functions are prevented from being misoperated or maliciously used when not needed. In addition, it can also help maintain the stable operating state of network equipment and avoid abnormal situations that may be caused by long-term operation of unnecessary functions.
[0127] In addition, in the example of the present application, after the relevant functions for the deployment in the persistent storage area of the network device are turned off, operations of returning to successfully exit the deployment function and returning to error exit the deployment function can also be performed.
[0128] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0129] Corresponding to the zero-configuration deployment method of the network device described in the above embodiment, Figure 6 is a schematic diagram of the structure of a zero-configuration deployment device for a network device provided in an embodiment of the present application. The device can be implemented as part or all of a computer device by software, hardware, or a combination of both. The computer device can be Figure 7 Electronic equipment shown.
[0130] Reference Figure 6 The zero configuration deployment device of the network device includes:
[0131] The responding unit 601 is used to determine a provisioning file of any network device in the network topology in response to a startup operation of the network device, wherein the provisioning file is at least used to indicate a plurality of provisioning services that the network device needs to execute.
[0132] The traversal unit 602 is used to traverse the deployment service list of the network device according to the deployment service names of the multiple deployment services, wherein the deployment service list pre-stores deployment service names, callback functions and priorities corresponding to the multiple deployment services respectively;
[0133] The configuration and deployment unit 603 is used to call the callback functions corresponding to the multiple deployment services according to the priorities corresponding to the multiple deployment services, and control the multiple deployment services to execute deployment service configuration in sequence.
[0134] Optionally, in a possible implementation manner of the first aspect, the apparatus further includes:
[0135] The editing unit is used to add new table data and / or delete existing table data in the deployment service list in response to an editing operation on the deployment service list.
[0136] Optionally, in a possible implementation manner of the first aspect, the configuring and starting unit includes:
[0137] A generating subunit, used for sorting the multiple deployment services according to the priorities corresponding to the multiple deployment services, and generating a deployment service sequence list;
[0138] The reading subunit is used to read the current deployment service of the network device that has currently executed the deployment service configuration from the user configuration file of the network device;
[0139] A determination subunit, used to determine the next start-up service of the current start-up service in the start-up service sequence list;
[0140] The calling subunit is used to call the callback function corresponding to the next deployment service, so that the next deployment service is controlled by the callback function to execute the corresponding deployment service configuration until multiple deployment services are executed in sequence to complete the deployment service configuration, wherein the deployment service configuration includes at least one of the following: software upgrade, feature library entry, configuration package import, and command line configuration.
[0141] Optionally, in a possible implementation manner of the first aspect, the calling subunit is specifically configured to:
[0142] Determining whether the next deployment service is a deployment service that the network device needs to execute as indicated by the deployment file, and determining whether the next deployment service is an undeployed service of the network device;
[0143] When it is determined that the next deployment service is a deployment service that the network device needs to execute and the next deployment service is a non-deployed service, a callback function corresponding to the next deployment service is called.
[0144] Optionally, in a possible implementation manner of the first aspect, the apparatus further includes:
[0145] A writing unit, used for writing the next start-up service into a user configuration file of the network device;
[0146] The updating unit is used to update the user configuration file to the persistent storage area of the network device.
[0147] Optionally, in a possible implementation manner of the first aspect, the apparatus further includes:
[0148] A restart unit, configured to read a user configuration file of the network device in response to a restart operation of the network device;
[0149] A reading unit, configured to read a current deployment service for which the network device has currently executed the deployment service configuration from the user configuration file of the network device when it is determined based on the user configuration file that the network device is currently in the process of executing the deployment service configuration;
[0150] A traversal unit, used for traversing the start-up service sequence list to determine the next start-up service of the current start-up service;
[0151] The calling unit is used to call the callback function corresponding to the next deployment service, so that the next deployment service is controlled by the callback function to execute the corresponding deployment service configuration until the deployment service configuration is completed after the multiple deployment services are executed in sequence.
[0152] Optionally, in a possible implementation manner of the first aspect, the apparatus further includes:
[0153] The ending unit is used for completing the configuration of the deployment service in response to the last deployment service of the multiple deployment services, and closing the deployment function of the persistent storage area of the network device.
[0154] It should be noted that the zero-configuration deployment device of the network device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0155] The functional units and modules in the above embodiments may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the above integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.
[0156] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0157] An embodiment of the present application further provides an electronic device, the electronic device comprising one or more processors and a memory;
[0158] The memory is coupled to one or more processors, and the memory is used to store computer program codes, the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the zero configuration deployment method of the network device shown above.
[0159] The electronic device may be a mobile phone, a smart screen, a tablet computer, a wearable electronic device, an in-vehicle electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, or a communication device such as a server, a storage device, a base station, or a smart car, etc. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.
[0160] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored; when the computer-readable storage medium is executed on an electronic device, the electronic device executes the zero-configuration deployment method for the network device shown above.
[0161] The above-mentioned computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The above-mentioned computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated therein. The above-mentioned available media may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium, or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0162] The embodiment of the present application also provides a computer program product including computer instructions, which, when executed on an electronic device, enables the electronic device to execute the zero-configuration deployment method for the network device shown above.
[0163] The computer storage medium and computer program product provided in the above-mentioned embodiments of the present application are used to execute the method provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding beneficial effects of the method provided above, and will not be repeated here.
[0164] In the above embodiments, it can also be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above-mentioned computer program product includes one or more computer instructions. When the above-mentioned computer instructions are loaded and executed on a computer, the above-mentioned process or function according to the embodiment of the present application is generated in whole or in part. The above-mentioned computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the above-mentioned computer instructions can be transmitted from a website site, computer, server or data center by wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (such as: infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The above-mentioned computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, digital versatile discs (DVD)), or semiconductor media (eg, solid state disks (SSD)).
[0165] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0166] The memory 701 can be used to store computer software programs 702 and modules, and the processor 703 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 701. The memory 701 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory 701 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0167] Among them, the processor 703 may include one or more processors such as a central processing unit, an application processor (AP), a baseband processor, etc. The processor may be the nerve center and command center of the wireless router. The processor 703 may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions. The memory 701 may be used to store computer executable program codes, and the executable program codes include instructions. The processor 703 executes various functional applications and data processing of the network device by running the instructions stored in the memory. The memory 701 may include a program storage area and a data storage area, such as storing data of a sound signal to be played. For example, the memory may be a double rate synchronous dynamic random access memory DDR or a flash memory Flash.
[0168] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0169] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments applied for herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0170] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the above modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0171] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0172] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some of the technical features therein by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A zero-configuration deployment method for a network device, characterized in that: include: In response to a startup operation of any network device in the network topology structure, determining a startup file of the network device, wherein the startup file is at least used to indicate a plurality of startup services that the network device needs to execute; According to the deployment service names of the plurality of deployment services, traversing the deployment service list of the network device, wherein the deployment service list pre-stores deployment service names, callback functions and priorities corresponding to the plurality of deployment services respectively; According to the priorities corresponding to the plurality of deployment services, the callback functions corresponding to the plurality of deployment services are called to control the plurality of deployment services to execute deployment service configuration in sequence.
2. The method according to claim 1, characterized in that The calling of callback functions corresponding to the plurality of deployment services respectively according to their respective priorities, and controlling the plurality of deployment services to sequentially execute deployment service configurations, comprises: Sorting the plurality of the deployment services according to respective priorities corresponding to the plurality of deployment services to generate a deployment service sequence list; Reading, from a user configuration file of the network device, a current deployment service of which the network device has currently executed deployment service configuration; Determine the next start-up service of the current start-up service in the start-up service sequence list; Calling a callback function corresponding to the next deployment service, so that the next deployment service is controlled by the callback function to execute the corresponding deployment service configuration, until the plurality of deployment services are sequentially executed to complete the deployment service configuration, wherein the deployment service configuration includes at least one of the following: software upgrade, feature library entry, configuration package import, and command line configuration.
3. The method according to claim 2, characterized in that The calling of the callback function corresponding to the next start service includes: Determining whether the next deployment service is a deployment service that the deployment file indicates the network device needs to execute, and determining whether the next deployment service is an undeployed service of the network device; When it is determined that the next deployment service is the deployment service that the network device needs to execute and the next deployment service is the undeployed service, calling the callback function corresponding to the next deployment service is executed.
4. The method according to claim 2, characterized in that: Before calling the callback function corresponding to the next start service, the method further includes: Writing the next start service into a user configuration file of the network device; The user configuration file is updated to the persistent storage area of the network device.
5. The method according to any one of claims 2 to 4, characterized in that The method further comprises: In response to a restart operation of the network device, reading a user configuration file of the network device; In a case where it is determined based on the user configuration file that the network device is currently in a process of executing a deployment service configuration, reading a current deployment service for which the network device has currently executed the deployment service configuration from the user configuration file of the network device; Traversing the startup service sequence list to determine the next startup service of the current startup service; A callback function corresponding to the next deployment service is called, so that the next deployment service is controlled by the callback function to execute the corresponding deployment service configuration, until the deployment services are executed in sequence to complete the deployment service configuration.
6. The method according to any one of claims 1 to 4, characterized in that After calling the callback functions corresponding to the plurality of deployment services respectively according to the priorities corresponding to the plurality of deployment services respectively, and controlling the plurality of deployment services to sequentially execute deployment service configuration, the method further includes: In response to the last deployment service of the plurality of deployment services executing and completing the deployment service configuration, the deployment function of the persistent storage area of the network device is closed.
7. The method according to any one of claims 1 to 4, characterized in that The method further comprises: In response to the editing operation on the deployment service list, new table data is added and / or existing table data is deleted in the deployment service list.
8. A zero-configuration deployment device for a network device, characterized in that: include: A response unit, configured to determine a startup file of any network device in the network topology structure in response to a startup operation of the network device, wherein the startup file is at least used to indicate a plurality of startup services that the network device needs to execute; A traversal unit, used for traversing the startup service list of the network device according to the startup service names of the plurality of startup services, wherein the startup service list pre-stores the startup service names, callback functions and priorities corresponding to the plurality of startup services respectively; The configuration and deployment unit is used to call the callback functions corresponding to the plurality of deployment services respectively according to the priorities corresponding to the plurality of deployment services respectively, and control the plurality of deployment services to execute deployment service configuration in sequence.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
