CN117270887B - Spring micro-service management method, device and storage medium - Google Patents

Spring micro-service management method, device and storage medium Download PDF

Info

Publication number
CN117270887B
CN117270887B CN202311559692.9A CN202311559692A CN117270887B CN 117270887 B CN117270887 B CN 117270887B CN 202311559692 A CN202311559692 A CN 202311559692A CN 117270887 B CN117270887 B CN 117270887B
Authority
CN
China
Prior art keywords
jar
package
target
directory
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311559692.9A
Other languages
Chinese (zh)
Other versions
CN117270887A (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.)
Jiajia Technology Co ltd
Original Assignee
Jiajia 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 Jiajia Technology Co ltd filed Critical Jiajia Technology Co ltd
Priority to CN202311559692.9A priority Critical patent/CN117270887B/en
Publication of CN117270887A publication Critical patent/CN117270887A/en
Application granted granted Critical
Publication of CN117270887B publication Critical patent/CN117270887B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a method, a device and a storage medium for managing Spring micro-services, which can avoid dependence conflicts while slimming and privatizing deployment package volume, and the method comprises the following steps: acquiring and decompressing a privately-arranged package of the Spring micro-service, and finding out a start script and JAR packages of all the micro-services; decompressing any JAR package, and switching the micro-service starting mode into using a class file and the JAR package for starting; renaming the target JAR package under the/BOOT-INF/lib directory by using the MD5 value; moving the target JAR package with the MD5 value to a public dependency directory, and generating associated information of the target JAR package with the MD5 value under a/BOOT-INF/lib directory; modifying a JAVA program entry specified by the starting script; and recompressing the modified startup script and the target JAR package with the MD5 value to obtain a new privately-allocated package.

Description

Spring micro-service management method, device and storage medium
Technical Field
The present invention relates to the field of computer software development, and in particular, to a method and apparatus for managing Spring microservices, and a storage medium.
Background
The privately-allocated package of the micro-service product (such as Spring micro-service) is composed of JAR packages of a plurality of micro-services, and if the micro-service product contains 50 micro-services and the JAR packages have the volume of 100M, the volume of the privately-allocated package of the micro-service product reaches 5G. And, the repetition of the microservice JAR is very dependent, so that a substantial part of the volume of the microservice product is occupied by external dependencies. Thus, there is a need to reduce the volume of privately deployed packages of microservice products.
At present, the thought of reducing the volume of privately-allocated packages is mainly as follows: external dependencies are deposited in a common dependency directory by JAVA build tools (e.g., maven, gradle). For example, assuming that 50 micro services all rely on a JAR packet of a certain 1M size, this JAR will repeatedly appear 50 times occupying a volume of 50M, and will occupy only 1M if placed in the public dependency directory, i.e., by placing external dependencies in the public dependency directory, the volume can be reduced by 60% -90%.
However, JAVA build tools require that the microservice have the same version of dependency, and if the dependent versions of the microservice are inconsistent, this can cause multiple versions of dependency packages to appear in the common dependency directory, which can cause anomalies in the JAVA program when loading the class. In addition, the micro-service product is commonly developed by a plurality of teams, each team has independent JAVA engineering, and the dependent versions of different teams are inconsistent.
In summary, it is necessary to provide a management solution for Spring micro services, which can reduce the volume of privately deployed packages while avoiding dependency conflicts.
Disclosure of Invention
The embodiment of the application provides a method, a device and a storage medium for managing Spring micro-services, so as to solve the problems in the related art, and the technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for managing a Spring micro service, including:
acquiring a privatized deployment package of the Spring micro-service;
decompressing the privately-arranged package, and finding out a starting script and JAR packages of all micro services;
decompressing any JAR package, and switching the micro-service starting mode into using a class file exposed in a file system and the JAR package for starting;
renaming a target JAR package under a BOOT-INF/lib directory by using an MD5 value, wherein the target JAR package is a dependent package packaged when a Spring micro-service is started;
moving a target JAR packet with an MD5 value to a public dependency directory, and generating associated information of the target JAR packet with the MD5 value under a/BOOT-INF/lib directory;
modifying a JAVA program entry specified by the starting script;
and recompressing the modified starting script and the target JAR package with the MD5 value to obtain a new privately-allocated package of the Spring micro-service.
In one embodiment, using the MD5 value, renaming/renaming a target JAR package under the BOOT-INF/lib directory includes:
traversing each target JAR packet under the BOOT-INF/lib directory, and calculating a target MD5 value of each target JAR packet;
renaming each of the target JAR packets using the target MD5 value.
In one embodiment, the association information is a soft chain pointing to the target JAR packet with MD5 value, and the name of the soft chain is the original name of the target JAR packet with MD5 value.
In one embodiment, the soft link is a linux soft link.
In one embodiment, modifying the JAVA program portal specified by the start-up script includes:
and in the command line of the starting script, modifying the JAVA program entry appointed by the starting script into org.
In one embodiment, the method further comprises:
obtaining a vulnerability list provided by a client;
searching a first JAR package of a repairing version from the public dependency directory, wherein the first JAR package is a JAR package of a version in which the loopholes in the loophole list do not exist;
after the first JAR packet is verified to pass, feeding back the first JAR packet to the client;
moving a new first JAR package obtained after the client repairs the vulnerability to the public dependency directory, replacing the association information of the first JAR package with the association information of the new first JAR package, and deleting the first JAR package;
restarting the Spring micro-service.
In one embodiment, validating the first JAR packet pass includes:
and carrying out smoking test on the first JAR packet, and determining that the first JAR packet passes verification when no problem exists in the test.
In a second aspect, an embodiment of the present application further provides a device for managing a Spring micro service, including:
the decompression unit is used for acquiring the privately-arranged package of the Spring micro-service; decompressing the privately-arranged package, and finding out a starting script and JAR packages of all micro services; decompressing any JAR package, and switching the micro-service starting mode into using a class file exposed in a file system and the JAR package for starting;
the management unit is used for renaming a target JAR package under the BOOT-INF/lib directory by using the MD5 value, wherein the target JAR package is a dependency package packaged when the Spring micro-service is started; moving a target JAR packet with an MD5 value to a public dependency directory, and generating associated information of the target JAR packet with the MD5 value under a/BOOT-INF/lib directory; modifying a JAVA program entry specified by the starting script; and recompressing the modified starting script and the target JAR package with the MD5 value to obtain a new privately-allocated package of the Spring micro-service.
In one embodiment, the management unit is specifically configured to:
traversing each target JAR packet under the BOOT-INF/lib directory, and calculating a target MD5 value of each target JAR packet;
renaming each of the target JAR packets using the target MD5 value.
In one embodiment, the association information is a soft chain pointing to the target JAR packet with MD5 value, and the name of the soft chain is the original name of the target JAR packet with MD5 value.
In one embodiment, the soft link is a linux soft link.
In one embodiment, the management unit is specifically configured to:
and in the command line of the starting script, modifying the JAVA program entry appointed by the starting script into org.
In one embodiment, the management unit is further configured to:
obtaining a vulnerability list provided by a client;
searching a first JAR package of a repairing version from the public dependency directory, wherein the first JAR package is a JAR package of a version in which the loopholes in the loophole list do not exist;
after the first JAR packet is verified to pass, feeding back the first JAR packet to the client;
moving a new first JAR package obtained after the client repairs the vulnerability to the public dependency directory, replacing the association information of the first JAR package with the association information of the new first JAR package, and deleting the first JAR package;
restarting the Spring micro-service.
In one embodiment, the management unit is specifically configured to:
and carrying out smoking test on the first JAR packet, and determining that the first JAR packet passes verification when no problem exists in the test.
In a third aspect, embodiments of the present application further provide a computer apparatus, including: a memory and a processor, the memory storing instructions that are loaded and executed by the processor to implement the method of any of the embodiments of the above aspects, wherein the memory and the processor are in communication with each other via an internal connection path.
In a fourth aspect, embodiments of the present application further provide a computer readable storage medium, in which a computer program is stored, where the computer program, when run on a computer, implements a method according to any one of the embodiments of the above aspects.
The advantages or beneficial effects in the technical scheme at least comprise:
according to the method and the device, the volume of the privately deployed package is greatly reduced by moving the dependent package to the public dependent directory, the dependent package of the public dependent directory is pointed by using the association information of the JAR package, and meanwhile, the conflict of JAR packages with the same name and different contents can be avoided by adding the MD5 value to the JAR package under the public dependent directory, so that the problem of multi-version dependent conflict can be solved.
Meanwhile, by replacing the JAR package with the loopholes, the method and the device realize the hot repair of the loopholes, avoid re-outputting the program package, have short flow and less time consumption, and greatly reduce the cost of the repair of the loopholes.
The foregoing summary is for the purpose of the specification only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the present application will become apparent by reference to the drawings and the following detailed description.
Drawings
In the drawings, the same reference numerals refer to the same or similar parts or elements throughout the several views unless otherwise specified. The figures are not necessarily drawn to scale. It is appreciated that these drawings depict only some embodiments according to the disclosure and are not therefore to be considered limiting of its scope.
Fig. 1 is a flow chart of a method for managing Spring micro services according to an embodiment of the present application;
FIG. 2 is a flow chart of another method for managing Spring micro-services according to an embodiment of the present application;
FIG. 3 is a block diagram of a Spring micro-service management device according to an embodiment of the present application;
fig. 4 is a block diagram of a computer device according to an embodiment of the present application.
Detailed Description
Hereinafter, only certain exemplary embodiments are briefly described. As will be recognized by those of skill in the pertinent art, the described embodiments may be modified in various different ways without departing from the spirit or scope of the present application. Accordingly, the drawings and description are to be regarded as illustrative in nature and not as restrictive.
Fig. 1 shows a flowchart of a method for managing Spring micro services according to an embodiment of the present application. As shown in fig. 1, the method may include the steps of:
s110, acquiring a privately-arranged package of the Spring micro-service.
In a specific implementation, the privately-arranged package of the Spring micro-service may be a zip compression package, where the privately-arranged package may include a plurality of deployment files of the micro-service, such as a startup script, a configuration file, and a JAR package of the micro-service, that is, a JAR package (Fat JAR) generated by a Spring Boot package plug-in.
Illustratively, the directory structure of the privately deployed package may appear as follows:
---ServiceA
-start-up script
-configuration file
-Fat Jar (Jar package)
As an example, a privately deployed package of Spring micro-services may be obtained from a local server.
S120, decompressing the privately-arranged package, and finding out a starting script and JAR packages of all micro services.
In the specific implementation, after the privately-arranged package is decompressed, a starting script can be found by searching a file with a suffix of the file of the bat, and searching all files with the suffix of JAR, so as to find the JAR package of all micro services.
S130, decompressing any JAR package, and switching the micro-service starting mode into starting by using the class file and the JAR package exposed in the file system.
In the specific implementation, the micro-service starting mode may be switched from java-jar starting to java org.
Because the plurality of JAR packages of micro services exist in the privately-allocated package, the JAR packages have repeated dependence, in the application, after any JAR package is decompressed, the micro service starting mode is switched to be started by using the class file and the JAR package exposed in the file system, and the JAR packages of the micro services can be decompressed to the file system, so that the JAR packages of the plurality of micro services can be subjected to pooling treatment, and then all the repeated JAR packages can be moved into a public dependency directory through a soft chain, so that the volume of the privately-allocated package is reduced.
S140, renaming the target JAR package under the/BOOT-INF/lib directory by using the MD5 value.
In the implementation, the target JAR package may be a dependency package packaged during the starting of the Spring micro-service, that is, the target JAR package is a compression package, and the target JAR package is placed in the/BOOT-INF/lib directory during the packaging of the Spring micro-service.
It can be understood that all third party dependent packages are placed under the/Boot-INF/lib directory when Spring Boot packages. Based on this, the/BOOT-INF/lib directory needs to be traversed to find all common dependency packages.
In specific implementation, step S140 may include: traversing each target JAR packet under the BOOT-INF/lib directory, and calculating a target MD5 value of each target JAR packet; each target JAR packet is renamed using the target MD5 value. For example, a target JAR packet may be renamed { name } { MD5 sum }, JAR, MD5 being the target MD5 value of the target JAR packet.
In the application, by using the MD5 value to rename/BOOT-INF/lib target JAR packet under the directory, the phenomenon that the JAR packets with the same file name but different actual contents are covered when moving can be avoided, so that the JAR packets with unchanged version numbers and changed contents can be prevented from generating dependency conflicts when running, such as the JAR packet of SNAPSHOT or the JAR packet repeatedly uploaded.
S150, moving the target JAR packet with the MD5 value to a public dependency directory, and generating association information of the target JAR packet with the MD5 value under the/BOOT-INF/lib directory.
In particular implementations, the association information may be a soft chain that points to the target JAR packet with the MD5 value, where the name of the soft chain may be the original name of the target JAR packet with the MD5 value.
As an example, the soft link may be a linux soft link.
In the implementation, after the target JAR packet with the MD5 value is moved to the public dependency directory, the JAVA program will not go to the public dependency directory to search for the target JAR packet with the MD5 value (i.e., the dependency packet) or will go to the BOOT-INF/lib directory to search for the target JAR packet with the MD5 value. Based on the information, the JAVA program can conveniently find the target JAR packet with the MD5 value by generating the associated information of the target JAR packet with the MD5 value under the/BOOT-INF/lib directory.
S160, modifying the JAVA program entry specified by the starting script.
Generally, JAVA program launch is a main method that requires a specified program. The original Fat Jar mode will specify a main method in the Manifest file, and now the JAVA package has been decompressed, so that it is necessary to switch to starting the JAVA program in the form of specifying a mean method in the command line.
In the specific implementation, the JAVA program can be started in the form of a mean method by modifying the JAVA program entry specified by the start script into org. It is understood that the-jar xxx.jar of the startup script is replaced with org.
In specific implementation, after executing step S160, after the project implements the decompressed privately deployed package, the JAVA program may be started using the JAVA program portal (i.e., jarLauncher) specified by the startup script.
S170, recompressing the modified starting script and the target JAR package with the MD5 value to obtain a new privately-allocated package of the Spring micro-service.
After the completion of step S170, the external dependencies are all placed in the public dependency directory, and the privately-deployed package in step S110 is recompressed into a "slide" -like deployment package. At this point, the "slide" deployment package volume will be much smaller than the privately-deployed package in step S110 described above, due to the pooling of public-dependent JAR. For example, the proprietary deployment package Slim of the original 10G is reduced to only 800M.
After the steps S110 to S170 are completed, all the target JAR packages under the/BOOT-INF/lib directory are automatically added to the CLASSPATH at the start of the JarLauncher. When the class loader loads the target JAR package under the/BOOT-INF/lib directory, the class loader points to the real JAR package under the public dependency directory through a soft chain, namely the target JAR package with the MD5 value.
In the method, the volume of the privately deployed package is greatly reduced by moving the dependent package to the public dependent directory, and meanwhile, the problem of multi-version dependent conflict can be solved by adding the MD5 value to the JAR package under the public dependent directory and avoiding the JAR package with the same name and different contents.
The current security scanning tool is very popular, and clients can periodically scan privately deployed packages of Spring micro services. Because the vulnerability database is continuously updated, the JAR package without the vulnerability initially is scanned out of the vulnerability after a period of time. The client can require the software provider to repair the bug in a limited time, the research and development needs to be switched to the historical version upgrading dependent version corresponding to the client environment, and the software provider is re-packaged to the client after the test is passed. However, this vulnerability restoration method has a long process, a long time and a high cost.
Based on the above, in the process of managing the Spring micro-service, the bug hot repair needs to be realized in addition to avoiding the dependence conflict.
Aiming at the problem, the application provides a lightweight vulnerability thermal restoration method without re-outputting a program package.
The specific process of implementing the vulnerability thermal remediation of the application will be specifically described below.
As shown in fig. 2, the method for managing Spring micro services provided in the present application may further include the following steps:
s210, obtaining a vulnerability list provided by a client.
In practice, a client may create a vulnerability manifest for vulnerabilities discovered using Spring micro services. Thereafter, the vulnerability list may be obtained actively, periodically, etc.
S220, searching a first JAR packet of the repair version from the public dependency directory.
In implementations, the first JAR package may be a version of a JAR package that does not have vulnerabilities in the vulnerability manifest.
In practice, the first JAR package of the repair version may be looked up from the public dependency directory on mvnrepositor. For example, if a large vulnerability exists in the previous log4j, then a version of the JAR package without the vulnerability in the public dependency directory may be found on mvnrepositioning.
And S230, after the first JAR packet is verified to pass, feeding back the first JAR packet to the client.
When the method is implemented, the first JAR package can be subjected to a smoking test, and when the test is free of problems, the first JAR package can be determined to pass verification, and at the moment, the first JAR package can be fed back to a client. For example, a version of the flawless JAR packet corresponding to log4j may be fed back to the customer.
S240, moving the new first JAR package obtained after the vulnerability is repaired by the client to the public dependency directory, replacing the association information of the first JAR package with the association information of the new first JAR package, and deleting the first JAR package.
Illustratively, assuming log4j is to be upgraded from 2.16.0 to 2.18.0, the new first JAR packet is the 2.18.0 version of JAR packet. After moving the new first JAR package to the public dependency directory, a BOOT-INF/lib directory under the script micro-service directory can be written, the file name of log4j-core-2.16.0.jar is searched, the log4j-core-2.16.0.jar soft link is modified to point to log4j-core-2.18.0- { md5 sum }. JAR under the public dependency directory, and the replacement of the association information of the first JAR package to the association information of the new first JAR package can be completed. At this point, to avoid dependency collisions, the first JAR packet (i.e., the old JAR packet) may be deleted.
S250, restarting the Spring micro-service.
In the method, the device and the system, the thermal recovery of the loopholes is realized by replacing the JAR package with the loopholes, the program package is prevented from being re-exported, the flow is short, the time consumption is low, and the cost of the recovery of the loopholes is greatly reduced.
According to the method and the device, the volume of the privately deployed package is greatly reduced by moving the dependent package to the public dependent directory, the dependent package of the public dependent directory is pointed by using the association information of the JAR package, and meanwhile, the conflict of JAR packages with the same name and different contents can be avoided by adding the MD5 value to the JAR package under the public dependent directory, so that the problem of multi-version dependent conflict can be solved.
Meanwhile, by replacing the JAR package with the loopholes, the method and the device realize the hot repair of the loopholes, avoid re-outputting the program package, have short flow and less time consumption, and greatly reduce the cost of the repair of the loopholes.
Fig. 3 shows a block diagram of a management apparatus for Spring micro services according to an embodiment of the present application. As shown in fig. 3, the apparatus may include:
the decompression unit 310 is configured to obtain a privately-arranged package of the Spring micro-service; decompressing the privately-arranged package, and finding out a starting script and JAR packages of all micro services; decompressing any JAR package, and switching the micro-service starting mode into using the class file exposed in the file system and the JAR package for starting;
the management unit 320 is configured to rename, using the MD5 value, a target JAR packet under the BOOT-INF/lib directory, where the target JAR packet is a dependency packet packaged when the Spring micro-service is started; moving the target JAR package with the MD5 value to a public dependency directory, and generating associated information of the target JAR package with the MD5 value under a/BOOT-INF/lib directory; modifying a JAVA program entry specified by the starting script; and recompressing the modified starting script and the target JAR package with the MD5 value to obtain a new privately-allocated package of the Spring micro-service.
In one embodiment, the management unit 320 is specifically configured to:
traversing each target JAR packet under the BOOT-INF/lib directory, and calculating a target MD5 value of each target JAR packet;
each target JAR packet is renamed using the target MD5 value.
In one embodiment, the association information is a soft chain pointing to the target JAR packet with MD5 value, the name of the soft chain being the original name of the target JAR packet with MD5 value.
In one embodiment, the soft link is a linux soft link.
In one embodiment, the management unit 320 is specifically configured to:
in the command line of the startup script, the JAVA program entry specified by the startup script is modified to org.
In one embodiment, the management unit 320 is further configured to:
obtaining a vulnerability list provided by a client;
searching a first JAR package of a repairing version from a public dependency directory, wherein the first JAR package is a JAR package of a version without a vulnerability in a vulnerability list;
after the first JAR packet is verified to pass, the first JAR packet is fed back to the client;
moving a new first JAR package obtained after the vulnerability is repaired by a client into a public dependency directory, replacing the association information of the first JAR package with the association information of the new first JAR package, and deleting the first JAR package;
restarting the Spring micro-service.
In one embodiment, the management unit 320 is specifically configured to:
and carrying out smoking test on the first JAR packet, and determining that the first JAR packet passes verification when the test is free of problems.
The functions of each unit of the Spring micro-service management device in the embodiment of the present application may be referred to the corresponding description in the above method, and will not be described herein.
Fig. 4 shows a block diagram of a computer device according to an embodiment of the present application. As shown in fig. 4, the computer apparatus includes: a memory 410 and a processor 420, wherein the memory 410 stores instructions that are loaded and executed by the processor 420 to implement the method for managing Spring micro-services in the above embodiment. The number of memories 410 and processors 420 may be one or more.
The computer apparatus further includes:
and the communication interface 430 is used for communicating with external equipment and carrying out data interaction transmission.
If the memory 410, the processor 420, and the communication interface 430 are implemented independently, the memory 410, the processor 420, and the communication interface 430 may be connected to each other and communicate with each other through buses. The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 4, but not only one bus or one type of bus.
Alternatively, in a specific implementation, if the memory 410, the processor 420, and the communication interface 430 are integrated on a chip, the memory 410, the processor 420, and the communication interface 430 may communicate with each other through internal interfaces.
The embodiments of the present application provide a computer readable storage medium, in which a computer program is stored, which when run on a computer implements the method provided in the embodiments of the present application.
The embodiment of the application also provides a chip, which comprises a processor and is used for calling and running the instructions stored in the memory, so that the communication device provided with the chip executes the method provided by the embodiment of the application.
The embodiment of the application also provides a chip, which comprises: the input interface, the output interface, the processor and the memory are connected through an internal connection path, the processor is used for executing codes in the memory, and when the codes are executed, the processor is used for executing the method provided by the application embodiment.
It should be appreciated that the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or any conventional processor or the like. It is noted that the processor may be a processor supporting an advanced reduced instruction set machine (Advanced RISC Machines, ARM) architecture.
Further, optionally, the memory may include a read-only memory and a random access memory, and may further include a nonvolatile random access memory. The memory may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may include a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory, among others. Volatile memory can include random access memory (random access memory, RAM), which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic RAM (Dynamic Random Access Memory, DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct memory bus RAM (DR RAM).
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. Computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Any process or method description in a flowchart or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process. And the scope of the preferred embodiments of the present application includes additional implementations in which functions may be performed in a substantially simultaneous manner or in an opposite order from that shown or discussed, including in accordance with the functions that are involved.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the methods of the embodiments described above may be performed by a program that, when executed, comprises one or a combination of the steps of the method embodiments, instructs the associated hardware to perform the method.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules described above, if implemented in the form of software functional modules and sold or used as a stand-alone product, may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic or optical disk, or the like.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of various changes or substitutions within the technical scope of the present application, and these should be covered in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (7)

1. The method for managing the Spring micro-service is characterized by comprising the following steps of:
acquiring a privatized deployment package of the Spring micro-service;
decompressing the privately-arranged package, and finding out a starting script and JAR packages of all micro services;
decompressing any JAR package, and switching the micro-service starting mode into using a class file exposed in a file system and the JAR package for starting;
renaming a target JAR package under a BOOT-INF/lib directory by using an MD5 value, wherein the target JAR package is a dependent package packaged when a Spring micro-service is started;
moving a target JAR packet with an MD5 value to a public dependency directory, generating associated information of the target JAR packet with the MD5 value under a/BOOT-INF/lib directory, wherein the associated information is a soft chain pointing to the target JAR packet with the MD5 value, and the name of the soft chain is the original name of the target JAR packet with the MD5 value, wherein all target JAR packets under the/BOOT-INF/lib directory are automatically added to a CLASSPATH when the JarLauncher starts, and a class loader loads the target JAR packet under the/BOOT-INF/lib directory and points to the target JAR packet with the MD5 value under the public dependency directory through the soft chain;
in a command line of the starting script, modifying a JAVA program entry appointed by the starting script into org.
Recompression is carried out on the modified starting script and the target JAR package with the MD5 value, so that a new privately-allocated package of the Spring micro-service is obtained;
the method further comprises the steps of:
obtaining a vulnerability list provided by a client;
searching a first JAR package of a repairing version from the public dependency directory, wherein the first JAR package is a JAR package of a version in which the loopholes in the loophole list do not exist;
after the first JAR packet is verified to pass, feeding back the first JAR packet to the client;
moving a new first JAR package obtained after the client repairs the vulnerability to the public dependency directory, replacing the association information of the first JAR package with the association information of the new first JAR package, and deleting the first JAR package;
restarting the Spring micro-service.
2. The method of claim 1, wherein renaming the target JAR package under the BOOT-INF/lib directory using the MD5 value comprises:
traversing each target JAR packet under the BOOT-INF/lib directory, and calculating a target MD5 value of each target JAR packet;
renaming each of the target JAR packets using the target MD5 value.
3. The method of claim 1, wherein the soft link is a linux soft link.
4. The method of claim 1, wherein validating the first JAR packet pass comprises:
and carrying out smoking test on the first JAR packet, and determining that the first JAR packet passes verification when no problem exists in the test.
5. A Spring micro-service management device, comprising:
the decompression unit is used for acquiring the privately-arranged package of the Spring micro-service; decompressing the privately-arranged package, and finding out a starting script and JAR packages of all micro services; decompressing any JAR package, and switching the micro-service starting mode into using a class file exposed in a file system and the JAR package for starting;
the management unit is used for renaming a target JAR package under the BOOT-INF/lib directory by using the MD5 value, wherein the target JAR package is a dependency package packaged when the Spring micro-service is started; moving a target JAR packet with an MD5 value to a public dependency directory, generating associated information of the target JAR packet with the MD5 value under a/BOOT-INF/lib directory, wherein the associated information is a soft chain pointing to the target JAR packet with the MD5 value, and the name of the soft chain is the original name of the target JAR packet with the MD5 value, wherein all target JAR packets under the/BOOT-INF/lib directory are automatically added to a CLASSPATH when the JarLauncher starts, and a class loader loads the target JAR packet under the/BOOT-INF/lib directory and points to the target JAR packet with the MD5 value under the public dependency directory through the soft chain; in a command line of the starting script, modifying a JAVA program entry appointed by the starting script into org. Recompression is carried out on the modified starting script and the target JAR package with the MD5 value, so that a new privately-allocated package of the Spring micro-service is obtained;
the management unit is also used for acquiring a vulnerability list provided by a client; searching a first JAR package of a repairing version from the public dependency directory, wherein the first JAR package is a JAR package of a version in which the loopholes in the loophole list do not exist; after the first JAR packet is verified to pass, feeding back the first JAR packet to the client; moving a new first JAR package obtained after the client repairs the vulnerability to the public dependency directory, replacing the association information of the first JAR package with the association information of the new first JAR package, and deleting the first JAR package; restarting the Spring micro-service.
6. A computer apparatus, comprising: a memory and a processor, the memory storing instructions that are loaded and executed by the processor to implement the method of any of claims 1-4.
7. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when run on a computer, implements the method according to any of claims 1-4.
CN202311559692.9A 2023-11-22 2023-11-22 Spring micro-service management method, device and storage medium Active CN117270887B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311559692.9A CN117270887B (en) 2023-11-22 2023-11-22 Spring micro-service management method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311559692.9A CN117270887B (en) 2023-11-22 2023-11-22 Spring micro-service management method, device and storage medium

Publications (2)

Publication Number Publication Date
CN117270887A CN117270887A (en) 2023-12-22
CN117270887B true CN117270887B (en) 2024-03-19

Family

ID=89219998

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311559692.9A Active CN117270887B (en) 2023-11-22 2023-11-22 Spring micro-service management method, device and storage medium

Country Status (1)

Country Link
CN (1) CN117270887B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10235527B1 (en) * 2016-08-11 2019-03-19 Pivotal Software, Inc. Vulnerability notification for live applications
CN110109701A (en) * 2019-05-14 2019-08-09 重庆商勤科技有限公司 File configuration method, device and application dissemination method, device when using deployment
CN112434307A (en) * 2020-06-21 2021-03-02 石高建 Data processing method combining big data and Internet of things and cloud computing server center
CN114047930A (en) * 2021-11-15 2022-02-15 中国电信股份有限公司 Secure distribution method and system of software product, electronic device and storage medium
CN116069354A (en) * 2022-12-07 2023-05-05 深圳市四格互联信息技术有限公司 Application program upgrading method, device, equipment and storage medium
CN116991491A (en) * 2022-06-28 2023-11-03 重庆市通信建设有限公司 Program plug-in loading method and device, computer equipment and computer program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6718364B2 (en) * 1999-08-10 2004-04-06 Sun Microsystems, Inc. Method and apparatus for expedited file downloads in an applet environment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10235527B1 (en) * 2016-08-11 2019-03-19 Pivotal Software, Inc. Vulnerability notification for live applications
CN110109701A (en) * 2019-05-14 2019-08-09 重庆商勤科技有限公司 File configuration method, device and application dissemination method, device when using deployment
CN112434307A (en) * 2020-06-21 2021-03-02 石高建 Data processing method combining big data and Internet of things and cloud computing server center
CN114047930A (en) * 2021-11-15 2022-02-15 中国电信股份有限公司 Secure distribution method and system of software product, electronic device and storage medium
CN116991491A (en) * 2022-06-28 2023-11-03 重庆市通信建设有限公司 Program plug-in loading method and device, computer equipment and computer program
CN116069354A (en) * 2022-12-07 2023-05-05 深圳市四格互联信息技术有限公司 Application program upgrading method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于MD5的加盐消息摘要Java实现;赵一凡等;软件导刊;20180315(第03期);全文 *

Also Published As

Publication number Publication date
CN117270887A (en) 2023-12-22

Similar Documents

Publication Publication Date Title
RU2580065C2 (en) Method and system for software update
US7814474B2 (en) Updatable mobile handset based on Linux with compression and decompression techniques
US8495615B2 (en) Method, system and computer program for distributing software patches
US9928059B1 (en) Automated deployment of a multi-version application in a network-based computing environment
CN111090452B (en) Service environment switching method and computer readable storage medium
US9547345B2 (en) System and method for safely updating thin client operating system over a network
WO2021143845A1 (en) Extended system partitioning method and apparatus, storage medium, and computer device
US11966302B2 (en) Updating a virtual machine backup
US9411618B2 (en) Metadata-based class loading using a content repository
CN102541593A (en) Rapid comparison method of versions of remote files
CN117270887B (en) Spring micro-service management method, device and storage medium
CN111258681B (en) BeeGFS service starting method and device
CN108536444B (en) Plug-in compiling method and device, computer equipment and storage medium
CN111400256A (en) Method and device for calling resource file by application program
US8190587B1 (en) In-place image promotion
CN113254356B (en) Test environment management method based on Knative
CN112486513B (en) Container-based cluster management method and system
CN111400243A (en) Research and development management system based on pipeline service and file storage method and device
CN111258605A (en) Universal upgrading method and device for channel client, computer equipment and storage medium
CN116991504B (en) Android App multi-resource dynamic loading and updating method and device and equipment
CN109996262B (en) AC starting method and device
CN116301908B (en) Buildroot local compiling method and system based on Shenwei architecture
CN116841551A (en) Compiling deployment method, device, equipment and storage medium of low-code development platform
CN114077458A (en) Method, device, equipment and storage medium for starting service module in application program
CN116932078A (en) Plug-in first cold start optimization method and device

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