Data upgrading method and device, electronic device, and computer readable medium

By receiving data upgrade requests, scanning configuration files to obtain upgrade configuration information, and automatically upgrading local data, it solves the cumbersome and erroneous operation problems of manual upgrades in the existing technology, and realizes cross-version automation and efficient service upgrades.

CN113190251BActive Publication Date: 2025-06-06BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110498748.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-08
Publication Date
2025-06-06
Estimated Expiration
2041-05-08

AI Technical Summary

Technical Problem

In the prior art, service upgrades require manual manual sorting of incremental scripts and maintenance of upgrade documents, resulting in large personnel investment, frequent misoperation, and difficulty in achieving cross-version automation upgrades.

Method used

By receiving data upgrade requests, scan the configuration file to obtain the corresponding upgrade configuration information, and automatically upgrade the local data based on this information, supporting cross-version automated upgrades.

Benefits of technology

It realizes unmanned service upgrade operation, supports one-click service upgrade, reduces personnel investment, improves upgrade efficiency, and supports any lower version to any higher version.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113190251B_ABST
    Figure CN113190251B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data upgrade method and device, which relates to the field of computer technology, and further to the field of database technology. The method includes: receiving a data upgrade request; based on the data upgrade request, scanning a configuration file, obtaining upgrade configuration information corresponding to the data upgrade request in the configuration file; based on the upgrade configuration information, performing upgrade processing on local data, and obtaining an upgrade result. This implementation realizes the automation of data upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, specifically to the field of database technology, and more particularly to a data upgrade method and device, an electronic device, a computer-readable medium, and a computer program product. Background Art

[0002] With the iteration of multiple versions of products, service upgrades are a common application scenario requirement in order to meet the actual business traffic needs of different customers. Existing upgrade services generally manually organize incremental scripts of service middleware that need to be upgraded, and manually maintain upgrade documents for each version. Due to the complexity of service deployment, involving multiple middleware and multi-module services, the manpower investment is large, and there are many errors in manual upgrades. Summary of the invention

[0003] The present disclosure provides a data upgrade method and device, an electronic device, a computer-readable medium, and a computer program product.

[0004] According to a first aspect, a data upgrade method is provided, the method comprising: receiving a data upgrade request; based on the data upgrade request, scanning a configuration file to obtain upgrade configuration information corresponding to the data upgrade request in the configuration file; based on the upgrade configuration information, performing upgrade processing on local data to obtain an upgrade result.

[0005] According to the second aspect, a data upgrade device is provided, which includes: a receiving unit, configured to receive a data upgrade request; a scanning unit, configured to scan a configuration file based on the data upgrade request, and obtain upgrade configuration information corresponding to the data upgrade request in the configuration file; an upgrading unit, configured to upgrade local data based on the upgrade configuration information, and obtain an upgrade result.

[0006] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any implementation manner of the first aspect.

[0007] According to a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, where the computer instructions are used to cause a computer to execute the method described in any implementation of the first aspect.

[0008] According to a fifth aspect, a computer program product is provided, comprising a computer program, which implements the method described in any implementation manner of the first aspect when executed by a processor.

[0009] The data upgrade method and device provided by the embodiments of the present disclosure firstly receive a data upgrade request; secondly, based on the data upgrade request, scan the configuration file to obtain the upgrade configuration information corresponding to the data upgrade request in the configuration file; finally, based on the upgrade configuration information, perform upgrade processing on the local data to obtain the upgrade result. Thus, when the upgrade service program corresponding to the data upgrade method is used for automatic upgrade, a one-click service upgrade operation is supported, and no human intervention in the upgrade process is required. Since the configuration file pre-sets the upgrade configuration information, the entire upgrade process can support cross-version automatic upgrades, and can also support any lower version to any higher version.

[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0012] Figure 1 is a flow chart of an embodiment of a data upgrade method according to the present disclosure;

[0013] Figure 2 is a flow chart of a method for upgrading local data in the present disclosure;

[0014] Figure 3 is a flow chart of another embodiment of the data upgrading method according to the present disclosure;

[0015] Figure 4 is a structural schematic diagram of an embodiment of a data upgrading device according to the present disclosure;

[0016] Figure 5 It is a block diagram of an electronic device used to implement the data upgrade method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0017] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0018] Figure 1 A process 100 according to an embodiment of a data upgrade method of the present disclosure is shown. The data upgrade method comprises the following steps:

[0019] Step 101: Receive a data upgrade request.

[0020] In this embodiment, the execution subject on which the data upgrade method runs can receive the data upgrade request through the upgrade interface, and the upgrade interface can be a RESTful (Representational State Transfer) style interface. The RESTful style is a software architecture style and design style, not a standard, but only provides a set of design principles and constraints. It is mainly used for client and server interaction software. Software designed based on this style can be more concise, more layered, and easier to implement mechanisms such as caching.

[0021] The RESTful interface provides web services to all clients through a unified set of interfaces, realizing the separation of front-end and back-end. For example, in a large system where multiple development languages ​​work together, the use of RESTful interfaces can completely ignore the development language and work together with standard interfaces.

[0022] In this embodiment, the data upgrade request includes but is not limited to: the identifier of the data to be upgraded (the data to be upgraded is one or more data in the local data), the current version, and the version requested to be upgraded; optionally, the data upgrade request may also include: the upgrade steps that need to be executed when upgrading the data to be upgraded and the parameters involved in the upgrade process, wherein the parameters may be the number of times the upgrade steps are executed, the execution environment requirements, etc.

[0023] Optionally, in this embodiment, the data upgrade request may be only an upgrade instruction, which may be an instruction triggered after the operator completes configuration or modification of the configuration file, and the execution subject determines that the upgrade configuration information related to the local data can be obtained by scanning the configuration file after receiving the upgrade instruction. The configuration file is a file used to store user information (user mailbox, user account, etc.) and upgrade configuration information, and the upgrade configuration information of the local data can be configured or modified in real time through the configuration file.

[0024] Step 102: based on the data upgrade request, scan the configuration file to obtain the upgrade configuration information corresponding to the data upgrade request in the configuration file.

[0025] In this embodiment, for various upgrade requirements, the configuration file has various types of upgrade configuration information, and each type of upgrade configuration information may correspond to different data or databases. For example, one type of upgrade configuration information is to create an upgrade step sequence, another type of upgrade configuration information is to determine the cross-version length of the upgrade version, and another type of upgrade configuration information is user information.

[0026] Optionally, for each type of upgrade configuration information, there may also be different versions of intermediate data, and after the local data is upgraded through the intermediate data of the current version, the local data corresponding to the current version is obtained. When the local data is data stored in multiple different types of databases, the middleware data may refer to data stored in different types of databases, such as mysql, elasticsearch, etc., where mysql is a relational database management system and elasticsearch is a highly scalable open source full-text search and analysis engine; different versions of intermediate data refer to each version of data being independent of other versions in all version data in the configuration file, such as v1.0, v2.0, v3.0, and v4.0, the data of the three versions are inconsistent and stored independently; it should be noted that the configuration file generally only stores version data related to the upgrade of the current version, such as upgrading from v1.0 to v3.0, that is, the data of the three versions of v1.0, v2.0, and v3.0 will be stored at the same time.

[0027] The execution subject on which the data upgrade method runs receives a data upgrade request, and can select upgrade configuration information corresponding to the data upgrade request from the configuration file according to the data upgrade request, wherein the upgrade configuration information is a configurable upgrade information for local data, and the upgrade information includes but is not limited to data types, database index configuration information, database templates, target service versions, and configuration steps, etc. In this embodiment, the data type includes: data applicable to different types of databases (such as mysql, elasticsearch, redis, etc., redis is a cross-platform non-relational database); the configuration step may refer to at least one upgrade step involved in the process of upgrading local data, for example, the upgrade step is data migration, data cleaning, etc., and the upgrade step can exist as an independent upgrade program in the configuration file. When the local data is upgraded, the upgrade program is called to execute the corresponding upgrade process; in the configuration file, the configuration step can also be the step identifier and parameters of the corresponding upgrade step, and the corresponding preset upgrade step and the parameters used when the upgrade step is executed can be obtained through the configuration step. The target service version refers to the target version to which the local data of the current version is upgraded, wherein the current version is lower than the target version. Database index configuration information refers to information for configuring the index of the database where the local data is located (for example, adding, deleting, modifying the index, etc.).

[0028] Optionally, the upgrade configuration information may have multiple different versions (e.g., v1.0, v2.0, v3.0), and each version of the upgrade configuration information has higher and lower versions, for example, v2.0 is higher than v1.0, and v3.0 is higher than v2.0. For different types of upgrade configuration information in the configuration file, each type of upgrade configuration information also has multiple different versions.

[0029] In this embodiment, the configuration file is used to manage the upgrade configuration information of different versions of the data management, and the upgrade information of each version of the local data can be flexibly configured. The configuration file is decoupled from the data upgrade method mirror executed by the execution subject, and the upgrade configuration information can be flexibly configured by using ConfigMap. ConfigMap is a resource object used to store configuration files. All configuration contents for the upgrade configuration information are stored in a distributed key-value database. The file format of the configuration file can be in json format.

[0030] Step 103: Based on the upgrade configuration information, upgrade the local data to obtain an upgrade result.

[0031] In this embodiment, after the upgrade configuration information of the configuration file is acquired, the data in the local data related to the data upgrade request or the upgrade configuration information is upgraded based on the upgrade configuration information to obtain an upgrade result.

[0032] In this embodiment, upgrading the local data includes: cleaning, screening, data migration, etc. of the actual data in the local data; upgrading the local data may also include: deploying, updating or deleting the local structure (such as a database, data engine, etc.) that manages or stores the local data.

[0033] In this embodiment, the upgrade result includes: upgrade success or upgrade failure, wherein upgrade success further includes: upgrade success between adjacent versions, cross-version upgrade success, etc., and upgrade failure further includes: upgrade failure between adjacent versions, cross-version upgrade failure, etc. Cross-version upgrade refers to upgrading the local data corresponding to the upgrade configuration of the current version to the data of a version that is not adjacent to the current version, such as upgrading the data of version v1.0 to version v4.0.

[0034] As an example, the information configured in the upgrade configuration information includes: data type, target service version, and configuration steps. Based on the upgrade configuration information, the upgrade process of the local data includes: obtaining data corresponding to the data type in the local data, and executing the upgrade steps corresponding to the configuration steps on the obtained data (the upgrade steps are a preset upgrade process), so that the obtained data is changed to the data required by the target service version. For example, after data migration and data cleaning of the v1.0 version of the mysql type in the local data, data with a target service version of v2.0 is obtained, and the data with a target service version of v2.0 is the data after the upgrade is successful.

[0035] Optionally, the configuration file has multiple versions of upgrade configuration information. Multiple different types of upgrade configuration information for the same version can be fixed as an upgrade package for the current version. The upgrade package contains all upgrade steps for upgrading local data and the upgrade order of each upgrade step. The above-mentioned upgrade processing of local data based on the upgrade configuration information includes: obtaining an upgrade package corresponding to the upgrade configuration information, executing the upgrade package, and upgrading the local data to data of the version corresponding to the upgrade package.

[0036] The data upgrade method provided by the embodiment of the present disclosure first receives a data upgrade request; secondly, based on the data upgrade request, scans the configuration file to obtain the upgrade configuration information corresponding to the data upgrade request in the configuration file; finally, based on the upgrade configuration information, performs upgrade processing on the local data to obtain the upgrade result. Therefore, when the upgrade service program corresponding to the data upgrade method is used for automatic upgrade, a one-click service upgrade operation is supported, and no human intervention in the upgrade process is required. Since the configuration file pre-sets the upgrade configuration information, the entire upgrade process can support cross-version automatic upgrades, and can also support any lower version to any higher version.

[0037] In some optional implementations of this embodiment, the upgrade configuration information has multiple versions; based on the upgrade configuration information, upgrading the local data includes: after the upgrade of the local data fails based on the current version of the upgrade configuration information, using the upgrade configuration information of an adjacent version to the current version of the upgrade configuration information to upgrade the local data.

[0038] In this optional implementation, the upgrade configuration information can support multiple versions, and because the upgrade configuration information supports multiple versions, the intermediate data of each version is parallel, and a copy of the middleware data of each version is stored. The intermediate data of each version is independent of the intermediate data of other versions. If an error occurs during the upgrade of the intermediate data of one version, it can be switched to the adjacent version data at any time.

[0039] Optionally, the upgrade configuration information or data upgrade request may also include: cross-version update. When the data upgrade request has a cross-version update and the upgrade configuration information is not set to a cross-version update, when scanning the configuration file based on the data upgrade request, the upgrade configuration information can be automatically set to support cross-version upgrades. The above-mentioned upgrade processing of local data based on the upgrade configuration information includes: after the local data upgrade fails based on the target service version in the upgrade configuration information, the upgrade configuration information of a version that is not adjacent to the target service version is used to upgrade the local data. If the target service version is 4.0, after the current v1.0 version of the data fails to be upgraded to version v4.0, after the upgrade configuration information of version v2.0 is scanned in the upgrade configuration file, the upgrade configuration information of version v2.0 is used to upgrade the local data to version v2.0.

[0040] The method for upgrading local data provided by this optional implementation supports multiple versions of the upgrade configuration information. If one version fails to upgrade, the upgrade data can be easily rolled back, reducing the risk of service downtime caused by the upgrade. At the same time, the data upgrade method provided by this embodiment also supports cross-version automated upgrades of multiple version services, saving upgrade maintenance costs.

[0041] Based on different contents of the upgrade configuration information, different ways of upgrading the local data are adopted. In some optional implementations of this embodiment, when the upgrade configuration information includes: at least one configuration step, the local data may be upgraded through the at least one configuration step. Specifically, Figure 2 A flowchart 200 of a method for upgrading local data according to the present disclosure is shown. The method for upgrading local data includes the following steps:

[0042] Step 201 : Select a target upgrade step corresponding to each configuration step from a plurality of preset upgrade steps.

[0043] In this embodiment, the upgrade step is a preset actual data update process, and each upgrade step can update the local data to the version corresponding to the upgrade step. The configuration step can be a step identifier and parameter set in the configuration file that has the same format as the configuration file and corresponds to the upgrade step one by one.

[0044] The upgrade configuration information corresponding to the data upgrade request may be provided with configuration steps corresponding to multiple upgrade steps one by one. After the operator completes the configuration of various upgrade configuration information in the configuration file, based on the upgrade configuration information corresponding to the data upgrade request, the execution subject on which the data upgrade method runs may obtain multiple configuration steps from the upgrade configuration information. Further, after obtaining multiple configuration steps, the execution subject selects the target upgrade step corresponding to each configuration step from the preset multiple upgrade steps, and actually updates the local data through the selected target upgrade step.

[0045] Step 202: determine the upgrade order corresponding to each target upgrade step.

[0046] In this embodiment, the upgrade order can set an execution order for each configuration step based on the upgrade requirements of the current local data. The execution order can be used to characterize the priority of each configuration step in all configuration steps; optionally, the upgrade order can also be the execution order of each configuration step obtained from the data upgrade request; optionally, the upgrade order can also be the configuration order configured in various types of upgrade configuration information in the configuration file; further, since the configuration steps correspond to the upgrade steps one by one, after the execution order is configured for the configuration steps, the upgrade order of the upgrade steps is also determined accordingly.

[0047] In some optional implementations of this embodiment, the upgrade configuration information also includes: the first execution order of each configuration step, and the above-mentioned determination of the upgrade order corresponding to each target upgrade step includes: obtaining the first execution order of each configuration step from the configuration file; based on the first execution order, determining the upgrade order corresponding to each target upgrade step.

[0048] In this embodiment, the upgrade configuration information in the configuration file includes: at least one configuration step and the first execution order of each configuration step. In this embodiment, the first execution order is the sorting number of each configuration step in all configuration steps. The sorting number can be used to determine the sequence of target upgrade steps corresponding to each configuration step, and the execution order of the target upgrade steps is the upgrade order corresponding to each target upgrade step. The upgrade order is the sequence of each target upgrade step in the step queue.

[0049] In this embodiment, by setting the first execution order of each configuration step in the upgrade configuration information in the configuration file, the upgrade order of each target upgrade step in the step queue is determined, thereby improving the convenience of executing each target upgrade step.

[0050] In some optional implementations of this embodiment, the upgrade configuration information also includes: a second execution order of each configuration step, and the above-mentioned determination of the upgrade order corresponding to each target upgrade step includes: obtaining the second execution order of each configuration step from the data upgrade request; based on the second execution order of each configuration step, determining the upgrade order corresponding to each target upgrade step.

[0051] In this embodiment, the data upgrade request includes: the number of at least one configuration step and the second execution order corresponding to each configuration step. The second execution order is the sorting number of each configuration step in all configuration steps. The sorting number can be used to determine the sequence of target upgrade steps corresponding to each configuration step, and the execution order of the target upgrade steps is the upgrade order corresponding to each target upgrade step. The upgrade order is the sequence of each target upgrade step in the step queue.

[0052] The number of the configuration step and the second execution order corresponding to each configuration step are set in the data upgrade request. When the configuration file fails or the configuration file cannot be modified, the configuration step can be set in real time through the data upgrade request, and then the target upgrade step corresponding to each configuration step can be selected from the preset multiple upgrade steps.

[0053] The method for setting the configuration step may be as follows: determining the configuration step of the data upgrade request from a plurality of preset upgrade configuration information corresponding to a plurality of preset numbers according to the number of the configuration step in the data upgrade request.

[0054] In this embodiment, by obtaining the execution order of each configuration step in the data upgrade request, an optional method is provided for obtaining multiple target upgrade steps, thereby ensuring the diversity of the target upgrade steps.

[0055] Step 203, sorting the selected target upgrade steps according to the upgrade order to obtain a step queue.

[0056] In this embodiment, there is at least one selected target upgrade step, and the upgrade order corresponding to the selected target upgrade step has at least one value. Each upgrade step corresponds to an upgrade order. All selected upgrade steps are sorted according to the upgrade order corresponding to each upgrade step to obtain a step queue including all selected upgrade steps.

[0057] Step 204, executing each target upgrade step in the step queue on the local data in sequence.

[0058] In this optional implementation, the step queue has at least one target upgrade step. After executing a target upgrade step in the step queue on the local data in sequence, an upgrade result for the target upgrade step will be obtained. If the upgrade result for the target upgrade step is a successful upgrade, the next upgrade step adjacent to the target upgrade step in the step queue will continue to be executed; if the upgrade result for the target upgrade step is a failed upgrade, the step queue will be stopped or the next target upgrade step adjacent to the target upgrade step in the step queue will be executed. At this time, it is necessary to record the upgrade failure of the target upgrade step.

[0059] When all target upgrade steps in the entire step queue are executed, the upgrade result of the step queue is obtained. Generally, when the upgrade results corresponding to all target upgrade steps in the step queue are all successful upgrades, the upgrade result of the step queue is that the local data upgrade is successful; when not all target upgrade steps in the step queue have the same upgrade results as successful upgrades, the upgrade result of the step queue is that the local data upgrade has failed.

[0060] Optionally, the method for upgrading local data provided in this embodiment may also include: receiving data monitoring requests for each upgrade step through a monitoring interface, the data monitoring request is used to request the status of monitoring data upgrade; when upgrading local data, outputting the upgrade results of the steps corresponding to the monitoring request.

[0061] In this optional mode, if an exception occurs during the upgrade of each target upgrade step in the step queue or the upgrade is completed normally, the execution subject on which the data upgrade method runs automatically sends emails and messages, and the recipient supports the configuration file mode, that is, the mailbox of the recipient who receives the email needs to be configured in the configuration file, and the recipient can be determined by the operator who configures the configuration file, such as the recipient is the upgrade person in charge. It should be noted that in this embodiment, the mailbox of the recipient set in the configuration file belongs to a kind of upgrade configuration information.

[0062] Optionally, after receiving the data monitoring request, the execution subject on which the data upgrade method runs also checks the execution status of the step queue in real time through the monitoring interface, including the target upgrade steps being executed or completed in the step queue, the time consumed to execute each target upgrade step, the target upgrade steps that failed to execute, etc. If the step queue supports reentry after execution fails, the target upgrade steps that have been successfully executed will be automatically skipped after re-execution.

[0063] In this optional method, during the upgrade of local data, the service upgrade does not require human attention, and the success or failure of the upgrade is automatically notified, thereby improving the real-time monitoring effect of the upgrade.

[0064] The method for upgrading local data provided by this optional implementation method, when the upgrade configuration information includes at least one configuration step, upgrades the local data according to the target upgrade step indicated by the upgrade configuration information. During the upgrade process, the local data can be upgraded automatically without human intervention, thereby reducing the amount of personnel input and saving human capital.

[0065] In some optional implementations of this embodiment, the upgrade configuration information may further include: the configuration version of each configuration step. The above step 201 may further specifically include: obtaining the current version of local data; detecting whether the configuration version of each configuration step is greater than the current version of local data; obtaining the configuration step whose configuration version is greater than the current version of local data among the configuration steps as the target configuration step; and selecting the target upgrade step corresponding to the target configuration step from the preset multiple upgrade steps.

[0066] In this optional implementation, the configuration steps and the configuration versions of the configuration steps can be configured by the operator in the configuration file, and the configuration versions of the configuration steps can also be used to determine the upgrade steps for local data that need to be upgraded and the upgrade steps for local data that do not need to be upgraded.

[0067] In this optional implementation, the target configuration step corresponds to at least one upgrade step, and the target configuration step is used to indicate the upgrade step that can be executed by the local data. When the configuration versions of all configuration steps are greater than the current version of the local data, all configuration steps are taken as target configuration steps; when the configuration versions of some configuration steps are greater than the current version of the local data, some configuration steps whose configuration versions are greater than the current version of the local data are taken as target configuration steps.

[0068] In this embodiment, a target upgrade step corresponding to a target configuration step is selected from a plurality of preset upgrade steps, an upgrade order corresponding to each target upgrade step is determined, and the selected target upgrade steps are sorted according to the upgrade order to obtain a step queue; each target upgrade step in the step queue is executed on the local data in turn.

[0069] In this embodiment, after the execution entity upgrades the local data, it can record the version of the upgrade configuration information for upgrading the local data, and use the recorded version as the current version of the local data; it should be noted that before the local data is upgraded, the version of the local data is the basic zero version.

[0070] In this embodiment, the local data is upgraded based on the current version of the local data and the configuration version of each configuration step. Only the upgrade step corresponding to the target configuration step may be used for the upgrade, thereby ensuring the effectiveness of the execution of the upgrade step.

[0071] The contents of the upgrade steps for different local data are different. In some optional implementations of this embodiment, the preset multiple upgrade steps include at least one of the following: template update, incremental update, index creation, index reconstruction, data cleaning, data migration, cache reconstruction, and cross-version update.

[0072] In this optional implementation, template update refers to updating templates of different types of databases (for example, elasticsearch); incremental update refers to updating only the parts of the local data that need to be updated when upgrading the local data, and not updating the parts that do not need to be updated or have already been updated. Incremental update is the opposite of full update; an index is a structure that sorts the values ​​of one or more columns in a database table. Creating an index refers to creating an index value for a database (for example, MySQL); rebuilding an index refers to deleting the old index in the database and re-establishing a new index; data cleaning refers to a procedure for discovering and correcting identifiable errors in local data, including checking data consistency, handling invalid values ​​and missing values, etc.; data migration is used to copy local data from one database to another; cross-version update refers to updating the local data of the current version to data of a version that is not adjacent to the current version.

[0073] In this optional implementation, the preset multiple upgrade steps can be respectively for different types of data, such as mysql, elasticsearch, redis and other types of databases. By presetting multiple upgrade steps, data upgrade, data cleaning logic, database creation, database maintenance and other tasks of different types of databases such as elasticsearch, mysql, redis and so on can be automatically performed. It should be noted that based on different types of databases, the upgrade steps selected from the preset multiple upgrade steps can be the same or different.

[0074] In this optional implementation, the preset multiple upgrade steps include data cleaning, template updating and other contents. Therefore, according to different data upgrade requests, the upgrade configuration information corresponding to the data upgrade request can be selected from the preset upgrade steps, and a step queue including at least one upgrade step can be obtained based on the upgrade configuration information, thereby ensuring one-click automatic execution of data upgrade, saving human resource costs, and greatly reducing manual operations and upgrade document steps, without the need for additional maintenance of upgrade scripts.

[0075] refer to Figure 3 , shows a process 300 according to another embodiment of the data upgrade method of the present disclosure, the data upgrade method comprises the following steps:

[0076] Step 301: Receive a data upgrade request and a data monitoring request.

[0077] In this embodiment, the data monitoring request is used to request the status of monitoring data upgrade, and the data monitoring request includes but is not limited to: the monitored data range, the monitored steps, the monitored version, etc. Optionally, the data monitoring request can also be just a monitoring instruction, which can be an instruction triggered after the operator completes the configuration or modification of the configuration file. After receiving the monitoring instruction, the execution subject queries the current execution upgrade status of the local data through the monitoring interface, including which step of the upgrade step is executed, the time consumed by the upgrade step execution, and execution failure, etc.

[0078] Step 302: based on the data upgrade request, scan the configuration file to obtain the upgrade configuration information corresponding to the data upgrade request in the configuration file.

[0079] Step 303: Based on the upgrade configuration information, upgrade the local data to obtain an upgrade result.

[0080] It should be understood that the operations and features in the above steps 301-303 correspond to the operations and features in steps 101-103 respectively. Therefore, the above descriptions of the operations and features in steps 101-103 are also applicable to steps 201-203 and will not be repeated here.

[0081] Step 304: when upgrading the local data, output the data upgrade status corresponding to the data monitoring request.

[0082] In this embodiment, based on the data monitoring request, it is determined that the client has a need to monitor the data upgrade steps. Therefore, the execution entity can send notification information related to the upgrade process to the client in real time through the monitoring interface. That is, the data upgrade method provided in this embodiment can support detailed upgrade process monitoring.

[0083] In this embodiment, the state of data upgrade is used to indicate the upgrade-related information of local data at different stages of the upgrade (start, end and upgrade process). The execution subject on which the data upgrade method runs outputs the state of data upgrade corresponding to the data monitoring request according to the data monitoring request, for example, the upgrade step being executed, the time taken to execute the current upgrade step, the execution status of the upgrade step, etc. The state of data upgrade can indicate the step of the upgrade step being executed, the time already spent, the time to be spent, the success or failure of the upgrade step, etc.

[0084] In view of the difficulty in controlling and monitoring the overall upgrade process and data rollback in traditional solutions, the data upgrade method provided in this embodiment uses configuration files to flexibly configure version information in the architecture, and supports error data rollback, version rollback and automatic monitoring of the entire service process, without the need for manual monitoring, and supports automatic email notification of the upgrade person in charge after the upgrade is completed or an error occurs. In addition, the data upgrade method provided in this embodiment can also support cross-version upgrades and support the configuration of multi-version service upgrade packages, such as from v1.0->v2.0->v3.0->v4.0.

[0085] The data upgrade method provided in this embodiment receives a data monitoring request, and when upgrading local data, sends the data upgrade status corresponding to the data monitoring request in real time, and automatically sends the upgrade result of success or failure. This automatic notification can help operators understand the actual situation during the upgrade process.

[0086] In some optional implementations of this embodiment, the data upgrade method further includes: receiving instruction information for modifying or configuring configuration file information, and modifying or configuring the upgrade configuration information in the configuration file based on the instruction information.

[0087] In this optional implementation, the instruction information may be an instruction sent by an operator through a terminal to an execution subject on which the data upgrade method is running, and the configuration file may be modified through the instruction, thereby ensuring the reliability of modifying the configuration file.

[0088] In this optional implementation, modifying the upgrade configuration information of the configuration file means further adding or deleting part or all of the content of the original upgrade configuration information on the basis of the original upgrade configuration information. Configuring the configuration file means the specific content of the upgrade configuration information obtained by setting parameters and / or configuring upgrade steps without any upgrade configuration information.

[0089] In this optional implementation, the execution subject on which the data upgrade method runs can flexibly configure and modify each configuration step in the configuration file according to the instruction information, so as to obtain the target upgrade step based on each configuration step. The process of configuring and modifying each configuration step is also the process of configuring or modifying the upgrade configuration information in the configuration file.

[0090] In this optional implementation, by modifying or configuring the content of the upgrade configuration information, a reliable data upgrade basis is provided for the upgrade of local data, and the flexibility of data upgrade is further provided on the basis of the automation of the upgrade service.

[0091] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a data upgrade device. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0092] like Figure 4 As shown, the data upgrade device 400 provided in this embodiment includes: a receiving unit 401, a scanning unit 402, and an upgrading unit 403. The receiving unit 401 can be configured to receive a data upgrade request. The scanning unit 402 can be configured to scan the configuration file based on the data upgrade request to obtain the upgrade configuration information corresponding to the data upgrade request in the configuration file. The upgrading unit 403 can be configured to upgrade the local data based on the upgrade configuration information to obtain an upgrade result.

[0093] In this embodiment, in the data upgrade device 400, the specific processing of the receiving unit 401, the scanning unit 402, and the upgrading unit 403 and the technical effects thereof can be referred to in Figure 1 The relevant descriptions of step 101, step 102, and step 103 in the corresponding embodiment are not repeated here.

[0094] In some optional implementations of this embodiment, the upgrade configuration information has multiple versions; the upgrade unit 403 includes: an upgrade module (not shown in the figure). The upgrade module is configured to upgrade the local data using the upgrade configuration information of a version adjacent to the upgrade configuration information of the current version after the upgrade of the local data fails based on the upgrade configuration information of the current version.

[0095] In some optional implementations of the present embodiment, the upgrade configuration information includes: at least one configuration step, and the upgrade unit 403 includes: a selection module (not shown in the figure), a determination module (not shown in the figure), a sorting module (not shown in the figure), and an execution module (not shown in the figure). Among them, the selection module can be configured to select the target upgrade step corresponding to each configuration step from a plurality of preset upgrade steps. The determination module can be configured to determine the upgrade order corresponding to each target upgrade step. The sorting module can be configured to sort the selected target upgrade steps according to the upgrade order to obtain a step queue. The execution module can be configured to execute each target upgrade step in the step queue on the local data in turn.

[0096] In some optional implementations of the present embodiment, the upgrade configuration information further includes: a configuration version of each configuration step, and the selection module includes: an acquisition submodule (not shown in the figure), a detection submodule (not shown in the figure), a calibration submodule (not shown in the figure), and a selection submodule (not shown in the figure). Among them, the acquisition submodule can be configured to acquire the current version of the local data. The detection submodule can be configured to detect whether the configuration version of each configuration step is greater than the current version of the local data. The calibration submodule can be configured to acquire the configuration step of each configuration step that is greater than the current version of the local data as the target configuration step. The selection submodule can be configured to select a target upgrade step corresponding to the target configuration step from a plurality of preset upgrade steps.

[0097] In some optional implementations of this embodiment, the upgrade configuration information further includes: a first execution order of each configuration step, and the determination module includes: a configuration submodule (not shown in the figure), and a first determination submodule (not shown in the figure). The configuration submodule may be configured to obtain the first execution order of each configuration step from the configuration file. The first determination submodule may be configured to determine the upgrade order corresponding to each target upgrade step based on the first execution order.

[0098] In some optional implementations of this embodiment, the data upgrade request includes: a second execution order of each configuration step, and the determination module includes: a request submodule (not shown in the figure), and a second determination submodule (not shown in the figure). The request submodule can be configured to obtain the second execution order of each configuration step from the data upgrade request. The second determination submodule can be configured to determine the upgrade order corresponding to each target upgrade step based on the second execution order of each configuration step.

[0099] In some optional implementations of this embodiment, the above-mentioned preset multiple upgrade steps include at least one of the following: template update, incremental update, index creation, index reconstruction, data cleaning, data migration, cache reconstruction, and cross-version update.

[0100] In some optional implementations of this embodiment, the apparatus 400 further includes: a monitoring unit (not shown in the figure), and a sending unit (not shown in the figure). The monitoring unit may be configured to receive a data monitoring request, and the data monitoring request is used to request the status of monitoring data upgrade. The sending unit may be configured to output the status of data upgrade corresponding to the data monitoring request when upgrading the local data.

[0101] In some optional implementations of this embodiment, the apparatus 400 further includes: an instruction unit (not shown in the figure) and a modification unit (not shown in the figure). The instruction unit is configured to receive instruction information for modifying or configuring file information. The modification unit is configured to modify or configure the upgrade configuration information in the configuration file.

[0102] The data upgrade device provided by the embodiment of the present disclosure, first, the receiving unit 401 receives the data upgrade request; secondly, the scanning unit 402 scans the configuration file based on the data upgrade request to obtain the upgrade configuration information corresponding to the data upgrade request in the configuration file; finally, the upgrade unit 403 performs upgrade processing on the local data based on the upgrade configuration information to obtain the upgrade result. Therefore, when the upgrade service program corresponding to the data upgrade method is used for automatic upgrade, a one-click service upgrade operation is supported, and no human intervention in the upgrade process is required. Since the configuration file pre-sets the upgrade configuration information, the entire upgrade process can support cross-version automatic upgrades, and can also support any low version to any high version.

[0103] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0104] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0105] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0106] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0107] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a data upgrade method. For example, in some embodiments, the data upgrade method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the data upgrade method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the data upgrade method in any other appropriate manner (e.g., by means of firmware).

[0108] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0109] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0110] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0111] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0112] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0113] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0114] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0115] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0116] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A data upgrade method, the method include: Receive data upgrade request; Based on the data upgrade request, scanning the configuration file to obtain the upgrade configuration information corresponding to the data upgrade request in the configuration file; The configuration file has multiple different types of upgrade configuration information, and each type of upgrade configuration information corresponds to a different database; The upgrade configuration information includes: at least one configuration step and a configuration version of each configuration step, wherein the configuration step is a step identifier set in the configuration file and having the same format as the configuration file and corresponding to the upgrade step one by one, and a parameter used when the upgrade step is executed; Get the current version of local data; Detect whether the configuration version of each configuration step included in the upgrade configuration information is greater than the current version of the local data; obtain the configuration step whose configuration version of each configuration step is greater than the current version of the local data as the target configuration step; select the target upgrade step corresponding to the target configuration step from the preset multiple upgrade steps; the multiple upgrade steps are respectively aimed at different types of databases, including at least one of the following: template update, incremental update, index creation, index reconstruction, data cleaning, data migration, cache reconstruction, cross-version update, and automatically perform data upgrade, data cleaning logic and database creation, and database maintenance work for different types of databases through the multiple upgrade steps; determine the upgrade order corresponding to each target upgrade step, sort the selected target upgrade steps according to the upgrade order, and obtain a step queue; execute each target upgrade step in the step queue on the local data in turn to perform upgrade processing and obtain an upgrade result.

2. The method according to claim 1, in, The upgrade configuration information has multiple versions, and also includes: After the local data fails to be upgraded based on the upgrade configuration information of the current version, the local data is upgraded using the upgrade configuration information of a version adjacent to the upgrade configuration information of the current version.

3. The method according to claim 1, in, The upgrade configuration information also includes: a first execution order of each configuration step, and the determination of the upgrade order corresponding to each target upgrade step includes: Obtaining a first execution order of each configuration step from the configuration file; Based on the first execution order, an upgrade order corresponding to each target upgrade step is determined.

4. The method according to claim 1, in, The data upgrade request includes: a second execution order of each configuration step, and the determining of the upgrade order corresponding to each target upgrade step includes: Acquire a second execution order of each configuration step from the data upgrade request; Based on the second execution order of each configuration step, an upgrade order corresponding to each target upgrade step is determined.

5. The method according to any one of claims 1 to 4, further comprising: include: receiving a data monitoring request, wherein the data monitoring request is used to request a status of monitoring data upgrade; When the local data is upgraded, a data upgrade status corresponding to the data monitoring request is output.

6. The method according to claim 5, further comprising: include: receiving instruction information for modifying or configuring file information; The upgrade configuration information in the configuration file is modified or configured based on the instruction information.

7. A data upgrading device, the device include: A receiving unit configured to receive a data upgrade request; a scanning unit configured to scan a configuration file based on the data upgrade request, and obtain upgrade configuration information corresponding to the data upgrade request in the configuration file; The configuration file has multiple different types of upgrade configuration information, and each type of upgrade configuration information corresponds to a different database; The upgrade configuration information includes: at least one configuration step and a configuration version of each configuration step, wherein the configuration step is a step identifier set in the configuration file and having the same format as the configuration file and corresponding to the upgrade step one by one, and a parameter used when the upgrade step is executed; Upgrade unit, including: The selection module is configured to: obtain the current version of local data; detect whether the configuration version of each configuration step included in the upgrade configuration information is greater than the current version of the local data; obtain the configuration step whose configuration version is greater than the current version of the local data among the configuration steps as the target configuration step; select the target upgrade step corresponding to the target configuration step from multiple preset upgrade steps; the multiple upgrade steps are respectively for different types of databases, including at least one of the following: template update, incremental update, index creation, index reconstruction, data cleaning, data migration, cache reconstruction, cross-version update, and automatically perform data upgrade, data cleaning logic and database creation, and database maintenance work for different types of databases through the multiple upgrade steps; A determination module is configured to determine an upgrade order corresponding to each target upgrade step; A sorting module is configured to sort the selected target upgrade steps according to the upgrade order to obtain a step queue; The execution module is configured to execute each target upgrade step in the step queue on the local data in sequence to perform upgrade processing and obtain an upgrade result.

8. The device according to claim 7, in, The upgrade configuration information has multiple versions; the upgrade unit also includes: The upgrade module is configured to upgrade the local data by using the upgrade configuration information of a version adjacent to the upgrade configuration information of the current version after the upgrade of the local data fails based on the upgrade configuration information of the current version.

9. The device according to claim 7, in, The upgrade configuration information also includes: a first execution order of each configuration step, and the determination module includes: A configuration submodule, configured to obtain a first execution order of each configuration step from the configuration file; The first determination submodule is configured to determine an upgrade order corresponding to each target upgrade step based on the first execution order.

10. The device according to claim 7, in, The data upgrade request includes: a second execution order of each configuration step, and the determination module includes: A request submodule, configured to obtain a second execution order of each configuration step from the data upgrade request; The second determination submodule is configured to determine the upgrade order corresponding to each target upgrade step based on the second execution order of each configuration step.

11. The device according to any one of claims 7 to 10, further comprising: include: A monitoring unit configured to receive a data monitoring request, wherein the data monitoring request is used to request a status of monitoring data upgrade; The sending unit is configured to output a data upgrade status corresponding to the data monitoring request when the local data is upgraded.

12. The device according to claim 11, further comprising: include: An instruction unit, configured to receive instruction information for modifying or configuring file information; The modification unit is configured to modify or configure the upgrade configuration information in the configuration file based on the instruction information.

13. An electronic device, It is characterized in that include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

14. A non-transitory computer-readable storage medium storing computer instructions, It is characterized in that The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.

15. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Upgrade management method, upgrade method and apparatus

    CN106817241A

  • Virtualization system upgrading method, device and equipment and computer readable storage medium

    CN110795121A

  • OTA upgrading method and device

    CN112230966A