Rail transit software application scheduling method based on Kubernetes
Through Kubernetes container orchestration and management technology, it solves the resource waste and migration expansion problems when urban rail software applications are deployed on servers, achieves efficient utilization of hardware resources and stable operation of software, reduces operation and maintenance costs, and supports fast and smooth upgrades. and expansion.
Patent Information
- Application Number
- CN202011560581.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-25
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2040-12-25
AI Technical Summary
When existing urban rail software applications are deployed directly on servers, hardware resources are wasted due to process interference, labor costs are high, migration and expansion are difficult, and upgrades and expansions due to large data volumes take a long time, affecting the stable operation of rail transit software.
Using Kubernetes container orchestration and management technology, we build container images on server clusters and perform containerized deployment of software applications through Kubernetes replica controllers to achieve high utilization of hardware resources and efficient software operation, reduce labor costs, and eliminate the gap between software and hardware. Strong coupling enables fast and smooth upgrades and expansion.
Kubernetes technology achieves efficient utilization of hardware resources and stable operation of software, reduces operation and maintenance costs, reduces dependence on hardware, supports rapid and smooth upgrades and expansion of software and hardware, and improves the stability and stability of rail transit software applications. flexibility.
Smart Images

Figure CN112559157B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rail transit software application scheduling, and in particular to a rail transit software application scheduling method based on Kubernetes. Background Art
[0002] Urban rail transit has become an indispensable part of a developed city. With the development of intelligent technology, various intelligent software technologies have begun to be applied to the operation and maintenance of urban rail transit. However, since urban rail intelligent technology is still in the development stage, the stability of intelligent software applications needs to be improved. At the same time, as time goes by, the huge amount of data generated by the rail line will test the normal operation of the original software and hardware. Therefore, the use of Kubernetes containerized orchestration management technology on the rail transit intelligent software application platform can effectively ensure the stability of software operation and upgrade transition. In addition, Kubernetes containerized orchestration management technology also provides a hardware cluster interface, which also facilitates the later hardware replacement, expansion, and software scheduling between nodes, alleviates the impact of large data volumes on software and hardware, and further ensures the daily safe operation of urban rail transit.
[0003] Previously, general urban rail software application technologies had the following defects:
[0004] (1) Traditional urban rail software applications are directly deployed on the server. Generally, only one or two software applications can be deployed on a host to prevent interference between software processes. Although this approach can ensure the safe operation of each software, it will cause a certain waste of server resources and increase cost investment.
[0005] (2) If a traditional urban rail software application fails, the operation and maintenance personnel are required to respond quickly to check and repair it. This strong dependence on the operation and maintenance personnel is not conducive to the intelligent development of urban rail transit software. It not only increases the work pressure of the operation and maintenance personnel, but also increases the operational risks of urban rail transit.
[0006] (3) Once traditional urban rail software applications are deployed on a server, they will become highly dependent on the environment and resources of the server, making it difficult to migrate and expand them.
[0007] (IV) When a server component fails or the amount of data is huge, the replacement and upgrade and expansion of the server hardware will enter a very complex workflow, which may result in the uninstallation and reinstallation of the software. The manpower and time required are not allowed during the safe operation of rail transit. Therefore, the upgrade work can only be carried out during non-operating time periods, and the upgrade work time period is relatively limited.
[0008] Therefore, how to avoid the waste of hardware resources and high labor costs caused by mutual interference between different processes when the existing urban rail software applications are directly deployed to the server, the difficulty in migration and expansion due to the strong dependence on the server environment and resources, and the time-consuming upgrade and expansion due to the huge amount of data, are still problems that need to be urgently solved by technical personnel in this field. Summary of the invention
[0009] The present invention provides a rail transit software application scheduling method based on Kubernetes, which is used to solve the defects of existing urban rail software applications being directly deployed to servers, such as waste of hardware resources and high labor costs caused by mutual interference between different processes, difficulty in migration and expansion due to strong dependence on the server environment and resources, and long time consumption for upgrading and expanding due to huge data volume. By deploying Kubernetes containerized orchestration management applications on server clusters, each rail transit software application installed on the server cluster can achieve high utilization of hardware resources and efficient operation of software after Kubernetes containerized deployment, reduce labor costs, release the strong coupling between rail transit software applications and hardware, and achieve the goal of fast and smooth upgrading and expansion of software and hardware.
[0010] The present invention provides a rail transit software application scheduling method based on Kubernetes, the method comprising:
[0011] According to the running programs of each rail transit software application deployed as needed, build the corresponding container images of each rail transit software application and send them to the master host in the Kubernetes server cluster;
[0012] Using a Kubernetes replica controller object to pull the corresponding container images of the rail transit software applications from the master host;
[0013] Based on the current rail transit environment and the corresponding container images, a Kubernetes replica controller is used to deploy containerized rail transit software applications in the Kubernetes server cluster.
[0014] According to a Kubernetes-based rail transit software application scheduling method provided by the present invention, based on the current rail transit environment and the corresponding container images, a Kubernetes replica controller is used to deploy containerized rail transit software applications in the Kubernetes server cluster, including:
[0015] Using the Kubernetes replica controller to pull the corresponding container images from the master host, and determine the monomer pod objects corresponding to the rail transit software applications;
[0016] The Kubernetes replica controller determines the number of each monomer pod object based on the current rail transit environment, and creates a copy of the monomer pod object based on the number;
[0017] The property file of the Kubernetes replica controller includes the master host address pre-written in it.
[0018] According to a Kubernetes-based rail transit software application scheduling method provided by the present invention, if any rail transit software application is a calling component type, the property file for creating the Kubernetes replica controller of any rail transit software application is a deployment.yaml property file;
[0019] If any rail transit software application is of the status viewing type, the property file for creating the Kubernetes replica controller of any rail transit software application is the statefulSet.yaml property file.
[0020] According to a rail transit software application scheduling method based on Kubernetes provided by the present invention, the current rail transit environment includes at least one of the number of collection devices in the current track, the number of physical parameter types that the collection devices need to collect, and the collection and reporting frequency of the collection devices.
[0021] A rail transit software application scheduling method based on Kubernetes provided by the present invention also includes:
[0022] Build the gateway object ambassador of the Kubernetes server cluster;
[0023] The gateway object ambassador is used to provide a unified software access entry for each rail transit software application.
[0024] According to a rail transit software application scheduling method based on Kubernetes provided by the present invention, the gateway object ambassador of the Kubernetes server cluster is constructed, including:
[0025] Edit the replica controller property file ambassador-deployment.yaml and the service property file ambassador-service.yaml of the gateway object ambassador of the Kubernetes server cluster, write the unified software access entry IP address into the ambassador-deployment.yaml, and write the port number of each rail transit software application into the ambassador-service.yaml.
[0026] A rail transit software application scheduling method based on Kubernetes provided by the present invention also includes:
[0027] When each rail transit software application needs to eliminate anomalies or software upgrades, each functional object in the Kubernetes server cluster schedules the distribution of the monomer pod object based on the real-time monitored health of each rail transit software application and the available resources of the hardware node;
[0028] When the Kubernetes server cluster needs to be expanded, a new server is added to the Kubernetes server cluster based on the sealosjoin-master command or the sealos join-node command in the sealos installation tool.
[0029] The present invention also provides a rail transit software application scheduling device based on Kubernetes, comprising:
[0030] A construction unit is used to build corresponding container images of each rail transit software application according to the running programs of each rail transit software application deployed as needed, and send them to the master host in the Kubernetes server cluster;
[0031] A pulling unit, used to pull the corresponding container images of the rail transit software applications from the master host using a Kubernetes replica controller object;
[0032] The deployment unit is used to deploy containerized rail transit software applications in the Kubernetes server cluster using a Kubernetes replica controller based on the current rail transit environment and the corresponding container images.
[0033] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the rail transit software application scheduling method based on Kubernetes as described in any one of the above are implemented.
[0034] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the rail transit software application scheduling method based on Kubernetes as described in any one of the above.
[0035] The rail transit software application scheduling method based on Kubernetes provided by the present invention, by the running program of each rail transit software application arranged as needed, constructs each corresponding container image of each rail transit software application, and sends it to the master host in the Kubernetes server cluster; uses the Kubernetes copy controller object to pull each corresponding container image of each rail transit software application from the master host; based on the current rail transit environment and the corresponding container images, uses the Kubernetes copy controller to deploy containerized rail transit software applications in the Kubernetes server cluster. Since the Kubernetes containerized orchestration management application is arranged on the server cluster, and each rail transit software application needs to consider the current rail transit environment when it is arranged on the Kubernetes server cluster, it is determined whether the amount of data that each software application needs to process is large, and the amount of resources occupied when each rail transit software application is arranged is determined based on the amount of data. Therefore, the use of the Kubernetes containerized orchestration management application can not only release the strong coupling between software and hardware, reduce labor costs, but also reasonably allocate Kubernetes container resources based on the amount of data in the environment where each software application runs. Therefore, the method provided by the present invention realizes high utilization of hardware resources and efficient operation of software, reduces labor costs, releases the strong coupling between rail transit software applications and hardware, and achieves the goal of rapid and smooth upgrade and expansion of software and hardware. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A schematic diagram of a flow chart of a rail transit software application scheduling method based on Kubernetes provided by the present invention;
[0038] Figure 2 A code example diagram of the statefulSet.yaml property file provided by the present invention;
[0039] Figure 3 A schematic diagram of the structure of a rail transit software application scheduling device based on Kubernetes provided by the present invention;
[0040] Figure 4 The overall design diagram of the rail transit intelligent software application operation and maintenance scheduling technology based on Kubernetes containerized orchestration management provided by the present invention;
[0041] Figure 5 An example diagram of a property file for processing a software application by a gateway object provided by the present invention;
[0042] Figure 6 A schematic diagram of the physical structure of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] When existing urban rail software applications are directly deployed to the server, there are common problems such as wasted hardware resources and high labor costs due to interference between different processes, difficulty in migration and expansion due to strong dependence on the server environment and resources, and time-consuming upgrades and expansions due to the huge amount of data. Figure 1-Figure 2 The present invention describes a rail transit software application scheduling method based on Kubernetes. Figure 1 A schematic diagram of the process of the rail transit software application scheduling method based on Kubernetes provided by the present invention is shown in FIG. Figure 1 As shown, the method includes:
[0045] Step 110, according to the running programs of each rail transit software application deployed as needed, build the corresponding container images of each rail transit software application and send them to the master host in the Kubernetes server cluster.
[0046] Optionally, the Kubernetes-based rail transit software application scheduling method provided by the present invention is a method for deploying various rail transit software applications running in a certain rail transit environment on server cluster hardware. The rail transit environment may be a certain operation scenario including multiple stations, or it may be a certain rail line, or it may be an environment including multiple rail lines, that is, the certain rail transit environment is determined based on the hardware performance of the server cluster. If the hardware performance is strong, a large number of rail transit software applications can be deployed on the server cluster to cover multiple lines; and the various rail transit software applications running in the rail transit environment generally include: monitoring software for performing statistical analysis and risk judgment on collected real-time signals, management software for generating maintenance work orders for risk equipment, and logging software for recording collected real-time signals to generate log files so that maintenance personnel can obtain equipment operation status by checking log events at any time, etc.
[0047] The method provided by the present invention is to realize the construction of container images of various rail transit software applications based on the Docker engine in the Kubernetes containerized application. Among them, the Docker engine is an open source application container engine that allows developers to package their applications and dependent packages into a portable container and then publish them to any popular Linux machine. It can also realize virtualization. The containers completely use the sandbox mechanism and there will be no interface between them.
[0048] The Docker engine in Kubernetes containerized applications includes three major components: container images, containers, and image central warehouses. Container images are used to create Docker containers. A container image can contain a complete operating system environment and other applications required by users. Docker container images are readable, and a container image can create multiple containers. A container is an instance created by an image. It can be started, started, stopped, and deleted. Each container is isolated from each other to ensure a secure platform. The image central warehouse is a place where container images are stored centrally. The image central warehouse contains multiple container images, and each container image is set with different labels for distinction. Therefore, before building a container image, it is necessary to analyze the running program and operating system environment of each rail transit software application, and then create a Dockerfile file according to the running program and operating system environment of each rail transit software application in accordance with the requirements of the Docker engine in the Kubernetes containerized application. The Dockerfile file is a text file containing instructions, each of which builds one layer of the container image. Therefore, the content of each instruction is to describe how each layer of the container image should be built. Then, based on the Dockerfile file, the container image corresponding to each rail transit software application is built through the docker build command in the Docker engine of the Kubernetes containerized application, and each container image is pushed to the master host in the server cluster hardware for storage. Specifically, the registry application is installed on the master host as the image central warehouse of the Kubernetes server cluster, and then each container image is pushed to the image central warehouse. The master host is explained here. The Kubernetes server cluster adopts a master-slave architecture. The master host, which is the decision-making master control function, is selected by screening out the host with the strongest hardware performance in the server cluster as the master host. The hardware performance comprehensively considers the storage capacity and CPU performance. It should also be explained here that after creating the container image, you can choose to store the container image in the image central warehouse in the master host or not. However, considering the large number of rail transit software applications, manual deployment alone wastes a lot of time. Therefore, the present invention uses the Kubernetes container management cluster to realize the deployment of container images, which can greatly save the time spent on deployment.
[0049] Step 120: Use the Kubernetes replica controller object to pull the corresponding container images of the rail transit software applications from the master host.
[0050] Optionally, create a daemon.json configuration file on each host in each Kubernetes server cluster, and add the address and port number of the image central warehouse in the daemon.json configuration file to ensure that each host in the cluster can access the image central warehouse of the registry application. At this time, the container image stored in the image central warehouse is equivalent to the template file of each rail transit software application. When each host deploys each rail transit software application, it must first pull the module from the image central warehouse, and then copy and create the functional container docker according to the template and the software computing power requirements. In the Kubernetes application, docker is added to the Kubernetes function and encapsulated into a pod monomer. It should be noted here that the Kubernetes containerized application is a container management platform that separates server hardware and rail transit software applications, eliminating the problem that the former two are too dependent due to over-coupling, making it impossible to transplant and upgrade the software, and cannot smoothly achieve hardware expansion. The Kubernetes containerized application serves as a management platform with multiple running nodes, which can be divided into control nodes and working nodes. The control node is used for cluster management of containers, and the containerized application is deployed on the working node using the container image. The working node here refers to the host in the server cluster, and the containerized application can also be deployed on the control node. The Kubernetes containerized application is an open source application for managing containerized applications on multiple hosts in a server cluster.
[0051] Step 130, based on the current rail transit environment and the corresponding container images, a Kubernetes replica controller is used to deploy containerized rail transit software applications in the Kubernetes server cluster.
[0052] Optionally, the container images of each rail transit software application pulled from the image central warehouse are used as templates, and the functional subjects in each template are extracted for creation. For example, data collection belongs to functional subject A, data parsing and statistical analysis belongs to functional subject B, and data display also belongs to a functional subject C. By analyzing the two container images pulled from the image central warehouse, it can be known that rail transit software application 1 includes three functional subjects A, B and C, and rail transit software application 2 includes two functional subjects A and B. When deploying rail transit software applications on each host in the server cluster, it is also necessary to consider the current rail transit environment. That is, the performance requirements of the environmental data (i.e., user expectations) for a certain functional subject in each software application. For example, if the number of collection devices in the environment is huge, then the rail transit software application 1 including three functional subjects A, B and C must carry a large amount of collected data. Therefore, the computing amount of functional subjects A and B will be very large, so the performance requirements for them will be very high. Therefore, when the containerized rail transit software application 1 is deployed using the Kubernetes replica controller, the number of pod monomers encapsulating the A function that are copied and created will increase, and the number of pod monomers encapsulating the B function that are copied and created will also increase. The Kubernetes containerized application selects nodes that meet the hardware requirements and have the same functional classification in the Kubernetes server cluster based on the hardware requirements and functional classification of each rail transit software application, and creates container groups on these nodes. Based on the container images of each rail transit software application, containerized rail transit software applications are created in the container group. Here, each host in the Kubernetes server cluster is a node of the Kubernetes containerized application, which is used to provide a deployment basis for the Kubernetes containerized application. The container images of each rail transit software application are placed in the container group. Based on the controller of the Kubernetes containerized application, the creation process, operation status and other information of the container group are monitored. After the containerized rail transit software application is formed in the container group, the application is exposed, and then the external service interface is generated to achieve communication, complete the external release of the application, and perform log management and status monitoring of the application operation. Different from the conventional evenly distributed fully automatic operation, in order to better manage resources, according to the hardware requirements and functional classification of each rail transit software application, the rail transit software application is deployed on nodes that meet the hardware requirements and have the same functional classification, so as to achieve the directional operation of each rail transit software application.Therefore, for the rail transit software application 1 mentioned in the above example, which includes three functional bodies A, B and C, and the rail transit software application 2 including two functional bodies A and B, multiple pod monomers that encapsulate functional body A will be composed of a container group of function A and arranged to run on one host; similarly, multiple pod monomers that encapsulate functional body B will be composed of a container group of function B and arranged to run on one host, and multiple pod monomers that encapsulate functional body C will be composed of a container group of function C and arranged to run on one host; the rail transit software application will be deployed on nodes that meet the hardware requirements and are of the same functional classification to achieve the targeted operation of each rail transit software application.
[0053] The rail transit software application scheduling method based on Kubernetes provided by the present invention, by the running program of each rail transit software application deployed as needed, constructs each corresponding container image of each rail transit software application, and sends it to the master host in the Kubernetes server cluster; uses the Kubernetes copy controller object to pull each corresponding container image of each rail transit software application from the master host; based on the current rail transit environment and the corresponding container images, uses the Kubernetes copy controller to deploy containerized rail transit software applications in the Kubernetes server cluster. Since the Kubernetes containerized orchestration management application is deployed on the server cluster, and each rail transit software application needs to consider the current rail transit environment when it is deployed on the Kubernetes server cluster, it is determined whether the amount of data that each software application needs to process is large, and the amount of resources occupied when each rail transit software application is deployed is determined based on the amount of data. Therefore, the use of the Kubernetes containerized orchestration management application not only removes the strong coupling between software and hardware, reduces labor costs, but also can reasonably allocate Kubernetes container resources based on the amount of data in the environment where each software application runs. Therefore, the method provided by the present invention realizes high utilization of hardware resources and efficient operation of software, reduces labor costs, releases the strong coupling between rail transit software applications and hardware, and achieves the goal of rapid and smooth upgrade and expansion of software and hardware.
[0054] On the basis of the above embodiment, in the method, based on the current rail transit environment and the corresponding container images, a Kubernetes replica controller is used to deploy containerized rail transit software applications in the Kubernetes server cluster, including:
[0055] Using the Kubernetes replica controller to pull the corresponding container images from the master host, and determine the monomer pod objects corresponding to the rail transit software applications;
[0056] The Kubernetes replica controller determines the number of each monomer pod object based on the current rail transit environment, and creates a copy of the monomer pod object based on the number;
[0057] The property file of the Kubernetes replica controller includes the master host address pre-written in it.
[0058] Optionally, edit the replica controller property file deployment.yaml or statefulSet.yaml property file, edit the image pull address in the property file to the central warehouse registry host address, and use the replica editor to create a single pod object of the software application. Specifically, after pulling back the container image of each rail transit software application, analyze the container image as a software template, extract the functional body contained in the template, and one functional body corresponds to one type of single pod object. Then, the Kubernetes replica controller determines the number of each single pod object based on the current rail transit environment. For example, rail transit software application 1 includes There are three functional entities A, B and C. Data collection belongs to functional entity A, data analysis belongs to functional entity B, and data display also belongs to a functional entity C. Based on the current rail transit environment, it is known that the number of collection devices is huge. Therefore, the rail transit software application 1 including the three functional entities A, B and C must carry a large amount of collected data. Therefore, the computing amount of functional entities A and B will be very large, so their performance requirements will be very high. Therefore, when using the Kubernetes replica controller to deploy the containerized rail transit software application 1, the number of pod monomers encapsulated with function A will increase, and the number of pod monomers encapsulated with function B will also increase. Among them, the specific creation operation in the Kubernetes application can use the create or apply command of the Kubernetes command tool kubectl to create each Kubernetes object through a property file.
[0059] The method provided by the present invention further defines how the current rail transit environment factors participate in the deployment of containerized rail transit software applications in the Kubernetes server cluster, thereby improving the specificity of the scheduling method provided by the present invention in the field of rail transit, and providing unique considerations of the current rail transit environment for software deployment in the field of rail transit.
[0060] Based on the above embodiment, in this method, if any rail transit software application is a calling component type, the property file for creating the Kubernetes replica controller of any rail transit software application is a deployment.yaml property file;
[0061] If any rail transit software application is of the status viewing type, the property file for creating the Kubernetes replica controller of any rail transit software application is the statefulSet.yaml property file.
[0062] Optionally, if any rail transit software application is a calling component type, that is, when any rail transit software application is running, it needs to call and interact with each functional subject in the software, that is, it belongs to the calling component type software, for example: collecting data belongs to functional subject A, parsing and statistically analyzing data belongs to functional subject B, and displaying data also belongs to a functional subject C. Rail transit software application 1 includes three functional subjects A, B and C. When functional subject B performs analysis, it needs to pull the collected data from functional subject A, and when functional subject C performs display, it needs to pull the health or warning information obtained through statistical analysis from functional subject B. Therefore, rail transit software application 1 is a calling component type software application. When the rail transit software application of the calling component type configures its corresponding replica controller, it is to write in the deployment.yaml property file to edit the image pull address to the central warehouse registry host address. If any rail transit software application is of the type of viewing status, that is, any rail transit software application does not require interaction and calling between functional entities during operation, and only needs to read train operation data or alarm log data through software, etc., then there is no need to use Kubernetes container application as an intermediate layer for conversion, and directly access the corresponding storage address of the server cluster hardware and then return. Therefore, when configuring the corresponding replica controller for this type of rail transit software application of the viewing status type, write the image pull address to edit the central warehouse registry host address in the statefulSet.yaml property file. Different property files reflect the operating mechanisms of different types of software. Figure 2 The code example diagram of the statefulSet.yaml property file provided by the present invention is as follows: Figure 2As shown, the code lines above the comment "#Container mount point" are all property descriptions of a rail transit software application named "sms-h5-backend" and with a port number of 30003. The type of the software application is the viewing status type. Therefore, the code lines below the comment "#Container mount point" are all describing the storage location in the host from which the data that may be viewed by the software should be read, that is, introducing the path for reading data.
[0063] The method provided by the present invention clearly points out the property files of the Kubernetes replica controllers corresponding to different types of software, and provides an accurate operation method for deploying various rail transit software applications in Kubernetes containerized applications.
[0064] Based on the above embodiment, in this method, the current rail transit environment includes at least one of the number of acquisition devices in the current track, the number of physical parameter types that the acquisition devices need to collect, and the acquisition and reporting frequency of the acquisition devices.
[0065] Optionally, the current rail transit environment is further defined as the influencing factor affecting the deployment of rail transit software applications in Kubernetes containerized applications, and the types of physical parameters that need to be considered when conducting qualitative and quantitative analysis. Therefore, based on the operating environment of the rail transit software application, three physical parameters are selected as optional direct reference factors: the number of acquisition devices in the current track, the number of physical parameter types that the acquisition device needs to collect, and / or the acquisition and reporting frequency of the acquisition device. Since the number of acquisition devices is positively correlated with the amount of data that needs to be processed by the software that needs to collect and analyze the acquisition data type, the number of physical parameter types collected is also positively correlated with the amount of data that needs to be processed by the software that needs to collect and analyze the acquisition data type. For example, if the acquisition device only collects one physical parameter of current intensity, and another acquisition device collects three physical parameters of temperature, humidity and light intensity, then the amount of data that needs to be processed by the rail transit software application that connects and processes the other acquisition device will inevitably be larger, and the acquisition and reporting frequency of the acquisition device is also positively correlated with the amount of data that needs to be processed by the software that needs to collect and analyze the acquisition data type, because the higher the frequency, the larger the amount of data that needs to be processed, and the higher the computing performance requirements for processing high concurrency. Here, the current rail transit environment is described by at least one physical parameter including the number of collection devices in the current track, the number of physical parameter types that the collection devices need to collect, and the collection and reporting frequency of the collection devices, indicating that the environment can be measured by multiple parameters, which can be one or a comprehensive measurement of multiple parameters. The current rail transit environment can be measured by a single parameter, namely, the number of collection devices in the current track, the number of physical parameter types that the collection devices need to collect, or the collection and reporting frequency of the collection devices, or it can be a combination of two: the number of collection devices in the current track and the number of physical parameter types that the collection devices need to collect, the number of collection devices in the current track and the collection and reporting frequency of the collection devices, the number of physical parameter types that the collection devices need to collect, or the collection and reporting frequency of the collection devices. The above three two-parameter combination comprehensive measurement methods can also be a method in which the previous rail transit environment can be measured in combination with three parameters: the number of collection devices in the current track, the number of physical parameter types that the collection devices need to collect, and the collection and reporting frequency of the collection devices. The method provided by the present invention defines the current rail transit environment as the type of physical parameters included in the influencing factors affecting the deployment of rail transit software applications in Kubernetes containerized applications, thereby realizing qualitative and quantitative analysis of the transportation environment.
[0066] Based on the above embodiment, the method further includes:
[0067] Build the gateway object ambassador of the Kubernetes server cluster;
[0068] The gateway object ambassador is used to provide a unified software access entry for each rail transit software application.
[0069] Optionally, a controller based on Kubernetes containerized applications monitors the creation process, operation status and other information of the container group, exposes the application after forming a containerized rail transit software application in the container group, and then generates an external service interface to realize communication and complete the external release of the application. The generation of the external service interface is to build the gateway object ambassador in the Kubernetes containerized application, configure the attributes of the ambassador, so that each rail transit software application in the Kubernetes cluster has a unified software access entrance.
[0070] The method provided by the present invention defines the setting of access entrances when publishing after each rail transit software application is deployed on a Kubernetes server cluster, unifies the access entrances of each rail transit software application into one address, and provides an accurate operation method for setting a unified address in a Kubernetes containerized application.
[0071] Based on the above embodiment, in the method, the gateway object ambassador of the Kubernetes server cluster is constructed, including:
[0072] Edit the replica controller property file ambassador-deployment.yaml and the service property file ambassador-service.yaml of the gateway object ambassador of the Kubernetes server cluster, write the unified software access entry IP address into the ambassador-deployment.yaml, and write the port number of each rail transit software application into the ambassador-service.yaml.
[0073] Optionally, the access method of the Kubernetes server cluster and the access method of each rail transit software application running on the Kubernetes server cluster are further defined, and the unified access entrance of each rail transit software application is unified through a unique IP. Each rail transit software application running on the Kubernetes server cluster is equipped with a unique port number allocated to each rail transit software application in the corresponding Kubernetes server cluster on the basis of the unique IP. The setting method is implemented through the operations of editing ambassador-deployment.yaml and ambassador-service.yaml described above. Edit the Kubernetes gateway object replica controller property file ambassador-deployment.yaml and the gateway application service property file ambassador-service.yaml. The external exposure port of the service provided by each rail transit software application is the NodePort method.
[0074] The method provided by the present invention further defines the setting of access entrances for each rail transit software application when it is released after the deployment of each rail transit software application on the Kubernetes server cluster is completed, and provides an accurate operation method for setting a unified address in a Kubernetes containerized application.
[0075] On the basis of the above embodiment, in this method, when each rail transit software application needs to eliminate anomalies or software upgrades, each functional object in the Kubernetes server cluster schedules the distribution of the monomer pod object based on the real-time monitored health of each rail transit software application and the available resources of the hardware node;
[0076] When the Kubernetes server cluster needs to be expanded, a new server is added to the Kubernetes server cluster based on the sealosjoin-master command or the sealos join-node command in the sealos installation tool.
[0077] Optionally, whether the software module is abnormal and cannot be used, or the software is upgraded, various functional objects of kubernetes can monitor the health of each software module in real time, and schedule the distribution of application monomers according to the bearing capacity of the hardware node, achieving the effect of intelligent management. With the help of the sealos installation tool, you only need to use a simple command: sealos join--master or sealos join--node command to add a new node (server) to the Kubernetes cluster, so as to achieve the effect of convenient and quick hardware expansion.
[0078] The following describes a rail transit software application scheduling device based on Kubernetes provided by the present invention. The rail transit software application scheduling device based on Kubernetes described below and a rail transit software application scheduling method based on Kubernetes described above can correspond to each other.
[0079] Figure 3 A schematic diagram of the structure of the rail transit software application scheduling device based on Kubernetes provided by the present invention is shown in FIG. Figure 3 As shown, the rail transit software application scheduling device based on Kubernetes includes a construction unit 310, a pulling unit 320 and a deployment unit 340, wherein:
[0080] The construction unit 310 is used to construct the corresponding container images of each rail transit software application according to the running programs of each rail transit software application deployed as needed, and send them to the master host in the Kubernetes server cluster;
[0081] The pulling unit 320 is used to use the Kubernetes replica controller object to pull the corresponding container images of the rail transit software applications from the master host;
[0082] The deployment unit 330 is used to deploy containerized rail transit software applications in the Kubernetes server cluster using a Kubernetes replica controller based on the current rail transit environment and the corresponding container images.
[0083] The rail transit software application scheduling device based on Kubernetes provided by the present invention, by the running program of each rail transit software application deployed as needed, constructs each corresponding container image of each rail transit software application, and sends it to the master host in the Kubernetes server cluster; uses the Kubernetes copy controller object to pull each corresponding container image of each rail transit software application from the master host; based on the current rail transit environment and the corresponding container images, uses the Kubernetes copy controller to deploy containerized rail transit software applications in the Kubernetes server cluster. Since the Kubernetes containerized orchestration management application is deployed on the server cluster, and each rail transit software application needs to consider the current rail transit environment when it is deployed on the Kubernetes server cluster, it is determined whether the amount of data that each software application needs to process is large, and the amount of resources occupied when each rail transit software application is deployed is determined based on the amount of data. Therefore, the use of the Kubernetes containerized orchestration management application not only removes the strong coupling between software and hardware, reduces labor costs, but also can reasonably allocate Kubernetes container resources based on the amount of data in the environment where each software application runs. Therefore, the device provided by the present invention realizes high utilization of hardware resources and efficient operation of software, reduces labor costs, releases the strong coupling between rail transit software applications and hardware, and achieves the goal of rapid and smooth upgrade and expansion of software and hardware.
[0084] Based on the above embodiment, in the device, the deployment unit is used to:
[0085] Using the Kubernetes replica controller to pull the corresponding container images from the master host, and determine the monomer pod objects corresponding to the rail transit software applications;
[0086] The Kubernetes replica controller determines the number of each monomer pod object based on the current rail transit environment, and creates a copy of the monomer pod object based on the number;
[0087] The property file of the Kubernetes replica controller includes the master host address pre-written in it.
[0088] On the basis of the above embodiment, in the device,
[0089] If any rail transit software application is a calling component type, the property file for creating the Kubernetes replica controller of any rail transit software application is a deployment.yaml property file;
[0090] If any rail transit software application is of the status viewing type, the property file for creating the Kubernetes replica controller of any rail transit software application is the statefulSet.yaml property file.
[0091] On the basis of the above embodiment, in the device,
[0092] The current rail transit environment includes at least one of the number of acquisition devices in the current track, the number of physical parameter types that the acquisition devices need to collect, and the acquisition and reporting frequency of the acquisition devices.
[0093] Based on the above embodiment, the device further includes an access configuration unit, which is used to:
[0094] Build the gateway object ambassador of the Kubernetes server cluster;
[0095] The gateway object ambassador is used to provide a unified software access entry for each rail transit software application.
[0096] On the basis of the above embodiment, in the device, the gateway object ambassador for constructing the Kubernetes server cluster includes:
[0097] Edit the replica controller property file ambassador-deployment.yaml and the service property file ambassador-service.yaml of the gateway object ambassador of the Kubernetes server cluster, write the unified software access entry IP address into the ambassador-deployment.yaml, and write the port number of each rail transit software application into the ambassador-service.yaml.
[0098] On the basis of the above embodiment, the device further includes an upgrade and expansion unit for:
[0099] When each rail transit software application needs to eliminate anomalies or software upgrades, each functional object in the Kubernetes server cluster schedules the distribution of the monomer pod object based on the real-time monitored health of each rail transit software application and the available resources of the hardware node;
[0100] When the Kubernetes server cluster needs to be expanded, a new server is added to the Kubernetes server cluster based on the sealosjoin-master command or the sealos join-node command in the sealos installation tool.
[0101] The key technologies in the above method provided by the present invention are:
[0102] 1) Based on containerization technology.
[0103] Generate a corresponding container image for each track application software module through Dockerfile, and run the image instructions to let the software application run independently in the docker container, so that each container module has an independent operating environment, reducing the mutual interference of processes between software modules.
[0104] 2) Good hardware scalability.
[0105] With the help of the sealos installation tool, you only need to use a simple command: sealos join--master or sealosjoin--node command to add a new node (server) to the Kubernetes cluster to achieve the effect of hardware expansion.
[0106] 3) Intelligent and smooth transition.
[0107] Whether a software module is abnormal and cannot be used, or the software is being upgraded, various functional objects of Kubernetes can monitor the health of each software module in real time, and schedule the distribution of application monomers according to the bearing capacity of the hardware nodes, achieving the effect of intelligent management.
[0108] The method provided by the present invention achieves the following four effects:
[0109] (1) Make full use of the server resources in the rail transit computer room to reduce the rail transit's investment in operation and maintenance costs.
[0110] (2) Reduce the dependence of rail software applications on server hardware, and facilitate the subsequent migration and scheduling of software and the expansion and upgrade of hardware.
[0111] (3) Minimize the reliance of rail software applications on operation and maintenance personnel, and realize intelligent operation and maintenance management of urban rail transit software.
[0112] (IV) In the face of the trend of increasing data volume in the future, it can achieve rapid and smooth upgrade and expansion of urban rail transit software and hardware.
[0113] Through the above design, although the urban rail transit software application is stored on the server, it has its own independent operating environment - the docker container, and Kubernetes deploys the docker container inside the pod, reducing the software application's dependence on the server. The process isolation between the software is high, and more software applications can be deployed within the server's tolerance (the server's tolerance is controlled by the Kubernetes object kube-schedule, which can monitor the server environment in real time and allocate the distribution of urban rail software applications on the host), realizing the full utilization of server resources and simplifying the software migration scheduling work.
[0114] In addition, Kubernetes's replica controller can control the running of service monomer pods according to the number of replicas expected by the user. Even if a service monomer terminates abnormally, the replica controller can migrate the access traffic to another healthy pod monomer, and then restart a healthy service monomer, achieving a smooth repair effect.
[0115] The following describes the operation process of the rail transit software application deployed by the method provided by the present invention by taking an example in which the present invention has been successfully applied to an SMS system of a rail transit project. Figure 4 The overall design diagram of the rail transit intelligent software application operation and maintenance scheduling technology based on Kubernetes containerized orchestration management provided by the present invention is as follows: Figure 4 As shown in the figure, when there is an access from https or http, ambassador-service verifies the target IP address of the request. If the IP address is the same as the unique IP published by this Kubernetes server cluster, it passes the verification and enters the ambassador pod cluster. The ambassador pod cluster analyzes the target software port number carried in the request according to the pod configured in the image central warehouse to find the target software that needs to be accessed by the request. Figure 5 The gateway object provided by the present invention is used to process the property file example of the software application, such as Figure 5 As shown in the code, starting from line 22, the ambassador pod cluster analyzes the target software port number carried in the request according to the pod configured in the image central warehouse to obtain the information of the target software to be accessed in the request. The port name of the target software to be accessed is "hx8s7a", the unique port number of the target software to be accessed in the server cluster is 30003, and the name of the target software to be accessed is "sms-h5-backend"; after forwarding the request to the corresponding rail transit software application i according to the port number (assuming Figure 4The access process in finally turns to the rail transit software application i, where 1≤i≤N). The replica controller of the rail transit software application i then processes the request according to the pod configured for the rail transit software application i by the mirror central warehouse to meet its needs.
[0116] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the rail transit software application scheduling method based on Kubernetes, the method comprising: constructing the corresponding container images of the rail transit software applications according to the running programs of the rail transit software applications arranged as needed, and sending them to the master host in the Kubernetes server cluster; using the Kubernetes replica controller object to pull the corresponding container images of the rail transit software applications from the master host; based on the current rail transit environment and the corresponding container images, using the Kubernetes replica controller to deploy the containerized rail transit software applications in the Kubernetes server cluster.
[0117] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0118] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the rail transit software application scheduling method based on Kubernetes provided by the above-mentioned methods, and the method includes: according to the running programs of each rail transit software application deployed as needed, building each corresponding container image of the rail transit software application, and sending it to the master host in the Kubernetes server cluster; using the Kubernetes replica controller object to pull the corresponding container images of each rail transit software application from the master host; based on the current rail transit environment and the corresponding container images, using the Kubernetes replica controller to deploy the containerized rail transit software applications in the Kubernetes server cluster.
[0119] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the rail transit software application scheduling method based on Kubernetes provided in the above-mentioned embodiments, the method comprising: building corresponding container images of each rail transit software application according to the running programs of each rail transit software application deployed as needed, and sending them to the master host in the Kubernetes server cluster; using the Kubernetes replica controller object to pull the corresponding container images of each rail transit software application from the master host; based on the current rail transit environment and the corresponding container images, using the Kubernetes replica controller to deploy the containerized rail transit software applications in the Kubernetes server cluster.
[0120] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0121] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, 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 invention.
Claims
1. A rail transit software application scheduling method based on Kubernetes, characterized in that: include: According to the running programs of each rail transit software application deployed as needed, build the corresponding container images of each rail transit software application and send them to the master host in the Kubernetes server cluster; Using a Kubernetes replica controller object to pull the corresponding container images of the rail transit software applications from the master host; Based on the current rail transit environment and the corresponding container images, a Kubernetes replica controller is used to deploy containerized rail transit software applications in the Kubernetes server cluster; Based on the current rail transit environment and the corresponding container images, the Kubernetes replica controller is used to deploy containerized rail transit software applications in the Kubernetes server cluster, including: Using the Kubernetes replica controller to pull the corresponding container images from the master host, and determine the monomer pod objects corresponding to the rail transit software applications; The Kubernetes replica controller determines the number of each monomer pod object based on the current rail transit environment, and creates a copy of the monomer pod object based on the number; The property file of the Kubernetes replica controller includes the master host address pre-written in it; If any rail transit software application is a calling component type, the property file for creating the Kubernetes replica controller of any rail transit software application is a deployment.yaml property file; If any rail transit software application is of the viewing status type, the property file of the Kubernetes replica controller for creating any rail transit software application is the statefulSet.yaml property file; The current rail transit environment includes at least one of the number of acquisition devices in the current track, the number of physical parameter types that the acquisition devices need to collect, and the acquisition and reporting frequency of the acquisition devices.
2. The rail transit software application scheduling method based on Kubernetes according to claim 1, characterized in that: Also includes: Build the gateway object ambassador of the Kubernetes server cluster; The gateway object ambassador is used to provide a unified software access entry for each rail transit software application.
3. The rail transit software application scheduling method based on Kubernetes according to claim 2 is characterized in that: The gateway object ambassador for constructing the Kubernetes server cluster includes: Edit the replica controller property file ambassador-deployment.yaml and the service property file ambassador-service.yaml of the gateway object ambassador of the Kubernetes server cluster, write the unified software access entry IP address into the ambassador-deployment.yaml, and write the port number of each rail transit software application into the ambassador-service.yaml.
4. The rail transit software application scheduling method based on Kubernetes according to claim 1 is characterized in that: Also includes: When each rail transit software application needs to eliminate anomalies or software upgrades, each functional object in the Kubernetes server cluster schedules the distribution of the monomer pod object based on the real-time monitored health of each rail transit software application and the available resources of the hardware node; When the Kubernetes server cluster needs to be expanded, a new server is added to the Kubernetes server cluster based on the sealos join –master command or the sealos join –node command in the sealos installation tool.
5. A rail transit software application scheduling device based on Kubernetes, characterized in that: include: A construction unit is used to build corresponding container images of each rail transit software application according to the running programs of each rail transit software application deployed as needed, and send them to the master host in the Kubernetes server cluster; A pulling unit, used to pull the corresponding container images of the rail transit software applications from the master host using a Kubernetes replica controller object; A deployment unit, configured to deploy containerized rail transit software applications in the Kubernetes server cluster using a Kubernetes replica controller based on the current rail transit environment and the corresponding container images; The deployment unit is specifically used for: Using the Kubernetes replica controller to pull the corresponding container images from the master host, and determine the monomer pod objects corresponding to the rail transit software applications; The Kubernetes replica controller determines the number of each monomer pod object based on the current rail transit environment, and creates a copy of the monomer pod object based on the number; The property file of the Kubernetes replica controller includes the master host address pre-written in it; If any rail transit software application is a calling component type, the property file for creating the Kubernetes replica controller of any rail transit software application is a deployment.yaml property file; If any rail transit software application is of the viewing status type, the property file of the Kubernetes replica controller for creating any rail transit software application is the statefulSet.yaml property file; The current rail transit environment includes at least one of the number of acquisition devices in the current track, the number of physical parameter types that the acquisition devices need to collect, and the acquisition and reporting frequency of the acquisition devices.
6. 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 steps of the rail transit software application scheduling method based on Kubernetes are implemented as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the rail transit software application scheduling method based on Kubernetes are implemented as described in any one of claims 1 to 4.
