Container environment-oriented modular software adaptive support platform

Through a modular software adaptive support platform for container environments, asynchronous data transmission and Docker virtualization technology are used to achieve efficient updates of container microservices and flexible deployment of systems, solving the problem of operation and maintenance efficiency and maintenance problems of existing tools in container environments. The problem of insufficient adaptability improves the reliability and efficiency of the system.

CN118784631AInactive Publication Date: 2024-10-15CHINA STATE SHIPBUILDING CORP LTD RESEARCH INSTITUTE 719

Patent Information

Application Number
CN202410748263.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing container environment development and operation and maintenance tools cannot meet the high standard requirements of modern software for performance, response speed and adaptability. Especially when cloud platforms and hardware devices change frequently, it is difficult to achieve efficient system operation and maintenance and containers. Rapid updates for microservices.

Method used

A modular software adaptive support platform for container environments is designed, including architecture information transmission middleware, distributed application support framework, architecture topology analysis module, application management module and front-end display module, using Pub/Sub asynchronous Data transmission mechanism, Docker virtualization technology, React and NextJS framework realize imperceptible online and offline and real-time updates of microservices through topology structure and network proxy strategy.

Benefits of technology

Significantly improves the reliability and efficiency of the system, reduces the difficulty of software maintenance and transplantation, provides an integrated development and operating environment, supports rapid response and flexible deployment, and meets the high standards of performance and adaptability of modern software. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784631A_ABST
    Figure CN118784631A_ABST
Patent Text Reader

Abstract

The invention discloses a container environment-oriented modular software adaptive support platform. A system structure information transmission middleware is responsible for modeling a data stream and a data transmission mode between micro-services and decoupling message communication between the micro-services; the distributed application support framework provides a standardized interaction mode for the whole platform and users. The system structure topology analysis module is responsible for organizing the system structure of the whole system into a topological graph structure based on registration information of a client program; and the application management module is responsible for realizing a management function of client application based on Docker, and realizing a network agent strategy and a micro-service updating strategy oriented to single-machine deployment. And the front-end display module is responsible for displaying the content of the whole self-adaptive support platform on a webpage in a user-friendly manner, so that a user can check various information of the whole system and execute related operation on the whole platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer software technology, and in particular relates to a modular software adaptive support platform for container environments. Background Art

[0002] With the continuous advancement of computing technology, traditional monolithic applications have gradually failed to meet the needs of modern software for rapid iteration and flexible deployment. The emergence of container technology, especially the popularity of tools such as Docker and Kubernetes, has made microservice architecture possible, thus promoting a fundamental change in the development model. For example, in the global market competition, enterprises need to respond quickly to market changes, which requires their software infrastructure to provide the ability to quickly deploy and flexibly adjust. Container technology has become a key technology to support enterprise agility with its characteristics of fast startup, easy migration and efficient use of resources. However, since container environments usually need to be deployed on ever-changing cloud platforms and need to adapt to frequent changes in hardware equipment and resource configuration, this poses a considerable challenge to developers and operators of container environments. In addition, existing solutions often have many shortcomings in terms of system operation and maintenance efficiency, container microservice updates, and container adaptive changes, making it difficult to meet the high standards of modern software for performance, response speed and adaptability. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a modular software adaptive support platform for container environments. The design of the entire platform focuses on achieving a high degree of modularity and scalability so that new resources, services and applications can be easily added while maintaining efficient operating performance. By providing such a support platform, the present invention significantly improves the reliability and efficiency of the system in the container environment, and significantly reduces the difficulty of software maintenance and transplantation.

[0004] A modular software adaptive support platform for container environments, including:

[0005] The architecture information transmission middleware is based on the Pub / Sub asynchronous data transmission mechanism, which models the data flow and data transmission mode between microservices. It decouples the message communication between microservices based on the abstract concept of Topic, and realizes the non-perception of the up and down of other microservices by one microservice.

[0006] Distributed application support framework, including a series of user-friendly SDKs and APIs. The APIs or SDKs are used in client programs to register corresponding resources with the platform and conduct standardized communication with the platform.

[0007] The architecture topology analysis module organizes the architecture of the entire system into a topology structure based on the registration information of the client program;

[0008] The application management module implements the management function of client applications based on Docker, and implements the network proxy strategy and microservice update strategy for single-machine deployment;

[0009] The front-end display module uses the React and NextJS frameworks to build the front-end display interface, uses the Ant Design component library for front-end display, uses antv-g6 to organize the client application architecture information into a topology diagram display, and displays the data flow information between architectures in real time; at the same time, the module also provides a user-friendly control interface to facilitate users to update and replace microservices.

[0010] Preferably, in the architecture topology analysis module, the ResourceService class is responsible for registering the client with the PubSubStorage of PubSub, and starting an asynchronous daemon thread to use the AlivenessCheckerPlugin class to perform Client heartbeat detection; the ResourceController class exposes the interface to the outside in the form of HTTP API through the interface provided by the ResourceService class; when the front-end display module calls the API, it accesses the graph method of the ResourceController class to obtain a graph data structure containing Client information and Topic subscription information; the data structure includes a client set and a client-topic subscription relationship set, which is used for the front-end page to draw a topology map using HTML.

[0011] Preferably, the application management module designs two functional interfaces, UpdateStrategy.Creator application creator and UpdateStrategy.Destroyer application destroyer, and provides update interface method declaration through UpdateStrategy interface, that is, the specific update strategy implements UpdateStrategy interface and overloads update method, and customizes the scheduling of two functional interfaces, UpdateStrategy.Creator and UpdateStrategy.Destroyer, in the update method body, to realize customized service upgrade.

[0012] Preferably, when two versions of the service try to "occupy" the same externally exposed network port number at the same time when using RollingUpdateStrategy, the application management module additionally starts a ProxyServerManager instance for network proxy; ProxyServerManager uses an abstract factory design pattern, which includes two properties declared as ProxyServerFactory interfaces, namely TCP proxy server factory and UDP proxy server factory, and the fields of these two ProxyServerFactory interfaces are used to create TCP and UDP proxy server ProxyServer instance objects respectively; the ProxyServer interface has two implementation classes, TcpProxyServer and UdpProxyServer, which are responsible for the implementation of TCP network proxy and UDP network proxy respectively.

[0013] Preferably, the front-end display module includes the following four parts:

[0014] Interface display design and implementation submodule: Based on the functional component design mechanism of React; the design of the core interface is based on a single page, using the open source React framework Next.js, creating the directory / app / and configuring the route; on this basis, the layout and writing of each component are carried out to complete the design and implementation of the interface; the third-party component library Ant Design is used in the design and implementation;

[0015] Driver deployment submodule: interacts with the backend through network requests to complete the execution of remote scripts;

[0016] Image management submodule: uses axios to encapsulate network requests, interacts with the backend to create, update, and destroy containers, and feeds back the results in the node flow chart;

[0017] Node flow chart sub-module: Use AntV-G6 graph visualization engine to design and implement components; use axios to encapsulate network requests, interact with backend services to obtain the latest real-time data and update the graph.

[0018] Preferably, the interface display design and implementation submodule:

[0019] The display design of the interface follows the design ideas recommended by the React and Next.js frameworks. When designing the page, the layout file is used to determine the basic layout design and the idea of ​​the page file;

[0020] When implementing the interface, use the third-party component library Ant Design and add the StyledComponentRegistry element in layout.tsx;

[0021] The overall interface layout is defined in layout.tsx, which defines the common required elements of a web page and gives the basic layout of the page: the top is the Header, the bottom is the Footer, and the middle is the specific functional page elements; the Header and Footer are similar to the header and footer of common web pages, and only contain relevant information such as the title of some pages; the specific definition used to fill the middle elements is the focus, and its content is located in page.tsx, which uses the Tools, ToolBar and FlowChart custom components;

[0022] The Tools component corresponds to the interface design and implementation of driver deployment and the corresponding event logic; the ToolBar component corresponds to the interface design and implementation of image management and the corresponding time logic; FlowChart is the core flow chart display, and also includes event logic such as timed data refresh.

[0023] Preferably, the function of the driver deployment module is to remotely execute the corresponding script through the user's click; the process is that the user selects the script to be executed according to the optional options, and after clicking the "deploy" button, the server knows the information and executes the corresponding script; the core logic is: user selection -> click "deploy" -> send network request -> execution success / failure; and a pop-up window appears to inform the user, so that the user can decide the next step;

[0024] The interface of this module is located in the Tools component, which includes the DriverPostTests component. All interface elements are defined in DriverPostTests: when the user clicks "Driver Selection", the available driver options are displayed, and when the user clicks "Deployment Location", the available deployment locations in the corresponding driver are displayed. When both are selected, the user clicks "Deploy", the executeTmpRequests function is called to send a post request to the server's / platform / shell / execute address to inform the user of the user's choice, and a pop-up window will be displayed to prompt the user whether the choice is executed successfully based on the server's response; if one of the "Deployment Location" or "Driver Selection" is not selected, then when the user clicks "Deploy", no event will occur, but the user will be prompted to complete the selection.

[0025] Preferably, the image management module is used to remotely start the Docker container through a user's click; the image management module includes three functions: container creation, container update, and container deletion;

[0026] The interface part of this module is located in the ToolBar component, which further includes ClientCreation, ClientUpdate and ClientDeletion, which correspond to the interface and event logic of container creation, container update and container deletion respectively.

[0027] Preferably, the function of the node flow chart module is to display nodes and edges in real time according to the data information provided by the server, and to visually present the current topological structure;

[0028] The interface implementation and event logic of this module are included in the FlowChart component. In the FlowChart component, when the page is loaded for the first time or refreshed each time, the useEffect function in the FlowChart component takes effect and executes the internal function. The function completes two tasks: creating a graph instance to display the node flow chart; creating a scheduled task to regularly refresh the nodes and edges of the flow chart.

[0029] Preferably, after converting the nodes and edges, the nodes need to be deduplicated, and the nodes representing the front end themselves need to be deleted; and the graph structure is cached once, and each time a new graph structure is obtained, it is first checked whether there is any change, and if there is no change, the graph structure is not updated;

[0030] After obtaining the converted and deduplicated data, the new nodes and edges are integrated into newData in the updateGraph function. If the graph structure is found to have changed through detection, graph.changeData is called to draw the graph structure using the new data; at the same time, the graph.updateLayout function is called to automatically update the layout;

[0031] After the initial loading is completed, the data on the graph edge will be updated every 600ms to indicate the flow of data: first, a post request {"clientId":"b969facc-8304-4117-8d55-fc8eb8dd282d"} is initiated to the server's / platform / pubsub / listUnreadMessages, and the server returns the updated data information to the front-end module. The front-end display module processes it through the updateData function. The specific processing logic is: find the corresponding edge according to publisherId and topic, and then use data as text to update and replace the text on the original edge; in updateData, the data flow on the edge is obtained by traversing each array item, then finding the corresponding edge according to the attribute and updating the label attribute; use graph.updateItem to update the specified edge;

[0032] When updating the data on the edge of the chart, the FlowChart component first checks whether the storeClientId exists. If it is found that the storeClientId does not exist each time the data on the edge of the chart is obtained, the register function is called to register with the server. As the front end, it needs to subscribe to all other topics so that it can obtain new data in real time afterwards.

[0033] The present invention has the following beneficial effects:

[0034] The present invention provides a modular software adaptive support platform for container environments, and provides an integrated solution so that developers can more efficiently create and deploy software applications that can adapt to changes in their environment. The platform integrates multiple interfaces and modules, including architecture information transmission middleware, distributed application support framework, architecture topology analysis module, application management module and front-end display module, and these interfaces and modules work together to provide a comprehensive development and operation environment for container environments. The architecture information transmission middleware is responsible for modeling the data flow and data transmission mode between microservices, and decoupling the message communication between microservices. The distributed application support framework provides a standardized interaction mode for the entire platform and users. The architecture topology analysis module is responsible for organizing the architecture of the entire system into a topology structure based on the registration information of the client program. The application management module is responsible for implementing the management function of the client application based on Docker, and implementing the network proxy strategy and microservice update strategy for single-machine deployment. The front-end display module is responsible for displaying the content of the entire adaptive support platform on a web page in a user-friendly manner so that users can view various information of the entire system and perform related operations on the entire platform. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 is a block diagram of the adaptive support platform of the present invention;

[0036] Figure 2 Workflow diagram of the adaptive support platform of the present invention;

[0037] Figure 3 A topology diagram formed by each client in the system displayed on the front-end display interface;

[0038] Figure 4 This is a schematic diagram of the device going offline in the information structure topology diagram;

[0039] Figure 5 A schematic diagram of updating the sensor program to be able to process new sensor data information;

[0040] Figure 6 This is the information structure topology diagram of the new sensor program displayed on the front-end display page after it goes online. DETAILED DESCRIPTION

[0041] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0042] A modular software adaptive support platform for container environments, including:

[0043] 1) The architecture information transmission middleware is based on the Pub / Sub asynchronous data transmission mechanism to model the data flow and data transmission method between microservices. Based on the abstract concept of Topic, the message communication between microservices is decoupled to achieve the non-perceived online and offline of one microservice to other microservices.

[0044] The architecture information transmission middleware module refers to the message queue and Publish / Subscribe mode, and uses the abstract concept of Topic to decouple the communication between microservices, changing the communication mode between microservices from a synchronous model to an asynchronous model, thereby segmenting the strongly dependent RPC between microservices, thereby realizing the imperceptible online and offline functions of microservices.

[0045] In this module, Topic can be regarded as a string object, that is, the same string represents the same Topic.

[0046] This module abstracts all clients (whether they are program entities accessed through SDK or API) into Client class, which contains basic properties such as global unique identifier, client name, client type, client access time, as well as reference to PubSub instance and a storage for "unread messages". Client implements Publisher abstract interface and Subscriber abstract interface, where Publisher and Subscriber are both functional interfaces in Java programming language, and they only contain one method declaration, namely publish and subscribe, which conforms to the "single responsibility" design principle in common design patterns. When the publish method of the Client is called, the Client will construct a Message entity (including a globally unique identifier, the globally unique identifier of the message publisher, the message subject, the message publishing time and the message data) through its own client ID and the publish method parameters topic and data, and pass it to the PubSub instance for message publishing; when the Topic subscribed by the Client receives a newly published message, the PubSub instance will notify the Client by calling the onMessage method of the Client, and the Client will store the message in the unread message storage; the real client of the platform will periodically call the listUnreadMessages method of the Client to obtain the unread message list (refer to the implementation of the message queue pull model) and process the messages.

[0047] The core component of this module, PubSub, consists of PubSubStorage for storing Client instances and Topic subscription information, a collection of PubSub plug-in instances PubSubPlugin, and a lock object for concurrent security control between PubSub instances and several PubSubPlugin instances under multi-threaded concurrent access conditions.

[0048] The PubSubStorage component stores the subscription relationship between Client and Topic based on a mapping table whose key is Client instance and value is RelationPair collection. RelationPair contains Relation value and Topic value, where Relation is an enumeration class, including two enumeration values: PUBLISH and SUBSCRIBE. Therefore, each item in the mapping table of PubSubStorage represents several Topic topics subscribed by each Client and several Topic topics to which it may publish messages in the future. Based on this, when the message publisher publishes a message, it can decide which Subscriber (Client) onMessage method to trigger based on the information stored in the mapping table of PubSubStorage to correctly distribute the message. In addition, since PubSubStorage stores all Client instance references and Topic information, all Client collections and Topic collections can also be obtained from PubSubStorage.

[0049] PubSubPlugin is an interface that applies the adapter design pattern. It designs three lifecycle callback function declarations: onRegister, beforeOnMessage, and afterGetPubSubStore. The specific plug-in implementation class can choose to overload several method declarations to trigger at the appropriate time. You can register a plug-in with the PubSub instance so that the PubSub instance calls the destruction function of the registered plug-in when performing the corresponding operation. The platform currently designs two plug-ins, AlivenessCheckerPlugin and AllTopicSolverPlugin. AlivenessCheckerPlugin is used to asynchronously check the activity of the Client client using heartbeat detection, and AllTopicSolverPlugin is used to resolve the Topic with the value of asterisk (*) as "all topics". The more important role of this part is to provide the front-end display module with messages of all topics, so as to display the data flow information of the entire system in the front-end display interface.

[0050] The AlivenessCheckerPlugin plugin implements dynamic unloading of disconnected Client program entity objects in PubSubStorage by actively polling the heartbeat interface on the client and recording the last time each client polled the heartbeat interface on the server.

[0051] The AllTopicSolverPlugin plugin overloads the beforeOnMessage and afterGetPubSubStore callback functions. It dynamically, non-invasively, and imperceptibly resolves the asterisk (*) topic to "all topics" at runtime and returns it to the client.

[0052] PubSub includes a collection of PubSubStorage and PubSubPlugin, which serves as the facade of the architecture information transmission middleware module and exposes the interface to users. The functions of the PubSub class include but are not limited to: registering the subscription relationship between the Client and the Topic; obtaining the subscription relationship between the Client and the Topic; deregistering the Client; registering PubSubPlugin; and publishing and forwarding messages based on topics.

[0053] 2) Distributed application support framework, including a series of user-friendly SDKs and APIs. By using this API or SDK in the client program, you can register the corresponding resources with the platform and communicate with the platform in a standardized manner.

[0054] Based on the workflow set by the architecture information transmission middleware module, we exposed the operation interface based on the HTTP protocol and implemented the programming language SDK using C++ and Java.

[0055] In the server-side program of the platform, we use the Spring Web MVC framework to assist in building HTTP services. Clients can access HTTP APIs to register, unregister, publish messages, and view microservice dependency topology diagrams.

[0056] The overall life cycle of the client is as follows: When the client program starts, the client initiates a register request to the server, submits its own name, type, topic subscription relationship and other information to the server, and the server returns a globally unique ID for client identification; after successful registration, the client needs to periodically initiate a keepAlive request to the server to identify its own activity and avoid being deregistered by the server's heartbeat mechanism plug-in AlivenessCheckerPlugin; before the program stops, the client can publish data to the server, and can also periodically pull unread messages from the server to the local for message consumption; when the program stops, the client initiates an unregister request to the server (taking into account the possibility that the client may be down due to force majeure such as power outages, the server will use the heartbeat mechanism to automatically remove clients that have not initiated keepAlive for a long time, that is, the client does not have to initiate an unregister request to the server, but for timeliness, it is recommended that the client actively initiate an unregister request to the server when stopping the program).

[0057] In the client implementation of C++ language, we build the client library program based on nlohmann / json, fmtlib / fmt, boost, and httplib libraries.

[0058] In the client view of Java language, we build the client library program based on the Spring BootStarter technology which is more popular in the current Java ecosystem. The library program will automatically register several Topics declared by Spring's @Bean annotation into the context when the program starts, and register all callback functions annotated by @Handler of all classes annotated by @Listener into the context. When a message of the corresponding Topic is published, the library program will asynchronously trigger the corresponding callback function in the daemon thread. In addition, the program needs to configure the relevant properties in the application.yml configuration file. The library program will automatically create an HTTP client program and register it automatically when it starts. The above design greatly improves the ease of use and configuration of the library program, which is conducive to the rapid access of the client.

[0059] 3) Architecture topology analysis module, based on the registration information of the client program, organizes the architecture of the entire system into a topology structure. In the platform, the architecture topology analysis module focuses on managing the client management registered to the platform and displaying the dependent topology relationship.

[0060] In the platform server, the ResourceService class is responsible for registering the client to PubSubStorage of PubSub, and starting an asynchronous daemon thread to use the AlivenessCheckerPlugin class to perform client heartbeat detection; the ResourceController class exposes the interface to the outside in the form of HTTP API through the interface provided by the ResourceService class. When the front-end display module calls the API, it accesses the graph method of the ResourceController class (the request path is " / resource / graph") to obtain a graph data structure containing client information and Topic subscription information. This data structure includes a client collection and a client-topic subscription relationship collection, which is used for the front-end page to draw a topology map using HTML.

[0061] 4) Application management module, based on Docker, implements the management function of client applications, and implements the network proxy strategy and microservice update strategy for single-machine deployment. The application management module uses Docker virtualization technology to achieve "online and offline applications through the platform", and then realizes the "dynamic update of applications" function.

[0062] Regarding the application update interface, the application management module has designed two functional interfaces, UpdateStrategy.Creator application creator and UpdateStrategy.Destroyer application destroyer, and provides the update(Creator, Destroyer) interface method declaration through the UpdateStrategy interface, that is, the specific update strategy can be implemented by implementing the UpdateStrategy interface and overloading the update method, and the two functional interfaces of the formal parameters UpdateStrategy.Creator and UpdateStrategy.Destroyer can be customized in the update method body to achieve customized service upgrades. For example, the default update strategy DefaultUpdateStrategy first calls the UpdateStrategy.Destroyer method to destroy the old version of the application, and then calls the UpdateStrategy.Creator method to create a new version of the application; more advanced strategies such as RollingUpdateStrategy first create a new version of the application, and then destroy the old version of the application after the new version of the application is started, so as to achieve a "seamless" upgrade of the service.

[0063] In addition, since the stand-alone version of Docker is currently used for application scheduling, when using RollingUpdateStrategy, two versions of the service may try to "occupy" the same exposed network port number at the same time. Therefore, the server will start an additional ProxyServerManager instance for network proxy. ProxyServerManager uses the abstract factory design pattern, which contains two properties declared as ProxyServerFactory interfaces, namely TCP proxy server factory (actual type is TcpProxyServerFactory) and UDP proxy server factory (actual type is UdpProxyServerFactory). The fields of these two ProxyServerFactory interfaces are used to create TCP and UDP proxy server ProxyServer instance objects respectively. The ProxyServer interface has two implementation classes, TcpProxyServer and UdpProxyServer, which are responsible for the implementation of TCP network proxy and UDP network proxy respectively.

[0064] 5) Front-end display module, using React and NextJS framework to build the front-end display interface, using Ant Design component library for front-end display, using antv-g6 to organize the client application architecture information into a topology diagram display, which can display the data flow information between architectures in real time. At the same time, this module also provides a user-friendly control interface to facilitate users to update and replace microservices. The design of the entire front-end module consists of the following 4 parts:

[0065] Interface display design and implementation submodule: React-based functional component design mechanism. The core interface design is based on a single page (and single route), using the famous open source React framework Next.js. You only need to create the directory / app / to automatically configure the route. On this basis, you can complete the interface design and implementation by doing the layout and writing each component. The third-party component library Ant Design was used in the design and implementation.

[0066] Driver deployment submodule: interacts with the backend through network requests to complete the execution of remote scripts.

[0067] Image management submodule: mainly uses axios to encapsulate network requests, interacts with the backend to create, update, and destroy containers, and feeds back the results in the node flow chart.

[0068] Node flow chart sub-module: Use AntV-G6 graph visualization engine to design and implement components; use axios to encapsulate network requests, interact with backend services to obtain the latest real-time data and update the graph.

[0069] 5.1) Interface display design and implementation sub-module:

[0070] The interface design follows the design ideas recommended by the React and Next.js frameworks. The layout file (i.e. layout.tsx) is used to determine the basic layout design and the page file (i.e. page.tsx) is used in page design. The specific components are further divided according to their functions and layout positions for easy management and maintenance.

[0071] When implementing the interface, the more mature third-party component library Ant Design was used. In order to be compatible with the Next.js framework, it is necessary to add the StyledComponentRegistry element in layout.tsx (the specific definition of StyledComponentRegistry is located in / lib / AntdRegistry).

[0072] The overall interface layout is defined in layout.tsx, which defines the common required elements of a web page, such as body and html, and gives the basic layout of the page: Header at the top, Footer at the bottom, and specific functional page elements in the middle. Header and Footer are similar to headers and footers of common web pages, and only contain relevant information such as the title of some pages; the specific definition used to fill in the middle elements is the focus, and its content is located in page.tsx, which uses custom components such as Tools, ToolBar, and FlowChart.

[0073] The Tools component corresponds to the interface design and implementation of driver deployment and the corresponding event logic; the ToolBar component corresponds to the interface design and implementation of image management and the corresponding time logic; FlowChart is the core flow chart display, and also includes event logic such as timed data refresh.

[0074] 5.2) Driver deployment submodule:

[0075] The function of the driver deployment module is to remotely execute the corresponding script through the user's click. The basic process is that the user selects the script to be executed according to the options. After clicking the "Deploy" button, the server knows the information and executes the corresponding script. For this purpose, the core logic is: user selection -> click "Deploy" -> send network request -> execution success / failure. Regardless of whether the execution succeeds or fails, a pop-up window will appear to inform the user, and the user can decide the next step.

[0076] The interface of this module is located in the Tools component, which of course includes the DriverPostTests component, in which all interface elements are further defined. When the user clicks "Driver Selection", the available driver options will be displayed, and when clicking "Deployment Location", the available deployment locations in the corresponding driver will be displayed. When both are selected, the user clicks "Deploy", which will call the executeTmpRequests function (located in / api / toolsRequests.tsx) to send a post request to the server's / platform / shell / execute address to inform the user of the choice, and according to the server's response, a pop-up window will be displayed to prompt the user whether the choice is executed successfully; and if one of the "Deployment Location" or "Driver Selection" is not selected, then when the user clicks "Deploy", no event will occur, but the user will be prompted to complete the selection.

[0077] It should be noted that, since the driver to be deployed and the deployment location are relatively fixed in this scenario, all options for "Deployment location" and "Driver selection" are saved in the AvailablePostRequestsTestConfig in the front-end configuration file ( / data / BackendConfig.tsx), rather than being pulled from the server.

[0078] 5.3) Image management submodule:

[0079] The image management module is used to remotely start the Docker container through user clicks. The basic process is similar to the core logic in the driver deployment module. The difference is that the image management module includes three functions: container creation, container update, and container deletion. Each module is relatively independent but has certain connections.

[0080] The interface of this module is located in the ToolBar component, which further includes ClientCreation, ClientUpdate and ClientDeletion, which correspond to the interface and event logic of container creation, container update and container deletion. Similar to the driver deployment module, the three functions can only be executed by clicking the button to send the request after the user completes the selection of options. Take container creation as an example. After the user selects the docker image and docker version (port and udp ports are optional, and there are default values ​​if they are not filled in), click the "Create client" button. At this time, the requestToCreateDockerClient function will be called to collect the form information and send a post request to the server's / platform / application / create address to complete the creation of the container. Regardless of whether the creation succeeds or fails, the front-end interface will give a pop-up window prompt. Similarly, container update and container deletion are similar processes. The only difference is that before container update and container deletion, a get request will be sent to the server's / platform / application / list to know which containers have been created (only created containers can be updated and deleted).

[0081] Similarly, when the container is created, the docker image and docker version are saved in the AvailableDocker in the frontend configuration file ( / data / BackendConfig.tsx).

[0082] 5.4) Node flow chart submodule:

[0083] The function of the node flow chart module is to display nodes and edges in real time according to the data information provided by the server, and to visually present the current topological structure.

[0084] The interface implementation and event logic of this module are mainly contained in the FlowChart component. In the FlowChart component, data acquisition and conversion are more important than the design and implementation of the interface. When the page is loaded for the first time or refreshed each time, the useEffect function in the FlowChart component takes effect and executes the internal function. The function specifically completes two tasks: creating a graph instance to display the node flow chart; creating a scheduled task to regularly refresh the nodes and edges of the flow chart. It should be noted that in order to make the canvas expand and contract naturally, an event listener is added to the window object, and the size of the canvas is also changed when the web page size changes.

[0085] The creation of the graph uses the API provided by the AntV-G6 graph visualization engine. When creating the graph, the basic configuration of G6GraphConfig in / data / G6GraphConfig.tsx is read. The most important thing is to configure the styles of defaultEdge and defaultNode.

[0086] When first loaded, the FlowChart component will first update the graph structure to show the initial graph to the user. After that, it is set to call updateGraph every 2000ms to update the graph data. The specific process of the update is to send a get request to the server's / platform / resource / graph to obtain the graph structure. The following is an example of a server response:

[0087]

[0088] The nodes array represents all nodes; the edges array represents all edges

[0089] The meanings of the items in nodes are as follows:

[0090] clientType: represents the type of node. Among the types, topic is a virtual node and does not correspond to a real device or software in the actual system. Other nodes correspond to software or hardware entities. Different types of nodes will be drawn in different shapes in the final display of the flowchart.

[0091] name: the name of the node;

[0092] id: the unique id of the node. The ids of different nodes must be different.

[0093] The meanings of the items in edges are as follows:

[0094] from: the id of the node connected to the beginning of an edge;

[0095] to: the id of the node to which the terminal of an edge is connected;

[0096] The data structure required by the AntV-G6 graph engine when drawing nodes is as follows:

[0097] Therefore, the logic of the createNodes function is to convert the original data obtained from the server into data that conforms to the above data structure. The effects of each field on the final node in the flowchart are as follows:

[0098] id: As the unique identifier of the node, it does not affect the display effect;

[0099] Label and description: text description on the node graph, where description is only valid in the rectangle with description presented by the topic type node;

[0100] type: controls the pattern of the node;

[0101] size: controls the size of the node;

[0102] linkPoints and anchorPoints: control the connection points extending from the left and right sides of the node pattern, which are the actual visible connection points and the logical connection points respectively.

[0103] style: Use CSS to make other custom modifications to the node pattern;

[0104] The createEdge function converts the edge attribute values ​​in the original data. The input is the edges in the server response, and the output is the edge data to be drawn.

[0105] In addition, it should be noted that after converting the nodes and edges, the nodes need to be deduplicated and the nodes representing the front end themselves need to be deleted. In addition, in order to avoid screen flickering and performance consumption caused by repeated rendering, the graph structure is cached. Every time a new graph structure is obtained, it is first checked to see if there is any change. If there is no change, the graph structure will not be updated.

[0106] After obtaining the converted and deduplicated data, the new nodes and edges are integrated into newData in the updateGraph function. If the graph structure is found to have changed through detection, graph.changeData is called to draw the graph structure using the new data. Since the number of nodes may change, the graph.updateLayout function is also called to automatically update the layout.

[0107] After the initial loading is completed, the data on the edge of the graph will be updated every 600ms. Here, it refers to the data on the edge in the graph structure, which is used to indicate the flow of data. This process is similar to the update of the graph structure. First, a post request {"clientId":"b969facc-8304-4117-8d55-fc8eb8dd282d"} is initiated to the server's / platform / pubsub / listUnreadMessages, and the server returns the updated data information to the front-end module. The front-end display module processes it through the updateData function. The specific processing logic is to find the corresponding edge according to the publisherId and topic, and then use the data as text to update and replace the original text on the edge (the label attribute in the edge is ignored when creating the edge in order to separate the graph structure and the data on the edge). Therefore, in updateData, the data flow on the edge is obtained by traversing each array item, finding the corresponding edge according to the attribute, and updating the label attribute. Since the update process is relatively frequent but the number of edges updated each time may be small, the entire graph structure is not updated in updateData. Instead, graph.updateItem is used to update the specified edges.

[0108] The difference from updating the graph structure is that when updating the data on the edge of the graph, the FlowChart component will first check whether the storeClientId exists. This is because from the perspective of the server, the front-end interface is a node that is no different from other nodes, so it needs to register with the server to inform its existence. The storeClientId is an id assigned by the server after registering the node to prove its identity. If the storeClientId does not exist each time the data on the edge of the graph is obtained, the register function will be called to register with the server ( / platform / resource / register). As the front end, it needs to subscribe to all other topics so that it can obtain new data in real time afterwards.

[0109] Furthermore, the architecture under the container environment refers to a cutting-edge technology. In today's rapidly developing technology environment, container technology has become the core of cloud computing and microservice architecture. Containers provide a lightweight and portable way to encapsulate and run applications, allowing them to run seamlessly in almost any environment. However, with the popularity of containerized applications, developers and operation and maintenance teams are also facing a series of challenges. For example, in an architecture system for a container environment, a containerized application is usually composed of multiple microservices, which need to be able to discover and communicate with each other. It is very difficult and complex to achieve stable service discovery and network configuration in a dynamic environment. On the other hand, when the external environment of the system changes, how to dynamically and adaptively update certain microservices without affecting the normal operation of other microservices in the system is also challenging. The development of this platform is precisely to solve the above problems. The use of an adaptive support platform will bring higher efficiency and stability to the container environment, and promote the architecture of the container environment to a more agile and responsive future.

[0110] Furthermore, let's take a specific example to introduce the specific steps of using the adaptive support platform:

[0111] In this example, the entire system is a small simulation system for container environments. There are eight sensors, four controllers, two computing nodes and one decision node in the system. Two sensors form a group. The data of each two groups of sensors are aggregated to the computing node through the adaptive support platform for computational processing. The calculation results of the two computing nodes are then aggregated to the decision node for decision making. The decision node controls the four controllers to perform different operations based on the sensor data. The decision logic is to calculate the average value of each group of sensors and select the controller corresponding to the group with the smallest sensor data for operation. During the operation of the entire system, we will simulate the changes in two hardware devices:

[0112] Simulate the disconnection of sensor hardware devices. We will shut down the second sensor of the third sensor group during normal system operation to simulate the disconnection of sensor hardware devices. At this time, the computing node should directly use the first sensor data of the third sensor group as the average value of the group, and the rest of the system will not be affected.

[0113] Simulate the access of new sensor hardware devices. After executing 1), we will re-access the new sensor platform as the second sensor of the third sensor group and update the computing node microservice to adapt to the access of the new sensor. During the entire process of accessing new sensors and updating microservices, the operation of the entire system will not be affected.

[0114] The following is a specific workflow of the adaptive support platform of the present invention:

[0115] Step 1) Execute the `docker load` command to load the front-end and back-end images.

[0116] sudo docker load-i platform-server.tar

[0117] sudo docker load-i flowchart-11-16.tar

[0118] Step 2) Start the backend and frontend images in sequence through the docker run command.

[0119] sudo docker run-p 8080:8080-d platform-server:1.2.1

[0120] sudo docker run --name flowchart-dp 8000:80flowchart:0.9-test

[0121] Step 3) Start eight sensor applications, four controller programs, two computing node programs and one decision node program respectively. In each application, register with the platform through the register interface provided by the platform and become a client in the system.

[0122] Step 4) After registration is completed, the sensor application sends the corresponding sensor data information to the corresponding Topic through the publisher interface provided by the platform, and other applications in the system obtain sensor data information from the corresponding Topic through the subscribe interface provided by the platform. At this time, the topology formed by each client in the system can be seen on the front-end display interface of the platform, such as Figure 3 shown.

[0123] Step 5) When the sensor hardware device changes and the second sensor of the third sensor group goes offline, the device can be seen offline in the information structure topology diagram, but the operation of the entire system is not affected. Figure 4 shown.

[0124] Step 6) When the sensor hardware device changes and a new sensor is connected to the platform as the second sensor of the third sensor group, the sensor program reports the new hardware detection information, and the platform front page will display the new hardware detection information. System users select sensor driver deployment through the driver deployment window to update the sensor program.

[0125] Step 7) After receiving the updated driver, the sensor program decompresses and executes the sensor driver program to update the sensor program to be able to process the new sensor data information, such as Figure 5 shown.

[0126] Step 8) The system user selects the decision service driver program deployment through the driver window to update the computing service program. Finally, the system user can see the information structure topology diagram after the new sensor program is launched on the front page of the adaptive support platform, and the entire system can operate normally. Figure 6 shown.

[0127] In summary, the above are only preferred embodiments of the present invention and are not intended to limit the protection scope of 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.

Claims

1. A modular software adaptive support platform for container environments, characterized in that: include: The architecture information transmission middleware is based on the Pub / Sub asynchronous data transmission mechanism, which models the data flow and data transmission mode between microservices. It decouples the message communication between microservices based on the abstract concept of Topic, and realizes the non-perception of the up and down of other microservices by one microservice. Distributed application support framework, including a series of user-friendly SDKs and APIs. The APIs or SDKs are used in client programs to register corresponding resources with the platform and conduct standardized communication with the platform. The architecture topology analysis module organizes the architecture of the entire system into a topology structure based on the registration information of the client program; The application management module implements the management function of client applications based on Docker, and implements the network proxy strategy and microservice update strategy for single-machine deployment; The front-end display module uses the React and NextJS frameworks to build the front-end display interface, uses the Ant Design component library for front-end display, uses antv-g6 to organize the client application architecture information into a topology diagram, and displays the data flow information between architectures in real time; at the same time, this module also provides; The user-friendly control interface makes it easy for users to update and replace microservices.

2. A modular software adaptive support platform for container environments as claimed in claim 1, characterized in that: In the architecture topology analysis module, the ResourceService class is responsible for registering the client with the PubSubStorage of PubSub, and starting an asynchronous daemon thread to use the AlivenessCheckerPlugin class to perform client heartbeat detection; the ResourceController class exposes the interface to the outside in the form of HTTPAPI through the interface provided by the ResourceService class; when the front-end display module calls the API, it accesses the graph method of the ResourceController class to obtain a graph data structure containing Client information and Topic subscription information; the data structure includes a client set and a client-topic subscription relationship set, which is used for the front-end page to draw a topology map using HTML.

3. A modular software adaptive support platform for container environments as claimed in claim 1, characterized in that: The application management module designs two functional interfaces, UpdateStrategy.Creator application creator and UpdateStrategy.Destroyer application destroyer, and provides update interface method declaration through UpdateStrategy interface, that is, the specific update strategy implements UpdateStrategy interface and overloads update method, and customizes the scheduling of two functional interfaces, UpdateStrategy.Creator and UpdateStrategy.Destroyer, in the update method body to realize customized service upgrade.

4. A modular software adaptive support platform for container environments as claimed in claim 3, characterized in that: When two versions of the service try to "occupy" the same exposed network port number at the same time when using RollingUpdateStrategy, the application management module starts an additional ProxyServerManager instance for network proxy; ProxyServerManager uses the abstract factory design pattern, which contains two properties declared as ProxyServerFactory interfaces, namely TCP proxy server factory and UDP proxy server factory. The fields of these two ProxyServerFactory interfaces are used to create TCP and UDP proxy server ProxyServer instance objects respectively; the ProxyServer interface has two implementation classes, TcpProxyServer and UdpProxyServer, which are responsible for the implementation of TCP network proxy and UDP network proxy respectively.

5. A modular software adaptive support platform for container environments as claimed in claim 1, characterized in that: The front-end display module includes the following 4 parts: Interface display design and implementation submodule: Based on the functional component design mechanism of React; the design of the core interface is based on a single page, using the open source React framework Next.js, creating the directory / app / and configuring the route; on this basis, the layout and writing of each component are carried out to complete the design and implementation of the interface; the third-party component library Ant Design is used in the design and implementation; Driver deployment submodule: interacts with the backend through network requests to complete the execution of remote scripts; Image management submodule: uses axios to encapsulate network requests, interacts with the backend to create, update, and destroy containers, and feeds back the results in the node flow chart; Node flow chart submodule: Use AntV-G6 graph visualization engine to design and implement components; Use axios to encapsulate network requests, interact with backend services to obtain the latest real-time data and update the graph.

6. A modular software adaptive support platform for container environments as claimed in claim 5, characterized in that: The interface displays the design and implementation submodules: The display design of the interface follows the design ideas recommended by the React and Next.js frameworks. When designing the page, the layout file is used to determine the basic layout design and the idea of ​​the page file; When implementing the interface, use the third-party component library Ant Design and add the StyledComponentRegistry element in layout.tsx; The overall interface layout is defined in layout.tsx, which defines the common required elements of a web page and gives the basic layout of the page: the top is the Header, the bottom is the Footer, and the middle is the specific functional page elements; the Header and Footer are similar to the header and footer of common web pages, and only contain relevant information such as the title of some pages; the specific definition used to fill the middle elements is the focus, and its content is located in page.tsx, which uses the Tools, ToolBar and FlowChart custom components; The Tools component corresponds to the interface design and implementation of driver deployment and the corresponding event logic; the ToolBar component corresponds to the interface design and implementation of image management and the corresponding time logic; FlowChart is the core flow chart display, and also includes event logic such as timed data refresh.

7. A modular software adaptive support platform for container environments as claimed in claim 5, characterized in that: The function of the driver deployment module is to remotely execute the corresponding script through user clicks; The process is that the user selects the script to be executed according to the options. After clicking the "Deploy" button, the server knows the information and executes the corresponding script. The core logic is: user selection -> click "Deploy" -> send network request -> execution success / failure; a pop-up window will appear to inform the user, and the user can decide the next step. The interface of this module is located in the Tools component, which includes the DriverPostTests component. All interface elements are defined in DriverPostTests: when the user clicks "Driver Selection", the available driver options are displayed, and when clicking "Deployment Location", the available deployment locations in the corresponding driver are displayed. When both are selected, the user clicks "Deploy", the executeTmpRequests function is called to send a post request to the server's / platform / shell / execute address to inform the user of the user's selection, and a pop-up window is displayed to prompt the user whether the selection is executed successfully based on the server's response; if one of "Deployment Location" or "Driver Selection" is not selected, then when the user clicks "Deploy", no event will occur, but the user will be prompted to complete the selection.

8. A modular software adaptive support platform for container environments as claimed in claim 5, characterized in that: The image management module is used to remotely start the Docker container through a user's click; the image management module includes three functions: container creation, container update, and container deletion; The interface part of this module is located in the ToolBar component, which further includes ClientCreation, ClientUpdate and ClientDeletion, which correspond to the interface and event logic of container creation, container update and container deletion respectively.

9. A modular software adaptive support platform for container environments as claimed in claim 5, characterized in that: The function of the node flow chart module is to display nodes and edges in real time according to the data information provided by the server, and to visually present the current topology structure; The interface implementation and event logic of this module are included in the FlowChart component. In the FlowChart component, when the page is loaded for the first time or refreshed each time, the useEffect function in the FlowChart component takes effect and executes the internal function. The function completes two tasks: creating a graph instance to display the node flow chart; creating a scheduled task to regularly refresh the nodes and edges of the flow chart.

10. A modular software adaptive support platform for container environments as claimed in claim 9, characterized in that: After converting the nodes and edges, the nodes need to be deduplicated and the nodes representing the front end themselves need to be deleted. The graph structure is cached and each time a new graph structure is obtained, it is first checked to see if there is any change. If there is no change, the graph structure is not updated. After obtaining the converted and deduplicated data, the new nodes and edges are integrated into newData in the updateGraph function. If the graph structure is found to have changed through detection, graph.changeData is called to draw the graph structure using the new data; at the same time, the graph.updateLayout function is called to automatically update the layout; After the initial loading is completed, the data on the graph edge will be updated every 600ms to indicate the flow of data: first, a post request {"clientId":"b969facc-8304-4117-8d55-fc8eb8dd282d"} is initiated to the server's / platform / pubsub / listUnreadMessages, and the server returns the updated data information to the front-end module. The front-end display module processes it through the updateData function. The specific processing logic is: find the corresponding edge according to publisherId and topic, and then use data as text to update and replace the text on the original edge; in updateData, the data flow on the edge is obtained by traversing each array item, then finding the corresponding edge according to the attribute and updating the label attribute; use graph.updateItem to update the specified edge; When updating the data on the edge of the chart, the FlowChart component first checks whether the storeClientId exists. If it is found that the storeClientId does not exist each time the data on the edge of the chart is obtained, the register function is called to register with the server. As the front end, it needs to subscribe to all other topics so that it can obtain new data in real time afterwards.

Citation Information

Patent Citations

  • Network security experiment platform construction method based on Docker

    CN110166285A

  • Application deployment online management method and device, equipment and storage medium

    CN110221859A

  • Micro-service architecture optimization method based on intelligent arrangement

    CN113360295A

  • Distributed and container virtualization-based elastic micro-service system and implementation method

    CN114422371A

  • End-to-end composer and system thereof

    CN116260858A

Cited By

  • Method and system for cross-service unified topological data structure and operation in network target range

    CN120301931A

  • Password-free deployment method and device in Linux environment and medium

    CN120692011A