WO2011076058A1 - Distributed databases upgrade method, upgrade processing device and upgrade controlling device - Google Patents

Distributed databases upgrade method, upgrade processing device and upgrade controlling device Download PDF

Info

Publication number
WO2011076058A1
WO2011076058A1 PCT/CN2010/079425 CN2010079425W WO2011076058A1 WO 2011076058 A1 WO2011076058 A1 WO 2011076058A1 CN 2010079425 W CN2010079425 W CN 2010079425W WO 2011076058 A1 WO2011076058 A1 WO 2011076058A1
Authority
WO
WIPO (PCT)
Prior art keywords
upgrade
database
database script
script
processing device
Prior art date
Application number
PCT/CN2010/079425
Other languages
French (fr)
Chinese (zh)
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 WO2011076058A1 publication Critical patent/WO2011076058A1/en

Links

Classifications

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

Definitions

  • the present invention relates to the field of distributed databases, and in particular, to a method for upgrading a distributed database, an upgrade processing device, and an upgrade control device. Background technique
  • the technical problem to be solved by the present invention is to provide a method for upgrading a distributed database, an upgrade processing device, and an upgrade control device, which can solve the problem that a distributed database has a business interruption during the upgrade process.
  • a method for a distributed database upgrade where the distributed database includes at least two database devices, each of which is provided with an upgrade processing device, and the method includes:
  • the upgrade processing device receives and stores a first database script sent by the upgrade control device, and creates a new data object according to the first database script, and upgrades the database of the database device;
  • the upgrade processing device switches the currently used database script from the second database script to the first database script; the second database script is a database script for processing the data access request before the upgrade succeeds.
  • the method further includes:
  • the upgrade processing device receives a database script query request sent by the upgrade control device, and returns a second database script to the upgrade control unit.
  • the method further includes:
  • the upgrade processing device Upon receiving the data access request, the upgrade processing device processes the data access request using the first database script.
  • the method further includes:
  • the upgrade processing device returns an upgrade result to the upgrade control device.
  • the method further includes:
  • the upgrade processing device corresponding to the upgraded database receives the fallback request sent by the upgrade control device;
  • the upgrade processing device switches the currently used database script from the first database script to the second database script according to the received backoff request, and deletes the newly created database Data object.
  • An upgrade processing device is deployed on a database device of a distributed database, and the device includes:
  • a receiving module configured to receive a first database script sent by the upgrade control device
  • An upgrade module configured to create a new data object according to the first database script, and upgrade a database of the database device;
  • a switching module configured to: after the upgrade succeeds, switch the currently used database script from the second database script to the first database script, where the second database script is a database script for processing the data access request before the upgrade succeeds .
  • the device also includes:
  • a query module configured to receive a database script query request, and query the database script currently used by the database device according to the query module;
  • a sending module configured to return a second database script to the upgrade control device.
  • the device also includes:
  • a processing module configured to process the data access request by using the first database script after the switching module switches the database script from the second database script to the first database script.
  • the device also includes:
  • Receiving a fallback request module configured to receive a fallback request sent by the upgrade control device after the upgrade is successful
  • the fallback module is configured to switch the currently used database script from the first database script to the second database script, and delete the newly created data object.
  • An upgrade control device is used for the upgrade of the distributed database, the distributed database includes at least two database devices, and the upgrade processing device is deployed on the database device, and the upgrade control device includes:
  • a sending module configured to send a database script query request to the upgrade processing device
  • a control module configured to determine, according to the second database script returned by the upgrade processing device, that the database of the database device needs to be upgraded, and control the sending module to send the first for the database upgrade to the upgrade processing device Database script.
  • the device also includes:
  • a receiving module configured to receive a storage result returned by the upgrade processing device
  • the sending module is further configured to send an upgrade request to the upgraded processing device that is successfully stored according to the storage result received by the receiving module.
  • the receiving module is further configured to receive an upgrade result returned by the upgrade processing device, where the sending module is further configured to perform an upgrade upgrade process successfully when a part of the database upgrade fails according to the upgrade result received by the receiving module.
  • the device sends a fallback request.
  • the upgrade control device centrally controls the upgrade progress of multiple upgrade processing devices in the distributed database to achieve centralized upgrade.
  • the upgrade processing device simultaneously saves at least two database scripts before and after the upgrade, and the upgrade processing device creates a new data object process after the upgrade.
  • the database script is not switched, so that the database script can be used to process the data access request during the upgrade process, so that the service is not interrupted during the upgrade process, and the data access quality is guaranteed.
  • FIG. 1 is a flowchart of a distributed database upgrade according to an embodiment of the present invention
  • FIG. 2 is a diagram of an upgrade processing apparatus according to an embodiment of the present invention.
  • FIG. 3 is a diagram of an upgrade control apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram showing the relationship between an upgrade control device and an upgrade processing device according to an embodiment of the present invention
  • FIG. 5 is a flowchart of a distributed database upgrade according to another embodiment of the present invention. detailed description
  • the embodiment of the present invention is directed to the problem that the distributed database is interrupted during the upgrade process in the prior art, and provides a distributed database upgrade method, an upgrade processing device, and an upgrade control device, which can avoid the distributed database during the upgrade process. A business disruption occurred.
  • the embodiment of the present invention provides a method for upgrading a distributed database.
  • the distributed database includes at least two database devices, and an upgrade processing device is deployed on each database device. As shown in FIG. 1 , the embodiment includes:
  • Step 101 The upgrade processing device receives and stores the first database script sent by the upgrade control device.
  • Step 102 The upgrade processing device creates a new data object according to the first database script, and upgrades the database of the database device.
  • Step 103 After the upgrade is successful, the upgrade processing device switches the database script from the second database script to the first database script, and the second database script is a database script for the upgrade processing device to process the data access request before and during the upgrade process.
  • the first database script is a new database script received by the upgrade processing device, and the second database script corresponds to an old database script stored before the upgrade processing device.
  • the upgrade processing device saves the database scripts before and after the upgrade, and does not switch the database script during the process of upgrading the database after creating the upgraded new data object.
  • the embodiment of the present invention further provides an upgrade processing apparatus, which is deployed on each database device of the distributed database.
  • the embodiment includes:
  • the receiving module 20 is configured to receive a first database script sent by the upgrade control device, a storage module 21, configured to store the first database script received by the receiving module 20, and an upgrade module 22, configured to create new data according to the first database script.
  • Object upgrade the database of the database device;
  • the switching module 23 is configured to switch the database script from the second database script to the first database script after the upgrade is successful, and the second database script is a database script used by the upgrade processing device to process the data access request before and during the upgrade process. .
  • the device further comprises:
  • the query module 24 is configured to receive a database script query request sent by the upgrade control device, and query a database script currently used by the database device;
  • the sending module 25 is configured to return a second database script to the upgrade control device, where the first database script is a script sent by the upgrade control device for the database upgrade when the database needs to be upgraded according to the returned second database script.
  • the device also includes:
  • the processing module 26 is configured to process the data access request received by the database device by using the first database script after the switching module 23 switches the database script from the second database script to the first database script.
  • the processing module 26 is further configured to process the data access request received by the database device using the second database script before the switching module 23 switches the database script from the second database script to the first database script.
  • the device also includes:
  • Receiving a fallback request module 27, configured to receive a fallback request sent by the upgrade control device after the upgrade is successful, where the rollback request is a request sent by the upgrade control device when the partial database upgrade fails; the fallback module 28 is configured to use the database
  • the script switches from the first database script to the second database script and deletes the newly created data object. No connection is required between multiple upgrade processing devices on a distributed database.
  • the first database script is a new database script received by the upgrade processing device, and the second database script corresponds to an old database script stored before the upgrade processing device.
  • the upgrade processing device of this embodiment saves both the pre-upgrade and post-upgrade database scripts, and does not switch the database script during the process of upgrading the database after creating the upgraded new data object, so that the upgrade process can still be performed during the upgrade process.
  • the database script before the upgrade is not deleted, so that when the rollback request is received, the workload of the rollback can be reduced, the rollback efficiency is improved, and the rollback does not generate an error, thereby avoiding the quality of the data access service. decline.
  • the embodiment of the present invention further provides an upgrade control apparatus, which is used for upgrading a distributed database.
  • the distributed database includes at least two database devices, and an upgrade processing device is deployed on each database device, as shown in FIG. Examples include:
  • the sending module 30 is configured to send a database script query request to the upgrade processing device.
  • the control module 31 is configured to determine, according to the second database script returned by the upgrade processing device, that the database of the database device needs to be upgraded, and the control sending module 31 sends the upgrade to the upgrade processing device.
  • the device further comprises:
  • the receiving module 32 is configured to receive a storage result returned by the upgrade processing device.
  • the sending module 30 is further configured to send an upgrade request to the upgrade processing device that successfully stores according to the storage result received by the receiving module 32.
  • the receiving module 32 is further configured to receive the upgrade result returned by the upgrade processing device.
  • the sending module 30 is further configured to send a fallback request to the upgraded upgrade processing device when the partial database upgrade fails according to the upgrade result received by the receiving module 32. .
  • the upgrade control device of this embodiment may be deployed in the same number as one upgrade processing device. According to the library device, it can also be deployed on a single computer device.
  • the upgrade control device and the upgrade processing device are connected by a network including a local area network and a wide area network.
  • the upgrade control device of the embodiment can centrally control the upgrade or rollback progress of multiple database devices in the distributed database, thereby implementing centralized upgrade of the distributed database, and avoiding inconsistent database versions between different database devices of the distributed database.
  • the relationship between the upgrade control device and the upgrade processing device is shown in Figure 4.
  • the method for upgrading the distributed database in the embodiment of the present invention is further described below with reference to FIG. 5.
  • the embodiment includes:
  • Step 501 The upgrade control device sends a database version query request to the upgrade processing device.
  • the upgrade control device sends a database version query request to the upgrade processing device (only one upgrade processing device is shown in FIG. 5), and requests the database version information to be queried. ;
  • Step 502 The upgrade processing device returns database version information to the upgrade control device.
  • the upgrade processing device queries database version information of the database device, and returns version information of the database device to the upgrade control device.
  • Step 503 The upgrade control device confirms the database device that needs to be upgraded
  • the upgrade control device confirms the database device to be upgraded according to the database version information returned by the upgrade processing device; for example, the upgrade control device needs to upgrade all the database devices to use the new database script, first query the database script currently used by the database device, if some are received
  • the database version information returned by the upgrade processing device on the database device is the old database script used by the database device, then it is confirmed that these database devices need to be upgraded; if some database devices use the old database script, but do not need to upgrade, It does not affect other database devices that need to be upgraded, so you can not upgrade these databases.
  • Step 504 The upgrade control device sends a new database script to the upgrade processing device; and the upgrade control device loads the upgrade process on one or more database devices that need to be upgraded. Sending a new database script; if the bandwidth between the upgrade control device and the upgrade processing device is limited, the upgrade control device may compress the new database script and then send it to the upgrade processing device;
  • Step 505 The upgrade processing device receives and saves the new database script ;
  • the upgrade processing device on the database device receives and saves the new database script to the local storage medium, and the upgrade processing device also stores the old database script;
  • Step 506 The upgrade processing device returns a storage result to the upgrade control device.
  • the upgrade processing device on the database device returns a new database script storage result to the upgrade control device;
  • Step 507 The upgrade control device sends an upgrade request to the upgrade processing device that is successfully stored.
  • the upgrade control device sends an upgrade request to the upgrade processing device that successfully receives and stores the new database script according to the received storage result.
  • the upgrade control device may use the retransmission mechanism to resend the new database to the upgrade processing device after the second preset time.
  • Step 508 The upgrade processing device creates a new data object according to the new database script; the upgrade processing device compares whether the upgraded new database script and the old database script before the upgrade are compatible, and analyzes the new data object added by the new database script.
  • the old database script is used to process the data access request from the service/application, and the request for the service/application access to the database can be processed normally.
  • the upgrade processing device After analyzing the new database script successfully and judging the compatibility of the old and new database scripts, the upgrade processing device creates a new data object, upgrades the database of the database device in which it is located, and uses the old database script to process the service/application from the same time while creating the new data object.
  • the upgrade processing device processes the data access request from the business/application using the new database script
  • Step 510 The upgrade processing device returns an upgrade result to the upgrade control device.
  • the upgrade processing device fails to analyze the new database or the new and old database scripts are incompatible, or the upgrade processing device fails to create a new data object, the upgrade processing device returns an upgrade result of the upgrade failure to the upgrade control device, otherwise returns Upgrade successful upgrade results.
  • Step 511 The upgrade control device sends a fallback request to the upgraded upgrade processing device; after the partial database upgrade fails, the upgrade control device returns a request to the upgraded database device;
  • Step 512 The upgrade processing device switches the database script and deletes the newly created data object. After receiving the fallback request, the upgrade processing device switches the data access request of the processing service/application to the old database script before the upgrade, and automatically deletes the upgraded file. New data object created;
  • Step 513 The upgrade processing device returns a rollback result to the upgrade control device.
  • the upgrade control device may query the upgrade processing device for the version information of the database device before and after the upgrade or the upgrade process, and the upgrade processing device queries the database version information and returns the information to the upgrade control device.
  • the distributed database upgrade method in this embodiment can implement centralized upgrade of databases on multiple database devices of a distributed database, thereby avoiding the problem of inconsistent data of multiple database devices.
  • the upgrade processing device saves at least two database scripts before and after the upgrade, and the upgrade processing device does not switch the database script during the process of creating the upgraded new data object, so that the upgrade process can still be used before the upgrade process.
  • the database script processes the data access request, so that the service is not interrupted during the upgrade process, and the data access quality is guaranteed.
  • the method embodiment is corresponding to the device embodiment, and the portion not described in detail in the method embodiment may refer to the description of the relevant part in the device embodiment, and the partial reference method not described in detail in the device embodiment. The description of the relevant parts in the embodiment can be.
  • the steps of the foregoing embodiments may be implemented by a program to instruct related hardware, and the program may be stored in a computer readable storage medium.
  • the method includes the steps of the foregoing method embodiment, such as: a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM). Wait.
  • sequence numbers of the steps are not used to limit the sequence of the steps.
  • the steps of the steps are changed without any creative work. It is also within the scope of the invention.

Abstract

A distributed databases upgrade method, an upgrade processing device and an upgrade controlling device are provided. The distributed databases comprise at least two database equipments, and the upgrade processing device is disposed on each of the database equipments; and the upgrade processing device receives and stores the first database script sent by the upgrade controlling device (101), and creates the new data object according to the first database script and upgrades the database of the database equipment (102); the upgrade processing device switches the currently used database script from the second database script to the first database script after the update is successful (103); the second database script is the database script used to process the data access request before the upgrade is successful. The present invention can still use the database script pre-upgraded to process the data access request during the upgrade so as to implement the service without interruption during the upgrade and to ensure the data access quality.

Description

分布式数据库升级的方法、 升级处理装置及升级控制装置 技术领域  Distributed database upgrade method, upgrade processing device and upgrade control device
本发明涉及分布式数据库领域, 特别涉及一种分布式数据库升级的方 法、 升级处理装置及升级控制装置。 背景技术  The present invention relates to the field of distributed databases, and in particular, to a method for upgrading a distributed database, an upgrade processing device, and an upgrade control device. Background technique
随着信息技术(Information Technology, IT )软硬件的发展以及社会信 息化进程的不断加快, 分布式数据库在通讯、 金融等行业内的应用越来越 广泛。 分布式数据库可以实现大容量、 多类别的数据存储, 又能通过多个 数据库设备之间的协同工作, 对外提供高性能的数据访问服务, 同时还能 通过分布在多个站点上的数据库设备实现数据在站点级别的容灾, 极大地 保证了数据的可靠性和安全性。 度和风险, 发明人在实现本发明的过程中, 发现现有技术中分布式数据库 在进行在线升级时存在以下缺陷: 在数据库设备在利用新的数据库脚本创 建新增的数据对象, 对数据库进行升级时, 对外提供的数据访问服务会有 中断, 影响业务 /应用访问数据库的质量。 在通信行业中, 如果出现部分数 据库设备不能工作, 则会造成响应时延, 影响终端用户体验。 发明内容  With the development of information technology (IT) software and hardware and the acceleration of social information processing, distributed databases are becoming more and more widely used in communications and finance industries. Distributed database can realize large-capacity and multi-category data storage, and can provide high-performance data access services through collaborative work between multiple database devices. At the same time, it can be realized by database devices distributed on multiple sites. The data is disaster-tolerant at the site level, which greatly ensures the reliability and security of the data. Degrees and risks, in the process of implementing the present invention, the inventors found that the distributed database in the prior art has the following defects when performing online upgrade: In the database device, a new data object is created by using a new database script, and the database is performed. When upgrading, the external data access service will be interrupted, affecting the quality of the business/application access database. In the communications industry, if some of the database devices fail to work, it will cause a response delay that affects the end user experience. Summary of the invention
本发明要解决的技术问题是提供一种分布式数据库升级的方法、 升级 处理装置及升级控制装置, 能够解决分布式数据库在升级过程中出现业务 中断的问题。  The technical problem to be solved by the present invention is to provide a method for upgrading a distributed database, an upgrade processing device, and an upgrade control device, which can solve the problem that a distributed database has a business interruption during the upgrade process.
为解决上述技术问题, 本发明的实施例提供技术方案如下: 一种分布式数据库升级的方法, 所述分布式数据库包括至少两个数据 库设备, 每个数据库设备上部署有升级处理装置, 所述方法包括: In order to solve the above technical problem, the embodiments of the present invention provide the following technical solutions: A method for a distributed database upgrade, where the distributed database includes at least two database devices, each of which is provided with an upgrade processing device, and the method includes:
所述升级处理装置接收并存储升级控制装置发送的第一数据库脚本, 并根据所述第一数据库脚本创建新的数据对象, 升级所述数据库设备的数 据库;  The upgrade processing device receives and stores a first database script sent by the upgrade control device, and creates a new data object according to the first database script, and upgrades the database of the database device;
升级成功后, 所述升级处理装置将当前所使用的数据库脚本从第二数 据库脚本切换为所述第一数据库脚本; 所述第二数据库脚本为升级成功之 前用于处理数据访问请求的数据库脚本。  After the upgrade is successful, the upgrade processing device switches the currently used database script from the second database script to the first database script; the second database script is a database script for processing the data access request before the upgrade succeeds.
所述升级处理装置接收并存储升级控制装置发送的第一数据库脚本之 前, 该方法还包括:  Before the upgrade processing device receives and stores the first database script sent by the upgrade control device, the method further includes:
所述升级处理装置接收所述升级控制装置发送的数据库脚本查询请 求, 并向所述升级控制单元返回第二数据库脚本。  The upgrade processing device receives a database script query request sent by the upgrade control device, and returns a second database script to the upgrade control unit.
所述升级处理装置将数据库脚本从第二数据库脚本切换为所述第一数 据库脚本之后, 该方法还包括:  After the upgrade processing device switches the database script from the second database script to the first database script, the method further includes:
若接收到数据访问请求, 所述升级处理装置使用所述第一数据库脚本 处理所述数据访问请求。  Upon receiving the data access request, the upgrade processing device processes the data access request using the first database script.
所述升级处理装置将数据库脚本从第二数据库脚本切换为所述第一数 据库脚本之后, 该方法还包括:  After the upgrade processing device switches the database script from the second database script to the first database script, the method further includes:
所述升级处理装置向所述升级控制装置返回升级结果。  The upgrade processing device returns an upgrade result to the upgrade control device.
所述升级处理装置向所述升级控制装置返回升级结果之后, 该方法还 包括:  After the upgrade processing device returns the upgrade result to the upgrade control device, the method further includes:
升级成功的数据库对应的升级处理装置接收所述升级控制装置发送的 回退请求;  The upgrade processing device corresponding to the upgraded database receives the fallback request sent by the upgrade control device;
所述升级处理装置根据收到的回退请求, 将当前所使用的数据库脚本 从所述第一数据库脚本切换为所述第二数据库脚本, 并删除所述新创建的 数据对象。 The upgrade processing device switches the currently used database script from the first database script to the second database script according to the received backoff request, and deletes the newly created database Data object.
一种升级处理装置, 部署在分布式数据库的数据库设备上, 所述装置 包括:  An upgrade processing device is deployed on a database device of a distributed database, and the device includes:
接收模块, 用于接收升级控制装置发送的第一数据库脚本;  a receiving module, configured to receive a first database script sent by the upgrade control device;
升级模块, 用于根据所述第一数据库脚本创建新的数据对象, 升级所 述数据库设备的数据库;  An upgrade module, configured to create a new data object according to the first database script, and upgrade a database of the database device;
切换模块, 用于在升级成功后, 将当前所使用的数据库脚本从第二数 据库脚本切换为所述第一数据库脚本, 所述第二数据库脚本为升级成功之 前用于处理数据访问请求的数据库脚本。  a switching module, configured to: after the upgrade succeeds, switch the currently used database script from the second database script to the first database script, where the second database script is a database script for processing the data access request before the upgrade succeeds .
该装置还包括:  The device also includes:
查询模块, 用于接收数据库脚本查询请求, 据此查询所述数据库设备 当前所使用的数据库脚本;  a query module, configured to receive a database script query request, and query the database script currently used by the database device according to the query module;
发送模块, 用于向所述升级控制装置返回第二数据库脚本。  And a sending module, configured to return a second database script to the upgrade control device.
该装置还包括:  The device also includes:
处理模块, 用于在所述切换模块将数据库脚本从第二数据库脚本切换 为所述第一数据库脚本之后, 使用所述第一数据库脚本处理数据访问请求。  And a processing module, configured to process the data access request by using the first database script after the switching module switches the database script from the second database script to the first database script.
该装置还包括:  The device also includes:
接收回退请求模块, 用于在升级成功后, 接收所述升级控制装置发送 的回退请求;  Receiving a fallback request module, configured to receive a fallback request sent by the upgrade control device after the upgrade is successful;
回退模块, 用于将当前所使用的数据库脚本从所述第一数据库脚本切 换为所述第二数据库脚本, 并删除所述新创建的数据对象。  The fallback module is configured to switch the currently used database script from the first database script to the second database script, and delete the newly created data object.
一种升级控制装置, 用于分布式数据库的升级, 所述分布式数据库包 括至少两个数据库设备, 数据库设备上部署有升级处理装置, 所述升级控 制装置包括:  An upgrade control device is used for the upgrade of the distributed database, the distributed database includes at least two database devices, and the upgrade processing device is deployed on the database device, and the upgrade control device includes:
发送模块, 用于向所述升级处理装置发送数据库脚本查询请求; 控制模块, 用于根据所述升级处理装置返回的第二数据库脚本判断出 所述数据库设备的数据库需要升级, 并控制所述发送模块向所述升级处理 装置发送用于所述数据库升级的第一数据库脚本。 a sending module, configured to send a database script query request to the upgrade processing device; a control module, configured to determine, according to the second database script returned by the upgrade processing device, that the database of the database device needs to be upgraded, and control the sending module to send the first for the database upgrade to the upgrade processing device Database script.
该装置还包括:  The device also includes:
接收模块, 用于接收所述升级处理装置返回的存储结果;  a receiving module, configured to receive a storage result returned by the upgrade processing device;
所述发送模块, 还用于根据所述接收模块接收到的存储结果, 向存储 成功的升级处理装置发送升级请求。  The sending module is further configured to send an upgrade request to the upgraded processing device that is successfully stored according to the storage result received by the receiving module.
所述接收模块, 还用于接收所述升级处理装置返回的升级结果; 所述发送模块, 还用于根据所述接收模块接收到的升级结果, 在部分 数据库升级失败时向升级成功的升级处理装置发送回退请求。  The receiving module is further configured to receive an upgrade result returned by the upgrade processing device, where the sending module is further configured to perform an upgrade upgrade process successfully when a part of the database upgrade fails according to the upgrade result received by the receiving module. The device sends a fallback request.
本发明的实施例具有以下有益效果:  Embodiments of the present invention have the following beneficial effects:
通过升级控制装置集中控制分布式数据库中多个升级处理装置的升级 进度来实现集中升级, 升级处理装置同时保存升级前后的至少 2份数据库 脚本, 升级处理装置在创建升级后的新的数据对象过程中并不切换数据库 脚本, 这样在升级过程中仍然可以使用升级前的数据库脚本处理数据访问 请求, 从而实现在升级的过程中业务不中断, 保证数据访问质量。 附图说明  The upgrade control device centrally controls the upgrade progress of multiple upgrade processing devices in the distributed database to achieve centralized upgrade. The upgrade processing device simultaneously saves at least two database scripts before and after the upgrade, and the upgrade processing device creates a new data object process after the upgrade. The database script is not switched, so that the database script can be used to process the data access request during the upgrade process, so that the service is not interrupted during the upgrade process, and the data access quality is guaranteed. DRAWINGS
图 1为本发明实施例的分布式数据库升级流程图;  1 is a flowchart of a distributed database upgrade according to an embodiment of the present invention;
图 2为本发明实施例的升级处理装置图;  2 is a diagram of an upgrade processing apparatus according to an embodiment of the present invention;
图 3为本发明实施例的升级控制装置图;  3 is a diagram of an upgrade control apparatus according to an embodiment of the present invention;
图 4为本发明实施例的升级控制装置与升级处理装置之间的关系示意 图;  4 is a schematic diagram showing the relationship between an upgrade control device and an upgrade processing device according to an embodiment of the present invention;
图 5为本发明另一实施例的分布式数据库升级流程图。 具体实施方式 FIG. 5 is a flowchart of a distributed database upgrade according to another embodiment of the present invention. detailed description
为使本发明的实施例要解决的技术问题、 技术方案和优点更加清楚, 下面将结合附图及具体实施例进行详细描述。  The technical problems, the technical solutions, and the advantages of the embodiments of the present invention will become more apparent from the following detailed description.
本发明的实施例针对现有技术中分布式数据库在升级过程中出现业务 中断的问题, 提供一种分布式数据库升级的方法、 升级处理装置及升级控 制装置, 能够避免分布式数据库在升级过程中出现业务中断。  The embodiment of the present invention is directed to the problem that the distributed database is interrupted during the upgrade process in the prior art, and provides a distributed database upgrade method, an upgrade processing device, and an upgrade control device, which can avoid the distributed database during the upgrade process. A business disruption occurred.
本发明实施例提供了一种分布式数据库升级的方法, 该分布式数据库 包括至少两个数据库设备,每个数据库设备上部署有升级处理装置, 如图 1 所示, 本实施例包括:  The embodiment of the present invention provides a method for upgrading a distributed database. The distributed database includes at least two database devices, and an upgrade processing device is deployed on each database device. As shown in FIG. 1 , the embodiment includes:
步骤 101 :升级处理装置接收并存储升级控制装置发送的第一数据库脚 本;  Step 101: The upgrade processing device receives and stores the first database script sent by the upgrade control device.
步骤 102: 升级处理装置根据第一数据库脚本创建新的数据对象, 升级 数据库设备的数据库;  Step 102: The upgrade processing device creates a new data object according to the first database script, and upgrades the database of the database device.
步骤 103: 升级成功后, 升级处理装置将数据库脚本从第二数据库脚本 切换为第一数据库脚本, 第二数据库脚本为升级处理装置在升级前以及升 级过程中用于处理数据访问请求的数据库脚本。  Step 103: After the upgrade is successful, the upgrade processing device switches the database script from the second database script to the first database script, and the second database script is a database script for the upgrade processing device to process the data access request before and during the upgrade process.
其中, 第一数据库脚本为升级处理装置接收到的新数据库脚本, 第二 数据库脚本对应为升级处理装置之前存储的旧数据库脚本。  The first database script is a new database script received by the upgrade processing device, and the second database script corresponds to an old database script stored before the upgrade processing device.
本实施例的分布式数据库升级的方法, 升级处理装置同时保存有升级 前和升级后的数据库脚本, 在创建升级后的新的数据对象, 对数据库进行 升级的过程中并不切换数据库脚本, 这样在升级过程中仍然可以使用升级 前的数据库脚本处理数据访问请求, 从而实现在升级的过程中业务不中断, 保证数据访问质量。  In the distributed database upgrade method of the embodiment, the upgrade processing device saves the database scripts before and after the upgrade, and does not switch the database script during the process of upgrading the database after creating the upgraded new data object. During the upgrade process, you can still use the pre-upgrade database script to process data access requests, so that services are not interrupted during the upgrade process, ensuring data access quality.
本发明实施例还提供了一种升级处理装置, 部署在分布式数据库的每 个数据库设备上, 如图 2所示, 本实施例包括: 接收模块 20, 用于接收升级控制装置发送的第一数据库脚本; 存储模块 21 , 用于存储接收模块 20接收到的第一数据库脚本; 升级模块 22, 用于根据第一数据库脚本创建新的数据对象, 升级数据 库设备的数据库; The embodiment of the present invention further provides an upgrade processing apparatus, which is deployed on each database device of the distributed database. As shown in FIG. 2, the embodiment includes: The receiving module 20 is configured to receive a first database script sent by the upgrade control device, a storage module 21, configured to store the first database script received by the receiving module 20, and an upgrade module 22, configured to create new data according to the first database script. Object, upgrade the database of the database device;
切换模块 23 , 用于在升级成功后, 将数据库脚本从第二数据库脚本切 换为第一数据库脚本, 第二数据库脚本为升级处理装置在升级前以及升级 过程中用于处理数据访问请求的数据库脚本。  The switching module 23 is configured to switch the database script from the second database script to the first database script after the upgrade is successful, and the second database script is a database script used by the upgrade processing device to process the data access request before and during the upgrade process. .
其中, 该装置还包括:  Wherein, the device further comprises:
查询模块 24, 用于接收升级控制装置发送的数据库脚本查询请求, 并 查询数据库设备当前所使用的的数据库脚本;  The query module 24 is configured to receive a database script query request sent by the upgrade control device, and query a database script currently used by the database device;
发送模块 25 , 用于向升级控制装置返回第二数据库脚本, 第一数据库 脚本为升级控制装置根据返回的第二数据库脚本判断出数据库需要升级 时, 发送的用于数据库升级的脚本。  The sending module 25 is configured to return a second database script to the upgrade control device, where the first database script is a script sent by the upgrade control device for the database upgrade when the database needs to be upgraded according to the returned second database script.
该装置还包括:  The device also includes:
处理模块 26,用于在切换模块 23将数据库脚本从第二数据库脚本切换 为第一数据库脚本之后, 使用第一数据库脚本处理数据库设备接收到的数 据访问请求。  The processing module 26 is configured to process the data access request received by the database device by using the first database script after the switching module 23 switches the database script from the second database script to the first database script.
处理模块 26还用于在切换模块 23将数据库脚本从第二数据库脚本切 换为第一数据库脚本之前, 使用第二数据库脚本处理数据库设备接收到的 数据访问请求。  The processing module 26 is further configured to process the data access request received by the database device using the second database script before the switching module 23 switches the database script from the second database script to the first database script.
该装置还包括:  The device also includes:
接收回退请求模块 27, 用于在升级成功后, 接收升级控制装置发送的 回退请求, 回退请求为升级控制装置在部分数据库升级失败时发送的请求; 回退模块 28 , 用于将数据库脚本从第一数据库脚本切换为第二数据库 脚本, 并删除新创建的数据对象。 分布式数据库上的多个升级处理装置之间不需要连接。 Receiving a fallback request module 27, configured to receive a fallback request sent by the upgrade control device after the upgrade is successful, where the rollback request is a request sent by the upgrade control device when the partial database upgrade fails; the fallback module 28 is configured to use the database The script switches from the first database script to the second database script and deletes the newly created data object. No connection is required between multiple upgrade processing devices on a distributed database.
其中, 第一数据库脚本为升级处理装置接收到的新数据库脚本, 第二 数据库脚本对应为升级处理装置之前存储的旧数据库脚本。  The first database script is a new database script received by the upgrade processing device, and the second database script corresponds to an old database script stored before the upgrade processing device.
本实施例的升级处理装置, 同时保存有升级前和升级后的数据库脚本, 在创建升级后的新的数据对象, 对数据库进行升级的过程中并不切换数据 库脚本, 这样在升级过程中仍然可以使用升级前的数据库脚本处理数据访 问请求, 从而实现在升级的过程中业务不中断, 保证数据访问质量。 本实 施例在升级成功后不删除升级前的数据库脚本, 这样在接收到回退请求时, 能够减少回退的工作量, 提高回退效率, 保证回退不产生错误, 从而避免 数据访问服务质量下降。  The upgrade processing device of this embodiment saves both the pre-upgrade and post-upgrade database scripts, and does not switch the database script during the process of upgrading the database after creating the upgraded new data object, so that the upgrade process can still be performed during the upgrade process. Use the database script before the upgrade to process the data access request, so that the service is not interrupted during the upgrade process, and the data access quality is guaranteed. In this embodiment, after the upgrade is successful, the database script before the upgrade is not deleted, so that when the rollback request is received, the workload of the rollback can be reduced, the rollback efficiency is improved, and the rollback does not generate an error, thereby avoiding the quality of the data access service. decline.
本发明实施例还提供了一种升级控制装置, 用于分布式数据库的升级, 分布式数据库包括至少两个数据库设备, 每个数据库设备上部署有升级处 理装置, 如图 3所示, 本实施例包括:  The embodiment of the present invention further provides an upgrade control apparatus, which is used for upgrading a distributed database. The distributed database includes at least two database devices, and an upgrade processing device is deployed on each database device, as shown in FIG. Examples include:
发送模块 30 , 用于向升级处理装置发送数据库脚本查询请求; 控制模块 31 , 用于根据升级处理装置返回的第二数据库脚本判断出数 据库设备的数据库需要升级, 控制发送模块 31向升级处理装置发送用于数 据库升级的第一数据库脚本。  The sending module 30 is configured to send a database script query request to the upgrade processing device. The control module 31 is configured to determine, according to the second database script returned by the upgrade processing device, that the database of the database device needs to be upgraded, and the control sending module 31 sends the upgrade to the upgrade processing device. The first database script for database upgrades.
其中, 该装置还包括:  Wherein, the device further comprises:
接收模块 32 , 用于接收升级处理装置返回的存储结果;  The receiving module 32 is configured to receive a storage result returned by the upgrade processing device.
发送模块 30还用于根据接收模块 32接收到的存储结果, 向存储成功 的升级处理装置发送升级请求。  The sending module 30 is further configured to send an upgrade request to the upgrade processing device that successfully stores according to the storage result received by the receiving module 32.
其中, 接收模块 32还用于接收升级处理装置返回的升级结果; 发送模块 30还用于根据接收模块 32接收到的升级结果, 在部分数据 库升级失败时向升级成功的升级处理装置发送回退请求。  The receiving module 32 is further configured to receive the upgrade result returned by the upgrade processing device. The sending module 30 is further configured to send a fallback request to the upgraded upgrade processing device when the partial database upgrade fails according to the upgrade result received by the receiving module 32. .
本实施例的升级控制装置可以和某一个升级处理装置部署在同一台数 据库设备上, 也可以单独部署在一台计算机设备上。 升级控制装置和升级 处理装置之间通过包括局域网和广域网在内的网络相连接。 The upgrade control device of this embodiment may be deployed in the same number as one upgrade processing device. According to the library device, it can also be deployed on a single computer device. The upgrade control device and the upgrade processing device are connected by a network including a local area network and a wide area network.
本实施例的升级控制装置, 能够集中控制分布式数据库中的多个数据 库设备的升级或者回退进度, 从而实现分布式数据库的集中升级, 避免分 布式数据库不同数据库设备之间的数据库版本不一致, 导致业务 /应用访问 的数据不一致的问题。  The upgrade control device of the embodiment can centrally control the upgrade or rollback progress of multiple database devices in the distributed database, thereby implementing centralized upgrade of the distributed database, and avoiding inconsistent database versions between different database devices of the distributed database. The problem of inconsistent data leading to business/application access.
在实际应用中,升级控制装置与升级处理装置之间的关系示意图如图 4 所示。 下面结合图 5对本发明实施例的分布式数据库升级的方法进行进一 步介绍, 如图 5所示, 本实施例包括:  In practical applications, the relationship between the upgrade control device and the upgrade processing device is shown in Figure 4. The method for upgrading the distributed database in the embodiment of the present invention is further described below with reference to FIG. 5. As shown in FIG. 5, the embodiment includes:
步骤 501 : 升级控制装置向升级处理装置发送数据库版本查询请求; 升级控制装置向升级处理装置 (图 5中只画出了 1个升级处理装置作 为示意)发送数据库版本查询请求, 要求查询数据库版本信息;  Step 501: The upgrade control device sends a database version query request to the upgrade processing device. The upgrade control device sends a database version query request to the upgrade processing device (only one upgrade processing device is shown in FIG. 5), and requests the database version information to be queried. ;
步骤 502: 升级处理装置向升级控制装置返回数据库版本信息; 升级处理装置查询数据库设备的数据库版本信息, 并向升级控制装置 返回数据库设备的版本信息;  Step 502: The upgrade processing device returns database version information to the upgrade control device. The upgrade processing device queries database version information of the database device, and returns version information of the database device to the upgrade control device.
步骤 503 : 升级控制装置确认需要升级的数据库设备;  Step 503: The upgrade control device confirms the database device that needs to be upgraded;
升级控制装置根据升级处理装置返回的数据库版本信息, 确认要升级 的数据库设备; 比如升级控制装置需要所有的数据库设备升级为使用新数 据库脚本, 首先查询数据库设备目前使用的数据库脚本, 如果接收到一些 数据库设备上的升级处理装置返回的数据库版本信息为数据库设备使用的 是旧数据库脚本, 那么就确认这些数据库设备需要进行升级; 如果一些数 据库设备使用的虽然是旧数据库脚本, 但是并不需要升级, 也不影响其他 需要升级的数据库设备, 那么也可以不对这些数据库进行升级;  The upgrade control device confirms the database device to be upgraded according to the database version information returned by the upgrade processing device; for example, the upgrade control device needs to upgrade all the database devices to use the new database script, first query the database script currently used by the database device, if some are received The database version information returned by the upgrade processing device on the database device is the old database script used by the database device, then it is confirmed that these database devices need to be upgraded; if some database devices use the old database script, but do not need to upgrade, It does not affect other database devices that need to be upgraded, so you can not upgrade these databases.
步骤 504: 升级控制装置向升级处理装置发送新数据库脚本; 升级控制装置向需要升级的一个或者多个数据库设备上的升级处理装 置发送新数据库脚本; 如果升级控制装置与升级处理装置之间的带宽有限, 升级控制装置可以将新数据库脚本进行压缩后再发送给升级处理装置; 步骤 505: 升级处理装置接收并保存新数据库脚本; Step 504: The upgrade control device sends a new database script to the upgrade processing device; and the upgrade control device loads the upgrade process on one or more database devices that need to be upgraded. Sending a new database script; if the bandwidth between the upgrade control device and the upgrade processing device is limited, the upgrade control device may compress the new database script and then send it to the upgrade processing device; Step 505: The upgrade processing device receives and saves the new database script ;
数据库设备上的升级处理装置接收并保存新数据库脚本到本地存储介 质中, 同时升级处理装置还保存有旧数据库脚本;  The upgrade processing device on the database device receives and saves the new database script to the local storage medium, and the upgrade processing device also stores the old database script;
步骤 506: 升级处理装置向升级控制装置返回存储结果;  Step 506: The upgrade processing device returns a storage result to the upgrade control device.
数据库设备上的升级处理装置向升级控制装置返回新数据库脚本存储 结果;  The upgrade processing device on the database device returns a new database script storage result to the upgrade control device;
步骤 507: 升级控制装置向存储成功的升级处理装置发送升级请求; 升级控制装置根据接收到的存储结果, 向成功接收并存储新数据库脚 本的升级处理装置发送升级请求。 对于保存新数据库脚本失败或者在第一 预设时间内未返回存储结果的升级处理装置, 升级控制装置可以釆用重发 机制, 在第二预设时间之后再向上述升级处理装置重新发送新数据库脚本; 步骤 508: 升级处理装置根据新数据库脚本创建新增的数据对象; 升级处理装置比较升级后的新数据库脚本和升级前的旧数据库脚本是 否兼容, 分析出新数据库脚本新增的数据对象, 同时使用旧数据库脚本处 理来自业务 /应用的数据访问请求, 保证业务 /应用访问数据库的请求能被正 常处理。  Step 507: The upgrade control device sends an upgrade request to the upgrade processing device that is successfully stored. The upgrade control device sends an upgrade request to the upgrade processing device that successfully receives and stores the new database script according to the received storage result. For the upgrade processing device that fails to save the new database script or does not return the storage result within the first preset time, the upgrade control device may use the retransmission mechanism to resend the new database to the upgrade processing device after the second preset time. Step 508: The upgrade processing device creates a new data object according to the new database script; the upgrade processing device compares whether the upgraded new database script and the old database script before the upgrade are compatible, and analyzes the new data object added by the new database script. At the same time, the old database script is used to process the data access request from the service/application, and the request for the service/application access to the database can be processed normally.
在分析新数据库脚本成功并且判断新旧数据库脚本兼容后, 升级处理 装置创建新增的数据对象, 升级所在数据库设备的数据库, 在创建新增数 据对象的同时, 使用旧数据库脚本处理来自业务 /应用的数据访问请求; 步骤 509: 升级处理装置切换数据库脚本;  After analyzing the new database script successfully and judging the compatibility of the old and new database scripts, the upgrade processing device creates a new data object, upgrades the database of the database device in which it is located, and uses the old database script to process the service/application from the same time while creating the new data object. Data access request; Step 509: The upgrade processing device switches the database script;
升级成功后, 升级处理装置使用新数据库脚本处理自业务 /应用的数据 访问请求;  After the upgrade is successful, the upgrade processing device processes the data access request from the business/application using the new database script;
步骤 510: 升级处理装置向升级控制装置返回升级结果。 在步骤 508 中, 如果升级处理装置分析新数据库失败或者新旧数据库 脚本不兼容, 或者升级处理装置创建新增数据对象失败, 升级处理装置会 向升级控制装置返回为升级失败的升级结果, 否则返回为升级成功的升级 结果。 Step 510: The upgrade processing device returns an upgrade result to the upgrade control device. In step 508, if the upgrade processing device fails to analyze the new database or the new and old database scripts are incompatible, or the upgrade processing device fails to create a new data object, the upgrade processing device returns an upgrade result of the upgrade failure to the upgrade control device, otherwise returns Upgrade successful upgrade results.
如果升级过程中出现部分数据库设备升级失败, 也就是升级控制装置 在向升级处理装置发送升级请求之后, 在第三预设时间内未接收到部分升 级处理装置返回的升级结果或者接收到部分升级处理装置返回的为升级失 败的升级结果, 则需要进行如下步骤:  If some database device upgrade fails during the upgrade process, that is, after the upgrade control device sends the upgrade request to the upgrade processing device, the upgrade result returned by the partial upgrade processing device is not received or the partial upgrade process is received within the third preset time. If the device returns an upgrade result that fails to be upgraded, you need to perform the following steps:
步骤 511 : 升级控制装置向升级成功的升级处理装置发送回退请求; 在部分数据库升级失败后, 升级控制装置向升级成功的数据库设备的 退请求;  Step 511: The upgrade control device sends a fallback request to the upgraded upgrade processing device; after the partial database upgrade fails, the upgrade control device returns a request to the upgraded database device;
步骤 512: 升级处理装置切换数据库脚本, 并删除新创建的数据对象; 升级处理装置接收到回退请求后, 把处理业务 /应用的数据访问请求切 换为升级前的旧数据库脚本, 自动删除升级后创建的新增数据对象;  Step 512: The upgrade processing device switches the database script and deletes the newly created data object. After receiving the fallback request, the upgrade processing device switches the data access request of the processing service/application to the old database script before the upgrade, and automatically deletes the upgraded file. New data object created;
步骤 513 : 升级处理装置向升级控制装置返回回退结果。  Step 513: The upgrade processing device returns a rollback result to the upgrade control device.
其中, 在升级前后或者升级过程中, 升级控制装置均可以向升级处理 装置查询数据库设备的版本信息, 升级处理装置查询数据库版本信息后返 回给升级控制装置。  The upgrade control device may query the upgrade processing device for the version information of the database device before and after the upgrade or the upgrade process, and the upgrade processing device queries the database version information and returns the information to the upgrade control device.
本实施例的分布式数据库升级的方法, 可以实现分布式数据库的多个 数据库设备上的数据库集中升级, 避免多个数据库设备数据不一致的问题。 并且在升级过程中, 升级处理装置同时保存升级前后的至少 2份数据库脚 本, 升级处理装置在创建升级后的新的数据对象过程中并不切换数据库脚 本, 这样在升级过程中仍然可以使用升级前的数据库脚本处理数据访问请 求, 从而实现在升级的过程中业务不中断, 保证数据访问质量。 所述方法实施例是与所述装置实施例相对应的, 在方法实施例中未详 细描述的部分参照装置实施例中相关部分的描述即可, 在装置实施例中未 详细描述的部分参照方法实施例中相关部分的描述即可。 The distributed database upgrade method in this embodiment can implement centralized upgrade of databases on multiple database devices of a distributed database, thereby avoiding the problem of inconsistent data of multiple database devices. And during the upgrade process, the upgrade processing device saves at least two database scripts before and after the upgrade, and the upgrade processing device does not switch the database script during the process of creating the upgraded new data object, so that the upgrade process can still be used before the upgrade process. The database script processes the data access request, so that the service is not interrupted during the upgrade process, and the data access quality is guaranteed. The method embodiment is corresponding to the device embodiment, and the portion not described in detail in the method embodiment may refer to the description of the relevant part in the device embodiment, and the partial reference method not described in detail in the device embodiment. The description of the relevant parts in the embodiment can be.
本领域普通技术人员可以理解, 实现上述实施例方法中的全部或部分 步骤是可以通过程序来指令相关的硬件来完成, 所述的程序可以存储于一 计算机可读取存储介质中, 该程序在执行时, 包括如上述方法实施例的步 骤,所述的存储介质,如:磁碟、光盘、只读存储记忆体(Read-Only Memory, ROM )或随机存储记忆体 ( Random Access Memory, RAM )等。  It will be understood by those skilled in the art that all or part of the steps of the foregoing embodiments may be implemented by a program to instruct related hardware, and the program may be stored in a computer readable storage medium. When executed, the method includes the steps of the foregoing method embodiment, such as: a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM). Wait.
在本发明各方法实施例中, 所述各步骤的序号并不能用于限定各步骤 的先后顺序, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提 下, 对各步骤的先后变化也在本发明的保护范围之内。  In the method embodiments of the present invention, the sequence numbers of the steps are not used to limit the sequence of the steps. For those skilled in the art, the steps of the steps are changed without any creative work. It is also within the scope of the invention.
以上所述是本发明的优选实施方式, 应当指出, 对于本技术领域的普 通技术人员来说, 在不脱离本发明所述原理的前提下, 还可以作出若干改 进和润饰, 这些改进和润饰也应视为本发明的保护范围。  The above is a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. It should be considered as the scope of protection of the present invention.

Claims

权利要求书 Claim
1. 一种分布式数据库升级的方法, 其特征在于, 所述分布式数据库包 括至少两个数据库设备, 每个数据库设备上部署有升级处理装置, 所述方 法包括:  A method for upgrading a distributed database, wherein the distributed database includes at least two database devices, and each database device is provided with an upgrade processing device, and the method includes:
所述升级处理装置接收并存储升级控制装置发送的第一数据库脚本, 并根据所述第一数据库脚本创建新的数据对象, 升级所述数据库设备的数 据库;  The upgrade processing device receives and stores a first database script sent by the upgrade control device, and creates a new data object according to the first database script, and upgrades the database of the database device;
升级成功后, 所述升级处理装置将当前所使用的数据库脚本从第二数 据库脚本切换为所述第一数据库脚本; 所述第二数据库脚本为升级成功之 前用于处理数据访问请求的数据库脚本。  After the upgrade is successful, the upgrade processing device switches the currently used database script from the second database script to the first database script; the second database script is a database script for processing the data access request before the upgrade succeeds.
2. 根据权利要求 1所述的方法, 其特征在于, 所述升级处理装置接收 并存储升级控制装置发送的第一数据库脚本之前, 该方法还包括:  The method according to claim 1, wherein before the upgrading processing device receives and stores the first database script sent by the upgrade control device, the method further includes:
所述升级处理装置接收所述升级控制装置发送的数据库脚本查询请 求, 并向所述升级控制单元返回第二数据库脚本。  The upgrade processing device receives a database script query request sent by the upgrade control device, and returns a second database script to the upgrade control unit.
3. 根据权利要求 1所述的方法, 其特征在于, 所述升级处理装置将数 据库脚本从第二数据库脚本切换为所述第一数据库脚本之后, 该方法还包 括:  The method according to claim 1, wherein after the upgrading processing device switches the database script from the second database script to the first database script, the method further includes:
若接收到数据访问请求, 所述升级处理装置使用所述第一数据库脚本 处理所述数据访问请求。  Upon receiving the data access request, the upgrade processing device processes the data access request using the first database script.
4. 根据权利要求 1至 3任一项所述的方法, 其特征在于, 所述升级处 理装置将数据库脚本从第二数据库脚本切换为所述第一数据库脚本之后, 该方法还包括:  The method according to any one of claims 1 to 3, wherein after the upgrading processing device switches the database script from the second database script to the first database script, the method further includes:
所述升级处理装置向所述升级控制装置返回升级结果。  The upgrade processing device returns an upgrade result to the upgrade control device.
5. 根据权利要求 4所述的方法, 其特征在于, 所述升级处理装置向所 述升级控制装置返回升级结果之后, 该方法还包括: 升级成功的数据库对应的升级处理装置接收所述升级控制装置发送的 回退请求; The method according to claim 4, wherein, after the upgrade processing device returns an upgrade result to the upgrade control device, the method further includes: The upgrade processing device corresponding to the upgraded database receives the fallback request sent by the upgrade control device;
所述升级处理装置根据收到的回退请求, 将当前所使用的数据库脚本 从所述第一数据库脚本切换为所述第二数据库脚本, 并删除所述新创建的 数据对象。  The upgrade processing device switches the currently used database script from the first database script to the second database script according to the received fallback request, and deletes the newly created data object.
6. 一种升级处理装置, 其特征在于, 部署在分布式数据库的数据库设 备上, 所述装置包括:  An upgrade processing device, which is deployed on a database device of a distributed database, the device comprising:
接收模块, 用于接收升级控制装置发送的第一数据库脚本;  a receiving module, configured to receive a first database script sent by the upgrade control device;
升级模块, 用于根据所述第一数据库脚本创建新的数据对象, 升级所 述数据库设备的数据库;  An upgrade module, configured to create a new data object according to the first database script, and upgrade a database of the database device;
切换模块, 用于在升级成功后, 将当前所使用的数据库脚本从第二数 据库脚本切换为所述第一数据库脚本, 所述第二数据库脚本为升级成功之 前用于处理数据访问请求的数据库脚本。  a switching module, configured to: after the upgrade succeeds, switch the currently used database script from the second database script to the first database script, where the second database script is a database script for processing the data access request before the upgrade succeeds .
7. 根据权利要求 6所述的装置, 其特征在于, 该装置还包括: 查询模块, 用于接收数据库脚本查询请求, 据此查询所述数据库设备 当前所使用的数据库脚本;  The device according to claim 6, wherein the device further comprises: a query module, configured to receive a database script query request, and query the database script currently used by the database device according to the query module;
发送模块, 用于向所述升级控制装置返回第二数据库脚本。  And a sending module, configured to return a second database script to the upgrade control device.
8. 根据权利要求 6所述的装置, 其特征在于, 该装置还包括: 处理模块, 用于在所述切换模块将数据库脚本从第二数据库脚本切换 为所述第一数据库脚本之后, 使用所述第一数据库脚本处理数据访问请求。  The device according to claim 6, wherein the device further comprises: a processing module, configured to: after the switching module switches the database script from the second database script to the first database script, The first database script processes the data access request.
9. 根据权利要求 6至 8任一项所述的装置, 其特征在于, 该装置还包 括:  9. Apparatus according to any one of claims 6 to 8, wherein the apparatus further comprises:
接收回退请求模块, 用于在升级成功后, 接收所述升级控制装置发送 的回退请求;  Receiving a fallback request module, configured to receive a fallback request sent by the upgrade control device after the upgrade is successful;
回退模块, 用于将当前所使用的数据库脚本从所述第一数据库脚本切 换为所述第二数据库脚本, 并删除所述新创建的数据对象。 a fallback module, configured to cut a currently used database script from the first database script Switching to the second database script and deleting the newly created data object.
10. 一种升级控制装置, 其特征在于, 用于分布式数据库的升级, 所 述分布式数据库包括至少两个数据库设备, 数据库设备上部署有升级处理 装置, 所述升级控制装置包括:  An upgrade control device, characterized in that it is used for an upgrade of a distributed database, the distributed database includes at least two database devices, and an upgrade processing device is deployed on the database device, and the upgrade control device includes:
发送模块, 用于向所述升级处理装置发送数据库脚本查询请求; 控制模块, 用于根据所述升级处理装置返回的第二数据库脚本判断出 所述数据库设备的数据库需要升级, 并控制所述发送模块向所述升级处理 装置发送用于所述数据库升级的第一数据库脚本。  a sending module, configured to send a database script query request to the upgrade processing device, and a control module, configured to determine, according to the second database script returned by the upgrade processing device, that the database of the database device needs to be upgraded, and control the sending The module sends a first database script for the database upgrade to the upgrade processing device.
11. 根据权利要求 10所述的装置, 其特征在于, 该装置还包括: 接收模块, 用于接收所述升级处理装置返回的存储结果;  The device according to claim 10, further comprising: a receiving module, configured to receive a storage result returned by the upgrade processing device;
所述发送模块, 还用于根据所述接收模块接收到的存储结果, 向存储 成功的升级处理装置发送升级请求。  The sending module is further configured to send an upgrade request to the upgraded processing device that is successfully stored according to the storage result received by the receiving module.
12. 根据权利要求 11所述的装置, 其特征在于,  12. Apparatus according to claim 11 wherein:
所述接收模块, 还用于接收所述升级处理装置返回的升级结果; 所述发送模块, 还用于根据所述接收模块接收到的升级结果, 在部分 数据库升级失败时向升级成功的升级处理装置发送回退请求。  The receiving module is further configured to receive an upgrade result returned by the upgrade processing device, where the sending module is further configured to perform an upgrade upgrade process successfully when a part of the database upgrade fails according to the upgrade result received by the receiving module. The device sends a fallback request.
PCT/CN2010/079425 2009-12-22 2010-12-03 Distributed databases upgrade method, upgrade processing device and upgrade controlling device WO2011076058A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910243455.5 2009-12-22
CN2009102434555A CN102103613B (en) 2009-12-22 2009-12-22 Distributed database upgrade method, upgrade processing device and upgrade control device

Publications (1)

Publication Number Publication Date
WO2011076058A1 true WO2011076058A1 (en) 2011-06-30

Family

ID=44156390

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/079425 WO2011076058A1 (en) 2009-12-22 2010-12-03 Distributed databases upgrade method, upgrade processing device and upgrade controlling device

Country Status (2)

Country Link
CN (1) CN102103613B (en)
WO (1) WO2011076058A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677908A (en) * 2013-12-04 2014-03-26 乐视网信息技术(北京)股份有限公司 Method and system for updating transcoding service
CN106611062A (en) * 2016-12-29 2017-05-03 北京奇虎科技有限公司 Database updating method and device
CN110519649B (en) * 2018-05-22 2022-04-19 青岛海尔多媒体有限公司 Control method and device of split television and computer readable storage medium
CN108768758A (en) * 2018-08-31 2018-11-06 郑州云海信息技术有限公司 Distributed memory system online upgrading method, apparatus, equipment and storage medium
CN110737670B (en) * 2019-10-21 2023-06-13 中国民航信息网络股份有限公司 Method, device and system for guaranteeing consistency of cluster data
CN111708792A (en) * 2020-06-16 2020-09-25 东莞中国科学院云计算产业技术创新与育成中心 Cloud platform database upgrading method and device, computer equipment and storage medium
CN112632159B (en) * 2020-12-01 2021-09-28 腾讯科技(深圳)有限公司 Database access control method and device, electronic equipment and storage medium
CN113342803B (en) * 2021-03-03 2024-03-12 中国工商银行股份有限公司 Database updating method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004227198A (en) * 2003-01-22 2004-08-12 Ricoh Co Ltd Document management device, documentation management system, and program for realizing function of the system
US7130870B1 (en) * 2000-05-20 2006-10-31 Ciena Corporation Method for upgrading embedded configuration databases
CN101009589A (en) * 2006-01-26 2007-08-01 腾讯科技(深圳)有限公司 A method and system for software upgrade

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100487701C (en) * 2006-08-02 2009-05-13 华为技术有限公司 Online updating control method and device of embedded database
CN100591022C (en) * 2007-11-29 2010-02-17 上海华为技术有限公司 Method and apparatus for implementing preactivation of batch configuration
CN101464888B (en) * 2008-12-29 2010-08-18 深圳市迈科龙电子有限公司 Smooth upgrading apparatus and method for information system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7130870B1 (en) * 2000-05-20 2006-10-31 Ciena Corporation Method for upgrading embedded configuration databases
JP2004227198A (en) * 2003-01-22 2004-08-12 Ricoh Co Ltd Document management device, documentation management system, and program for realizing function of the system
CN101009589A (en) * 2006-01-26 2007-08-01 腾讯科技(深圳)有限公司 A method and system for software upgrade

Also Published As

Publication number Publication date
CN102103613B (en) 2013-06-12
CN102103613A (en) 2011-06-22

Similar Documents

Publication Publication Date Title
WO2011076058A1 (en) Distributed databases upgrade method, upgrade processing device and upgrade controlling device
US7822718B1 (en) Restoration of archived configurations for a network device
KR100620054B1 (en) System and method of managing device for device managing technology
US20070244999A1 (en) Method, apparatus, and computer product for updating software
US20050210081A1 (en) Data synchronization method
WO2016090846A1 (en) Network version upgrade method and apparatus
CN105677380B (en) Method and device for board-by-board upgrading of double master control isolations
CN109582335B (en) Method, device and equipment for on-line upgrading of non-interrupt storage cluster nodes
CN109634638B (en) Cluster software upgrading method, device, equipment and medium
CN107395385A (en) Method for upgrading software and device
CN110650164B (en) File uploading method and device, terminal and computer storage medium
US20080183878A1 (en) System And Method For Dynamic Patching Of Network Applications
US7076645B2 (en) Method of rebooting a multi-device cluster while maintaining cluster operation
CN110620798B (en) Control method, system, equipment and storage medium for FTP connection
US8826264B1 (en) Non-disruptive upgrade of applications
WO2006057061A1 (en) Distributed transaction processing method, device, and program
US7769828B2 (en) System for provisioning time sharing option (TSO) and interactive productivity system facility (ISPF) services in a network environment
CN109189403B (en) Operating system OS batch installation method and device and network equipment
WO2021057605A1 (en) Device management method, device, system and device, and storage medium
WO2018094686A1 (en) Smb service failure handling method, and storage device
CN112104576A (en) Resident flow table storage and calibration method and system of SDN switch
CN100488129C (en) Method for processing the batch configuration and network management device and network system
JP2015114952A (en) Network system, monitoring control unit, and software verification method
JP5418070B2 (en) Business operation support method and computer apparatus
CN105765908B (en) A kind of multi-site automatic update method, client and system

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: 10838621

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: 10838621

Country of ref document: EP

Kind code of ref document: A1