A cloud-native platform with tens of millions of microservices and millions of nodes based on k8s
By combining open source tools and k8s mechanisms, a cloud-native platform is provided, which solves the problems of low microservice deployment efficiency and poor code security, and achieves efficient and secure deployment and code auditing.
Patent Information
- Application Number
- CN202410827872.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2044-06-25
AI Technical Summary
The prior art requires a lot of manpower and material resources and time when deploying microservices, and it is difficult to ensure the security and quality of the code.
Combining open source tools such as gitlab, Jenkins, sonar and Harbor, based on the k8s mechanism, it provides a cloud-native platform, including data acquisition, data preprocessing, MC module, solution deployment performance evaluation module, performance prediction module and human-computer interaction module, to realize one-click deployment and code auditing.
It greatly improves deployment efficiency, saves manpower and time costs, ensures stable implementation and stable operation of the project, and improves code security quality detection and vulnerability scanning.
Smart Images

Figure CN118860420B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud native platforms, and more specifically to a cloud native platform with tens of millions of microservices and millions of nodes based on k8s. Background Art
[0002] Currently, the mainstream way to deploy microservices in the industry is to manually upload Jar packages to the server. If the size and number of Jar packages exceed certain limits, a large number of operation and maintenance and development staff will be required to cooperate repeatedly, wasting manpower and material resources, increasing unnecessary communication costs, and taking a lot of time to complete the normal deployment of the service.
[0003] To solve the above dilemma, the present invention combines a series of open source tools such as gitlab, Jenkins, sonar and Harbor, and based on the k8s mechanism, can deploy tens of millions of microservices on millions of servers with one click, saving a lot of manpower, material resources and time costs, greatly improving the deployment efficiency, and during the deployment process, the security quality of the code is audited to avoid code vulnerabilities and ensure smooth online operation. Summary of the invention
[0004] In order to overcome the above-mentioned defects of the prior art, the present invention provides a cloud-native platform with tens of millions of microservices and millions of nodes based on k8s to solve the problems existing in the above-mentioned background technology.
[0005] The present invention provides the following technical solutions: a cloud native platform with tens of millions of microservices and millions of nodes based on k8s, including a data acquisition module, a data preprocessing module, an MC module, a solution deployment performance evaluation module, a performance prediction module, and a human-computer interaction module;
[0006] The data acquisition module is used to collect the task arrival time, task type, subtask set and assignable node set as target data and then transmit them to the data preprocessing module;
[0007] The data preprocessing module is used to clean and reduce noise of the target data, obtain target data that can be directly used and transmit it to the MC module;
[0008] The MC module is used to receive the target data transmitted by the data preprocessing module, and set node constraints according to the target data. The node constraints include a data constraint formula and a computing resource constraint formula. The data constraint formula is: Among them, D i is the size of the i-th data on node x, C max is the total storage resource of node x; the computing resource constraint formula is: Among them, Ei is the computing resources required by the ith service on node x, E max is the total amount of computing resources of node x; and transmits the processed data to the solution deployment performance evaluation module;
[0009] The solution deployment performance evaluation module is used to receive data transmitted by the MC module. The solution deployment performance evaluation module writes the deployment scheme of the microservice on the nodes in the network in the form of a matrix, and uses the matrix X to represent the deployment scheme of the microservice on the nodes in the network. Among them, X ab Indicates that the bth microservice is deployed at node a, A is the number of all nodes in the current network system, and B is the total number of microservice types that will be called in all K tasks; the performance of the service deployment solution is evaluated, and the formula for evaluating the performance of the service deployment solution is: Among them, T ave is the average execution time of the k tasks that have been completed so far, which can be used to represent the performance of the deployment solution, where a single task T i The calculation formula for the execution time is: T i =T trans,i +T exec,i , where T trans,i represents the transmission delay of the entire process of executing the i-th task, T exec,i It represents the execution time of the entire process of executing the i-th task, and transmits the evaluation result to the performance prediction module;
[0010] The performance prediction module is used to receive the evaluation results transmitted by the solution deployment performance evaluation module, predict the service deployment solution performance by building an LSTM neural network model, and its prediction output is the predicted service deployment solution performance at n moments in the future, and transmit the prediction results to the human-computer interaction module;
[0011] The human-computer interaction module is used to perform human-computer interaction display on the prediction results transmitted by the performance prediction module.
[0012] Preferably, the LSTM neural network model constructed by the performance prediction module includes:
[0013] Initialize the basic architecture of the LSTM neural network model, which includes an input layer, two LSTM units, a Dropout layer, a fully connected layer, a learnable parameter activation function, a comprehensive loss function, an optimizer, a regularizer, and an output layer; the output layer includes n nodes;
[0014] Each LSTM unit consists of a memory unit and three control gates; the three control gates are input gate, forget gate and output gate; a fully connected layer is added between LSTM units;
[0015] The Dropout layer randomly discards a certain proportion of nodes from the LSTM neural network model temporarily, which can effectively prevent overfitting.
[0016] Preferably, the learnable parameter activation function is: Among them, f is the input data, p 1 is a learnable slope parameter that controls the slope of the linear transformation of f; p 2 is a learnable offset parameter that controls the offset of the Sigmoid function.
[0017] Preferably, the formula of the comprehensive loss function LOSS is: Among them, q is the quantile, which represents the quantile level in the loss calculation. The value of q is between (0, 1), which determines whether the loss is calculated for the lower quantile or the upper quantile. true is the true target value, y pred low is the lower quantile of the predicted distribution, y pred high is the upper quantile of the predicted distribution; || + is the positive function, which ensures that only positive differences between the prediction and the true value contribute to the loss.
[0018] Preferably, the optimizer is an adaptive optimizer, and its optimization formula is: Among them, δ λ+1,l is the parameter of the lth layer of the LSTM neural network model when the number of training iterations is λ+1, δ λ,l is the parameter of the lth layer of the LSTM neural network model when the number of training iterations is λ; η l is the learning rate of the lth layer of the LSTM neural network model, v λ is the exponential moving average of the squared gradients for training iterations λ, ρ is a small constant to prevent the denominator from being zero, and m λ,l is the parameter gradient for the training iteration number λ.
[0019] Technical effects and advantages of the present invention:
[0020] The present invention is provided with a solution deployment performance evaluation module and a performance prediction module, which is conducive to writing the deployment plan of microservices on nodes in the network in the form of a matrix, evaluating the performance of the service deployment plan, and predicting the performance of the service deployment plan by constructing an LSTM neural network model. In addition, the present invention combines a series of open source tools such as gitlab, Jenkins, sonar and Harbor, and is based on the mechanism of k8s. It has high efficiency, security, cross-platform, stability and elastic scalability, improves work efficiency, saves a lot of manpower and time costs for enterprises, ensures the stable implementation and stable operation of the project, and improves the quality inspection and vulnerability scanning of code security, realizes fast and stable, lightweight and rapid migration to any environment for efficient construction and deployment, and greatly reduces production problems caused by manual misoperation of operation and maintenance personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a structural diagram of the cloud-native platform with tens of millions of microservices and millions of nodes based on k8s of the present invention. DETAILED DESCRIPTION
[0022] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. In addition, the forms of the various structures recorded in the following implementation modes are only examples. The cloud native platform with tens of millions of microservices and millions of nodes based on k8s involved in the present invention is not limited to the various structures recorded in the following implementation modes. All other implementation modes obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0023] The present invention provides a cloud native platform with tens of millions of microservices and millions of nodes based on k8s, including a data acquisition module, a data preprocessing module, an MC module, a solution deployment performance evaluation module, a performance prediction module, and a human-computer interaction module;
[0024] The data acquisition module collects data and then transmits it to the data preprocessing module. The data preprocessing module is used to receive the data collected by the data acquisition module, preprocess the data and then transmit it to the MC module. After receiving the data from the data preprocessing module, the MC module sets the saving constraint conditions and then transmits the data to the solution deployment performance evaluation module. The solution deployment performance evaluation module is used to evaluate the performance of the service deployment solution and transmit the evaluated data to the performance prediction module. The performance prediction module is used to predict the performance of the service deployment solution by constructing a neural network model and transmit it to the human-computer interaction module. The human-computer interaction module is used to display the data through human-computer interaction.
[0025] In this embodiment, it should be specifically explained that the data acquisition module is used to collect target data, and the target data includes task arrival time, task type, assignable nodes and subtask set;
[0026] The data preprocessing module is used to obtain target data that can be directly used by cleaning and denoising the data;
[0027] The MC module sets the arrival time of the i-th task to t i , the task type is k i , the subtask set is S ki , the set of nodes that can be assigned is V i , and set node constraints; in the cloud native network system of deployed microservices, after the task arrives at the system, it needs to be assigned to different nodes for execution according to the status of the network nodes; assuming that there are n tasks in total, i = 1, 2, 3...n; the node set V i The nodes in the task should have the computing and storage resources required to complete the task type, and have deployed the microservices required for the current subtask or have the physical conditions for the newly deployed microservices, that is, they should meet the node constraints.
[0028] The node constraint conditions include data constraint formulas and computing resource constraint formulas;
[0029] The data constraint formula is: Among them, D i is the size of the i-th data on node x, C max is the total storage resource of node x;
[0030] The computing resource constraint formula is: Among them, E i is the computing resources required by the ith service on node x, E max is the total amount of computing resources of node x.
[0031] In this embodiment, it should be specifically explained that the solution deployment performance evaluation module writes the deployment scheme of the microservice on the nodes in the network in the form of a matrix and evaluates the performance of the service deployment scheme;
[0032] Use matrix X to represent the deployment scheme of microservices on nodes in the network. Among them, X ab Indicates that the bth microservice is deployed on node a, A is the number of all nodes in the current network system, and B is the total number of microservice types that will be called in all K tasks;
[0033] The formula for evaluating the performance of the service deployment solution is: Among them, T aveis the average execution time of the k tasks that have been completed so far, which can be used to represent the performance of the deployment solution, where a single task T i The calculation formula for the execution time is: T i =T trans,i +T exec,i , where T trans,i represents the transmission delay of the entire process of executing the i-th task, T exec,i Represents the total execution time of the i-th task.
[0034] In this embodiment, it should be specifically explained that the performance prediction module is used to predict the performance of the service deployment solution by constructing the LSTM neural network model; the construction method of the LSTM neural network model includes:
[0035] Initialize the basic architecture of the LSTM neural network model, which includes an input layer, two LSTM units, a Dropout layer, a fully connected layer, a learnable parameter activation function, a comprehensive loss function, an optimizer, a regularizer, and an output layer; the output layer includes n nodes;
[0036] Each LSTM unit consists of a memory unit and three control gates; the three control gates are input gate, forget gate and output gate; a fully connected layer is added between LSTM units;
[0037] The Dropout layer randomly discards a certain proportion of nodes from the LSTM neural network model temporarily, which can effectively prevent overfitting;
[0038] The learnable parameter activation function is: Among them, f is the input data, p 1 is a learnable slope parameter that controls the slope of the linear transformation of f, p 1 The value of will affect the gradient of the Sigmoid function in the input space, thereby affecting the response speed of the Sigmoid function to the input; 1 The learning of can adapt the model to different ranges of activation values in the data; p 2 is a learnable offset parameter that controls the offset of the Sigmoid function, allowing the model to adapt to different baselines or offsets in the input data. 2 Learning can enable the model to better model the overall pattern of the data;
[0039] P 1 and p 2 The specific value of is obtained through model training; in deep learning, training is performed through the back-propagation algorithm and optimizer, which adjusts the parameters in the network so that the model achieves better performance on the training data;
[0040] Uncertainty modeling is introduced into the loss function to obtain the comprehensive loss function LOSS;
[0041] Among them, q is the quantile, which represents the quantile level in the loss calculation. The value of q is between (0, 1), which determines whether the loss is calculated for the lower quantile or the upper quantile. true is the true target value, y pred low is the lower quantile of the predicted distribution, y pred high is the upper quantile of the predicted distribution; || + is the positive function, which ensures that only when the difference between the prediction and the true value is positive will it contribute to the loss;
[0042] The optimizer adopts an adaptive optimizer that adaptively adjusts the learning rate;
[0043] The optimization formula of the adaptive optimizer is: Among them, δ λ+1,l is the parameter of the lth layer of the LSTM neural network model when the number of training iterations is λ+1, δ λ,l is the parameter of the lth layer of the LSTM neural network model when the number of training iterations is λ; η l is the learning rate of the lth layer of the LSTM neural network model. Different learning rates are selected according to different layers. λ is the exponential moving average of the squared gradients for training iterations λ, ρ is a small constant to prevent the denominator from being zero, and m λ,l is the parameter gradient for the training iteration number λ;
[0044] If LOSS λ >LOSS λ+1 , then δ λ+1,l =δ λ,l ×F, where LOSS λ is the value of the comprehensive loss function when the number of training iterations is λ, LOSS λ-1 is the value of the comprehensive loss function when the number of training iterations is λ-1; F is the reduction parameter;
[0045] The regularizer uses L2 norm regularization to control the complexity of the LSTM neural network model and prevent overfitting;
[0046] The n output layers are used to output the performance of the service deployment solution at n moments.
[0047] In this embodiment, it should be specifically explained that when the LSTM neural network model is applied to the service deployment plan performance prediction, the input data is the performance of the deployment plan evaluated by the plan deployment performance evaluation module, and the output layer outputs the predicted service deployment plan performance at the next n moments.
[0048] In this embodiment, it should be specifically explained that the cloud native platform of tens of millions of microservices and millions of nodes based on k8s proposed in this embodiment pulls the code by calling the gitlab API to realize the automatic management of the code. As a code hosting platform, gitlab provides a rich API interface, which can easily obtain code information, perform branch management, submit code and other operations. By integrating the gitlab API, the automatic pulling and version control of the code can be realized to ensure that the latest and correct code is deployed each time.
[0049] Secondly, use the Jenkins API and k8s API to automate the construction of services. Jenkins is a powerful automated construction tool that can be integrated with various programming languages and construction tools to achieve automated compilation, packaging, and testing. By calling the Jenkins API, the construction process can be integrated into the DevOps platform, and Jenkins can be scaled through k8s to compile hundreds of projects at the same time. And cooperate with k8s for one-click construction and deployment. Not only does it greatly improve construction efficiency, but it also reduces the possibility of human errors.
[0050] Use k8s API for automated deployment and elastic scaling. As a container orchestration platform, k8s provides powerful automated management and scheduling capabilities. By calling k8s API, you can achieve automated deployment, expansion and reduction of services. You can dynamically adjust the number and configuration of services according to business needs and server load conditions to ensure service stability and availability.
[0051] In addition, the sonar API is integrated to perform security and quality checks on the server. Sonar is a static code analysis tool that can help find potential problems and vulnerabilities in the code. By calling the sonar API, code checks can be automatically performed during the build process to ensure code quality and security.
[0052] Finally, use Harbor's API to manage and store images. Harbor is an open source container image repository that can easily store and manage container images. By calling Harbor's API, you can automatically upload, download, and version control images to ensure the security and consistency of images.
[0053] Through the self-developed DevOps platform, we have achieved full automation from code creation, pulling, building, testing, deployment to elastic scaling. The application deployment work that originally took a month and 50 people to complete can now be completed by one person with one-click operation in one hour. More importantly, we have achieved the decoupling of services and servers, and can freely scale the number of services. This not only greatly improves work efficiency, but also reduces operation and maintenance costs, providing strong support for the company's business development.
[0054] At the same time, the DevOps platform also has good scalability and flexibility. With the development of business and the update of technology, we can easily integrate new tools and technologies to meet the ever-changing needs.
[0055] In this embodiment, it should be specifically explained that the difference between this embodiment and the prior art lies mainly in that this embodiment has a solution deployment performance evaluation module and a performance prediction module, which are used to write the deployment plan of the microservice on the node in the network in the form of a matrix, and evaluate the performance of the service deployment plan, and predict the performance of the service deployment plan by building an LSTM neural network model, and combine a series of open source tools such as gitlab, Jenkins, sonar and Harbor, based on the mechanism of k8s, with high efficiency, security, cross-platform, stability and elastic scalability, which improves work efficiency, saves a lot of manpower and time costs for enterprises, ensures the stable implementation and stable operation of the project, and improves the quality inspection and vulnerability scanning of code security, and realizes fast and stable, lightweight and rapid migration to any environment for efficient construction and deployment, which greatly reduces the production problems caused by manual misoperation of operation and maintenance personnel.
[0056] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0057] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A cloud-native platform with tens of millions of microservices and millions of nodes based on k8s, characterized by: It includes data acquisition module, data preprocessing module, MC module, solution deployment performance evaluation module, performance prediction module and human-computer interaction module; The data acquisition module is used to collect the task arrival time, task type, subtask set and assignable node set as target data and then transmit them to the data preprocessing module; The data preprocessing module is used to clean and reduce noise of the target data, obtain target data that can be directly used and transmit it to the MC module; The MC module is used to receive the target data transmitted by the data preprocessing module, and set node constraints according to the target data. The node constraints include a data constraint formula and a computing resource constraint formula. The data constraint formula is: Among them, D i is the size of the i-th data on node x, C max is the total storage resource of node x; the computing resource constraint formula is: Among them, E i is the computing resources required by the ith service on node x, E max is the total amount of computing resources of node x; and transmits the processed data to the solution deployment performance evaluation module; The solution deployment performance evaluation module is used to receive data transmitted by the MC module. The solution deployment performance evaluation module writes the deployment scheme of the microservice on the nodes in the network in the form of a matrix, and uses the matrix X to represent the deployment scheme of the microservice on the nodes in the network. Among them, X ab Indicates that the bth microservice is deployed at node a, A is the number of all nodes in the current network system, and B is the total number of microservice types that will be called in all K tasks; the performance of the service deployment solution is evaluated, and the formula for evaluating the performance of the service deployment solution is: Among them, T ave is the average execution time of the k tasks that have been completed so far, which can be used to represent the performance of the deployment solution, where a single task T i The calculation formula for the execution time is: T i =T trans,i +T exec,i , where T trans,i represents the transmission delay of the entire process of executing the i-th task, T exec,i It represents the execution time of the entire process of executing the i-th task, and transmits the evaluation result to the performance prediction module; The performance prediction module is used to receive the evaluation results transmitted by the solution deployment performance evaluation module, predict the service deployment solution performance by building an LSTM neural network model, and its prediction output is the predicted service deployment solution performance at n moments in the future, and transmit the prediction results to the human-computer interaction module; The human-computer interaction module is used to perform human-computer interaction display on the prediction results transmitted by the performance prediction module.
2. According to claim 1, a cloud native platform with tens of millions of microservices and millions of nodes based on k8s, characterized in that: The LSTM neural network model constructed by the performance prediction module includes: Initialize the basic architecture of the LSTM neural network model, which includes an input layer, two LSTM units, a Dropout layer, a fully connected layer, a learnable parameter activation function, a comprehensive loss function, an optimizer, a regularizer, and an output layer; the output layer includes n nodes; Each LSTM unit consists of a memory unit and three control gates; the three control gates are input gate, forget gate and output gate; a fully connected layer is added between LSTM units; The Dropout layer randomly discards a certain proportion of nodes from the LSTM neural network model temporarily, which can effectively prevent overfitting.
3. According to claim 2, a cloud native platform with tens of millions of microservices and millions of nodes based on k8s, characterized in that: The learnable parameter activation function is: Among them, f is the input data, p1 is the learnable slope parameter that controls the slope of the linear transformation of f; p2 is the learnable offset parameter that controls the offset of the Sigmoid function.
4. According to claim 2, a cloud native platform with tens of millions of microservices and millions of nodes based on k8s, characterized in that: The formula of the comprehensive loss function LOSS is: Among them, q is the quantile, which represents the quantile level in the loss calculation. The value of q is between (0, 1), which determines whether the loss is calculated for the lower quantile or the upper quantile. true is the true target value, y pred low is the lower quantile of the predicted distribution, y pred high is the upper quantile of the predicted distribution; || + is the positive function, which ensures that only positive differences between the prediction and the true value contribute to the loss.
5. According to claim 2, a cloud native platform with tens of millions of microservices and millions of nodes based on k8s, characterized in that: The optimizer is an adaptive optimizer, and its optimization formula is: Among them, δ λ+1,l is the parameter of the lth layer of the LSTM neural network model when the number of training iterations is λ+1, δ λ,l is the parameter of the lth layer of the LSTM neural network model when the number of training iterations is λ; η l is the learning rate of the lth layer of the LSTM neural network model, v λ is the exponential moving average of the squared gradients for training iterations λ, ρ is a small constant to prevent the denominator from being zero, and m λ,l is the parameter gradient for the number of training iterations λ.
Citation Information
Patent Citations
Container scheduling method and device, equipment and storage medium
CN115951902A