Method for starting and stopping java service process based on web page

CN121579088APending Publication Date: 2026-02-27SHANGHAI TONGLIAN FINANCIAL SERVICES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511679081.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-17
Publication Date
2026-02-27

AI Technical Summary

Benefits of technology

[0048]本发明可以实现可视化的方式来管理java服务进程,用于管理java服务进程停止,启动以及观察java服务进程的内存使用情况以保证java服务进程的健康性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579088A_ABST
    Figure CN121579088A_ABST
Patent Text Reader

Abstract

The invention relates to a method for starting and stopping a java service process based on a web page. The method comprises the following steps: newly establishing a set of web pages for querying and managing a transaction process; defining parameters of a server node where the process service is located; defining parameters of process nodes; a java implementation class is compiled, an ssh service class is used, and a command of a linux start-stop server is assembled to carry out start-stop operation of the service. According to the method and the system, the java service process is managed in a visual mode.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of service process management, in particular to a method for starting and stopping java service process based on web page. BACKGROUND

[0002] In a conventional Internet enterprise, with the continuous development and expansion of the company, the java service process of enterprise management construction will be more and more. For the management personnel, the system management will be more and more complex, so a visual way is needed to manage the java service process; and some service process management can be done, such as service process stopping, starting and observing the memory usage of the service to ensure the health of the service.

[0003] Therefore, it is necessary to provide a method for starting and stopping java service process based on web page, which realizes the visual way to manage the java service process. SUMMARY

[0004] The purpose of the present application is to provide a method for starting and stopping java service process based on web page, which realizes the visual way to manage the java service process.

[0005] In order to solve the problems in the prior art, the present application provides a method for starting and stopping java service process based on web page, comprising the following steps:

[0006] A set of web pages for querying and managing transaction processes is newly created;

[0007] The parameters of the server node where the process service is located are defined;

[0008] The parameters of the process node are defined;

[0009] A java implementation class is written, an ssh service class is used, and the commands for starting and stopping the linux server are assembled to perform the starting and stopping operation of the service.

[0010] Optionally, in the method for starting and stopping java service process based on web page, the required operation buttons are defined in the web page, including start button, stop button and refresh parameter button; and the process related parameter page display to be queried is defined, including process number, process server node, process instance, program name, program version number, process state, start time and memory usage.

[0011] Optionally, in the method for starting and stopping java service process based on web page, the parameters of the server node where the process service is located include:

[0012] Defining the node ip of the server where the server process is located;

[0013] Defining the port of the server where the server process is located;

[0014] Defining the username for logging into the server;

[0015] Defining the private key for logging into the server;

[0016] Defining the default path for logging into the server;

[0017] Defining the installation path of the jdk version installed on the server;

[0018] Defining the installation path of the jsvc corresponding to the server.

[0019] Optionally, in the method of starting and stopping the java service process based on the web page, the parameters of the process node include:

[0020] Defining the unique process ID of the process;

[0021] Defining the process name corresponding to the process;

[0022] Defining the server node corresponding to the process, used for associating query of the corresponding server;

[0023] Defining the version number corresponding to the process;

[0024] Defining the type of the process;

[0025] Defining the memory usage information of the process;

[0026] Defining the start time of the process.

[0027] Optionally, in the method of starting and stopping the java service process based on the web page, the step of starting and stopping the service is as follows:

[0028] According to the process ID, the parameters of the corresponding process node are queried;

[0029] According to the queried parameters of the process node, the parameters of the corresponding server node are queried;

[0030] Assembling the linux command for starting and stopping the service;

[0031] According to the server node ip, the server node port, the server username, the server private key, the ssh service and the login server execution command, the service is started or stopped.

[0032] Optionally, in the method of starting and stopping the java service process based on the web page, after the starting and stopping operation of the service is performed, the following steps are further included:

[0033] The process state in the database is updated according to the returned result of the command.

[0034] Optionally, in the method for starting and stopping the java service process based on the web page, the assembling of the linux command for starting and stopping the service comprises the following steps:

[0035] The installation path of jsvc is obtained, and a corresponding start service operation is added, the start service operation comprising start and stop;

[0036] The installation path of jdk is obtained, and the command home is used;

[0037] The path of the server where the start jar package is located is obtained, and the command cp is used;

[0038] The directory corresponding to the out log output is obtained, and the command outfile is used;

[0039] The directory corresponding to the error log output is obtained, and the command errfile is used;

[0040] The directory corresponding to the pid process is obtained, and the command pidfile is used;

[0041] The default path of server login is obtained, and the command Dapp.home is used;

[0042] The service id corresponding to the process is obtained, and the command Dprocess.id is used;

[0043] The process name corresponding to the process is obtained, and the command Dartifact.id is used;

[0044] The version number corresponding to the process is obtained, and the command Dversion is used;

[0045] The heap size, the persistent generation size and the virtual machine instance parameters used by the program corresponding to the process are obtained;

[0046] The service start class corresponding to the use is obtained.

[0047] Compared with the prior art, the present application has the following advantages:

[0048] The present application can realize the visual management of the java service process, and is used for managing the stop and start of the java service process and observing the memory usage of the java service process to ensure the health of the java service process. BRIEF DESCRIPTION OF DRAWINGS

[0049] Figure 1 The flow chart of the start and stop method provided by the embodiment of the present application is shown. DETAILED DESCRIPTION

[0050] The specific embodiments of the present application will be described in more detail with reference to the drawings. The advantages and features of the present application will be more clearly understood from the following description taken in conjunction with the accompanying drawings. It should be noted that the drawings are in extremely simplified form and are not drawn to precise scale, and are used only to facilitate the understanding of embodiments of the present application.

[0051] In the following, if the method described herein comprises a series of steps, and the order of these steps presented herein is not necessarily the only order in which the steps can be performed, and some of the described steps can be omitted and / or some other steps not described herein can be added to the method.

[0052] In a conventional Internet enterprise, as the company continues to grow, the number of java service processes built by enterprise management will increase. For management personnel, the system management will become more and more complex, so a visual way is needed to manage the java service process; and some service process management can be done, such as service process stop, start and observation of service memory usage to ensure the health of the service.

[0053] In order to solve the problems existing in the prior art, the present application provides a method for starting and stopping java service processes based on web pages, as shown in Figure 1 The method comprises the following steps:

[0054] S1: A set of web pages for querying and managing transaction processes is newly created; operation buttons required in the web pages are defined, including start button, stop button and refresh parameter button; process related parameter page display required for query is defined, including process number, process server node, process instance, program name, program version number, process state, start time and memory usage.

[0055] Web (World Wide Web, World Wide Web) is a global, dynamic interactive distributed graphical information system based on hypertext and HTTP protocol, which organizes information nodes on the Internet into a network structure through hyperlinks to provide a graphical, easy-to-access browsing interface for users.

[0056] S2: The parameters of the server node where the process service is located are defined, including:

[0057] The node ip of the server where the server process is located is defined;

[0058] The port of the server where the server process is located is defined;

[0059] The username for logging into the server is defined;

[0060] Defining the private key of the login server;

[0061] Defining the default path of the login server;

[0062] Defining the installation path of the jdk version of the login server installation, JDK (Java Development Kit) is a Java language software development kit developed by Oracle Corporation, which includes Java runtime environment (JVM and system class library) and compiler (javac), packaging tools (jar) and other development tools, supporting Java SE (standard edition), Jakarta EE (enterprise edition) and JavaME (mobile edition) platform development;

[0063] Defining the installation path of the jsvc (JavaScriptMVC) corresponding to the server, JavaScriptMVC is an open source MVC framework based on JavaScript, aiming to simplify the development process of complex projects. It improves code organization ability by separating data logic, interface display and user interaction control layer, and is compatible with various browsers popular at that time.

[0064] S3: Defining the parameters of the process node, including:

[0065] Defining the unique process ID of the process;

[0066] Defining the process name corresponding to the process;

[0067] Defining the server node corresponding to the process, used for associated query of the corresponding server;

[0068] Defining the version number corresponding to the process;

[0069] Defining the type of the process;

[0070] Defining the memory usage information of the process;

[0071] Defining the start time of the process.

[0072] S4: Writing java implementation class, using ssh service class, assembling linux start and stop server command to perform service start and stop operation, the steps of service start and stop operation are as follows:

[0073] S41: According to the process ID, query the parameters of the corresponding process node;

[0074] S42: According to the parameters of the process node queried, query the parameters of the corresponding server node;

[0075] S43: Assemble the linux command of starting and stopping the service, Linux command is a set of instructions in the operating system for managing files, directories, processes and other resources;

[0076] S44: Start or stop the service according to the server node ip, server node port, server username, server private key, use the ssh service, and log in the server to execute the command.

[0077] S5: After the start-stop operation of the service, the following steps are included:

[0078] Update the process state in the database according to the returned result of the command.

[0079] Preferably, the assembled start-stop service linux command includes the following steps:

[0080] Get the installation path of jsvc, add the corresponding start service operation, and start the service operation including start and stop;

[0081] Get the installation path of jdk, use the command home, and in the Linux system, the home command usually refers to switching to the home directory of the current user (i.e. the path pointed to by the $HOME environment variable);

[0082] Get the path of the server where the start jar package is located, use the command cp, JAR (Java Archive) is a software package file format based on ZIP format, with the extension.jar, used to aggregate Java class files, metadata and resource files, supporting Java application development and deployment; The command cp is a command for file copying in Linux, which can be followed by options and parameters;

[0083] Get the corresponding out log output directory, use the command outfile, and outfile is a subcommand or operator for saving command output to a file;

[0084] Get the corresponding error log output directory, use the command errfile, and errfile is used to find file errors;

[0085] Get the corresponding pid process directory, use the command pidfile, and pidfile command is used to create, manage process ID file (PID file), usually used for process control of daemon process;

[0086] Get the default path of server login, use the command Dapp.home, and Dapp.home command is used to find the data home directory;

[0087] Get the service id corresponding to the process, use the command Dprocess.id, Process.Id is the property of System.Diagnostics.Process class in.NET Framework, used to get the unique identifier (PID) of the current process;

[0088] Get the process name corresponding to the process, use the command Dartifact.id, DartifactId is the name used to identify modules or projects in Maven projects, usually combined with groupId to form a unique project identifier;

[0089] Get the version number corresponding to the process, use the command Dversion, dversion command is used to query DonauKit version information;

[0090] Get the heap size, persistent generation size, and virtual machine instance parameters used by the corresponding process;

[0091] Get the service started by the corresponding process servedamon class, servedamon class is a daemon in Linux system service, responsible for running in the background to provide specific functions, such as network service or system management tasks.

[0092] In summary, compared with the prior art, the present application has the following advantages:

[0093] The present application can realize the visual management of java service process, and is used for managing the stop and start of java service process, and observing the memory usage of java service process to ensure the health of java service process.

[0094] The above is only the preferred embodiment of the present application, and does not limit the present application in any way. Any person skilled in the art, without departing from the scope of the technical solutions of the present application, can make any form of equivalent replacement or modification of the technical solutions and technical contents disclosed in the present application, and still belong to the protection scope of the present application.

Claims

1. A method for starting and stopping a Java service process based on a web page, characterized in that, Includes the following steps: Create a new set of web pages for querying and managing transaction progress; Define the parameters of the server node where the process service resides; Define the parameters of the process node; Write a Java implementation class to use the SSH service class to assemble commands for starting and stopping the Linux server, and perform service start and stop operations.

2. The method for starting and stopping a Java service process based on a web page as described in claim 1, characterized in that, Define the necessary operation buttons on the web page, including a start button, a stop button, and a refresh parameter button; then define the page display of the process-related parameters to be queried, including process ID, process server node, process instance, program name, program version number, process status, start time, and memory usage.

3. The method for starting and stopping a Java service process based on a web page as described in claim 2, characterized in that, The parameters defining the server node where the process service resides include: Define the IP address of the server node where the server process resides; Define the port on the server where the server process resides; Define the username for logging into the server; Define the private key for the login server; Define the default path for the login server; Define the installation path of the JDK version installed on the login server; Define the installation path of jsvc for the server.

4. The method for starting and stopping a Java service process based on a web page as described in claim 3, characterized in that, The parameters for defining a process node include: Define a unique process ID for the process; Define the process name corresponding to the process; Define the server node corresponding to the process, which is used to associate and query the corresponding server; Define the version number corresponding to the process; Define the type of process; Define the memory usage information of a process; Define the process start time.

5. The method for starting and stopping a Java service process based on a web page as described in claim 4, characterized in that, The steps to start or stop a service are as follows: Based on the process ID, query the parameters of the corresponding process node; Query the parameters of the corresponding server node based on the parameters of the process node. Linux commands for assembling, starting, and stopping services; Start or stop the service based on the server node IP, server node port, server username, server private key, use of SSH service, and commands executed after logging into the server.

6. The method for starting and stopping a Java service process based on a web page as described in claim 5, characterized in that, After starting or stopping the service, the following steps are also included: Update the process status in the database based on the results returned by the command.

7. The method for starting and stopping a Java service process based on a web page as described in claim 5, characterized in that, The Linux commands for assembling and stopping the service include the following steps: Obtain the installation path of jsvc, and add the corresponding service startup operations, including start and stop. To obtain the JDK installation path, use the command `home`. To obtain the path of the startup JAR file on the server, use the `cp` command; To obtain the directory of the corresponding out log output, use the command outfile; To obtain the directory where the corresponding error log is output, use the command errfile; To obtain the directory corresponding to the process with the PID, use the command pidfile; To obtain the default login path for the server, use the command `Dapp.home`. To obtain the service ID corresponding to a process, use the command `Dprocess.id`. To obtain the process name corresponding to a process, use the command Dartifact.id; To obtain the version number of a process, use the command Dversion. Get the heap size, permanent generation size, and virtual machine instance parameters used by the program for the corresponding process; Obtain the `serveDamon` class that the corresponding service is started.