CN110597531B - Distributed module upgrading method and device and storage medium - Google Patents

Distributed module upgrading method and device and storage medium Download PDF

Info

Publication number
CN110597531B
CN110597531B CN201910716847.2A CN201910716847A CN110597531B CN 110597531 B CN110597531 B CN 110597531B CN 201910716847 A CN201910716847 A CN 201910716847A CN 110597531 B CN110597531 B CN 110597531B
Authority
CN
China
Prior art keywords
upgrading
node
jar package
test
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910716847.2A
Other languages
Chinese (zh)
Other versions
CN110597531A (en
Inventor
郭巧佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910716847.2A priority Critical patent/CN110597531B/en
Priority to PCT/CN2019/117808 priority patent/WO2021022713A1/en
Publication of CN110597531A publication Critical patent/CN110597531A/en
Application granted granted Critical
Publication of CN110597531B publication Critical patent/CN110597531B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention relates to a cloud technology, and provides a distributed module upgrading method, a distributed module upgrading device and a storage medium, wherein the method comprises the following steps: decoupling a basic function module corresponding to the target function module from the system according to the function classification; deploying a target function module on a preset node, and establishing communication between the target function module and a host; the method comprises the steps that a host computer receives an upgrading request aiming at a certain target function module, and the host computer tests an upgrading JAR package according to a preset test rule so as to test the upgrading JAR package; the host selects the optimal upgrading node of the target function module from all the nodes according to the operation parameters and the test results of all the nodes; and the host sends a JAR package replacement request to the optimal upgrading node, and the optimal upgrading node downloads the upgrading JAR package to finish upgrading. Because the coupling degree of the decoupled basic function module and other function modules is low, the upgrading of the target function module initiated by the invention does not have larger influence on other function modules.

Description

Distributed module upgrading method and device and storage medium
Technical Field
The present invention relates to cloud technologies, and in particular, to a distributed module upgrading method, apparatus, and storage medium.
Background
At present, for a public function of an item, for example, a portable terminal has a plurality of public functions such as airline reservation and hotel reservation, each public function is usually imported by using a jar package and is internally called, so as to execute the function. However, this solution is inconvenient for upgrading, and if there is a new function access (upgrade), the version needs to be released periodically, the time period is long, and the service intrusiveness is strong. In addition, a micro service can be adopted to decompose one project into a plurality of services, and the micro service form has two schemes of single-host single service and single-host multi-service, wherein the single-host single service causes bottleneck or resource waste, the single-host multi-service causes too many services to be difficult to manage, and for the micro service mode, each separated service is respectively registered in registration centers such as Eureka or Zeekeeper, and the service upgrading is not complete enough.
Disclosure of Invention
In order to solve the above technical problems, the present invention provides a distributed module upgrading method, applied to an electronic device, including:
A. decoupling basic function modules corresponding to the target function modules from the system according to the function classification, and setting communication parameters of the target function modules and the host, wherein the decoupling process of the target function modules comprises the steps of setting communication interfaces of the basic function modules according to a preset data communication rule, and the target function modules are communicated through the communication interfaces of the basic function modules;
B. deploying the basic function module on a preset node, and enabling each node to establish communication between the node and the host through the communication parameters of the target function module;
C. the method comprises the steps that a host computer receives an upgrading request aiming at a certain target function module, the host computer tests an upgrading JAR package according to a preset test rule, wherein the upgrading request comprises an upgrading JAR package of the target function module and parameter information of the upgrading JAR package, and the parameter information of the upgrading JAR package comprises a version parameter of the JAR package;
D. the host selects the optimal upgrade node of the target function module from all nodes according to the real-time operation parameters, the historical operation parameters and the test results of all the nodes;
E. the method comprises the steps that a host sends a JAR package replacement request aiming at a target function module to an optimal upgrading node, wherein the JAR package replacement request comprises a version number of an upgrading JAR package and a downloading path of the upgrading JAR package;
F. and the optimal upgrading node downloads the upgrading JAR package according to the downloading path, replaces the old JAR package of the target function module and finishes upgrading the target function module.
The invention also provides a distributed module upgrading device, comprising:
the decoupling module is used for decoupling a plurality of basic function modules corresponding to the target function modules from the system according to the function classification, wherein the decoupling process of the target function modules comprises the steps of setting communication interfaces of the basic function modules according to a preset data communication rule, and the basic function modules are communicated with one another through the communication interfaces;
the node deployment module is used for deploying the basic function module on a preset node and enabling each node to establish communication between the node and the host through the communication parameters of the target function module;
the test module is used for testing the upgrade JAR package according to a preset test rule after the host computer receives an upgrade request aiming at a certain target function module so as to test the upgrade JAR package;
the optimal upgrading node determining module is used for enabling the host to select the optimal upgrading node of the target function module from all the nodes according to the real-time operation parameters, the historical operation parameters and the test results of all the nodes;
and the upgrading module is used for enabling the host to send a JAR package replacing request aiming at the target function module to the optimal upgrading node, wherein the JAR package replacing request comprises the version number of the upgrading JAR package and the downloading path of the upgrading JAR package, and the optimal upgrading node downloads the upgrading JAR package according to the downloading path and replaces the old JAR package of the target function module to finish upgrading the target function module.
The present invention also provides an electronic device, comprising: a memory and a processor, the memory having stored therein a distributed module upgrade program that, when executed by the processor, performs the steps of:
A. decoupling basic function modules corresponding to the target function modules from the system according to the function classification, and setting communication parameters of the target function modules and the host, wherein the decoupling process of the target function modules comprises the steps of setting communication interfaces of the basic function modules according to a preset data communication rule, and the target function modules are communicated through the communication interfaces of the basic function modules;
B. deploying the basic function module on a preset node, and enabling each node to establish communication between the node and the host through the communication parameters of the target function module;
C. the method comprises the steps that a host computer receives an upgrading request aiming at a certain target function module, and the host computer tests an upgrading JAR package according to a preset test rule, wherein the upgrading request comprises an upgrading JAR package of the target function module and parameter information of the upgrading JAR package, and the parameter information of the upgrading JAR package comprises version parameters of the JAR package;
D. the host selects the optimal upgrade node of the target function module from all the nodes according to the real-time operation parameters, the historical operation parameters and the test results of all the nodes;
E. the host sends a JAR package replacement request aiming at the target function module to the optimal upgrading node, wherein the JAR package replacement request comprises a version number of the upgrading JAR package and a downloading path of the upgrading JAR package;
F. and the optimal upgrading node downloads the upgrading JAR package according to the downloading path, replaces the old JAR package of the target function module and finishes upgrading the target function module.
The present invention also provides a computer readable storage medium storing a computer program comprising program instructions which, when executed by a processor, implement the distributed module upgrade method as described above.
In the invention, the basic function module is decoupled from the system and deployed on the appointed node, and because the coupling degree of the decoupled basic function module and other function modules is low, the upgrading of the target function module is initiated by the method and the system, so that no larger influence is generated on other function modules, and meanwhile, the settable number of the node is more than the allowable number of the registration modules of the Zeekeeper registration center in the micro-service-based framework, so that the registration bottleneck problem of the Zeekeeper registration center can be avoided.
Drawings
The above features and technical advantages of the present invention will become more apparent and readily appreciated from the following description of the embodiments thereof taken in conjunction with the accompanying drawings.
FIG. 1 is a flow chart illustrating a distributed module upgrade method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating the relationship of basic functional modules and nodes in accordance with an embodiment of the present invention;
fig. 3 is a program module diagram showing a distributed module upgrade procedure according to an embodiment of the present invention.
Detailed Description
Embodiments of a distributed module upgrade method, apparatus, and storage medium according to the present invention will be described below with reference to the accompanying drawings. Those of ordinary skill in the art will recognize that the described embodiments can be modified in various different ways, or combinations thereof, without departing from the spirit and scope of the invention. Accordingly, the drawings and description are illustrative in nature and not intended to limit the scope of the claims. Furthermore, in the present description, the drawings are not to scale and like reference numerals refer to like parts.
Fig. 1 is a flowchart illustrating a distributed module upgrading method in this embodiment, and fig. 2 is a schematic diagram illustrating a relationship between a basic function module and a node in this embodiment. The following describes the distributed module upgrading method of the present embodiment with reference to fig. 1 and fig. 2, including the following steps:
A. and decoupling a plurality of basic function modules corresponding to the target function modules from the system according to preset function classification, and setting communication parameters of the target function modules and the host, wherein the decoupling process of the target function modules comprises the steps of setting communication interfaces of the basic function modules according to preset data communication rules, and the basic function modules are communicated through the communication interfaces.
The target function module refers to a module with one or more functions included in the system, and one target function module may include a plurality of basic function modules, each of which has a communication interface. For example, the travel-carrying APP comprises a plurality of target function modules such as hotel reservation, air ticket reservation, travel customization and the like, wherein the air ticket reservation module is divided into a plurality of basic function modules according to the node number, and the basic function modules are communicated through the communication interface.
B. And deploying the target function module on a plurality of preset nodes through the basic function module, and enabling each node to establish communication between the node and the host through the communication parameters of the target function module. Specifically, a basic function module is deployed corresponding to each node. The node refers to an end point of a network connection, and the node may be a processor, a controller or a workstation. Nodes are different from one another according to their functions, and may be interconnected together by links to serve as control points in the network. For example, the basic function modules of the air ticket booking module are all arranged on different nodes respectively.
C. When the host receives an upgrade request aiming at a certain target function module, the host tests an upgrade JAR package according to a preset test rule so as to test the upgrade JAR package, wherein the upgrade request comprises the upgrade JAR package of the target function module and the parameter information of the upgrade JAR package, and the parameter information of the upgrade JAR package comprises the version parameter of the JAR package. The upgrading request received by the host computer may further include deployment information for upgrading the JAR package, where the deployment information may include supportable system information, an encoding rule of the JAR, and an identifier of a JAR package dependent component.
Preferably, the host calls the upgrade JAR package using the Hadoop Test class and tests the upgrade JAR package using the TestDFSIO class. The TestDFSIO class comprises a TestDFSIO write subclass and a TestDFSIO read subclass, and the TestDFSIO class concurrently executes read-write upgrade JAR packages through mapReduce operation, wherein the mapReduce operation comprises at least one map task, and the map is used for reading or writing each file in the upgrade JAR packages and outputting execution information generated by reading or writing each file; therefore, the execution information can be counted and the IO (input and output) performance test result of the upgrading JAR package can be output.
D. The host selects the optimal upgrade node of the target function module from all the nodes according to the real-time operation parameters, the historical operation parameters and the test results of all the nodes;
E. the host sends a JAR package replacement request aiming at the target function module to the optimal upgrading node, wherein the JAR package replacement request comprises a version number of the upgrading JAR package and a downloading path of the upgrading JAR package;
F. and the optimal upgrading node downloads the upgrading JAR package according to the downloading path, replaces the old JAR package of the target function module, and completes upgrading of the target function module, and preferably, the host also generates an updating prompt of the target function module.
For example, a plurality of functional modules of the ticket booking module of the portable APP are respectively arranged on different nodes, and the ticket booking module communicates with the host. The air ticket booking module, the hotel booking module and the travel customizing module are communicated with the host. When the air ticket booking module is to be upgraded, the host computer firstly tests the upgrade JAR package, then selects an optimal node from all nodes according to the real-time operation parameters, the historical operation parameters and the test results of the nodes corresponding to the basic function modules, and carries out the operation of upgrading the JAR package, thereby completing the upgrade of the air ticket booking module.
In an optional implementation, when the host receives the upgrade request, the step of testing the upgrade JAR package by the host according to the preset test rule includes:
placing the upgraded JAR into a virtual test environment for testing, wherein the virtual test environment comprises a plurality of test instructions, and the plurality of test instructions at least comprise a trial loading test instruction, a version test instruction, an unloading test instruction and a plurality of function test instructions;
and the virtual test environment sequentially tests the upgrading JAR package according to the sequence of the trial loading test, the version test, the unloading test and the function test.
Further, the process of executing the test loading test by the virtual test environment comprises the following steps:
calling a real-time test case to run an upgrade JAR package and acquiring real-time state information of a CPU (central processing unit) of a host and real-time occupation information of a memory in real time, specifically, testing and upgrading a node load of the JAR package by using an nnbench type, wherein the nnbench type can repeatedly execute the real-time test case for multiple times and is used for checking whether the operation of the upgrade JAR package on the node is repeatable and whether the operation is efficient;
and judging whether the JAR package can cause overload of a certain node according to the real-time state information of the CPU and the real-time occupation information of the memory, if so, stopping testing and outputting a test report, and if not, triggering a version test program.
More specifically, the specific determination process of determining whether the upgrade JAR packet may cause an overload to occur in a certain node according to the real-time status information of the CPU and the real-time occupancy information of the memory may be: and sequentially judging whether the load rate of the CPU is greater than a preset load threshold value or not and whether the usage of the memory is greater than a preset usage threshold value or not, and if the results of the two judgments are yes, determining that the upgrading JAR packet can cause overload of a certain node.
It should be noted that the preset load threshold and the preset usage threshold are set by a technician according to the CPU performance parameters and the memory parameters of all the nodes managed by the host, and are also stored in the host in advance. Preferably, the preset load threshold and the preset usage threshold are stored in a configuration file in an xml format, and when the virtual test environment in the host needs to use the preset load threshold and the preset usage threshold, the configuration file is parsed by an xml file parser and the preset load threshold and the preset usage threshold are obtained from the configuration file.
Further, the step of version testing comprises: judging whether the version number of the JAR packet meets the iteration rule of the preset version number, if so, executing the safety test of the version, otherwise, stopping the test,
the safety testing step of the version comprises the following steps: and acquiring the encryption authentication key of the upgrade JAR from the parameter information of the upgrade JAR package, analyzing the encryption authentication key according to an encryption rule, and finally judging whether the upgrade JAR package has safety according to the analysis result of the encryption authentication key, namely determining that the upgrade JAR package has safety if the encryption authentication key can be analyzed correctly.
Further, the process of unloading the test is as follows: unloading the upgrading JAR package and storing the operation data of the upgrading JAR package; and the receiver reads the original operation data, compares the operation data of the upgrade JAR package with the original operation data, judges whether the numerical values of the specified data items are consistent, and if so, determines that the operation of the default JAR package cannot be influenced when the upgrade JAR package meets the compatibility requirement, namely the upgrade JAR is uninstalled.
Further, the functional test may comprise the steps of: calling a test case execution function and acquiring an execution result; and then, comparing the execution result with a value range corresponding to the function name, and if the execution result is not in the value range, determining that the functional function test fails. It should be noted that there are multiple test cases in the virtual environment, and each test case corresponds to a different function. And, if a function involves external data being obtained through the interface, the virtual environment obtains the external data from the test interface, wherein the test interface includes part or all of the external data required for the test.
In an alternative implementation, the step of the host determining the optimal upgrade node for the target functional module includes:
extracting environment dependent data of the upgrading JAR package from a test result of the upgrading JAR package, wherein the environment dependent data at least comprises node load data, node interface data and node operating system data;
screening out a plurality of nodes with loads meeting the operation requirement of the upgrading JAR package from the plurality of nodes according to the node load data to serve as standby nodes;
and comparing the node interface data and the operating system parameters of each standby node with the node interface requirements and the node operating system requirements of the upgrading JAR package, thereby determining the optimal upgrading node meeting the requirements of upgrading the JAR package.
It should be noted that, in the step of selecting the optimal upgrade node of the target function module from the plurality of nodes by the host according to the real-time operation parameters, the historical operation parameters, and the test results of each node, the node with the smallest current load can be found from the plurality of upgrade nodes to upgrade the JAR package, so that the load utilization rate of each node can be improved, and the influence of upgrading the JAR package on the current use of the user can be reduced.
In the invention, the functions of each upgrading JAR package are usually different, and further, the dependence degree of each upgrading JAR package on a data interface is different, namely, the data interaction between some upgrading JAR packages and other function modules is less, and the data interaction between some upgrading JAR packages and other function modules is more. In the prior art, a data interface is usually deployed at each node, and then a node is randomly selected from an upgrade JAR package, which causes waste of node resources, and since network resources corresponding to nodes in each area are different, the upgrade JAR package may be deployed at nodes where network resources are different, which further causes problems that the upgrade JAR package responds to an operation instruction of a user slowly when the upgrade JAR package is actually operated.
In an optional implementation, when the host determines that there is no optimal node, the host receives a node addition request, where the node addition request includes the number of nodes to be added, the operating system type of the node, and an environmental parameter of the node;
the host machine uses the virtual machines and creates the virtual machines according to the increased number of the nodes;
the host sets an operating system of the virtual machine according to the operating system type of the node;
and the host sets deployment parameters of the virtual machine according to the environment parameters of the nodes.
In an alternative implementation, in order to further reduce the modification of the target functional module without affecting other functional modules, the method of the present invention may further include the following operation steps:
creating a project manager in the host, wherein the project manager is used for managing the shared basic function module;
when the host receives the upgrade request, the host modifies a version number of the target function module stored in the project manager.
The invention also provides a distributed module upgrading device, which comprises a decoupling module 501, a node deployment module 502, a test module 503, an optimal upgrading node determination module 504 and an upgrading module 505.
The decoupling module 501 is configured to decouple a plurality of basic function modules corresponding to each target function module from the system according to the function classification, where the decoupling process of the target function modules includes setting communication interfaces of the basic function modules according to a preset data communication rule, and the basic function modules communicate with each other through the communication interfaces;
the node deployment module 502 is configured to deploy a basic function module on a preset node, and enable each node to establish communication between the node and the host through the communication parameters of the target function module;
the test module 503 is configured to test the upgrade JAR package according to a preset test rule after the host receives an upgrade request for a certain target function module, so as to test the upgrade JAR package;
the optimal upgrade node determination module 504 is configured to enable the host to select an optimal upgrade node of the target function module from all nodes according to the real-time operation parameters, the historical operation parameters, and the test results of each node;
the upgrade module 505 is configured to enable the host to send a JAR package replacement request for the target function module to the optimal upgrade node, where the JAR package replacement request includes a version number of the upgrade JAR package and a download path of the upgrade JAR package, and the optimal upgrade node downloads the upgrade JAR package according to the download path and replaces an old JAR package of the target function module, thereby completing upgrading of the target function module.
In addition, the invention also provides an electronic device, and fig. 2 shows a hardware architecture of the electronic device. In this embodiment, the electronic device 2 is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction. For example, the server may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a cabinet server (including an independent server or a server cluster composed of multiple servers). As shown in fig. 3, the electronic device 2 includes at least a memory 21 and a processor 22, which are communicatively connected to each other through a system bus. Wherein: the memory 21 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 21 may be an internal storage unit of the electronic device 2, such as a hard disk or a memory of the electronic device 2. In other embodiments, the memory 21 may also be an external storage device of the electronic apparatus 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the electronic apparatus 2. Of course, the memory 21 may also comprise both an internal memory unit of the electronic apparatus 2 and an external memory device thereof. In this embodiment, the memory 21 is generally used for storing an operating system and various application software installed in the electronic device 2, such as the distributed module upgrading program code. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is generally configured to control the overall operation of the electronic apparatus 2, such as performing data interaction or communication related control and processing with the electronic apparatus 2. In this embodiment, the processor 22 is configured to run the program codes stored in the memory 21 or process data, for example, run the distributed module upgrading program.
It is noted that fig. 2 only shows the electronic device 2 with components 21-22, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead.
The memory 21 containing the readable storage medium may include an operating system, a distributed module upgrade program 50, and the like. The steps described above for the distributed module upgrade method are implemented when processor 22 executes distributed module upgrade program 50 in memory 21. In this embodiment, the distributed module upgrading program stored in the memory 21 may be divided into one or more program modules, and the one or more program modules are stored in the memory 21 and executed by one or more processors (in this embodiment, the processor 22) to complete the present invention. For example, fig. 3 shows a program module schematic diagram of the distributed module upgrading program, and in this embodiment, the distributed module upgrading program 50 may be divided into a decoupling module 501, a node deployment module 502, a test module 503, an optimal upgrade node determination module 504, and an upgrade module 505. The program module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than a program for describing the execution process of the distributed module upgrading program in the electronic device 2. The following description will specifically describe specific functions of the program modules.
The decoupling module 501 is configured to decouple a plurality of basic function modules corresponding to the target function module from the system according to a preset function classification, and set a communication parameter between the target function module and the host. The decoupling process of the target function module comprises the steps of setting communication interfaces of the basic function modules according to preset data communication rules, and communicating the basic function modules through the communication interfaces.
The node deployment module 502 is configured to deploy the target function module on a plurality of preset nodes through the basic function module, and enable each node to establish communication between the target function module and the host through the communication parameters of the target function module.
The test module 503 is configured to enable the host to test the upgrade JAR package according to a preset test rule, so as to test the upgrade JAR package.
The optimal upgrade node determination module 504 is configured to enable the host to select an optimal upgrade node of the target function module from all nodes according to the real-time operation parameters, the historical operation parameters, and the test results of each node.
The upgrade module 505 is configured to enable the host to send a JAR package replacement request for the target function module to the optimal upgrade node, where the optimal upgrade node downloads the upgrade JAR package according to the download path and replaces the old JAR package of the target function module, thereby completing the upgrade of the target function module.
Furthermore, the embodiment of the present invention also provides a computer-readable storage medium, which may be any one or any combination of a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a portable compact disc read only memory (CD-ROM), a USB memory, and the like. Among other things, the computer-readable storage medium includes a distributed module upgrade program 50, which when executed by the processor 22, performs the following:
A. decoupling a plurality of basic function modules corresponding to the target function module from the system according to preset function classification, and setting communication parameters of the target function module and the host, wherein the decoupling process of the target function module comprises the steps of setting communication interfaces of the basic function modules according to preset data communication rules, and the basic function modules are communicated through the communication interfaces.
B. The target function module is deployed on a plurality of preset nodes through the basic function module, and each node establishes communication between the target function module and the host through the communication parameters of the target function module. Specifically, a basic function module is deployed corresponding to each node.
C. When the host receives an upgrading request aiming at a certain target function module, the host tests the upgrading JAR package according to a preset test rule so as to test the upgrading JAR package.
D. The host selects the optimal upgrade node of the target function module from all the nodes according to the real-time operation parameters, the historical operation parameters and the test results of all the nodes;
E. the host sends a JAR package replacement request aiming at the target function module to the optimal upgrading node, wherein the JAR package replacement request comprises a version number of the upgrading JAR package and a downloading path of the upgrading JAR package;
F. and the optimal upgrading node downloads the upgrading JAR package according to the downloading path, replaces the old JAR package of the target function module and finishes upgrading the target function module.
The embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiment of the distributed module upgrading method and the electronic device 2, and will not be described herein again.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A distributed module upgrading method is applied to an electronic device and is characterized by comprising the following steps:
A. decoupling basic function modules corresponding to the target function modules from the system according to the function classification, and setting communication parameters of the target function modules and the host, wherein the decoupling process of the target function modules comprises the steps of setting communication interfaces of the basic function modules according to a preset data communication rule, and the target function modules are communicated through the communication interfaces of the basic function modules;
B. deploying the basic function module on a preset node, and enabling each node to establish communication between the node and the host through the communication parameters of the target function module;
C. the method comprises the steps that a host computer receives an upgrading request aiming at a certain target function module, and the host computer tests an upgrading JAR package according to a preset test rule, wherein the upgrading request comprises the upgrading JAR package of the target function module and parameter information of the upgrading JAR package, and the parameter information of the upgrading JAR package comprises version parameters of the JAR package;
D. the host selects the optimal upgrade node of the target function module from all the nodes according to the real-time operation parameters, the historical operation parameters and the test results of all the nodes;
E. the host sends a JAR package replacement request aiming at the target function module to the optimal upgrading node, wherein the JAR package replacement request comprises a version number of the upgrading JAR package and a downloading path of the upgrading JAR package;
F. and the optimal upgrading node downloads the upgrading JAR package according to the downloading path and replaces the old JAR package of the target function module to finish upgrading the target function module.
2. The distributed module upgrading method according to claim 1, wherein when the host receives the upgrading request, the step of testing the upgrading JAR package by the host according to the preset test rule includes:
placing the upgrading JAR package into a virtual test environment for testing, wherein the virtual test environment comprises a plurality of test instructions, and the plurality of test instructions at least comprise a trial loading test instruction, a version test instruction, an unloading test instruction and a plurality of function test instructions;
and the virtual test environment sequentially tests the upgrading JAR package according to the sequence of the trial loading test, the version test, the unloading test and the function test.
3. The distributed module upgrade method according to claim 2, wherein the process of the virtual test environment performing the test loading test comprises:
calling a real-time test case operation upgrade JAR packet and acquiring real-time state information of a CPU (central processing unit) of a host and real-time device information of a memory in real time;
judging whether the JAR package can cause overload of a certain node according to the real-time state information of the CPU and the real-time device information of the memory, if so, stopping testing and outputting a test report, and if not, triggering a version test program;
the step of version testing comprises: judging whether the version number of the JAR packet meets the iteration rule of the preset version number, if so, executing the safety test of the version, otherwise, stopping the test,
the safety testing step of the version comprises the following steps: acquiring an encryption authentication key of the upgrade JAR from the parameter information of the upgrade JAR package, analyzing the encryption authentication key according to an encryption rule, and finally judging whether the upgrade JAR package has safety according to the analysis result of the encryption authentication key, namely determining that the upgrade JAR package has safety if the encryption authentication key can be analyzed correctly;
the process of the unloading test is as follows: unloading the upgrading JAR package and storing the operation data of the upgrading JAR package; the receiver reads the original operation data, compares the operation data of the upgrade JAR package with the original operation data and judges whether the numerical values of the designated data items are consistent, if so, the upgrade JAR package is determined not to influence the operation of the default version JAR package when meeting the compatibility requirement, namely, the upgrade JAR package is unloaded;
the functional test comprises the following steps: calling a test case execution function and acquiring an execution result; and then, comparing the execution result with a value range corresponding to the function name, and if the execution result is not in the value range, determining that the functional function test fails.
4. The distributed module upgrading method according to claim 3, wherein, in the process of executing the trial loading test, the judgment process of judging whether the upgrading JAR packet can cause overload of a certain node according to the real-time state information of the CPU and the real-time occupation information of the memory is as follows: and sequentially judging whether the load rate of the CPU is greater than a preset load threshold value or not and whether the usage of the memory is greater than a preset usage threshold value or not, and if the results of the two judgments are yes, determining that the upgrading JAR packet can cause overload of a certain node.
5. The distributed module upgrading method according to claim 3, wherein during the test loading test, the nnbench class is used to call the real-time test case to test the node load of the upgrade JAR package.
6. The distributed module upgrade method according to claim 1, wherein the step of the host computer determining an optimal upgrade node for the target functional module comprises:
extracting environment dependent data of the upgrading JAR package from a test result of the upgrading JAR package, wherein the environment dependent data at least comprises node load data, node interface data and node operating system data;
screening out a plurality of nodes with loads meeting the operation requirement of the upgrading JAR package from the plurality of nodes according to the node load data to serve as standby nodes;
and comparing the node interface data and the operating system parameters of each standby node with the node interface requirements and the node operating system requirements of the upgrading JAR package, thereby determining the optimal upgrading node meeting the requirements of upgrading the JAR package.
7. The distributed module upgrading method according to claim 1, wherein when the host determines that there is no optimal node, the host receives a node addition request, wherein the node addition request includes a node addition number, an operating system type of the node, and an environmental parameter of the node;
the host machine uses the virtual machines and creates the virtual machines according to the increased number of the nodes;
the host sets an operating system of the virtual machine according to the operating system type of the node;
and the host sets deployment parameters of the virtual machine according to the environment parameters of the nodes.
8. A distributed module upgrade apparatus, comprising:
the decoupling module is used for decoupling a plurality of basic function modules corresponding to the target function modules from the system according to the function classification, wherein the decoupling process of the target function modules comprises the steps of setting communication interfaces of the basic function modules according to a preset data communication rule, and the basic function modules are communicated with one another through the communication interfaces;
the node deployment module is used for deploying the basic function module on a preset node and enabling each node to establish communication between the node and the host through the communication parameters of the target function module;
the test module is used for testing the upgrade JAR package according to a preset test rule after the host computer receives an upgrade request aiming at a certain target function module so as to test the upgrade JAR package;
the optimal upgrading node determining module is used for enabling the host to select the optimal upgrading node of the target function module from all the nodes according to the real-time operation parameters, the historical operation parameters and the test results of all the nodes;
and the upgrading module is used for enabling the host to send a JAR package replacing request aiming at the target function module to the optimal upgrading node, wherein the JAR package replacing request comprises the version number of the upgrading JAR package and the downloading path of the upgrading JAR package, and the optimal upgrading node downloads the upgrading JAR package according to the downloading path and replaces the old JAR package of the target function module to finish upgrading the target function module.
9. An electronic device, comprising: a memory and a processor, the memory having stored therein a distributed module upgrade program that, when executed by the processor, performs the steps of:
A. decoupling basic function modules corresponding to the target function modules from the system according to the function classification, and setting communication parameters of the target function modules and the host, wherein the decoupling process of the target function modules comprises the steps of setting communication interfaces of the basic function modules according to preset data communication rules, and the target function modules are communicated through the communication interfaces of the basic function modules;
B. deploying the basic function module on a preset node, and enabling each node to establish communication between the node and the host through the communication parameters of the target function module;
C. the method comprises the steps that a host computer receives an upgrading request aiming at a certain target function module, and the host computer tests an upgrading JAR package according to a preset test rule, wherein the upgrading request comprises an upgrading JAR package of the target function module and parameter information of the upgrading JAR package, and the parameter information of the upgrading JAR package comprises version parameters of the JAR package;
D. the host selects the optimal upgrade node of the target function module from all the nodes according to the real-time operation parameters, the historical operation parameters and the test results of all the nodes;
E. the host sends a JAR package replacement request aiming at the target function module to the optimal upgrading node, wherein the JAR package replacement request comprises a version number of the upgrading JAR package and a downloading path of the upgrading JAR package;
F. and the optimal upgrading node downloads the upgrading JAR package according to the downloading path and replaces the old JAR package of the target function module to finish upgrading the target function module.
10. A computer-readable storage medium, characterized in that it stores a computer program comprising program instructions which, when executed by a processor, implement the distributed module upgrade method according to any one of claims 1 to 7.
CN201910716847.2A 2019-08-05 2019-08-05 Distributed module upgrading method and device and storage medium Active CN110597531B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910716847.2A CN110597531B (en) 2019-08-05 2019-08-05 Distributed module upgrading method and device and storage medium
PCT/CN2019/117808 WO2021022713A1 (en) 2019-08-05 2019-11-13 Distributed module update method, device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910716847.2A CN110597531B (en) 2019-08-05 2019-08-05 Distributed module upgrading method and device and storage medium

Publications (2)

Publication Number Publication Date
CN110597531A CN110597531A (en) 2019-12-20
CN110597531B true CN110597531B (en) 2022-11-08

Family

ID=68853626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910716847.2A Active CN110597531B (en) 2019-08-05 2019-08-05 Distributed module upgrading method and device and storage medium

Country Status (2)

Country Link
CN (1) CN110597531B (en)
WO (1) WO2021022713A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240715A (en) * 2019-12-31 2020-06-05 兰剑智能科技股份有限公司 Device upgrading method and device, electronic device and computer readable medium
US11334459B2 (en) * 2020-08-18 2022-05-17 Advantest Corporation Flexible test systems and methods
CN112527634B (en) * 2020-11-25 2023-06-02 中国联合网络通信集团有限公司 Program division method and device, software testing method and platform
CN113885913B (en) * 2021-09-30 2022-07-29 珠海虎江科技有限公司 Upgrading method of virtual reality display equipment, computer device and computer readable storage medium
CN114422994A (en) * 2022-03-29 2022-04-29 龙旗电子(惠州)有限公司 Firmware upgrading method and device, electronic equipment and storage medium
CN115658116B (en) * 2022-11-11 2023-03-28 苏州浪潮智能科技有限公司 Storage cluster upgrade control method, device, equipment and storage medium
CN116149707B (en) * 2023-02-22 2023-09-01 北京志凌海纳科技有限公司 Method and device for detecting and avoiding upgrading risk of distributed system
CN116501359B (en) * 2023-06-29 2023-09-15 深圳和润达科技有限公司 Method, device, system and medium for carrying out self-adaptive remote upgrading on equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201607A (en) * 2016-07-04 2016-12-07 乐视控股(北京)有限公司 The upgrade method of a kind of software version and equipment
CN108667641A (en) * 2017-03-30 2018-10-16 杭州海康威视数字技术股份有限公司 Distributed system upgrade method, distributed system and updating and management equipment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040030768A1 (en) * 1999-05-25 2004-02-12 Suban Krishnamoorthy Unified system and method for downloading code to heterogeneous devices in distributed storage area networks
US10754494B2 (en) * 2015-06-23 2020-08-25 Dell Products, L.P. Method and control system providing one-click commissioning and push updates to distributed, large-scale information handling system (LIHS)
CN105589928A (en) * 2015-12-02 2016-05-18 中国银联股份有限公司 Simulation testing method for distributed data processing system
CN105389191B (en) * 2015-12-11 2018-11-02 北京奇虎科技有限公司 A kind of method for upgrading software based on LAN, device and system
CN107133063A (en) * 2017-03-10 2017-09-05 西安中科创达软件有限公司 The method for upgrading software and mobile terminal of a kind of customization
CN108334370B (en) * 2017-05-26 2021-02-09 中国电子科技集团公司第四十一研究所 Software automatic incremental updating and upgrading method of distributed test system
CN108632375B (en) * 2018-05-09 2021-04-27 四川华创世纪科技有限公司 Online upgrading method for distributed deployment service software program
CN108768758A (en) * 2018-08-31 2018-11-06 郑州云海信息技术有限公司 Distributed memory system online upgrading method, apparatus, equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201607A (en) * 2016-07-04 2016-12-07 乐视控股(北京)有限公司 The upgrade method of a kind of software version and equipment
CN108667641A (en) * 2017-03-30 2018-10-16 杭州海康威视数字技术股份有限公司 Distributed system upgrade method, distributed system and updating and management equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于P2P的VOD资源发布和更新系统设计与实现;阮伟;《中国优秀硕士学位论文全文数据库 信息科技辑》;20080715(第07期);I136-189 *

Also Published As

Publication number Publication date
WO2021022713A1 (en) 2021-02-11
CN110597531A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
CN110597531B (en) Distributed module upgrading method and device and storage medium
US8762977B2 (en) Mobile device software management method and apparatus
CN111414391A (en) Method and system for accessing multiple data sources
CN112685410A (en) Business rule checking method and device, computer equipment and storage medium
CN113330419A (en) Equipment application installation method and device
CN114362983A (en) Firewall policy management method and device, computer equipment and storage medium
CN111679888A (en) Deployment method and device of agent container
CN113157411A (en) Reliable configurable task system and device based on Celery
CN114006815A (en) Automatic deployment method and device for cloud platform nodes, nodes and storage medium
CN110825452A (en) Cloud service adaptation module management method for multi-cloud management
CN115544518A (en) Vulnerability scanning engine implementation method and device, vulnerability scanning method and electronic equipment
CN111538542B (en) System configuration method and related device
CN114662102A (en) File processing method and device and storage medium
CN113760244A (en) Method and system for realizing multiple entrances and multiple interfaces based on C language mode
CN112667441A (en) Service module scheduling method, system and storage medium based on fault-tolerant function
CN113515299A (en) Software development kit SDK hot upgrading method, device, equipment and storage medium
CN112817953A (en) Data verification method and device, computer equipment and computer-readable storage medium
CN112667491A (en) Function test method and device of virtual machine
CN117472516B (en) Virtual resource scheduling method, device, cluster system, electronic equipment and medium
CN109683926B (en) Network component updating method, device, equipment and computer readable storage medium
CN114500268B (en) Method and device for deploying char resources, server and storage medium
CN111078358B (en) Test data processing method and system based on software container
US20240095148A1 (en) Automatic assignment of changed permissions for diagnostic purposes for work container instances that have already been started
CN108923973B (en) Monitoring method and device
CN116755719A (en) Data processing method, device and data processing system of application component

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