Dependence package upgrading method and device based on message component, equipment and medium

By configuring a message listening service in the service center to listen for dependency package upgrade messages and obtain relevant information to determine whether the project service has been upgraded, the problem of untimely updates of dependency package upgrade information is solved, improving upgrade efficiency and user experience.

CN121433686APending Publication Date: 2026-01-30PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511492379.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2026-01-30

AI Technical Summary

Technical Problem

In existing technologies, the untimely updating of dependency package upgrade information leads to untimely scanning, affecting software security and user experience.

Method used

By configuring a message listening service in the service center, we can listen for dependency package upgrade messages, obtain the service instance name, service IP, latest dependency package name and version information, and determine whether the current project service has completed the dependency package upgrade.

Benefits of technology

It enables timely updates of dependency package upgrade information, improves upgrade efficiency, reduces the probability of service anomalies, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121433686A_ABST
    Figure CN121433686A_ABST
Patent Text Reader

Abstract

The invention provides a dependency package upgrading method and device based on a message component, equipment and a medium, and the method comprises the steps: receiving a dependency package upgrading message of a project service in advance through a message center, and monitoring the dependency package upgrading message of the message center through a message monitoring service; under the condition that the dependency package upgrading message is monitored, obtaining a service instance name, a service IP, a latest dependency package name and latest version information from the dependency package upgrading message based on a preset message format; therefore, the upgrade message can be obtained at the first time when the dependency package is upgraded, and whether the project service completes the dependency package upgrade or not can be quickly verified, so that the problem that the dependency package upgrade information is not timely updated due to the fact that the scanning time is not timely through a timed scanning method is avoided, the update efficiency of the dependency package upgrade information is improved, and the user experience is improved. Therefore, traffic recovery is performed on the suspended service in time, the service abnormity probability is reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, computer device, and computer-readable storage medium for dependency package upgrades based on message components. Background Technology

[0002] In software development, to improve software functionality, it's necessary to fix existing security risks. This is especially true in the development of financial system software, where timely patching of security vulnerabilities is crucial. For example, dependency packages that may have security issues need to be upgraded to secure versions promptly. Dependency package upgrades are a common development task. Typically, during the upgrade process, the project's deployment packages are scanned periodically to analyze dependency package names and version information, thus determining whether the upgrades have been completed. However, this method, relying on periodic scanning, inevitably suffers from delays in scanning time, leading to outdated dependency package upgrade information.

[0003] Therefore, how to solve the problem of untimely updates to dependency package upgrade information has become an urgent technical issue. Summary of the Invention

[0004] The main objective of this invention is to provide a dependency package upgrade method, apparatus, device, and computer-readable storage medium based on message components, aiming to solve the technical problem of untimely updates of dependency package upgrade information.

[0005] To achieve the above objectives, the present invention provides a dependency package upgrade method based on a message component, the dependency package upgrade method comprising the following steps: Configure a message listening service in the service center, and use the message listening service to listen for dependency package upgrade messages in the message center; Upon detecting the dependency package upgrade message, based on a preset message format, the service instance name, service IP, latest dependency package name, and latest version information are obtained from the dependency package upgrade message. Based on the service instance name and service IP, determine the current project service, and based on the latest dependency package name and latest version information, determine the latest dependency package information; Based on the latest dependency package information, the current dependency packages of the current project service are verified to determine whether the current project service has completed the dependency package upgrade.

[0006] Furthermore, to achieve the above objectives, the present invention also provides a dependency package upgrade device based on a message component, the dependency package upgrade device based on a message component comprising: The upgrade message listening module is used to configure the message listening service in the service center and listen for the upgrade messages of the dependency packages in the message center through the message listening service. The upgrade message acquisition module is used to, upon detecting the dependency package upgrade message, obtain the service instance name, service IP, latest dependency package name, and latest version information from the dependency package upgrade message based on a preset message format. Based on the service instance name and service IP, determine the current project service, and based on the latest dependency package name and latest version information, determine the latest dependency package information; Based on the latest dependency package information, the current dependency packages of the current project service are verified to determine whether the current project service has completed the dependency package upgrade.

[0007] Furthermore, to achieve the above objectives, the present invention also provides a computer device, the computer device including a processor, a memory, and a message-based dependency package upgrade program stored in the memory and executable by the processor, wherein when the message-based dependency package upgrade program is executed by the processor, it implements the steps of the message-based dependency package upgrade method as described above.

[0008] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a message-based dependency package upgrade program, wherein when the message-based dependency package upgrade program is executed by a processor, it implements the steps of the message-based dependency package upgrade method described above.

[0009] This application provides a dependency package upgrade method based on a message component. The method configures a message listening service in a service center and listens for dependency package upgrade messages in the message center through this service. Upon receiving a dependency package upgrade message, based on a preset message format, it obtains the service instance name, service IP, latest dependency package name, and latest version information from the dependency package upgrade message. Based on the service instance name and service IP, it determines the current project service, and based on the latest dependency package name and latest version information, it determines the latest dependency package information. Based on the latest dependency package information, it verifies the current dependency package of the current project service to determine whether the current project service has completed the dependency package upgrade. Through this method, this application receives dependency package upgrade messages for project services in advance through the message center and listens for these messages through the message listening service. This allows for immediate acquisition of dependency package upgrade messages and rapid verification of whether the project service has completed the dependency package upgrade, avoiding the problem of untimely updates caused by timed scanning methods. This improves the efficiency of dependency package upgrade information updates, enabling timely traffic recovery for suspended services, reducing the probability of service anomalies, and improving user experience. Attached Figure Description

[0010] Figure 1 This is a flowchart illustrating the first embodiment of the dependency package upgrade method based on message components of the present invention. Figure 2 This is a flowchart illustrating the second embodiment of the dependency package upgrade method based on message components of the present invention. Figure 3 This is a schematic diagram of the overall process of dependency package upgrade based on message components in this invention; Figure 4 This is a flowchart illustrating the third embodiment of the dependency package upgrade method based on message components of the present invention. Figure 5 This is a schematic diagram of the dependency package upgrade device based on message components according to the present invention; Figure 6 This is a schematic diagram of the hardware structure of the computer device involved in the embodiment of the present invention.

[0011] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0013] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0014] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0015] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0016] The dependency package upgrade method based on message components involved in this invention is mainly applied to computer devices, such as PCs, laptops, and mobile terminals, which have display and processing functions.

[0017] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0018] Reference Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the dependency package upgrade method based on message components of the present invention.

[0019] like Figure 1 As shown, this embodiment of the invention provides a dependency package upgrade method based on message components, which includes steps S10 to S40.

[0020] Step S10: Configure a message listening service in the service center, and listen for dependency package upgrade messages in the message center through the message listening service; Currently, during the upgrade process of software dependency packages, the project deployment packages are scanned periodically to analyze the dependency package names and version information, thereby determining whether the project's dependency packages have been upgraded. However, since this method relies on periodic scanning, there is an inherent problem that the scanning time may not be timely, resulting in untimely updates of dependency package upgrade information.

[0021] To address the aforementioned issues, this embodiment introduces a messaging component within the project. Upon project startup, a dependency package upgrade message, containing the latest dependency package name and version number, is sent to the message center using a pre-defined message format. The service center listens for this dependency package upgrade message, analyzes its content, and then checks whether the project service has completed the dependency package upgrade. Based on this analysis, it determines whether to enable the project service. If enabled, traffic is then routed to the project service. This allows for rapid acceptance testing of project dependency upgrades.

[0022] Specifically, a message listening service is configured in the service center to listen for dependency package upgrade messages in the message center.

[0023] Step S20: Upon receiving the dependency package upgrade message, based on a preset message format, obtain the service instance name, service IP, latest dependency package name, and latest version information from the dependency package upgrade message; In this embodiment, if the dependency package upgrade message is received in the message center, the service instance name, service IP, latest dependency package name, and latest version message corresponding to the dependency package upgrade message are obtained by parsing the pre-agreed message format.

[0024] Step S30: Based on the service instance name and service IP, determine the current project service, and based on the latest dependency package name and latest version information, determine the latest dependency package information; In this embodiment, based on the service instance name and service IP, the project service whose dependency package has been upgraded is identified and denoted as the current project service. Then, based on the latest dependency package name and latest version information of the current project service, the latest dependency package information is obtained.

[0025] Step S40: Based on the latest dependency package information, verify the current dependency package of the current project service to determine whether the current project service has completed the dependency package upgrade.

[0026] In this embodiment, based on the latest dependency package information that the current project service should be upgraded to, the dependency package information of the current dependency package of the current project service is verified to determine whether the current dependency package of the current project service is the latest dependency package, thereby determining whether the current project service has completed the dependency package upgrade.

[0027] This embodiment provides a dependency package upgrade method based on a message component. The method configures a message listening service in a service center and listens for dependency package upgrade messages in the message center through this service. Upon receiving a dependency package upgrade message, based on a preset message format, it obtains the service instance name, service IP, latest dependency package name, and latest version information from the dependency package upgrade message. Based on the service instance name and service IP, it determines the current project service, and based on the latest dependency package name and latest version information, it determines the latest dependency package information. Based on the latest dependency package information, it verifies the current dependency package of the current project service to determine whether the current project service has completed the dependency package upgrade. Through this method, this application receives dependency package upgrade messages for project services in advance through the message center and listens for these messages through a message listening service. This allows for immediate acquisition of dependency package upgrade messages and rapid verification of whether the project service has completed the dependency package upgrade, avoiding the problem of untimely updates caused by timed scanning methods. This improves the efficiency of dependency package upgrade information updates, enabling timely traffic recovery for suspended services, reducing the probability of service anomalies, and improving user experience.

[0028] Reference Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of the dependency package upgrade method based on message components of the present invention.

[0029] Based on the above Figure 1 In the illustrated embodiment, prior to step S10, the following steps are also included: Step S01: Add a message component to the project source code of each project service to listen for dependency package upgrade messages of each project service based on the message component. Step S02: When the dependency package upgrade is detected based on the message component, the service instance name and service IP of the current project service being upgraded, as well as the dependency package name and version information of the latest dependency package after the upgrade, are obtained based on the message component. Step S03: Based on the service instance name and service IP of the current project service and the dependency package name and version information of the latest dependency package information, generate the dependency package upgrade message and send the dependency package upgrade message to the message center.

[0030] In this embodiment, a message component is introduced into the project in advance so that when the project starts, a dependency package upgrade message containing the latest dependency package name and latest version number of the current project service is sent to the message center in a pre-defined message format.

[0031] Specifically, sending the dependency package upgrade message to the message center includes: Configure the message sending object; The message sending location is generated based on the IP address and service port of the message center; Based on the message sending object and the message sending location, the dependency package upgrade message is sent to the message center.

[0032] For example, such as Figure 3 As shown: 1. Obtain the source code of the current project service: Obtain the project source code from the project source code repository gitlab using git clone.

[0033] 2. Add a message component: Add a dependency node to the dependency configuration of the project po.xml file in the project source code, and import the message component rocketmq-client into this node.

[0034] Specifically, adding a message component to the source code of each project service includes: The `git clone` command is used to retrieve the source code of each project service from the GitLab repository, and also retrieves the project configuration file for each project's source code. Based on the dependency configuration projects in each project configuration file, the dependency nodes are determined in the corresponding project source code, and the message component is introduced into the dependency nodes.

[0035] Furthermore, in order to improve listening efficiency and reduce resource consumption while listening for dependency package upgrade messages, a dependency configuration project is defined in the project configuration file of the project source code, a dependency node is defined in the project source code, and a message component is introduced in the source code corresponding to the dependency node, so as to listen only to the dependency node, improve the targeting of listening messages, and reduce redundant listening data.

[0036] 3. Configure the message sender. Create a new instance of the dependency package message sender, i.e., `DefaultMQProducer producer = new DefaultMQProducer("dependency package message sender")`, and locate the dependency package message sending location by creating a `nameserver` object and specifying the destination using the IP address and port: `producer.setNamesrvAddr("Message center IP address: Message center service port")`. The dependency package message sender can be started using `producer.start()` to send dependency package upgrade messages to the message center.

[0037] For example, when the program starts, it obtains the latest dependency package information (including the current dependency package name and version information) after the upgrade of the project service (i.e., the current project service) through the message component introduced in the dependency node in the project source code. The obtained dependency package name and version information are converted into a protocol message format, such as {"depinfo":[{"name":"dependency package name 1","version":"dependency package 1 version"},{"name":"dependency package name 2","version":"dependency package 2 version"}]]}. Then, the dependency package version information converted into a protocol message object is converted into a byte type and placed into a message object, for example, Message message = new Message(protocol message object.getBytes()). Specifically, the dependency package message object can be sent through the send method (producer.send(message)).

[0038] Reference Figure 4 , Figure 4 This is a flowchart illustrating the third embodiment of the dependency package upgrade method based on message components of the present invention.

[0039] Based on the above Figure 1 In the illustrated embodiment, step S40 specifically includes: Step S41: Compare the dependency package name and version information of the current dependency package with the dependency package name and version information in the latest dependency package information; Step S42: When the name of the current dependency package matches the name of the latest dependency package, and the version information of the current dependency package matches the latest version information, it is determined that the current project service has completed the dependency package upgrade. Step S43: If the name of the current dependency package does not match the name of the latest dependency package, or if the version information of the current dependency package does not match the latest version information, it is determined that the current project service has not completed the dependency package upgrade.

[0040] Furthermore, before comparing the dependency package name and version information of the current dependency package with the dependency package name and version information in the latest dependency package information, the method further includes: Based on the dependency tree viewing command, obtain the dependency tree of the current project service, and obtain the dependency package name and version information of the current dependency package in the dependency tree.

[0041] For example, the dependency tree viewer command `mvn dependency:tree` can be used to view the dependency tree of the current project service, and the version information of each dependency of the current project service can be understood based on the dependency tree.

[0042] Furthermore, after verifying the current dependency packages of the current project service based on the latest dependency package information to determine whether the current project service has completed the dependency package upgrade, the process also includes... When the current project service completes the dependency package upgrade, traffic is imported to the current project service to enable the current project service; If the current project service has not completed the dependency package upgrade, traffic to the current project service will be redirected to disable the current project service.

[0043] Specifically, it determines whether the service has completed the upgrade of its dependent packages. If the service has completed the upgrade, it is enabled and traffic is introduced to the service. If the service has not completed the upgrade, it is disabled and traffic introduction to the service is restricted.

[0044] For example, the steps for implementing dependency package upgrades based on the messaging component provided in this application include: 1. To view the current dependency versions, use the dependency tree viewer command `mvn dependency:tree` to view the dependency tree of the current project service and understand the version information of each dependency of the current project service based on the dependency tree; 2. Find new version: Based on the aforementioned message component, find the latest version of the dependencies that need to be upgraded; 3. Test the new version: After upgrading the dependency package to the latest version, the project service needs to be fully tested (including unit tests, integration tests and system tests) to ensure that the latest version of the dependency does not introduce any compatibility issues or other problems.

[0045] 4. Update dependency package versions: After confirming that the latest version of the dependency package is working correctly based on the test results, update the pom.xml file in the corresponding configuration file of the project service, and modify the version of the dependency that needs to be upgraded to the latest version.

[0046] 5. Rebuild the project: After saving the changes in the pom.xml file, use the mvn clean install command to rebuild the project service to ensure that the project service is compiled and packaged using the latest version of the dependency packages.

[0047] 6. Verify the upgrade results: After completing the project service construction, run the testing and verification steps again to ensure that the functionality and performance of the project service are normal.

[0048] Through the above methods, this embodiment enables rapid acceptance testing of dependency package upgrades for project services. Specifically, by promptly updating dependency package upgrade messages, the acceptance testing of project dependency package upgrades can be completed as quickly as possible, improving the accuracy and efficiency of dependency package upgrade acceptance.

[0049] Please see Figure 5 , Figure 5 This application provides a schematic diagram of the functional modules of a dependency package upgrade device based on a message component.

[0050] like Figure 5 As shown, the message-based dependency package upgrade device 500 includes: The message listening module 510 is upgraded to configure a message listening service in the service center and listen for dependency package upgrade messages in the message center through the message listening service. The upgrade message acquisition module 520 is used to, upon listening to the dependency package upgrade message, obtain the service instance name, service IP, latest dependency package name and latest version information from the dependency package upgrade message based on a preset message format. The latest information acquisition module 530 is used to determine the current project service based on the service instance name and service IP, and to determine the latest dependency package information based on the latest dependency package name and latest version information; The dependency upgrade verification module 540 is used to verify the current dependency package of the current project service based on the latest dependency package information, so as to determine whether the current project service has completed the dependency package upgrade.

[0051] Furthermore, the message-based dependency package upgrade device 500 also includes: The message component adding module is used to add message components to the project source code of each project service, so as to listen for dependency package upgrade messages of each project service based on the message components. The dependency package upgrade monitoring module is used to obtain the service instance name and service IP of the current project service being upgraded, as well as the dependency package name and version information of the latest dependency package after the upgrade, based on the message component when the dependency package upgrade is detected by the message component. The upgrade message sending module is used to generate the dependency package upgrade message based on the service instance name and service IP of the current project service and the dependency package name and version information of the latest dependency package information, and send the dependency package upgrade message to the message center.

[0052] Furthermore, the message component adding module specifically includes: The configuration file retrieval unit is used to retrieve the project source code of each project service from the project source code repository gitlab based on the cloning command git clone, and to retrieve the project configuration file of each project source code. The message component import unit is used to determine the dependency nodes in the corresponding project source code based on the dependency configuration project in each project configuration file, and import the message component in the dependency nodes.

[0053] Furthermore, the upgrade message sending module specifically includes: The message sending object configuration unit is used to configure the message sending object; A message sending location unit is used to generate a message sending location based on the IP address and service port of the message center. An upgrade message sending unit is used to send the dependency package upgrade message to the message center based on the message sending object and the message sending location.

[0054] Furthermore, the dependency upgrade verification module 540 specifically includes: The dependency information comparison unit is used to compare the dependency package name and version information of the current dependency package with the dependency package name and version information in the latest dependency package information; The dependency upgrade determination unit is used to determine that the current project service has completed the dependency upgrade when the dependency package name of the current dependency package matches the latest dependency package name and the version information of the current dependency package matches the latest version information. The dependency upgrade determination unit is used to determine that the current project service has not completed the dependency upgrade when the dependency package name of the current dependency package does not match the latest dependency package name, or when the version information of the current dependency package does not match the latest version information.

[0055] Furthermore, the dependency upgrade verification module 540 is also used for: Based on the dependency tree viewing command, obtain the dependency tree of the current project service, and obtain the dependency package name and version information of the current dependency package in the dependency tree.

[0056] Furthermore, the message-based dependency package upgrade device 500 also includes: The project service activation module is used to import traffic to the current project service to enable the current project service when the dependency package upgrade is completed; The project service pause module is used to stop the traffic of the current project service and disable the current project service when the dependency package upgrade has not been completed.

[0057] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and modules can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0058] The aforementioned device can be implemented as a computer program, which can be used in, for example... Figure 6 It runs on the computer device shown.

[0059] Please see Figure 6 , Figure 6 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.

[0060] See Figure 6 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.

[0061] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any message-based dependency package upgrade method.

[0062] The processor provides computing and control capabilities, supporting the operation of the entire computer device.

[0063] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor, it enables the processor to perform any message-based dependency package upgrade method.

[0064] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 6The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0065] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.

[0066] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: Configure a message listening service in the service center, and use the message listening service to listen for dependency package upgrade messages in the message center; Upon detecting the dependency package upgrade message, based on a preset message format, the service instance name, service IP, latest dependency package name, and latest version information are obtained from the dependency package upgrade message. Based on the service instance name and service IP, determine the current project service, and based on the latest dependency package name and latest version information, determine the latest dependency package information; Based on the latest dependency package information, the current dependency packages of the current project service are verified to determine whether the current project service has completed the dependency package upgrade.

[0067] In one embodiment, in configuring a message listening service in the service center and listening for dependency package upgrade messages in the message center through the message listening service, the processor is configured to run a computer program stored in memory to perform the following steps: Add a message component to the source code of the project to which each project service belongs, so as to listen for the dependency package upgrade messages of each project service based on the message component; When a dependency package upgrade is detected based on the message component, the service instance name and service IP of the current project service being upgraded, as well as the dependency package name and version information of the latest dependency package after the upgrade, are obtained based on the message component. Based on the service instance name and service IP of the current project service, as well as the dependency package name and version information of the latest dependency package information, the dependency package upgrade message is generated and sent to the message center.

[0068] In one embodiment, regarding adding a message component to the project source code of the project to which each project service belongs, the processor is configured to run a computer program stored in memory to perform the following steps: The `git clone` command is used to retrieve the source code of each project service from the GitLab repository, and also retrieves the project configuration file for each project's source code. Based on the dependency configuration projects in each project configuration file, the dependency nodes are determined in the corresponding project source code, and the message component is introduced into the dependency nodes.

[0069] In one embodiment, in sending the dependency package upgrade message to the message center, the processor is configured to run a computer program stored in memory to perform the following steps: Configure the message sending object; The message sending location is generated based on the IP address and service port of the message center; Based on the message sending object and the message sending location, the dependency package upgrade message is sent to the message center.

[0070] In one embodiment, in verifying the current dependencies of the current project service based on the latest dependency package information to determine whether the current project service has completed the dependency package upgrade, the processor is configured to run a computer program stored in memory to perform the following steps: Compare the dependency package name and version information of the current dependency package with the dependency package name and version information in the latest dependency package information; When the name of the current dependency package matches the name of the latest dependency package, and the version information of the current dependency package matches the latest version information, it is determined that the current project service has completed the dependency package upgrade. If the name of the current dependency package does not match the name of the latest dependency package, or if the version information of the current dependency package does not match the latest version information, it is determined that the current project service has not completed the dependency package upgrade.

[0071] In one embodiment, in comparing the dependency package name and version information of the current dependency package with the dependency package name and version information in the latest dependency package information, the processor is configured to run a computer program stored in memory to perform the following steps: Based on the dependency tree viewing command, obtain the dependency tree of the current project service, and obtain the dependency package name and version information of the current dependency package in the dependency tree.

[0072] In one embodiment, in verifying the current dependencies of the current project service based on the latest dependency package information to determine whether the current project service has completed the dependency package upgrade, the processor is configured to run a computer program stored in memory to perform the following steps: When the current project service completes the dependency package upgrade, traffic is imported to the current project service to enable the current project service; If the current project service has not completed the dependency package upgrade, traffic to the current project service will be redirected to disable the current project service.

[0073] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the message component-based dependency package upgrade methods provided in the embodiments of this application.

[0074] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.

[0075] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for dependency package upgrade based on message component, characterized in that, The dependency package upgrading method comprises the following steps: configuring a message monitoring service in the service center, and monitoring a dependency package upgrading message of a message center through the message monitoring service; in the case of monitoring the dependency package upgrading message, obtaining a service instance name, a service IP, a latest dependency package name and latest version information in the dependency package upgrading message based on a preset message format; determining a current project service based on the service instance name and the service IP, and determining latest dependency package information based on the latest dependency package name and the latest version information; verifying a current dependency package of the current project service based on the latest dependency package information to determine whether the current project service completes dependency package upgrading.

2. The message-component-based dependency package upgrade method of claim 1, wherein, Before the step of configuring a message monitoring service in the service center, and monitoring a dependency package upgrading message of a message center through the message monitoring service, the method further comprises the following steps: adding a message component in project source code of each project service to monitor a dependency package upgrading message of each project service based on the message component; when monitoring dependency package upgrading based on the message component, obtaining a service instance name and a service IP of the current project service to be upgraded, and dependency package name and version information of the latest dependency package information after upgrading based on the message component; generating the dependency package upgrading message based on the service instance name and the service IP of the current project service and the dependency package name and version information of the latest dependency package information, and sending the dependency package upgrading message to the message center.

3. The message-component-based dependency package upgrade method of claim 2, wherein, The step of adding a message component in project source code of each project service comprises the following steps: obtaining project source code of each project service from a project source code warehouse gitlab based on a clone command git clone, and obtaining a project configuration file of each project source code; Based on the dependency configuration in each project's configuration file, the dependencies are determined in the corresponding project's source code. The step of sending the dependency package upgrading message to the message center comprises the following steps: The node, and the message component is introduced in the dependent node.

4. The message-component-based dependency package upgrade method of claim 2, wherein, configuring a message sending object; generating a message sending position based on an IP address and a service port of the message center; sending the dependency package upgrading message to the message center based on the message sending object and the message sending position. The step of verifying a current dependency package of the current project service based on the latest dependency package information to determine whether the current project service completes dependency package upgrading comprises the following steps:

5. The message-component-based dependency package upgrade method of claim 1, wherein, comparing dependency package name and version information of the current dependency package with dependency package name and version information in the latest dependency package information; when the dependency package name of the current dependency package matches the latest dependency package name, and the version information of the current dependency package matches the latest version information, determining that the current project service completes dependency package upgrading; when the dependency package name of the current dependency package does not match the latest dependency package name, or the version information of the current dependency package does not match the latest version information, determining that the current project service does not complete dependency package upgrading. ​ 6. The message-component-based dependency package upgrade method of claim 1, wherein, Before the comparing the dependency package name and the version information of the current dependency package with the dependency package name and the version information in the latest dependency package information, the method further comprises: Based on the dependency tree viewing command, the dependency tree of the current project service is acquired, and the dependency package name and the version information of the current dependency package are acquired in the dependency tree.

7. The message-component-based dependency package upgrade method according to any one of claims 1 to 6, wherein, The method further comprises: When the current project service completes the dependency package upgrade, the traffic of the current project service is imported to enable the current project service; When the current project service does not complete the dependency package upgrade, the traffic of the current project service is exported to disable the current project service.

8. A message component based dependency package upgrade apparatus, comprising: The dependency package upgrade device based on a message component comprises: An upgrade message listening module is configured to configure a message listening service in a service center and listen to a dependency package upgrade message of a message center through the message listening service; An upgrade message acquisition module is configured to acquire a service instance name, a service IP, a latest dependency package name and latest version information in the dependency package upgrade message based on a preset message format when the dependency package upgrade message is listened to; A latest information acquisition module is configured to determine a current project service based on the service instance name and the service IP and determine latest dependency package information based on the latest dependency package name and the latest version information; A dependency upgrade verification module is configured to verify a current dependency package of the current project service based on the latest dependency package information to determine whether the current project service completes the dependency package upgrade.

9. A computer device, comprising: The computer device comprises a processor, a memory and a dependency package upgrade program based on a message component stored in the memory and executable by the processor, wherein the dependency package upgrade program based on the message component is executed by the processor to implement the steps of the dependency package upgrade method based on the message component in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores the dependency package upgrade program based on the message component, wherein the dependency package upgrade program based on the message component is executed by the processor to implement the steps of the dependency package upgrade method based on the message component in any one of claims 1 to 7.