Application deployment method and device based on engine deployment, equipment and storage medium
By reading the deployment engine skip tag in the server deployment description file of the WEB application, determining the target engine name that needs to be skipped, and traversing the local deployment engine class collection, deleting unnecessary classes, solving the problem of application deployment failure and improving deployment success rate and operation and maintenance efficiency.
Patent Information
- Application Number
- CN202510053986.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-04-25
AI Technical Summary
During the WEB application deployment process, due to the irregular application writing, the abandoned classes containing relevant component annotations were not deleted in time, resulting in the failure of application deployment. The existing technology requires manual modification of files, which increases the workload and is not conducive to operation and maintenance.
By reading the deployment engine skip tag in the server deployment description file of the application to be deployed, determine the target engine name that needs to be skipped, traverse the local deployment engine class collection, delete unnecessary deployment engine classes, and finally deploy the application based on the remaining deployment engine classes.
It realizes skipping the startup of relevant deployment engines through configuration files, solves the problem of application deployment failure, improves the success rate of application deployment, and enhances the compatibility and operation and maintenance efficiency of application servers.
Smart Images

Figure CN119883293A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an application deployment method, device, equipment and storage medium based on engine deployment. Background Art
[0002] During the deployment of a WEB (World Wide Web) application, the application server usually starts multiple deployment engines. The deployment engines parse the WEB application and load the WEB application components, so that the WEB application is deployed successfully and accessed successfully. By default, multiple deployment engines in the application server determine whether the application uses related components by scanning the application classes or annotations, and then start them. However, in some scenarios, the application is not written in a standardized manner, and the abandoned classes containing related component annotations are not deleted in time. When the application server scans the relevant annotations and starts the relevant deployment engine, the application deployment fails and runs abnormally due to the non-standard application writing and the failure to delete the abandoned classes containing related component annotations in time.
[0003] In the prior art, the above-mentioned problem is usually overcome by the manufacturer manually finding and deleting the abandoned related annotation class method, or by manually annotating or deleting the jar file of the related deployment engine itself. However, the method in the prior art requires manual modification of the files of the WEB application layer, which makes application development inflexible, thereby increasing the workload. In addition, modifying the files of the application server layer is inconvenient for the subsequent operation and maintenance of the application server and WEB application, making the operation and maintenance work more cumbersome and difficult. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide an application deployment method, device, equipment and storage medium based on engine deployment, which can skip the startup of the relevant deployment engine in the form of a configuration file to solve the problem of application deployment failure. The specific solution is as follows:
[0005] In a first aspect, the present application discloses an application deployment method based on engine deployment, which is applied to an application server, comprising:
[0006] If a plurality of applications to be deployed are received, server deployment description files in the plurality of applications to be deployed are read, and deployment engine skip tags in the server deployment description files are determined, so as to determine a plurality of target engine names for skipping application deployment based on the deployment engine skip tags;
[0007] Traverse the local deployment engine class collection to determine the currently traversed deployment engine class, and loop through the array attributes in the deployment engine class to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result;
[0008] Determine the deployment engine name corresponding to the deployment engine class based on the engine name array attribute, and determine whether there is an engine name identical to the deployment engine name among the plurality of target engine names, and if there is an engine name identical to the deployment engine name among the plurality of target engine names, delete the deployment engine class from the deployment engine class set;
[0009] Jump to the step of traversing the local deployment engine class set until all deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set.
[0010] Optionally, if a plurality of applications to be deployed are received, server deployment description files in the plurality of applications to be deployed are read, and deployment engine skip tags in the server deployment description files are determined, so as to determine a plurality of target engine names for skipping application deployment based on the deployment engine skip tags, including:
[0011] If an application to be deployed is received, a reading operation is performed on the application to be deployed according to a preset path to determine a server deployment description file in the application to be deployed;
[0012] Parsing the server deployment description file to determine a deployment engine skip tag in the server deployment description file, and reading a target engine name corresponding to the deployment engine skip tag;
[0013] The target engine name is stored in the engine name array attribute of the deployment engine class of the application to be deployed.
[0014] Optionally, storing the target engine name in the engine name array attribute of the deployment engine class of the application to be deployed includes:
[0015] The target engine name is segmented by calling a preset string segmentation method to obtain a segmentation array corresponding to the target engine name, and the segmentation array is stored in the engine name array attribute of the deployment engine class of the application to be deployed.
[0016] Optionally, the traversing of the local deployment engine class set to determine the currently traversed deployment engine class, and looping through the array attributes in the deployment engine class to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result, includes:
[0017] Call the preset engine acquisition method to obtain all local deployment engine classes to obtain a deployment engine class collection;
[0018] Traversing the deployment engine class set, and taking the first deployment engine class traversed as the currently traversed deployment engine class;
[0019] The array attributes of the deployment engine class are traversed in a loop to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result.
[0020] Optionally, determining the deployment engine name corresponding to the deployment engine class based on the engine name array attribute, and determining whether there is an engine name identical to the deployment engine name among the plurality of target engine names, and if there is an engine name identical to the deployment engine name among the plurality of target engine names, deleting the deployment engine class from the deployment engine class set, comprises:
[0021] Calling a preset name acquisition method to acquire the deployment engine name in the engine name array attribute, and determining a target segmentation array corresponding to the deployment engine name;
[0022] Comparing the target segmentation array with the segmentation arrays corresponding to the target engine names respectively to determine whether there is an array in the segmentation arrays that completely corresponds to the elements of the target segmentation array;
[0023] If there is an array in the plurality of segmentation arrays that completely corresponds to the target segmentation array elements, the deployment engine class is deleted from the deployment engine class set.
[0024] Optionally, the performing application deployment based on a deployment engine corresponding to the current deployment engine class set includes:
[0025] A number of deployment engine classes in the current deployment engine class set are determined, and the number of deployment engine classes are started in sequence to perform application deployment of applications corresponding to the number of engine classes.
[0026] Optionally, the engine deployment-based application deployment method further includes:
[0027] If there is a deployment failure engine class that fails to be deployed among the plurality of engine classes, determining a deployment failure application corresponding to the deployment failure engine class;
[0028] A deployment engine skip tag is added to the target server deployment description file corresponding to the deployment failure application, and the deployment failure application is redeployed.
[0029] In a second aspect, the present application discloses an application deployment device based on engine deployment, which is applied to an application server, including:
[0030] An information determination module, configured to read server deployment description files in the applications to be deployed if a plurality of applications to be deployed are received, and determine deployment engine skip tags in the server deployment description files, so as to determine a plurality of target engine names for skipping application deployment based on the deployment engine skip tags;
[0031] A class set traversal module, used to traverse the local deployment engine class set to determine the currently traversed deployment engine class, and to loop through the array attributes in the deployment engine class to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result;
[0032] an engine class deletion module, configured to determine the deployment engine name corresponding to the deployment engine class based on the engine name array attribute, and determine whether there is an engine name identical to the deployment engine name among the plurality of target engine names, and if there is an engine name identical to the deployment engine name among the plurality of target engine names, delete the deployment engine class from the deployment engine class set;
[0033] The step jump module is used to jump to the step of traversing the local deployment engine class set until all deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set.
[0034] In a third aspect, the present application discloses an electronic device, comprising:
[0035] Memory, used to store computer programs;
[0036] The processor is used to execute the computer program to implement the application deployment method based on engine deployment as mentioned above.
[0037] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned engine-based application deployment method.
[0038] In the present application, when a number of applications to be deployed are received, the server deployment description files in the number of applications to be deployed are read, and the deployment engine skip tag in the server deployment description file is determined, so as to determine a number of target engine names for skipping application deployment based on the deployment engine skip tag; the local deployment engine class set is traversed to determine the currently traversed deployment engine class, and the array attribute in the deployment engine class is traversed in a loop to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result; the deployment engine name corresponding to the deployment engine class is determined based on the engine name array attribute, and it is determined whether there is an engine name identical to the deployment engine name in the number of target engine names, if there is an engine name identical to the deployment engine name in the number of target engine names, the deployment engine class is deleted from the deployment engine class set; jump to the step of traversing the local deployment engine class set until all the deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set.
[0039] It can be seen that through the method of the present application, the deployment engine skip tag can be determined by reading the server deployment description files of several applications to be deployed, and then the target engine name that needs to skip the application deployment can be determined according to the deployment engine skip tag. Then the local deployment engine class set can be traversed, and the array attributes of the traversed deployment engine class can be looped to determine the engine name array attribute corresponding to the deployment engine class, and then the deployment engine name corresponding to the deployment engine class can be determined based on the engine name array attribute, and then it can be determined whether there is an engine name identical to the deployment engine name in the target engine name. If so, the current deployment engine class is deleted from the deployment engine class set. Finally, the traversal of the local deployment engine class set is continued until all the deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set. In this way, the startup of the relevant deployment engine can be skipped in the form of a configuration file, the problem of application deployment failure can be solved, and the compatibility of the application server can be enhanced to improve the operation and maintenance efficiency of the application in the later stage. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0041] Figure 1 A flow chart of an application deployment method based on engine deployment disclosed in this application;
[0042] Figure 2 This is a timing diagram of application deployment disclosed in this application;
[0043] Figure 3 A flowchart of a specific application deployment method based on engine deployment disclosed in this application;
[0044] Figure 4 This is a schematic diagram of the structure of an application deployment device based on engine deployment disclosed in this application;
[0045] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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.
[0047] In the prior art, the above-mentioned problem is usually overcome by the manufacturer manually finding and deleting the abandoned related annotation class method, or by manually annotating or deleting the jar file of the related deployment engine itself. However, the method in the prior art requires manual modification of the files of the WEB application layer, which makes application development inflexible, thereby increasing the workload. In addition, modifying the files of the application server layer is inconvenient for the subsequent operation and maintenance of the application server and WEB application, making the operation and maintenance work more cumbersome and difficult.
[0048] In order to overcome the above technical problems, the present application discloses an application deployment method, device, equipment and storage medium based on engine deployment, which can skip the startup of the relevant deployment engine in the form of a configuration file, solve the problem of application deployment failure, and improve operation and maintenance efficiency.
[0049] See also Figure 1 As shown, an embodiment of the present invention discloses an application deployment method based on engine deployment, which is applied to an application server and includes:
[0050] Step S11: If a number of applications to be deployed are received, server deployment description files in the applications to be deployed are read, and deployment engine skip tags in the server deployment description files are determined to determine a number of target engine names for skipping application deployment based on the deployment engine skip tags.
[0051] In this embodiment, before the application is deployed, it is necessary to perform preparation work for the application deployment, such as Figure 2As shown, first you need to deploy the server deployment description file in each application. It should be noted that you can configure the deployment engine skip tag in the application server standard deployment description file. You need to configure the attribute named skipSniffers in the deployment engine skip tag. This attribute is a custom attribute. You can configure the name of the deployment engine to be skipped. Multiple names are separated by commas. Specifically, you can define the inforsuite-web.xml deployment description file and configure the skip engine attribute tag, such as <property name="skipSniffers" value="" / > , where value can be temporarily configured as empty, because when deploying an application for the first time, it is not known whether there are deployment engines that need to be skipped. You can adjust the configuration according to the actual situation later. If you have clearly identified the deployment engines that need to be skipped, you can directly configure them, for example <property name="skipSniffers" value="ejb , cdi" / > , where EJB deployment engine and CDI deployment engine are tags that need to skip deployment, and then place the configured deployment description file in the WEB-INF directory of the WEB application so that the application server can read this configuration during subsequent deployment.
[0052] If the application server receives several applications to be deployed, it needs to read the applications to be deployed according to the preset path, which is the WEB-INF directory of the application in this embodiment, and then read the server deployment description file of each application to be deployed. Then it needs to parse the server deployment description file to determine the deployment engine skip tag in the server deployment description file, read the deployment engine name to be skipped configured by the skipSniffers attribute, and store the target engine name in the engine name array attribute of the deployment engine class of the application to be deployed.
[0053] It should be noted that after reading the name of the deployment engine that needs to be skipped, it is necessary to call a preset string segmentation method, such as calling the string segmentation method of JDK (Java Development Kit, a Java-based software development kit), using commas as segmentation nodes to segment the target engine name to obtain a segmentation array corresponding to the target engine name, and then store the segmentation array in the engine name array attribute of the deployment engine class of the application to be deployed.
[0054] Step S12: traverse the local deployment engine class set to determine the currently traversed deployment engine class, and traverse the array attributes in the deployment engine class in a loop to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result.
[0055] In this embodiment, the local deployment engine class set can be traversed to take the first deployment engine class traversed as the currently traversed deployment engine class, and then in the subsequent traversal, each traversed deployment engine class is taken as the currently traversed deployment engine class. Specifically, it is necessary to call the preset engine acquisition method to obtain all local deployment engine classes to obtain a deployment engine class set, and then traverse the deployment engine class set, and take the first traversed deployment engine class as the currently traversed deployment engine class. The loop for the deployment engine class is an outer loop. Further, it is necessary to loop the array attributes of the deployment engine class to determine the engine name array attribute corresponding to the deployment engine class by looping the array attributes. The loop for the array attributes in the deployment engine class is an inner loop. In this way, the efficiency of application deployment can be improved by traversing the outer loop of the deployment engine class and traversing the inner loop of the array attributes.
[0056] Step S13: determine the deployment engine name corresponding to the deployment engine class based on the engine name array attribute, and determine whether there is an engine name identical to the deployment engine name among the several target engine names; if there is an engine name identical to the deployment engine name among the several target engine names, delete the deployment engine class from the deployment engine class set.
[0057] In this embodiment, it is necessary to determine the deployment engine name corresponding to the deployment engine class based on the engine name array attribute. Specifically, the deployment engine name corresponding to the currently traversed deployment engine class can be determined by reading the engine name array attribute, and then the target segmentation array corresponding to the deployment engine name needs to be determined. Further, it is necessary to determine whether there is an engine name identical to the deployment engine name among several target engine names, and since there may be multiple applications to be deployed, it is necessary to determine several segmentation arrays corresponding to all current applications to be deployed, and then the target segmentation array is compared with several segmentation arrays corresponding to several target engine names to determine whether there is an array in several segmentation arrays that completely corresponds to the target segmentation array elements. If there is an array in several segmentation arrays that completely corresponds to the target segmentation array elements, it indicates that the currently traversed deployment engine needs to be skipped when there is a deployment, so it is necessary to delete the currently traversed deployment engine class from the deployment engine class set. In this way, the startup of the relevant deployment engine can be skipped in the form of a configuration file to solve the problem of application deployment failure.
[0058] Step S14: Jump to the step of traversing the local deployment engine class set until all deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set.
[0059] In this embodiment, after the processing of the currently traversed deployment engine class is completed, it is necessary to jump back to the step of traversing the local deployment engine class set to continue the loop traversal, and use the next traversed deployment engine class as the currently traversed deployment engine class, and then continue the outer loop for the deployment engine class until all the deployment engine classes in the deployment engine class set are traversed. When all the deployment engine classes in the deployment engine class set are traversed, the deployment engine classes in the deployment engine class set that need to be skipped by the engine have all been deleted in the deployment engine class set, so the application deployment can be performed according to the deployment engine in the current deployment engine class set that is finally obtained.
[0060] It should be noted that in the process of application deployment, there may be a situation where the deployment fails due to some scenarios, that is, in non-standard scenarios, classes containing relevant component annotations remain in the application. Therefore, if there is a deployment failure engine class that fails to deploy in several engine classes, the deployment failure application corresponding to the deployment failure engine class is determined, and then according to the actual deployment error, the engine to be skipped is configured in the skipSniffers attribute of the inforsuite-web.xml deployment description file, so as to add a deployment engine skip tag in the target server deployment description file corresponding to the deployment failure application, and redeploy the deployment failure application. Therefore, when redeploying the application that failed to deploy, the engine that failed to deploy before can be skipped to achieve the deployment of the application. In this way, the deployment error problem of the application can be solved by constantly adjusting the server deployment description file, and finally the application can be deployed successfully, which effectively improves the success rate of application deployment and thus improves the user experience.
[0061] It can be seen that, through the method of the present application, the deployment engine skip tag can be determined by reading the server deployment description files of several applications to be deployed, and then the target engine name that needs to skip the application deployment can be determined according to the deployment engine skip tag. Then the local deployment engine class set can be traversed, and the array attributes of the traversed deployment engine class can be traversed in a loop to determine the engine name array attribute corresponding to the deployment engine class, and then the deployment engine name corresponding to the deployment engine class can be determined based on the engine name array attribute, and then it is determined whether there is an engine name identical to the deployment engine name in the target engine name. If so, the current deployment engine class is deleted from the deployment engine class set. Finally, the traversal of the local deployment engine class set is continued until all the deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set. In this way, on the one hand, the startup of the relevant deployment engine can be skipped in the form of a configuration file, the problem of application deployment failure can be solved, and the success rate of application deployment can be improved. On the other hand, the compatibility and availability of the application server can be enhanced, so that the subsequent operation and maintenance work of the application server and the application becomes more efficient, and the workload of the operation and maintenance personnel is reduced.
[0062] Based on the above embodiments, it can be seen that in this application, it is necessary to loop through the deployment engine class set and loop through the array properties of the deployment engine class to determine the deployment engine class that needs to be deleted from the deployment engine class set. For this reason, this embodiment describes in detail how to determine the deployment engine class that needs to be deleted from the deployment engine class set through a double loop. Figure 3 As shown, an embodiment of the present invention discloses an application deployment method based on engine deployment, including:
[0063] Step S21: If a number of applications to be deployed are received, the server deployment description files in the applications to be deployed are read, and the deployment engine skip tags in the server deployment description files are determined to determine a number of target engine names for skipping application deployment based on the deployment engine skip tags.
[0064] Step S22: Call the preset engine acquisition method to acquire all local deployment engine classes to obtain a deployment engine class set.
[0065] In this embodiment, it is necessary to call the preset engine acquisition method to obtain all local deployment engine classes. It should be noted that the preset engine acquisition method can be set by the user. In this embodiment, it is the acquisition engine service method of the service locator class in the application server. By calling the acquisition engine service method of the service locator class in the application server, all deployment engine classes in the application server are acquired and stored in the deployment engine class collection object.
[0066] Step S23: traverse the deployment engine class set, and use the first traversed deployment engine class as the currently traversed deployment engine class.
[0067] In this embodiment, the deployment engine class collection needs to be traversed. Specifically, the deployment engine class collection objects can be traversed by calling the JDK's for loop traversal method, and the first traversed deployment engine class is used as the currently traversed deployment engine class, and the loop for the deployment engine class is an outer loop.
[0068] Step S24: loop through the array attributes of the deployment engine class to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result.
[0069] In this embodiment, it is necessary to loop traverse the array attributes in the deployment engine class. Specifically, the JDK's for loop traversal method can be used again in the for loop that traverses the deployment engine class collection object to traverse the array attributes of the deployment engine class, that is, a double for loop traversal (the outer loop traverses the deployment engine class collection object, and the inner loop traversal skips the engine name array attribute) and the array attribute of the deployment engine class is the skipped engine name array attribute.
[0070] Step S25: Call a preset name acquisition method to acquire the deployment engine name in the engine name array attribute, and determine the target segmentation array corresponding to the deployment engine name.
[0071] In this embodiment, it is necessary to call a preset name acquisition method to obtain the deployment engine name in the engine name array attribute, wherein the preset name acquisition method can be set by the user. In this embodiment, the deployment engine name is obtained by calling the name acquisition method of the deployment engine class, and after the deployment engine name is determined, it is necessary to determine the target segmentation array corresponding to the deployment engine name.
[0072] Step S26: Compare the target segmentation array with the segmentation arrays corresponding to the target engine names to determine whether there is an array in the segmentation arrays that completely corresponds to the target segmentation array elements.
[0073] In this embodiment, it is necessary to compare the target segmentation array with several segmentation arrays corresponding to several target engine names. Specifically, the target segmentation array can be compared with the elements in the several segmentation arrays through the JDK string comparison method to determine whether there are arrays in the several segmentation arrays whose elements completely correspond to the elements of the target segmentation array.
[0074] Step S27: If there is an array in the plurality of segmentation arrays that completely corresponds to the target segmentation array element, the deployment engine class is deleted from the deployment engine class set.
[0075] In this embodiment, if there is an array in the several segmented arrays with elements that completely correspond to the target segmented array elements, the delete element method of the deployment engine class collection object is called to delete the current deployment engine class. Since the engine names corresponding to the several segmented arrays are all engine names that need to be skipped, when there is a completely corresponding array, it indicates that the current deployment engine needs to be skipped during deployment, so it is necessary to call the delete element method of the deployment engine class collection object to delete the current deployment engine class. If they are not equal, the loop is continued, and each time the loop is executed, a round of the above comparison process is executed until all deployment engine classes in the deployment engine class collection are traversed.
[0076] Step S28: Jump to the step of traversing the deployment engine class set until all deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set.
[0077] In this embodiment, if a number of applications to be deployed are received, the server deployment description files in the applications to be deployed are read, and the deployment engine skip tags in the server deployment description files are determined, so as to determine the target engine names for skipping the application deployment based on the deployment engine skip tags, and then the preset engine acquisition method needs to be called to obtain all local deployment engine classes to obtain a deployment engine class set, and the deployment engine class set is traversed, and the first deployment engine class traversed is used as the currently traversed deployment engine class, and then the array attribute of the deployment engine class is traversed in a loop to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result. After determining the engine name array attribute, it is necessary to call the preset name acquisition method to obtain the deployment engine name in the engine name array attribute, and determine the target segmentation array corresponding to the deployment engine name, and then compare the target segmentation array with the segmentation arrays corresponding to the target engine names respectively to determine whether there is an array in the segmentation arrays that completely corresponds to the target segmentation array elements. If there is an array in the segmentation arrays that completely corresponds to the target segmentation array elements, the deployment engine class is deleted from the deployment engine class set. Therefore, when it is determined that the name corresponding to the currently traversed deployment engine class completely corresponds to an engine name in the engine names corresponding to the several segmentation arrays, the current deployment engine class can be deleted. Since the engine names corresponding to the several segmentation arrays are all engine names that need to be skipped, when there is a completely corresponding array, it indicates that the current deployment engine needs to be skipped during deployment. Therefore, the currently traversed deployment engine class can be deleted from the deployment engine class set to skip the engine during application deployment. In this way, the startup of the relevant deployment engine can be skipped in the form of a configuration file to solve the problem of application deployment failure.
[0078] See also Figure 4 As shown, an embodiment of the present invention discloses an application deployment device based on engine deployment, which is applied to an application server and includes:
[0079] The information determination module 11 is used for, if receiving a plurality of applications to be deployed, reading the server deployment description files in the plurality of applications to be deployed, and determining the deployment engine skip tags in the server deployment description files, so as to determine a plurality of target engine names for skipping application deployment based on the deployment engine skip tags;
[0080] The class set traversal module 12 is used to traverse the local deployment engine class set to determine the currently traversed deployment engine class, and to loop through the array attributes in the deployment engine class to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result;
[0081] An engine class deletion module 13 is used to determine the deployment engine name corresponding to the deployment engine class based on the engine name array attribute, and determine whether there is an engine name identical to the deployment engine name among the plurality of target engine names, and if there is an engine name identical to the deployment engine name among the plurality of target engine names, delete the deployment engine class from the deployment engine class set;
[0082] The step jump module 14 is used to jump to the step of traversing the local deployment engine class set until all deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set.
[0083] In the present application, when a number of applications to be deployed are received, the server deployment description files in the number of applications to be deployed are read, and the deployment engine skip tag in the server deployment description file is determined, so as to determine a number of target engine names for skipping application deployment based on the deployment engine skip tag; the local deployment engine class set is traversed to determine the currently traversed deployment engine class, and the array attribute in the deployment engine class is traversed in a loop to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result; the deployment engine name corresponding to the deployment engine class is determined based on the engine name array attribute, and it is determined whether there is an engine name identical to the deployment engine name in the number of target engine names, if there is an engine name identical to the deployment engine name in the number of target engine names, the deployment engine class is deleted from the deployment engine class set; jump to the step of traversing the local deployment engine class set until all the deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set. It can be seen that through the method of the present application, the deployment engine skip tag can be determined by reading the server deployment description files of several applications to be deployed, and then the target engine name that needs to skip the application deployment can be determined according to the deployment engine skip tag. Then the local deployment engine class set can be traversed, and the array attributes of the traversed deployment engine class can be looped to determine the engine name array attribute corresponding to the deployment engine class, and then the deployment engine name corresponding to the deployment engine class can be determined based on the engine name array attribute, and then it can be determined whether there is an engine name identical to the deployment engine name in the target engine name. If so, the current deployment engine class is deleted from the deployment engine class set. Finally, the traversal of the local deployment engine class set is continued until all the deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set. In this way, the startup of the relevant deployment engine can be skipped in the form of a configuration file, the problem of application deployment failure can be solved, and the compatibility of the application server can be enhanced to improve the operation and maintenance efficiency of the application in the later stage.
[0084] In some embodiments, the information determination module 11 may specifically include:
[0085] A description file determination submodule is used for, if an application to be deployed is received, to read the application to be deployed according to a preset path to determine a server deployment description file in the application to be deployed;
[0086] A tag determination submodule, used to parse the server deployment description file to determine the deployment engine skip tag in the server deployment description file, and read the target engine name corresponding to the deployment engine skip tag;
[0087] The data storage submodule is used to store the target engine name in the engine name array attribute of the deployment engine class of the application to be deployed.
[0088] In some embodiments, the data storage submodule may specifically include:
[0089] The data storage unit is used to call a preset string segmentation method to segment the target engine name to obtain a segmentation array corresponding to the target engine name, and store the segmentation array in the engine name array attribute of the deployment engine class of the application to be deployed.
[0090] In some embodiments, the class set traversal module 12 may specifically include:
[0091] The engine class calling unit is used to call the preset engine acquisition method to obtain all local deployment engine classes to obtain a deployment engine class set;
[0092] A collection traversal unit, used to traverse the deployment engine class collection and use the first traversed deployment engine class as the currently traversed deployment engine class;
[0093] The property traversal unit is used to traverse the array properties of the deployment engine class in a loop to determine the engine name array property corresponding to the deployment engine class according to the traversal result.
[0094] In some embodiments, the engine class deletion module 13 may specifically include:
[0095] An information determination unit, configured to call a preset name acquisition method to acquire a deployment engine name in the engine name array attribute, and determine a target segmentation array corresponding to the deployment engine name;
[0096] A data comparison unit, used for comparing the target segmentation array with the plurality of segmentation arrays corresponding to the plurality of target engine names, respectively, to determine whether there is an array in the plurality of segmentation arrays that completely corresponds to the elements of the target segmentation array;
[0097] A data deleting unit is used to delete the deployment engine class from the deployment engine class set if there is an array in the plurality of segmented arrays that completely corresponds to the target segmented array element.
[0098] In some embodiments, the step jump module 14 may specifically include:
[0099] The application deployment unit is used to determine several deployment engine classes in the current deployment engine class set, and start the several deployment engine classes in sequence to perform application deployment of applications corresponding to the several engine classes.
[0100] In some embodiments, the engine-based application deployment device may further include:
[0101] an application determining unit, configured to determine a deployment failure application corresponding to a deployment failure engine class if there is a deployment failure engine class that fails to be deployed among the plurality of engine classes;
[0102] The tag adding unit is used to add a deployment engine skip tag in the target server deployment description file corresponding to the deployment failure application, and redeploy the deployment failure application.
[0103] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0104] Figure 5 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the application deployment method based on engine deployment disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0105] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0106] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0107] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the application deployment method based on engine deployment performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0108] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed application deployment method based on engine deployment is implemented. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.
[0109] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the 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.
[0110] 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 this application.
[0111] 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.
[0112] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0113] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An application deployment method based on engine deployment, characterized in that: Applicable to application servers, including: If a plurality of applications to be deployed are received, server deployment description files in the plurality of applications to be deployed are read, and deployment engine skip tags in the server deployment description files are determined, so as to determine a plurality of target engine names for skipping application deployment based on the deployment engine skip tags; Traverse the local deployment engine class collection to determine the currently traversed deployment engine class, and loop through the array attributes in the deployment engine class to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result; Determine the deployment engine name corresponding to the deployment engine class based on the engine name array attribute, and determine whether there is an engine name identical to the deployment engine name among the plurality of target engine names, and if there is an engine name identical to the deployment engine name among the plurality of target engine names, delete the deployment engine class from the deployment engine class set; Jump to the step of traversing the local deployment engine class set until all deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set.
2. The engine deployment-based application deployment method according to claim 1, characterized in that: If a plurality of applications to be deployed are received, server deployment description files in the plurality of applications to be deployed are read, and deployment engine skip tags in the server deployment description files are determined to determine a plurality of target engine names for skipping application deployment based on the deployment engine skip tags, including: If an application to be deployed is received, a reading operation is performed on the application to be deployed according to a preset path to determine a server deployment description file in the application to be deployed; Parsing the server deployment description file to determine a deployment engine skip tag in the server deployment description file, and reading a target engine name corresponding to the deployment engine skip tag; The target engine name is stored in the engine name array attribute of the deployment engine class of the application to be deployed.
3. The engine deployment-based application deployment method according to claim 2, characterized in that: The step of storing the target engine name in the engine name array attribute of the deployment engine class of the application to be deployed includes: The target engine name is segmented by calling a preset string segmentation method to obtain a segmentation array corresponding to the target engine name, and the segmentation array is stored in the engine name array attribute of the deployment engine class of the application to be deployed.
4. The application deployment method based on engine deployment according to claim 1, characterized in that: The traversing of the local deployment engine class set to determine the currently traversed deployment engine class, and looping through the array attributes in the deployment engine class to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result, including: Call the preset engine acquisition method to obtain all local deployment engine classes to obtain a deployment engine class collection; Traversing the deployment engine class set, and taking the first deployment engine class traversed as the currently traversed deployment engine class; The array attributes of the deployment engine class are traversed in a loop to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result.
5. The application deployment method based on engine deployment according to claim 1, characterized in that: The step of determining the deployment engine name corresponding to the deployment engine class based on the engine name array attribute, and determining whether there is an engine name identical to the deployment engine name among the plurality of target engine names, and if there is an engine name identical to the deployment engine name among the plurality of target engine names, deleting the deployment engine class from the deployment engine class set comprises: Calling a preset name acquisition method to acquire the deployment engine name in the engine name array attribute, and determining a target segmentation array corresponding to the deployment engine name; Comparing the target segmentation array with the segmentation arrays corresponding to the target engine names respectively to determine whether there is an array in the segmentation arrays that completely corresponds to the elements of the target segmentation array; If there is an array in the plurality of segmentation arrays that completely corresponds to the target segmentation array elements, the deployment engine class is deleted from the deployment engine class set.
6. The engine deployment-based application deployment method according to any one of claims 1 to 5, characterized in that: The application deployment based on the deployment engine corresponding to the current deployment engine class set includes: A number of deployment engine classes in the current deployment engine class set are determined, and the number of deployment engine classes are started in sequence to perform application deployment of applications corresponding to the number of engine classes.
7. The engine deployment-based application deployment method according to claim 6, characterized in that: Also includes: If there is a deployment failure engine class that fails to be deployed among the plurality of engine classes, determining a deployment failure application corresponding to the deployment failure engine class; A deployment engine skip tag is added to the target server deployment description file corresponding to the deployment failure application, and the deployment failure application is redeployed.
8. An application deployment device based on engine deployment, characterized in that: Applicable to application servers, including: An information determination module, configured to read server deployment description files in the applications to be deployed if a plurality of applications to be deployed are received, and determine deployment engine skip tags in the server deployment description files, so as to determine a plurality of target engine names for skipping application deployment based on the deployment engine skip tags; A class set traversal module, used to traverse the local deployment engine class set to determine the currently traversed deployment engine class, and to loop through the array attributes in the deployment engine class to determine the engine name array attribute corresponding to the deployment engine class according to the traversal result; an engine class deletion module, configured to determine the deployment engine name corresponding to the deployment engine class based on the engine name array attribute, and determine whether there is an engine name identical to the deployment engine name among the plurality of target engine names, and if there is an engine name identical to the deployment engine name among the plurality of target engine names, delete the deployment engine class from the deployment engine class set; The step jump module is used to jump to the step of traversing the local deployment engine class set until all deployment engine classes in the deployment engine class set are traversed, so as to perform application deployment based on the deployment engine corresponding to the current deployment engine class set.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the engine deployment-based application deployment method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the engine deployment-based application deployment method according to any one of claims 1 to 7 is implemented.