CN109189499B - Java program management method, java program management device, computer device and storage medium - Google Patents

Java program management method, java program management device, computer device and storage medium Download PDF

Info

Publication number
CN109189499B
CN109189499B CN201810919781.2A CN201810919781A CN109189499B CN 109189499 B CN109189499 B CN 109189499B CN 201810919781 A CN201810919781 A CN 201810919781A CN 109189499 B CN109189499 B CN 109189499B
Authority
CN
China
Prior art keywords
starting
java
configuration information
java program
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810919781.2A
Other languages
Chinese (zh)
Other versions
CN109189499A (en
Inventor
李路路
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201810919781.2A priority Critical patent/CN109189499B/en
Publication of CN109189499A publication Critical patent/CN109189499A/en
Application granted granted Critical
Publication of CN109189499B publication Critical patent/CN109189499B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a Java program management method, a Java program management device, a Java program management computer device and a Java program storage medium, wherein the Java program management method comprises the following steps: receiving configuration information of Java programs; carrying out validity check on the configuration information; if the configuration information passes the verification, configuring a preset script template according to the configuration information to obtain a target script; registering the target script as a self-starting service of the Linux system. The technical scheme of the invention provides a simple and convenient mode for realizing the starting-up self-starting of the Java program, improves the development work efficiency, and avoids unpredictable errors caused by the operation delay of some emergency functions due to the need of artificial starting after power failure.

Description

Java program management method, java program management device, computer device and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for managing Java programs, a computer device, and a storage medium.
Background
The Linux system has high efficiency and openness, developers generally use the Linux system to work in the project development process, and in the Java project development process, a Java program is often required to be arranged under the Linux system, and the Java program is required to be capable of running all the time so as to be convenient for normal execution of the project development work.
At present, if the server is powered off, after the server is restarted, the Java program needs to be manually started, so that some emergency functions are delayed due to the fact that the Java program needs to be manually started after the server is powered off, or complex scripts are required to be written to register the Java program in the system self-starting service, but the self-starting service adding failure caused by the lack of configuration data or errors is easy to occur in the way of writing the scripts, so that the development working efficiency of a project is affected.
Disclosure of Invention
Accordingly, in order to solve the above-mentioned problems, it is necessary to provide a method, an apparatus, a computer device, and a storage medium for managing Java programs, which can automatically generate a script according to configuration information successfully checked, ensure the correctness of the script, successfully realize the startup self-starting of the Java programs, and improve the development work efficiency.
A management method of Java programs, comprising:
receiving configuration information of Java programs;
carrying out validity check on the configuration information;
if the configuration information passes the verification, configuring a preset script template according to the configuration information to obtain a target script;
registering the target script as a self-starting service of the Linux system.
A management apparatus of Java programs, comprising:
the information receiving module is used for receiving configuration information of the Java program;
the information verification module is used for verifying the validity of the configuration information;
the script generation module is used for configuring a preset script template according to the configuration information if the configuration information passes the verification, so as to obtain a target script;
and the service registration module is used for registering the target script as the self-starting service of the Linux system.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above-mentioned Java program management method when the computer program is executed by the processor.
A computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above-described Java program management method.
According to the Java program management method, the Java program management device, the computer equipment and the storage medium, by receiving the configuration information of the Java program and performing validity check on the configuration information, if the configuration information is detected to be illegal, error information can be timely output, so that a user can modify the configuration information according to the error information, the condition that the Java program is started and self-started to fail due to human errors is avoided, if the configuration information is checked to pass, a preset script template is configured according to the configuration information to obtain a target script, the target script is registered in the self-starting service of the Linux system, the success rate of starting and self-starting of the Java program in the Linux system is ensured, the unpredictable error caused by the fact that some emergency functions are required to be started manually after power failure is avoided, and therefore a simple mode for realizing the starting and self-starting of the Java program is provided, and development work efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of an application environment of a Java program management method according to an embodiment of the invention;
FIG. 2 is a flowchart of a Java program management method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for managing Java programs according to an embodiment of the present invention;
FIG. 4 is a flowchart showing a method for managing Java programs according to an embodiment of the present invention for verifying program execution parameters;
FIG. 5 is a flowchart showing step S4 in FIG. 2;
FIG. 6 is a schematic block diagram of a Java program management apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a computer device in accordance with an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The Java program management method provided by the application can be applied to an application environment as shown in fig. 1, wherein the application environment comprises a server side and a client side, the server side and the client side are connected through a network, a user inputs configuration information of the Java program through the client side, the server side checks the configuration information input by the user, a script is generated according to the configuration information, and the script is registered to be self-starting service of the Linux system. The client may be, but not limited to, a variety of personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server may be implemented by a server cluster formed by an independent server or a plurality of servers. The embodiment of the invention provides a Java program management method applied to a server.
In an embodiment, fig. 2 shows a flowchart of a method for managing Java programs in this embodiment, where the method is applied to the server in fig. 1, and is used to check configuration information of Java programs input by a user, ensure validity of the configuration information, generate scripts, register the scripts as a self-starting service of the Linux system, and improve development working efficiency. As shown in fig. 2, the method for managing Java programs includes steps S1 to S4, which are described in detail below:
s1: configuration information of a Java program is received.
In this embodiment, java is a programming language, and Java programs are application programs written in the Java language, and implement specific functions of the product in Java project development.
Specifically, the server receives configuration information input by a user at the client, the configuration information is configuration information of a Java program which needs to be set to be started up for self-starting, and because the Java program needs to be operated for a long time in a Linux system so as to be convenient for normal execution of development work, the Java program can be started up in time after the server is started up, and the situation that some emergency functions are delayed in operation due to the need of artificial starting after power failure, and unpredictable errors occur is avoided.
Further, the user inputs configuration information according to the environment in which the Java program actually runs and the name of the Java program, and the configuration information may specifically include environment variable parameters including JDK (Java Development Kit ) paths and directories of the Java program, and program execution parameters including Java main program information, JVM (Java Virtual Machine ) start parameters and information of database users.
The JDK is a development environment of Java projects, the JDK path is an installation path of Java environment variable configuration in a Linux system, a catalog of a Java program is a catalog of the Java program to be started, java main program information is a main function method class of the Java program and a jar packet called by the Java program, the jar packet is a general class of packing storage, the JVM is an operation platform of Java language and belongs to an abstract computer, and information of a database user comprises a database user name and a password which are the user name and the password of a database to be accessed in the process of starting the Java program.
S2: and carrying out validity check on the configuration information.
In this embodiment, the validity check on the configuration information includes validity check on the environment variable parameter and validity check on the program execution parameter, when both the environment variable parameter and the program execution parameter are determined to be legal parameters, the configuration information is checked, otherwise, when the environment variable parameter or the program execution parameter is determined to be illegal parameters, the configuration information is identified to be illegal, and the verification is determined to be failed.
Further, according to configuration information input by a user, whether the environment variable parameter input by the user is consistent with the environment variable parameter set by the Linux system is checked, if the environment variable parameter is consistent with the environment variable parameter set by the Linux system, the environment variable parameter is determined to be legal, otherwise, if the environment variable parameter is inconsistent with the environment variable parameter set by the Linux system, the environment variable parameter is illegal, meanwhile, whether the program execution parameter input by the user can successfully start the Java program is checked, if the Java program can be successfully started, the checking is determined to be passed, the program execution parameter is legal, otherwise, if the Java program cannot be started according to the program execution parameter, the program execution parameter is illegal.
S3: if the configuration information passes the verification, configuring a preset script template according to the configuration information to obtain a target script.
In this embodiment, the script template is a shell script that is edited and set in advance, and the script template is encapsulated, so that codes of the functional modules are hidden, and a simple interface is provided, so that the content of a preset position in the script template is configured through the interface, after the configuration information is checked, the configuration information input by a user is filled in the corresponding preset position in the script template through the interface provided by the script template, so that a target script can be automatically generated and used as a script of the startup self-starting service.
S4: registering the target script as a self-starting service of the Linux system.
Specifically, storing a target script into a preset target folder, wherein the target folder is a connection directory of a starting process in a self-starting project of a Linux system, adding the name of the target script into a starting automatic starting service list of the Linux system, giving executable permission to the target script, registering the target script as a self-starting service of the Linux system, determining starting operation level, service starting sequence number, service closing sequence number and other information of the self-starting service, wherein the smaller the starting operation level of the self-starting service is, the more preferentially operates, the service starting sequence number and the service closing sequence number are two digits with the size ranging from 00 to 99, starting the self-starting service according to the sequence of the service starting sequence number from small to large when the Linux system starts the service, and stopping the self-starting service according to the sequence of the service closing sequence number from large to small when the Linux system stops the service.
In the embodiment of the invention, by receiving the configuration information of the Java program and carrying out validity check on the configuration information, if the configuration information is detected to be illegal, the error information can be timely output, so that a user can modify the configuration information according to the error information, the condition that the starting-up of the Java program fails due to human error is avoided, if the configuration information is checked to pass, a preset script template is configured according to the configuration information to obtain a target script, the target script is registered in the self-starting service of the Linux system, the success rate of the starting-up self-starting of the Java program in the Linux system is ensured, and the unpredictable error caused by the operation delay of some emergency functions due to human starting after power failure is avoided, thereby providing a simple mode for realizing the starting-up self-starting of the Java program and improving the development work efficiency.
In one embodiment, as shown in fig. 3, when the configuration information is an environment variable parameter, the validity check of the configuration information mentioned in step S2 specifically includes the following steps:
s211: and checking the environment variable parameters by using a preset regular expression.
In this embodiment, the environment variable parameters include JDK paths and directories of Java programs, and after receiving JDK paths and directories of Java programs input by a user at a client, a server uses a preset regular expression to check whether the JDK paths and the directories of Java programs are legal.
Specifically, the specific content of the regular expression may be preset to be var lnxpath=/([ \/] [ \w- ] +), for checking whether the JDK path is consistent with the JDK path installed in the Linux system, and checking whether the directory of the Java program exists in the Linux system.
S212: if the information consistent with the environment variable parameter is not matched in the Linux system, the verification is determined to be failed, and error information is output, so that a user modifies the environment variable parameter according to the error information.
Specifically, if the information consistent with the JDK path is not matched in the Linux system or the directory of the Java program does not exist, determining that the verification of the environment variable parameter fails, outputting error information, for example, outputting error information such as that the JDK path is an illegal path or that the directory information is wrong, and prompting the user to input again.
It can be understood that the user can modify the environment variable parameters in time according to the prompt of the error information, so that Java program running errors caused by illegal environment variable parameters are avoided.
S213: and if the information consistent with the environment variable parameters is matched in the Linux system, determining that the verification is passed.
Specifically, if the JDK path is consistent with the JDK path installed in the Linux system and the directory information of the Java program is matched in the Linux system, the JDK path indicates that the environment variable parameter input by the user is legal, and the environment variable parameter verification is determined to pass.
In this embodiment, when the configuration information is an environment variable parameter, the preset regular expression is used to check the environment variable parameter, the validity of the environment variable parameter input by the user is detected, if the information consistent with the environment variable parameter is not matched in the Linux system, the verification is determined to be failed, and error information is output, so that the user modifies the environment variable parameter according to the error information, the situation that the Java program is started due to the fact that the user inadvertently inputs the incorrect environment variable parameter is avoided, and if the Linux system matches the information consistent with the environment variable parameter, the verification is determined to be passed, and the correctness of the target script is ensured.
In one embodiment, as shown in fig. 4, when the configuration information is a program execution parameter, the validity check of the configuration information mentioned in step S2 specifically includes the following steps:
s221: and pre-starting the Java program according to the program execution parameters.
In this embodiment, the program execution parameters include Java main program information, JVM startup parameters, and database user information.
Specifically, after receiving Java main program information, JVM starting parameters and information of a database user input by a user at a client, the server starts a JVM installed in a Linux system by using the JVM starting parameters, runs a Java program in the JVM according to the Java main program information, and performs database operations on a database to be accessed through information connection of the database user, wherein the database operations refer to operations on data on the database, including but not limited to operations of reading data, writing data, updating data or deleting data, and the like, and pre-starts the Java program according to program execution parameters so as to check whether the Java program can be started successfully.
S222: if the Java program fails to be started in advance, the Java program is determined to be failed in verification, and the information of the failed start in advance is output, so that a user modifies program execution parameters according to the information of the failed start in advance.
In this embodiment, if the Java program fails to be pre-started in the JVM, it is determined that the program execution parameter fails to be checked, and the Java program pre-start failure information is output, so that the user modifies the program execution parameter according to the pre-start failure information, thereby avoiding the self-start failure of the Java program caused by the illegal configuration information.
S223: if the Java program is started successfully, the Java program is determined to pass the verification.
In this embodiment, if the Java program can run successfully in the JVM, it indicates that the configuration information input by the user is legal, and determines that the program execution parameter passes the verification.
In this embodiment, when the configuration information is a program execution parameter, the Java program is pre-started according to the program execution parameter, the validity of the program execution parameter input by the user is detected, if the Java program fails to be pre-started, the verification is determined to fail, and the pre-start failure information is output, so that the user modifies the program execution parameter according to the pre-start failure information, if the Java program fails to be pre-started, the verification is determined to pass, and the validity of the configuration information input by the user is ensured through the pre-start processing of the Java program, so that the condition that the Java program fails to be started due to the false configuration information input by the user is avoided, and the startup self-starting success rate of the Java program is improved.
In one embodiment, as shown in fig. 5, in step S4, registering the target script as a self-starting service of the Linux system specifically includes the following steps:
s41: and adding the target script into a startup automatic starting item of the Linux system, endowing executable rights to the target script, and generating a self-starting service corresponding to the Java program.
In this embodiment, the target script is stored in a preset target folder, the name of the target script is added to a startup automatic startup service list of the Linux system, executable permission is given to the target script, a self-startup service corresponding to the Java program is registered and generated in the Linux system, and when the server is started again after power failure, the Java program can be automatically started and run when the server is started without manual startup.
For example, the chkconfig command of the management system service may be used to register the target script into the self-starting service of the Linux system, and specific implementation instructions are as follows:
#!/bin/sh
#chkconfig:2345 85 90
#description:
chmod+x a.sh
chkconfig--add a.sh
chkconfig a.sh on
wherein, "# -)! The method is characterized in that the method comprises the following steps of taking (1)/(bin/sh) as a path of a target script, taking (1)/(chkconfig: 2345 85 90) as a path of the target script, starting a service at a 2/3/4/5 operation level, taking a service starting sequence number as S85, taking a service closing sequence number as K90, "#description:" as description information of the service, "chmod+x a.sh" as an executable authority given to the target script, taking (1)/(chkconfig-add.sh) as a name of the target script to a starting automatic starting service list of a system, and taking (1)/(chkconsh) as a starting self-starting state.
S42: the port number for opening the self-starting service is allocated for the self-starting service.
In this embodiment, the server allocates an idle port number for starting the self-starting service to the self-starting service by detecting the use condition of the port in the Linux system, so that the Java program binds the port number, and repeated starting of the Java program is avoided.
For example, the server side allocates an idle port number 3248 for the self-starting service, where the port number 3248 is a port number for controlling the running of the self-starting service, and when the Java program corresponding to the self-starting service is started, a service port is started in the ports 3248, and the service port is only used for occupying the ports 3248, and does not accept any network connection. When a Java program is started each time, the server detects whether only one Java program is started in the Linux system, and if the Java program is not started in the Linux system, the Java program can be started and run normally; if the Java program has been started in the Linux system, when the same Java program is restarted, the Java program throws out an exception when the service port is restarted in the ports 3248 allocated to the Java program, which means that the ports 3248 are occupied, so that it can be confirmed that the Java program has been started in the Linux system, and the operation of starting the Java program is exited.
In the embodiment, the target script is added into the automatic starting project of the Linux system, executable permission is given to the target script, the self-starting service corresponding to the Java program is generated, the Java program is registered into the self-starting service of the Linux system, the starting self-starting function of the Java program in the Linux system is realized, the timeliness of starting the Java program is ensured, meanwhile, the port number for starting the self-starting service is distributed for the self-starting service, repeated starting of the Java program is avoided, and system resources are saved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
In one embodiment, a management device for Java programs is provided, where the management device for Java programs corresponds to the management method for Java programs in the above embodiment one by one. As shown in fig. 6, the Java program management apparatus includes: an information receiving module 61, an information checking module 62, a script generating module 63 and a service registering module 64. The functional modules are described in detail as follows:
an information receiving module 61 for receiving configuration information of the Java program;
an information verification module 62, configured to perform validity verification on the configuration information;
the script generating module 63 is configured to configure a preset script template according to the configuration information if the configuration information passes the verification, so as to obtain a target script;
the service registration module 64 is configured to register the target script as a self-starting service of the Linux system.
Further, the configuration information includes environment variable parameters and program execution parameters.
Further, when the configuration information is an environment variable parameter, the information verification module 62 includes:
a path matching unit 6211 for verifying an environment variable parameter using a preset regular expression;
the matching failure unit 6212 is configured to determine that the verification fails if the information consistent with the environment variable parameter is not matched in the Linux system, and output error information, so that the user modifies the environment variable parameter according to the error information;
and the successful matching unit 6213 is configured to determine that the verification passes if the information consistent with the environmental variable parameter is matched in the Linux system.
Further, when the configuration information is a program execution parameter, the information verification module 62 includes:
a pre-start verification unit 6221, configured to pre-start the Java program according to the program execution parameter;
the pre-boot failure unit 6222 is configured to determine that the verification fails if the Java program fails to pre-boot, and output pre-boot failure information, so that the user modifies the program execution parameters according to the pre-boot failure information;
the pre-boot success unit 6223 is configured to determine that the verification passes if the Java program is pre-boot-successful.
Further, the service registration module 64 includes:
a service adding unit 641, configured to add the target script to a startup automatic startup item of the Linux system, and assign executable rights to the target script, and generate a self-startup service corresponding to the Java program;
a port binding unit 642 for allocating a port number for opening the self-starting service to the self-starting service.
For specific limitations on the management apparatus of the Java program, reference is made to the above limitation on the management method of the Java program, and no further description is given here. Each module in the management device of the Java program may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method of managing Java programs.
In one embodiment, a computer apparatus is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements steps in the method for managing Java programs in the above embodiment when executing the computer program, such as steps S1 to S4 shown in fig. 2, or implements functions of each module/unit of the device for managing Java programs in the above embodiment when executing the computer program, such as functions of modules 61 to 64 shown in fig. 6. In order to avoid repetition, a description thereof is omitted.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements steps in the management method of the Java program of the above embodiment, such as steps S1 to S4 shown in fig. 2, or which when executed by a processor implements functions of each module/unit of the management apparatus of the Java program of the above embodiment, such as functions of modules 61 to 64 shown in fig. 6. In order to avoid repetition, a description thereof is omitted.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (7)

1. A management method of Java programs, the management method comprising:
receiving configuration information of Java programs;
carrying out validity check on the configuration information;
if the configuration information passes the verification, configuring a preset script template according to the configuration information to obtain a target script;
registering the target script as a self-starting service of a Linux system;
when the configuration information is a program execution parameter, the performing validity check on the configuration information includes:
pre-starting the Java program according to the program execution parameters;
if the Java program fails to be pre-started, determining that the verification fails, and outputting pre-starting failure information so that a user modifies the program execution parameters according to the pre-starting failure information;
and if the Java program is started successfully, determining that the Java program passes the verification.
2. The method for managing Java programs according to claim 1, wherein when the configuration information is an environment variable parameter, the verifying the validity of the configuration information comprises:
checking the environment variable parameters by using a preset regular expression;
if the information consistent with the environment variable parameter is not matched in the Linux system, determining that verification fails, and outputting error information so that a user modifies the environment variable parameter according to the error information;
and if the information consistent with the environment variable parameters is matched in the Linux system, determining that the verification is passed.
3. The method of managing Java programs according to any one of claims 1 to 2, wherein registering the target script as a self-starting service of a Linux system comprises:
adding the target script into a startup automatic startup project of the Linux system, endowing the target script with executable rights, and generating a self-startup service corresponding to the Java program;
and allocating a port number for opening the self-starting service for the self-starting service.
4. A management device for Java programs, the management device comprising:
the information receiving module is used for receiving configuration information of the Java program;
the information verification module is used for verifying the validity of the configuration information;
the script generation module is used for configuring a preset script template according to the configuration information if the configuration information passes the verification, so as to obtain a target script;
the service registration module is used for registering the target script as a self-starting service of the Linux system;
the information verification module comprises:
the pre-starting verification unit is used for pre-starting the Java program according to the program execution parameters in the configuration information;
the pre-starting failure unit is used for determining that verification fails if the Java program fails to be started in advance, and outputting pre-starting failure information so that a user modifies the program execution parameters according to the pre-starting failure information;
and the pre-starting success unit is used for determining that the verification passes if the Java program is successfully pre-started.
5. The Java program management apparatus according to claim 4, wherein said service registration module comprises:
the service adding unit is used for adding the target script into a startup automatic startup project of the Linux system, endowing executable rights to the target script and generating a self-startup service corresponding to the Java program;
and the port binding unit is used for distributing and starting the port number of the self-starting service for the self-starting service.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method for managing Java programs according to any one of claims 1 to 3 when the computer program is executed by the processor.
7. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the Java program management method according to any one of claims 1 to 3.
CN201810919781.2A 2018-08-14 2018-08-14 Java program management method, java program management device, computer device and storage medium Active CN109189499B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810919781.2A CN109189499B (en) 2018-08-14 2018-08-14 Java program management method, java program management device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810919781.2A CN109189499B (en) 2018-08-14 2018-08-14 Java program management method, java program management device, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN109189499A CN109189499A (en) 2019-01-11
CN109189499B true CN109189499B (en) 2024-02-02

Family

ID=64921308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810919781.2A Active CN109189499B (en) 2018-08-14 2018-08-14 Java program management method, java program management device, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN109189499B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457063B (en) * 2019-07-15 2024-04-16 中国平安人寿保险股份有限公司 Script program packaging method and device, electronic equipment and readable storage medium
CN110868720A (en) * 2019-12-24 2020-03-06 西安闻泰电子科技有限公司 Method and device for identifying base station message, mobile terminal and storage medium
CN111586171B (en) * 2020-05-07 2023-05-30 广州虎牙信息科技有限公司 Server operation method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963912A (en) * 2010-10-12 2011-02-02 浪潮电子信息产业股份有限公司 Implementation method for storing and checking hardware configuration information of system
CN105045689A (en) * 2015-06-25 2015-11-11 浪潮电子信息产业股份有限公司 Method for using RAID card to perform hard disk batch detection, monitoring and alerting
CN107491338A (en) * 2017-09-29 2017-12-19 郑州云海信息技术有限公司 A kind of whole machine cabinet batch automatic configuration RAID card level method for distinguishing
CN107943496A (en) * 2017-11-17 2018-04-20 郑州云海信息技术有限公司 A kind of device and method of whole machine cabinet server batch updating firmware

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963912A (en) * 2010-10-12 2011-02-02 浪潮电子信息产业股份有限公司 Implementation method for storing and checking hardware configuration information of system
CN105045689A (en) * 2015-06-25 2015-11-11 浪潮电子信息产业股份有限公司 Method for using RAID card to perform hard disk batch detection, monitoring and alerting
CN107491338A (en) * 2017-09-29 2017-12-19 郑州云海信息技术有限公司 A kind of whole machine cabinet batch automatic configuration RAID card level method for distinguishing
CN107943496A (en) * 2017-11-17 2018-04-20 郑州云海信息技术有限公司 A kind of device and method of whole machine cabinet server batch updating firmware

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
数据库系统shell脚本应用;陈华生;;电子测试(第14期);第61-62、67页 *

Also Published As

Publication number Publication date
CN109189499A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
US10073966B2 (en) Operating system-independent integrity verification
WO2020173128A1 (en) Method and device for generating software development kit, and terminal device
CN109189499B (en) Java program management method, java program management device, computer device and storage medium
US8281229B2 (en) Firmware verification using system memory error check logic
US10228993B2 (en) Data dump for a memory in a data processing system
US10514904B2 (en) Dynamically applying a patch to a computer application
CN109710317B (en) System starting method and device, electronic equipment and storage medium
CN112988183A (en) Program upgrading method and device, electronic equipment and storage medium
CN108874582A (en) A kind of system recovery method, device and terminal
WO2021141543A1 (en) Method and apparatus for authority control, computer device and storage medium
WO2015154538A1 (en) Memory booting method and device
CN107567629A (en) Dynamic firmware module loader in credible performing environment container
CN110995825A (en) Intelligent contract issuing method, intelligent node equipment and storage medium
Dhobi et al. Secure firmware update over the air using trustzone
TWI604336B (en) Runtime verification using external device
CN111596964A (en) Method and device for realizing batch deployment of Windows systems based on wireless network
US8689206B2 (en) Isolating operating system in-memory modules using error injection
EP4287054A1 (en) Computer implemented method for updating a safety software code, computer hardware device, computer program and a computer-readable medium
WO2020006880A1 (en) Voice recognition tool deployment method, apparatus, computer device and storage medium
CN113342389B (en) Service updating method and device and computer readable storage medium
CN113114730B (en) Upgrading method and device, terminal equipment and storage medium
CN111949301B (en) Application program hot update method, device and computer readable storage medium
WO2016184180A1 (en) Method and apparatus for safe startup of system
CN112860287A (en) System program upgrading method and device, computer equipment and storage medium
US11989280B2 (en) Pointer authentication failure detection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant