WO2021022713A1 - 分布式的模块升级方法、装置及存储介质 - Google Patents

分布式的模块升级方法、装置及存储介质 Download PDF

Info

Publication number
WO2021022713A1
WO2021022713A1 PCT/CN2019/117808 CN2019117808W WO2021022713A1 WO 2021022713 A1 WO2021022713 A1 WO 2021022713A1 CN 2019117808 W CN2019117808 W CN 2019117808W WO 2021022713 A1 WO2021022713 A1 WO 2021022713A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
jar package
test
upgrade
upgraded
Prior art date
Application number
PCT/CN2019/117808
Other languages
English (en)
French (fr)
Inventor
郭巧佳
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021022713A1 publication Critical patent/WO2021022713A1/zh

Links

Images

Classifications

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

Definitions

  • the invention relates to cloud technology, in particular to a distributed module upgrade method, device and storage medium.
  • Ctrip has multiple public functions such as air ticket reservation and hotel reservation.
  • Each of its public functions is usually imported by a jar package and called internally to execute its functions. But this kind of scheme is inconvenient to upgrade, as long as there is access (upgrade) of new functions, it needs to be scheduled to release the version, the time period is long, and the business is strong.
  • microservices There are two solutions in the form of microservices: single-host single-service and single-host multiple services. Among them, single-host single-service causes bottlenecks or waste of resources, single-host multiple services As a result, it is difficult to manage too many services.
  • each service that is split is registered to a registry such as Eureka or Zeekeeper, which leads to insufficient service upgrades.
  • the present invention provides a distributed module upgrade method applied to electronic devices, including:
  • A. Decouple the basic function modules corresponding to each target function module from the system according to the function classification, and set the communication parameters between each target function module and the host.
  • the decoupling process of the target function module includes preset data
  • the communication rule sets the communication interface of the basic function module, and each target function module communicates through the communication interface of the basic function module;
  • the host receives an upgrade request for a target function module, and the host tests the upgrade JAR package according to the preset test rules, where the upgrade request includes the upgrade JAR package of the target function module and the parameter information of the upgrade JAR package, and the upgrade
  • the parameter information of the JAR package includes the version parameter of the JAR package;
  • the host selects the optimal upgrade node of the target function module from all nodes according to the real-time operating parameters, historical operating parameters and test results of each node;
  • the host sends a JAR package replacement request for the target function module to the optimal upgrade node, where the JAR package replacement request includes the version number of the upgraded JAR package and the download path of the upgraded JAR package;
  • 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 to complete the upgrade of the target function module.
  • the present invention also provides a distributed module upgrading device, including:
  • the decoupling module is used to decouple multiple basic function modules corresponding to each target function module from the system according to the function classification.
  • the decoupling process of the target function module includes setting the basic function module according to preset data communication rules.
  • a communication interface through which basic functional modules communicate through the communication interface;
  • the node deployment module is used to deploy the basic function modules on the preset nodes and make each node establish communication between the node and the host through the communication parameters of the target function module;
  • the test module is used to test the upgraded JAR package according to the preset test rules after the host receives an upgrade request for a certain target function module, so as to test the upgraded JAR package;
  • the optimal upgrade node determination module is used to enable the host to select the optimal upgrade node of the target function module from all nodes according to the real-time operating parameters, historical operating parameters and test results of each node;
  • the upgrade module is used to make the host send a JAR package replacement request for the target function module to the optimal upgrade node.
  • the JAR package replacement request includes the version number of the upgraded JAR package and the download path of the upgraded JAR package.
  • the optimal upgrade node is based on the download Download the upgrade JAR package through the path, and replace the old JAR package of the target function module to complete the upgrade of the target function module.
  • the present invention also provides an electronic device, the electronic device comprising: a memory and a processor, the memory stores a distributed module upgrade program, the distributed module upgrade program is executed by the processor to achieve the following steps :
  • A. Decouple the basic function modules corresponding to each target function module from the system according to the function classification, and set the communication parameters between each target function module and the host.
  • the decoupling process of the target function module includes preset data
  • the communication rule sets the communication interface of the basic function module, and each target function module communicates through the communication interface of the basic function module;
  • the host receives an upgrade request for a target function module, and the host tests the upgrade JAR package according to the preset test rules.
  • the upgrade request includes the upgrade JAR package of the target function module and the parameter information of the upgrade JAR package, and the upgrade JAR
  • the parameter information of the package includes the version parameter of the JAR package;
  • the host selects the optimal upgrade node of the target function module from all nodes according to the real-time operating parameters, historical operating parameters and test results of each node;
  • the host sends a JAR package replacement request for the target function module to the optimal upgrade node, where the JAR package replacement request includes the version number of the upgraded JAR package and the download path of the upgraded JAR package;
  • 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 to complete the upgrade of the target function module.
  • the present invention also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program includes program instructions that, when executed by a processor, realize the distributed Module upgrade method.
  • the basic function module is decoupled from the system and the decoupled basic function module is deployed on the designated node. Since the decoupled basic function module has a low degree of coupling with other function modules, it is passed The upgrade of the target function module initiated by the present invention will not have a relatively large impact on other function modules. At the same time, because the number of nodes that can be set is larger than the number of modules that can be registered in the Zeekeeper registry based on the microservice framework, so It can avoid the registration bottleneck of the Zeekeeper registry.
  • Figure 1 is a flowchart showing a distributed module upgrade method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram showing the relationship between basic function modules and nodes in an embodiment of the present invention
  • Fig. 3 is a schematic diagram showing program modules of a distributed module upgrade program according to an embodiment of the present invention.
  • Fig. 1 shows a flowchart of a distributed module upgrade method in this embodiment
  • Fig. 2 is a schematic diagram of the relationship between basic function modules and nodes in this embodiment. The following describes the distributed module upgrade method of this embodiment in conjunction with FIG. 1 and FIG. 2, which includes the following steps:
  • A. Decouple multiple basic function modules corresponding to each target function module from the system according to the preset function classification, and set the communication parameters between each target function module and the host.
  • the decoupling process of the target function module includes The communication interface of the basic function module is set according to the preset data communication rules, and the basic function modules communicate through the communication interface.
  • the target function module refers to a module with one or more functions included in the system, and a target function module may include multiple basic function modules, and each basic function module has a communication interface.
  • the Ctrip APP includes multiple target function modules such as hotel reservation, air ticket reservation, and travel customization.
  • the air ticket reservation module divides multiple basic function modules according to the number of nodes, and these basic function modules communicate through communication interfaces.
  • the target function module on multiple preset nodes through the basic function module, and make each node establish communication between the node and the host through the communication parameters of the target function module.
  • basic functional modules are deployed.
  • the node refers to the end point of the network connection, and the node can be a processor, a controller or a workstation.
  • Nodes vary with their functions, and they can be interconnected through links and act as control points in the network.
  • the basic function modules of the air ticket reservation module are all set on different nodes.
  • the host When the host receives an upgrade request for a certain target function module, the host tests the upgrade JAR package according to the preset test rules to test the upgrade JAR package, where the upgrade request includes the upgrade JAR package of the target function module and the upgrade
  • the parameter information of the JAR package, and the parameter information of the upgraded JAR package includes the version parameter of the JAR package.
  • the upgrade request received by the host may also include deployment information of the upgraded JAR package, where the deployment information may include supportable system information, JAR coding rules, and identifications of JAR package dependent components.
  • the host uses the Hadoop Test class to call the upgrade JAR package, and uses the TestDFSIO class to test the upgrade JAR package.
  • the TestDFSIO class includes the TestDFSIO write subclass and the TestDFSIO read subclass.
  • the TestDFSIO class uses the mapReduce job to concurrently execute the read and write upgrade JAR package, where the mapReduce job includes at least one map task, and the map is used to read or write the upgrade JAR
  • Each file in the package also outputs the execution information generated by reading or writing each file; thus, the execution information can be counted and the IO (input and output) performance test results of the upgraded JAR package can be output.
  • the host selects the optimal upgrade node of the target function module from all nodes according to the real-time operating parameters, historical operating parameters and test results of each node;
  • the host sends a JAR package replacement request for the target function module to the optimal upgrade node, where the JAR package replacement request includes the version number of the upgraded JAR package and the download path of the upgraded JAR package;
  • 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 to complete the upgrade of the target function module.
  • the host Preferably, the host also generates an update prompt of the target function module.
  • multiple functional modules of the ticket booking module of the Ctrip APP are set on different nodes, and the ticket booking module communicates with the host. That is, the air ticket reservation module, hotel reservation module, and travel customization module all communicate with the host.
  • the host When upgrading the ticket booking module, the host first tests the upgrade JAR package, and then selects the best node from all nodes based on the real-time operating parameters, historical operating parameters and test results of the nodes corresponding to each basic function module, and then upgrades The operation of the JAR package completes the upgrade of the ticket reservation module.
  • the steps for the host to test the upgrade JAR package according to a preset test rule include:
  • the upgraded JAR into a virtual test environment for testing, where the virtual test environment includes several test instructions, and the several test instructions include at least a test load test instruction, a version test instruction, an uninstall test instruction, and multiple function test instructions;
  • process of the virtual test environment executing the trial load test includes:
  • the real-time status information of the CPU and the real-time occupancy information of the memory it is judged whether the upgraded JAR package will cause a node to be overloaded, if it is, stop the test and output the test report, if not, trigger the version test program.
  • the specific judging process for judging whether the upgraded JAR package will cause an overload of a node may be: sequentially judging whether the load rate of the CPU is greater than a preset load threshold , Whether the usage of the memory is greater than the preset usage threshold, if the results of the two judgments are both yes, it is determined that the upgraded JAR package will cause an overload of a node.
  • the preset load threshold and preset usage threshold are set by technicians according to the CPU performance parameters and memory parameters of all nodes managed by the host, and the preset load threshold and preset usage threshold are also pre-stored In the host.
  • the preset load threshold and the preset usage threshold are stored in a configuration file in xml format.
  • the xml file parser is used Parse the configuration file and obtain the preset load threshold and the preset usage threshold from it.
  • the steps of version testing include: judging whether the version number of the JAR package meets the preset version number iteration rule, if it is, execute the version security test, if not, stop the test,
  • the security test steps of the version include: obtaining the encrypted authentication key of the upgraded JAR from the parameter information of the upgraded JAR package, then analyze the encrypted authentication key according to the encryption rules, and finally, analyze the encrypted authentication key according to the encryption rules As a result, it is determined whether the upgraded JAR package is secure, that is, if the encryption authentication key can be parsed correctly, it is determined that the upgraded JAR package is secure.
  • the uninstallation test process is: uninstall the upgraded JAR package and save the running data of the upgraded JAR package; then, read the original running data and compare the running data of the upgraded JAR package with the original running data and judge Whether the values of the specified data items are consistent, if so, it is determined that when the upgrade JAR package meets the compatibility requirements, that is, after the upgrade JAR is uninstalled, it will not affect the operation of the default version JAR package.
  • the functional test may include the steps of: calling the test case to execute the functional function and obtaining the execution result; then, comparing the execution result with the value range corresponding to the function name, and if the execution result is not within the value range, determine the function function The test failed. It should be noted that there are multiple test cases in the virtual environment, and each test case corresponds to a different function. Moreover, if a function involves obtaining external data through an interface, the virtual environment will obtain the external data from the test interface, where the test interface includes part or all of the external data required for the test.
  • the step of the host determining the optimal upgrade node of the target function module includes:
  • nodes whose load meets the operation of the upgraded JAR package are selected from multiple nodes as backup nodes;
  • the node interface data and operating system parameters of each standby node are compared with the node interface requirements of the upgraded JAR package and the node operating system requirements to determine the optimal upgraded node that meets the requirements of the upgraded JAR package.
  • the host selects the optimal upgrade node of the target function module from several nodes according to the real-time operating parameters, historical operating parameters and test results of each node, and can find the current minimum load from several upgrade nodes.
  • Upgrade the JAR package which can improve the load utilization of each node and reduce the impact of upgrading the JAR package on the current use of users, because usually nodes with high load rates are usually the main services currently providing users Node, and upgrading the JAR on the node involved can easily affect the current use of the user, for example, cause the node to crash.
  • each upgraded JAR package is usually different. Further, its dependence on the data interface is also different. That is, some upgraded JAR packages have less data interaction with other functional modules, and some upgrade There are many data interactions between the JAR package and other functional modules, and the present invention can determine the data interaction items involved in the upgraded JAR package according to the test result of the target upgrade JAR package, and then upgrade the data according to the data interaction item of the upgraded JAR package The JAR package is placed on the node that can meet the minimum data interaction items to ensure the unity of the upgraded JAR package.
  • a data interface is usually deployed on each node, and then a node is selected arbitrarily by deploying and upgrading the JAR package, which will cause a waste of node resources, and because the network resources corresponding to the nodes in each area are different Therefore, this may also deploy the upgraded JAR package on nodes with cross network resources, which will cause problems such as slow response to user operation instructions when the upgraded JAR package is actually running.
  • the host when the host determines that there is no optimal node, the host receives a node increase request, where the node increase request includes the number of nodes to increase, the operating system type of the node, and the environmental parameters of the node;
  • the host uses a virtual machine and creates virtual machines according to the increased number of nodes;
  • the host sets the operating system of the virtual machine according to the operating system type of the node
  • the host sets the deployment parameters of the virtual machine according to the environment parameters of the node.
  • the method of the present invention may further include the following operation steps:
  • the host modifies the version number of the target function module stored in the project manager.
  • the present invention also provides a distributed module upgrade device, including a decoupling module 501, a node deployment module 502, a testing module 503, an optimal upgrade node determination module 504, and an upgrade module 505.
  • the decoupling module 501 is used for decoupling multiple basic function modules corresponding to each target function module from the system according to the function classification.
  • the decoupling process of the target function module includes setting basic functions according to preset data communication rules.
  • the communication interface of the module, and the basic function modules communicate through the communication interface;
  • the node deployment module 502 is used to deploy basic function modules on preset nodes, 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 used to enable the host to test the upgraded JAR package according to a preset test rule after receiving an upgrade request for a certain target function module, so as to test the upgraded JAR package;
  • the optimal upgrade node determination module 504 is configured to enable the host to select the optimal upgrade node of the target function module from all nodes according to the real-time operating parameters, historical operating parameters and test results of each node;
  • the upgrade module 505 is used to make the host send a JAR package replacement request for the target function module to the optimal upgrade node.
  • the JAR package replacement request includes the version number of the upgraded JAR package and the download path of the upgraded JAR package.
  • the optimal upgrade node is based on the download Download the upgrade JAR package through the path, and replace the old JAR package of the target function module to complete the upgrade of the target function module.
  • FIG. 2 shows the hardware architecture of the electronic device.
  • the electronic device 2 is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions.
  • it can 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).
  • the electronic device 2 at least includes, but is not limited to, a memory 21 and a processor 22 that can be communicatively connected to each other through a system bus.
  • the memory 21 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM) ), static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disks, optical disks, etc.
  • the memory 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.
  • the memory 21 may also be an external storage device of the electronic device 2, for example, a plug-in hard disk equipped on the electronic device 2, a smart media card (SMC), a secure digital (Secure Digital, SD) card, flash card (Flash Card), etc.
  • the memory 21 may also include both the internal storage unit of the electronic device 2 and its external storage device.
  • the memory 21 is generally used to store the operating system and various application software installed in the electronic device 2, such as the distributed module upgrade program code.
  • the memory 21 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 22 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
  • the processor 22 is generally used to control the overall operation of the electronic device 2, for example, to perform data interaction or communication-related control and processing with the electronic device 2.
  • the processor 22 is used to run the program code or process data stored in the memory 21, for example, to run the distributed module upgrade program.
  • FIG. 2 only shows the electronic device 2 with components 21-22, but it should be understood that it is not required to implement all the illustrated components, and more or fewer components may be implemented instead.
  • the memory 21 containing a readable storage medium may include an operating system, a distributed module upgrade program 50, and the like.
  • the processor 22 executes the distributed module upgrade program 50 in the memory 21, the steps described in the above distributed module upgrade method are implemented.
  • the distributed module upgrade program stored in the memory 21 can be divided into one or more program modules, and the one or more program modules are stored in the memory 21, and can be divided into one or more program modules.
  • a plurality of processors (the processor 22 in this embodiment) are executed to complete the present invention.
  • FIG. 3 shows a schematic diagram of the program modules of the distributed module upgrade program.
  • the distributed module upgrade program 50 can be divided into a decoupling module 501, a node deployment module 502, and a test module. 503.
  • the program module referred to in the present invention refers to a series of computer program instruction segments capable of completing specific functions, and is more suitable than a program to describe the execution process of the distributed module upgrade program in the electronic device 2. The following description will specifically introduce the 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 the preset function classification, and set the communication parameters between the target function module and the host.
  • the decoupling process of the target function module includes setting the communication interface of the basic function module according to the preset data communication rules, and the basic function modules communicate through the communication interface.
  • the node deployment module 502 is used 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 testing module 503 is used to enable the host to test the upgraded JAR package according to a preset testing rule to test the upgraded JAR package.
  • the optimal upgrade node determination module 504 is used to enable the host to select the optimal upgrade node of the target function module from all nodes according to the real-time operating parameters, historical operating parameters and test results of each node.
  • the upgrade module 505 is used to make the host send a JAR package replacement request for the target function module to the optimal upgrade node.
  • 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 to complete the target function module. upgrade.
  • the embodiment of the present invention also provides a computer-readable storage medium.
  • the computer-readable storage medium may be a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a read-only memory (ROM), an erasable programmable Any one or any combination of read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, etc.
  • the computer-readable storage medium includes a distributed module upgrade program, etc., when the distributed module upgrade program 50 is executed by the processor 22, the following operations are implemented:
  • A. Decouple multiple basic function modules corresponding to the target function module from the system according to the preset function classification, and set the communication parameters between the target function module and the host.
  • the decoupling process of the target function module includes according to the preset
  • the data communication rules set the communication interface of the basic function module, and the basic function modules communicate through the communication interface.
  • B Deploy the target function module on multiple preset nodes through the basic function module, and make each node establish communication between the target function module and the host through the communication parameters of the target function module. Specifically, corresponding to each node, basic functional modules are deployed.
  • the host When the host receives an upgrade request for a certain target function module, the host tests the upgraded JAR package according to the preset test rules to test the upgraded JAR package.
  • the host selects the optimal upgrade node of the target function module from all nodes according to the real-time operating parameters, historical operating parameters and test results of each node;
  • the host sends a JAR package replacement request for the target function module to the optimal upgrade node, where the JAR package replacement request includes the version number of the upgraded JAR package and the download path of the upgraded JAR package;
  • 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 to complete the upgrade of the target function module.
  • the specific implementation of the computer-readable storage medium of the present invention is substantially the same as the specific implementation of the distributed module upgrade method and the electronic device 2 described above, and will not be repeated here.

Landscapes

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

Abstract

本发明涉及云技术,提供一种分布式的模块升级方法、装置及存储介质,方法包括:根据功能分类从系统中解耦出与目标功能模块对应的基础功能模块;将目标功能模块部署在预设的节点上,并建立目标功能模块与主机之间的通信;主机接收到针对某一目标功能模块的升级请求,主机按照预设的测试规则测试升级JAR包,以测试该升级JAR包;主机根据各个节点的运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;主机向最优升级节点发送JAR包更替请求,最优升级节点下载升级JAR包,完成升级。由于解耦出的基础功能模块与其他功能模块的耦合度低,故通过本发明发起对目标功能模块的升级并不会对其他功能模块产生比较大的影响。

Description

分布式的模块升级方法、装置及存储介质
本申请要求于2019年8月5日提交中国专利局,申请号为201910716847.2、发明名称为“分布式的模块升级方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及云技术,具体说,涉及分布式的模块升级方法、装置及存储介质。
背景技术
目前,对于一个项目的公共功能,例如,携程其具有机票预订、酒店预订等多个公共功能,其每个公共功能通常都是应用一个jar包进行导入,并内部调用,从而执行其功能。但这种方案不方便升级,只要有新的功能的接入(升级)则需要排期发布版本、时间周期长,而且业务倾入性强。另外,还可以采用微服务将一个项目分解为多个服务,微服务形式会有单主机单服务和单主机多服务两种方案,其中,单主机单服务导致瓶颈或资源浪费,单主机多服务导致服务太多管理困难,而且,对于微服务的方式,拆分出的各个服务是分别注册到Eureka或Zeekeeper等注册中心,这都导致服务升级不够完善。
发明内容
为解决以上技术问题,本发明提供一种分布式的模块升级方法,应用于电子装置,包括:
A、根据功能分类从系统中解耦出与各目标功能模块分别对应的基础功能模块,并设置各目标功能模块与主机的通信参数,其中,目标功能模块的解耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各目标功能模块之间通过基础功能模块的所述通信接口通信;
B、将基础功能模块部署在预设的节点上,并使得各节点通过目标功能模 块的通信参数建立节点与主机之间的通信;
C、主机接收到针对某一目标功能模块的升级请求,主机按照预设的测试规则测试升级JAR包,其中,升级请求包括目标功能模块的升级JAR包及该升级JAR包的参数信息,且升级JAR包的参数信息包括JAR包的版本参数;
D、主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;
E、主机向最优升级节点发送针对目标功能模块的JAR包更替请求,其中,该JAR包更替请求包括升级JAR包的版本号,以及升级JAR包的下载路径;
F、最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级。
本发明还提供一种分布式的模块升级装置,包括:
解耦模块,用于根据功能分类从系统中解耦出与各目标功能模块对应的多个基础功能模块,其中,目标功能模块的解耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各基础功能模块之间通过所述通信接口通信;
节点部署模块,用于将基础功能模块部署在预设的节点上,并使得各节点通过目标功能模块的通信参数建立节点与主机之间的通信;
测试模块,用于使在主机接收到针对某一目标功能模块的升级请求后,按照预设的测试规则测试升级JAR包,以测试该升级JAR包;
最优升级节点确定模块,用于使主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;
升级模块,用于使主机向最优升级节点发送针对目标功能模块的JAR包更替请求,该JAR包更替请求包括升级JAR包的版本号,以及升级JAR包的下载路径,最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级。
本发明还提供一种电子装置,该电子装置包括:存储器和处理器,所述存储器中存储有分布式的模块升级程序,所述分布式的模块升级程序被所述处理器执行时实现如下步骤:
A、根据功能分类从系统中解耦出与各目标功能模块分别对应的基础功能 模块,并设置各目标功能模块与主机的通信参数,其中,目标功能模块的解耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各目标功能模块之间通过基础功能模块的所述通信接口通信;
B、将基础功能模块部署在预设的节点上,并使得各节点通过目标功能模块的通信参数建立节点与主机之间的通信;
C、主机接收到针对某一目标功能模块的升级请求,主机按照预设的测试规则测试升级JAR包其中,升级请求包括目标功能模块的升级JAR包及该升级JAR包的参数信息,且升级JAR包的参数信息包括JAR包的版本参数;
D、主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;
E、主机向最优升级节点发送针对目标功能模块的JAR包更替请求,其中,该JAR包更替请求包括升级JAR包的版本号,以及升级JAR包的下载路径;
F、最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级。
本发明还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时,实现如上所述的分布式的模块升级方法。
在本发明中,将基础功能模块从系统中解耦出来并将解耦出来的基础功能模块部署在指定的节点上,由于解耦出的基础功能模块与其他功能模块的耦合度低,故通过本发明发起对目标功能模块的升级并不会对其他功能模块产生比较大的影响,同时,由于节点的可设置数量比基于微服务框架中Zeekeeper注册中心可允许注册模块数量要多的多,故可以避免Zeekeeper注册中心的注册瓶颈问题。
附图说明
通过结合下面附图对其实施例进行描述,本发明的上述特征和技术优点将会变得更加清楚和容易理解。
图1是表示本发明实施例的分布式的模块升级方法的流程图;
图2是表示本发明实施例的基础功能模块和节点关系示意图;
图3是表示本发明实施例的分布式的模块升级程序的程序模块示意图。
具体实施方式
下面将参考附图来描述本发明所述的分布式的模块升级方法、装置及存储介质的实施例。本领域的普通技术人员可以认识到,在不偏离本发明的精神和范围的情况下,可以用各种不同的方式或其组合对所描述的实施例进行修正。因此,附图和描述在本质上是说明性的,而不是用于限制权利要求的保护范围。此外,在本说明书中,附图未按比例画出,并且相同的附图标记表示相同的部分。
图1示出本实施例中分布式的模块升级方法的流程图,图2是本实施例中基础功能模块和节点关系示意图。下面结合图1和图2来说明本实施例的分布式的模块升级方法,包括如下步骤:
A、根据预设的功能分类从系统中解耦出与各目标功能模块分别对应的多个基础功能模块,并设置各目标功能模块与主机的通信参数,其中,目标功能模块的解耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各基础功能模块之间通过所述通信接口通信。
所述目标功能模块是指系统中包含的具有一个或多个功能的模块,而一个目标功能模块则可能包含有多个基础功能模块,每个基础功能模块都具有通信接口。例如,携程APP包括酒店预订、机票预订、旅游定制等多个目标功能模块,其中机票预订模块又根据节点数分出多个基础功能模块,这些基础功能模块通过通信接口通信。
B、将目标功能模块通过基础功能模块部署在预设的多个节点上,并使得各节点通过目标功能模块的通信参数建立节点与主机之间的通信。具体说,对应每个节点,都部署有基础功能模块。其中,结点是指网络连接的端点,结点可以是处理器、控制器或工作站。结点随其功能不同而各不相同,可以通过链路互联在一起,在网络中作为控制点。比如,机票预订模块的基础功能模块都分别设置在不同的节点上。
C、当主机接收到针对某一目标功能模块的升级请求,主机按照预设的测试规则测试升级JAR包,以测试该升级JAR包,其中,升级请求包括目标功能模块的升级JAR包及该升级JAR包的参数信息,且升级JAR包的参数信 息包括JAR包的版本参数。其中,主机接收到的升级请求中还可以包括升级JAR包的部署信息,其中,部署信息可以包括可支持系统信息、JAR的编码规则、JAR包依赖组件的标识。
优选地,主机使用Hadoop Test类调用升级JAR包,并使用TestDFSIO类测试升级JAR包。其中,TestDFSIO类包括TestDFSIO write子类和TestDFSIO read子类,TestDFSIO类通过mapReduce作业来并发的执行读写升级JAR包,其中,mapReduce作业包括至少一个map任务,且该map用于读或写升级JAR包中的每个文件并输出读或写每个文件所产生的执行信息;从而可以统计执行信息并输出升级JAR包的IO(输入和输出)性能测试结果。
D、主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;
E、主机向最优升级节点发送针对目标功能模块的JAR包更替请求,其中,该JAR包更替请求包括升级JAR包的版本号,以及升级JAR包的下载路径;
F、最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级,优选地,主机还生成目标功能模块的更新提示。
例如,携程APP的机票预订模块的多个功能模块都分别设置在不同的节点上,而机票预订模块与主机之间通信。即机票预订模块、酒店预订模块、旅游定制模块都与主机之间通信。当要针对机票预订模块进行升级时,主机先测试升级JAR包,然后根据各基础功能模块对应的节点的实时运行参数、历史运行参数及测试结果从所有节点中选出最优的节点,进行升级JAR包的操作,从而完成机票预订模块的升级。
在一个可选实施中,主机接收到升级请求时,主机按照预设的测试规则测试升级JAR包的步骤包括:
将升级JAR放入虚拟测试环境中进行测试,其中,虚拟测试环境包括若干个测试指令,且若干个测试指令至少包括试加载测试指令、版本测试指令、卸载测试指令、多个功能测试指令;
虚拟测试环境依次按照试加载测试、版本测试、卸载测试、功能测试的顺序对升级JAR包进行测试。
进一步地,虚拟测试环境执行试加载测试的过程包括:
调用实时测试用例运行升级JAR包并实时获取主机的CPU的实时状态信息和内存的实时占用信息,具体说,使用nnbench类测试升级JAR包的节点负载,其中,nnbench类会多次重复执行实时测试用例,用于检查升级JAR包在节点的运行是否可重复以及运行是否高效;
根据CPU的实时状态信息和内存的实时占用信息判断该升级JAR包是否会导致某个节点出现过载,若是,则停止测试输出测试报告,若不是,则触发版本测试程序。
再具体地,根据该CPU的实时状态信息和内存的实时占用信息判断该升级JAR包是否会导致某个节点出现过载的具体判断过程可以是:依次判断该CPU的负载率是否大于预设负载阈值、该内存的使用量是否大于预设使用量阈值,若两次判断的结果均为是,则确定该升级JAR包会导致某个节点出现过载。
需要说明的是,预设负载阈值和预设使用量阈值为技术人员根据主机所管理的全部节点的CPU性能参数和内存参数设置定,且该预设负载阈值和预设使用量阈值也是预先存储在主机中。优选地,该预设负载阈值和预设使用量阈值保存在xml格式的配置文件中,当主机中的虚拟测试环境需要使用该预设负载阈值和预设使用量阈值时,通过xml文件解析器解析该配置文件并从中获取该预设负载阈值和预设使用量阈值。
进一步地,版本测试的步骤包括:判断JAR包的版本号是否满足预设版本号迭代规则,若是,则执行版本的安全性测试,若不是则停止测试,
其中,版本的安全性测试步骤包括:从该升级JAR包的参数信息获取该升级JAR的加密认证密钥,接着,按照加密规则解析该加密认证密钥,最后,根据该加密认证密钥的解析结果判断该升级JAR包是否具有安全性,即若该加密认证密钥能够被解析正确,则确定该升级JAR包具有安全性。
进一步地,卸载测试的过程为:将升级JAR包卸载并保存该升级JAR包的运行数据;接者,读取原始运行数据并将该升级JAR包的运行数据与原始运行数据进行比对并判断指定数据项的数值是否一致,若是,则确定当该升级JAR包满足兼容性要求,即该升级JAR卸载后,并不会影响默认版本JAR包的运行。
进一步地,功能测试可以包括步骤:调用测试用例执行功能函数并获取执行结果;接着,将该执行结果与函数名对应的值域进行比较,若执行结果没有在该值域内,则确定该功能函数测试失败。需要说明的是,虚拟环境中有多个测试用例,每个测试用例对应不同的功能函数。并且,若一个功能函数涉及通过接口获取外部数据的,虚拟环境将从测试接口中获取外部数据,其中,该测试接口包括了测试所需的部分或全部的外部数据。
在一个可选实施中,主机确定目标功能模块的最优升级节点的步骤包括:
从升级JAR包的测试结果提取该升级JAR包的环境依赖数据,其中,环境依赖数据至少包括节点负载数据、节点接口数据、节点操作系统数据;
根据节点负载数据从多个节点中筛选出多个负载满足该升级JAR包运行的节点作为备用节点;
将每个备用节点的节点接口数据、操作系统参数与该升级JAR包的节点接口要求、节点操作系统要求进行比对,从而确定满足升级JAR包的要求的最优升级节点。
需要说明的是,主机根据各个节点的实时运行参数及历史运行参数及测试结果从若干个节点中选出目标功能模块的最优升级节点这一步骤,能够从若干个升级节点中找到当前负载最小的节点升级该JAR包,这样可以提高每个节点的负载利用率且可减低升级该JAR包对用户的当前使用造成的影响,因为,通常负载率高的节点通常是当前为用户提供服务的主要节点,而在该节点涉节点升级该JAR容易对用户当前的使用造成影响,例如,导致节点的崩溃。
在本发明中,每个升级JAR包的功能通常不一样,进一步的,其对数据接口的依赖程度也不一样,即有的升级JAR包与其他的功能模块的数据交互较少,有的升级JAR包与其他的功能模块的数据交互较多,而本发明能够根据目标升级JAR包的测试结果确定该升级JAR包所涉及的数据交互项,进而根据该升级JAR包的数据交互项目将该升级JAR包放在能够最低限定满足其数据交互项的节点,以确保该升级JAR包的统一性。而现有技术中,通常会在每个节点都部署数据接口,进而部署升级JAR包任意选一个节点,这样就会造成节点资源的浪费,且由于每个区域的节点对应的网络资源是不同的,故这样还可能会将升级JAR包部署在网络资源交差的节点,进而导致该升级 JAR包在实际运行时,对用户的操作指令响应慢等问题。
在一个可选实施中,当主机判断没有最优节点时,主机接收节点增加请求,其中,节点增加请求包括节点增加数量、节点的操作系统类型、节点的环境参数;
主机使用虚拟器并根据节点增加数量创建虚拟机;
主机根据节点的操作系统类型设置虚拟机的操作系统;
主机根据节点的环境参数设置虚拟机的部署参数。
在一个可选实施中,为了进一步减低目标功能模块的修改不影响到其他功能模块,本发明的方法还可以包括以下操作步骤:
在主机中创建项目管理器,其中,该项目管理器用于管理被公用的基础功能模块;
当主机接收到升级请求后,主机修改存储在项目管理器中的目标功能模块的版本号。
本发明还提供一种分布式的模块升级装置,包括解耦模块501、节点部署模块502、测试模块503、最优升级节点确定模块504、升级模块505。
其中,解耦模块501用于根据功能分类从系统中解耦出与各目标功能模块对应的多个基础功能模块,其中,目标功能模块的解耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各基础功能模块之间通过所述通信接口通信;
节点部署模块502用于将基础功能模块部署在预设的节点上,并使得各节点通过目标功能模块的通信参数建立节点与主机之间的通信;
测试模块503用于使在主机接收到针对某一目标功能模块的升级请求后,按照预设的测试规则测试升级JAR包,以测试该升级JAR包;
最优升级节点确定模块504用于使主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;
升级模块505用于使主机向最优升级节点发送针对目标功能模块的JAR包更替请求,该JAR包更替请求包括升级JAR包的版本号,以及升级JAR包的下载路径,最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级。
另外,本发明还提供一种电子装置,图2示出了电子装置的硬件架构。本 实施例中,所述电子装置2是一种能够按照事先设定或者存储的指令,自动进行数值计算和/或信息处理的设备。例如,可以是智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。如图3所示,所述电子装置2至少包括,但不限于,可通过系统总线相互通信连接的存储器21、处理器22。其中:所述存储器21至少包括一种类型的计算机可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器21可以是所述电子装置2的内部存储单元,例如该电子装置2的硬盘或内存。在另一些实施例中,所述存储器21也可以是所述电子装置2的外部存储设备,例如该电子装置2上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器21还可以既包括所述电子装置2的内部存储单元也包括其外部存储设备。本实施例中,所述存储器21通常用于存储安装于所述电子装置2的操作系统和各类应用软件,例如所述分布式的模块升级程序代码等。此外,所述存储器21还可以用于暂时地存储已经输出或者将要输出的各类数据。
所述处理器22在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器22通常用于控制所述电子装置2的总体操作,例如执行与所述电子装置2进行数据交互或者通信相关的控制和处理等。本实施例中,所述处理器22用于运行所述存储器21中存储的程序代码或者处理数据,例如运行所述的分布式的模块升级程序等。
需要指出的是,图2仅示出了具有组件21-22的电子装置2,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
包含可读存储介质的存储器21中可以包括操作系统、分布式的模块升级程序50等。处理器22执行存储器21中分布式的模块升级程序50时实现以上分布式的模块升级方法所述的步骤。在本实施例中,存储于存储器21中的所述分布式的模块升级程序可以被分割为一个或者多个程序模块,所述一个 或者多个程序模块被存储于存储器21中,并可由一个或多个处理器(本实施例为处理器22)所执行,以完成本发明。例如,图3示出了所述分布式的模块升级程序的程序模块示意图,该实施例中,所述分布式的模块升级程序50可以被分割为解耦模块501、节点部署模块502、测试模块503、最优升级节点确定模块504、升级模块505。其中,本发明所称的程序模块是指能够完成特定功能的一系列计算机程序指令段,比程序更适合于描述所述分布式的模块升级程序在所述电子装置2中的执行过程。以下描述将具体介绍所述程序模块的具体功能。
解耦模块501用于根据预设的功能分类从系统中解耦出与目标功能模块对应的多个基础功能模块,并设置目标功能模块与主机的通信参数。目标功能模块的解耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各基础功能模块之间通过所述通信接口通信。
节点部署模块502用于将目标功能模块通过基础功能模块部署在预设的多个节点上,并使得各节点通过目标功能模块的通信参数建立目标功能模块与主机之间的通信。
测试模块503用于使主机按照预设的测试规则测试升级JAR包,以测试该升级JAR包。
最优升级节点确定模块504用于使主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点。
升级模块505用于使主机向最优升级节点发送针对目标功能模块的JAR包更替请求,最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级。
此外,本发明实施例还提出一种计算机可读存储介质,所述计算机可读存储介质可以是硬盘、多媒体卡、SD卡、闪存卡、SMC、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器等等中的任意一种或者几种的任意组合。所述计算机可读存储介质中包括分布式的模块升级程序等,所述分布式的模块升级程序50被处理器22执行时实现如下操作:
A、根据预设的功能分类从系统中解耦出与目标功能模块对应的多个基础功能模块,并设置目标功能模块与主机的通信参数,其中,目标功能模块的解 耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各基础功能模块之间通过所述通信接口通信。
B、将目标功能模块通过基础功能模块部署在预设的多个节点上,并使得各节点通过目标功能模块的通信参数建立目标功能模块与主机之间的通信。具体说,对应每个节点,都部署有基础功能模块。
C、当主机接收到针对某一目标功能模块的升级请求,主机按照预设的测试规则测试升级JAR包,以测试该升级JAR包。
D、主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;
E、主机向最优升级节点发送针对目标功能模块的JAR包更替请求,其中,该JAR包更替请求包括升级JAR包的版本号,以及升级JAR包的下载路径;
F、最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级。
本发明之计算机可读存储介质的具体实施方式与上述分布式的模块升级方法以及电子装置2的具体实施方式大致相同,在此不再赘述。
以上所述仅为本发明的优选实施例,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (20)

  1. 一种分布式的模块升级方法,应用于电子装置,其特征在于,包括:
    A、根据功能分类从系统中解耦出与各目标功能模块分别对应的基础功能模块,并设置各目标功能模块与主机的通信参数,其中,目标功能模块的解耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各目标功能模块之间通过基础功能模块的所述通信接口通信;
    B、将基础功能模块部署在预设的节点上,并使得各节点通过目标功能模块的通信参数建立节点与主机之间的通信;
    C、主机接收到针对某一目标功能模块的升级请求,主机按照预设的测试规则测试升级JAR包,其中,升级请求包括目标功能模块的升级JAR包及该升级JAR包的参数信息,且升级JAR包的参数信息包括JAR包的版本参数;
    D、主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;
    E、主机向最优升级节点发送针对目标功能模块的JAR包更替请求,其中,该JAR包更替请求包括升级JAR包的版本号,以及升级JAR包的下载路径;
    F、最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级。
  2. 根据权利要求1所述的分布式的模块升级方法,其特征在于,所述将基础功能模块部署在预设的节点上,其中节点是指网络连接的端点,为处理器、控制器或工作站,各节点通过链路互联在一起,在网络中作为控制点。
  3. 根据权利要求1所述的分布式的模块升级方法,其特征在于,所述主机接收到的升级请求还包括升级JAR包的部署信息,其中,部署信息包括可支持系统信息、JAR的编码规则、JAR包依赖组件的标识。
  4. 根据权利要求1所述的分布式的模块升级方法,其特征在于,主机使用Hadoop Test类调用升级JAR包,并使用TestDFSIO类测试升级JAR包;其中,TestDFSIO类包括TestDFSIO write子类和TestDFSIO read子类,TestDFSIO类通过mapReduce作业来并发的执行读写升级JAR包,其中, mapReduce作业包括至少一个map任务,且该map用于读或写升级JAR包中的每个文件并输出读或写每个文件所产生的执行信息,以统计执行信息并输出升级JAR包的输入和输出性能测试结果。
  5. 根据权利要求1所述的分布式的模块升级方法,其特征在于,主机接收到升级请求时,主机按照预设的测试规则测试升级JAR包的步骤包括:
    将升级JAR包放入虚拟测试环境中进行测试,其中,虚拟测试环境包括多个测试指令,且多个测试指令至少包括试加载测试指令、版本测试指令、卸载测试指令、多个功能测试指令;
    虚拟测试环境依次按照试加载测试、版本测试、卸载测试、功能测试的顺序对升级JAR包进行测试。
  6. 根据权利要求5所述的分布式的模块升级方法,其特征在于,虚拟测试环境执行试加载测试的过程包括:
    调用实时测试用例运行升级JAR包并实时获取主机的CPU的实时状态信息和内存的实时装置信息;
    根据CPU的实时状态信息和内存的实时装置信息判断该升级JAR包是否会导致某个节点出现过载,若是,则停止测试输出测试报告,若不是,则触发版本测试程序;
    版本测试的步骤包括:判断JAR包的版本号是否满足预设版本号迭代规则,若是,则执行版本的安全性测试,若不是则停止测试,
    其中,版本的安全性测试步骤包括:从该升级JAR包的参数信息获取该升级JAR的加密认证密钥,接着,按照加密规则解析该加密认证密钥,最后,根据该加密认证密钥的解析结果判断该升级JAR包是否具有安全性,即若该加密认证密钥能够被解析正确,则确定该升级JAR包具有安全性;
    卸载测试的过程为:将升级JAR包卸载并保存该升级JAR包的运行数据;接者,读取原始运行数据并将该升级JAR包的运行数据与原始运行数据进行比对并判断指定数据项的数值是否一致,若是,则确定当该升级JAR包满足兼容性要求,即该升级JAR卸载后,并不会影响默认版本JAR包的运行;
    功能测试包括如下步骤:调用测试用例执行功能函数并获取执行结果;接着,将该执行结果与函数名对应的值域进行比较,若执行结果没有在该值域内,则确定该功能函数测试失败。
  7. 根据权利要求6所述的分布式的模块升级方法,其特征在于,执行试加载测试过程中,根据CPU的实时状态信息和内存的实时占用信息判断升级JAR包是否会导致某个节点出现过载的判断过程是:依次判断CPU的负载率是否大于预设负载阈值、内存的使用量是否大于预设使用量阈值,若两次判断的结果均为是,则确定该升级JAR包会导致某个节点出现过载。
  8. 根据权利要求6所述的分布式的模块升级方法,其特征在于,执行试加载测试过程中,使用nnbench类调用实时测试用例来测试升级JAR包的节点负载。
  9. 根据权利要求1所述的分布式的模块升级方法,其特征在于,主机确定目标功能模块的最优升级节点的步骤包括:
    从升级JAR包的测试结果提取该升级JAR包的环境依赖数据,其中,环境依赖数据至少包括节点负载数据、节点接口数据、节点操作系统数据;
    根据节点负载数据从多个节点中筛选出多个负载满足该升级JAR包运行的节点作为备用节点;
    将每个备用节点的节点接口数据、操作系统参数与该升级JAR包的节点接口要求、节点操作系统要求进行比对,从而确定满足升级JAR包的要求的最优升级节点。
  10. 根据权利要求1所述的分布式的模块升级方法,其特征在于,当主机判断没有最优节点时,主机接收节点增加请求,其中,节点增加请求包括节点增加数量、节点的操作系统类型、节点的环境参数;
    主机使用虚拟器并根据节点增加数量创建虚拟机;
    主机根据节点的操作系统类型设置虚拟机的操作系统;
    主机根据节点的环境参设置虚拟机的部署参数。
  11. 一种分布式的模块升级装置,其特征在于,包括:
    解耦模块,用于根据功能分类从系统中解耦出与各目标功能模块对应的多个基础功能模块,其中,目标功能模块的解耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各基础功能模块之间通过所述通信接口通信;
    节点部署模块,用于将基础功能模块部署在预设的节点上,并使得各节点通过目标功能模块的通信参数建立节点与主机之间的通信;
    测试模块,用于使在主机接收到针对某一目标功能模块的升级请求后,按照预设的测试规则测试升级JAR包,以测试该升级JAR包;
    最优升级节点确定模块,用于使主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;
    升级模块,用于使主机向最优升级节点发送针对目标功能模块的JAR包更替请求,该JAR包更替请求包括升级JAR包的版本号,以及升级JAR包的下载路径,最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级。
  12. 一种电子装置,其特征在于,该电子装置包括:存储器和处理器,所述存储器中存储有分布式的模块升级程序,所述分布式的模块升级程序被所述处理器执行时实现如下步骤:
    A、根据功能分类从系统中解耦出与各目标功能模块分别对应的基础功能模块,并设置各目标功能模块与主机的通信参数,其中,目标功能模块的解耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各目标功能模块之间通过基础功能模块的所述通信接口通信;
    B、将基础功能模块部署在预设的节点上,并使得各节点通过目标功能模块的通信参数建立节点与主机之间的通信;
    C、主机接收到针对某一目标功能模块的升级请求,主机按照预设的测试规则测试升级JAR包其中,升级请求包括目标功能模块的升级JAR包及该升级JAR包的参数信息,且升级JAR包的参数信息包括JAR包的版本参数;
    D、主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;
    E、主机向最优升级节点发送针对目标功能模块的JAR包更替请求,其中,该JAR包更替请求包括升级JAR包的版本号,以及升级JAR包的下载路径;
    F、最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级。
  13. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时,实现如下步骤:
    A、根据功能分类从系统中解耦出与各目标功能模块分别对应的基础功能模块,并设置各目标功能模块与主机的通信参数,其中,目标功能模块的解耦过程包括根据预设的数据通信规则设置基础功能模块的通信接口,各目标功能模块之间通过基础功能模块的所述通信接口通信;
    B、将基础功能模块部署在预设的节点上,并使得各节点通过目标功能模块的通信参数建立节点与主机之间的通信;
    C、主机接收到针对某一目标功能模块的升级请求,主机按照预设的测试规则测试升级JAR包,其中,升级请求包括目标功能模块的升级JAR包及该升级JAR包的参数信息,且升级JAR包的参数信息包括JAR包的版本参数;
    D、主机根据各个节点的实时运行参数、历史运行参数及测试结果从所有节点中选出该目标功能模块的最优升级节点;
    E、主机向最优升级节点发送针对目标功能模块的JAR包更替请求,其中,该JAR包更替请求包括升级JAR包的版本号,以及升级JAR包的下载路径;
    F、最优升级节点根据下载路径下载升级JAR包,并更替目标功能模块的旧JAR包,完成目标功能模块的升级。。
  14. 根据权利要求13所述的一种计算机可读存储介质,其特征在于,所述主机接收到的升级请求还包括升级JAR包的部署信息,其中,部署信息包括可支持系统信息、JAR的编码规则、JAR包依赖组件的标识。
  15. 根据权利要求13所述的一种计算机可读存储介质,其特征在于,主机接收到升级请求时,主机按照预设的测试规则测试升级JAR包的步骤包括:
    将升级JAR包放入虚拟测试环境中进行测试,其中,虚拟测试环境包括多个测试指令,且多个测试指令至少包括试加载测试指令、版本测试指令、卸载测试指令、多个功能测试指令;
    虚拟测试环境依次按照试加载测试、版本测试、卸载测试、功能测试的顺序对升级JAR包进行测试。
  16. 根据权利要求15所述的一种计算机可读存储介质,其特征在于,虚拟测试环境执行试加载测试的过程包括:
    调用实时测试用例运行升级JAR包并实时获取主机的CPU的实时状态 信息和内存的实时装置信息;
    根据CPU的实时状态信息和内存的实时装置信息判断该升级JAR包是否会导致某个节点出现过载,若是,则停止测试输出测试报告,若不是,则触发版本测试程序;
    版本测试的步骤包括:判断JAR包的版本号是否满足预设版本号迭代规则,若是,则执行版本的安全性测试,若不是则停止测试,
    其中,版本的安全性测试步骤包括:从该升级JAR包的参数信息获取该升级JAR的加密认证密钥,接着,按照加密规则解析该加密认证密钥,最后,根据该加密认证密钥的解析结果判断该升级JAR包是否具有安全性,即若该加密认证密钥能够被解析正确,则确定该升级JAR包具有安全性;
    卸载测试的过程为:将升级JAR包卸载并保存该升级JAR包的运行数据;接者,读取原始运行数据并将该升级JAR包的运行数据与原始运行数据进行比对并判断指定数据项的数值是否一致,若是,则确定当该升级JAR包满足兼容性要求,即该升级JAR卸载后,并不会影响默认版本JAR包的运行;
    功能测试包括如下步骤:调用测试用例执行功能函数并获取执行结果;接着,将该执行结果与函数名对应的值域进行比较,若执行结果没有在该值域内,则确定该功能函数测试失败。
  17. 根据权利要求16所述的一种计算机可读存储介质,其特征在于,执行试加载测试过程中,根据CPU的实时状态信息和内存的实时占用信息判断升级JAR包是否会导致某个节点出现过载的判断过程是:依次判断CPU的负载率是否大于预设负载阈值、内存的使用量是否大于预设使用量阈值,若两次判断的结果均为是,则确定该升级JAR包会导致某个节点出现过载。
  18. 根据权利要求16所述的一种计算机可读存储介质,其特征在于,执行试加载测试过程中,使用nnbench类调用实时测试用例来测试升级JAR包的节点负载。
  19. 根据权利要求13所述的一种计算机可读存储介质,其特征在于,主机确定目标功能模块的最优升级节点的步骤包括:
    从升级JAR包的测试结果提取该升级JAR包的环境依赖数据,其中,环境依赖数据至少包括节点负载数据、节点接口数据、节点操作系统数据;
    根据节点负载数据从多个节点中筛选出多个负载满足该升级JAR包运行 的节点作为备用节点;
    将每个备用节点的节点接口数据、操作系统参数与该升级JAR包的节点接口要求、节点操作系统要求进行比对,从而确定满足升级JAR包的要求的最优升级节点。
  20. 根据权利要求13所述的一种计算机可读存储介质,其特征在于,当主机判断没有最优节点时,主机接收节点增加请求,其中,节点增加请求包括节点增加数量、节点的操作系统类型、节点的环境参数;
    主机使用虚拟器并根据节点增加数量创建虚拟机;
    主机根据节点的操作系统类型设置虚拟机的操作系统;
    主机根据节点的环境参设置虚拟机的部署参数。
PCT/CN2019/117808 2019-08-05 2019-11-13 分布式的模块升级方法、装置及存储介质 WO2021022713A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910716847.2A CN110597531B (zh) 2019-08-05 2019-08-05 分布式的模块升级方法、装置及存储介质
CN201910716847.2 2019-08-05

Publications (1)

Publication Number Publication Date
WO2021022713A1 true WO2021022713A1 (zh) 2021-02-11

Family

ID=68853626

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117808 WO2021022713A1 (zh) 2019-08-05 2019-11-13 分布式的模块升级方法、装置及存储介质

Country Status (2)

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

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113885913A (zh) * 2021-09-30 2022-01-04 珠海虎江科技有限公司 虚拟现实显示设备的升级方法、计算机装置及计算机可读存储介质
CN115658116A (zh) * 2022-11-11 2023-01-31 苏州浪潮智能科技有限公司 一种存储集群升级控制方法、装置、设备及存储介质
CN116149707A (zh) * 2023-02-22 2023-05-23 北京志凌海纳科技有限公司 分布式系统的升级风险检测和规避方法及装置
CN116501359A (zh) * 2023-06-29 2023-07-28 深圳和润达科技有限公司 对设备进行自适应远程升级的方法、装置、系统及介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240715A (zh) * 2019-12-31 2020-06-05 兰剑智能科技股份有限公司 设备升级方法、装置、电子设备和计算机可读介质
US11334459B2 (en) * 2020-08-18 2022-05-17 Advantest Corporation Flexible test systems and methods
CN112527634B (zh) * 2020-11-25 2023-06-02 中国联合网络通信集团有限公司 程序划分方法及装置、软件测试方法及平台
CN114422994A (zh) * 2022-03-29 2022-04-29 龙旗电子(惠州)有限公司 固件升级方法、装置及电子设备、存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105389191A (zh) * 2015-12-11 2016-03-09 北京奇虎科技有限公司 一种基于局域网的软件升级方法、装置和系统
CN107133063A (zh) * 2017-03-10 2017-09-05 西安中科创达软件有限公司 一种定制化的软件升级方法及移动终端
CN108768758A (zh) * 2018-08-31 2018-11-06 郑州云海信息技术有限公司 分布式存储系统在线升级方法、装置、设备及存储介质

Family Cites Families (7)

* 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 (zh) * 2015-12-02 2016-05-18 中国银联股份有限公司 用于分布式数据处理系统的模拟测试方法
CN106201607A (zh) * 2016-07-04 2016-12-07 乐视控股(北京)有限公司 一种软件版本的升级方法及设备
CN108667641A (zh) * 2017-03-30 2018-10-16 杭州海康威视数字技术股份有限公司 分布式系统升级方法、分布式系统及升级管理设备
CN108334370B (zh) * 2017-05-26 2021-02-09 中国电子科技集团公司第四十一研究所 一种分布式测试系统的软件自动增量更新升级方法
CN108632375B (zh) * 2018-05-09 2021-04-27 四川华创世纪科技有限公司 一种针对分布式部署服务软件程序的在线升级方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105389191A (zh) * 2015-12-11 2016-03-09 北京奇虎科技有限公司 一种基于局域网的软件升级方法、装置和系统
CN107133063A (zh) * 2017-03-10 2017-09-05 西安中科创达软件有限公司 一种定制化的软件升级方法及移动终端
CN108768758A (zh) * 2018-08-31 2018-11-06 郑州云海信息技术有限公司 分布式存储系统在线升级方法、装置、设备及存储介质

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113885913A (zh) * 2021-09-30 2022-01-04 珠海虎江科技有限公司 虚拟现实显示设备的升级方法、计算机装置及计算机可读存储介质
CN115658116A (zh) * 2022-11-11 2023-01-31 苏州浪潮智能科技有限公司 一种存储集群升级控制方法、装置、设备及存储介质
CN116149707A (zh) * 2023-02-22 2023-05-23 北京志凌海纳科技有限公司 分布式系统的升级风险检测和规避方法及装置
CN116149707B (zh) * 2023-02-22 2023-09-01 北京志凌海纳科技有限公司 分布式系统的升级风险检测和规避方法及装置
CN116501359A (zh) * 2023-06-29 2023-07-28 深圳和润达科技有限公司 对设备进行自适应远程升级的方法、装置、系统及介质
CN116501359B (zh) * 2023-06-29 2023-09-15 深圳和润达科技有限公司 对设备进行自适应远程升级的方法、装置、系统及介质

Also Published As

Publication number Publication date
CN110597531B (zh) 2022-11-08
CN110597531A (zh) 2019-12-20

Similar Documents

Publication Publication Date Title
WO2021022713A1 (zh) 分布式的模块升级方法、装置及存储介质
US9811368B2 (en) Model-based virtual system provisioning
CN106156186B (zh) 一种数据模型管理装置、服务器及数据处理方法
US20060235664A1 (en) Model-based capacity planning
US6871223B2 (en) System and method for agent reporting in to server
US10656971B2 (en) Agile framework for vertical application development and delivery
US20050262501A1 (en) Software distribution method and system supporting configuration management
US20080072219A1 (en) Deployment and versioning of applications
CN109614167B (zh) 一种管理插件的方法和系统
US11175901B2 (en) Distribution and execution of instructions in a distributed computing environment
US10929115B2 (en) Distribution and execution of instructions in a distributed computing environment
KR101751515B1 (ko) 테스트 실행 장치, 방법 및 컴퓨터 프로그램
CN111679888A (zh) 一种代理容器的部署方法及装置
US9904574B2 (en) Parallel computing without requiring antecedent code deployment
CN112685410A (zh) 业务规则校验方法、装置、计算机设备及存储介质
CN112860282A (zh) 集群插件的升级方法、装置和服务器
CN113330419A (zh) 一种设备应用安装方法和装置
CN114661319A (zh) 软件升级稳定性推荐
CN110222535A (zh) 区块链配置文件的处理装置、方法及存储介质
CN112363731A (zh) 一种应用自动化部署方法、装置和计算机可读存储介质
CN107943504A (zh) 一种嵌入式系统中软件模块的动态升级方法
US11169813B2 (en) Policy handling for data pipelines
US20140013317A1 (en) Computer-readable recording medium, patch determination method, and information processing apparatus
CN112564979B (zh) 构建任务的执行方法、装置、计算机设备和存储介质
CN115237631A (zh) 一种基于数据共享插件的易扩展式数据共享系统及方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19940253

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19940253

Country of ref document: EP

Kind code of ref document: A1