Application cluster management method, device, electronic device, storage medium and product
By starting the target main application in the dynamic cluster for application detection and association establishment, creating a sub-application container in a maintained state, realizing dynamic management of the main application to the sub-application, solving the low efficiency of the main application to the sub-application management in the dynamic cluster. Problem, improves management efficiency and reduces loading time.
Patent Information
- Application Number
- CN202411001896.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-07-25
AI Technical Summary
The prior art is difficult to realize efficient management of main applications to sub-applications in dynamic cluster management scenarios, and it depends on manual operation efficiency.
By starting the target main application for application detection, determining and establishing the association relationship between the main application and the sub-application, creating a sub-application container and setting it to a keep-alive state, realizing the dynamic management of the main application for sub-applications and getting rid of manual dependencies.
Implement efficient management of sub-applications by the main application in dynamic application clusters, reducing the loading time of sub-application clusters, avoiding loading lag problems, and improving management efficiency.
Smart Images

Figure CN118519727B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cluster systems, and in particular to an application cluster management method, and also to an application cluster management device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Microservice technology is a common cluster management method, but this technology is common in static cluster management scenarios, but it is difficult to apply to dynamic cluster management scenarios. When nesting and integrating applications in static cluster management scenarios, it is already known which systems, applications, and businesses are involved in the main application cluster (i.e., the main system) and the managed sub-application cluster (i.e., the subsystem). For example, for a portal website (static), users already know that they need to manage the administrative system, declaration system, and project management system. However, for dynamic clusters, such as the main storage system, users do not know in advance which subsystems need to be managed. When discovering devices, users need to dynamically link the relationship between the parent and the child, and dynamically manage the subsystem into the main system, so that the main system can dynamically manage the subsystem. Obviously, this implementation method relies on manual operations and is relatively inefficient.
[0003] Therefore, how to achieve efficient management of sub-applications by the main application in a dynamic application cluster is an urgent problem to be solved by those skilled in the art. Summary of the invention
[0004] An object of the present invention is to provide an application cluster management method, which can realize efficient management of sub-applications by the main application in a dynamic application cluster; another object of the present invention is to provide an application cluster management device, an electronic device, a computer-readable storage medium and a computer program product, all of which have the above-mentioned beneficial effects.
[0005] In a first aspect, the present invention provides an application cluster management method, which is applied to an application cluster system, wherein a main application and a sub-application are deployed in the application cluster system, and both the main application and the sub-application are dynamic applications, including:
[0006] Starting a target main application, performing an application detection operation using the target main application, and determining each target sub-application;
[0007] Establishing an association relationship between the target main application and each of the target sub-applications, and starting each of the target sub-applications;
[0008] Create a sub-application container, and set the working state of the sub-application container to a keep-alive state; the number of the sub-application container is 1;
[0009] According to the association relationship, any of the target sub-applications is mounted to the target main application using the sub-application container, so as to implement dynamic management of the sub-application by the main application.
[0010] After starting each of the target sub-applications, the method further includes:
[0011] Determining whether each of the target sub-applications is in an activated state;
[0012] If each of the target sub-applications is in the activated state, executing the step of creating a sub-application container and setting the working state of the sub-application container to a keep-alive state;
[0013] If each of the target sub-applications is not in the activated state, an alarm prompt is output.
[0014] Wherein, judging whether each of the target sub-applications is in an activated state includes:
[0015] Using the target main application to connect to the target sub-application to determine whether the target sub-application can be pulled up;
[0016] If the target sub-application can be pulled up, determining that the target sub-application is in the activated state;
[0017] If the target sub-application cannot be pulled up, it is determined that the target sub-application is not in the activated state.
[0018] Wherein, the application cluster management method further includes:
[0019] When each of the target sub-applications is in the activated state, performing an initialization operation on each of the target sub-applications;
[0020] The initialization operation includes loading application resources of the target sub-application and / or obtaining a lifecycle hook function of the target sub-application.
[0021] Before starting each of the target sub-applications, the method further includes:
[0022] The application information of each target sub-application is converted using a preset conversion rule to obtain each target sub-application in a unified format;
[0023] The preset conversion rules include one or more combinations of application name setting rules, application IP setting rules, container mounting setting rules, and application home page setting rules.
[0024] When the preset conversion rule is the application name setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, including:
[0025] Determine the product type to which each of the target sub-applications belongs;
[0026] For each target sub-application belonging to the same product type, the application name of each target sub-application is set to be consistent.
[0027] Wherein, when the preset conversion rule is the application IP setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, including:
[0028] Determine the application IP of each target sub-application;
[0029] When the same application IP exists, any target sub-application corresponding to the application IP is retained, and other target sub-applications corresponding to the application IP are removed.
[0030] Wherein, when the preset conversion rule is the container mount setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, including:
[0031] Determining a target path of the sub-application container;
[0032] The container mount paths of all the target sub-applications are set to the target path.
[0033] When the preset conversion rule is the application home page setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, including:
[0034] Determine the product type to which each of the target sub-applications belongs;
[0035] For each target sub-application belonging to the same product type, the homepages of each target sub-application are set to be consistent.
[0036] According to the association relationship, after using the sub-application container to mount any of the target sub-applications to the target main application to achieve dynamic management of the sub-application by the main application, the method further includes:
[0037] Perform path parsing on the current system application to determine whether a sub-application identifier exists in the application path of the current system application;
[0038] If the sub-application identifier does not exist in the application path, determining that the current system application is the main application, and displaying the main application menu;
[0039] If the sub-application identifier exists in the application path, the current system application is determined to be the sub-application, and a sub-application menu is loaded and displayed.
[0040] Wherein, the application cluster management also includes:
[0041] Monitoring the application path of each system application in the application cluster system;
[0042] If it is monitored that the application path has an IP change, and the application path changes from the absence of the sub-application identifier to the presence of the sub-application identifier, it is determined that the current system application switching mode is switched from the main application mode to the sub-application mode;
[0043] If it is monitored that the IP of the application path changes, and the application path changes from the presence of the sub-application identifier to the absence of the sub-application identifier, it is determined that the current system application switching mode is switching from the sub-application mode to the main application mode;
[0044] If it is monitored that the application path has an IP change, and the sub-application identifier exists in the application path before and after the IP change, it is determined that the current system application switching mode is the sub-application switching mode.
[0045] Wherein, the application cluster management also includes:
[0046] During the application path monitoring process, when the browser of the application cluster system is closed, the current main application and the current sub-application are uninstalled;
[0047] When it is determined that the current system application switching mode is the sub-application switching mode, the sub-application before switching is uninstalled, and the sub-application after switching is loaded.
[0048] In a second aspect, the present invention further discloses an application cluster management device, which is applied to an application cluster system, wherein a main application and a sub-application are deployed in the application cluster system, and both the main application and the sub-application are dynamic applications, including:
[0049] A detection module, used to start a target main application, perform an application detection operation using the target main application, and determine each target sub-application;
[0050] An establishing module, used to establish an association relationship between the target main application and each of the target sub-applications, and start each of the target sub-applications;
[0051] A creation module, used for creating a sub-application container, setting the working state of the sub-application container to a keep-alive state; the number of the sub-application container is 1;
[0052] The mounting module is used to mount any of the target sub-applications to the target main application using the sub-application container according to the association relationship, so as to realize dynamic management of the sub-application by the main application.
[0053] In a third aspect, the present invention further discloses an electronic device, comprising:
[0054] Memory for storing computer programs;
[0055] A processor is used to implement the steps of any one of the application cluster management methods described above when executing the computer program.
[0056] In a fourth aspect, the present invention further discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the application cluster management methods described above are implemented.
[0057] In a fifth aspect, the present invention further discloses a computer program product, including a computer program / instruction, which implements the steps of any one of the application cluster management methods described above when executed by a processor.
[0058] The present invention provides an application cluster management method, which is applied to an application cluster system, wherein a main application and a sub-application are deployed in the application cluster system, and the main application and the sub-application are both dynamic applications, comprising: starting a target main application, using the target main application to perform an application detection operation, and determining each target sub-application; establishing an association relationship between the target main application and each target sub-application, and starting each target sub-application; creating a sub-application container, and setting the working state of the sub-application container to a keep-alive state; the number of the sub-application containers is 1; according to the association relationship, using the sub-application container to mount any of the target sub-applications to the target main application, so as to realize dynamic management of the sub-application by the main application.
[0059] By applying the technical solution provided by the present invention, for the dynamic application cluster system, the started target main application is used to perform application detection, determine the target sub-application in the cluster system, realize the active discovery of the sub-application by the main application in the dynamic application cluster, and establish the association relationship between the two; at the same time, create a sub-application container and set its working state to the keep-alive state, so that after starting the target sub-application, any target sub-application can be mounted to the target main application based on the sub-application container in the keep-alive state, and realize the active collection and management of the sub-application by the main application in the dynamic application cluster. Obviously, this implementation method gets rid of manual dependence and realizes the efficient management of the sub-application by the main application in the dynamic application cluster. In addition, in the actual application scenario, this technical solution realizes the decoupling between dynamic applications by keeping only one sub-application alive in a sub-application container, and reduces the time occupied by the simultaneous loading of the sub-application cluster. Therefore, in the scenario of managing a large number of quantum applications, the loading jam problem can still be avoided.
[0060] The application cluster management device, electronic device, computer-readable storage medium, and computer program product provided by the present invention also have the above-mentioned technical effects, and the present invention will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present invention, the following briefly introduces the drawings required for describing the prior art and the embodiments of the present invention. Of course, the drawings related to the embodiments of the present invention described below are only part of the embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work, and the obtained other drawings also belong to the protection scope of the present invention.
[0062] Figure 1 A schematic diagram of the distribution of a static application cluster system provided by an embodiment of the present invention;
[0063] Figure 2 A distribution diagram of a dynamic application cluster system provided by an embodiment of the present invention;
[0064] Figure 3 A schematic diagram of a flow chart of an application cluster management method provided by an embodiment of the present invention;
[0065] Figure 4 A flow chart of sub-application management in an application cluster management process provided by an embodiment of the present invention;
[0066] Figure 5 A parent-child application management flow chart in an application cluster management process provided by an embodiment of the present invention;
[0067] Figure 6 A schematic diagram of the structure of an application cluster management device provided by an embodiment of the present invention;
[0068] Figure 7 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0069] The core of the present invention is to provide an application cluster management method, which can realize efficient management of sub-applications by the main application in a dynamic application cluster; another core of the present invention is to provide an application cluster management device, an electronic device, a computer-readable storage medium and a computer program product, all of which have the above-mentioned beneficial effects.
[0070] In order to describe the technical solutions in the embodiments of the present invention more clearly and completely, the technical solutions in the embodiments of the present invention will be introduced below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0071] Please refer to Figure 1 , Figure 1 This is a schematic diagram of the distribution of a static application cluster system provided by an embodiment of the present invention. When nesting and integrating applications in the static application cluster management scenario, it is already known which systems, applications, and services the main application cluster and the managed sub-application cluster are. Figure 1 As shown, for a portal website (static), users already know that they need to manage administrative systems, declaration systems, project management systems, etc.
[0072] However, for dynamic class clusters, such as Figure 2 The main storage system shown is Figure 2 This is a distribution diagram of a dynamic application cluster system provided by an embodiment of the present invention. The user does not know in advance which subsystems need to be managed. When discovering devices, the user needs to dynamically link the relationship between the parent and the child, and dynamically manage the subsystem into the main system, so that the main system can dynamically manage the subsystem. Obviously, this implementation method relies on manual operation and is relatively inefficient.
[0073] In order to solve the above technical problems, an embodiment of the present invention provides an application cluster management method.
[0074] Please refer to Figure 3 , Figure 3 A flow chart of an application cluster management method provided by an embodiment of the present invention is provided. The application cluster management method is applied to an application cluster management system. The application cluster system is deployed with main applications and sub-applications, wherein the number of main applications and sub-applications is not unique, and both are dynamic applications, that is, the application cluster system is a dynamic application cluster system. The application cluster management method provided by an embodiment of the present invention may include the following S101 to S104.
[0075] S101: Start a target main application, use the target main application to perform an application detection operation, and determine each target sub-application.
[0076] This step aims to realize active detection of sub-applications based on the main application. As mentioned above, the number of main applications and sub-applications in the application cluster system is not unique. For any main application, that is, the target main application mentioned above, after startup, the application detection operation can be automatically performed to detect all or part of the sub-applications in the application cluster system. Here, the sub-application actively detected by the target main application can be called the target sub-application. Therefore, the subsequent steps can be continued to realize the efficient management of each target sub-application by the target main application in the application cluster system.
[0077] In one embodiment of the present invention, performing an application detection operation using a target main application to determine each target sub-application may include:
[0078] Obtain the login information of each sub-application in the application cluster system, including the application IP and login password;
[0079] The application detection operation is performed using each login information to determine the sub-application that has successfully logged in as the target sub-application.
[0080] The embodiment of the present invention provides an implementation method for determining each target sub-application by performing an application detection operation based on a target main application. It can be understood that the application cluster system is composed of a large number of dynamic applications, including dynamic main applications and dynamic sub-applications. For any dynamic application that joins the application cluster system, it needs to register the application at the initial joining stage, that is, register its own related login information (the application IP and login password as mentioned above, of course, not limited to this, and can also include user name, domain name and other information) to the application cluster system for storage, so that the legality of the application can be verified later to ensure the stability and security of the application cluster system. Therefore, the registration information of all dynamic applications within the application cluster system can be maintained, such as a dynamic application list. On this basis, the target main application can actively obtain all or part of the dynamic application registration information in the dynamic application list from the application cluster system, and obtain the login information of all or part of the sub-applications in the application cluster system. Therefore, the target main application can use each login information to perform an application detection operation, and use the sub-application that has successfully logged in as the target sub-application.
[0081] Therefore, the embodiment of the present invention realizes the active detection and discovery of sub-applications by the main application by obtaining the login information of each sub-application in the application cluster system, which is more convenient for the subsequent automated parent-child application interconnection (i.e., the main application and the sub-application interconnection), without the need for manual interconnection, and has higher work efficiency.
[0082] S102: Establishing an association relationship between a target main application and each target sub-application, and starting each target sub-application.
[0083] This step aims to achieve the creation of an association relationship between the main application and the sub-application. Specifically, after determining the corresponding target sub-application based on the target main application detection, the association relationship between the two can be automatically created, that is, one target main application connects to multiple target sub-applications. Here, the association relationship can be recorded and saved in the form of an application association list. Furthermore, after the establishment of the association relationship between the parent and child applications, each target sub-application can be started to enable each target dynamic application in the application cluster system to enter a normal working state.
[0084] S103: Create a sub-application container, and set the working state of the sub-application container to a keep-alive state; the number of sub-application containers is 1.
[0085] This step is intended to achieve the creation and status setting of the sub-application container, that is, a sub-application container can be created in the application cluster system and its working state can be set to the keep-alive state. It can be understood that the sub-application container is used to realize the mounting of the sub-application to the main application. For the target main application, the number of target sub-applications that can be managed is unknown. It may be necessary to manage new target sub-applications from time to time in the actual working scenario. If a sub-application container is created for each target sub-application, it will not only waste system resources but also cause a long time occupation. Therefore, only one sub-application container in the keep-alive state can be created to achieve the switching mounting of the target sub-application to the target main application, that is, in the actual working scenario of the application cluster system, for the target main application, only one target sub-application is kept alive. When it is necessary to connect to another target sub-application, the current target sub-application can be uninstalled and the new target sub-application can be re-mounted. Therefore, no matter how many target sub-applications the target main application needs to manage, the target main application will not be affected, and the system stability can still be effectively guaranteed.
[0086] S104: Based on the association relationship, any target sub-application is mounted to the target main application using the sub-application container, so as to achieve dynamic management of the sub-application by the main application.
[0087] This step aims to achieve the mounting of the target sub-application to the target main application. This process can be implemented based on the above-mentioned association relationship and using the sub-application container. As mentioned above, the sub-application container can mount any target sub-application discovered by the target main application on the target main application, thereby realizing dynamic management of sub-applications by the main application in the application cluster system.
[0088] It can be seen that the application cluster management method provided by the embodiment of the present invention, for the dynamic application cluster system, uses the started target main application to perform application detection, determines the target sub-application in the cluster system, realizes the active discovery of the sub-application by the main application in the dynamic application cluster, and establishes the association relationship between the two; at the same time, creates a sub-application container and sets its working state to the keep-alive state, so that after starting the target sub-application, any target sub-application can be mounted to the target main application based on the sub-application container in the keep-alive state, so as to realize the active collection and management of the sub-application by the main application in the dynamic application cluster. Obviously, this implementation method gets rid of manual dependence and realizes the efficient management of the sub-application by the main application in the dynamic application cluster. In addition, in the actual application scenario, this technical solution realizes the decoupling between dynamic applications by keeping only one sub-application alive in a sub-application container, and reduces the time occupied by the simultaneous loading of the sub-application cluster. Therefore, in the scenario of managing a large number of quantum applications, the loading jam problem can still be avoided.
[0089] Based on the above embodiments:
[0090] In one embodiment of the present invention, after starting each target sub-application, the following steps may also be included:
[0091] Determine whether each target sub-application is in an activated state;
[0092] If each target sub-application is in an activated state, executing the steps of creating a sub-application container and setting the working state of the sub-application container to a keep-alive state;
[0093] If the target sub-application is not in an activated state, an alarm prompt is output.
[0094] The application cluster management method provided by the embodiment of the present invention can further realize the activation status judgment of the target sub-application, ensuring that only the target sub-application in the activated state can be managed by the target main application, and for the target sub-application that is in the inactivated state after startup, an alarm prompt can be output to remind the technical staff to perform operation and maintenance management. Specifically, after starting the target sub-application, the target sub-application can be actively activated and the activation status can be judged. If it is determined that the target sub-application is in the activated state, the subsequent steps can be continued to realize the target main application to manage the target sub-application; if it is determined that the target sub-application is not in the activated state, an alarm prompt can be directly output.
[0095] It can be seen that the application cluster management method provided in the embodiment of the present invention determines the activation status of the target sub-application after starting the target sub-application and before mounting the target sub-application, so as to ensure that only the target sub-application in the activated state is mounted subsequently, and avoids the situation where the mounting fails due to the target sub-application not being activated when directly mounting the target sub-application, thereby effectively improving the work efficiency and the success rate of the main application for the management of the sub-application.
[0096] In one embodiment of the present invention, determining whether each target sub-application is in an activated state may include:
[0097] Use the target main application to connect to the target sub-application to determine whether the target sub-application can be pulled up;
[0098] If the target sub-application can be pulled up, it is determined that the target sub-application is in an activated state;
[0099] If the target sub-application cannot be pulled up, it is determined that the target sub-application is not in an activated state.
[0100] The embodiment of the present invention provides a method for determining whether a target sub-application is in an activated state. Specifically, the target main application can be used to actively pull up the target sub-application to determine whether it can be pulled up. If the target sub-application can be pulled up by the target main application, it can be determined that the target sub-application is in an activated state; if the target sub-application cannot be pulled up by the target main application, it can be determined that the target sub-application is not in an activated state.
[0101] In one embodiment of the present invention, the application cluster management method may further include:
[0102] When each target sub-application is in an activated state, performing initialization operations on each target sub-application;
[0103] The initialization operation includes loading application resources of the target sub-application and / or obtaining a lifecycle hook function of the target sub-application.
[0104] The application cluster management method provided by the embodiment of the present invention can further implement the initialization operation of the target sub-application, that is, perform the initialization operation on the target sub-application in the activated state, so as to effectively ensure the success rate of the main application in managing the sub-application. Specifically, the initialization operation may include loading the application resources of the target sub-application and / or obtaining the life cycle hook function of the target sub-application, wherein the application resources of the target sub-application can be loaded through import Entry (a dependency library of a micro-frontend framework); the life cycle hook function of the target sub-application may include bootstrap (loading sub-application), callback (activating sub-application), beforemount (initializing sub-application), mount (mounting sub-application), unmount (unmounting sub-application), etc.
[0105] In one embodiment of the present invention, before starting each target sub-application, the following steps may also be included:
[0106] Using preset conversion rules to convert the application information of each target sub-application to obtain each target sub-application in a unified format;
[0107] The preset conversion rules include one or more combinations of application name setting rules, application IP setting rules, container mounting setting rules, and application home page setting rules.
[0108] The application cluster management method provided in the embodiment of the present invention can further implement the format conversion operation of the target sub-application, that is, to unify the format of all target sub-applications associated with the target main application, and this process can be implemented based on the preset application information conversion rules (that is, the above-mentioned preset conversion rules). Specifically, the preset conversion rules may include but are not limited to application name setting rules, application IP setting rules, container mounting setting rules, application home page setting rules, etc., wherein the application name setting rules are used to set the application name of all target sub-applications, the application IP setting rules are used to set the IP information of all target sub-applications, the container mounting setting rules are used to specify the mounting path of all target sub-applications, and the application home page setting rules are used to unify the application login home page of all target sub-applications.
[0109] In one embodiment of the present invention, when the preset conversion rule is an application name setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, which may include:
[0110] Determine the product type to which each target sub-application belongs;
[0111] For each target sub-application belonging to the same product type, set the application name of each target sub-application to be consistent.
[0112] Specifically, under the application name setting rules, for target sub-applications belonging to the same category of products, their application names can be uniformly set, that is, the target sub-application names under different categories of products are different, and the target sub-application names under the same category of products are the same.
[0113] In one embodiment of the present invention, when the preset conversion rule is an application IP setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, which may include:
[0114] Determine the application IP of each target sub-application;
[0115] When the same application IP exists, any target sub-application corresponding to the application IP is retained, and other target sub-applications corresponding to the application IP are removed.
[0116] Specifically, under the application IP setting rules, it is necessary to ensure that the application IPs of all target sub-applications are inconsistent. For more than one target sub-application with the same application IP, only one of them can be retained and the other target sub-applications with the same application IP can be eliminated.
[0117] In one embodiment of the present invention, when the preset conversion rule is a container mount setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, which may include:
[0118] Determine the target path of the sub-application container;
[0119] Set the container mount path of all target sub-applications to the target path.
[0120] Specifically, under the container mounting setting rules, as described above, only one sub-application container is created in the application cluster system to implement the mounting of all target sub-applications. Therefore, the container mounting paths of all target sub-applications can be set to be the target path of the sub-application container.
[0121] In one embodiment of the present invention, when the preset conversion rule is an application home page setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, which may include:
[0122] Determine the product type to which each target sub-application belongs;
[0123] For each target sub-application belonging to the same product type, set the home page of each target sub-application to be consistent.
[0124] Specifically, under the home page setting rules, for target sub-applications belonging to the same category of products, their home pages can be set uniformly, that is, the home pages of target sub-applications under different categories of products are different, and the home pages of target sub-applications under the same category of products are the same.
[0125] In one embodiment of the present invention, after any target sub-application is mounted to the target main application by using the sub-application container according to the association relationship to implement dynamic management of the sub-application by the main application, the following may also be included:
[0126] Parse the path of the current system application to determine whether there is a sub-application identifier in the application path of the current system application;
[0127] If there is no sub-application identifier in the application path, the current system application is determined to be the main application, and the main application menu is displayed;
[0128] If a sub-application identifier exists in the application path, the current system application is determined to be a sub-application, and the sub-application menu is loaded and displayed.
[0129] For the application cluster system, when it uses the browser to load and display the menu information of each dynamic application in the system, the browser can determine whether the dynamic application is the main application or the sub-application by judging whether there is a sub-application identifier in the application path of the dynamic application to be loaded, and adopt the corresponding menu display method. Among them, the sub-application identifier is unique and definite, that is, all target sub-applications use the same sub-application identifier. If the sub-application identifier exists in the application path of the current system application, it can be determined that the current system application is a sub-application, and its corresponding menu information needs to be reloaded and displayed; if the sub-application identifier does not exist in the application path of the current system application, it can be determined that the current system application is the main application, and its corresponding menu information can be directly displayed.
[0130] It is understandable that for static applications, the menu of a static sub-application can be directly displayed in the menu of the static main application to which it belongs, that is, the two can coexist, while for dynamic applications, the menu of a dynamic sub-application cannot be directly displayed in the menu of the dynamic main application to which it belongs, and the menu needs to be reloaded and displayed.
[0131] In one embodiment of the present invention, the application cluster management may further include:
[0132] Monitor the application path of each system application in the application cluster system;
[0133] If it is detected that the application path has an IP change, and the application path changes from no sub-application identifier to a sub-application identifier, it is determined that the current system application switching mode is switched from the main application mode to the sub-application mode;
[0134] If it is detected that the IP of the application path changes, and the application path changes from having a sub-application identifier to not having a sub-application identifier, it is determined that the current system application switching mode is switching from the sub-application mode to the main application mode;
[0135] If an IP change of the application path is detected, and a sub-application identifier exists in the application path before and after the IP change, it is determined that the current system application switching mode is the sub-application switching mode.
[0136] For the application cluster system, when it uses the browser to load and display the menu information of each dynamic application in the system, the browser can determine the current switching mode of the application cluster system by monitoring the IP changes and identification information changes in the application path, such as the switch from the main application to the sub-application, the switch from the sub-application to the main application, the switch between sub-applications, etc. Obviously, if the monitored application path has IP changes and identification information changes, and the identification information changes from the sub-application identification to the existence of the sub-application identification, it can be determined that the current mode is switching from the main application to the sub-application; if the monitored application path has IP changes and identification information changes, and the identification information changes from the existence of the sub-application identification to the non-existence of the sub-application identification, it can be determined that the current mode is switching from the sub-application to the main application; if the monitored application path has IP changes but no identification information changes, and the sub-application identification has always existed, it can be determined that the current mode is switching between sub-applications.
[0137] In one embodiment of the present invention, the application cluster management may further include:
[0138] During the application path monitoring process, when the browser of the application cluster system is closed, the current main application and the current sub-application are uninstalled;
[0139] When it is determined that the current system application switching mode is the sub-application switching mode, the sub-application before switching is uninstalled, and the sub-application after switching is loaded.
[0140] The application cluster management method provided by the embodiment of the present invention can also realize the unloading function of dynamic applications during the dynamic application switching process, so as to timely release unnecessary system resource occupation. Specifically, when the browser of the application cluster system is closed, the currently loaded main application and sub-application will no longer be used. At this time, both of them can be directly uninstalled; when the current system application switching mode is the sub-application switching mode, the sub-application before switching will not be used, and it can be directly uninstalled, and then the new sub-application can be loaded. In addition, for switching from the main application to the sub-application mode and from the sub-application to the main application mode, there is no need to perform the unloading operation of the dynamic application, that is, no unloading or reloading is required.
[0141] The embodiment of the present invention takes Qiankun (a micro-frontend implementation library based on single-spa) as an example to provide another application cluster management method.
[0142] In the embodiment of the present invention, the implementation process of the dynamic application cluster management method is specifically described by comparing the static application cluster management method. Figure 4 and Figure 5 As shown in the flow chart, Figure 4 A sub-application management flow chart in an application cluster management process provided by an embodiment of the present invention, Figure 5 The present invention provides a parent-child application management flow chart in an application cluster management process. The implementation process of the dynamic application cluster management method is as follows:
[0143] 1. Registration and startup of sub-applications:
[0144] The micro-frontend qiankun has two operation modes: one is to use registerMicroApps + start to automatically load sub-applications; the other is to use loadMicroApp to manually load sub-applications.
[0145] 1. Static sub-application registration:
[0146] Use registerMicroApps provided by Qiankun framework to register sub-applications. registerMicroApps will load all micro-applications at one time during initialization, and then enter the corresponding micro-application through route changes.
[0147] (1) Sub-application list definition:
[0148] const apps = [
[0149] {…
[0150] }
[0151] ].
[0152] (2) Sub-application registration:
[0153] registerMicroApps(apps, {}
[0154] ).
[0155] (3) Sub-application startup configuration:
[0156] const options = {
[0157] …
[0158] }.
[0159] (4) Sub-application startup:
[0160] start(options).
[0161] 2. Dynamic sub-application registration:
[0162] (1) Sub-application list definition:
[0163] At this time, the initial sub-application is just a default value. Because the managed sub-applications will not know the managed sub-applications immediately after the main application is started, only after the device is discovered can the main application and sub-applications be connected to know which sub-applications are managed.
[0164] const apps = [
[0165] {…
[0166] }
[0167] ].
[0168] (2) Device discovery (sub-application detection):
[0169] Device discovery includes the functions of adding, deleting, modifying and checking. Adding, deleting and modifying are modifications to the information of sub-applications, and checking is the query of sub-application information. The device information discovered here is mainly the basic information of sub-applications. Through this layer of page processing, the parent and sub-applications can be associated in the background, and the association relationship can be saved in the configuration file or database. Finally, the sub-application information can be found for the next step of conversion.
[0170] (3) Sub-application information conversion:
[0171] The information discovered by the device is not equivalent to the information that the sub-application wants to register, so a layer of information conversion is required, namely:
[0172] const app = { / / Sub-application conversion rules are as follows:
[0173] / / (a) The sub-application name of the same product is the same:
[0174] name: 'app1';
[0175] / / (b) The access IP addresses of different sub-applications are inconsistent:
[0176] entry: ' / / localhost:8080';
[0177] / / (c) The sub-application's mounted container is unique and is kept alive by Keepalived:
[0178] container: '#container';
[0179] / / (d) activeRule represents the entry, that is, the page that is entered for the first time after entering the sub-application. For static sub-applications, each sub-application has its own different home page, but for dynamic sub-applications, sub-applications of the same product but different versions have the same home page:
[0180] activeRule: ' / profile';
[0181] }
[0182] (4) Sub-application startup: Change from automatic sub-application startup to manual sub-application startup.
[0183] this.microApp = loadMicroApp(app, {
[0184] / / Whether to enable sandbox style isolation, the default is true.
[0185] sandbox: true,
[0186] / / Whether it is a single instance scene, a single instance means that only one sub-application will be rendered at the same time, the default is false.
[0187] singular: false,
[0188] }).
[0189] 2. Sub-application mounting:
[0190] 1. For static sub-applications, you can define multiple containers to mount sub-applications, because static sub-applications, that is, the sub-application management clusters are known. Therefore, you can configure a container name for each sub-application and mount it on the main application page. If you render the administrative system, you can mount the page elements of the administrative system on container 1. If you render the declaration system, you can mount the page elements of the declaration system on container 2. When you switch sub-applications later, you can also switch between different sub-applications.
[0191] 2. For dynamic sub-applications, only two containers are defined, one main application container and one sub-application container, and no more sub-application containers are added. At the same time, the Keepalived plug-in is introduced. Keepalived allows the page information to remain in the state before the user returns to the previous route page, that is, the page information is not destroyed after leaving. Then, if you only switch between the main application and sub-application a, instead of switching between sub-application a and sub-application b, the container does not need to be destroyed and initialized, that is, the page content rendered by the container will still be there next time.
[0192] 3. Sub-applications run in the main application:
[0193] This process involves the routing isolation of parent and child applications, that is, how to know which system a certain route (each route corresponds to a system and a unique page) belongs to.
[0194] 1. For static sub-applications: Since users already know which sub-applications are, they can directly add a prefix of app1 to the route of the administrative system and a prefix of app2 to the route of the declaration system. Each sub-application page has a routing address in the parent application. For example, / app2 / profile is the home page of the declaration system; / app2 / create is the declaration page of the declaration system; / app1 / profile is the home page of the administrative system. These routes will be directly configured in the routes of the main application.
[0195] 2. For dynamic sub-applications: For any sub-application, only one prefix subApp is added to its route, and / subApp is used to distinguish the main application from the sub-application. Because there is only one container, multiple sub-applications will not coexist. At this time, you only need to distinguish the main sub-application. In addition, since you don't know which pages of which systems will be displayed in the main application, you need to dynamically match all pages. Here, you can use catchAll( / subApp / *) to get all sub-application pages. No matter which application page it is, as long as it has the / subApp logo, it can be a sub-application page.
[0196] Among them, Catchall is a matching mechanism within the system. During the application process, it is first parsed according to the path. Through layer-by-layer matching and path splitting, when the subApp identifier is captured, it can be determined that this is the sub-application path, and then the fixed path behind the sub-application is matched. Since the sub-path is not obtained from the main path, but the sub-application is automatically matched, the step of the sub-application transmitting the menu information to the main application in advance can be omitted, omitting the system logic. In addition, the suffix after the subApp identifier is the inherent information of the sub-application, which can be obtained through loop matching.
[0197] In addition to the above configuration differences, in terms of display, static routes can be displayed in the menu of the main application, that is, parent and child routes can coexist. However, the menu of dynamic routes must be reloaded after the child application is loaded, and a new child application menu must be loaded, that is, parent and child routes cannot coexist.
[0198] 4. Application switching:
[0199] 1. For static sub-applications, if the route captures the switch from prefix / app1 to / app2, it can be determined that the current switch is from sub-application 1 to sub-application 2.
[0200] 2. For dynamic sub-applications, if the routing captures the IP change, it can be determined that an application switch has occurred. For example:
[0201] The address of the main application: https: / / 100.1.1.1 / # / profile;
[0202] Sub-application 1 address: https: / / 100.1.1.2 / # / subApp / profile;
[0203] Sub-application 2 address: https: / / 100.1.1.3 / # / subApp / profile.
[0204] (1) The IP changes from no subApp to subApp, which means switching from the main application to the subApp (after reaching the subApp, the catchAll mechanism in step 3 can be matched);
[0205] (2) The IP changes from having a subApp to not having a subApp, which means switching from a subApp to a parent App;
[0206] (3) The IP changes, but the subApp still exists, which means switching from one sub-application to another.
[0207] Obviously, static sub-applications capture routing changes, while dynamic sub-applications capture changes in registered sub-application information.
[0208] 5. Application uninstallation:
[0209] 1. Static sub-application: If the route captures the switch from prefix / app1 to / app2, that is, the switch from sub-application 1 to sub-application 2, then sub-application 1 needs to be uninstalled and sub-application 2 needs to be loaded.
[0210] 2. Dynamic sub-applications, if the router captures the IP change, it is determined that an application switch has occurred: if you jump back to the main application from the current sub-application, then through Keepalived, the main application and sub-application can be switched directly without eliminating the current sub-application. If you switch from the current sub-application to another sub-application, the page elements in the container need to change. At this time, the current sub-application will be uninstalled and a new sub-application will be loaded. However, the container of the main application is permanent and will not be destroyed. That is:
[0211] (1) Closing the browser will uninstall both the parent app and the child app;
[0212] (2) When switching from sub-application 1 to the main application, and from the main application to sub-application 1, neither application needs to be uninstalled or reloaded;
[0213] (3) Switching from sub-application 1 to sub-application 2, the main application is not uninstalled, sub-application 1 is uninstalled, and sub-application 2 is loaded;
[0214] (4) Switch from sub-application 2 to sub-application 1. The main application is not uninstalled, sub-application 2 is uninstalled, and sub-application 1 is loaded.
[0215] It can be seen that the technical solution generates a set of standard ways to manage dynamic clusters, that is, a standard docking method for nested parent-child cluster management, which can infinitely expand the managed sub-clusters. Specifically, the system expansion can be achieved by only discovering and executing business operations through dynamic devices, without the need to establish new relationships between parent-child clusters through repeated coding. In addition, since the number of managed sub-clusters is unknown, it is set to keep only one set of sub-clusters alive at the same time, which can ensure that the system can run concisely and stably on the basis of sacrificing the loading time of the sub-clusters, and no matter how many sub-clusters are managed, the system will not freeze. At the same time, the managed sub-clusters can be not only different devices, but also different versions of the same device. For example, version 1 is a stable version of the file scenario, and version 12 is an upgraded version of the multi-service scenario. Then the device of version 1 can not be upgraded to the latest version, but only used for file storage to maximize the efficiency of file transfer. Version 12 includes various functions and can query and set up the entire storage. Management. In addition, because the routing of the sub-application is handled by the sub-application itself, the main application does not need to know which sub-applications there are.
[0216] Based on this, the application cluster management method provided by the embodiment of the present invention has the following advantages:
[0217] (1) Dynamic management: multiple unknown clusters can be managed under certain rules;
[0218] (2) Low maintenance: no need to repeatedly process dynamic information;
[0219] (3) High scalability: more clusters can be managed based on the same solution;
[0220] (4) Management of multiple scenarios: such as different devices, different versions, etc.
[0221] (5) Applications are decoupled and do not affect each other: when one system fails, it does not affect the use of other systems;
[0222] (6) Improved usability: All managed sub-clusters can be managed directly through the main cluster without having to switch login addresses back and forth;
[0223] (7) Page consistency: If the framework and style are developed in a unified manner, the parent-child cluster will look like a complete whole, and there will no longer be a sense of a parent-child system.
[0224] An embodiment of the present invention provides an application cluster management device.
[0225] Please refer to Figure 6 , Figure 6 This is a structural diagram of an application cluster management device provided by the present invention. The application cluster management device is applied to an application cluster system. A main application and a sub-application are deployed in the application cluster system. Both the main application and the sub-application are dynamic applications, including:
[0226] Detection module 1, used to start the target main application, use the target main application to perform application detection operations, and determine each target sub-application;
[0227] Establishing module 2, used to establish the association relationship between the target main application and each target sub-application, and start each target sub-application;
[0228] Create module 3, used to create a sub-application container, set the working state of the sub-application container to a keep-alive state; the number of sub-application containers is 1;
[0229] The mounting module 4 is used to mount any target sub-application to the target main application by using the sub-application container according to the association relationship, so as to realize the dynamic management of the main application to the sub-application.
[0230] It can be seen that the application cluster management device provided by the embodiment of the present invention, for the dynamic application cluster system, uses the started target main application to perform application detection, determines the target sub-application in the cluster system, realizes the active discovery of the sub-application by the main application in the dynamic application cluster, and establishes the association relationship between the two; at the same time, creates a sub-application container and sets its working state to the keep-alive state, so that after starting the target sub-application, any target sub-application can be mounted to the target main application based on the sub-application container in the keep-alive state, so as to realize the active collection and management of the sub-application by the main application in the dynamic application cluster. Obviously, this implementation method gets rid of manual dependence and realizes the efficient management of the sub-application by the main application in the dynamic application cluster. In addition, in the actual application scenario, the technical solution realizes the decoupling between dynamic applications by keeping only one sub-application alive in a sub-application container, and reduces the time occupied by the simultaneous loading of the sub-application cluster. Therefore, the loading jam problem can still be avoided in the scenario of managing a large number of quantum applications.
[0231] In one embodiment of the present invention, the application cluster management device may also include an activation module, which is used to determine whether each target sub-application is in an activated state after starting each target sub-application; if each target sub-application is in an activated state, execute the steps of creating a sub-application container and setting the working state of the sub-application container to a keep-alive state; if each target sub-application is not in an activated state, output an alarm prompt.
[0232] In one embodiment of the present invention, the above-mentioned activation module can be specifically used to connect the target sub-application using the target main application to determine whether the target sub-application can be pulled up; if the target sub-application can be pulled up, it is determined that the target sub-application is in an activated state; if the target sub-application cannot be pulled up, it is determined that the target sub-application is not in an activated state.
[0233] In one embodiment of the present invention, the application cluster management device may further include an initialization module for performing initialization operations on each target sub-application when each target sub-application is in an activated state; wherein the initialization operation includes loading application resources of the target sub-application and / or obtaining a lifecycle hook function of the target sub-application.
[0234] In one embodiment of the present invention, the application cluster management device may also include a conversion module for converting the application information of each target sub-application using preset conversion rules to obtain each target sub-application in a unified format; wherein the preset conversion rules include a combination of one or more of application name setting rules, application IP setting rules, container mounting setting rules, and application home page setting rules.
[0235] In one embodiment of the present invention, when the preset conversion rule is an application name setting rule, the above conversion module can be specifically used to determine the product type to which each target sub-application belongs; for each target sub-application belonging to the same product type, the application name of each target sub-application is set to be consistent.
[0236] In one embodiment of the present invention, when the preset conversion rule is an application IP setting rule, the above-mentioned conversion module can be specifically used to determine the application IP of each target sub-application; when the same application IP exists, any target sub-application corresponding to the application IP is retained, and other target sub-applications corresponding to the application IP are eliminated.
[0237] In one embodiment of the present invention, when the preset conversion rule is a container mount setting rule, the above conversion module can be specifically used to determine the target path of the sub-application container; and set the container mount path of all target sub-applications as the target path.
[0238] In one embodiment of the present invention, when the preset conversion rule is an application home page setting rule, the above-mentioned conversion module can be specifically used to determine the product type to which each target sub-application belongs; for each target sub-application belonging to the same product type, the home page of each target sub-application is set to be consistent.
[0239] In one embodiment of the present invention, the application cluster management device may also include a display module, which is used to perform path resolution on the current system application and determine whether there is a sub-application identifier in the application path of the current system application; if there is no sub-application identifier in the application path, the current system application is determined to be the main application and the main application menu is displayed; if there is a sub-application identifier in the application path, the current system application is determined to be a sub-application, and the sub-application menu is loaded and displayed.
[0240] In one embodiment of the present invention, the application cluster management device may further include a monitoring module for monitoring the application path of each system application in the application cluster system; if an IP change is detected in the application path, and the application path changes from no sub-application identifier to the presence of a sub-application identifier, then the current system application switching mode is determined to be switching from the main application to the sub-application mode; if an IP change is detected in the application path, and the application path changes from the presence of a sub-application identifier to the absence of a sub-application identifier, then the current system application switching mode is determined to be switching from the sub-application to the main application mode; if an IP change is detected in the application path, and the sub-application identifier exists in the application path before and after the IP change, then the current system application switching mode is determined to be the sub-application switching mode.
[0241] In one embodiment of the present invention, the application cluster management device may also include an uninstall module, which is used to uninstall the current main application and the current sub-application when the browser of the application cluster system is closed during the application path monitoring process; when it is determined that the current system application switching mode is the sub-application switching mode, uninstall the sub-application before switching and load the sub-application after switching.
[0242] For an introduction to the device provided in the embodiment of the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.
[0243] An embodiment of the present invention provides an electronic device.
[0244] Please refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided by the present invention, and the electronic device may include:
[0245] A memory 11, used for storing computer programs;
[0246] The processor 10 can implement the steps of any one of the above-mentioned application cluster management methods when executing a computer program.
[0247] like Figure 7 , which is a schematic diagram of the composition structure of an electronic device, the electronic device may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 all communicate with each other through the communication bus 13.
[0248] In the embodiment of the present invention, the processor 10 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic devices.
[0249] The processor 10 may call a program stored in the memory 11. Specifically, the processor 10 may execute operations in an embodiment of the application cluster management method.
[0250] The memory 11 is used to store one or more programs, which may include program codes, and the program codes include computer operation instructions. In the embodiment of the present invention, the memory 11 at least stores programs for implementing the following functions:
[0251] Start the target main application, use the target main application to perform application detection operations, and determine each target sub-application;
[0252] Establish the association relationship between the target main application and each target sub-application, and start each target sub-application;
[0253] Create a sub-application container and set the working state of the sub-application container to keep alive; the number of sub-application containers is 1;
[0254] According to the association relationship, any target sub-application is mounted to the target main application using the sub-application container to achieve dynamic management of the sub-application by the main application.
[0255] In a possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.
[0256] In addition, the memory 11 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.
[0257] The communication interface 12 may be an interface of a communication module, and is used to connect to other devices or systems.
[0258] Of course, it should be noted that Figure 7 The structure shown does not constitute a limitation on the electronic device in the embodiment of the present invention. In actual applications, the electronic device may include Figure 7 More or fewer components than shown, or combinations of certain components.
[0259] An embodiment of the present invention provides a computer-readable storage medium.
[0260] The computer-readable storage medium provided in the embodiment of the present invention stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned application cluster management methods can be implemented.
[0261] Among them, the computer-readable storage medium can be any available medium that can be stored in a computer or a data storage device such as a server or data center that includes one or more available media integrated. For example, it can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk) and other media that can store computer program codes.
[0262] For an introduction to the computer-readable storage medium provided in an embodiment of the present invention, please refer to the above method embodiment, and the present invention will not elaborate on it here.
[0263] An embodiment of the present invention provides a computer program product.
[0264] The computer program product provided by the embodiment of the present invention includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps of any one of the above-mentioned application cluster management methods can be implemented.
[0265] Specifically, in the above embodiments, all or part of them can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of them can be implemented in the form of a computer program product.
[0266] Among them, the computer program product may include one or more computer programs / instructions, and when the computer program / instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention may be generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line, etc.) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0267] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.
[0268] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0269] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0270] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0271] The technical solution provided by the present invention is described in detail above. Specific examples are used herein to illustrate the principle and implementation of the present invention, and the description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. An application cluster management method, characterized in that: Applied to an application cluster system, wherein a main application and sub-applications are deployed in the application cluster system, and both the main application and the sub-applications are dynamic applications, including: Starting a target main application, performing an application detection operation using the target main application, and determining each target sub-application; Establishing an association relationship between the target main application and each of the target sub-applications, and starting each of the target sub-applications; Create a sub-application container, and set the working state of the sub-application container to a keep-alive state; the number of the sub-application container is 1; According to the association relationship, any of the target sub-applications is mounted to the target main application using the sub-application container to implement dynamic management of the sub-application by the main application; Perform path parsing on the current system application to determine whether a sub-application identifier exists in the application path of the current system application; If the sub-application identifier does not exist in the application path, determining that the current system application is the main application, and displaying the main application menu; If the sub-application identifier exists in the application path, determining that the current system application is the sub-application, and loading and displaying a sub-application menu; The use of the target main application to perform an application detection operation to determine each target sub-application includes: obtaining login information of each sub-application in the application cluster system, the login information including an application IP and a login password; using each of the login information to perform the application detection operation to determine that the sub-application that has successfully logged in is the target sub-application.
2. The application cluster management method according to claim 1, characterized in that: After starting each of the target sub-applications, the method further includes: Determining whether each of the target sub-applications is in an activated state; If each of the target sub-applications is in the activated state, executing the step of creating a sub-application container and setting the working state of the sub-application container to a keep-alive state; If each of the target sub-applications is not in the activated state, an alarm prompt is output.
3. The application cluster management method according to claim 2, characterized in that: Determining whether each of the target sub-applications is in an activated state includes: Using the target main application to connect to the target sub-application to determine whether the target sub-application can be pulled up; If the target sub-application can be pulled up, determining that the target sub-application is in the activated state; If the target sub-application cannot be pulled up, it is determined that the target sub-application is not in the activated state.
4. The application cluster management method according to claim 2, characterized in that: Also includes: When each of the target sub-applications is in the activated state, performing an initialization operation on each of the target sub-applications; The initialization operation includes loading application resources of the target sub-application and / or obtaining a lifecycle hook function of the target sub-application.
5. The application cluster management method according to claim 1, characterized in that: Before starting each of the target sub-applications, the method further includes: The application information of each target sub-application is converted using a preset conversion rule to obtain each target sub-application in a unified format; The preset conversion rules include one or more combinations of application name setting rules, application IP setting rules, container mounting setting rules, and application home page setting rules.
6. The application cluster management method according to claim 5, characterized in that: When the preset conversion rule is the application name setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, including: Determine the product type to which each of the target sub-applications belongs; For each target sub-application belonging to the same product type, the application name of each target sub-application is set to be consistent.
7. The application cluster management method according to claim 5, characterized in that: When the preset conversion rule is the application IP setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, including: Determine the application IP of each target sub-application; When the same application IP exists, any target sub-application corresponding to the application IP is retained, and other target sub-applications corresponding to the application IP are removed.
8. The application cluster management method according to claim 5, characterized in that: When the preset conversion rule is the container mount setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, including: Determining a target path of the sub-application container; The container mount paths of all the target sub-applications are set to the target path.
9. The application cluster management method according to claim 5, characterized in that: When the preset conversion rule is the application home page setting rule, the application information of each target sub-application is converted using the preset conversion rule to obtain each target sub-application in a unified format, including: Determine the product type to which each of the target sub-applications belongs; For each target sub-application belonging to the same product type, the homepages of each target sub-application are set to be consistent.
10. The application cluster management method according to claim 1, characterized in that: Also includes: Monitoring the application path of each system application in the application cluster system; If it is monitored that the application path has an IP change, and the application path changes from the absence of the sub-application identifier to the presence of the sub-application identifier, it is determined that the current system application switching mode is switched from the main application mode to the sub-application mode; If it is monitored that the IP of the application path changes, and the application path changes from the presence of the sub-application identifier to the absence of the sub-application identifier, it is determined that the current system application switching mode is switching from the sub-application mode to the main application mode; If it is monitored that the application path has an IP change, and the sub-application identifier exists in the application path before and after the IP change, it is determined that the current system application switching mode is the sub-application switching mode.
11. The application cluster management method according to claim 10, characterized in that: Also includes: During the application path monitoring process, when the browser of the application cluster system is closed, the current main application and the current sub-application are uninstalled; When it is determined that the current system application switching mode is the sub-application switching mode, the sub-application before switching is uninstalled, and the sub-application after switching is loaded.
12. An application cluster management device, characterized in that: Applied to an application cluster system, wherein a main application and sub-applications are deployed in the application cluster system, and both the main application and the sub-applications are dynamic applications, including: A detection module, used to start a target main application, perform an application detection operation using the target main application, and determine each target sub-application; An establishing module, used to establish an association relationship between the target main application and each of the target sub-applications, and start each of the target sub-applications; A creation module, used for creating a sub-application container, setting the working state of the sub-application container to a keep-alive state; the number of the sub-application container is 1; A mounting module, used to mount any of the target sub-applications to the target main application using the sub-application container according to the association relationship, so as to realize dynamic management of the sub-application by the main application; a display module, used to perform path resolution on the current system application, and determine whether there is a sub-application identifier in the application path of the current system application; if the sub-application identifier does not exist in the application path, determine that the current system application is the main application, and display the main application menu; if the sub-application identifier exists in the application path, determine that the current system application is the sub-application, and load and display the sub-application menu; The detection module is specifically used to obtain login information of each sub-application in the application cluster system, wherein the login information includes an application IP and a login password; and use the login information to perform the application detection operation to determine that the sub-application that has successfully logged in is the target sub-application.
13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the application cluster management method according to any one of claims 1 to 11 when executing the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the application cluster management method according to any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the application cluster management method according to any one of claims 1 to 11 are implemented.
