Operation method and electronic device for microservices
By providing a graphical user interface and daemon startup scripts in the Windows operating system environment, the problem of local containerization and continuous operation of microservices is solved, and the user experience and operation stability is improved.
Patent Information
- Application Number
- CN202411984114.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-08
AI Technical Summary
In the Windows operating system environment, it is difficult for the existing technology to realize the local containerization and continuous operation of microservices, and the command line operations are not intuitive, which limits the user experience and the popularization of tools.
By providing a graphical user interface and daemon startup script containing microservice controls, users can directly operate microservices through the graphical interface to realize preloading of microservices and continuous operation of daemon processes.
Improves user experience, reduces operational complexity, and realizes the continuous availability and stability of microservices without operating through the command line interface.
Smart Images

Figure CN119781867A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of microservice containerization and management, for example, to an operation method and electronic device for microservices. Background Art
[0002] With the widespread application of cloud computing and microservice architecture, containerization technology has become an indispensable part of modern software development. Kubernetes (k8s for short) is one of the most widely used container orchestration platforms, mainly used to manage containerized application deployment, expansion, and service discovery in cluster environments. However, k8s is mainly designed to solve the problems of server-side container management and large-scale cluster deployment based on the B / S (Browser / Server) architecture, and is not the best choice for applications running in a stand-alone or desktop environment. Especially in the Windows operating system environment, there is currently no local container technology designed specifically for the C / S (Client / Server) architecture.
[0003] If you need to run microservice-based applications locally on the Windows operating system, you usually need to install Java 8. In this case, users must start microservices based on microservice frameworks (such as SpringBoot) through the command line interface. The specific operation includes opening a CMD (Command Prompt) window every time you start a service and entering a specific command in it to start the JAR (Java Archive) file containing the microservice logic.
[0004] However, the related technology runs microservices locally in the Windows operating system environment. Once the CMD window is closed, the service will also stop, which limits the continuous availability of the service. Moreover, for non-technical personnel, command line operations are not intuitive and friendly, which limits the popularity of such tools.
[0005] The information disclosed in the above Background section is only for enhancement of understanding of the background of the present disclosure and therefore may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0006] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0007] The embodiments of the present disclosure provide a method and electronic device for operating microservices, which simplify microservice operations through a graphical interface and a daemon process, thereby improving user experience and the stability of continuous background operation.
[0008] According to a first aspect of the present disclosure, a method for operating a microservice is provided, which is implemented by an operating device for a microservice, and includes:
[0009] In response to a user's startup operation on the running device, a graphical user interface is displayed, the graphical user interface includes a microservice control, and the microservice corresponding to the microservice control has been pre-loaded into the running device;
[0010] In response to a user's selection operation on a microservice control, determining a target microservice that needs to be run;
[0011] Start and run the target microservice as a daemon process through the startup script;
[0012] Collect the running information of the target microservice.
[0013] In some embodiments, the microservice corresponding to the microservice control is preloaded to the running device in the following manner:
[0014] In response to a user's search operation for a microservice to be loaded, determining a JAR file of the microservice in a local storage location;
[0015] Load the determined JAR file into the specified directory and configure the running parameters of the microservice to obtain the configuration file;
[0016] Initialize the startup script of the microservice and end the preloading process of the microservice.
[0017] In some embodiments, loading the determined JAR file into a specified directory includes:
[0018] Call the obfuscation tool to process the determined JAR file to obtain the encrypted JAR file;
[0019] Load the encrypted JAR file into the specified directory.
[0020] In some embodiments, the operating parameters include at least one of the following: the framework type for building the microservice, the name of the microservice, the internationalization key value of the microservice, the service operation port of the microservice, the visualization capability port of the microservice, the service address of the microservice, the configuration file type of the microservice in the development environment, and the configuration file type of the microservice in the production environment.
[0021] In some embodiments, the startup script of initializing the microservice includes:
[0022] Generate a startup script containing all the commands and parameters required to start the microservice;
[0023] Set the startup script application to reference the configuration file of the microservice;
[0024] Configure the daemon function of the startup script.
[0025] In some embodiments, the JAR file is obtained after compiling and packaging the microservice.
[0026] In some embodiments, the target microservice is started and run as a daemon process by starting a script, including:
[0027] Check and set the Java execution path, and start the Java virtual machine based on the Java execution path;
[0028] Set Java virtual machine parameters, start the target microservice based on the Java virtual machine, JAR file, and configuration file, and configure the microservice to run continuously in the background as a daemon process.
[0029] In some embodiments, the operation method for a microservice further includes: when the target microservice operates abnormally, determining abnormal information based on the collected operation information of the target microservice.
[0030] In some embodiments, the operating method for a microservice further includes: in response to a microservice enabling setting operation by a user, setting an enabling state of the microservice, wherein the enabling state includes enabled and disabled, and the enabled microservice is configured with a dynamic path and its microservice control can be displayed in a graphical user interface.
[0031] According to a second aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory storing program instructions and an operating device for microservices, wherein the processor is configured to execute an operating method for microservices provided according to the first aspect of the present disclosure by calling the operating device when running the program instructions.
[0032] The operation method and electronic device for microservices provided by the embodiments of the present disclosure can achieve the following technical effects: the operation method for microservices is implemented by an operation device, the operation device has been pre-loaded with microservices, and provides a graphical user interface including microservice controls. Users can start the corresponding microservices by directly operating the microservice controls without directly interacting with the command line, thereby reducing the complexity of operations, improving user experience, and contributing to the promotion and use of the operation device. In addition, the target microservice is started and run as a daemon process, so even if the graphical user interface is closed, the microservice will continue to run in the background, unaffected by foreground operations, and improve the operation stability of the microservice. Based on the operation method for microservices provided by the embodiments of the present disclosure, when it is necessary to run a microservice-based application locally on the Windows operating system, a microservice based on a microservice framework (such as Spring Boot) can be started and run through the operation device for microservices, without having to start and run such microservices through a command line interface.
[0033] The foregoing general description and the following description are exemplary and explanatory only and are not intended to limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0035] Figure 1 It is a schematic diagram of the architecture of a running device for microservices provided by an embodiment of the present disclosure;
[0036] Figure 2 is a schematic diagram of a graphical user interface provided by an embodiment of the present disclosure;
[0037] Figure 3 is a schematic diagram of a method for operating a microservice provided by an embodiment of the present disclosure;
[0038] Figure 4 is a schematic diagram of another method for operating a microservice provided by an embodiment of the present disclosure;
[0039] Figure 5 is a schematic diagram of another method for operating a microservice provided by an embodiment of the present disclosure;
[0040] Figure 6 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0041] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0042] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0043] Unless otherwise stated, the term "plurality" means two or more.
[0044] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0045] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0046] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0047] The present disclosure provides an electronic device in which a running device for microservices is deployed. Figure 1 and Figure 2 As shown in the figure, the running device includes a graphical user interface, a rendering process, a main process, a microservice loading module, a microservice start and stop module, an information collection module, and a microservice management module. The main process is the main control center of the running device, responsible for managing the life cycle of the entire running device, including startup, loading resources, managing windows, handling system events, etc. The main process is located at the bottom layer and is responsible for managing core tasks such as loading, starting and stopping, information collection and management of microservices. The rendering process is located in the middle layer and is responsible for presenting the graphical user interface and handling the interaction between users and microservice controls.
[0048] The graphical user interface includes microservice controls, each microservice control corresponds to a microservice, and the microservice corresponding to the microservice control has been preloaded into the running device. For example, the graphical user interface includes microservice controls A to microservice controls N, and microservice controls A to microservice controls N correspond to microservices A to microservices N, respectively, and these microservices have been preloaded into the running device. Specifically, the microservices can be compiled and packaged to obtain a JAR file, and the JAR file can be loaded into the running device.
[0049] In the disclosed embodiment, the operating system of the electronic device is a Windows operating system, and the above-mentioned operating device can be operated in a Windows operating system environment. Microservices is a software architecture style that splits a large application into a group of small, independent services, each of which implements a specific business function and can be independently deployed, expanded and maintained.
[0050] Optionally, the microservices in the embodiments of the present disclosure may be based on the microservices of some specified microservice frameworks. The microservice framework is used to simplify and accelerate the construction, deployment and management of applications based on the microservice architecture. Such frameworks enable developers to focus on the implementation of business logic by providing a series of built-in support and services without having to deal with complex distributed system problems from scratch. The microservice frameworks in the embodiments of the present disclosure may include SpringBoot, Micronaut, and Quarkus, etc. Taking Spring Boot as an example, Spring Boot is a project for creating independent, production-level Spring framework-based applications, which simplifies the initial construction and development process of Spring-based applications.
[0051] In conjunction with the operating device for microservices provided in the embodiment of the present disclosure, the embodiment of the present disclosure provides an operating method for microservices, the operating method is implemented by an electronic device (hereinafter referred to as the device) through the operating device for microservices, such as Figure 3 As shown, the operation methods for microservices include:
[0052] S301, the device displays a graphical user interface in response to a user's startup operation on a running device.
[0053] In some embodiments, the desktop of the device may include a shortcut of the running device, and the user starts the running device by clicking the shortcut of the running device, and a graphical user interface will be displayed after the running device is started. Of course, the startup operation for the running device is not limited to this, and the startup operation may also be a voice command, a network remote startup, a hardware button startup, etc.
[0054] The graphical user interface includes microservice controls, each microservice control corresponds to a microservice, and the microservice corresponding to the microservice control has been preloaded into the running device. For example, the graphical user interface includes microservice controls A to microservice controls N, and microservice controls A to microservice controls N correspond to microservices A to microservice N, respectively, and these microservices have been preloaded into the running device.
[0055] S302: In response to a user's selection operation on a microservice control, the device determines a target microservice that needs to be run.
[0056] In the disclosed embodiment, the user can select a specific microservice control by clicking a mouse, touching a touch screen, or navigating a keyboard, etc. Each microservice control is associated with a specific microservice, and the microservice associated with the selected microservice control is used as the target microservice to be run.
[0057] S303: The device starts and runs the target microservice as a daemon process through a startup script.
[0058] In the disclosed embodiment, the device can call the microservice start-stop module, and the microservice start-stop module starts and runs the target microservice in the form of a daemon process through a startup script. Here, a daemon process refers to a program that runs continuously in the background of the operating system. When the target microservice is started and runs in the form of a daemon process, even if the graphical user interface is closed, the microservice will continue to run in the background.
[0059] S304, the device collects the operation information of the target microservice.
[0060] In the disclosed embodiment, the device may call an information collection module, and the information collection module collects the operation information of the target microservice, and the collected operation information of the target microservice may be uniformly collected in a specified directory. The operation information may include operation logs, configuration change history, and user behavior data.
[0061] The operation method for microservices provided in the embodiment of the present disclosure is implemented through an operation device, which has been pre-loaded with microservices and provides a graphical user interface including microservice controls. Users can start the corresponding microservices by directly operating the microservice controls without directly interacting with the command line, thereby reducing the complexity of operations, improving user experience, and contributing to the promotion and use of the operation device. In addition, the target microservice is started and run as a daemon process, so even if the graphical user interface is closed, the microservice will continue to run in the background and will not be affected by foreground operations, thereby improving the operation stability of the microservice. Based on the operation method for microservices provided in the embodiment of the present disclosure, when it is necessary to run a microservice-based application locally on the Windows operating system, a microservice based on a microservice framework (such as Spring Boot) can be started and run through the operation device for microservices, without having to start and run such microservices through a command line interface.
[0062] In some embodiments, the device can call the microservice loading module to preload the microservice corresponding to the microservice control into the running device. Specifically, the microservice corresponding to the microservice control is preloaded into the running device in the following manner: in response to the user's search operation for the microservice to be loaded, the JAR file of the microservice is determined in the local storage location; the determined JAR file is loaded into the specified directory, and the running parameters of the microservice are configured to obtain the configuration file; the startup script of the microservice is initialized, and the preloading process of the microservice is ended. Among them, the JAR file is obtained after the microservice is compiled and packaged. Taking the microservice based on the Spring Boot framework as an example, the Maven command "package" can be used to compile and package the microservice to obtain the JAR file of the microservice.
[0063] In some embodiments, in combination Figure 2 As shown, the graphical user interface includes a setting control, and the user's search operation for the microservice to be loaded includes a click operation on the setting control. In response to the user's click operation on the setting control, the device displays a selection interface for a local storage location. The user can select a corresponding local storage location in the selection interface, and the device displays the JAR file of the microservice in the selected local storage location. The user determines the microservice to be loaded by selecting the JAR file of the corresponding microservice in the local storage location.
[0064] In some embodiments, in combination Figure 2As shown, the graphical user interface includes a setting control, and the user's search operation for the microservice to be loaded includes a click operation on the setting control. In response to the user's click operation on the setting control, the device automatically searches for and displays the JAR files of the microservices that are not currently loaded. The user determines the microservice to be loaded by selecting the JAR file of the corresponding microservice from the displayed JAR files.
[0065] In some embodiments, in response to a user clicking on a setting control, the device automatically searches for and loads JAR files of microservices that are not currently installed. The device determines the relevance of each uninstalled microservice to the installed microservices; and displays the JAR files of each currently uninstalled microservice in descending order of relevance.
[0066] In the embodiment of the present disclosure, for each unloaded microservice, the functional correlation, source correlation, and data dependency correlation of the unloaded microservice with the loaded microservice are determined; based on the functional correlation, source correlation, and data dependency correlation, the device determines the fusion correlation of each unloaded microservice with the loaded microservice; and the JAR files of each currently unloaded microservice are displayed in order of fusion correlation from high to low.
[0067] In the disclosed embodiment, the functional association between the unloaded microservice and the loaded microservice can be calculated based on the business logic similarity and API interface compatibility between the unloaded microservice and the loaded microservice. The business logic similarity can be matched according to the business logic or domain model processed by the microservice; the API interface compatibility is determined by analyzing the API interface provided by the microservice and checking whether the parameter structure, return value format, etc. between them are compatible.
[0068] In the disclosed embodiment, the source correlation between the unloaded microservice and the loaded microservice can be calculated based on the developer, open source project and third-party service of the unloaded microservice and the loaded microservice. It is understandable that if the developer of the unloaded microservice is the same as that of the loaded microservice, the source correlation between the two is high; if the open source project of the unloaded microservice and the loaded microservice comes from the same open source community or project library, the source correlation between the two is high; if the third-party service of the unloaded microservice and the loaded microservice depends on the same third-party service provider, the source correlation between the two is high.
[0069] In the embodiments of the present disclosure, the data dependency correlation between the unloaded microservice and the loaded microservice can be calculated based on the database connection, cache sharing and file system interaction of the unloaded microservice and the loaded microservice. With respect to the database connection, check whether the unloaded microservice and the loaded microservice access the same data storage system. If the two access the same data storage system, the functional correlation between the two is relatively high. With respect to the cache sharing, confirm whether the unloaded microservice and the loaded microservice share the same cache instance. If the two access the same shared cache instance, the functional correlation between the two is relatively high. With respect to the file system interaction, evaluate whether the unloaded microservice and the loaded microservice read and write the same file system path. If the two read and write the same file system path, the functional correlation between the two is relatively high.
[0070] In some embodiments, loading the determined JAR file into a specified directory includes: calling an obfuscation tool to process the determined JAR file to obtain an encrypted JAR file; and loading the encrypted JAR file into the specified directory.
[0071] In the disclosed embodiments, obfuscation tools include ProGuard, DexGuard, Allatori, etc. The obfuscation tool is used to rename the class, method, and variable names in the JAR file, making the decompiled code difficult to understand. This increases the difficulty for crackers to interpret the logic of the original code. Hiding implementation details: In addition to name obfuscation, some advanced obfuscation tools can also modify the bytecode structure or insert obfuscation code to further hide the specific implementation details of the program. The encrypted JAR file can reduce the risk of being analyzed and exploited by hackers. Even if an attacker obtains a JAR file, it is difficult to extract useful information from it to launch a targeted attack.
[0072] In some embodiments, the operating parameters include at least one of the following: the framework type for building the microservice, the name of the microservice, the internationalization key value of the microservice, the service operation port of the microservice, the visualization capability port of the microservice, the service address of the microservice, the configuration file type of the microservice in the development environment, and the configuration file type of the microservice in the production environment.
[0073] In some embodiments, initializing a startup script of a microservice includes: generating a startup script including all commands and parameters required to start the microservice; setting a startup script application to reference a configuration file of the microservice; and configuring a daemon function of the startup script.
[0074] In the disclosed embodiment, by concentrating all the commands and parameters required for startup into one script, the startup process can be fully automated. Developers or operation and maintenance teams only need to execute one script to complete complex startup operations, which greatly simplifies the deployment process and improves work efficiency. Standardized startup scripts can be easily copied in different environments, making the migration from development environment to test environment and then to production environment smoother. The startup script application references the configuration file of the microservice, and the behavior of the microservice can be adjusted without modifying the code. Different configuration files can be used in different environments, so as to achieve seamless switching without recompiling or publishing code. This is particularly suitable for continuous integration / continuous deployment (CI / CD) processes. By configuring the daemon function of the startup script, it is ensured that after starting the microservice based on the startup script, it can continue to run as a daemon in the background, and even if the user closes the terminal window, it will not affect its normal work, which improves the operation stability of the microservice.
[0075] In some embodiments, the target microservice is started and run as a daemon process through a startup script, including: checking and setting the Java execution path, starting the Java virtual machine based on the Java execution path; setting Java virtual machine parameters, starting the target microservice based on the Java virtual machine, JAR file and configuration file, and configuring the microservice as a daemon process to run continuously in the background.
[0076] In the disclosed embodiment, by explicitly specifying the Java execution path, it is possible to ensure that the correct Java version is used to start the microservice, avoiding failures caused by incompatibility issues between different versions. From Java path checking to daemon configuration, each link provides a guarantee for the reliable operation of microservices and reduces the risk of unexpected downtime. Reasonable JVM parameter settings and resource configuration optimize the performance of microservices, improve response speed and processing power. Automatically generated startup scripts and modular JAR file structures simplify operations. By correctly setting the Java path and JVM parameters, microservices are protected from external attacks and the risk of internal data leakage is reduced.
[0077] Combination Figure 4 As shown, the embodiment of the present disclosure provides another operation method for a microservice, and the operation method for a microservice includes:
[0078] S401, the device displays a graphical user interface in response to a user's startup operation on a running device.
[0079] S402: In response to a user's selection operation on a microservice control, the device determines a target microservice that needs to be run.
[0080] S403, the device checks and sets a Java execution path, and starts a Java virtual machine based on the Java execution path.
[0081] In the disclosed embodiment, the device first determines the script running directory and initializes the Java command. The device then checks and sets the Java execution path, specifically, whether there is a custom JAVA_HOME_EFILM environment variable. If JAVA_HOME_EFILM exists, the path is used, otherwise the standard JAVA_HOME environment variable is checked. If both environment variables do not exist, the default value JAVA=java is maintained. Before the actual startup, a step can be added to verify whether the Java path is valid. The set JAVA variable is then used to start the Java virtual machine.
[0082] S404, the device sets Java virtual machine parameters, starts the target microservice based on the Java virtual machine, the JAR file and the configuration file, and configures the microservice to run continuously in the background as a daemon process.
[0083] S405, the device collects the operation information of the target microservice.
[0084] In some embodiments, the operation method for a microservice further includes: when the target microservice operates abnormally, determining abnormal information based on the collected operation information of the target microservice.
[0085] In the disclosed embodiment, by continuously collecting the operation information of the microservice, the abnormal situation can be detected immediately when the problem occurs, thus shortening the time of fault discovery. When the target microservice runs abnormally, the context information of the abnormality can be obtained from the collected operation information, including stack trace, variable status, etc., to help developers quickly understand the root cause of the problem.
[0086] Combination Figure 5 As shown, the embodiment of the present disclosure provides another operation method for a microservice, and the operation method for a microservice includes:
[0087] S501, the device displays a graphical user interface in response to a user's startup operation on a running device.
[0088] S502: In response to a user's selection operation on a microservice control, the device determines a target microservice that needs to be run.
[0089] S503: The device starts and runs the target microservice as a daemon process through a startup script.
[0090] S504, the device collects the operation information of the target microservice.
[0091] S505: When the target microservice runs abnormally, the device determines abnormal information based on the collected running information of the target microservice.
[0092] In some embodiments, the operating method for a microservice further includes: in response to a microservice enabling setting operation by a user, setting an enabling state of the microservice, wherein the enabling state includes enabled and disabled, and the enabled microservice is configured with a dynamic path and its microservice control can be displayed in a graphical user interface.
[0093] In the disclosed embodiment, the device can call the microservice management module to set the enabled state of the microservice. The microservice management module hands the enabled microservice to the microservice start and stop module for processing, generates dynamic routing, and generates microservice controls for the microservice for display in the graphical user interface.
[0094] Combination Figure 6 As shown, an embodiment of the present disclosure provides an electronic device 600, and the electronic device 600 includes a processor (processor) 601 and a memory (memory) 602. Optionally, the electronic device 600 may also include a communication interface (Communication Interface) 603 and a bus 604. Among them, the processor 601, the communication interface 603, and the memory 602 can communicate with each other through the bus 604. The communication interface 603 can be used for information transmission. The memory 602 stores program instructions and an operating device for microservices. When the processor 601 runs the program instructions, it executes the operating method for microservices of the above embodiment by calling the operating device.
[0095] In addition, the logic instructions in the memory 602 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
[0096] The memory 602 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 601 executes the function application and data processing by running the program instructions / modules stored in the memory 602, that is, the operation method for the microservice in the above embodiment is implemented.
[0097] The memory 602 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; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 602 may include a high-speed random access memory and may also include a non-volatile memory.
[0098] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned operation method for microservices.
[0099] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.
[0100] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0101] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0102] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0103] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for operating a microservice, implemented by an operating device for a microservice, characterized in that: include: In response to a user's startup operation on the running device, a graphical user interface is displayed, the graphical user interface includes a microservice control, and the microservice corresponding to the microservice control has been pre-loaded into the running device; In response to a user's selection operation on a microservice control, determining a target microservice that needs to be run; Start and run the target microservice as a daemon process through the startup script; Collect the running information of the target microservice.
2. The method for operating microservices according to claim 1, characterized in that: The microservice corresponding to the microservice control is preloaded to the running device in the following way: In response to a user's search operation for a microservice to be loaded, determining a JAR file of the microservice in a local storage location; Load the determined JAR file into the specified directory and configure the running parameters of the microservice to obtain the configuration file; Initialize the startup script of the microservice and end the preloading process of the microservice.
3. The method for operating microservices according to claim 2, characterized in that: Load the identified JAR files into the specified directory, including: Call the obfuscation tool to process the determined JAR file to obtain the encrypted JAR file; Load the encrypted JAR file into the specified directory.
4. The method for operating microservices according to claim 2, characterized in that: The operating parameters include at least one of the following: the framework type for building the microservice, the name of the microservice, the internationalization key value of the microservice, the service operation port of the microservice, the visualization capability port of the microservice, the service address of the microservice, the configuration file type of the microservice in the development environment, and the configuration file type of the microservice in the production environment.
5. The method for operating microservices according to claim 2, characterized in that: Initialize the startup script of the microservice, including: Generate a startup script containing all the commands and parameters required to start the microservice; Set the startup script application to reference the configuration file of the microservice; Configure the daemon function of the startup script.
6. The method for operating microservices according to claim 1, characterized in that: The JAR file is obtained after compiling and packaging the microservice.
7. The method for operating microservices according to claim 1, characterized in that: Start and run the target microservice as a daemon process through the startup script, including: Check and set the Java execution path, and start the Java virtual machine based on the Java execution path; Set Java virtual machine parameters, start the target microservice based on the Java virtual machine, JAR file, and configuration file, and configure the microservice to run continuously in the background as a daemon process.
8. The method for operating microservices according to claim 1, characterized in that: Also includes: When the target microservice runs abnormally, abnormal information is determined based on the collected running information of the target microservice.
9. The method for operating microservices according to claim 1, characterized in that: Also includes: In response to the user's microservice enabling setting operation, the enabling state of the microservice is set, and the enabling state includes enabled and disabled. The enabled microservice is configured with a dynamic path and its microservice control can be displayed in the graphical user interface.
10. An electronic device comprising a processor and a memory storing program instructions and a running device for a microservice, characterized in that: The processor is configured to execute the operating method for microservices according to any one of claims 1 to 9 by calling the operating device when running the program instructions.
Citation Information
Cited By
Web-based micro-service process management method
CN121560418A
A web-based microservice process management method
CN121560418B