Software operation and installation package generation method and device, computer equipment and storage medium

By setting the first configuration file, query script file and compiled files corresponding to the version numbers of multiple running environments in the installation package, the target object can automatically identify the version number of the running environment and run the target software, solving the problem that developers need to generate multiple versions of the installation package for multiple companies, reducing management costs and complexity, and avoiding the problem that the software cannot run normally.

CN119806681AActive Publication Date: 2025-04-11INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202412000333.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-11
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In the field of code technology, developers need to generate multiple versions of installation packages for multiple companies to adapt to open source project version updates in different operating environments, resulting in the risk of management complexity and wrong versions.

Method used

By presetting the first configuration file, query script file and compiled files corresponding to the version numbers of multiple running environments in the installation package, the target object can automatically identify the version number of the running environment and run the target software, reducing the cost and complexity of the developer managing the installation package.

Benefits of technology

This enables developers to only provide one installation package to adapt to different operating environments, reducing management costs and complexity, and avoiding the problem of software not being able to run normally due to providing wrong versions of installation packages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806681A_ABST
    Figure CN119806681A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of codes, and discloses a software operation and installation package generation method and device, computer equipment and a storage medium, and the method comprises the steps that an installation package of target software is acquired, and the installation package comprises a first configuration file, a query script file and compiling files corresponding to multiple operation environment versions respectively; and loading the installation package, and reading the name of the query script file from the position corresponding to the target label when the installation package is loaded to the target label from the first configuration file. And skipping to execute the query script file according to the name of the query script file. And according to the query script file, identifying a target running environment version number of the target object. And replacing the position corresponding to the target tag with the target running environment version number from the name of the query script file to obtain a second configuration file. And running the target software according to the second configuration file and the compiling files corresponding to the multiple running environment versions. The problem that software cannot run normally can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of code technology, and in particular to a method, device, computer equipment and storage medium for software operation and installation package generation. Background Art

[0002] In the field of code technology, the versions of open source projects are constantly updated, and different operating environments can only be applied to corresponding versions of open source projects. When a developer develops a software (software used to implement a certain business function) for multiple companies at the same time, a source code can be developed, but the corresponding version of the installation package needs to be generated according to the version of the customer's computer equipment operating environment, so that the corresponding version of the installation package and the open source project can be used to run the software normally on the customer's computer equipment. For example, the operating environment of Company A is version 1.0, the operating environment of Company B is version 2.0, and the operating environment of Company C is version 3.0. The developer needs to generate three versions of installation packages and provide them to the corresponding companies.

[0003] In this way, the development manufacturer needs to manage multiple versions of the installation package. When providing the installation package to the customer, the wrong version of the installation package may be provided to the customer, causing the customer's computer to be unable to run the software normally. Summary of the invention

[0004] In view of this, the present invention provides a method, apparatus, computer device, storage medium and program product for software running and installation package generation to solve the problem of software not being able to run normally in the related art.

[0005] In a first aspect, the present invention provides a software running method, which is executed by a target object, and the method comprises:

[0006] Obtaining an installation package of the target software, wherein the installation package includes a first configuration file, a query script file, and compilation files corresponding to a plurality of operating environment versions;

[0007] The installation package is loaded, and when the target tag is loaded from the first configuration file, the name of the query script file is read from the position corresponding to the target tag;

[0008] Jump to execute the query script file according to the name of the query script file;

[0009] According to the query script file, identify the target operating environment version number of the target object;

[0010] Replace the location corresponding to the target tag from the name of the query script file to the version number of the target operating environment to obtain a second configuration file;

[0011] The target software is run according to the second configuration file and the compiled files corresponding to the multiple operating environment versions.

[0012] The software running method provided by the present invention has the following advantages:

[0013] By pre-setting the first configuration file, the query script file and the compiled files corresponding to the version numbers of the various operating environments in the installation package, and pre-setting the target tag in the first configuration file, the name of the query script file is filled in the position corresponding to the target tag. When the target object obtains the installation package and loads the installation package, when the target tag in the first configuration file is loaded, the name of the query script file can be read from the position corresponding to the target tag. Then, the target object can jump to the execution logic of the query script file according to the name of the query script file, and identify the current target operating environment version number of the target object. Then, the target object replaces the position corresponding to the target tag with the target operating environment version number, and obtains a second configuration file including the specified version number. Finally, the target object can run the target software according to the second configuration file including the specified version number and the compiled file in the installation package. Under such a setting, for the target software, different customer developers only need to provide one installation package, which can reduce the cost and complexity of the developer to manage the installation package, and avoid the problem that the target software cannot run normally due to the developer providing the wrong version of the installation package to the customer.

[0014] In an optional implementation, running the target software according to the second configuration file and the compiled files corresponding to the plurality of operating environment versions respectively includes:

[0015] Read the target operating environment version number from the position corresponding to the target tag in the second configuration file;

[0016] Get the target dependency package corresponding to the target operating environment version number;

[0017] Selecting a target compilation file corresponding to the target operating environment version number from the compilation files corresponding to the multiple operating environment versions;

[0018] Run the target software according to the target dependency package and target compilation file.

[0019] Specifically, the target object can read the target operating environment version number supported by itself from the second configuration file of the specified version number. Then, according to the target operating environment version number, the corresponding target compilation file and target dependency package can be obtained to run the target software under the target operating environment version number. In this way, it can be ensured that the target object can run the target software normally, avoiding the problem that the target software cannot be run normally due to the wrong version of the obtained installation package.

[0020] In an optional implementation, identifying the target operating environment version number of the target object according to the query script file includes:

[0021] Obtain the loading information of the running software of the target object;

[0022] Parse the loading information of the running software to obtain the version number of the target operating environment.

[0023] Specifically, by parsing the loading information of the running software in the target object, the accurate target running version number can be obtained.

[0024] In an optional implementation, identifying the target operating environment version number of the target object according to the query script file includes:

[0025] Get the target object's running environment variables;

[0026] The value of the running environment variable is determined as the target running environment version number.

[0027] Specifically, it is more convenient to directly read the values ​​of the running environment variables, and usually only requires the technician to set a simple query code or command. In addition, this reading method is faster and can run the target software earlier.

[0028] In a first aspect, the present invention provides a method for generating an installation package, the method comprising:

[0029] Obtaining multiple operating environment version numbers, a first configuration file, a query script file, and source code of the target software;

[0030] Generate a project object corresponding to each operating environment version number according to each operating environment version number, the first configuration file, and the source code;

[0031] Compile each project object in parallel to obtain a compilation file corresponding to each project object;

[0032] After it is determined that the compiling operations corresponding to all project objects are completed, an installation package of the target software is generated according to the compiling file, the first configuration file, and the query script file corresponding to each project object.

[0033] The installation package generation method provided by the present invention has the following advantages:

[0034] When generating an installation package, this solution can obtain multiple operating environment version numbers, first configuration files and script files, as well as the source code of the target software. Then, the target object can generate a project object corresponding to each operating environment version number according to each operating environment version number, first configuration file and source code. The target object can compile each project object in parallel to obtain a compiled file corresponding to each project object, and the compilation efficiency is relatively fast. After determining that the compilation operations corresponding to all project objects are completed, the installation package is generated according to the compiled file corresponding to each project object, the first configuration file, and the query script file. In this way, the developer only needs to generate an installation package for the target software according to the above solution, that is, the developer only needs to manage one installation package for each software, which is more convenient and can avoid the problem of providing the wrong version of the installation package, and further avoid the problem of the target software not being able to run normally.

[0035] In an optional embodiment, the method further includes:

[0036] When the compilation error information of the target project object is obtained, the compilation operation of all project objects is stopped, wherein the target project object is a project object corresponding to any running environment version number;

[0037] Generate and display alarm information based on the operating environment version number and compilation error information corresponding to the target project object.

[0038] Specifically, during the compilation process, when an error occurs in the compilation process of any project object, the compilation of all threads is stopped immediately, which can avoid unnecessary compilation of other project objects and save computing resources and time. In addition, by interrupting the compilation process in time, errors in one version can be prevented from affecting the construction of other versions. In addition, by generating alarm information through version numbers and error information, developers can quickly get feedback and know which version of the project object has a problem and what the specific error is, thereby speeding up the troubleshooting.

[0039] In an optional implementation, each project object is compiled in parallel to obtain a compiled file corresponding to each project object, including:

[0040] Create a directory file corresponding to each project object;

[0041] Starting a target thread among the multiple threads to compile a target project object to obtain at least one sub-compilation file corresponding to the target project object, wherein the target project object is a project object corresponding to any operating environment version number;

[0042] Each sub-compilation file corresponding to the target project object is added to the directory file corresponding to the target project object to obtain the compilation file corresponding to the target project object.

[0043] Specifically, multiple threads are started to compile different project objects in parallel, making full use of computing resources and shortening compilation time. In addition, a separate directory file is created for each project object to store the compilation results, including sub-compilation files, to ensure that the compilation output of each version is properly isolated and managed, avoiding file conflicts or overwriting problems, and facilitating subsequent analysis and deployment.

[0044] In a third aspect, the present invention provides a software running device, the device comprising:

[0045] A first acquisition module is used to acquire an installation package of the target software, wherein the installation package includes a first configuration file, a query script file, and compilation files corresponding to a plurality of operating environment versions;

[0046] A loading module, used to load the installation package, and when loading from the first configuration file to the target tag, read the name of the query script file from the position corresponding to the target tag;

[0047] An execution module, used for jumping to execute a query script file according to the name of the query script file;

[0048] An identification module, used to identify the target operating environment version number of the target object according to the query script file;

[0049] A replacement module, used to replace the position corresponding to the target tag from the name of the query script file to the version number of the target operating environment to obtain a second configuration file;

[0050] The running module is used to run the target software according to the second configuration file and the compiled files corresponding to the multiple running environment versions.

[0051] In a fourth aspect, the present invention provides an installation package generation device, the device comprising:

[0052] A second acquisition module is used to acquire multiple operating environment version numbers, a first configuration file, a query script file, and a source code of the target software;

[0053] A generation module, used to generate a project object corresponding to each operating environment version number according to each operating environment version number, the first configuration file, and the source code;

[0054] A compilation module is used to compile each project object in parallel to obtain a compilation file corresponding to each project object;

[0055] The generation module is also used to generate an installation package of the target software according to the compilation file, the first configuration file, and the query script file corresponding to each project object after determining that the compilation operations corresponding to all project objects are completed.

[0056] In a fifth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the software running method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0057] In a sixth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the installation package generation method of the above-mentioned second aspect or any corresponding embodiment thereof by executing the computer instructions.

[0058] In a seventh aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the software running method of the above-mentioned first aspect or any corresponding embodiment thereof.

[0059] In an eighth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the installation package generation method of the second aspect or any corresponding embodiment thereof.

[0060] In a ninth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the software running method of the first aspect or any corresponding embodiment thereof.

[0061] In a tenth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the installation package generation method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0063] Figure 1 is a flowchart of a software running method according to an embodiment of the present invention;

[0064] Figure 2 is a flow chart of a method for generating an installation package according to an embodiment of the present invention;

[0065] Figure 3 It is a flowchart of a method for generating an installation package and running software in a Maven project according to an embodiment of the present invention;

[0066] Figure 4 is a schematic diagram of specifying a target operating environment version number according to an embodiment of the present invention;

[0067] Figure 5 is a structural block diagram of a software running device according to an embodiment of the present invention;

[0068] Figure 6 is a structural block diagram of an installation package generating device according to an embodiment of the present invention;

[0069] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0070] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0071] The professional terms involved in the present invention are explained below.

[0072] Open source project: refers to a software project whose source code is publicly released and allows anyone to view, use, modify and distribute it.

[0073] Source code: It is the original instruction set written by programmers using a programming language (for example, the Java programming language), which contains all the logic and algorithms of the software.

[0074] Operating environment: refers to the collection of hardware and software conditions required to run an application, for example, it may include computer equipment, operating system, virtual machine, third-party libraries and other necessary tools and services.

[0075] Dependencies: refers to external libraries required for building, running, or testing a project (for example, the target software in this solution). Dependencies can be the open source projects mentioned above. For example, the compression format of a dependency can be a JAR package.

[0076] Installation package: usually refers to a packaged file or a group of files, for example, it can contain compiled files, configuration files, and comes with instructions for correctly installing these components on the target object. The main purpose of the installation package is to simplify the software deployment process so that users can easily install, update or uninstall the software. For example, the compressed format of the installation package can be a JAR package.

[0077] Compiled file: A file generated after the source code is processed by a compiler and converted into machine code or bytecode.

[0078] In the relevant technical field, at the stage of generating an installation package for each customer, the computer equipment of the development manufacturer can generate a project object corresponding to the specified operating environment version number based on the configuration file (including the operating environment version number specified by the customer) and the source code created by the technician. The computer equipment can compile the project object to obtain a compiled file corresponding to the project object, and then package the compiled file and the configuration file to obtain an installation package. In this way, installation packages corresponding to multiple operating environment versions can be obtained, and the development manufacturer can provide the corresponding version of the installation package according to the customer's needs. In the running stage, after obtaining the installation package, the customer's computer equipment can directly run the software according to the configuration file and compiled file in the installation package. If the development manufacturer provides the wrong version of the installation package to the customer, the customer's computer equipment cannot run the software normally.

[0079] An embodiment of the present invention provides a software running method, in which all versions of compiled files are added to the installation package in the generation phase. In the running phase, the target object automatically identifies the target object's running environment version number and runs the target software. In this way, the developer only needs to manage one installation package, which can avoid the problem of providing the wrong version of the installation package, and also avoid the problem of not being able to run the target software normally.

[0080] According to an embodiment of the present invention, a software operation method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0081] In this embodiment, a software running method is provided, which can be executed by a target object. The target object can be a computer device, or a virtual machine (VM) running on the computer device, for example, a Java Virtual Machine (JVM). Figure 1 is a flowchart of a software running method according to an embodiment of the present invention. Figure 1As shown, the process includes the following steps:

[0082] Step S101, obtaining the installation package of the target software.

[0083] Among them, the installation package may include a first configuration file, a query script file, and compiled files corresponding to multiple operating environment versions. The first configuration file may include attribute information, dependency information, plug-in management information, etc. of the target software. The attribute information may include identification information, packaging type, description information (i.e., information indicating the business functions of the target software), etc. of the target software. For example, the identification information of the target software may be "A-app", and the packaging type may be Jar, War, etc. The dependency information may include identification information of all dependent packages required for the operation of the target software. The query script file may include instructions for querying the version number of the operating environment, for example, it may be a Shell file.

[0084] Specifically, the target object may receive the installation package of the target software sent from other clients, or may download the installation package of the target software from a website provided by a manufacturer.

[0085] Step S102, loading the installation package, when loading from the first configuration file to the target tag, reading the name of the query script file from the position corresponding to the target tag.

[0086] Specifically, when the target object needs to run the target software, the installation package can be loaded according to the preset loading order of the files. When loaded into the first configuration file and the target tag is loaded from the first configuration file, the name of the query script file can be read from the position corresponding to the target tag.

[0087] Step S103, jump to execute the query script file according to the name of the query script file.

[0088] Specifically, when the target object reads the name of the query script file, the query script file can be found in the installation package according to the name of the query script file.

[0089] Step S104, identifying the target operating environment version number of the target object according to the query script file.

[0090] Specifically, the target object can identify the target operating environment version of the target object according to the instructions included in the query script file. Based on the different instructions included in the query script file, this solution can identify the target operating environment version number of the target object in the following two ways:

[0091] Method 1: Obtain the loading information of the running software of the target object. Parse the loading information of the running software to obtain the version number of the target running environment.

[0092] Specifically, the target object can obtain the identification information of all running software, randomly select the identification information of a running software, and obtain the loading information of the running software according to the identification information of the running software. Then, the loading information of the running software can be parsed to obtain the running environment information, and finally, the target running environment version number can be extracted from the running environment information.

[0093] Method 2: Obtain the target object's operating environment variable and set the value of the operating environment variable to be the target operating environment version number.

[0094] Specifically, the target object may be pre-set with an operating environment variable. The target object may obtain its own operating environment variable and determine the value of the operating environment variable as the target operating environment version number.

[0095] Step S105, replacing the name of the query script file with the version number of the target operating environment at the position corresponding to the target tag to obtain a second configuration file.

[0096] Specifically, the target object can replace the position corresponding to the target tag from the name of the query script file to the target operating environment version number, so that a configuration file of the specified operating environment version number can be obtained, that is, the second configuration file.

[0097] Step S106, running the target software according to the second configuration file and the compiled files corresponding to the multiple operating environment versions.

[0098] Specifically, the target object can run the target software according to the following steps:

[0099] Step 1: read the target operating environment version number from the position corresponding to the target tag in the second configuration file.

[0100] Step 2: Get the target dependency package corresponding to the target operating environment version number.

[0101] Step three: selecting a target compilation file corresponding to the target operating environment version number from the compilation files corresponding to multiple operating environment versions.

[0102] Step 4: Run the target software according to the target dependency package and target compilation file.

[0103] Specifically, after completing the replacement operation, the target object can reload the second configuration file, and when loading into the target tag, read the target operating environment version number from the position corresponding to the target tag. Then, the target object can load the corresponding target dependency package from the local warehouse or remote warehouse according to the target operating environment version number and the identification information of the dependency package. At the same time, the target object can select the target compiled file corresponding to the target operating environment version number from the compiled files corresponding to multiple operating environment versions according to the target operating environment version number. Finally, the target object can run the target software according to the target dependency package and the target compiled file.

[0104] In some optional implementations, after recognizing that the target software has finished running, the target object can replace the position corresponding to the target tag in the second configuration file with the name of the query script file. In this way, if the target object's operating environment changes, when the target software is run again, it can be run again according to the changed operating environment version number, without asking the developer to provide a new installation package, which is more convenient and more flexible.

[0105] The software running method provided in this embodiment is to pre-set a first configuration file, a query script file and a compiled file corresponding to a plurality of operating environment version numbers in the installation package, and pre-set a target tag in the first configuration file, and fill in the name of the query script file at the position corresponding to the target tag. When the target object obtains the installation package and loads the installation package, when the target tag in the first configuration file is loaded, the name of the query script file can be read from the position corresponding to the target tag. Then, the target object can jump to the execution logic of the query script file according to the name of the query script file, and identify the current target operating environment version number of the target object. Then, the target object replaces the position corresponding to the target tag with the target operating environment version number, and obtains a second configuration file including the specified version number. Finally, the target object can run the target software according to the second configuration file including the specified version number and the compiled file in the installation package. Under such a setting, for the target software, different customer developers only need to provide one installation package, which can reduce the cost and complexity of the developer to manage the installation package, and avoid the problem that the target software cannot run normally due to the developer providing the wrong version of the installation package to the customer.

[0106] In this embodiment, a method for generating an installation package is provided, which can be executed by a computer device, such as a laptop computer, a desktop computer, etc. Figure 2 is a flow chart of a method for generating an installation package according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0107] Step S201, obtaining multiple operating environment version numbers, a first configuration file, a query script file, and source code of the target software.

[0108] Specifically, the technician can input multiple operating environment version numbers in the computer device, and set the first configuration file according to the information of the target software. In addition, the technician needs to construct a query script file and write the source code of the target software. In this way, the computer device can obtain multiple operating environment version numbers, the first configuration file, the query script file, and the source code of the target software.

[0109] Step S202: Generate a project object corresponding to each operating environment version number according to each operating environment version number, the first configuration file, and the source code.

[0110] Specifically, the computer device may generate a project object corresponding to the first operating environment version number according to the first operating environment version number, the first configuration file and the source code, wherein the first operating environment version number is any one of the multiple operating environment version numbers.

[0111] Step S203, compile each project object in parallel to obtain a compiled file corresponding to each project object.

[0112] Specifically, the target object can perform compilation operations through the following steps:

[0113] Step 1: Create a directory file corresponding to each project object.

[0114] Step 2: Start a target thread among the multiple threads to compile the target project object to obtain at least one sub-compilation file corresponding to the target project object.

[0115] The target project object may be a project object corresponding to any operating environment version number. The target thread may be any thread among multiple threads.

[0116] Step three: add each sub-compilation file corresponding to the target project object to the directory file corresponding to the target project object to obtain the compilation file corresponding to the target project object.

[0117] Specifically, the target object can first create a directory file corresponding to each operating environment version number according to each operating environment version number, that is, create a directory file corresponding to each project object. At the same time, the number of operating environment version numbers can be determined in the computer device, and according to the number of operating environment version numbers, multiple threads of the same number are called to compile each project object respectively, and obtain a sub-compiled file corresponding to each project object, specifically, one thread can compile one project object.

[0118] In some optional implementations, after determining the number of operating environment version numbers, the computer device may first determine whether the number of operating environment version numbers is greater than a preset threshold. When it is determined that the number of operating environment version numbers is greater than the preset threshold, only threads equal to the preset threshold may be called to first perform the compilation operation of some project objects. After each compilation operation of a project object is completed, the compilation operation may be immediately performed on the uncompiled project objects. In this way, the compilation efficiency can be improved through parallel compilation operations, and the problem of excessive consumption of system resources can be avoided.

[0119] Step S204, when it is determined that the compiling operations corresponding to all project objects are completed, an installation package of the target software is generated according to the compiling file, the first configuration file, and the query script file corresponding to each project object.

[0120] Specifically, after determining that the compilation operation of all project objects is completed, the computer device can package the compilation files, the first configuration files, and the query script files corresponding to all project objects to obtain an installation package of the target software. In this way, the developer can provide the installation package to all customers who have reserved the target software. The customer's computer device or the JVM running on the computer device can be based on the following example: Figure 1 The steps shown run the target software and execute related business.

[0121] In some optional implementations, when the compilation error information of the target project object is obtained, the compilation operation of all project objects is stopped. According to the operating environment version number and the compilation error information corresponding to the target project object, an alarm message is generated and displayed.

[0122] Specifically, since errors may occur during the compilation process, when an error occurs during the compilation process of a project object, it may mean that the compilation tool has failed. At this time, the compilation operation of all project objects can be stopped to avoid causing more compilation errors. In addition, in order to solve the problem in a timely manner, the computer device can obtain the operating environment version number and compilation error information corresponding to the erroneous project object, and generate an alarm message for display. The technician can perform repair operations based on the real-time displayed alarm information and complete the operation of generating the installation package as soon as possible.

[0123] The installation package generation method provided in the present embodiment can obtain multiple operating environment version numbers, first configuration files and script files, and source code of the target software when generating the installation package. Then, the target object can generate a project object corresponding to each operating environment version number according to each operating environment version number, first configuration file and source code. The target object can compile each project object in parallel to obtain a compiled file corresponding to each project object, and the compilation efficiency is relatively fast. After determining that the compilation operations corresponding to all project objects are completed, the installation package is generated according to the compiled file corresponding to each project object, the first configuration file, and the query script file. In this way, the development manufacturer only needs to generate an installation package of the target software according to the above scheme, that is, the development manufacturer only needs to manage one installation package for each software, which is relatively convenient, can avoid the problem of providing the wrong version of the installation package, and further can avoid the problem that the target software cannot run normally.

[0124] The following uses the Maven project management tool as an example to illustrate the process of running software and generating installation packages.

[0125] The above-mentioned target software can be a project (Project) developed based on the Maven project management tool. The Maven project management tool can be a project management tool based on the Java programming language. The Maven project management tool mainly includes multiple modules such as maven-core, maven-model, maven-artifact, maven-plugin-api, maven-compat, maven-embedder, maven-settings, and maven-resolver. Among them, maven-core contains the main logic and workflow of Maven, such as lifecycle management, plug-in execution, etc. Maven-model is used to define model objects and data structures, for example, to define the Project Object Model (POM), which can be used to parse and operate the information in the pom.xml file. Maven-artifact defines Maven's Artifact object, which is used to represent the dependencies and build results of the project. Maven-plugin-api defines the API interface and specifications of the Maven plug-in, and plug-in developers can write custom plug-ins based on the interface. Maven-compa contains compatibility implementation code to support older versions of Maven plug-ins. Maven-embedder provides Maven's embedded engine, which can embed Maven's functions in Java applications. Maven-settings defines Maven's configuration files and related parameters, which are used to configure the project's build environment. Maven-resolver is used to resolve project dependencies, including downloading dependencies from remote repositories, resolving dependency versions, and other functions.

[0126] In the stage of generating the installation package, the technician can use the Maven project management tool to write the source code of the target software and write the first configuration file and the query script file. Figure 3 As shown, maven-model can include the ModelBuilder class. The technician can modify the ModelBuilder class and specify multiple runtime environment version numbers in the ModelBuilder class. The technician can modify the pom.xml file and add the location of the version information in the pom.xml file. <descriptors>Tag, which can specify the shell file (query script file) mapped to the installation package. The modified ModelBuilder class can build a project object corresponding to each operating environment version number based on the pom.xml file, each operating environment version number and the source code of the software. When it is detected that multiple project objects are generated, multiple threads of the target object can be started. For each project object, a thread is used to compile each project object according to the CompilerMojo plug-in to obtain the .class file (sub-compiled file) corresponding to each project object, and the generated .class file is saved in the directory file (compiled file) corresponding to the project object. Finally, the pom.xml file, shell file and compiled files corresponding to multiple operating environment versions are packaged into an installation package for the target software.

[0127] During the run phase, the target object is loading the installation package. <descriptors>The tag jumps to the shell file, identifies the target operating environment version number of the target object according to the shell file, and replaces the target operating environment version number with <descriptors>The position corresponding to the label. Figure 4 As shown, the "groupId" tag is used to indicate the path of the installation package, the "aitifactId" tag is used to indicate the name of the installation package, the "version" tag is used to indicate the operating environment version number, and the "descriptors" tag is used to map the query script file. Figure 4 The above may be part of the information in the first configuration file. After being loaded into "descriptors", the target object can read the name of the query script file and jump to the execution logic of the query script file, so as to identify the target operating environment version number according to the query script file and add it to the location of the original query script file name to obtain Figure 4 Below is some information of the second configuration file.

[0128] In this way, the target object can read the target operating environment version number from the pom.xml file after the information is replaced, and then, according to the target operating environment version number, find the compilation file corresponding to the target operating environment version number in the installation package (that is, the directory file containing the .class file corresponding to the target operating environment version number), and obtain the dependency package corresponding to the target operating environment version number locally or remotely. Finally, the target object can run the target software according to the compilation file and dependency package corresponding to the target operating environment version number.

[0129] In this embodiment, a software running device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0130] This embodiment provides a software running device, such as Figure 5 As shown, including:

[0131] The first acquisition module 501 is used to acquire the installation package of the target software, wherein the installation package includes a first configuration file, a query script file, and compilation files corresponding to multiple operating environment versions.

[0132] The loading module 502 is used to load the installation package, and when loading from the first configuration file to the target tag, read the name of the query script file from the position corresponding to the target tag.

[0133] The execution module 503 is used to jump to execute the query script file according to the name of the query script file.

[0134] The identification module 504 is used to identify the target operating environment version number of the target object according to the query script file.

[0135] The replacement module 505 is used to replace the position corresponding to the target tag from the name of the query script file to the version number of the target operating environment to obtain a second configuration file.

[0136] The running module 506 is used to run the target software according to the second configuration file and the compilation files corresponding to the multiple operating environment versions.

[0137] In some optional implementations, the operation module 506 is specifically configured to:

[0138] The target operating environment version number is read from the position corresponding to the target tag in the second configuration file.

[0139] Get the target dependency package corresponding to the target runtime environment version number.

[0140] A target compilation file corresponding to the target operating environment version number is selected from the compilation files corresponding to the multiple operating environment versions.

[0141] Run the target software according to the target dependency package and target compilation file.

[0142] In some optional implementations, the identification module 504 is specifically configured to:

[0143] Get the loading information of the running software of the target object.

[0144] Parse the loading information of the running software to obtain the version number of the target operating environment.

[0145] In some optional implementations, the identification module 504 is specifically configured to:

[0146] Get the target object's running environment variables.

[0147] The value of the running environment variable is determined as the target running environment version number.

[0148] This embodiment provides an installation package generation device, such as Figure 6 As shown, including:

[0149] The second acquisition module 601 is used to acquire multiple operating environment version numbers, a first configuration file, a query script file, and source code of the target software.

[0150] The generation module 602 is used to generate a project object corresponding to each operating environment version number according to each operating environment version number, the first configuration file, and the source code.

[0151] The compiling module 603 is used to compile each project object in parallel to obtain a compiled file corresponding to each project object.

[0152] The generation module 602 is further used to generate an installation package of the target software according to the compilation file, the first configuration file, and the query script file corresponding to each project object after determining that the compilation operations corresponding to all project objects are completed.

[0153] In some optional implementations, the compiling module 603 is further configured to:

[0154] When the compilation error information of the target project object is obtained, the compilation operation of all project objects is stopped, wherein the target project object is a project object corresponding to any operating environment version number.

[0155] Generate and display alarm information based on the operating environment version number and compilation error information corresponding to the target project object.

[0156] In some optional implementations, the compiling module 603 is specifically configured to:

[0157] Create a catalog file corresponding to each project object.

[0158] A target thread among the multiple threads is started to compile a target project object to obtain at least one sub-compilation file corresponding to the target project object, wherein the target project object is a project object corresponding to any operating environment version number.

[0159] Each sub-compilation file corresponding to the target project object is added to the directory file corresponding to the target project object to obtain the compilation file corresponding to the target project object.

[0160] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0161] The software running device and installation package generating device in this embodiment are presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0162] The embodiment of the present invention also provides a computer device having the above Figure 5 The software running device shown, or having the above Figure 6 The software shown runs the device.

[0163] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0164] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.

[0165] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0166] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0167] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0168] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0169] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0170] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0171] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0172] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.< / descriptors> < / descriptors> < / descriptors>

Claims

1. A software running method, characterized in that: The method is performed by a target object, and the method includes: Obtaining an installation package of the target software, wherein the installation package includes a first configuration file, a query script file, and compilation files corresponding to a plurality of operating environment versions; The installation package is loaded, and when the target tag is loaded from the first configuration file, the name of the query script file is read from the position corresponding to the target tag; According to the name of the query script file, jump to execute the query script file; According to the query script file, identifying the target operating environment version number of the target object; The position corresponding to the target tag is replaced from the name of the query script file to the version number of the target operating environment to obtain a second configuration file; The target software is run according to the second configuration file and the compiled files corresponding to the multiple operating environment versions.

2. The method according to claim 1, characterized in that The step of running the target software according to the second configuration file and the compiled files corresponding to the plurality of operating environment versions includes: Read the target operating environment version number from the position corresponding to the target tag in the second configuration file; Obtain a target dependency package corresponding to the target operating environment version number; Selecting a target compiled file corresponding to the target operating environment version number from the compiled files corresponding to the plurality of operating environment versions; The target software is run according to the target dependency package and the target compiled file.

3. The method according to claim 1 or 2, characterized in that: The step of identifying the target operating environment version number of the target object according to the query script file includes: Obtaining loading information of the running software of the target object; The loading information of the running software is parsed to obtain the version number of the target operating environment.

4. The method according to claim 1 or 2, characterized in that: The step of identifying the target operating environment version number of the target object according to the query script file includes: Obtaining the operating environment variables of the target object; The value assigned to the operating environment variable is determined as the target operating environment version number.

5. A method for generating an installation package, characterized in that: The method comprises: Obtaining multiple operating environment version numbers, a first configuration file, a query script file, and source code of the target software; Generate a project object corresponding to each operating environment version number according to each operating environment version number, the first configuration file, and the source code; Compiling each of the project objects in parallel to obtain a compiled file corresponding to each of the project objects; After it is determined that the compiling operations corresponding to all the project objects are completed, an installation package of the target software is generated according to the compiled file corresponding to each of the project objects, the first configuration file, and the query script file.

6. The method according to claim 5, characterized in that The method further comprises: When the compilation error information of the target project object is obtained, the compilation operation of all project objects is stopped, wherein the target project object is a project object corresponding to any operating environment version number; Generate alarm information based on the operating environment version number and compilation error information corresponding to the target project object and display it.

7. The method according to claim 5, characterized in that The step of compiling each of the project objects in parallel to obtain a compiled file corresponding to each of the project objects includes: Creating a directory file corresponding to each of the project objects; Starting a target thread among the multiple threads to compile a target project object to obtain at least one sub-compilation file corresponding to the target project object, wherein the target project object is a project object corresponding to any operating environment version number; Each of the sub-compiled files corresponding to the target project object is added to a directory file corresponding to the target project object to obtain a compiled file corresponding to the target project object.

8. A software running device, characterized in that: The device comprises: A first acquisition module is used to acquire an installation package of the target software, wherein the installation package includes a first configuration file, a query script file, and compilation files corresponding to a plurality of operating environment versions; A loading module, configured to load the installation package, and when loading from the first configuration file to the target tag, read the name of the query script file from a position corresponding to the target tag; An execution module, used for jumping to execute the query script file according to the name of the query script file; An identification module, used to identify a target operating environment version number of a target object according to the query script file; A replacement module, used to replace the position corresponding to the target tag from the name of the query script file to the version number of the target operating environment to obtain a second configuration file; The running module is used to run the target software according to the second configuration file and the compiled files corresponding to the multiple operating environment versions.

9. An installation package generating device, characterized in that: The device comprises: A second acquisition module is used to acquire multiple operating environment version numbers, a first configuration file, a query script file, and a source code of the target software; A generation module, configured to generate a project object corresponding to each of the operating environment version numbers according to each of the operating environment version numbers, the first configuration file, and the source code; A compiling module, used to compile each of the project objects in parallel to obtain a compiled file corresponding to each of the project objects; The generation module is also used to generate an installation package of the target software according to the compilation file corresponding to each of the project objects, the first configuration file, and the query script file after determining that the compilation operations corresponding to all project objects are completed.

10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the software running method described in any one of claims 1 to 4, or the installation package generating method described in any one of claims 5 to 7 by executing the computer instructions.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the software running method described in any one of claims 1 to 4, or to execute the installation package generating method described in any one of claims 5 to 7.

Citation Information

Patent Citations

  • Software deployment method and device

    CN114003250A

  • Software packaging method, device and system

    CN116185417A

  • Project operation method and device

    CN117111994A

  • Software deployment method and device, computer equipment and storage medium

    CN117971694A

  • Supercomputing software management method and device and storage medium

    CN118585197A