CN112965714A - Method, device, equipment and storage medium for quickly updating codes - Google Patents

Method, device, equipment and storage medium for quickly updating codes Download PDF

Info

Publication number
CN112965714A
CN112965714A CN202110249088.0A CN202110249088A CN112965714A CN 112965714 A CN112965714 A CN 112965714A CN 202110249088 A CN202110249088 A CN 202110249088A CN 112965714 A CN112965714 A CN 112965714A
Authority
CN
China
Prior art keywords
file
configuration
pom
code
module
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.)
Granted
Application number
CN202110249088.0A
Other languages
Chinese (zh)
Other versions
CN112965714B (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 International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co 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 International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202110249088.0A priority Critical patent/CN112965714B/en
Publication of CN112965714A publication Critical patent/CN112965714A/en
Application granted granted Critical
Publication of CN112965714B publication Critical patent/CN112965714B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

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

Abstract

The invention provides a method, a device, equipment and a computer readable storage medium for quickly updating codes, wherein the method comprises the following steps: acquiring at least two application operations, wherein the application operations at least comprise acquiring an operation code, installing a dependent node of the operation code to a local, packaging the operation code, uploading the packaged operation code and restarting the operation code; extracting start codes of at least two application operations; acquiring a configuration file, and writing start codes of at least two application operations into the configuration file; inquiring a POM file in the configuration file, and extracting configuration variables of a start code to be stored in the POM file; and storing the configuration variables into the Properties file. The code updating method has the advantages that the code updating of multiple application operations can be automatically realized only by modifying the configuration variables of local Properties by research and development personnel, the centralized management of the multiple application operations is realized, the programs executed after the variables are modified are simplified, and the working efficiency is improved. The invention is also used in the field of blockchain technology.

Description

Method, device, equipment and storage medium for quickly updating codes
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for quickly updating a code.
Background
The Alibaba Cloud Toolkit is really good for single module deployment, is more convenient and faster than Jekins, and saves the operations of deployment, maintenance, configuration and the like of Jekins. However, there are 5 microservices modules and 10 developers based on the comprehensive large supervision, and then 5 × 10 — 50 configurations are needed, and services have dependencies, and the deployment order needs to be well controlled. For this scenario, the drawbacks of Alibaba Cloud Toolkit are: 1. each research and development personnel needs to configure each module once, the configuration is complicated and easy to make mistakes, and the repeated work is provided; 2. the code of each module needs to be manually updated; 3. when the system runs, the system needs to be executed according to a certain sequence, some commands can be executed simultaneously, some commands need to be executed in series, if the intermediate operation is not connected, the packaging time is prolonged, the maintenance is not facilitated, and according to observation and statistics, the packaging needs more than 15 minutes under the condition of manual guard; 4. the subsequent expansion is troublesome, one microservice is added, each developer needs to configure once, and the maintenance information is distributed in several configurations, which is not beneficial to management.
Disclosure of Invention
The invention provides a method, a device, equipment and a computer readable storage medium for quickly updating codes, and mainly aims to realize quick modification of application operation by only changing configuration variables in a configuration file during operation when the starting codes of a plurality of application operations are concentrated in the configuration file, so that corresponding application operation can be selectively selected according to steps to be executed, and all application operations are not required to be executed.
To achieve the above object, the present invention provides a method for updating code quickly, the method comprising:
acquiring at least two application operations, wherein the application operations at least comprise acquiring an operation code, installing a dependent node of the operation code to a local, packaging the operation code, uploading the packaged operation code and restarting the operation code;
extracting start codes of at least two application operations;
acquiring a configuration file, and writing start codes of at least two application operations into the configuration file;
inquiring a POM file in the configuration file, and extracting configuration variables of a start code to be stored in the POM file;
and storing the configuration variables into the Properties file.
Preferably, after the step of querying the POM file in the configuration file and extracting the configuration variables of the boot code to be stored in the POM file, the method includes:
constructing a dependent node of the configuration variable in a POM file in a configuration file;
and acquiring a dependency module in the configuration file, and setting a dependency node according to the dependency module association.
Preferably, after the step of storing the configuration variables in the Properties file, the method includes:
acquiring variable parameters;
the configuration variables in the Properties file are replaced with variable parameters.
Preferably, after the step of storing the configuration variables in the Properties file, the method further includes:
obtaining a dependent jar package in the POM file;
determining jar packets needing to be excluded, and acquiring jar packet coordinates needing to be excluded;
extracting the Properties file and writing the coordinates into the jar packet.
Preferably, the step of obtaining the configuration file and writing the start codes of at least two application operations into the configuration file further includes:
when a plurality of configuration files are obtained, an aggregation module is created;
setting expansion lists corresponding to a plurality of configuration files in an aggregation module, and writing the configuration files into the corresponding expansion lists;
and extracting the POM files in the aggregation module, writing the POM files into the extended list, and establishing the dependency between the extended list and the corresponding configuration files respectively.
Preferably, after the step of setting an extension list corresponding to a plurality of configuration files in the aggregation module and writing the plurality of configuration files into the corresponding extension list, the method includes:
acquiring a boot code of the jar packet, and writing the boot code into a POM file of the aggregation module;
acquiring the project name and the module name of the POM file of the aggregation module;
and writing the item name and the module name of the POM file of the aggregation module into the POM files of the plurality of configuration files.
Preferably, after the step of writing the item name and the module name of the POM file of the aggregated module into the POM files of the plurality of configuration files, the method includes:
and establishing an inheritance relationship with the POM file in the configuration file according to the item name and the module name of the POM file in the aggregation template.
In addition, to achieve the above object, the present invention also provides a device for quickly updating a code, the device comprising: a memory and a processor, the memory including a fast update code program therein, the fast update code program when executed by the processor implementing the steps of:
acquiring at least two application operations, wherein the application operations at least comprise acquiring an operation code, installing a dependent node of the operation code to a local, packaging the operation code, uploading the packaged operation code and restarting the operation code;
extracting start codes of at least two application operations;
acquiring a configuration file, and writing start codes of at least two application operations into the configuration file;
inquiring a POM file in the configuration file, and extracting configuration variables of a start code to be stored in the POM file;
and storing the configuration variables into the Properties file.
In addition, to achieve the above object, the present invention also provides a quick code update apparatus, including:
the operation acquisition module is used for acquiring at least two application operations, wherein the application operations at least comprise acquiring operation codes, installing dependent nodes of the operation codes to the local, packaging the operation codes, uploading the packaged operation codes and restarting the operation codes;
a code extraction module for extracting boot codes of at least two application operations
The code writing module is used for acquiring the configuration file and writing the starting codes of at least two application operations into the configuration file;
the variable extraction module is used for inquiring the POM file in the configuration file and extracting the configuration variable of the starting code to be stored in the POM file;
and the variable storage module is used for storing the configuration variables into the Properties file.
Furthermore, to achieve the above object, the present invention also provides a computer readable storage medium including a quick update code program, which when executed by a processor, implements the steps of the method for quickly updating code as described above.
The method, the device and the computer-readable storage medium for rapidly updating the code set by the invention set at least two running application operations through a Maven project, extracting the start code of the application operation, writing the start code of the application operation into a configuration file, inquiring a POM file in the configuration file, and writes the coordinates of the configuration variables in the start code of the application operation in the configuration file into the POM file, namely, the POM file and the configuration file establish a dependency relationship, the configuration variables of the starting code stored in the POM file are extracted and stored into the Properties file, so that when some custom variables are defined for configuration variables in the protists file, when the protriees file on which the configuration variables depend is loaded, the built-in loader automatically reads the configuration file content in the designated position of the Maven coordinate (the coordinate of the storage directory of the start code in the Maven item) corresponding to the configuration variables and stores the configuration file content in the static attribute. The code updating method has the advantages that the code updating of multiple application operations can be automatically realized only by modifying the configuration variables of local Properties by research and development personnel, the centralized management of the multiple application operations is realized, the programs executed after the variables are modified are simplified, and the working efficiency is improved.
Drawings
FIG. 1 is a diagram illustrating an application environment of a method for updating code quickly according to a preferred embodiment of the present invention;
FIG. 2 is a block diagram of a preferred embodiment of the fast update code process of FIG. 1;
FIG. 3 is a flowchart illustrating a method for quickly updating code according to a preferred embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a method for quickly updating codes, which is applied to a device for quickly updating codes. Referring to fig. 1, a schematic diagram of an application environment of a method for quickly updating a code according to a preferred embodiment of the present invention is shown.
In this embodiment, the fast code update apparatus includes: a processor 12, a memory 11, a communication bus 13, and a network interface 14.
The memory 11 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory, and the like. In some embodiments, the readable storage medium may be an internal storage unit of the quick update code device, such as a hard disk of the quick update code device. In other embodiments, the readable storage medium may also be an external memory 11 of the fast update code device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the fast update code device.
In the present embodiment, the readable storage medium of the memory 11 is generally used for storing the quick update code program 10 and the like installed in the quick update code device. The memory 11 may also be used to temporarily store data that has been output or is to be output.
Processor 12, which in some embodiments may be a Central Processing Unit (CPU), microprocessor or other data Processing chip, is configured to execute program code stored in memory 11 or process data, such as executing fast update code program 10.
Those skilled in the art will appreciate that the configuration of the terminal shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, the memory 1005, which is a kind of computer storage medium, may include an operating device, a network communication module, a user interface module, and a control program of the indoor unit of the air conditioner.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the control program of the indoor unit of the air conditioner stored in the memory 1005, and perform the following operations:
the network interface 14 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), typically used to establish a communication link between the quick update code device and other electronic devices.
The communication bus 13 is used to realize connection communication between these components.
FIG. 1 only shows a quick update code device with components 11-14, but it should be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
Optionally, the quick code update apparatus may further include a user interface, the user interface may include an input unit such as a Keyboard (Keyboard), a voice input device such as a microphone (microphone) or other devices with voice recognition function, a voice output device such as a sound, a headset, or other devices, and optionally the user interface may further include a standard wired interface, a wireless interface.
Optionally, the quick update code device may further include a display, which may also be referred to as a display screen or a display unit. In some embodiments, the display device may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an Organic Light-Emitting Diode (OLED) touch device, or the like. The display is used for displaying information processed in the fast update code device and for displaying a visualized user interface.
Optionally, the quick update code device further comprises a touch sensor. The area provided by the touch sensor for the user to perform touch operation is called a touch area. Further, the touch sensor described herein may be a resistive touch sensor, a capacitive touch sensor, or the like. The touch sensor may include not only a contact type touch sensor but also a proximity type touch sensor. Further, the touch sensor may be a single sensor, or may be a plurality of sensors arranged in an array, for example.
In addition, the area of the display of the quick code updating device can be the same as or different from the area of the touch sensor. Optionally, a display is stacked with the touch sensor to form a touch display screen. The device detects touch operation triggered by a user based on the touch display screen.
Optionally, the fast code updating apparatus may further include a Radio Frequency (RF) circuit, a sensor, an audio circuit, and the like, which are not described in detail herein.
In an alternative embodiment, it is also possible to: and uploading the result of the method for rapidly making the Excel file to a block chain.
Specifically, the corresponding summary information is obtained based on the result of the method for rapidly making the Excel file, specifically, the summary information is obtained by hashing the result of the method for rapidly making the Excel file, for example, by using the sha256s algorithm. Uploading summary information to the blockchain can ensure the safety and the fair transparency of the user. The user may download the summary information from the blockchain to verify that the results of the task scheduling method for processing the full warranty have been tampered with. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
In the embodiment of the apparatus shown in fig. 1, the memory 11, which is a kind of computer storage medium, may include therein an operating means, and a quick update code program 10; the processor 12, when executing the fast update code program 10 stored in the memory 11, implements the following steps:
acquiring at least two application operations, wherein the application operations at least comprise acquiring an operation code, installing a dependent node of the operation code to a local, packaging the operation code, uploading the packaged operation code and restarting the operation code;
extracting start codes of at least two application operations;
acquiring a configuration file, and writing start codes of at least two application operations into the configuration file;
inquiring a POM file in the configuration file, and extracting configuration variables of a start code to be stored in the POM file;
and storing the configuration variables into the Properties file.
It should be noted that a plurality of application operations are set in the Maven project, and the application operations are arranged in sequence and execute respective functions asynchronously.
In the Maven project, the application operations set in sequence at least include: obtaining operation codes, installing dependent nodes of the operation codes to the local, packaging the operation codes, uploading the packaged operation codes and restarting the operation codes.
The method comprises the steps of selecting an automatic Maven plug-in to set a jar package, obtaining a start code of the jar package, creating a configuration file in a Maven project, writing a storage directory of the start code in the Maven project into the configuration file according to a Maven intall command, automatically creating a development environment of the configuration file by an IDE (integrated development environment), extracting a POM (point of sale) file in the configuration file in the development environment, adding two plug-ins, namely, Maven-plugin-api and Maven-plugin-association, in the POM file to establish a dependency relationship between the POM file and the Maven plug-in and achieve self-definition of the Maven plug-in, wherein the Maven-plugin-api is a plug-in development api, the Maven-plugin-association is a package defined by annotations used in the plug-in, and the Maven-assembly-plugin is also added in the POM file and used for reading the configuration file.
The configuration file is set in the Maven project, a plurality of application operations are managed in a centralized mode through the configuration file, when the operations are needed, the corresponding application operations can be selected selectively according to the steps needed to be executed, and all the application operations are not needed to be executed. The setting process comprises the following steps: and pulling the starting code, writing the storage directory of the starting code in the Maven item into a configuration file according to the Maven intall command, and performing the starting method of the user-defined plug-in object on the item by creating the Maven item and introducing two plug-ins of Maven-plug-in-api and Maven-plug-in-options.
When the Maven project is provided with a plurality of configuration files, an aggregation module is created; when a plurality of configuration files are managed by a Maven project, the configuration files are managed by creating an aggregation module, wherein the aggregation module sets an inheritance relationship of the POM by using a directory structure, sets a lower directory and an upper directory, inherits the POM of the lower directory to the POM of the upper directory by default, and the POM file in the properties file is established to be dependent on the POM file of the upper directory, so that the POM can be quickly read.
The inheritance relationship between the lower directory and the upper directory can be realized through a hierarchical progressive directory structure, and POM files of the lower directory can also be added in the upper directory.
Setting a plurality of configuration file extension lists, and writing a plurality of configuration files into the corresponding extension lists; that is, the inheritance relationship between the lower directory and the upper directory in the aggregation module is realized by adopting a hierarchical progressive directory structure, that is, a plurality of configuration file extension lists are set, a plurality of configuration files are written into the corresponding extension lists, and the POM files of the configuration files are associated with the directory (the upper directory) at the extension lists, that is, the inheritance relationship is set completely.
Acquiring a boot code of the jar packet, and writing the boot code into a POM file of the aggregation module; the method specifically comprises the steps of acquiring a start code of a jar package, extracting the POM file in the aggregation module, adding two plugins, namely Maven-plugin-api and Maven-plugin-indicators, into the POM file so as to establish the dependency relationship between the POM file and the Maven plugins, and aggregating a plurality of configuration files through the aggregation module to realize the centralized management of a plurality of projects;
acquiring the project name and the module name of the POM file of the aggregation module; the item name and the module name of the POM file of the aggregation module are coordinates of the POM file of the aggregation module, and the directory and the configuration file which are dependent on the existence of the configuration file can be determined and found out through the coordinates of the POM file of the aggregation module, so that the inheritance relationship can be established according to the coordinates of the POM file of the aggregation module and the POM file of the configuration file, and the dependency relationship can be established with the POM file in the properties file.
Writing the item name and the module name of the POM file of the aggregation module into the POM files of a plurality of configuration files; in order to introduce the jar packages which depend on the same into a plurality of configuration files, the jar packages can be written into the POM files in the aggregation module, and the POM files in the configuration files inherit, specifically: the method comprises the steps of placing jar packages into coordinates in a POM file in an aggregation module, wherein the coordinates comprise a project name and a module name, writing the coordinates of the jar packages in the aggregation module into the POM file in a configuration file, reading the POM file through Maven when translating the project, finding the jar packages from the dependency relationship between the POM file and the jar packages, downloading the corresponding jar packages, needing no more time for finding the jar packages layer by layer, and shortening the acquisition time of the jar packages. By extracting the dependency relationship of each configuration file and the POM file, the consistency of each configuration file can be promoted while reading of the POM file is simplified.
It should be noted that, the elements extracted from the POM file in the aggregation module may be written in the POM file of the configuration file, and the elements extracted from the POM file in the aggregation module may also include item description information, item organization information, item starting year, URL address of the item, developer information of the item, contributor information of the item, deployment configuration of the item, defect tracking system information of the item, persistent integration system information of the item, version control system of the item, mail list information of the item, custom Maven attribute, dependent configuration of the item, dependent management configuration of the item, warehouse configuration of the item, source code directory configuration of the item, output directory configuration, plug-in management configuration, report output directory configuration of the item, report plug-in configuration, and the like.
Extracting the POM files in the aggregation module, writing the extended list into the POM files, and establishing the dependence of the extended list and the corresponding configuration files respectively; the establishment of the dependency relationship between the superior directory and the inferior directory is to write an extension list into the POM file in the aggregation module, establish the dependency between the extension list and the POM file in the corresponding stored large package configuration file, establish the dependency relationship between the POM file in the aggregation module and the POM file in the properties file, that is, when the POM file in the properties file modifies the variable parameter, the built-in loader automatically reads the Maven coordinate (the coordinate of the storage directory of the start code in the Maven item) corresponding to the POM file, load the POM file in the aggregation module into the configuration file in the inferior directory to obtain the designated position of the configuration file, obtain the content of the configuration file and store the content of the configuration file into the static attribute
A plurality of configuration files of the project are aggregated together by an aggregation module and are constructed by using a command, i.e. the building of multiple configuration files, is achieved by one command, wherein the aggregation module itself is also a configuration file, POM files are also arranged in the aggregation module, a plurality of expansion lists corresponding to the configuration files are arranged under the project directory of the aggregation module, the configuration files are aggregated under the project directory of the aggregation module and are placed in the corresponding expansion lists, correspondingly writing an extended list corresponding to a plurality of configuration files in the POM file of the aggregation module, and the extended list is respectively established with the corresponding configuration files, the Maven project calculates the construction sequence of the plurality of configuration files according to the dependency relationship of the plurality of configuration files, when constructing the Maven project, one command is used for sequentially constructing and realizing the pre-stored configuration files so as to realize that one command realizes the construction of a plurality of projects.
Constructing configuration variables in the POM files in the configuration files, and extracting dependent nodes in the configuration variables; the coordinate three elements of the dependent node in the POM file comprise: groupId, artifactId, version, wherein, groupId: the naming mode of the actual project to which the Maven project belongs is generally in reverse one-to-one correspondence with the domain name; artifactId: one Maven item (module) among the actual items, recommending the actual item name as the prefix of the artifactId; version: the version of the Maven item currently resides in. Of course, the dependent nodes of the POM file may also include packing and classfier, packing: the Maven item is packaged in a manner that generally corresponds to the file extension of the generated building block. When not defined, Maven will use the default value jar. classifier: help define some accessory attachments for the member output. Note that the classsifer of an item cannot be directly defined, because the affiliates are not generated by the item directly by default, but are generated with the help of additional plug-ins.
Acquiring a dependency module in a Maven project, and setting a dependency node according to dependency module association; when writing the POM file, one dependency often depends on other packages, while Maven can avoid the requirement of searching all required libraries, and the Maven finds out the dependency relationship between the POM file and the Maven by reading the POM file, so that the direct/indirect dependency relationship is well defined in the POM file of each item. When the project is translated, reading the POM file through Maven, finding the jar package from the dependency relationship between the POM file and the jar package, and downloading the corresponding jar package.
The coordinate three elements of the dependent node in the POM file are set to be the same as the dependent module in the Maven project, when a research and development worker modifies the configuration variables in the POM file, the Maven project reads the POM file from the Properties file to obtain the information required to be configured, and executes corresponding operations such as updating codes according to the information required to be configured.
And when the project is translated, reading the POM file through the Maven, finding the jar package from the dependence relationship between the POM file and the jar package, and downloading the corresponding jar package. POM files in a plurality of configuration files are uniformly maintained in a local Properties file through a plug-in of Properties-Maven-plug-in, the POM files mainly describe Maven coordinates of projects and dependency relations with the Maven projects, and the configuration files are separated from the POM files aiming at the problem that after the configuration files are packaged, a java program can also quickly read some self-defined configuration variables defined by the POM files and modify variable parameters, and does not need to modify codes any more.
In the prior art, a POM file is usually stored in a root directory of a configuration file in a Maven project, and required configuration information is acquired according to reading of the POM file, while in the application, the POM file in the configuration file is extracted and stored into a Properties file, and the POM file in the Properties file is used for defining some self-defined configuration variables.
Acquiring variable parameters; the variable parameters are Maven variables, which include: attributes are built in the Maven; elements in all POMs of POM/Project Properties, namely the content of any node of the current POM file; setting by a local user; environment variables, java system attributes; user-defined attributes defined by the user in the POM; variables of the upper level project, etc.
And extracting the POM file in the Properties file, and writing variable parameters. The method comprises the following steps of establishing the POM file, specifically, when some self-defined configuration variables are defined for the POM file in the properties file, when the properties file is loaded, a built-in loader automatically reads the configuration file content in the designated position of the Maven coordinate (the coordinate of the storage directory of the start code in the Maven project) corresponding to the POM file and stores the configuration file content in the static attribute.
Determining jar packages needing to be eliminated, and acquiring jar package coordinates; when a plurality of dependent jar packages exist in the POM file, one or more dependent jar packages are removed for convenient extraction of the dependent jar packages, then jar packages needing to be removed are determined, the coordinate positions of the jar packages needing to be removed are obtained, the coordinates of the jar packages comprise the item names of the jar packages and the module names of the jar packages, the corresponding dependent jar packages can be determined and found out through the item names of the jar packages and the module names of the jar packages, and the dependence of the jar packages is removed according to the item names of the jar packages and the module names of the jar packages.
Extracting configuration variables in the POM file in the Properties file, and writing the configuration variables into jar package coordinates; in order to exclude dependencies in the POM which are to be excluded or to directly download dependent jar packages, exclusions elements are used in the code to declare exclusion of the dependencies, and the exclusions can contain one or more exclusion sub-elements, so that one or more dependent jar packages can be excluded. It should be noted that when the exclusion is stated, only the item name of the jar package and the module name of the jar package are needed, and the judgment by the version element is not needed, so that the dog downloads the Maven extension from the plug-in, because the corresponding dependence jar package can be determined only by the item name of the jar package and the module name of the jar package, and the dependence of the jar package is excluded according to the item name of the jar package and the module name of the jar package. To reduce collisions that rely on multiple jar straps. In other words, in the dependence after Maven parses, the item name of the jar package and the module name of the jar package cannot appear, and Maven can directly refer to the jar package and download the jar package to the local folder.
It should be noted that, in the above embodiment, at least two running application operations are set through a Maven item, a start code of the application operation is extracted, the start code of the application operation is written into a configuration file, a POM file in the configuration file is queried, and coordinates of configuration variables in the start code of the application operation in the configuration file are written into the POM file, that is, the POM file establishes a dependency relationship with the configuration file, and the configuration variables stored in the POM file are extracted and stored into a Properties file, so that when some customized variables are defined for the configuration variables in the Properties file, and when the Properties file on which the configuration variables depend is loaded, a built-in loader automatically reads the configuration file content in the specified position of the Maven coordinate (the coordinates of the storage directory of the start code in the Maven item) corresponding to the configuration variables and stores the configuration file content in the static property. The method has the advantages that the research personnel can automatically realize updating codes, installing local basic packages, packaging micro-service modules, uploading jar packages and restarting applications only by modifying the configuration variables of local Properties, can also carry out personalized configuration, can deploy the stored configuration files of the start codes as required, can realize component functions as required by executing a self-defined Maven project command during operation, realizes centralized management of a plurality of application operations by the self-defined plug-in, simplifies the programs executed after modifying the variables, and improves the working efficiency.
In other embodiments, the fast update code program 10 may also be divided into one or more modules, which are stored in the memory 11 and executed by the processor 12 to accomplish the present invention. The modules referred to herein are referred to as a series of computer program instruction segments capable of performing specified functions. Referring to FIG. 2, a block diagram of a preferred embodiment of the fast update code program 10 of FIG. 1 is shown. The quick update code program 10 may be divided into: the device comprises an acquisition module 110, an extraction module 120, a writing module 130, a variable extraction module 140 and a storage module 150. The functions or operation steps implemented by the module 110-150 are similar to those described above, and are not described in detail here, for example, where:
the obtaining module 110 obtains at least two application operations, where the application operations at least include obtaining an operation code, installing a dependent node of the operation code to a local, packing the operation code, uploading the packed operation code, and restarting the operation code;
an extraction module 120 for extracting boot code for at least two application operations
A writing module 130, which takes the configuration file and writes the start codes of at least two application operations into the configuration file;
an extraction variable module 140, which queries the POM file in the configuration file and extracts the configuration variables of the start code to be stored in the POM file;
and the storage module 150 is used for storing the configuration variables into the Properties file.
In addition, the invention also provides a method for rapidly updating the code. Referring to FIG. 3, a flow chart of a method for quickly updating code according to a preferred embodiment of the present invention is shown. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the method for quickly updating code includes: step S10-step S40.
Step S10, obtaining at least two application operations, wherein the application operations at least comprise obtaining operation codes, installing dependent nodes of the operation codes to local, packaging the operation codes, uploading the packaged operation codes and restarting the operation codes;
it should be noted that a plurality of application operations are set in the Maven project, and the application operations are arranged in sequence and execute respective functions asynchronously.
In the Maven project, the application operations set in sequence at least include: obtaining operation codes, installing dependent nodes of the operation codes to the local, packaging the operation codes, uploading the packaged operation codes and restarting the operation codes.
Step S20, extracting the start codes of at least two application operations;
the method comprises the steps of selecting an automatic Maven plug-in to set a jar package, obtaining a start code of the jar package, creating a configuration file in a Maven project, writing a storage directory of the start code in the Maven project into the configuration file according to a Maven intall command, automatically creating a development environment of the configuration file by an IDE (integrated development environment), extracting a POM (point of sale) file in the configuration file in the development environment, adding two plug-ins, namely, Maven-plugin-api and Maven-plugin-association, in the POM file to establish a dependency relationship between the POM file and the Maven plug-in and achieve self-definition of the Maven plug-in, wherein the Maven-plugin-api is a plug-in development api, the Maven-plugin-association is a package defined by annotations used in the plug-in, and the Maven-assembly-plugin is also added in the POM file and used for reading the configuration file.
Step S30, obtaining a configuration file, and writing the start codes of at least two application operations into the configuration file;
the configuration file is set in the Maven project, a plurality of application operations are managed in a centralized mode through the configuration file, when the operations are needed, the corresponding application operations can be selected selectively according to the steps needed to be executed, and all the application operations are not needed to be executed. The setting process comprises the following steps: and pulling the starting code, writing the storage directory of the starting code in the Maven item into a configuration file according to the Maven intall command, and performing the starting method of the user-defined plug-in object on the item by creating the Maven item and introducing two plug-ins of Maven-plug-in-api and Maven-plug-in-options.
When the Maven project is provided with a plurality of configuration files, an aggregation module is created; when a plurality of configuration files are managed by a Maven project, the configuration files are managed by creating an aggregation module, wherein the aggregation module sets an inheritance relationship of the POM by using a directory structure, sets a lower directory and an upper directory, inherits the POM of the lower directory to the POM of the upper directory by default, and the POM file in the properties file is established to be dependent on the POM file of the upper directory, so that the POM can be quickly read.
The inheritance relationship between the lower directory and the upper directory can be realized through a hierarchical progressive directory structure, and POM files of the lower directory can also be added in the upper directory.
Setting a plurality of configuration file extension lists, and writing a plurality of configuration files into the corresponding extension lists; that is, the inheritance relationship between the lower directory and the upper directory in the aggregation module is realized by adopting a hierarchical progressive directory structure, that is, a plurality of configuration file extension lists are set, a plurality of configuration files are written into the corresponding extension lists, and the POM files of the configuration files are associated with the directory (the upper directory) at the extension lists, that is, the inheritance relationship is set completely.
Acquiring a boot code of the jar packet, and writing the boot code into a POM file of the aggregation module; the method specifically comprises the steps of acquiring a start code of a jar package, extracting the POM file in the aggregation module, adding two plugins, namely Maven-plugin-api and Maven-plugin-indicators, into the POM file so as to establish the dependency relationship between the POM file and the Maven plugins, and aggregating a plurality of configuration files through the aggregation module to realize the centralized management of a plurality of projects;
acquiring the project name and the module name of the POM file of the aggregation module; the item name and the module name of the POM file of the aggregation module are coordinates of the POM file of the aggregation module, and the directory and the configuration file which are dependent on the existence of the configuration file can be determined and found out through the coordinates of the POM file of the aggregation module, so that the inheritance relationship can be established according to the coordinates of the POM file of the aggregation module and the POM file of the configuration file, and the dependency relationship can be established with the POM file in the properties file.
Writing the item name and the module name of the POM file of the aggregation module into the POM files of a plurality of configuration files; in order to introduce the jar packages which depend on the same into a plurality of configuration files, the jar packages can be written into the POM files in the aggregation module, and the POM files in the configuration files inherit, specifically: the method comprises the steps of placing jar packages into coordinates in a POM file in an aggregation module, wherein the coordinates comprise a project name and a module name, writing the coordinates of the jar packages in the aggregation module into the POM file in a configuration file, reading the POM file through Maven when translating the project, finding the jar packages from the dependency relationship between the POM file and the jar packages, downloading the corresponding jar packages, needing no more time for finding the jar packages layer by layer, and shortening the acquisition time of the jar packages. By extracting the dependency relationship of each configuration file and the POM file, the consistency of each configuration file can be promoted while reading of the POM file is simplified.
It should be noted that, the elements extracted from the POM file in the aggregation module may be written in the POM file of the configuration file, and the elements extracted from the POM file in the aggregation module may also include item description information, item organization information, item starting year, URL address of the item, developer information of the item, contributor information of the item, deployment configuration of the item, defect tracking system information of the item, persistent integration system information of the item, version control system of the item, mail list information of the item, custom Maven attribute, dependent configuration of the item, dependent management configuration of the item, warehouse configuration of the item, source code directory configuration of the item, output directory configuration, plug-in management configuration, report output directory configuration of the item, report plug-in configuration, and the like.
Extracting the POM files in the aggregation module, writing the extended list into the POM files, and establishing the dependence of the extended list and the corresponding configuration files respectively; the establishment of the dependency relationship between the upper-level directory and the lower-level directory is to write an extension list into a POM file in the aggregation module, establish dependency between the extension list and a POM file in a configuration file stored correspondingly, establish the dependency relationship between the POM file in the aggregation module and the POM file in the properties file, that is, when the POM file in the properties file modifies variable parameters, a built-in loader automatically reads a Maven coordinate (a coordinate of the storage directory of a start code in a Maven item) corresponding to the POM file, and load the POM file in the aggregation module into the configuration file in the lower-level directory to acquire the designated position of the configuration file, and acquire the content of the configuration file and store the content in a static attribute.
A plurality of configuration files of the project are aggregated together by an aggregation module and are constructed by using a command, i.e. the building of multiple configuration files, is achieved by one command, wherein the aggregation module itself is also a configuration file, POM files are also arranged in the aggregation module, a plurality of expansion lists corresponding to the configuration files are arranged under the project directory of the aggregation module, the configuration files are aggregated under the project directory of the aggregation module and are placed in the corresponding expansion lists, correspondingly writing an extended list corresponding to a plurality of configuration files in the POM file of the aggregation module, and the extended list is respectively established with the corresponding configuration files, the Maven project calculates the construction sequence of the plurality of configuration files according to the dependency relationship of the plurality of configuration files, when constructing the Maven project, one command is used for sequentially constructing and realizing the pre-stored configuration files so as to realize that one command realizes the construction of a plurality of projects.
Step S40, inquiring the POM file in the configuration file, and extracting the configuration variable of the start code stored in the POM file;
constructing configuration variables in the POM files in the configuration files, and extracting dependent nodes in the configuration variables; the coordinate three elements of the dependent node in the POM file comprise: groupId, artifactId, version, wherein, groupId: the naming mode of the actual project to which the Maven project belongs is generally in reverse one-to-one correspondence with the domain name; artifactId: one Maven item (module) among the actual items, recommending the actual item name as the prefix of the artifactId; version: the version of the Maven item currently resides in. Of course, the dependent nodes of the POM file may also include packing and classfier, packing: the Maven item is packaged in a manner that generally corresponds to the file extension of the generated building block. When not defined, Maven will use the default value jar. classifier: help define some accessory attachments for the member output. Note that the classsifer of an item cannot be directly defined, because the affiliates are not generated by the item directly by default, but are generated with the help of additional plug-ins.
Acquiring a dependency module in a Maven project, and setting a dependency node according to dependency module association; when writing the POM file, one dependency often depends on other packages, while Maven can avoid the requirement of searching all required libraries, and the Maven finds out the dependency relationship between the POM file and the Maven by reading the POM file, so that the direct/indirect dependency relationship is well defined in the POM file of each item. When the project is translated, reading the POM file through Maven, finding the jar package from the dependency relationship between the POM file and the jar package, and downloading the corresponding jar package.
The coordinate three elements of the dependent node in the POM file are set to be the same as the dependent module in the Maven project, when a research and development worker modifies the configuration variables in the POM file, the Maven project reads the POM file from the Properties file to obtain the information required to be configured, and executes corresponding operations such as updating codes according to the information required to be configured.
And step S50, storing the configuration variables into the Properties file.
And when the project is translated, reading the POM file through the Maven, finding the jar package from the dependence relationship between the POM file and the jar package, and downloading the corresponding jar package. POM files in a plurality of configuration files are uniformly maintained in a local Properties file through a plug-in of Properties-Maven-plug-in, the POM files mainly describe Maven coordinates of projects and dependency relations with the Maven projects, and the configuration files are separated from the POM files aiming at the problem that after the configuration files are packaged, a java program can also quickly read some self-defined configuration variables defined by the POM files and modify variable parameters, and does not need to modify codes any more.
In the prior art, a POM file is usually stored in a root directory of a configuration file in a Maven project, and required configuration information is acquired according to reading of the POM file, while according to the method, configuration variables of the POM file in the configuration file are extracted and stored in Properties files, some self-defined variable parameters are defined by the configuration variables in the Properties files, when the Properties files are loaded, a built-in loader automatically reads configuration file contents in an appointed position of a Maven coordinate (a coordinate of a storage directory of a start code in the Maven project) corresponding to the POM file and stores the configuration file contents in a static attribute, so that the high efficiency and convenience of code modification are increased, one-time loading is realized, and the POM file can be used for multiple times.
Acquiring variable parameters; the variable parameters are Maven variables, which include: attributes are built in the Maven; elements in all POMs of POM/Project Properties, namely the content of any node of the current POM file; setting by a local user; environment variables, java system attributes; user-defined attributes defined by the user in the POM; variables of the upper level project, etc.
And extracting the POM file in the Properties file, and writing variable parameters. The method comprises the following steps of establishing the POM file, specifically, when some self-defined variables are defined for the POM file in the properties file, when the properties file is loaded, a built-in loader automatically reads the configuration file content in the designated position of the Maven coordinate (the coordinate of the storage directory of the start code in the Maven project) corresponding to the POM file and stores the configuration file content in the static attribute.
Determining jar packages needing to be eliminated, and acquiring jar package coordinates; when a plurality of dependent jar packages exist in the POM file, one or more dependent jar packages are removed for convenient extraction of the dependent jar packages, then jar packages needing to be removed are determined, the coordinate positions of the jar packages needing to be removed are obtained, the coordinates of the jar packages comprise the item names of the jar packages and the module names of the jar packages, the corresponding dependent jar packages can be determined and found out through the item names of the jar packages and the module names of the jar packages, and the dependence of the jar packages is removed according to the item names of the jar packages and the module names of the jar packages.
Extracting configuration variables in the POM file in the Properties file, and writing the configuration variables into jar package coordinates; in order to exclude dependencies in the POM which are to be excluded or to directly download dependent jar packages, exclusions elements are used in the code to declare exclusion of the dependencies, and the exclusions can contain one or more exclusion sub-elements, so that one or more dependent jar packages can be excluded. It should be noted that when the exclusion is stated, only the item name of the jar package and the module name of the jar package are needed, and the judgment by the version element is not needed, so that the dog downloads the Maven extension from the plug-in, because the corresponding dependence jar package can be determined only by the item name of the jar package and the module name of the jar package, and the dependence of the jar package is excluded according to the item name of the jar package and the module name of the jar package. To reduce collisions that rely on multiple jar straps. In other words, in the dependence after Maven parses, the item name of the jar package and the module name of the jar package cannot appear, and Maven can directly refer to the jar package and download the jar package to the local folder.
It should be noted that, in the above embodiment, at least two running application operations are set through a Maven item, a start code of the application operation is extracted, the start code of the application operation is written into a configuration file, a POM file in the configuration file is queried, and coordinates of configuration variables in the start code of the application operation in the configuration file are written into the POM file, that is, the POM file establishes a dependency relationship with the configuration file, and the configuration variables stored in the POM file are extracted and stored into a Properties file, so that when some customized variables are defined for the configuration variables in the Properties file, and when the Properties file on which the configuration variables depend is loaded, a built-in loader automatically reads the configuration file content in the specified position of the Maven coordinate (the coordinates of the storage directory of the start code in the Maven item) corresponding to the configuration variables and stores the configuration file content in the static property. The method has the advantages that the research personnel can automatically realize updating codes, installing local basic packages, packaging micro-service modules, uploading jar packages and restarting applications only by modifying the configuration variables of local Properties, can also carry out personalized configuration, can deploy the stored configuration files of the start codes as required, can realize component functions as required by executing a self-defined Maven project command during operation, realizes centralized management of a plurality of application operations by the self-defined plug-in, simplifies the programs executed after modifying the variables, and improves the working efficiency.
In addition, an embodiment of the present invention further provides a device for quickly updating a code, where the device for quickly updating a code includes:
the operation acquisition module is used for acquiring at least two application operations, wherein the application operations at least comprise acquiring operation codes, installing dependent nodes of the operation codes to the local, packaging the operation codes, uploading the packaged operation codes and restarting the operation codes;
a code extraction module for extracting boot codes of at least two application operations
The code writing module is used for acquiring the configuration file and writing the starting codes of at least two application operations into the configuration file;
the variable extraction module is used for inquiring the POM file in the configuration file and extracting the configuration variable of the starting code to be stored in the POM file;
and the variable storage module is used for storing the configuration variables into the Properties file.
Preferably, the quick update code device further comprises:
the construction dependent node module is used for constructing a dependent node of the configuration variable in the POM file in the configuration file;
and the association module is used for acquiring the dependency module in the configuration file and setting the dependency node according to the dependency module association.
Preferably, the quick update code device further comprises:
the variable acquisition module is used for acquiring variable parameters;
and the variable replacing module is used for replacing the configuration variables in the Properties file with variable parameters.
Preferably, the quick update code device further comprises:
the jar package obtaining module is used for obtaining a dependent jar package in the POM file;
the exclusion module is used for determining jar packets needing to be excluded and acquiring jar packet coordinates needing to be excluded;
and the coordinate writing module extracts the Properties file and writes the Properties file into the jar packet coordinate.
Preferably, the code writing module further comprises:
the creating module is used for creating an aggregation module when a plurality of configuration files are acquired;
the extension module is used for setting extension lists corresponding to a plurality of configuration files in the aggregation module and writing the configuration files into the corresponding extension lists;
and establishing a dependency module, extracting the POM files in the aggregation module, writing the POM files into the extended list, and establishing the dependency between the extended list and the corresponding configuration files respectively.
Preferably, the quick update code device further comprises:
the jar package code acquisition module acquires a boot code of a jar package and writes the boot code into a POM file of the aggregation module;
the coordinate acquisition module is used for acquiring the project name and the module name of the POM file of the aggregation module;
and a coordinate writing module for writing the item name and the module name of the POM file of the aggregation module into the POM files of the plurality of configuration files.
Preferably, the quick update code device further comprises:
and the inheritance establishing module is used for establishing inheritance relation with the POM file in the configuration file according to the project name and the module name of the POM file in the aggregation template.
The specific implementation of the code quick-update apparatus of the present invention is substantially the same as the specific implementation of the code quick-update method and the electronic device, and will not be described herein again.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a fast update code program, and when executed by a processor, the fast update code program implements the following operations:
acquiring at least two application operations, wherein the application operations at least comprise acquiring an operation code, installing a dependent node of the operation code to a local, packaging the operation code, uploading the packaged operation code and restarting the operation code;
extracting start codes of at least two application operations;
acquiring a configuration file, and writing start codes of at least two application operations into the configuration file;
inquiring a POM file in the configuration file, and extracting configuration variables of a start code to be stored in the POM file;
and storing the configuration variables into the Properties file.
Preferably, after the step of querying the POM file in the configuration file and extracting the configuration variables of the boot code to be stored in the POM file, the method includes:
constructing a dependent node of the configuration variable in a POM file in a configuration file;
and acquiring a dependency module in the configuration file, and setting a dependency node according to the dependency module association.
Preferably, after the step of storing the configuration variables in the Properties file, the method includes:
acquiring variable parameters;
the configuration variables in the Properties file are replaced with variable parameters.
Preferably, after the step of storing the configuration variables in the Properties file, the method further includes:
obtaining a dependent jar package in the POM file;
determining jar packets needing to be excluded, and acquiring jar packet coordinates needing to be excluded;
extracting the Properties file and writing the coordinates into the jar packet.
Preferably, the step of obtaining the configuration file and writing the start codes of at least two application operations into the configuration file further includes:
when a plurality of configuration files are obtained, an aggregation module is created;
setting expansion lists corresponding to a plurality of configuration files in an aggregation module, and writing the configuration files into the corresponding expansion lists;
and extracting the POM files in the aggregation module, writing the POM files into the extended list, and establishing the dependency between the extended list and the corresponding configuration files respectively.
Preferably, after the step of setting an extension list corresponding to a plurality of configuration files in the aggregation module and writing the plurality of configuration files into the corresponding extension list, the method includes:
acquiring a boot code of the jar packet, and writing the boot code into a POM file of the aggregation module;
acquiring the project name and the module name of the POM file of the aggregation module;
and writing the item name and the module name of the POM file of the aggregation module into the POM files of the plurality of configuration files.
Preferably, after the step of writing the item name and the module name of the POM file of the aggregated module into the POM files of the plurality of configuration files, the method includes:
and establishing an inheritance relationship with the POM file in the configuration file according to the item name and the module name of the POM file in the aggregation template.
The embodiments of the computer-readable storage medium of the present invention are substantially the same as the embodiments of the method for quickly updating a code and the electronic device, and are not repeated herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for rapidly updating code, the method comprising:
acquiring at least two application operations, wherein the application operations at least comprise acquiring an operation code, installing a dependent node of the operation code to a local, packaging the operation code, uploading the packaged operation code and restarting the operation code;
extracting start codes of at least two application operations;
acquiring a configuration file, and writing start codes of at least two application operations into the configuration file;
inquiring a POM file in the configuration file, and extracting configuration variables of a start code to be stored in the POM file;
and storing the configuration variables into the Properties file.
2. The method for rapidly updating code according to claim 1, wherein the step of querying the POM file in the configuration file and extracting the configuration variables of the boot code to be stored in the POM file is followed by the steps of:
constructing a dependent node of the configuration variable in a POM file in a configuration file;
and acquiring a dependency module in the configuration file, and setting a dependency node according to the dependency module association.
3. The method for rapidly updating code according to claim 1, wherein after the step of storing configuration variables in the Properties file, the method comprises:
acquiring variable parameters;
and loading the Properties file, and replacing the configuration variables in the Properties file with variable parameters.
4. The method for rapidly updating code according to claim 1, wherein after the step of storing configuration variables in the Properties file, further comprising:
obtaining a dependent jar package in the POM file;
determining jar packets needing to be excluded, and acquiring jar packet coordinates needing to be excluded;
extracting the Properties file and writing the coordinates into the jar packet.
5. The method for rapidly updating code according to claim 1, wherein the step of obtaining a configuration file and writing start codes of at least two application operations into the configuration file further comprises:
when a plurality of configuration files are obtained, an aggregation module is created;
setting expansion lists corresponding to a plurality of configuration files in an aggregation module, and writing the configuration files into the corresponding expansion lists;
and extracting the POM files in the aggregation module, writing the POM files into the extended list, and establishing the dependency between the extended list and the corresponding configuration files respectively.
6. The method for rapidly updating code according to claim 5, wherein the step of setting an extension list corresponding to a plurality of configuration files in the aggregation module and writing the plurality of configuration files into the corresponding extension list is followed by:
acquiring a boot code of the jar packet, and writing the boot code into a POM file of the aggregation module;
acquiring the project name and the module name of the POM file of the aggregation module;
and writing the item name and the module name of the POM file of the aggregation module into the POM files of the plurality of configuration files.
7. The method for rapidly updating codes according to claim 1, wherein the step of writing the item name and the module name of the POM file of the aggregated module into the POM files of the plurality of configuration files is followed by:
and establishing an inheritance relationship with the POM file in the configuration file according to the item name and the module name of the POM file in the aggregation template.
8. An apparatus for fast updating code, the apparatus comprising: a memory and a processor, the memory including a fast update code program therein, the fast update code program when executed by the processor implementing the steps of:
acquiring at least two application operations, wherein the application operations at least comprise acquiring an operation code, installing a dependent node of the operation code to a local, packaging the operation code, uploading the packaged operation code and restarting the operation code;
extracting start codes of at least two application operations;
acquiring a configuration file, and writing start codes of at least two application operations into the configuration file;
inquiring a POM file in the configuration file, and extracting configuration variables of a start code to be stored in the POM file;
and storing the configuration variables into the Properties file.
9. A fast update code device, characterized in that the fast update code device comprises:
the operation acquisition module is used for acquiring at least two application operations, wherein the application operations at least comprise acquiring operation codes, installing dependent nodes of the operation codes to the local, packaging the operation codes, uploading the packaged operation codes and restarting the operation codes;
a code extraction module for extracting boot codes of at least two application operations
The code writing module is used for acquiring the configuration file and writing the starting codes of at least two application operations into the configuration file;
the variable extraction module is used for inquiring the POM file in the configuration file and extracting the configuration variable of the starting code to be stored in the POM file;
and the variable storage module is used for storing the configuration variables into the Properties file.
10. A computer-readable storage medium, characterized in that it comprises a quick-update code program which, when executed by a processor, implements the steps of a method of quickly updating code according to any one of claims 1 to 7.
CN202110249088.0A 2021-03-08 2021-03-08 Method, device and equipment for quickly updating code and storage medium Active CN112965714B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110249088.0A CN112965714B (en) 2021-03-08 2021-03-08 Method, device and equipment for quickly updating code and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110249088.0A CN112965714B (en) 2021-03-08 2021-03-08 Method, device and equipment for quickly updating code and storage medium

Publications (2)

Publication Number Publication Date
CN112965714A true CN112965714A (en) 2021-06-15
CN112965714B CN112965714B (en) 2022-06-10

Family

ID=76277472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110249088.0A Active CN112965714B (en) 2021-03-08 2021-03-08 Method, device and equipment for quickly updating code and storage medium

Country Status (1)

Country Link
CN (1) CN112965714B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012062063A1 (en) * 2010-11-12 2012-05-18 中兴通讯股份有限公司 Method and apparatus for generating and uninstalling software installation package
WO2018020448A1 (en) * 2016-07-27 2018-02-01 Russell Julie System and method for generating api development code for integrating platforms
CN108073390A (en) * 2016-11-08 2018-05-25 北京京东尚科信息技术有限公司 It is managed collectively the method, apparatus and system of configuration file in multiple engineerings
CN110968357A (en) * 2018-09-30 2020-04-07 北京国双科技有限公司 Method and device for packaging maven item, storage medium and processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012062063A1 (en) * 2010-11-12 2012-05-18 中兴通讯股份有限公司 Method and apparatus for generating and uninstalling software installation package
WO2018020448A1 (en) * 2016-07-27 2018-02-01 Russell Julie System and method for generating api development code for integrating platforms
CN108073390A (en) * 2016-11-08 2018-05-25 北京京东尚科信息技术有限公司 It is managed collectively the method, apparatus and system of configuration file in multiple engineerings
CN110968357A (en) * 2018-09-30 2020-04-07 北京国双科技有限公司 Method and device for packaging maven item, storage medium and processor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
十六月的樱丘: "Properties文件中获取POM设置好的变量", 《HTTPS://BLOG.CSDN.NET/JIANGLINGHAO123/ARTICLE/DETAILS/50433233?LOCATIONNUM=1&FPS=1》 *

Also Published As

Publication number Publication date
CN112965714B (en) 2022-06-10

Similar Documents

Publication Publication Date Title
CN104252342B (en) Embedded application implementation method and device capable of configuring parameters
CN106055368B (en) application updating method and device
CN103365644A (en) Method and device for expanding software functions
CN106569880B (en) Method and system for dynamically sharing resources between Android applications
CN106469071B (en) Application theme changing method and device
CN111443912A (en) Page rendering method and device based on components, computer equipment and storage medium
US20130325534A1 (en) Terminal management system, management server, and method therefor
CN112748946B (en) Application program installation file generation method and device, computing equipment and storage medium
CN111068328A (en) Game advertisement configuration table generation method, terminal device and medium
CN110532016B (en) Version management method, version updating method and version management system
CN111274263A (en) Visual database change statement generation method and device and storage medium
CN115185550A (en) Service deployment method, device, computer equipment and storage medium
CN111694613A (en) Decoupling method between application program modules, electronic device and storage medium
CN112149035A (en) Website static resource processing method and device
US8539048B2 (en) Electronic device and method for loading configuration files using the same
KR101117165B1 (en) Web platform unit for mobile terminal connectioned web-application program in heterogeneous operating system
CN113434582B (en) Service data processing method and device, computer equipment and storage medium
JP2019501459A (en) Application program execution method and apparatus
CN109976751A (en) Model manipulation method, relevant apparatus and computer-readable medium
CN111949298A (en) Generation method and device of upgrade package, server and computer storage medium
CN112965714B (en) Method, device and equipment for quickly updating code and storage medium
CN106951240B (en) Batch packaging method for user customized products
CN106469048B (en) Method and device for calling content in attribute configuration file
CN112596746A (en) Application installation package generation method and device, computer equipment and storage medium
CN116647447A (en) Application program hot update method and device, intelligent device and storage medium

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