Methods for building a microservices-based and multi-language network controller architecture
Patent Information
- Application Number
- CN202111404061.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-24
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-11-24
AI Technical Summary
但是,传统数据中心网络控制器多使用统一编程语言(JAVA, C++等)进行集中式开发,存在低内聚,高耦合,开发效率低等各种软件开发问题
[0036] According to the method of constructing a network controller architecture based on microservices and multi-language according to the embodiment of the present invention, different programming languages can be used to develop microservices in parallel. Appropriate development languages can be selected according to specific business needs to achieve better and faster implementation Specific business requirements for network controllers.
Smart Images

Figure CN114172782B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network controller architecture, and in particular to a method for building a network controller architecture based on microservices and multiple languages. Background Art
[0002] As the country vigorously develops new infrastructure, data center construction has become a top priority. With the large-scale deployment of data centers, large data center clusters are planned to accommodate more than 1 million servers. In order to manage large data center networks, network controller management software was introduced, which greatly improved the carrying and service capabilities of data center networks. As the "brain" of the entire data center network, the high-reliability deployment of the network controller is very important for the safe and stable operation of the data center network. However, traditional data center network controllers are mostly developed in a unified programming language (JAVA, C++, etc.), which has various software development problems such as low cohesion, high coupling, and low development efficiency. Summary of the invention
[0003] According to an embodiment of the present invention, a method for building a network controller architecture based on microservices and multi-language is provided, comprising the following steps:
[0004] Build the Dapr development environment;
[0005] Develop gateway, user management, operation and maintenance management, and real-time alarm microservices in parallel;
[0006] Joint debugging gateway, user management, operation and maintenance management, and real-time alarm microservices.
[0007] Furthermore, building the Dapr development environment includes the following sub-steps:
[0008] Install Dapr CLI;
[0009] Verify Dapr CLI;
[0010] Install the Dapr runtime binary and verify the Dapr version;
[0011] Verify that the container is running and that the component catalog is initialized.
[0012] Further, by restarting the terminal / command prompt, run to verify the Dapr CLI.
[0013] Furthermore, the gateway, user management, operation and maintenance management, and real-time alarm microservices can use different development languages respectively.
[0014] Further, developing the gateway microservice includes the following sub-steps:
[0015] Build the Nginx and OpenResty development environment;
[0016] Create a views-count folder, and create four subfolders in the views-count folder directory: bin, config, logs, and lua;
[0017] The bin directory contains shell scripts for starting and stopping Nginx, the config directory contains the mime.types file which is the MIME Type used by Nginx, and the lua directory contains the lua script file.
[0018] Furthermore, developing the user management microservice includes the following sub-steps:
[0019] Issue a token to the logged-in user;
[0020] Verify that the username and password are correct;
[0021] After successful login, if the logged-in user has registered the same name in the API gateway, add the acl plug-in and the jwt plug-in;
[0022] Check if there is an old jwt key in the API Gateway, and delete it if it exists;
[0023] Create a new jwt key, generate the corresponding jwt according to the jwt key, and return to the front end.
[0024] Furthermore, the password is transmitted in MD5 form.
[0025] Furthermore, development and operation management includes the following sub-steps:
[0026] Start go-routine and register services with the gateway through sidecar.
[0027] Register new services and routes;
[0028] Add jwt and acl plugins for new services;
[0029] According to the URL nodeid parameter sent by the front end, select the REST server of the corresponding switch device to access and read or write the configuration information of the switch.
[0030] Furthermore, developing a real-time alert microservice includes the following sub-steps:
[0031] Create a message notification group, create a robot in the message notification group, and obtain the webhook URL address in the group;
[0032] Use python to develop webhook microservices;
[0033] Periodically poll the status of all switch devices from the OAM microservice;
[0034] The OAM microservice sends all switch device status information to the webhook microservice;
[0035] If an abnormal status is found, the webhook microservice will send the abnormal switch device ID and status to the message notification group in markdown format in real time.
[0036] According to the method for constructing a network controller architecture based on microservices and multiple languages according to an embodiment of the present invention, microservices can be developed in parallel using different programming languages. Suitable development languages can be selected for specific business needs, thereby realizing the specific business needs of the network controller better and faster.
[0037] It is to be understood that both the foregoing general description and the following detailed description are exemplary, and are intended to provide further explanation of the technology as claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flowchart of a method for building a microservice and multi-language based network controller architecture according to an embodiment of the present invention;
[0039] Figure 2 for Figure 1 The flowchart of setting up the Dapr development environment;
[0040] Figure 3 for Figure 1 API Gateway Microservice Development Flowchart;
[0041] Figure 4 for Figure 1 User management microservice development flow chart;
[0042] Figure 5 for Figure 1 OAM operation and maintenance management microservice development flow chart;
[0043] Figure 6 for Figure 1 Webhook real-time alarm microservice development flow chart. DETAILED DESCRIPTION
[0044] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings to further illustrate the present invention.
[0045] First, combine Figures 1 to 6 A method for building a microservice and multi-language based network controller architecture according to an embodiment of the present invention is described, which is used for a network controller architecture with a wide range of application scenarios.
[0046] like Figure 1 As shown, the method for constructing a network controller architecture based on microservices and multi-languages according to an embodiment of the present invention comprises the following steps:
[0047] Specifically, in S1, Figure 1 As shown in the figure, a Dapr (Distributed Application Runtime) development environment is built. By using the open source software architecture Dapr, elastic microservice application development can be performed on the cloud platform and the edge.
[0048] Furthermore, building the Dapr development environment includes the following sub-steps:
[0049] In S11, Figure 2 Install Dapr CLI as shown.
[0050] In S12, Figure 2 As shown, verify the Dapr CLI; in this embodiment, by restarting the terminal / command prompt, run to verify the Dapr CLI.
[0051] In S13, Figure 2 As shown, install the Dapr runtime binary and verify the Dapr version.
[0052] In S14, Figure 2 Verify that the container is running and that the component catalog is initialized as shown.
[0053] Specifically, in S2, if Figure 1 As shown, the gateway, user management, operation and maintenance management, and real-time alarm microservices are developed in parallel. In this embodiment, the gateway, user management, operation and maintenance management, and real-time alarm microservices can be developed in different languages respectively.
[0054] Further, develop a gateway microservice. In this embodiment, Lua is used to develop an API gateway microservice, which includes the following sub-steps:
[0055] In S211, Figure 3 As shown, build the Nginx and OpenResty development environment;
[0056] In S212, if Figure 3 As shown, create a views-count folder, and create four subfolders, bin, config, logs, and lua, in the views-count folder directory;
[0057] In S213, if Figure 3As shown, the bin directory stores the shell scripts for starting and stopping Nginx, the config directory stores the mime.types file which is the MIME Type used by Nginx, and the lua directory stores the lua script files.
[0058] Further, develop a user management microservice. In this embodiment, golang is used to develop a user user management microservice, which includes the following sub-steps:
[0059] In S221, if Figure 4 As shown, a token is issued to the logged-in user;
[0060] In S222, if Figure 4 As shown, verify whether the user name and password are correct; in this embodiment, the password is transmitted in MD5 format.
[0061] In S223, if Figure 4 As shown, after successful login, if the logged-in user registers the same name in the API gateway, add the acl plug-in and the jwt plug-in;
[0062] In S224, if Figure 4 As shown, check whether there is an old jwt key in the API gateway, and delete it if it exists;
[0063] In S225, if Figure 4 As shown, create a new jwt key, generate the corresponding jwt according to the jwt key, and return to the front end.
[0064] Further, the operation and maintenance management is developed. In this embodiment, node.js is used to develop the OAM operation and maintenance management microservice, which includes the following sub-steps:
[0065] In S231, if Figure 5 As shown, start go-routine and register the service with the gateway through sidecar;
[0066] In S232, if Figure 5 As shown, register new services and routes;
[0067] In S233, if Figure 5 As shown, add jwt and acl plug-ins to the new service;
[0068] In S234, Figure 5 As shown, according to the URL nodeid parameter sent by the front end, choose to access the rest server of the corresponding switch device to read or write the configuration information of the switch.
[0069] Further, develop a real-time alarm microservice. In this embodiment, Python is used to develop a webhook real-time alarm microservice, which includes the following sub-steps:
[0070] In S241, Figure 6 As shown, create a DingTalk / Slag message notification group, create a robot in the message notification group, and obtain the webhook URL address in the group;
[0071] In S242, if Figure 6 As shown, the webhook microservice is developed using python;
[0072] In S243, Figure 6 As shown, the OAM microservice periodically polls the status of all switch devices;
[0073] In S244, Figure 6 As shown, the OAM microservice sends all switch device status information to the webhook microservice;
[0074] In S245, Figure 6 As shown in the figure, if an abnormal state is found, the OAM microservice will send the abnormal switch device ID and state (such as CPU temperature, memory usage, port real-time rate, etc.) to the message notification group in markdown format in real time.
[0075] Specifically, in S3, Figure 1 As shown, the joint debugging gateway, user management, operation and maintenance management, and real-time alarm microservices.
[0076] The method for building a network controller architecture based on microservices and multiple languages according to an embodiment of the present invention enables developers to focus on writing business logic rather than solving the challenges of distributed systems, thereby significantly improving productivity and reducing development time; at the same time, different languages can be used for development within one system, which can give full play to the advantages of different programming languages.
[0077] Above, refer to Figures 1 to 6 The present invention describes a method for constructing a network controller architecture based on microservices and multiple languages according to an embodiment of the present invention. Microservices can be developed in parallel using different programming languages. Appropriate development languages can be selected for specific business needs, thereby better and faster realizing the specific business needs of the network controller.
[0078] It should be noted that, in this specification, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprises..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0079] Although the content of the present invention has been described in detail through the above preferred embodiments, it should be appreciated that the above description should not be considered as a limitation of the present invention. After reading the above content, it will be apparent to those skilled in the art that various modifications and substitutions of the present invention will occur. Therefore, the protection scope of the present invention should be limited by the appended claims.
Claims
1. A method for building a microservice and multi-language based network controller architecture, characterized in that: The following steps are included: Build the Dapr development environment; Develop gateway, user management, operation and maintenance management, and real-time alarm microservices in parallel; Jointly debug the gateway, user management, operation and maintenance management, and real-time alarm microservices; Developing the gateway microservice includes the following sub-steps: Build the Nginx and OpenResty development environment; Create a views-count folder, and create four subfolders in the views-count folder directory: bin, config, logs, and lua; The bin directory contains shell scripts for starting and stopping Nginx, the config directory contains mime.types files, which are MIME Types used by Nginx, and the lua directory contains lua script files; Developing the user management microservice includes the following sub-steps: Issue a token to the logged-in user; Verify that the username and password are correct; After successful login, if the logged-in user has registered the same name in the API gateway, add the acl plug-in and the jwt plug-in; Check if there is an old jwt key in the API Gateway, and delete it if it exists; Create a new jwt key, generate the corresponding jwt according to the jwt key, and return to the front end; Developing the operation and maintenance management includes the following sub-steps: Start go-routine and register services with the gateway through sidecar. Register new services and routes; Add jwt and acl plugins for the new service; According to the URL nodeid parameter sent by the front end, select the REST server of the corresponding switch device to access and read or write the configuration information of the switch; Developing the real-time alert microservice includes the following sub-steps: Create a message notification group, create a robot in the message notification group, and obtain the webhook URL address in the group; Use python to develop webhook microservices; Periodically poll the status of all switch devices from the OAM microservice; The OAM microservice sends all switch device status information to the webhook microservice; If an abnormal status is found, the webhook microservice sends the abnormal switch device ID and status to the message notification group in markdown format in real time.
2. The method for constructing a microservice and multi-language based network controller architecture as claimed in claim 1, characterized in that: Building the Dapr development environment includes the following sub-steps: Install Dapr CLI; Verify Dapr CLI; Install the Dapr runtime binary and verify the Dapr version; Verify that the container is running and that the component catalog is initialized.
3. The method for constructing a microservice and multi-language based network controller architecture as claimed in claim 2, characterized in that: Verify the Dapr CLI by restarting your terminal / command prompt and running.
4. The method for constructing a microservice and multi-language based network controller architecture as claimed in claim 1, characterized in that: The gateway, user management, operation and maintenance management, and real-time alarm microservices can use different development languages respectively.
5. The method for constructing a microservice and multi-language based network controller architecture as claimed in claim 1, characterized in that: The password is transmitted in MD5 format.
